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]

 



Oliver Neukum <oliver@xxxxxxxxxx> writes:
> Am Mittwoch, 25. Januar 2012, 00:09:28 schrieb Dan Williams:
>>
>> I'm also able to talk to my Gobi 2000 card, but I need to restrict the
>> driver to interface 0 because there are two interfaces with interrupt
>> endpoints, and both are ff/ff/ff so USB_DEVICE_AND_INTERFACE_INFO
>> matching doesn't help us there.  I suppose we could start putting the
>> interface number into the driver_data field and using that in
>> wdm_probe() if it's present.
>
> No. We are not starting with a kludge. If the existing macros for binding
> don't do the job, define a new macro in usbcore.

I'm afraid that won't be possible without modifying the whole matching
logic in usbcore.  USB_DEVICE_AND_INTERFACE_INFO is already matching on
all available fields:

struct usb_device_id {
        /* which fields to match against? */
        __u16           match_flags;

        /* Used for product specific matches; range is inclusive */
        __u16           idVendor;
        __u16           idProduct;
        __u16           bcdDevice_lo;
        __u16           bcdDevice_hi;

        /* Used for device class matches */
        __u8            bDeviceClass;
        __u8            bDeviceSubClass;
        __u8            bDeviceProtocol;

        /* Used for interface class matches */
        __u8            bInterfaceClass;
        __u8            bInterfaceSubClass;
        __u8            bInterfaceProtocol;

        /* not matched against */
        kernel_ulong_t  driver_info;
};


But I don't think it's a good idea to add this device to cdc-wdm
permanently anyway.  It's useless without the network driver for
anything but playing with QMI commands.  It's better to get Gobi
specific probing into qmi_wwan (or similar if making a Gobi-only
driver), and just use cdc-wdm as a subdriver from that.

And in fact I'm also starting to wonder if it was a good idea to add the
Huawei modem.  If the subdriver approach is accepted, then maybe it
would be better to use that for every such device including those with
separate control and data interfaces?  It would make the network device
look consistent with the common cdc_ether type devices, and would leave
all the device specific probing to the already device specific network
driver. 

What do you think?


Bjørn
--
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