[rfc] Propagate manufacturer information from MMKernelDevice to MMBroadbandModem

Ben Chan benchan at chromium.org
Thu Oct 5 20:33:02 UTC 2017


On Wed, Oct 4, 2017 at 12:53 PM, Ben Chan <benchan at chromium.org> wrote:
> On Wed, Oct 4, 2017 at 12:46 AM, Aleksander Morgado
> <aleksander at aleksander.es> 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.

The github branch is updated, and I created a pull request. Thanks.

>
>>
>> --
>> Aleksander
>> https://aleksander.es


More information about the ModemManager-devel mailing list