From: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: Forward: hotplugging usb-storage: bcdDevice at fault?
Date: Fri, 18 Jan 2002 08:03:54 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-101134108309825@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-101128461527545@msgid-missing>
[-- Attachment #1: Type: text/plain, Size: 2629 bytes --]
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
">= 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:
> >
> > 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 ...
>
> Ok. The match algorithm about device_id in kernel drivers/usb/usb.c:
> usb_match_id() as follows:
>
> /* No need to test id->bcdDevice_lo != 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;
>
> if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) &&
> (id->bcdDevice_hi < dev->descriptor.bcdDevice))
> continue;
>
> 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?nav=index.html|src/.|src/drivers|src/drivers/usb
>
> So, I'll apply the following patch.
>
> Index: etc/hotplug/usb.agent
> ===================================================================
> 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
>
> - # bcdDevice_lo <= bcdDevice < bcdDevice_hi
> + # bcdDevice_lo <= bcdDevice <= 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
>
> Regards,
> Fumitoshi UKAI
>
> _______________________________________________
> 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
--
Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver
I see you've been reading alt.sex.chubby.sheep voraciously.
-- Tanya
User Friendly, 11/24/97
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
prev parent reply other threads:[~2002-01-18 8:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-17 16:22 Forward: hotplugging usb-storage: bcdDevice at fault? Fumitoshi UKAI
2002-01-17 20:22 ` David Brownell
2002-01-18 3:10 ` Fumitoshi UKAI
2002-01-18 8:03 ` Matthew Dharm [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-hotplug-101134108309825@msgid-missing \
--to=mdharm-usb@one-eyed-alien.net \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).