USB: serial: option: add u-blox LARA-R6 01B modem
Subsystems (2)
PATCH 1/1 USB: serial: option: add u-blox LARA-R6 01B modem
The new LARA-R6 product variant identified by the "01B" string can be configured (by AT interface) in three different USB modes:
* Default mode (Vendor ID: 0x1546 Product ID: 0x1311) with 4 serial interfaces
* RmNet mode (Vendor ID: 0x1546 Product ID: 0x1312) with 4 serial interfaces and 1 RmNet virtual network interface
* CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1313) with 4 serial interface and 1 CDC-ECM virtual network interface
In default mode LARA-R6 01B exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parser/alternative functions
In RmNet mode LARA-R6 01B exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parser/alternative functions
If 4: RMNET interface
In CDC-ECM mode LARA-R6 01B exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parser/alternative functions
If 4: CDC-ECM interface
--- drivers/usb/serial/option.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/serial/option.c +5 -0
@@ -1152,6 +1152,11 @@ static const struct usb_device_id option_ids[] = { .driver_info = RSVD(4) }, { USB_DEVICE(UBLOX_VENDOR_ID, 0x1343), /* u-blox LARA-L6 (ECM) */ .driver_info = RSVD(4) }, + { USB_DEVICE(UBLOX_VENDOR_ID, 0x1311) }, /* u-blox LARA-R6 01B */ + { USB_DEVICE(UBLOX_VENDOR_ID, 0x1312), /* u-blox LARA-R6 01B (RMNET) */ + .driver_info = RSVD(4) }, + { USB_DEVICE(UBLOX_VENDOR_ID, 0x1313), /* u-blox LARA-R6 01B (ECM) */ + .driver_info = RSVD(4) },/* Quectel products using Quectel vendor ID */ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff), .driver_info = NUMEP2 },
Signature · 1 line
2.34.1
Johan Hovold
maintainerQuoted 22 lines · Davide Tronchin
The new LARA-R6 product variant identified by the "01B" string can be configured (by AT interface) in three different USB modes:
* Default mode (Vendor ID:0x1546Product ID:0x1311) with 4 serial interfaces
* RmNet mode (Vendor ID:0x1546Product ID:0x1312) with 4 serial interfaces and 1 RmNet virtual network interface
* CDC-ECM mode (Vendor ID:0x1546Product ID:0x1313) with 4 serial interface and 1 CDC-ECM virtual network interfaceIn default mode LARA-R6 01B exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parser/alternative functionsIn RmNet mode LARA-R6 01B exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parser/alternative functions
If 4: RMNET interface
Quoted 6 lines
In CDC-ECM mode LARA-R6 01B exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parser/alternative functions
If 4: CDC-ECM interface
Can you please also include the output of usb-devices for these configurations?
Quoted 11 lines
Signed-off-by Davide Tronchin <[email protected]>--- drivers/usb/serial/option.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/usb/serial/option.c +0
-0
drivers/usb/serial/option.c static const struct usb_device_id option_ids[] = { · line 1159
Quoted 8 lines
drivers/usb/serial/option.c +5
-0@@ -1152,6 +1152,11 @@ static const struct usb_device_id option_ids[] = { .driver_info = RSVD(4) }, { USB_DEVICE(UBLOX_VENDOR_ID, 0x1343), /* u-blox LARA-L6 (ECM) */ .driver_info = RSVD(4) }, + { USB_DEVICE(UBLOX_VENDOR_ID, 0x1311) }, /* u-blox LARA-R6 01B */ + { USB_DEVICE(UBLOX_VENDOR_ID, 0x1312), /* u-blox LARA-R6 01B (RMNET) */ + .driver_info = RSVD(4) }, + { USB_DEVICE(UBLOX_VENDOR_ID, 0x1313), /* u-blox LARA-R6 01B (ECM) */ + .driver_info = RSVD(4) },
These should all go above the 0x1341 PID.
I see that we used RSVD() also for the CDC interface for LARA-L6, but shouldn't it be possible to use a more exact match instead? The usb-devices output should tell.
drivers/usb/serial/option.c static const struct usb_device_id option_ids[] = { · line 1162
Quoted 3 lines
drivers/usb/serial/option.c +0
-0/* Quectel products using Quectel vendor ID */ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff), .driver_info = NUMEP2 },
Johan
Quoted 2 lines
Can you please also include the output of usb-devices for these configurations?
The first 4 interfaces of all the 3 configurations (default, RMNET, ECM) are the same.
Here below you can find debug/usb/devices file of the LARA-R6 01B module in all the USB configurations.
Default:
T: Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1546 ProdID=1311 Rev= 0.00 S: Manufacturer=u-blox S: Product=u-blox Modem S: SerialNumber=1478200b C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
RMNET:
T: Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1546 ProdID=1312 Rev= 0.00 S: Manufacturer=u-blox S: Product=u-blox Modem S: SerialNumber=1478200b C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan E: Ad=88(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
ECM:
T: Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 9 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=1546 ProdID=1313 Rev= 0.00 S: Manufacturer=u-blox S: Product=u-blox Modem S: SerialNumber=1478200b C:* #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 4 IfCount= 2 Cls=02(comm.) Sub=00 Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=88(I) Atr=03(Int.) MxPS= 64 Ivl=2ms I: If#= 5 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
Quoted 1 line
These should all go above the
0x1341PID.
Thank you for your indication. In patch V2 i will provide this change.
Quoted 3 lines
I see that we used
RSVD()also for the CDC interface for LARA-L6, but shouldn't it be possible to use a more exact match instead? The usb-devices output should tell.
Probably USB_DEVICE_AND_INTERFACE_INFO would not match LARA-R6 01B serial composition since R6 01B has:
- Diagnostic
Cls=ff(vend.) Sub=ff Prot=30
- all the other serial interfaces Cls=ff(vend.) Sub=ff Prot=ff
Could you kindly offer any recommendations? Maybe USB_DEVICE_INTERFACE_CLASS ca be used instead of USB_DEVICE_AND_INTERFACE_INFO.
Johan Hovold
maintainerQuoted 7 lines · Davide Tronchin
Quoted 2 lines
Can you please also include the output of usb-devices for these configurations?
The first 4 interfaces of all the 3 configurations (default, RMNET, ECM) are the same.
Here below you can find debug/usb/devices file of the LARA-R6 01B module in all the USB configurations.
Thanks, can you include this in the commit message for v2 as well?
Quoted 38 lines
ECM:
T: Bus=01 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 9 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=1546 ProdID=1313 Rev= 0.00 S: Manufacturer=u-blox S: Product=u-blox Modem S: SerialNumber=1478200b C:* #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 4 IfCount= 2 Cls=02(comm.) Sub=00 Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=88(I) Atr=03(Int.) MxPS= 64 Ivl=2ms I: If#= 5 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0msQuoted 3 lines
I see that we used
RSVD()also for the CDC interface for LARA-L6, but shouldn't it be possible to use a more exact match instead? The usb-devices output should tell.Probably
USB_DEVICE_AND_INTERFACE_INFOwould not match LARA-R6 01B serial composition since R6 01B has:
- Diagnostic
Quoted 6 lines
Cls=ff(vend.) Sub=ff Prot=30- all the other serial interfaces Cls=ff(vend.) Sub=ff Prot=ff
Could you kindly offer any recommendations? MaybeUSB_DEVICE_INTERFACE_CLASSca be used instead ofUSB_DEVICE_AND_INTERFACE_INFO.
Right, I had USB_DEVICE_INTERFACE_CLASS() in mind for the ECM configuration. That should avoid the need for RSVD().
Johan
Quoted 6 lines
Quoted 4 lines
The first 4 interfaces of all the 3 configurations (default, RMNET, ECM) are the same.
Here below you can find debug/usb/devices file of the LARA-R6 01B module in all the USB configurations.Thanks, can you include this in the commit message for v2 as well?
Sure.
Quoted 2 lines
Right, I had
USB_DEVICE_INTERFACE_CLASS()in mind for the ECM configuration. That should avoid the need forRSVD().
If possible, i would use USB_DEVICE_INTERFACE_CLASS() for all the R6 01B USB configurations. Something like:
{ USB_DEVICE_INTERFACE_CLASS(UBLOX_VENDOR_ID, 0x1311, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(UBLOX_VENDOR_ID, 0x1312, 0xff),
.driver_info = RSVD(4) },
{ USB_DEVICE_INTERFACE_CLASS(UBLOX_VENDOR_ID, 0x1313, 0xff) },
Reservation is required for RMNET on port 4, as the RMNET port also has USB interface class 255:
If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
What do you think?
Davide
Johan Hovold
maintainerQuoted 20 lines · Davide Tronchin
Quoted 6 lines
Quoted 4 lines
The first 4 interfaces of all the 3 configurations (default, RMNET, ECM) are the same.
Here below you can find debug/usb/devices file of the LARA-R6 01B module in all the USB configurations.Thanks, can you include this in the commit message for v2 as well?
Sure.
Quoted 2 lines
Right, I had
USB_DEVICE_INTERFACE_CLASS()in mind for the ECM configuration. That should avoid the need forRSVD().If possible, i would use
USB_DEVICE_INTERFACE_CLASS()for all the R6 01B USB configurations. Something like:{
USB_DEVICE_INTERFACE_CLASS(UBLOX_VENDOR_ID, 0x1311, 0xff)}, {USB_DEVICE_INTERFACE_CLASS(UBLOX_VENDOR_ID, 0x1312, 0xff),
.driver_info = RSVD(4) },
{USB_DEVICE_INTERFACE_CLASS(UBLOX_VENDOR_ID, 0x1313, 0xff)},
Quoted 7 lines
Reservation is required for RMNET on port 4, as the RMNET port also has USB interface class 255:
If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
What do you think?
That should work, but I don't think you should use more specific matching than required either. So I'd suggest sticking with USB_DEVICE() for the other two configurations.
Johan