summaryrefslogtreecommitdiff
path: root/common/usb_storage.c
diff options
context:
space:
mode:
authorTom Rix <Tom.Rix@windriver.com>2009-10-31 12:37:38 -0500
committerRemy Bohmer <linux@bohmer.net>2009-12-20 12:47:37 +0100
commit8f8bd565f35ff8a068727bfcf8975c50df082043 (patch)
tree828a43f51646a2060916a3d8928c62c430607045 /common/usb_storage.c
parentbb3bcfa2426cc6a0aecec7270e3ee67ca843a125 (diff)
downloadu-boot-imx-8f8bd565f35ff8a068727bfcf8975c50df082043.zip
u-boot-imx-8f8bd565f35ff8a068727bfcf8975c50df082043.tar.gz
u-boot-imx-8f8bd565f35ff8a068727bfcf8975c50df082043.tar.bz2
USB Consolidate descriptor definitions
The header files usb.h and usbdescriptors.h have the same nameed structure definitions for usb_config_descriptor usb_interface_descriptor usb_endpoint_descriptor usb_device_descriptor usb_string_descriptor These are out right duplicates in usb.h usb_device_descriptor usb_string_descriptor This one has extra unused elements usb_endpoint_descriptor unsigned char bRefresh unsigned char bSynchAddress; These in usb.h have extra elements at the end of the usb 2.0 specified descriptor and are used. usb_config_descriptor usb_interface_descriptor The change is to consolidate the definition of the descriptors to usbdescriptors.h. The dublicates in usb.h are removed. The extra element structure will have their name shorted by removing the '_descriptor' suffix. So usb_config_descriptor -> usb_config usb_interface_descriptor -> usb_interface For these, the common descriptor elements are accessed now by an element 'desc'. As an example - if (iface->bInterfaceClass != USB_CLASS_HUB) + if (iface->desc.bInterfaceClass != USB_CLASS_HUB) This has been compile tested on MAKEALL arm, ppc and mips. Signed-off-by: Tom Rix <Tom.Rix@windriver.com>
Diffstat (limited to 'common/usb_storage.c')
-rw-r--r--common/usb_storage.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 19613f2..391948b 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -1070,7 +1070,7 @@ retry_it:
int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
struct us_data *ss)
{
- struct usb_interface_descriptor *iface;
+ struct usb_interface *iface;
int i;
unsigned int flags = 0;
@@ -1094,9 +1094,9 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
#endif
if (dev->descriptor.bDeviceClass != 0 ||
- iface->bInterfaceClass != USB_CLASS_MASS_STORAGE ||
- iface->bInterfaceSubClass < US_SC_MIN ||
- iface->bInterfaceSubClass > US_SC_MAX) {
+ iface->desc.bInterfaceClass != USB_CLASS_MASS_STORAGE ||
+ iface->desc.bInterfaceSubClass < US_SC_MIN ||
+ iface->desc.bInterfaceSubClass > US_SC_MAX) {
/* if it's not a mass storage, we go no further */
return 0;
}
@@ -1119,8 +1119,8 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
ss->subclass = subclass;
ss->protocol = protocol;
} else {
- ss->subclass = iface->bInterfaceSubClass;
- ss->protocol = iface->bInterfaceProtocol;
+ ss->subclass = iface->desc.bInterfaceSubClass;
+ ss->protocol = iface->desc.bInterfaceProtocol;
}
/* set the handler pointers based on the protocol */
@@ -1153,7 +1153,7 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
* An optional interrupt is OK (necessary for CBI protocol).
* We will ignore any others.
*/
- for (i = 0; i < iface->bNumEndpoints; i++) {
+ for (i = 0; i < iface->desc.bNumEndpoints; i++) {
/* is it an BULK endpoint? */
if ((iface->ep_desc[i].bmAttributes &
USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) {
@@ -1178,7 +1178,7 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
ss->ep_in, ss->ep_out, ss->ep_int);
/* Do some basic sanity checks, and bail if we find a problem */
- if (usb_set_interface(dev, iface->bInterfaceNumber, 0) ||
+ if (usb_set_interface(dev, iface->desc.bInterfaceNumber, 0) ||
!ss->ep_in || !ss->ep_out ||
(ss->protocol == US_PR_CBI && ss->ep_int == 0)) {
USB_STOR_PRINTF("Problems with device\n");