Subject: kern/11428: umodem.c always issues optional Set_Comm_Feature.
To: None <gnats-bugs@gnats.netbsd.org>
From: Ryutaroh Matsumoto <root@pear.comm.ss.titech.ac.jp>
List: netbsd-bugs
Date: 11/05/2000 21:08:10
>Number:         11428
>Category:       kern
>Synopsis:       umodem.c always issues optional Set_Comm_Feature, which prevents a USB modem from attached.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 05 21:08:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Ryutaroh Matsumoto
>Release:        NetBSD-1.5_BETA
>Organization:
Tokyo Institute of Technology, Japan
>Environment:
System: NetBSD pear 1.5_BETA NetBSD 1.5_BETA (PEAR) #1: Mon Nov 6 13:16:47 JST 2000 root@pear:/usr/src/sys/arch/i386/compile/PEAR i386


>Description:
The USB Communication Device Class specification ver. 1.1 specifies that
Set_Comm_Feature request is optional (in page 17), and whether the device
accepts Set_Comm_Feature is indicated in the variable sc->sc_acm_cap
in dev/usb/umodem.c.
But umodem.c always issues Set_Comm_Feature without checking sc->sc_acm_cap,
and does not attach a USB modem if an error is returned by Set_Comm_Feature
request.
This behavior prevents a USB CDC ACM compliant modem from attached.

>How-To-Repeat:
Connect a USB CDC ACM compliant modem that does not accept Set_Comm_Feature
to a NetBSD box, and boot it.

>Fix:
Apply the following patch.

--- sys/dev/usb/umodem.c.org	Tue Oct 17 08:56:06 2000
+++ sys/dev/usb/umodem.c	Mon Nov  6 13:16:18 2000
@@ -259,8 +259,11 @@
 	}
 
 	if (sc->sc_cm_cap & USB_CDC_CM_OVER_DATA) {
-		err = umodem_set_comm_feature(sc, UCDC_ABSTRACT_STATE,
-					      UCDC_DATA_MULTIPLEXED);
+		if (sc->sc_acm_cap & USB_CDC_ACM_HAS_FEATURE)
+			err = umodem_set_comm_feature(sc, UCDC_ABSTRACT_STATE,
+						      UCDC_DATA_MULTIPLEXED);
+		else
+			err = 0;
 		if (err) {
 			printf("%s: could not set data multiplex mode\n",
 			       USBDEVNAME(sc->sc_dev));
>Release-Note:
>Audit-Trail:
>Unformatted: