summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/storage
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2011-06-24 18:11:55 +0000
committerhselasky <hselasky@FreeBSD.org>2011-06-24 18:11:55 +0000
commit9fee05c0d9060f4a70a62c23c55eae9a40a1a153 (patch)
treeaf2573b581de98ddf8c1d5ffbd15e73aaa12e24a /sys/dev/usb/storage
parent9d967b99869b118187f3816f87034a110428a848 (diff)
downloadFreeBSD-src-9fee05c0d9060f4a70a62c23c55eae9a40a1a153.zip
FreeBSD-src-9fee05c0d9060f4a70a62c23c55eae9a40a1a153.tar.gz
- Export the URIO USB device ID's.
- Add checks for configuration and interface index. MFC after: 3 days
Diffstat (limited to 'sys/dev/usb/storage')
-rw-r--r--sys/dev/usb/storage/urio.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/usb/storage/urio.c b/sys/dev/usb/storage/urio.c
index ee93439..6687173 100644
--- a/sys/dev/usb/storage/urio.c
+++ b/sys/dev/usb/storage/urio.c
@@ -198,22 +198,25 @@ DRIVER_MODULE(urio, uhub, urio_driver, urio_devclass, NULL, 0);
MODULE_DEPEND(urio, usb, 1, 1, 1);
MODULE_VERSION(urio, 1);
+static const STRUCT_USB_HOST_ID urio_devs[] = {
+ {USB_VPI(USB_VENDOR_DIAMOND, USB_PRODUCT_DIAMOND_RIO500USB, 0)},
+ {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO600USB, 0)},
+ {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO800USB, 0)},
+};
+
static int
urio_probe(device_t dev)
{
struct usb_attach_arg *uaa = device_get_ivars(dev);
- if (uaa->usb_mode != USB_MODE_HOST) {
+ if (uaa->usb_mode != USB_MODE_HOST)
return (ENXIO);
- }
- if ((((uaa->info.idVendor == USB_VENDOR_DIAMOND) &&
- (uaa->info.idProduct == USB_PRODUCT_DIAMOND_RIO500USB)) ||
- ((uaa->info.idVendor == USB_VENDOR_DIAMOND2) &&
- ((uaa->info.idProduct == USB_PRODUCT_DIAMOND2_RIO600USB) ||
- (uaa->info.idProduct == USB_PRODUCT_DIAMOND2_RIO800USB)))))
- return (0);
- else
+ if (uaa->info.bConfigIndex != 0)
return (ENXIO);
+ if (uaa->info.bIfaceIndex != 0)
+ return (ENXIO);
+
+ return (usbd_lookup_id_by_uaa(urio_devs, sizeof(urio_devs), uaa));
}
static int
OpenPOWER on IntegriCloud