usb: create common header virtual root hub descriptors
Subsystems (8)
PATCH 1/1 usb: create common header virtual root hub descriptors
Many USB host controller drivers contain almost identical copies of the same virtual root hub descriptors. Put these into a common file to avoid duplication.
Note that there were some very minor differences between the descriptors in the various files, such as:
- USB 1.0 vs. USB 1.1
- Manufacturer/Device ID
- Max packet size
- String content
I assume these aren't relevant.
---
Repost: Marek asked me to resend this Cc to the maintainers of the various edited files. If you're CC'd, could you please check that the minor differences in the descriptor content between the new header and your driver isn't going to be an issue. It's pretty unclear who the maintainer is for many of the files, so I've had to cast a fairly wide net...
--- arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c | 99 +------------------- arch/powerpc/cpu/mpc5xxx/usb_ohci.c | 99 +------------------- arch/powerpc/cpu/ppc4xx/usb_ohci.c | 99 +------------------- arch/sparc/cpu/leon3/usb_uhci.c | 107 +-------------------- board/mpl/common/usb_uhci.c | 115 +---------------------- drivers/usb/host/isp116x-hcd.c | 100 +------------------- drivers/usb/host/ohci-hcd.c | 98 +------------------ drivers/usb/host/ohci-s3c24xx.c | 95 +------------------ drivers/usb/host/r8a66597-hcd.c | 104 +-------------------- drivers/usb/musb/musb_hcd.c | 93 +------------------ include/usbroothubdes.h | 129 ++++++++++++++++++++++++++ 11 files changed, 143 insertions(+), 995 deletions(-) create mode 100644 include/usbroothubdes.h
arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c +1 -98
@@ -839,104 +839,7 @@ static int dl_done_list (ohci_t *ohci, td_t *td_list)* Virtual Root Hub *-------------------------------------------------------------------------*/ -/* Device descriptor */ -static __u8 root_hub_dev_des[] = -{ -0x12 ,/* __u8 bLength; */ -0x01 ,/* __u8 bDescriptorType; Device */ -0x10 ,/* __u16 bcdUSB; v1.1 */ -0x01 , -0x09 ,/* __u8 bDeviceClass; HUB_CLASSCODE */ -0x00 ,/* __u8 bDeviceSubClass; */ -0x00 ,/* __u8 bDeviceProtocol; */ -0x08 ,/* __u8 bMaxPacketSize0; 8 Bytes */ -0x00 ,/* __u16 idVendor; */ -0x00 , -0x00 ,/* __u16 idProduct; */ -0x00 , -0x00 ,/* __u16 bcdDevice; */ -0x00 , -0x00 ,/* __u8 iManufacturer; */ -0x01 ,/* __u8 iProduct; */ -0x00 ,/* __u8 iSerialNumber; */ -0x01 /* __u8 bNumConfigurations; */ -}; - - -/* Configuration descriptor */ -static __u8 root_hub_config_des[] = -{ -0x09 ,/* __u8 bLength; */ -0x02 ,/* __u8 bDescriptorType; Configuration */ -0x19 ,/* __u16 wTotalLength; */ -0x00 , -0x01 ,/* __u8 bNumInterfaces; */ -0x01 ,/* __u8 bConfigurationValue; */ -0x00 ,/* __u8 iConfiguration; */ -0x40 ,/* __u8 bmAttributes; -Bit 7: Bus-powered, 6: Self-powered, 5 Remote-wakwup, 4..0: resvd */ -0x00 ,/* __u8 MaxPower; */ - -/* interface */ -0x09 ,/* __u8 if_bLength; */ -0x04 ,/* __u8 if_bDescriptorType; Interface */ -0x00 ,/* __u8 if_bInterfaceNumber; */ -0x00 ,/* __u8 if_bAlternateSetting; */ -0x01 ,/* __u8 if_bNumEndpoints; */ -0x09 ,/* __u8 if_bInterfaceClass; HUB_CLASSCODE */ -0x00 ,/* __u8 if_bInterfaceSubClass; */ -0x00 ,/* __u8 if_bInterfaceProtocol; */ -0x00 ,/* __u8 if_iInterface; */ - -/* endpoint */ -0x07 ,/* __u8 ep_bLength; */ -0x05 ,/* __u8 ep_bDescriptorType; Endpoint */ -0x81 ,/* __u8 ep_bEndpointAddress; IN Endpoint 1 */ -0x03 ,/* __u8 ep_bmAttributes; Interrupt */ -0x02 ,/* __u16 ep_wMaxPacketSize; ((MAX_ROOT_PORTS + 1) / 8 */ -0x00 , -0xff /* __u8 ep_bInterval; 255 ms */ -}; - -static unsigned char root_hub_str_index0[] = -{ -0x04 ,/* __u8 bLength; */ -0x03 ,/* __u8 bDescriptorType; String-descriptor */ -0x09 ,/* __u8 lang ID */ -0x04 ,/* __u8 lang ID */ -}; - -static unsigned char root_hub_str_index1[] = -{ -28 ,/* __u8 bLength; */ -0x03 ,/* __u8 bDescriptorType; String-descriptor */ -'O' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'H' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'C' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'I' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -' ' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'R' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'o' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'o' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'t' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -' ' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'H' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'u' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -'b' ,/* __u8 Unicode */ -0 ,/* __u8 Unicode */ -}; +#include <usbroothubdes.h> /* Hub class-specific descriptor is constructed dynamically */
arch/powerpc/cpu/mpc5xxx/usb_ohci.c +1 -98
105 lines not on this page · raw message
arch/powerpc/cpu/ppc4xx/usb_ohci.c +1 -98
105 lines not on this page · raw message
arch/sparc/cpu/leon3/usb_uhci.c +3 -104
113 lines not on this page · raw message
board/mpl/common/usb_uhci.c +3 -112
121 lines not on this page · raw message
drivers/usb/host/isp116x-hcd.c +1 -99
106 lines not on this page · raw message
drivers/usb/host/ohci-hcd.c +1 -97
104 lines not on this page · raw message
drivers/usb/host/ohci-s3c24xx.c +1 -94
101 lines not on this page · raw message
drivers/usb/host/r8a66597-hcd.c +1 -103
110 lines not on this page · raw message
drivers/usb/musb/musb_hcd.c +1 -92
100 lines not on this page · raw message
include/usbroothubdes.h new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH 1/1 usb: create common header virtual root hub descriptors
Quoted 41 lines · Stephen Warren
Many USB host controller drivers contain almost identical copies of the same virtual root hub descriptors. Put these into a common file to avoid duplication.
Note that there were some very minor differences between the descriptors in the various files, such as:
- USB 1.0 vs. USB 1.1
- Manufacturer/Device ID
- Max packet size
- String contentI assume these aren't relevant.
Cc Thomas Lange <[email protected]>Cc Shinya Kuribayashi <[email protected]>Cc Gary Jennejohn <[email protected]>Cc Wolfgang Denk <[email protected]>Cc Eric Millbrandt <[email protected]>Cc Pierre Aubert <[email protected]>Cc Stefan Roese <[email protected]>Cc Daniel Hellstrom <[email protected]>Cc Denis Peter <[email protected]>Cc Rodolfo Giometti <[email protected]>Cc Zhang Wei <[email protected]>Cc Mateusz Zalega <[email protected]>Cc Remy Bohmer <[email protected]>Cc Markus Klotzbuecher <[email protected]>Cc Minkyu Kang <[email protected]>Cc Gary Jennejohn <[email protected]>Cc C Nauman <[email protected]>Cc David M?ller <[email protected]>Cc Yoshihiro Shimoda <[email protected]>Cc Nobuhiro Iwamatsu <[email protected]>Cc Thomas Abraham <[email protected]>Cc Tom Rini <[email protected]>Cc Andrew Murray <[email protected]>Cc Matej Fran?e?kin <[email protected]>Cc Cliff Cai <[email protected]>Cc Bryan Wu <[email protected]>Signed-off-by Stephen Warren <[email protected]>
Quoted 6 lines
---
Repost: Marek asked me to resend this Cc to the maintainers of the various edited files. If you're CC'd, could you please check that the minor differences in the descriptor content between the new header and your driver isn't going to be an issue. It's pretty unclear who the maintainer is for many of the files, so I've had to cast a fairly wide net...
Looks good for ppc4xx, so:
Thanks,
Stefan
PATCH 1/1 usb: create common header virtual root hub descriptors
In reply to Stephen WarrenQuoted 7 lines · Stephen Warren
Many USB host controller drivers contain almost identical copies of the same virtual root hub descriptors. Put these into a common file to avoid duplication.
Note that there were some very minor differences between the descriptors in the various files, such as:
Quoted 6 lines
- USB 1.0 vs. USB 1.1
- Manufacturer/Device ID
- Max packet size
- String contentI assume these aren't relevant.
Marek, how long do you think we should wait for acks/naks from the CC'd people?
PATCH 1/1 usb: create common header virtual root hub descriptors
Quoted 13 lines · Stephen Warren
Quoted 12 lines · Stephen Warren
Many USB host controller drivers contain almost identical copies of the same virtual root hub descriptors. Put these into a common file to avoid duplication.
Note that there were some very minor differences between the descriptors in the various files, such as:
- USB 1.0 vs. USB 1.1
- Manufacturer/Device ID
- Max packet size
- String content
Quoted 5 lines
Quoted 1 line
I assume these aren't relevant.
Marek, how long do you think we should wait for acks/naks from the CC'd people?
Stephen, I guess I'm not the right person to Ack/Nak this patch now, since I haven't played this for a long time. Also it's the same for Cliff Cai and his email is dead.
Thanks,
-Bryan
PATCH 1/1 usb: create common header virtual root hub descriptors
In reply to Stephen WarrenQuoted 13 lines · Stephen Warren
Quoted 12 lines · Stephen Warren
Many USB host controller drivers contain almost identical copies of the same virtual root hub descriptors. Put these into a common file to avoid duplication.
Note that there were some very minor differences between the descriptors in the various files, such as:
- USB 1.0 vs. USB 1.1
- Manufacturer/Device ID
- Max packet size
- String content
Quoted 4 lines
Quoted 1 line
I assume these aren't relevant.
Marek, how long do you think we should wait for acks/naks from the CC'd people?
Well, I'm picking this up now.
Best regards,
Marek Vasut
PATCH 1/1 usb: create common header virtual root hub descriptors
In reply to Stephen WarrenHello Stephen,
Sorry for the delay, I wasn't connected during 2 weeks.
I can't comment your patch because I no longer have an MPC5200-based board.
Best regards
Le 21/02/2014 05:19, Stephen Warren a ?crit :
Quoted 19 lines · Stephen Warren
Quoted 7 lines
Many USB host controller drivers contain almost identical copies of the same virtual root hub descriptors. Put these into a common file to avoid duplication.
Note that there were some very minor differences between the descriptors in the various files, such as:
Quoted 6 lines
- USB 1.0 vs. USB 1.1
- Manufacturer/Device ID
- Max packet size
- String contentI assume these aren't relevant.
Marek, how long do you think we should wait for acks/naks from the CC'd people?