endPoint &= 0x0f; /* Silently force endPoint to lie in range 0 to 15. */
pipe = usb_rcvbulkpipe( d, endPoint );
- bufSize = usb_maxpacket( d, pipe, usb_pipein(pipe) );
+ bufSize = usb_maxpacket( d, pipe, 0 );
/* usb_pipein() = ! usb_pipeout() = true for an in Endpoint */
ep = (struct midi_in_endpoint *)kmalloc(sizeof(struct midi_in_endpoint), GFP_KERNEL);
endPoint &= 0x0f;
pipe = usb_sndbulkpipe( d, endPoint );
- bufSize = usb_maxpacket( d, pipe, usb_pipeout(pipe) );
+ bufSize = usb_maxpacket( d, pipe, 1 );
ep = (struct midi_out_endpoint *)kmalloc(sizeof(struct midi_out_endpoint), GFP_KERNEL);
if ( !ep ) {
return NULL;
}
u->deviceName = NULL;
- u->idVendor = d->descriptor.idVendor;
- u->idProduct = d->descriptor.idProduct;
+ u->idVendor = le16_to_cpu(d->descriptor.idVendor);
+ u->idProduct = le16_to_cpu(d->descriptor.idProduct);
u->interface = ifnum;
u->altSetting = altSetting;
u->in[0].endpoint = -1;
} else {
if ( oep < 15 ) {
pins = oep+1;
- if ( pins > 16 )
- pins = 16;
u->out[oep].endpoint = p1[2];
u->out[oep].cableId = ( 1 << pins ) - 1;
if ( u->out[oep].cableId )
}
/* Failsafe */
if ( !u->deviceName[0] ) {
- if ( d->descriptor.idVendor == USB_VENDOR_ID_ROLAND ) {
+ if (le16_to_cpu(d->descriptor.idVendor) == USB_VENDOR_ID_ROLAND ) {
strcpy(u->deviceName, "Unknown Roland");
- } else if ( d->descriptor.idVendor == USB_VENDOR_ID_STEINBERG ) {
+ } else if (le16_to_cpu(d->descriptor.idVendor) == USB_VENDOR_ID_STEINBERG ) {
strcpy(u->deviceName, "Unknown Steinberg");
- } else if ( d->descriptor.idVendor == USB_VENDOR_ID_YAMAHA ) {
+ } else if (le16_to_cpu(d->descriptor.idVendor) == USB_VENDOR_ID_YAMAHA ) {
strcpy(u->deviceName, "Unknown Yamaha");
} else {
strcpy(u->deviceName, "Unknown");
int alts=-1;
int ret;
- if (d->descriptor.idVendor != USB_VENDOR_ID_YAMAHA) {
+ if (le16_to_cpu(d->descriptor.idVendor) != USB_VENDOR_ID_YAMAHA) {
return -EINVAL;
}
}
printk(KERN_INFO "usb-midi: Found YAMAHA USB-MIDI device on dev %04x:%04x, iface %d\n",
- d->descriptor.idVendor, d->descriptor.idProduct, ifnum);
+ le16_to_cpu(d->descriptor.idVendor),
+ le16_to_cpu(d->descriptor.idProduct), ifnum);
i = d->actconfig - d->config;
buffer = d->rawdescriptors[i];
- bufSize = d->actconfig->desc.wTotalLength;
+ bufSize = le16_to_cpu(d->actconfig->desc.wTotalLength);
u = parse_descriptor( d, buffer, bufSize, ifnum, alts, 1);
if ( u == NULL ) {
for ( i=0; i<VENDOR_SPECIFIC_USB_MIDI_DEVICES ; i++ ) {
u=&(usb_midi_devices[i]);
- if ( d->descriptor.idVendor != u->idVendor ||
- d->descriptor.idProduct != u->idProduct ||
+ if ( le16_to_cpu(d->descriptor.idVendor) != u->idVendor ||
+ le16_to_cpu(d->descriptor.idProduct) != u->idProduct ||
ifnum != u->interface )
continue;
}
printk(KERN_INFO "usb-midi: Found MIDISTREAMING on dev %04x:%04x, iface %d\n",
- d->descriptor.idVendor, d->descriptor.idProduct, ifnum);
+ le16_to_cpu(d->descriptor.idVendor),
+ le16_to_cpu(d->descriptor.idProduct), ifnum);
/* From USB Spec v2.0, Section 9.5.
i = d->actconfig - d->config;
buffer = d->rawdescriptors[i];
- bufSize = d->actconfig->desc.wTotalLength;
+ bufSize = le16_to_cpu(d->actconfig->desc.wTotalLength);
u = parse_descriptor( d, buffer, bufSize, ifnum, alts, 0);
if ( u == NULL ) {
{
struct usb_midi_device u;
- if ( d->descriptor.idVendor != uvendor ||
- d->descriptor.idProduct != uproduct ||
+ if ( le16_to_cpu(d->descriptor.idVendor) != uvendor ||
+ le16_to_cpu(d->descriptor.idProduct) != uproduct ||
ifnum != uinterface ) {
return -EINVAL;
}
};
static struct usb_driver usb_midi_driver = {
- .owner = THIS_MODULE,
.name = "midi",
.probe = usb_midi_probe,
.disconnect = usb_midi_disconnect,