lkml.org 
[lkml]   [2014]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [V2 PATCH 02/10] added media agnostic (MA) USB HCD roothubs
On Wed, 12 Nov 2014, Sean O. Stalley wrote:

> > > --- /dev/null
> > > +++ b/drivers/staging/mausb/drivers/mausb_hub.c
> >
> > > +/**
> > > + * Returns true if the given is the superspeed HCD. Note: The primary HCD is
> > > + * High Speed and the shared HCD is SuperSpeed.
> > > + */
> >
> > Why in that order?
> >
>
> We should probably switch this & make the superspeed hub primary.
> That way we match the xhci driver.

xhci-hcd makes the high-speed hcd the primary one. This is because it
registers the high-speed hcd before the SuperSpeed hcd. There was a
good reason for doing it this way, but I can't remember what it was
(it's buried somewhere in the email archives).

That's why when you look at the output from lsusb or something similar,
a SuperSpeed root hub has a bus number that is one higher than its peer
high-speed root hub.

> > > +int mausb_hub_status_data(struct usb_hcd *hcd, char *buf)
> > > +{
> > > + int i;
> > > + u16 port_change = 0;
> > > + u32 status = 0;
> > > + int ret = 1;
> > > + struct mausb_hcd *mhcd = usb_hcd_to_mausb_hcd(hcd);
> > > + struct mausb_root_hub *roothub = usb_hcd_to_roothub(hcd);
> > > +
> > > + /*
> > > + * Buf should never be more that 2 bytes. USB 3.0 hubs cannot have
> > > + * more than 15 downstream ports.
> > > + */
> > > + buf[0] = 0;
> > > + if (MAUSB_ROOTHUB_NUM_PORTS > 7) {
> > > + buf[1] = 0;
> > > + ret++;
> > > + }
> >
> > Endianness bug.
> >
>
> Could you elaborate?
> It was my understanding that this buffer was host-endian.
> Is this an unacceptable way to clear the buffer?

I don't understand Oliver's objection here. The buffer is
little-endian, just as it is for real hubs. The code seems correct.

Alan Stern



\
 
 \ /
  Last update: 2014-11-12 21:21    [W:0.061 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site