[PATCH] telit: don't require udev tags to bind devices

Carlo Lobrano c.lobrano at gmail.com
Fri Mar 24 16:08:41 UTC 2017


Hi Aleksander,

tested with HE910, LE910, LE910 V2, LE910 sv1 and everything is fine for me.

On 24 March 2017 at 15:37, Carlo Lobrano <c.lobrano at gmail.com> wrote:

> Hi,
>
> sure I can test it today or the next week
>
> BR,
> Carlo
>
> On 24 March 2017 at 14:51, Aleksander Morgado <aleksander at aleksander.es>
> wrote:
>
>> The vendor id/string based rules should already be enough to get the
>> telit plugin bind telit devices.
>>
>> This simplifies support for future Telit devices, as we wouldn't need
>> any additional change in the plugin. It also helps when working with
>> RS232 devices as the user wouldn't need to add the explicit tag to get
>> the devices bound to this plugin.
>>
>> https://bugs.freedesktop.org/show_bug.cgi?id=100373
>> ---
>>
>> Hey Carlo & Daniele,
>>
>> This patch removes the need of having an explicit ID_MM_TELIT_TAGGED to
>> flag those devices that may be grabbed by the Telit plugin.
>>
>> Could you test it with your devices to see if it works as expected?
>>
>> ---
>>  plugins/dell/77-mm-dell-port-types.rules   | 3 +--
>>  plugins/telit/77-mm-telit-port-types.rules | 9 ---------
>>  plugins/telit/mm-plugin-telit.c            | 6 ------
>>  3 files changed, 1 insertion(+), 17 deletions(-)
>>
>> diff --git a/plugins/dell/77-mm-dell-port-types.rules
>> b/plugins/dell/77-mm-dell-port-types.rules
>> index d619456c..bbb59b92 100644
>> --- a/plugins/dell/77-mm-dell-port-types.rules
>> +++ b/plugins/dell/77-mm-dell-port-types.rules
>> @@ -9,8 +9,7 @@ LABEL="mm_dell_vendorcheck"
>>  SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*",
>> ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}"
>>
>>  # DW5580 is a Dell-branded Telit modem
>> -# tag is needed here both for dynamic port recognition and minimizing
>> port probing time
>> -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81ba",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>> +# tag is needed here for dynamic port recognition
>>  ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81ba",
>> ENV{ID_MM_TELIT_PORTS_TAGGED}="1"
>>
>>  GOTO="mm_dell_port_types_end"
>> diff --git a/plugins/telit/77-mm-telit-port-types.rules
>> b/plugins/telit/77-mm-telit-port-types.rules
>> index 1b58a3d9..01538cb6 100644
>> --- a/plugins/telit/77-mm-telit-port-types.rules
>> +++ b/plugins/telit/77-mm-telit-port-types.rules
>> @@ -10,45 +10,36 @@ SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*",
>> ENV{.MM_USBIFNUM}="$attr{bInte
>>  # UC864-E, UC864-E-AUTO, UC864-K, UC864-WD, UC864-WDU
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1003",
>> ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1003",
>> ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1"
>> -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1003",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>>
>>  # UC864-G
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004",
>> ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004",
>> ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_NMEA}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004",
>> ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1"
>> -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1004",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>>
>>  # CC864-DUAL
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005",
>> ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005",
>> ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_NMEA}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005",
>> ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1"
>> -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1005",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>>
>>  # CC864-SINGLE, CC864-KPS
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1006",
>> ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1006",
>> ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1"
>> -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1006",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>>
>>  # DE910-DUAL
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010",
>> ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_TELIT_PORT_TYPE_NMEA}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010",
>> ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_TELIT_PORT_TYPE_AUX}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010",
>> ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1"
>> -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>>
>>  # CE910-DUAL
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011",
>> ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_TELIT_PORT_TYPE_MODEM}="1"
>> -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>>
>>  # HE910, UE910, UL865 (dynamic port identification supported)
>> -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021",
>> ENV{ID_MM_TELIT_PORTS_TAGGED}="1"
>>
>>  # GE910 (dynamic port identification supported)
>> -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022",
>> ENV{ID_MM_TELIT_PORTS_TAGGED}="1"
>>
>>  # LE910 V2
>> -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036",
>> ENV{ID_MM_TELIT_TAGGED}="1"
>>  ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036",
>> ENV{ID_MM_TELIT_PORTS_TAGGED}="1"
>>
>>  LABEL="mm_telit_port_types_end"
>> diff --git a/plugins/telit/mm-plugin-telit.c
>> b/plugins/telit/mm-plugin-telit.c
>> index abb87e4f..57ecd444 100644
>> --- a/plugins/telit/mm-plugin-telit.c
>> +++ b/plugins/telit/mm-plugin-telit.c
>> @@ -91,11 +91,6 @@ mm_plugin_create (void)
>>      /* Vendors: Telit */
>>      static const guint16 vendor_ids[] = { 0x1bc7, 0 };
>>      static const gchar *vendor_strings[] = { "telit", NULL };
>> -    /* Only handle TELIT tagged devices here. */
>> -    static const gchar *udev_tags[] = {
>> -        "ID_MM_TELIT_TAGGED",
>> -        NULL
>> -    };
>>      /* Custom init for port identification */
>>      static const MMAsyncMethod custom_init = {
>>          .async  = G_CALLBACK (telit_custom_init),
>> @@ -109,7 +104,6 @@ mm_plugin_create (void)
>>                        MM_PLUGIN_ALLOWED_VENDOR_IDS,     vendor_ids,
>>                        MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings,
>>                        MM_PLUGIN_ALLOWED_AT,             TRUE,
>> -                      MM_PLUGIN_ALLOWED_UDEV_TAGS,      udev_tags,
>>                        MM_PLUGIN_CUSTOM_INIT,            &custom_init,
>>                        NULL));
>>  }
>> --
>> 2.12.0
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20170324/e0534b03/attachment.html>


More information about the ModemManager-devel mailing list