[Patch] MTK plugin for MediaTek devices

Dan Williams dcbw at redhat.com
Tue Oct 8 09:59:57 PDT 2013


On Tue, 2013-10-08 at 15:22 +0800, 李晋 wrote:
> Hi,
> 1. To get current access technology, MTK device support a special command
> for getting the current connected access technology. It just return access
> tech only if PS is connected (for example, modem connect to the network
> through PPP), like GPRS/EDGE/UMTS/HSPA/LTE. BUT if modem disconnect with
> the network (for example, PPP disconnect), this command will return unknown
> access tech. Dose command like this can meet the demand of MM getting
> current access tech feature?

Yes; ModemManager can use generic code (CREG response) to determine
access technology, so my suggested approach would be to:

1) override the load_access_technologies virtual function and run the
MTK proprietary command to read access technology
2) if the proprietary command reports correct access technology, then
return that access technology
3) if the proprietary command reports "unknown" then chain up to the
parent's load_access_technology functions and let ModemManager grab the
generic access tech from the CREG response.

> 2. 6280 or 6290 don't support "AT+CMPS=?", what is this command for? If you
> mean "AT+CPMS=?"?

I did mean CPMS.  Rechecking, my 6280 device *does* support CPMS, just
not when a PIN is required.  That is expected, so ignore my comment
about CPMS.

Thanks!
Dan

