ChangeSet 1.778, 2002/12/05 14:19:47-08:00, plcl@telefonica.net [PATCH] usb-midi patch for 2.4.20-pre11 Please, apply the attached patch for usb-midi.c (Linux kernel 2.4.20-pre11) This patch solves some problems with MIDI IN: - System exclusive messages corrupted. - Other MIDI messages lost (mainly simultaneous notes). diff -Nru a/drivers/usb/usb-midi.c b/drivers/usb/usb-midi.c --- a/drivers/usb/usb-midi.c Thu Dec 5 14:48:50 2002 +++ b/drivers/usb/usb-midi.c Thu Dec 5 14:48:50 2002 @@ -370,7 +370,7 @@ { struct midi_in_endpoint *ep = (struct midi_in_endpoint *)(urb->context); unsigned char *data = urb->transfer_buffer; - int i, l, wake; + int i, j, wake; unsigned long int flags; if ( !ep->urbSubmitted ) { @@ -381,14 +381,14 @@ wake = 0; spin_lock_irqsave( &ep->lock, flags ); - for(l = 0; l < urb->actual_length; l += 4) { - int cin = (data[l]>>0)&0xf; - int cab = (data[l]>>4)&0xf; + for(j = 0; j < urb->actual_length; j += 4) { + int cin = (data[j]>>0)&0xf; + int cab = (data[j]>>4)&0xf; struct usb_mididev *cable = ep->cables[cab]; if ( cable ) { int len = cin_to_len[cin]; /** length of MIDI data **/ for (i = 0; i < len; i++) { - cable->min.buf[cable->min.bufWrPtr] = data[1+i]; + cable->min.buf[cable->min.bufWrPtr] = data[1+i+j]; cable->min.bufWrPtr = (cable->min.bufWrPtr+1)%MIDI_IN_BUFSIZ; if (cable->min.bufRemains < MIDI_IN_BUFSIZ) cable->min.bufRemains += 1;