# HG changeset patch # User bartv # Date 1028747951 0 # Node ID ce611170e194161a51e0ff746e3e9b8e8670d5d7 # Parent 8d47e3001deb60c96336c86a768546c4ed8263ef Commit bug fix to usbeth host-side driver provided by dsmith@redhat.com, diff --git a/packages/io/usb/eth/slave/current/ChangeLog b/packages/io/usb/eth/slave/current/ChangeLog --- a/packages/io/usb/eth/slave/current/ChangeLog +++ b/packages/io/usb/eth/slave/current/ChangeLog @@ -1,3 +1,12 @@ +2002-07-26 David Smith + + * host/ecos_usbeth.c (ecos_usbeth_probe): + Two changes to the code that checks to see if this is the correct + driver for the USB peripheral that was just loaded. Fixed a bug + that was comparing the product id of the peripheral to the vendor + id. Supports multiple implementations (vendor id/product id sets) + so that the same driver could be used for several devices. + 2001-07-10 Bart Veer * doc/usbseth.sgml, doc/*.html: diff --git a/packages/io/usb/eth/slave/current/host/ecos_usbeth.c b/packages/io/usb/eth/slave/current/host/ecos_usbeth.c --- a/packages/io/usb/eth/slave/current/host/ecos_usbeth.c +++ b/packages/io/usb/eth/slave/current/host/ecos_usbeth.c @@ -408,11 +408,23 @@ ecos_usbeth_probe(struct usb_device* usb unsigned char dummy[1]; int tx_endpoint = -1; int rx_endpoint = -1; - - if ((usbdev->descriptor.idVendor != ecos_usbeth_implementations[0].vendor) || - (usbdev->descriptor.idProduct != ecos_usbeth_implementations[0].vendor)) { + const ecos_usbeth_impl* impl; + int found_impl = 0; + + // See if this is the correct driver for this USB peripheral. + impl = ecos_usbeth_implementations; + while (impl->name != NULL) { + if ((usbdev->descriptor.idVendor != impl->vendor) || + (usbdev->descriptor.idProduct != impl->id)) { + found_impl = 1; + break; + } + impl++; + } + if (! found_impl) { return (void*) 0; } + // For now only support USB-ethernet peripherals consisting of a single // configuration, with a single interface, with two bulk endpoints. if ((1 != usbdev->descriptor.bNumConfigurations) ||