Re: [RFC PATCH V2 2/2] USB: Set usb port's DevicerRemovable according acpi information in EHCI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 07, 2012 at 05:33:29PM +0800, Lan Tianyu wrote:
> On 2012/9/5 22:39, Alan Stern wrote:
> >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.
> hi Sarah:
> 	Do you have some comments about this?

Go ahead and change the xhci-hub.c code to remove the __force once you
change the usb_hub_descriptor's wHubDelay and DeviceRemovable fields to
__le16.  They should have been marked as little endian from the
beginning.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux