- Export the URIO USB device ID's.

- Add checks for configuration and interface index.

MFC after:	3 days
This commit is contained in:
Hans Petter Selasky 2011-06-24 18:11:55 +00:00
parent 0b6d7bb4e8
commit d16e5e1a84

View File

@ -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