Skip to contentSkip to conversation

Allow any MIDI endpoint to drive use of interrupt transfer on Roland devices

PATCH Superseded [email protected] 2 participants 2 messages Oct 10, 2015 – Oct 11, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow any MIDI endpoint to drive use of interrupt transfer on Roland devices

From: "Keith A. Milner" <[email protected]>

sound/usb/midi.c +7 -2
index b901f46..52b8c72 100644
@@ -1860,9 +1860,14 @@ static void snd_usbmidi_switch_roland_altsetting(struct snd_usb_midi* umidi)
 
 	hostif = &intf->altsetting[1];
 	intfd = get_iface_desc(hostif);
+	/* If either or both of the endpoints support interrupt transfer,
+	 * then use the alternate setting
+	 */
 	if (intfd->bNumEndpoints != 2 ||
-	    (get_endpoint(hostif, 0)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK ||
-	    (get_endpoint(hostif, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
+	    !((get_endpoint(hostif, 0)->bmAttributes
+	      & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT ||
+	    (get_endpoint(hostif, 1)->bmAttributes
+	      & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT))
 		return;
 
 	snd_printdd(KERN_INFO "switching to altsetting %d with int ep\n",
Signature · 1 line
1.9.1
#1 lore raw
Quoted 4 lines · On Sat, 10 Oct 2015 20:59:01 +0200, [email protected] wrote:

From: "Keith A. Milner" <[email protected]>

The most important piece is missing -- why this change is needed at all. Could you give more detailed description?

thanks,

Takashi

Quoted 25 lines
sound/usb/midi.c +7 -2
index b901f46..52b8c72 100644
@@ -1860,9 +1860,14 @@ static void snd_usbmidi_switch_roland_altsetting(struct snd_usb_midi* umidi)
 
 	hostif = &intf->altsetting[1];
 	intfd = get_iface_desc(hostif);
+	/* If either or both of the endpoints support interrupt transfer,
+	 * then use the alternate setting
+	 */
 	if (intfd->bNumEndpoints != 2 ||
-	    (get_endpoint(hostif, 0)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK ||
-	    (get_endpoint(hostif, 1)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT)
+	    !((get_endpoint(hostif, 0)->bmAttributes
+	      & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT ||
+	    (get_endpoint(hostif, 1)->bmAttributes
+	      & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT))
 		return;
 
 	snd_printdd(KERN_INFO "switching to altsetting %d with int ep\n",
Signature · 1 line
1.9.1