Commit 8414871b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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

parent 64d163db
...@@ -1937,11 +1937,11 @@ static int snd_usb_roland_ua100_hack(snd_usb_audio_t *chip) ...@@ -1937,11 +1937,11 @@ static int snd_usb_roland_ua100_hack(snd_usb_audio_t *chip)
.type = QUIRK_MIDI_FIXED_ENDPOINT, .type = QUIRK_MIDI_FIXED_ENDPOINT,
.data = &ep_quirk .data = &ep_quirk
}; };
struct usb_config_descriptor *cfg = chip->dev->actconfig; struct usb_host_config *cfg = chip->dev->actconfig;
struct usb_interface *iface; struct usb_interface *iface;
int err; int err;
if (cfg->bNumInterfaces != 3) { if (cfg->desc.bNumInterfaces != 3) {
snd_printdd(KERN_ERR "invalid UA-100 descriptor\n"); snd_printdd(KERN_ERR "invalid UA-100 descriptor\n");
return -ENXIO; return -ENXIO;
} }
...@@ -2134,18 +2134,18 @@ static void *snd_usb_audio_probe(struct usb_device *dev, ...@@ -2134,18 +2134,18 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
struct usb_interface *intf, struct usb_interface *intf,
const struct usb_device_id *usb_id) const struct usb_device_id *usb_id)
{ {
struct usb_config_descriptor *config = dev->actconfig; struct usb_host_config *config = dev->actconfig;
const snd_usb_audio_quirk_t *quirk = (const snd_usb_audio_quirk_t *)usb_id->driver_info; const snd_usb_audio_quirk_t *quirk = (const snd_usb_audio_quirk_t *)usb_id->driver_info;
int i; int i;
snd_card_t *card; snd_card_t *card;
snd_usb_audio_t *chip; snd_usb_audio_t *chip;
int ifnum = intf->altsetting->bInterfaceNumber; int ifnum = intf->altsetting->desc.bInterfaceNumber;
if (quirk && quirk->ifnum != QUIRK_ANY_INTERFACE && ifnum != quirk->ifnum) if (quirk && quirk->ifnum != QUIRK_ANY_INTERFACE && ifnum != quirk->ifnum)
goto __err_val; goto __err_val;
if (usb_set_configuration(dev, config->bConfigurationValue) < 0) { if (usb_set_configuration(dev, config->desc.bConfigurationValue) < 0) {
snd_printk(KERN_ERR "cannot set configuration (value 0x%x)\n", config->bConfigurationValue); snd_printk(KERN_ERR "cannot set configuration (value 0x%x)\n", config->desc.bConfigurationValue);
goto __err_val; goto __err_val;
} }
......
...@@ -517,7 +517,7 @@ static void snd_usbmidi_in_endpoint_delete(snd_usb_midi_in_endpoint_t* ep) ...@@ -517,7 +517,7 @@ static void snd_usbmidi_in_endpoint_delete(snd_usb_midi_in_endpoint_t* ep)
static struct usb_endpoint_descriptor* snd_usbmidi_get_int_epd(snd_usb_midi_t* umidi) static struct usb_endpoint_descriptor* snd_usbmidi_get_int_epd(snd_usb_midi_t* umidi)
{ {
struct usb_interface* intf; struct usb_interface* intf;
struct usb_interface_descriptor* intfd; struct usb_host_interface* intfd;
if (umidi->chip->dev->descriptor.idVendor != 0x0582) if (umidi->chip->dev->descriptor.idVendor != 0x0582)
return NULL; return NULL;
...@@ -545,7 +545,7 @@ static struct usb_endpoint_descriptor* snd_usbmidi_get_int_epd(snd_usb_midi_t* u ...@@ -545,7 +545,7 @@ static struct usb_endpoint_descriptor* snd_usbmidi_get_int_epd(snd_usb_midi_t* u
static struct usb_endpoint_descriptor* snd_usbmidi_get_midiman_int_epd(snd_usb_midi_t* umidi) static struct usb_endpoint_descriptor* snd_usbmidi_get_midiman_int_epd(snd_usb_midi_t* umidi)
{ {
struct usb_interface* intf = umidi->iface; struct usb_interface* intf = umidi->iface;
if (!intf || intf->altsetting[0].bNumEndpoints < 1) if (!intf || intf->altsetting[0].desc.bNumEndpoints < 1)
return NULL; return NULL;
return &intf->altsetting[0].endpoint[0].desc; return &intf->altsetting[0].endpoint[0].desc;
} }
...@@ -774,9 +774,9 @@ static int snd_usbmidi_get_ms_info(snd_usb_midi_t* umidi, ...@@ -774,9 +774,9 @@ static int snd_usbmidi_get_ms_info(snd_usb_midi_t* umidi,
snd_usb_midi_endpoint_info_t* endpoints) snd_usb_midi_endpoint_info_t* endpoints)
{ {
struct usb_interface* intf; struct usb_interface* intf;
struct usb_interface_descriptor* intfd; struct usb_host_interface* intfd;
struct usb_ms_header_descriptor* ms_header; struct usb_ms_header_descriptor* ms_header;
struct usb_endpoint_descriptor* ep; struct usb_host_endpoint* ep;
struct usb_ms_endpoint_descriptor* ms_ep; struct usb_ms_endpoint_descriptor* ms_ep;
int i, epidx; int i, epidx;
...@@ -795,9 +795,9 @@ static int snd_usbmidi_get_ms_info(snd_usb_midi_t* umidi, ...@@ -795,9 +795,9 @@ static int snd_usbmidi_get_ms_info(snd_usb_midi_t* umidi,
printk(KERN_WARNING "snd-usb-midi: MIDIStreaming interface descriptor not found\n"); printk(KERN_WARNING "snd-usb-midi: MIDIStreaming interface descriptor not found\n");
epidx = 0; epidx = 0;
for (i = 0; i < intfd->bNumEndpoints; ++i) { for (i = 0; i < intfd->desc.bNumEndpoints; ++i) {
ep = &intfd->endpoint[i]; ep = &intfd->endpoint[i];
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK)
continue; continue;
ms_ep = (struct usb_ms_endpoint_descriptor*)ep->extra; ms_ep = (struct usb_ms_endpoint_descriptor*)ep->extra;
if (ep->extralen < 4 || if (ep->extralen < 4 ||
...@@ -806,22 +806,22 @@ static int snd_usbmidi_get_ms_info(snd_usb_midi_t* umidi, ...@@ -806,22 +806,22 @@ static int snd_usbmidi_get_ms_info(snd_usb_midi_t* umidi,
ms_ep->bDescriptorSubtype != MS_GENERAL) ms_ep->bDescriptorSubtype != MS_GENERAL)
continue; continue;
if (endpoints[epidx].epnum != 0 && if (endpoints[epidx].epnum != 0 &&
endpoints[epidx].epnum != (ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK)) { endpoints[epidx].epnum != (ep->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK)) {
++epidx; ++epidx;
if (epidx >= MIDI_MAX_ENDPOINTS) { if (epidx >= MIDI_MAX_ENDPOINTS) {
printk(KERN_WARNING "snd-usb-midi: too many endpoints\n"); printk(KERN_WARNING "snd-usb-midi: too many endpoints\n");
break; break;
} }
} }
endpoints[epidx].epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; endpoints[epidx].epnum = ep->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
if (ep->bEndpointAddress & USB_DIR_IN) { if (ep->desc.bEndpointAddress & USB_DIR_IN) {
endpoints[epidx].in_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1; endpoints[epidx].in_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1;
} else { } else {
endpoints[epidx].out_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1; endpoints[epidx].out_cables = (1 << ms_ep->bNumEmbMIDIJack) - 1;
} }
printk(KERN_INFO "snd-usb-midi: detected %d %s jack(s) on endpoint %d\n", printk(KERN_INFO "snd-usb-midi: detected %d %s jack(s) on endpoint %d\n",
ms_ep->bNumEmbMIDIJack, ms_ep->bNumEmbMIDIJack,
ep->bEndpointAddress & USB_DIR_IN ? "input" : "output", ep->desc.bEndpointAddress & USB_DIR_IN ? "input" : "output",
endpoints[epidx].epnum); endpoints[epidx].epnum);
} }
return 0; return 0;
...@@ -835,7 +835,7 @@ static int snd_usbmidi_detect_endpoint(snd_usb_midi_t* umidi, ...@@ -835,7 +835,7 @@ static int snd_usbmidi_detect_endpoint(snd_usb_midi_t* umidi,
snd_usb_midi_endpoint_info_t* endpoint) snd_usb_midi_endpoint_info_t* endpoint)
{ {
struct usb_interface* intf; struct usb_interface* intf;
struct usb_interface_descriptor* intfd; struct usb_host_interface* intfd;
struct usb_endpoint_descriptor* epd; struct usb_endpoint_descriptor* epd;
if (endpoint->epnum == -1) { if (endpoint->epnum == -1) {
...@@ -858,14 +858,14 @@ static int snd_usbmidi_detect_yamaha(snd_usb_midi_t* umidi, ...@@ -858,14 +858,14 @@ static int snd_usbmidi_detect_yamaha(snd_usb_midi_t* umidi,
snd_usb_midi_endpoint_info_t* endpoint) snd_usb_midi_endpoint_info_t* endpoint)
{ {
struct usb_interface* intf; struct usb_interface* intf;
struct usb_interface_descriptor* intfd; struct usb_host_interface* intfd;
uint8_t* cs_desc; uint8_t* cs_desc;
intf = umidi->iface; intf = umidi->iface;
if (!intf) if (!intf)
return -ENOENT; return -ENOENT;
intfd = intf->altsetting; intfd = intf->altsetting;
if (intfd->bNumEndpoints < 1) if (intfd->desc.bNumEndpoints < 1)
return -ENOENT; return -ENOENT;
for (cs_desc = intfd->extra; for (cs_desc = intfd->extra;
...@@ -892,7 +892,7 @@ static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi, int ports ...@@ -892,7 +892,7 @@ static int snd_usbmidi_create_endpoints_midiman(snd_usb_midi_t* umidi, int ports
{ {
snd_usb_midi_endpoint_info_t ep_info; snd_usb_midi_endpoint_info_t ep_info;
struct usb_interface* intf; struct usb_interface* intf;
struct usb_interface_descriptor* intfd; struct usb_host_interface* intfd;
struct usb_endpoint_descriptor* epd; struct usb_endpoint_descriptor* epd;
int cable, err; int cable, err;
......
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