[usb] Allow for wildcard USB class IDs

Make the class ID a property of the USB driver (rather than a property
of the USB device ID), and allow USB drivers to specify a wildcard ID
for any of the three component IDs (class, subclass, or protocol).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2015-09-14 17:52:25 +01:00
parent 549a0caabb
commit 668dc73d52
9 changed files with 69 additions and 49 deletions

View File

@@ -666,6 +666,7 @@ static struct usb_device_id dm96xx_ids[] = {
struct usb_driver dm96xx_driver __usb_driver = {
.ids = dm96xx_ids,
.id_count = ( sizeof ( dm96xx_ids ) / sizeof ( dm96xx_ids[0] ) ),
.class = USB_CLASS_ID ( USB_ANY_ID, USB_ANY_ID, USB_ANY_ID ),
.score = USB_SCORE_NORMAL,
.probe = dm96xx_probe,
.remove = dm96xx_remove,

View File

@@ -503,11 +503,6 @@ static struct usb_device_id ecm_ids[] = {
.name = "cdc-ecm",
.vendor = USB_ANY_ID,
.product = USB_ANY_ID,
.class = {
.class = USB_CLASS_CDC,
.subclass = USB_SUBCLASS_CDC_ECM,
.protocol = 0,
},
},
};
@@ -515,6 +510,7 @@ static struct usb_device_id ecm_ids[] = {
struct usb_driver ecm_driver __usb_driver = {
.ids = ecm_ids,
.id_count = ( sizeof ( ecm_ids ) / sizeof ( ecm_ids[0] ) ),
.class = USB_CLASS_ID ( USB_CLASS_CDC, USB_SUBCLASS_CDC_ECM, 0 ),
.score = USB_SCORE_NORMAL,
.probe = ecm_probe,
.remove = ecm_remove,

View File

@@ -655,11 +655,6 @@ static struct usb_device_id ncm_ids[] = {
.name = "cdc-ncm",
.vendor = USB_ANY_ID,
.product = USB_ANY_ID,
.class = {
.class = USB_CLASS_CDC,
.subclass = USB_SUBCLASS_CDC_NCM,
.protocol = 0,
},
},
};
@@ -667,6 +662,7 @@ static struct usb_device_id ncm_ids[] = {
struct usb_driver ncm_driver __usb_driver = {
.ids = ncm_ids,
.id_count = ( sizeof ( ncm_ids ) / sizeof ( ncm_ids[0] ) ),
.class = USB_CLASS_ID ( USB_CLASS_CDC, USB_SUBCLASS_CDC_NCM, 0 ),
.score = USB_SCORE_NORMAL,
.probe = ncm_probe,
.remove = ncm_remove,

View File

@@ -1038,13 +1038,11 @@ static struct usb_device_id smsc75xx_ids[] = {
.name = "smsc7500",
.vendor = 0x0424,
.product = 0x7500,
.class = { 0xff, 0x00, 0xff },
},
{
.name = "smsc7505",
.vendor = 0x0424,
.product = 0x7505,
.class = { 0xff, 0x00, 0xff },
},
};
@@ -1052,6 +1050,7 @@ static struct usb_device_id smsc75xx_ids[] = {
struct usb_driver smsc75xx_driver __usb_driver = {
.ids = smsc75xx_ids,
.id_count = ( sizeof ( smsc75xx_ids ) / sizeof ( smsc75xx_ids[0] ) ),
.class = USB_CLASS_ID ( 0xff, 0x00, 0xff ),
.score = USB_SCORE_NORMAL,
.probe = smsc75xx_probe,
.remove = smsc75xx_remove,