Re: [PATCH v2] usb: cdc-wdm: Add device-id for Huawei 3G/LTE modems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2012-01-21 at 22:53 +0100, Bjørn Mork wrote:
> [v2: Editorial changes suggested by Sergei Shtylyov]
> 
> These modems use the Qualcomm MSM Interface (QMI) protocol for
> management of their CDC ECM like wwan interface.  This driver
> is perfect for exporting the protocol to userspace.
> 
> The created character device will be indistinguishable from a
> common AT command based Device Management interface, so
> userspace applications must do some intelligent matching
> on the USB device.
> 
> Cc: Sergei Shtylyov <sshtylyov@xxxxxxxxxx>
> Signed-off-by: Bjørn Mork <bjorn@xxxxxxx>
> ---
> As Marcel pointed out, this is the only change which is really
> required to have support for this modem and start developing
> QMI applications.  Please note that this should only be applied 
> after the patch titled
> 
>  USB: cdc-wdm: Avoid hanging on interface with no USB_CDC_DMM_TYPE
> 
> which, unless I've misunderstood something, should already be 
> accepted both for next and stable.
> 
> 
> Thanks,
> Bjørn
> 
>  drivers/usb/class/cdc-wdm.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
> index 8faa2f7..f63601a 100644
> --- a/drivers/usb/class/cdc-wdm.c
> +++ b/drivers/usb/class/cdc-wdm.c
> @@ -31,6 +31,8 @@
>  #define DRIVER_AUTHOR "Oliver Neukum"
>  #define DRIVER_DESC "USB Abstract Control Model driver for USB WCM Device Management"
>  
> +#define HUAWEI_VENDOR_ID	0x12D1
> +
>  static const struct usb_device_id wdm_ids[] = {
>  	{
>  		.match_flags = USB_DEVICE_ID_MATCH_INT_CLASS |
> @@ -38,6 +40,20 @@ static const struct usb_device_id wdm_ids[] = {
>  		.bInterfaceClass = USB_CLASS_COMM,
>  		.bInterfaceSubClass = USB_CDC_SUBCLASS_DMM
>  	},
> +	{
> +		/* 
> +		 * Huawei E392, E398 and possibly other Qualcomm based modems
> +		 * embed the Qualcomm QMI protocol inside CDC on CDC ECM like
> +		 * control interfaces.  Userspace access to this is required
> +		 * to configure the accompanying data interface
> +		 */
> +		.match_flags        = USB_DEVICE_ID_MATCH_VENDOR |
> +					USB_DEVICE_ID_MATCH_INT_INFO,
> +		.idVendor           = HUAWEI_VENDOR_ID,
> +		.bInterfaceClass    = USB_CLASS_VENDOR_SPEC,
> +		.bInterfaceSubClass = 1,
> +		.bInterfaceProtocol = 9, /* NOTE: CDC ECM control interface! */
> +	},
>  	{ }
>  };

So the Pantech UML290 has the following layout:

0 (2/2/1):    CDC-ACM for AT commands
1 (10/0/0):   CDC-DATA for interface 0
2 (ff/ff/ff): Qualcomm DIAG
3 (ff/fd/ff): NMEA
4 (ff/fe/ff): Pantech WMC
5 (ff/f0/ff): RMNET/QMI port

Interface 5 is obviously the one we want here.  And the WDM driver is
only looking for certain descriptors.  Do we hack CDC-WDM and qmi_wwan
up for these types of devices?

Second, on Gobi devices, we have four USB interfaces, all FF/FF/FF.
Intf 0 and 2 have interrupt endpoints.  One of them is a DIAG interface,
one is NMEA, and the other two are AT and RMNET/QMI.

I think so far the Huawei device is the only one that I've seen that
exposes descriptors that are quasi-CDC at all.  How should we handle the
rest of these?

Dan

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux