Update of /cvsroot/alsa/alsa-kernel/usb
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3069/alsa-kernel/usb

Modified Files:
        usbmidi.c 
Log Message:
add comments in USB MIDI vendor-specific detection functions

Index: usbmidi.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/usb/usbmidi.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- usbmidi.c   16 Mar 2004 16:36:05 -0000      1.26
+++ usbmidi.c   17 Mar 2004 13:10:55 -0000      1.27
@@ -1015,6 +1015,10 @@
        if (intfd->bNumEndpoints < 1)
                return -ENOENT;
 
+       /*
+        * For each port there is one MIDI_IN/OUT_JACK descriptor, not
+        * necessarily with any useful contents.  So simply count 'em.
+        */
        for (cs_desc = hostif->extra;
             cs_desc < hostif->extra + hostif->extralen && cs_desc[0] >= 2;
             cs_desc += cs_desc[0]) {
@@ -1049,6 +1053,16 @@
                return -ENOENT;
        hostif = intf->altsetting;
        intfd = get_iface_desc(hostif);
+       /*
+        * The various MidiSport devices have more or less random endpoint
+        * numbers, so we have to identify the endpoints by their index in
+        * the descriptor array, like the driver for that other OS does.
+        *
+        * There is one interrupt input endpoint for all input ports, one
+        * bulk output endpoint for even-numbered ports, and one for odd-
+        * numbered ports.  Both bulk output endpoints have corresponding
+        * input bulk endpoints (at indices 1 and 3) which aren't used.
+        */
        if (intfd->bNumEndpoints < (endpoint->out_cables > 0x0001 ? 5 : 3)) {
                snd_printdd(KERN_ERR "not enough endpoints\n");
                return -ENOENT;



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to