On Wed, 5 Sep 2012, Lan Tianyu wrote:
> This is copied from xhci_usb3_hub_descriptor().
>
> struct usb_hub_descriptor {
> __u8 bDescLength;
> __u8 bDescriptorType;
> __u8 bNbrPorts;
> __le16 wHubCharacteristics;
> __u8 bPwrOn2PwrGood;
> __u8 bHubContrCurrent;
>
> /* 2.0 and 3.0 hubs differ here */
> union {
> struct {
> /* add 1 bit for hub status change; round to bytes */
> __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
> __u8 PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
> } __attribute__ ((packed)) hs;
>
> struct {
> __u8 bHubHdrDecLat;
> __u16 wHubDelay;
> __u16 DeviceRemovable;
> } __attribute__ ((packed)) ss;
> } u;
> } __attribute__ ((packed));
>
> The struct has been defined with __attribute__ ((packed)). So there is
> no alignment problem. Or we can
> hub->descriptor->u.ss.DeviceRemovable = (__force __u16)
> cpu_to_le16(port_removable);
> I think we also should define wHubDelay and DeviceRemovable as __le16
> for ss since they are little-endian order, right?
Yes. Ask Sarah about changing it.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html