Commit 40c72cb0 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Update USB class drivers

This patch makes the necessary updates to the bluetty, cdc-acm, and usblp
class drivers for the new interface/altsetting paradigm.  The changes are
quite small.

Unfortunately, the audio and usb-midi drivers are in much worse shape.
They will require more in-depth hacking, to come later...
parent 1c2dd325
......@@ -1025,7 +1025,7 @@ static int usb_bluetooth_probe (struct usb_interface *intf,
int num_bulk_in = 0;
int num_bulk_out = 0;
interface = &intf->altsetting[0];
interface = intf->cur_altsetting;
control_out_endpoint = interface->desc.bInterfaceNumber;
/* find the endpoints that we need */
......
......@@ -595,12 +595,12 @@ static int acm_probe (struct usb_interface *intf,
* is there it's not for call management ... so use
* the cdc union descriptor whenever there is one.
*/
ifcom = intf->altsetting + 0;
ifcom = intf->cur_altsetting;
if (intf == cfacm->interface[j]) {
ifdata = cfacm->interface[j + 1]->altsetting + 0;
ifdata = cfacm->interface[j + 1]->cur_altsetting;
data = cfacm->interface[j + 1];
} else if (intf == cfacm->interface[j + 1]) {
ifdata = cfacm->interface[j]->altsetting + 0;
ifdata = cfacm->interface[j]->cur_altsetting;
data = cfacm->interface[j];
} else
continue;
......
......@@ -133,6 +133,7 @@ struct usblp {
wait_queue_head_t wait; /* Zzzzz ... */
int readcount; /* Counter for reads */
int ifnum; /* Interface number */
struct usb_interface *intf; /* The interface */
/* Alternate-setting numbers and endpoints for each protocol
* (7/1/{index=1,2,3}) that the device supports: */
struct {
......@@ -837,7 +838,8 @@ static int usblp_probe(struct usb_interface *intf,
usblp->dev = dev;
init_MUTEX (&usblp->sem);
init_waitqueue_head(&usblp->wait);
usblp->ifnum = intf->altsetting->desc.bInterfaceNumber;
usblp->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
usblp->intf = intf;
usblp->writeurb = usb_alloc_urb(0, GFP_KERNEL);
if (!usblp->writeurb) {
......@@ -973,7 +975,7 @@ static int usblp_select_alts(struct usblp *usblp)
struct usb_endpoint_descriptor *epd, *epwrite, *epread;
int p, i, e;
if_alt = usblp->dev->actconfig->interface[usblp->ifnum];
if_alt = usblp->intf;
for (p = 0; p < USBLP_MAX_PROTOCOLS; p++)
usblp->protocol[p].alt_setting = -1;
......@@ -1022,7 +1024,8 @@ static int usblp_select_alts(struct usblp *usblp)
epread = NULL;
}
usblp->protocol[ifd->desc.bInterfaceProtocol].alt_setting = i;
usblp->protocol[ifd->desc.bInterfaceProtocol].alt_setting =
ifd->desc.bAlternateSetting;
usblp->protocol[ifd->desc.bInterfaceProtocol].epwrite = epwrite;
usblp->protocol[ifd->desc.bInterfaceProtocol].epread = epread;
}
......
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