summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/storage/urio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/storage/urio.c')
-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