aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2012-07-17 07:14:32 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-18 12:31:25 -0400
commit1817e83d6ccf992164dd83522b2d1c22b1a85977 (patch)
tree3fbea43d4ea36ecdd61aec298d393e829e33f596 /drivers/net/usb
parenteeda8585522bcc173f91d6254dfa63e871087c54 (diff)
net: qmi_wwan: make dynamic device IDs work
The usbnet API use the device ID table to store a pointer to a minidriver. Setting a generic pointer for dynamic device IDs will in most cases make them work as expected. usbnet will otherwise treat the dynamic IDs as blacklisted. That is rarely useful. There is no standard class describing devices supported by this driver, and most vendors don't even provide enough information to allow vendor specific wildcard matching. The result is that most of the supported devices must be explicitly listed in the device table. Allowing dynamic IDs to work both simplifies testing and verification of new devices, and provides a way for end users to use a device before the ID is added to the driver. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/qmi_wwan.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 85c983d52527..07743c14a6bc 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -600,10 +600,27 @@ static const struct usb_device_id products[] = {
600}; 600};
601MODULE_DEVICE_TABLE(usb, products); 601MODULE_DEVICE_TABLE(usb, products);
602 602
603static int qmi_wwan_probe(struct usb_interface *intf, const struct usb_device_id *prod)
604{
605 struct usb_device_id *id = (struct usb_device_id *)prod;
606
607 /* Workaround to enable dynamic IDs. This disables usbnet
608 * blacklisting functionality. Which, if required, can be
609 * reimplemented here by using a magic "blacklist" value
610 * instead of 0 in the static device id table
611 */
612 if (!id->driver_info) {
613 dev_dbg(&intf->dev, "setting defaults for dynamic device id\n");
614 id->driver_info = (unsigned long)&qmi_wwan_shared;
615 }
616
617 return usbnet_probe(intf, id);
618}
619
603static struct usb_driver qmi_wwan_driver = { 620static struct usb_driver qmi_wwan_driver = {
604 .name = "qmi_wwan", 621 .name = "qmi_wwan",
605 .id_table = products, 622 .id_table = products,
606 .probe = usbnet_probe, 623 .probe = qmi_wwan_probe,
607 .disconnect = usbnet_disconnect, 624 .disconnect = usbnet_disconnect,
608 .suspend = qmi_wwan_suspend, 625 .suspend = qmi_wwan_suspend,
609 .resume = qmi_wwan_resume, 626 .resume = qmi_wwan_resume,