From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Dharm Date: Fri, 18 Jan 2002 08:03:54 +0000 Subject: Re: Forward: hotplugging usb-storage: bcdDevice at fault? MIME-Version: 1 Content-Type: multipart/mixed; boundary="liOOAslEiF7prFVr" Message-Id: List-Id: References: In-Reply-To: To: linux-hotplug@vger.kernel.org --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hrm... this isn't right. We discussed this a long time ago, and decided that the better way to do this was to use an "or equals" comparison on one end. The idea was that the common construct was to say that "devices up to revisions x.xx have this bug", so the comparison was supposed to be ">=3D and <" The kernel was supposed to be changed long ago, but I guess it never got done. Matt On Fri, Jan 18, 2002 at 12:10:15PM +0900, Fumitoshi UKAI wrote: > At Thu, 17 Jan 2002 12:22:39 -0800, > David Brownell wrote: > >=20 > > The match algorithm in userland is supposed to be exactly > > the same as that in the kernel. If it doesn't do the same thing, > > then fix the userland version ... >=20 > Ok. The match algorithm about device_id in kernel drivers/usb/usb.c:=20 > usb_match_id() as follows: >=20 > /* No need to test id->bcdDevice_lo !=3D 0, since 0 is never > greater than any unsigned number. */ > if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) && > (id->bcdDevice_lo > dev->descriptor.bcdDevice)) > continue; >=20 > if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) && > (id->bcdDevice_hi < dev->descriptor.bcdDevice)) > continue; >=20 > I believe this code has not been changed, according to > http://linuxusb.bitkeeper.com:8088/usb-2.4/anno/drivers/usb/usb.c@1.23?na= v=3Dindex.html|src/.|src/drivers|src/drivers/usb >=20 > So, I'll apply the following patch. >=20 > Index: etc/hotplug/usb.agent > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvsroot/linux-hotplug/admin/etc/hotplug/usb.agent,v > retrieving revision 1.18 > diff -u -u -r1.18 usb.agent > --- etc/hotplug/usb.agent 2002/01/14 17:04:19 1.18 > +++ etc/hotplug/usb.agent 2002/01/18 03:01:59 > @@ -233,9 +233,9 @@ > continue > fi > =20 > - # bcdDevice_lo <=3D bcdDevice < bcdDevice_hi > + # bcdDevice_lo <=3D bcdDevice <=3D bcdDevice_hi > if [ $USB_MATCH_DEV_HI -eq $(( $match_flags & $USB_MATCH_DEV_HI )) ] && > - [ $usb_bcdDevice -ge $bcdDevice_hi ]; then > + [ $usb_bcdDevice -gt $bcdDevice_hi ]; then > continue > fi >=20 > Regards, > Fumitoshi UKAI >=20 > _______________________________________________ > Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net > Linux-hotplug-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel --=20 Matthew Dharm Home: mdharm-usb@one-eyed-alien.= net=20 Maintainer, Linux USB Mass Storage Driver I see you've been reading alt.sex.chubby.sheep voraciously. -- Tanya User Friendly, 11/24/97 --liOOAslEiF7prFVr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8R9bqz64nssGU+ykRAsZOAKDCuDR96AOrTI0T9ZMlHvyqw6SSlACgmc1J lO2kS88YRHwZH1jA9xAgs7s= =khuF -----END PGP SIGNATURE----- --liOOAslEiF7prFVr-- _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel