Re: [rfc] Propagate manufacturer information from MMKernelDevice to MMBroadbandModem

2017-10-04 Thread Ben Chan
On Wed, Oct 4, 2017 at 4:51 AM, Bjørn Mork  wrote:
> Ben Chan  writes:
>
>> * The few MBIM modems I have report the correct manufacturer through
>> the manufacturer string descriptor, but I suspect some MBIM modems
>> don't.
>
> FWIW, this is true for all the MBIM modems I've used so far too.  Few
> vendors manage to write their name in a consistent way, but I guess that
> is the same regardless of the source.
>

Hi Bjørn, thanks for checking and providing the list :)

> bjorn@miraculix:/var/tmp/usb$ for f in `grep -l 'CDC MBIM' */lsusb.txt`;
do echo -n "$f: "; grep Manu $f; done
> 0bdb:1926/lsusb.txt:   iManufacturer   1 Lenovo
> 1199:68a2/lsusb.txt:   iManufacturer   4 Sierra Wireless,
Incorporated
> 1199:9041/lsusb.txt:   iManufacturer   1 Sierra Wireless,
Incorporated
> 1199:9079/lsusb.txt:   iManufacturer   1 Sierra Wireless,
Incorporated
> 1199:a001/lsusb.txt:   iManufacturer   1 Sierra Wireless Inc.
> 12d1:1446/lsusb.txt:   iManufacturer   4 Huawei Technologies
> 12d1:157d/lsusb.txt:   iManufacturer   1 HUAWEI_MOBILE
> 12d1:15bb/lsusb.txt:   iManufacturer   6 Huawei Technologies Co.,
Ltd.
> 2001:7d01/lsusb.txt:   iManufacturer   9 D-Link,Inc
> 258d:e000/lsusb.txt:   iManufacturer   1 Sequans Communications
>
> What's the "correct" manufacturer, BTW?  Looking over this list, I note
> that the OEM and chipset vendors Ericsson, Intel, Qualcomm and Mediatek
> are all anonymous here.

Yeah, it's hard to tell which one is more "correct".  It's really up to the
OEMs to specify the appropriate USB vendor ID and manufacturer string
descriptor. Some may specify the chipset vendor and some may choose the
module vendor.  Some OEMs simply "rebrand" existing modules with a new
sticker on the modules but keep vendor ID and manufacturer string unchanged.

>
> The USB vendor ID gives a slightly different list, but not necessarily
> more correct:
>
> bjorn@miraculix:/var/tmp/usb$ for f in `grep -l 'CDC MBIM' */lsusb.txt`;
do echo -n "$f: "; grep idVend $f; done
> 0bdb:1926/lsusb.txt:   idVendor   0x0bdb Ericsson Business Mobile
Networks BV
> 1199:68a2/lsusb.txt:   idVendor   0x1199 Sierra Wireless, Inc.
> 1199:9041/lsusb.txt:   idVendor   0x1199 Sierra Wireless, Inc.
> 1199:9079/lsusb.txt:   idVendor   0x1199 Sierra Wireless, Inc.
> 1199:a001/lsusb.txt:   idVendor   0x1199 Sierra Wireless, Inc.
> 12d1:1446/lsusb.txt:   idVendor   0x12d1 Huawei Technologies Co.,
Ltd.
> 12d1:157d/lsusb.txt:   idVendor   0x12d1 Huawei Technologies Co.,
Ltd.
> 12d1:15bb/lsusb.txt:   idVendor   0x12d1 Huawei Technologies Co.,
Ltd.
> 2001:7d01/lsusb.txt:   idVendor   0x2001 D-Link Corp.
> 258d:e000/lsusb.txt:   idVendor   0x258d
>
>
> Bjørn
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [rfc] Propagate manufacturer information from MMKernelDevice to MMBroadbandModem

2017-10-04 Thread Ben Chan
On Wed, Oct 4, 2017 at 12:46 AM, Aleksander Morgado
 wrote:
> Hey,
>
>>
>> Unlike AT or QMI, MBIM doesn't define a standard command to query
>> manufacturer information. But the manufacturer information can often
>> be inferred from the USB vendor ID or retrieved through the
>> Manufacturer string descriptor at the USB level.
>>
>> MMBroadbandModemMbim currently uses the plugin name as the
>> manufacturer, which may not be very useful if the generic plugin is
>> used. I wonder if it makes sense to let MMBroadbandModemMbim make use
>> of the manufacturer information, if available, from MMKernelDevice.
>> Obviously, modem vendors would like us to report a proper manufacturer
>> name than 'Generic' :)
>>
>> I've put together a few patches that plumb up the logic, which you
>> check it out from this github branch:
>> https://github.com/cbchan/ModemManager/commits/mbim-manufacturer.
>> I'd like to hear your thoughts on this approach before creating a pull
>> request. In particular,
>>
>
> I personally find the idea ok.
>
>> * The few MBIM modems I have report the correct manufacturer through
>> the manufacturer string descriptor, but I suspect some MBIM modems
>> don't.
>>
>
> And the fallback back to plugin name is ok in that case.
>
>> *  I find the propagation (i.e. MMKernelDevice -> MMDevice -> MMPlugin
>> -> MMBaseModem -> MMBroadbandModemMbim) a bit involved and convoluted.
>> Perhaps there is simpler way to do that?
>>
>
> I believe you only need the API in MMKernelDevice, and then just:
>
> manufacturer = g_strdup (
> mm_kernel_device_get_physdev_manufacturer (
> mm_port_peek_kernel_device (
> MM_PORT (mm_base_modem_peek_port_mbim (MM_BASE_MODEM (self);
>
> (or something along those lines)

Thanks Aleksander. That works like a charm.

>
> --
> Aleksander
> https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [rfc] Propagate manufacturer information from MMKernelDevice to MMBroadbandModem

2017-10-04 Thread Bjørn Mork
Ben Chan  writes:

> * The few MBIM modems I have report the correct manufacturer through
> the manufacturer string descriptor, but I suspect some MBIM modems
> don't.

FWIW, this is true for all the MBIM modems I've used so far too.  Few
vendors manage to write their name in a consistent way, but I guess that
is the same regardless of the source.

bjorn@miraculix:/var/tmp/usb$ for f in `grep -l 'CDC MBIM' */lsusb.txt`; do 
echo -n "$f: "; grep Manu $f; done
0bdb:1926/lsusb.txt:   iManufacturer   1 Lenovo
1199:68a2/lsusb.txt:   iManufacturer   4 Sierra Wireless, Incorporated
1199:9041/lsusb.txt:   iManufacturer   1 Sierra Wireless, Incorporated
1199:9079/lsusb.txt:   iManufacturer   1 Sierra Wireless, Incorporated
1199:a001/lsusb.txt:   iManufacturer   1 Sierra Wireless Inc.
12d1:1446/lsusb.txt:   iManufacturer   4 Huawei Technologies
12d1:157d/lsusb.txt:   iManufacturer   1 HUAWEI_MOBILE
12d1:15bb/lsusb.txt:   iManufacturer   6 Huawei Technologies Co., Ltd.
2001:7d01/lsusb.txt:   iManufacturer   9 D-Link,Inc  
258d:e000/lsusb.txt:   iManufacturer   1 Sequans Communications

What's the "correct" manufacturer, BTW?  Looking over this list, I note
that the OEM and chipset vendors Ericsson, Intel, Qualcomm and Mediatek
are all anonymous here.

The USB vendor ID gives a slightly different list, but not necessarily
more correct:

bjorn@miraculix:/var/tmp/usb$ for f in `grep -l 'CDC MBIM' */lsusb.txt`; do 
echo -n "$f: "; grep idVend $f; done
0bdb:1926/lsusb.txt:   idVendor   0x0bdb Ericsson Business Mobile 
Networks BV
1199:68a2/lsusb.txt:   idVendor   0x1199 Sierra Wireless, Inc.
1199:9041/lsusb.txt:   idVendor   0x1199 Sierra Wireless, Inc.
1199:9079/lsusb.txt:   idVendor   0x1199 Sierra Wireless, Inc.
1199:a001/lsusb.txt:   idVendor   0x1199 Sierra Wireless, Inc.
12d1:1446/lsusb.txt:   idVendor   0x12d1 Huawei Technologies Co., Ltd.
12d1:157d/lsusb.txt:   idVendor   0x12d1 Huawei Technologies Co., Ltd.
12d1:15bb/lsusb.txt:   idVendor   0x12d1 Huawei Technologies Co., Ltd.
2001:7d01/lsusb.txt:   idVendor   0x2001 D-Link Corp.
258d:e000/lsusb.txt:   idVendor   0x258d 



Bjørn
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [rfc] Propagate manufacturer information from MMKernelDevice to MMBroadbandModem

2017-10-04 Thread Aleksander Morgado
Hey,

>
> Unlike AT or QMI, MBIM doesn't define a standard command to query
> manufacturer information. But the manufacturer information can often
> be inferred from the USB vendor ID or retrieved through the
> Manufacturer string descriptor at the USB level.
>
> MMBroadbandModemMbim currently uses the plugin name as the
> manufacturer, which may not be very useful if the generic plugin is
> used. I wonder if it makes sense to let MMBroadbandModemMbim make use
> of the manufacturer information, if available, from MMKernelDevice.
> Obviously, modem vendors would like us to report a proper manufacturer
> name than 'Generic' :)
>
> I've put together a few patches that plumb up the logic, which you
> check it out from this github branch:
> https://github.com/cbchan/ModemManager/commits/mbim-manufacturer.
> I'd like to hear your thoughts on this approach before creating a pull
> request. In particular,
>

I personally find the idea ok.

> * The few MBIM modems I have report the correct manufacturer through
> the manufacturer string descriptor, but I suspect some MBIM modems
> don't.
>

And the fallback back to plugin name is ok in that case.

> *  I find the propagation (i.e. MMKernelDevice -> MMDevice -> MMPlugin
> -> MMBaseModem -> MMBroadbandModemMbim) a bit involved and convoluted.
> Perhaps there is simpler way to do that?
>

I believe you only need the API in MMKernelDevice, and then just:

manufacturer = g_strdup (
mm_kernel_device_get_physdev_manufacturer (
mm_port_peek_kernel_device (
MM_PORT (mm_base_modem_peek_port_mbim (MM_BASE_MODEM (self);

(or something along those lines)

-- 
Aleksander
https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-simtech

2017-10-04 Thread Ben Chan
On Fri, Sep 22, 2017 at 5:05 AM, Aleksander Morgado
 wrote:
> Hey,
>
> The following branch includes several commits to port the simtech
> plugin to GTask:
> https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-simtech

lgtm w/ one nit

>
> --
> Aleksander
> https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-thuraya

2017-10-04 Thread Ben Chan
On Fri, Sep 22, 2017 at 5:09 AM, Aleksander Morgado
 wrote:
> Hey,
>
> The following branch includes several commits to port the Thuraya
> plugin to GTask
> https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-thuraya

lgtm

>
> --
> Aleksander
> https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-dell

2017-10-04 Thread Ben Chan
On Fri, Sep 22, 2017 at 5:04 AM, Aleksander Morgado
 wrote:
> Hey,
>
> This branch contains a single patch to port the Dell plugin to GTask:
> https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-dell

lgtm

>
> --
> Aleksander
> https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-via

2017-10-04 Thread Ben Chan
On Fri, Sep 22, 2017 at 5:11 AM, Aleksander Morgado
 wrote:
> Hey,
>
> The following branch contains a couple of patches to port the Via
> plugin to GTask
> https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-via

lgtm w/ some questions

>
> --
> Aleksander
> https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [review] https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-altair

2017-10-04 Thread Ben Chan
On Fri, Sep 22, 2017 at 5:08 AM, Aleksander Morgado
 wrote:
> Hey,
>
> This branch includes a commit to fully port the Altair plugin to GTask
> https://github.com/aleksander0m/ModemManager/tree/gtask-plugins-altair

lgtm

>
> --
> Aleksander
> https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


[rfc] Propagate manufacturer information from MMKernelDevice to MMBroadbandModem

2017-10-04 Thread Ben Chan
Hi Aleksander and Dan,

Unlike AT or QMI, MBIM doesn't define a standard command to query
manufacturer information. But the manufacturer information can often
be inferred from the USB vendor ID or retrieved through the
Manufacturer string descriptor at the USB level.

MMBroadbandModemMbim currently uses the plugin name as the
manufacturer, which may not be very useful if the generic plugin is
used. I wonder if it makes sense to let MMBroadbandModemMbim make use
of the manufacturer information, if available, from MMKernelDevice.
Obviously, modem vendors would like us to report a proper manufacturer
name than 'Generic' :)

I've put together a few patches that plumb up the logic, which you
check it out from this github branch:
https://github.com/cbchan/ModemManager/commits/mbim-manufacturer.
I'd like to hear your thoughts on this approach before creating a pull
request. In particular,

* The few MBIM modems I have report the correct manufacturer through
the manufacturer string descriptor, but I suspect some MBIM modems
don't.

*  I find the propagation (i.e. MMKernelDevice -> MMDevice -> MMPlugin
-> MMBaseModem -> MMBroadbandModemMbim) a bit involved and convoluted.
Perhaps there is simpler way to do that?

Thanks,
Ben
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel