Skip to contentSkip to conversation

USB: serial: option: adding support for ublox R410M

PATCH Applied SZ Lin (林上智) 5 participants 13 messages Apr 26, 2018 – May 2, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: serial: option: adding support for ublox R410M

This patch adds support for ublox R410M PID 0x90b2 USB modem to option driver, this module supports LTE Cat M1 / NB1.

Interface layout:
0: QCDM/DIAG
1: ADB
2: AT
3: RMNET

---

Please refer to following lsusb output:

Bus 001 Device 003: ID 05c6:90b2 Qualcomm, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x05c6 Qualcomm, Inc.
  idProduct          0x90b2
  bcdDevice            0.00
  iManufacturer           3 Qualcomm, Incorporated
  iProduct                2 Qualcomm CDMA Technologies MSM
  iSerial                 4 fb854106
  bNumConfigurations      1

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 108
bNumInterfaces 4
bConfigurationValue 1
iConfiguration 1 Qualcomm Configuration
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x86 EP 6 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0

bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)

---
 drivers/usb/serial/option.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/serial/option.c +5 -0
index f0c3612467a3..184691caee64 100644
@@ -233,6 +233,8 @@ static void option_instat_callback(struct urb *urb);
 /* These Quectel products use Qualcomm's vendor ID */
 #define QUECTEL_PRODUCT_UC20			0x9003
 #define QUECTEL_PRODUCT_UC15			0x9090
+/* These ublox products use Qualcomm's vendor ID */
+#define UBLOX_PRODUCT_R410M			0x90b2
 /* These Yuga products use Qualcomm's vendor ID */
 #define YUGA_PRODUCT_CLM920_NC5			0x9625
 
@@ -1065,6 +1067,9 @@ static const struct usb_device_id option_ids[] = {
 	/* Yuga products use Qualcomm vendor ID */
 	{ USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5),
 	  .driver_info = RSVD(1) | RSVD(4) },
+	/* ublox products use Qualcomm vendor ID */
+	{ USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M),
+	  .driver_info = RSVD(1) | RSVD(3) },
 	/* Quectel products using Quectel vendor ID */
 	{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21),
 	  .driver_info = RSVD(4) },
maintainer Applied
#1 lore raw
Quoted 11 lines · SZ Lin (林上智)

This patch adds support for ublox R410M PID 0x90b2 USB modem to option driver, this module supports LTE Cat M1 / NB1.

Interface layout:
0: QCDM/DIAG
1: ADB
2: AT
3: RMNET

Applied, thanks.

Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 10 lines · Johan Hovold
Quoted 9 lines · SZ Lin (林上智)

This patch adds support for ublox R410M PID 0x90b2 USB modem to option driver, this module supports LTE Cat M1 / NB1.

Interface layout:
0: QCDM/DIAG
1: ADB
2: AT
3: RMNET

Quoted 6 lines
Quoted 2 lines

Applied, thanks.

Johan

With a Qualcomm Device Management interface, shouldn't this modem be driven by qcserial?

/Lars
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw
Quoted 14 lines · Lars Melin
Quoted 13 lines · Johan Hovold
Quoted 11 lines · SZ Lin (林上智)

This patch adds support for ublox R410M PID 0x90b2 USB modem to option driver, this module supports LTE Cat M1 / NB1.

Interface layout:
0: QCDM/DIAG
1: ADB
2: AT
3: RMNET

Quoted 6 lines
Quoted 3 lines

Applied, thanks.

Johan

With a Qualcomm Device Management interface, shouldn't this modem be driven by qcserial?

Hmm, we already have some QCDM interfaces handled by option and qcaux so it's not that clear-cut.

Dan and Björn had a discussion about this a while back, so adding them on CC. It seems to me that this device does not fit the intended use (or Gobi 1000 layout) for qcserial, but I may be mistaken.

Thanks,
Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 22 lines · Johan Hovold
Quoted 14 lines · Lars Melin
Quoted 13 lines · Johan Hovold
Quoted 11 lines · SZ Lin (林上智)

This patch adds support for ublox R410M PID 0x90b2 USB modem to option driver, this module supports LTE Cat M1 / NB1.

Interface layout:
0: QCDM/DIAG
1: ADB
2: AT
3: RMNET

Quoted 6 lines
Quoted 3 lines

Applied, thanks.

Johan

With a Qualcomm Device Management interface, shouldn't this modem be driven by qcserial?

Quoted 6 lines

Hmm, we already have some QCDM interfaces handled by option and qcaux so it's not that clear-cut.

Dan and Björn had a discussion about this a while back, so adding them on CC. It seems to me that this device does not fit the intended use (or Gobi 1000 layout) for qcserial, but I may be mistaken.

tl;dr; I don't think qcserial is relevant unless a device matches one of the pre-defined layout schemes.

But I'm too new in this game to say anything about the initial intentions...

My view of the present situation is that qcserial handles interface layouts shared among many devices, while option handles interface layouts which are unique per device, and vendor+class based function mappings. But I could be wrong.

Anyway, Qualcomm based designs are definitely handled by both drivers. Using qcserial only makes sense if the interface layout matches one of the defined shared schemes, which currently are:

	QCSERIAL_G2K = 0,	/* Gobi 2000 */
	QCSERIAL_G1K = 1,	/* Gobi 1000 */
	QCSERIAL_SWI = 2,	/* Sierra Wireless */
	QCSERIAL_HWI = 3,	/* Huawei */

or if similar logic is added for a new vendor/shceme

And I see multi-vendor-id usage as the main reason for these schemes. There isn't much reason if you can make it a single match against a vendor-id.

The original Gobi devices are obviously multi-vendor, and Sierra Wireless and Huwaei are OEMs making devices for a number of laptop vendors. This causes traditional vendor-id matching to fail, as e.g. a HP device can be made by either OEMs (or others). qcserial has become a convenient way to map a long list of full device IDs to a specific OEM layout.

Bjørn
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 8 lines · Bjørn Mork

Anyway, Qualcomm based designs are definitely handled by both drivers. Using qcserial only makes sense if the interface layout matches one of the defined shared schemes, which currently are:

	QCSERIAL_G2K = 0,	/* Gobi 2000 */
	QCSERIAL_G1K = 1,	/* Gobi 1000 */
	QCSERIAL_SWI = 2,	/* Sierra Wireless */
	QCSERIAL_HWI = 3,	/* Huawei */

It seems to me that this Quectel device matches the interface layout for Gobi1K:

* Gobi 1K USB layout:
* 0: DM/DIAG (use libqcdm from ModemManager for communication)
* 1: serial port (doesn't respond)
* 2: AT-capable modem port
* 3: QMI/net
*/

/Lars
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 13 lines · Lars Melin
Quoted 8 lines · Bjørn Mork

Anyway, Qualcomm based designs are definitely handled by both drivers. Using qcserial only makes sense if the interface layout matches one of the defined shared schemes, which currently are:

    QCSERIAL_G2K = 0,    /* Gobi 2000 */
    QCSERIAL_G1K = 1,    /* Gobi 1000 */
    QCSERIAL_SWI = 2,    /* Sierra Wireless */
    QCSERIAL_HWI = 3,    /* Huawei */

It seems to me that this Quectel device matches the interface layout for Gobi1K:

Quoted 8 lines

         * Gobi 1K USB layout:
         * 0: DM/DIAG (use libqcdm from ModemManager for communication)
         * 1: serial port (doesn't respond)
         * 2: AT-capable modem port
         * 3: QMI/net
         */

/Lars

Ublox, not Quectel..
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#7 lore raw
Quoted 14 lines · Lars Melin
Quoted 13 lines · Lars Melin
Quoted 8 lines · Bjørn Mork

Anyway, Qualcomm based designs are definitely handled by both drivers. Using qcserial only makes sense if the interface layout matches one of the defined shared schemes, which currently are:

    QCSERIAL_G2K = 0,    /* Gobi 2000 */
    QCSERIAL_G1K = 1,    /* Gobi 1000 */
    QCSERIAL_SWI = 2,    /* Sierra Wireless */
    QCSERIAL_HWI = 3,    /* Huawei */

It seems to me that this Quectel device matches the interface layout for Gobi1K:

Quoted 8 lines
Quoted 6 lines

         * Gobi 1K USB layout:
         * 0: DM/DIAG (use libqcdm from ModemManager for communication)
         * 1: serial port (doesn't respond)
         * 2: AT-capable modem port
         * 3: QMI/net
         */

Ublox, not Quectel..

Yeah, but qcserial appears to select a different altsetting for the DM port for Gobi 1000, an altsetting which this particular device does not have.

I didn't re-read the full thread I referred to earlier, but I think in it, Dan mentioned Gobi 1000 device requiring firmware to be loaded too.

So if it's not a G1K device, we probably shouldn't be using qcserial even if the interface layout happens to match.

Thanks,
Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
Quoted 28 lines · Johan Hovold
Quoted 14 lines · Lars Melin
Quoted 13 lines · Lars Melin
Quoted 8 lines · Bjørn Mork

Anyway, Qualcomm based designs are definitely handled by both drivers. Using qcserial only makes sense if the interface layout matches one of the defined shared schemes, which currently are:

    QCSERIAL_G2K = 0,    /* Gobi 2000 */
    QCSERIAL_G1K = 1,    /* Gobi 1000 */
    QCSERIAL_SWI = 2,    /* Sierra Wireless */
    QCSERIAL_HWI = 3,    /* Huawei */

It seems to me that this Quectel device matches the interface layout for Gobi1K:

Quoted 8 lines
Quoted 6 lines

         * Gobi 1K USB layout:
         * 0: DM/DIAG (use libqcdm from ModemManager for communication)
         * 1: serial port (doesn't respond)
         * 2: AT-capable modem port
         * 3: QMI/net
         */

Ublox, not Quectel..

Yeah, but qcserial appears to select a different altsetting for the DM port for Gobi 1000, an altsetting which this particular device does not have.

Quoted 8 lines

I didn't re-read the full thread I referred to earlier, but I think in it, Dan mentioned Gobi 1000 device requiring firmware to be loaded too.

So if it's not a G1K device, we probably shouldn't be using qcserial even if the interface layout happens to match.

Thanks,
Johan

Good point, I forgot about the required firmware loading for Gobi1K. So this device should be handled by the option driver.

/Lars
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#9 lore raw
Quoted 20 lines · Lars Melin
Quoted 19 lines · Johan Hovold
Quoted 6 lines · Lars Melin
Quoted 5 lines · Lars Melin
Quoted 4 lines · Bjørn Mork

Anyway, Qualcomm based designs are definitely handled by both drivers. Using qcserial only makes sense if the interface layout matches one of the defined shared schemes, which currently are:

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

    QCSERIAL_G2K = 0,    /* Gobi 2000 */
    QCSERIAL_G1K = 1,    /* Gobi 1000 */
    QCSERIAL_SWI = 2,    /* Sierra Wireless */
    QCSERIAL_HWI = 3,    /* Huawei */

It seems to me that this Quectel device matches the interface layout for Gobi1K:

Yeah, but qcserial appears to select a different altsetting for the DM port for Gobi 1000, an altsetting which this particular device does not have.

Quoted 8 lines
Quoted 5 lines

I didn't re-read the full thread I referred to earlier, but I think in it, Dan mentioned Gobi 1000 device requiring firmware to be loaded too.

So if it's not a G1K device, we probably shouldn't be using qcserial even if the interface layout happens to match.

Good point, I forgot about the required firmware loading for Gobi1K. So this device should be handled by the option driver.

Yeah, we probably should document all of this at some point. :)

I didn't include the patch in this weeks -rc updates, but I've queued it up for the next batch.

Thanks everyone.

Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw
Quoted 37 lines · Johan Hovold
Quoted 29 lines · Lars Melin
Quoted 28 lines · Johan Hovold
Quoted 8 lines · Lars Melin
Quoted 7 lines · Lars Melin
Quoted 6 lines · Bjørn Mork

Anyway, Qualcomm based designs are definitely handled by both drivers.
Using qcserial only makes sense if the interface layout matches one of
the defined shared schemes, which currently are:

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
     QCSERIAL_G2K = 0,    /* Gobi 2000 */
     QCSERIAL_G1K = 1,    /* Gobi 1000 */
     QCSERIAL_SWI = 2,    /* Sierra Wireless */
     QCSERIAL_HWI = 3,    /* Huawei */

It seems to me that this Quectel device matches the interface layout for
Gobi1K:

Yeah, but qcserial appears to select a different altsetting for the DM
port for Gobi 1000, an altsetting which this particular device does not
have.

I didn't re-read the full thread I referred to earlier, but I think in
it, Dan mentioned Gobi 1000 device requiring firmware to be loaded too.

Quoted 6 lines
Quoted 3 lines

So if it's not a G1K device, we probably shouldn't be using qcserial
even if the interface layout happens to match.

Good point, I forgot about the required firmware loading for Gobi1K.
So this device should be handled by the option driver.

Quoted 5 lines

Yeah, we probably should document all of this at some point. :)

I didn't include the patch in this weeks -rc updates, but I've queued it
up for the next batch.

Option is likely the right driver for this device.

qcaux was mainly for mobile phones that have a TTY (often cdc-acm) as the modem port and a secondary DIAG/DM port driven by qcaux. The DM port doesn't have an interrupt endpoint thus it's not a normal modem port requiring the larger buffers of option and its control signaling.

qcserial (as Bjorn mentioned) is only for actual Gobi-type devices with the specific layouts and the firmware loading requirement where the 1K and 2K devices start in a special 1-port mode waiting for firmware and then become 4-port devices on firmware reboot.

Dan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw

<snip>

Quoted 8 lines

Option is likely the right driver for this device.

qcaux was mainly for mobile phones that have a TTY (often cdc-acm) as the modem port and a secondary DIAG/DM port driven by qcaux. The DM port doesn't have an interrupt endpoint thus it's not a normal modem port requiring the larger buffers of option and its control signaling.

Quoted 5 lines

qcserial (as Bjorn mentioned) is only for actual Gobi-type devices with the specific layouts and the firmware loading requirement where the 1K and 2K devices start in a special 1-port mode waiting for firmware and then become 4-port devices on firmware reboot.

Dan

Thank you all. I believe that many people are confused in selecting serial driver (option and qcserial) for QUALCOMM based module. This thread has provided clearly and properly presented the different between them.

SZ

maintainer
#12 lore raw
In reply to Dan Williams
Quoted 46 lines · Dan Williams
Quoted 29 lines · Johan Hovold
Quoted 28 lines · Lars Melin
Quoted 26 lines · Johan Hovold
Quoted 7 lines · Lars Melin
Quoted 6 lines · Lars Melin
Quoted 5 lines · Bjørn Mork

Anyway, Qualcomm based designs are definitely handled by both drivers. Using qcserial only makes sense if the interface layout matches one of the defined shared schemes, which currently are:

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
     QCSERIAL_G2K = 0,    /* Gobi 2000 */
     QCSERIAL_G1K = 1,    /* Gobi 1000 */
     QCSERIAL_SWI = 2,    /* Sierra Wireless */
     QCSERIAL_HWI = 3,    /* Huawei */

It seems to me that this Quectel device matches the interface layout for Gobi1K:

Yeah, but qcserial appears to select a different altsetting for the DM port for Gobi 1000, an altsetting which this particular device does not have.

I didn't re-read the full thread I referred to earlier, but I think in it, Dan mentioned Gobi 1000 device requiring firmware to be loaded too.

So if it's not a G1K device, we probably shouldn't be using qcserial even if the interface layout happens to match.

Quoted 8 lines
Quoted 3 lines

Good point, I forgot about the required firmware loading for Gobi1K.
So this device should be handled by the option driver.

Yeah, we probably should document all of this at some point. :)

I didn't include the patch in this weeks -rc updates, but I've queued it up for the next batch.

Option is likely the right driver for this device.

qcaux was mainly for mobile phones that have a TTY (often cdc-acm) as the modem port and a secondary DIAG/DM port driven by qcaux. The DM port doesn't have an interrupt endpoint thus it's not a normal modem port requiring the larger buffers of option and its control signaling.

Quoted 4 lines

qcserial (as Bjorn mentioned) is only for actual Gobi-type devices with the specific layouts and the firmware loading requirement where the 1K and 2K devices start in a special 1-port mode waiting for firmware and then become 4-port devices on firmware reboot.

Thanks for that summary. I've applied SZ's patch now.

Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html