diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-07-10 11:36:12 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-07-18 14:42:35 +0200 |
commit | 245069bcef15ecc19db616a967501349b76c84d0 (patch) | |
tree | 9398374ea6f0b87d4658c343326aaceba90cbd4d /drivers/net/usb | |
parent | 4a872ae0ffe1380a28589f8f9e164d9d67471f1a (diff) | |
download | barebox-245069bcef15ecc19db616a967501349b76c84d0.tar.gz barebox-245069bcef15ecc19db616a967501349b76c84d0.tar.xz |
USB: introduce usb_interface/usb_configuration structs
Currently we have two conflicting definitions of struct usb_config_descriptor
and struct usb_interface_descriptor in the tree. This is because the USB code
uses additional fields in the structs for internal housekeeping. Add
struct usb_interface and struct struct usb_configuration with the housekeeping
data and embed the corresponding hardware structs into them. This frees the
way to use the definitions from ch9.h in the next step.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/usbnet.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 13f58e3ea0..e9edf40fa3 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -16,7 +16,7 @@ int usbnet_get_endpoints(struct usbnet *dev) { struct usb_device *udev = dev->udev; int tmp; - struct usb_interface_descriptor *alt = NULL; + struct usb_interface *alt = NULL; struct usb_endpoint_descriptor *in = NULL, *out = NULL; struct usb_endpoint_descriptor *status = NULL; @@ -24,13 +24,13 @@ int usbnet_get_endpoints(struct usbnet *dev) unsigned ep; in = out = status = NULL; - alt = &udev->config.if_desc[tmp]; + alt = &udev->config.interface[tmp]; /* take the first altsetting with in-bulk + out-bulk; * remember any status endpoint, just in case; * ignore other endpoints and altsetttings. */ - for (ep = 0; ep < alt->bNumEndpoints; ep++) { + for (ep = 0; ep < alt->desc.bNumEndpoints; ep++) { struct usb_endpoint_descriptor *e; int intr = 0; @@ -63,10 +63,10 @@ int usbnet_get_endpoints(struct usbnet *dev) if (!alt || !in || !out) return -EINVAL; - if (alt->bAlternateSetting != 0 + if (alt->desc.bAlternateSetting != 0 || !(dev->driver_info->flags & FLAG_NO_SETINT)) { - tmp = usb_set_interface (dev->udev, alt->bInterfaceNumber, - alt->bAlternateSetting); + tmp = usb_set_interface(dev->udev, alt->desc.bInterfaceNumber, + alt->desc.bAlternateSetting); if (tmp < 0) return tmp; } |