diff options
Diffstat (limited to 'drivers/usb/core')
| -rw-r--r-- | drivers/usb/core/driver.c | 9 | ||||
| -rw-r--r-- | drivers/usb/core/message.c | 5 | ||||
| -rw-r--r-- | drivers/usb/core/sysfs.c | 5 | 
3 files changed, 13 insertions, 6 deletions
| diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index f536aebc958..23d7bbd199a 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -622,14 +622,15 @@ int usb_match_one_id(struct usb_interface *interface,  	if (!usb_match_device(dev, id))  		return 0; -	/* The interface class, subclass, and protocol should never be +	/* The interface class, subclass, protocol and number should never be  	 * checked for a match if the device class is Vendor Specific,  	 * unless the match record specifies the Vendor ID. */  	if (dev->descriptor.bDeviceClass == USB_CLASS_VENDOR_SPEC &&  			!(id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&  			(id->match_flags & (USB_DEVICE_ID_MATCH_INT_CLASS |  				USB_DEVICE_ID_MATCH_INT_SUBCLASS | -				USB_DEVICE_ID_MATCH_INT_PROTOCOL))) +				USB_DEVICE_ID_MATCH_INT_PROTOCOL | +				USB_DEVICE_ID_MATCH_INT_NUMBER)))  		return 0;  	if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) && @@ -644,6 +645,10 @@ int usb_match_one_id(struct usb_interface *interface,  	    (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol))  		return 0; +	if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_NUMBER) && +	    (id->bInterfaceNumber != intf->desc.bInterfaceNumber)) +		return 0; +  	return 1;  }  EXPORT_SYMBOL_GPL(usb_match_one_id); diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index b548cf1dbc6..ca7fc392fd9 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -1559,7 +1559,7 @@ static int usb_if_uevent(struct device *dev, struct kobj_uevent_env *env)  	if (add_uevent_var(env,  		   "MODALIAS=usb:" -		   "v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X", +		   "v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02Xin%02X",  		   le16_to_cpu(usb_dev->descriptor.idVendor),  		   le16_to_cpu(usb_dev->descriptor.idProduct),  		   le16_to_cpu(usb_dev->descriptor.bcdDevice), @@ -1568,7 +1568,8 @@ static int usb_if_uevent(struct device *dev, struct kobj_uevent_env *env)  		   usb_dev->descriptor.bDeviceProtocol,  		   alt->desc.bInterfaceClass,  		   alt->desc.bInterfaceSubClass, -		   alt->desc.bInterfaceProtocol)) +		   alt->desc.bInterfaceProtocol, +		   alt->desc.bInterfaceNumber))  		return -ENOMEM;  	return 0; diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index 9a56e3adf47..777f03c3772 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -840,7 +840,7 @@ static ssize_t show_modalias(struct device *dev,  	alt = intf->cur_altsetting;  	return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02X" -			"ic%02Xisc%02Xip%02X\n", +			"ic%02Xisc%02Xip%02Xin%02X\n",  			le16_to_cpu(udev->descriptor.idVendor),  			le16_to_cpu(udev->descriptor.idProduct),  			le16_to_cpu(udev->descriptor.bcdDevice), @@ -849,7 +849,8 @@ static ssize_t show_modalias(struct device *dev,  			udev->descriptor.bDeviceProtocol,  			alt->desc.bInterfaceClass,  			alt->desc.bInterfaceSubClass, -			alt->desc.bInterfaceProtocol); +			alt->desc.bInterfaceProtocol, +			alt->desc.bInterfaceNumber);  }  static DEVICE_ATTR(modalias, S_IRUGO, show_modalias, NULL); | 