> 
> 2013/9/17 Dan Williams <dcbw at redhat.com>
> 
> > On Mon, 2013-09-16 at 15:58 +0800, 李晋 wrote:
> > > Hi,
> > > 1) I fixed those style issues in this patch. I hope that there won't be
> > any
> > > style issues I missed.
> >
> > It looks good, there were only two remaining style issues and I fixed
> > them up quickly before committing.  Pushed now, thanks!
> >
> > > 2) Until now, I just find model number checking way to confirm the
> > > supported modes,
> > > I also think it's kind of weird. So I will try to sync with the AT
> > command
> > > owner of MTK
> > > with this issue.
> >
> > That would be great.  Also, is there any way to determine what the
> > current access technology is, eg GSM/GPRS/EDGE/UMTS/HSDPA/HSUPA/HSPA+
> > etc?  ModemManager can determine the generic access technology from the
> > AT+CGREG unsolicited responses, but the standard AT commands only report
> > GPRS/UMTS/LTE, they do not report EDGE/HSDPA/etc.
> >
> > > 3) I am sorry that I just can't tell you directly if "D-Link DWM-156 A5"
> > > can work with this plugin.
> > > Because we RD just have no info of what chipset owner customer use. But I
> > > have one way that may
> > > get some info of it. You can use COM port tool to send AT command
> > > "AT+EGMR=0,0" and it will
> > > reply with some like "+EGMR: "MT6276"" or "+EGMR: "MT6280"". This plugin
> > > will support these devices, and you can test with it.
> >
> > It's a MT6276-based device, and after updating the MTK udev rules, the
> > device works fine with your patches.  I was just saying that I've got a
> > device which I can test your plugin with, which is good :)
> >
> > > Any thing I should do to improve this MTK plugin, please let me know and
> > i
> > > will try to do with it.
> >
> > Just the questions about allowed modes (if possible) and access
> > technologies.  It looks like the device only provides AT commands, and
> > has no other proprietary protocol interface (like Qualcomm devices have
> > with DIAG or QMI), so I'd expect there to be some kind of AT command for
> > this information.
> >
> > One more question: my device doesn't appear to support "AT+CMPS=?", is
> > that also the case with 6280 and 6290 devices?
> >
> > Thanks again,
> > Dan
> >
> > > Best Regards!
> > >
> > > > plug-in for Modem-Manager.
> > > > I have tested it on the latest Linux distro like Ubuntu 13.04, Fedora
> > > > 18 and Debian 7.0 with MediaTek MT6280 and MT6290 devices.
> > > > The patch and debug log (use mmcli to control modem) are in the
> > > > attachments. I hope this plugin will be accept as part of MM, and I
> > > > will update it if there is any issue or MediaTek device change.
> > >
> > >
> > > 2013/9/14 Dan Williams <dcbw at redhat.com>
> > >
> > > > On Mon, 2013-09-09 at 21:07 +0800, 李晋 wrote:
> > > > > Hi,
> > > > > I am working for MediaTek and finished the first version of MTK
> > > > > plug-in for Modem-Manager.
> > > > > I have tested it on the latest Linux distro like Ubuntu 13.04, Fedora
> > > > > 18 and Debian 7.0 with MediaTek MT6280 and MT6290 devices.
> > > > > The patch and debug log (use mmcli to control modem) are in the
> > > > > attachments. I hope this plugin will be accept as part of MM, and I
> > > > > will update it if there is any issue or MediaTek device change.
> > > >
> > > > Thanks!  A couple comments:
> > > >
> > > > 1) Style issues; we try to keep a uniform code style in ModemManager.
> > > > This block shows two issues:
> > > >
> > > > +    response = mm_base_modem_at_command_finish(MM_BASE_MODEM(self),
> > res,
> > > > &error);
> > > > +    if(!response)
> > > > +    {
> > > > +        mm_dbg("Couldn't query unlock retries: '%s'", error->message);
> > > > +        goto error_ret;
> > > > +    }
> > > >
> > > > First, all functions should have a space between the function name and
> > > > the "(".  Second, the { for if/else/while/for statements goes on the
> > > > same line as the if/else/while/for.  So this should be:
> > > >
> > > > +    response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self),
> > > > res, &error);
> > > > +    if (!response) {
> > > > +        mm_dbg ("Couldn't query unlock retries: '%s'",
> > error->message);
> > > > +        goto error_ret;
> > > > +    }
> > > >
> > > > Also, arguments to continuation lines should align with the first line,
> > > > and ModemManager code only uses spaces for indentation, not tabs.  So
> > > > for example, this:
> > > >
> > > > +    if (!mm_get_int_from_match_info (match_info, 1, &pin1) ||
> > > > +       !mm_get_int_from_match_info (match_info, 2, &pin2) ||
> > > > +       !mm_get_int_from_match_info (match_info, 3, &puk1) ||
> > > > +       !mm_get_int_from_match_info (match_info, 4, &puk2))
> > > > +    {
> > > > +       g_set_error (&error,
> > > > +               MM_CORE_ERROR,
> > > > +               MM_CORE_ERROR_FAILED,
> > > > +               "Failed to parse the EPINC response: '%s'",
> > > > +               response);
> > > >
> > > > should now become:
> > > >
> > > > +    if (!mm_get_int_from_match_info (match_info, 1, &pin1) ||
> > > > +        !mm_get_int_from_match_info (match_info, 2, &pin2) ||
> > > > +        !mm_get_int_from_match_info (match_info, 3, &puk1) ||
> > > > +        !mm_get_int_from_match_info (match_info, 4, &puk2))
> > > > +    {
> > > > +       g_set_error (&error,
> > > > +                    MM_CORE_ERROR,
> > > > +                    MM_CORE_ERROR_FAILED,
> > > > +                    "Failed to parse the EPINC response: '%s'",
> > > > +                    response);
> > > >
> > > > 2) Next, is there really no command to determine what supported modes
> > > > (2g/3g/4g) the device has, other than checking the model number?
> > > > Hopefully we can ask the device what it actually supports, instead of
> > > > relying on a specific model number like in get_supported_modes_ready().
> > > >
> > > > 3) is there any way to get the current access technology (GSM, GPRS,
> > > > EDGE, UMTS, HSDPA, HSUPA, etc) that the device is using?
> > > >
> > > > Overall the patch looks pretty good, if you can clean up the style
> > > > issues then I think we could apply it and work out the other details
> > > > later.  Also, what device are you using?  I've got a D-Link DWM-156 A5
> > > > here that has a MediaTek chipset, so hopefully I can test the plugin
> > > > with it.
> > > >
> > > > Thanks!
> > > > Dan
> > > >
> > > >
> > > _______________________________________________
> > > ModemManager-devel mailing list
> > > ModemManager-devel at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
> >
> >
> >
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel




More information about the ModemManager-devel mailing list