Quoting Randy.Dunlap <[EMAIL PROTECTED]>:

> Dmitri wrote:
> > 
> > Quoting Pete Zaitcev <[EMAIL PROTECTED]>:
> > 
> > > Guys,
> > >
> > > I noticed a funny thing... When drivers ask for a pipe to be
> > > made up, they often pass an endpoint address with 0x80 bit set.
> > > This makes for a pipe with 0x00400000 bit set, which is in the
> > > reserved area. It appears not to harm anything, but is annoying
> > > in printouts. How about this:
> > >
> > > --- linux-2.4.13-ac2/include/linux/usb.h      Tue Oct 23 22:02:02 2001
> > > +++ linux-2.4.13-ac2-e/include/linux/usb.h    Fri Nov  2 09:37:19 2001
> > > @@ -758,7 +758,7 @@
> > >
> > >  static inline unsigned int __create_pipe(struct usb_device *dev, unsigned int 
>endpoint)
> > >  {
> > > -     return (dev->devnum << 8) | (endpoint << 15) |
> > > +     return (dev->devnum << 8) | ((endpoint & 0xf) << 15) |
> > >               ((dev->speed == USB_SPEED_LOW) << 26);
> > 
> > Total 16 endpoints? Did you mean 0x7f?
> 
> Why?  Endpoint is only 4 bits (numbered 0 - 15)
> in each direction, so endpoint could be ANDed with
> USB_ENDPOINT_NUMBER_MASK (just using a name instead of an
> inline constant :).

Indeed, the symbol would be preferrable. I was just thinking why
to reset bit 0x80 we use mask 0xF0 :-) But since other bits are
reserved, it makes perfect sense to reset them as well.

Dmitri

-- 
Linux, the way to get rid of boot viruses
  (By [EMAIL PROTECTED], MaDsen Wikholm)

PGP signature

Reply via email to