Commit c632fbc3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: drivers/usb fixups due to USB structure changes.

parent 8414871b
......@@ -629,13 +629,13 @@ static void hci_usb_destruct(struct hci_dev *hdev)
int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct usb_endpoint_descriptor *bulk_out_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *isoc_out_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *bulk_in_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *isoc_in_ep[HCI_MAX_IFACE_NUM];
struct usb_endpoint_descriptor *intr_in_ep[HCI_MAX_IFACE_NUM];
struct usb_interface_descriptor *uif;
struct usb_endpoint_descriptor *ep;
struct usb_host_endpoint *bulk_out_ep[HCI_MAX_IFACE_NUM];
struct usb_host_endpoint *isoc_out_ep[HCI_MAX_IFACE_NUM];
struct usb_host_endpoint *bulk_in_ep[HCI_MAX_IFACE_NUM];
struct usb_host_endpoint *isoc_in_ep[HCI_MAX_IFACE_NUM];
struct usb_host_endpoint *intr_in_ep[HCI_MAX_IFACE_NUM];
struct usb_host_interface *uif;
struct usb_host_endpoint *ep;
struct usb_interface *iface, *isoc_iface;
struct hci_usb *husb;
struct hci_dev *hdev;
......@@ -648,7 +648,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
return -EIO;
/* Check number of endpoints */
if (intf->altsetting[0].bNumEndpoints < 3)
if (intf->altsetting[0].desc.bNumEndpoints < 3)
return -EIO;
memset(bulk_out_ep, 0, sizeof(bulk_out_ep));
......@@ -663,37 +663,37 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
/* Find endpoints that we need */
ifn = min_t(unsigned int, udev->actconfig->bNumInterfaces, HCI_MAX_IFACE_NUM);
ifn = min_t(unsigned int, udev->actconfig->desc.bNumInterfaces, HCI_MAX_IFACE_NUM);
for (i = 0; i < ifn; i++) {
iface = &udev->actconfig->interface[i];
for (a = 0; a < iface->num_altsetting; a++) {
uif = &iface->altsetting[a];
for (e = 0; e < uif->bNumEndpoints; e++) {
for (e = 0; e < uif->desc.bNumEndpoints; e++) {
ep = &uif->endpoint[e];
switch (ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
case USB_ENDPOINT_XFER_INT:
if (ep->bEndpointAddress & USB_DIR_IN)
if (ep->desc.bEndpointAddress & USB_DIR_IN)
intr_in_ep[i] = ep;
break;
case USB_ENDPOINT_XFER_BULK:
if (ep->bEndpointAddress & USB_DIR_IN)
if (ep->desc.bEndpointAddress & USB_DIR_IN)
bulk_in_ep[i] = ep;
else
bulk_out_ep[i] = ep;
break;
case USB_ENDPOINT_XFER_ISOC:
if (ep->wMaxPacketSize < size)
if (ep->desc.wMaxPacketSize < size)
break;
size = ep->wMaxPacketSize;
size = ep->desc.wMaxPacketSize;
isoc_iface = iface;
isoc_alts = a;
isoc_ifnum = i;
if (ep->bEndpointAddress & USB_DIR_IN)
if (ep->desc.bEndpointAddress & USB_DIR_IN)
isoc_in_ep[i] = ep;
else
isoc_out_ep[i] = ep;
......@@ -721,11 +721,11 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
memset(husb, 0, sizeof(struct hci_usb));
husb->udev = udev;
husb->bulk_out_ep = bulk_out_ep[0]->bEndpointAddress;
husb->bulk_in_ep = bulk_in_ep[0]->bEndpointAddress;
husb->bulk_out_ep = bulk_out_ep[0]->desc.bEndpointAddress;
husb->bulk_in_ep = bulk_in_ep[0]->desc.bEndpointAddress;
husb->intr_ep = intr_in_ep[0]->bEndpointAddress;
husb->intr_interval = intr_in_ep[0]->bInterval;
husb->intr_ep = intr_in_ep[0]->desc.bEndpointAddress;
husb->intr_interval = intr_in_ep[0]->desc.bInterval;
if (isoc_iface) {
if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) {
......@@ -735,8 +735,8 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
usb_driver_claim_interface(&hci_usb_driver, isoc_iface, husb);
husb->isoc_iface = isoc_iface;
husb->isoc_in_ep = isoc_in_ep[1]->bEndpointAddress;
husb->isoc_out_ep = isoc_in_ep[1]->bEndpointAddress;
husb->isoc_in_ep = isoc_in_ep[1]->desc.bEndpointAddress;
husb->isoc_out_ep = isoc_in_ep[1]->desc.bEndpointAddress;
}
husb->completion_lock = RW_LOCK_UNLOCKED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment