NetBSD Problem Report #55240

From www@netbsd.org  Wed May  6 20:44:00 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0ACB81A9213
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  6 May 2020 20:44:00 +0000 (UTC)
Message-Id: <20200506204359.062581A921E@mollari.NetBSD.org>
Date: Wed,  6 May 2020 20:43:58 +0000 (UTC)
From: rspmn@arcor.de
Reply-To: rspmn@arcor.de
To: gnats-bugs@NetBSD.org
Subject: cdce(4) error "no data interface" when ECM USB IF are preceded by ACM USB IF
X-Send-Pr-Version: www-1.0

>Number:         55240
>Category:       kern
>Synopsis:       cdce(4) error "no data interface" when ECM USB IF are preceded by ACM USB IF
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    skrll
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 06 20:45:00 +0000 2020
>Closed-Date:    Sat Feb 20 09:19:44 +0000 2021
>Last-Modified:  Sat Feb 20 09:19:44 +0000 2021
>Originator:     Reinhard Speyerer
>Release:        NetBSD 9.0
>Organization:
>Environment:
NetBSD netbsd 9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/i386/compile/GENERIC i386
>Description:
cdce(4) returns "cdce0: autoconfiguration error: no data interface" when
the ECM USB interfaces of a device are preceded by ACM USB interfaces
instead of binding to the ECM USB interfaces as expected.

>How-To-Repeat:
Connect a wireless module where the ECM USB interfaces are preceded by
ACM USB interfaces (e.g. a Telit HE910) to a USB port and check dmesg(1)
output:

[  1806.975723] umodem0 at uhub5 port 2 configuration 1 interface 0
[  1806.975723] umodem0: Telit (0x1bc7) 6 CDC-ACM + 1 CDC-ECM (0x23), rev 2.00/17.30, addr 4, iclass 2/2
[  1806.975723] umodem0: data interface 1, has no CM over data, has break
[  1806.975723] umodem0: status change notification available
[  1806.975723] ucom4 at umodem0
[  1806.975723] umodem1 at uhub5 port 2 configuration 1 interface 2
[  1806.975723] umodem1: Telit (0x1bc7) 6 CDC-ACM + 1 CDC-ECM (0x23), rev 2.00/17.30, addr 4, iclass 2/2
[  1806.975723] umodem1: data interface 3, has no CM over data, has break
[  1806.975723] umodem1: status change notification available
[  1806.975723] ucom5 at umodem1
[  1806.975723] umodem2 at uhub5 port 2 configuration 1 interface 4
[  1806.975723] umodem2: Telit (0x1bc7) 6 CDC-ACM + 1 CDC-ECM (0x23), rev 2.00/17.30, addr 4, iclass 2/2
[  1806.975723] umodem2: data interface 5, has no CM over data, has break
[  1806.975723] umodem2: status change notification available
[  1806.975723] ucom6 at umodem2
[  1806.975723] umodem3 at uhub5 port 2 configuration 1 interface 6
[  1806.975723] umodem3: Telit (0x1bc7) 6 CDC-ACM + 1 CDC-ECM (0x23), rev 2.00/17.30, addr 4, iclass 2/2
[  1806.975723] umodem3: data interface 7, has no CM over data, has break
[  1806.975723] umodem3: status change notification available
[  1806.975723] ucom7 at umodem3
[  1806.975723] umodem4 at uhub5 port 2 configuration 1 interface 8
[  1806.975723] umodem4: Telit (0x1bc7) 6 CDC-ACM + 1 CDC-ECM (0x23), rev 2.00/17.30, addr 4, iclass 2/2
[  1806.975723] umodem4: data interface 9, has no CM over data, has break
[  1806.975723] umodem4: status change notification available
[  1806.975723] ucom8 at umodem4
[  1806.975723] umodem5 at uhub5 port 2 configuration 1 interface 10
[  1806.975723] umodem5: Telit (0x1bc7) 6 CDC-ACM + 1 CDC-ECM (0x23), rev 2.00/17.30, addr 4, iclass 2/2
[  1806.975723] umodem5: data interface 11, has no CM over data, has break
[  1806.975723] umodem5: status change notification available
[  1806.975723] ucom9 at umodem5
[  1806.975723] cdce0 at uhub5 port 2 configuration 1 interface 12
[  1806.975723] cdce0: Telit (0x1bc7) 6 CDC-ACM + 1 CDC-ECM (0x23), rev 2.00/17.30, addr 4
[  1806.975723] cdce0: autoconfiguration error: no data interface

>Fix:
Apply this patch

--- if_cdce.c.orig	2019-09-01 15:00:36.000000000 +0200
+++ if_cdce.c	2020-05-03 21:55:09.000000000 +0200
@@ -147,4 +147,5 @@
 	else {
-		ud = (const usb_cdc_union_descriptor_t *)usb_find_desc(un->un_udev,
-		    UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION);
+		ud = (const usb_cdc_union_descriptor_t *)usb_find_desc_if(un->un_udev,
+		    UDESC_CS_INTERFACE, UDESCSUB_CDC_UNION,
+		    usbd_get_interface_descriptor(uiaa->uiaa_iface));
 		if (ud == NULL) {
@@ -238,4 +239,5 @@

-	ue = (const usb_cdc_ethernet_descriptor_t *)usb_find_desc(dev,
-	    UDESC_CS_INTERFACE, UDESCSUB_CDC_ENF);
+	ue = (const usb_cdc_ethernet_descriptor_t *)usb_find_desc_if(dev,
+	    UDESC_CS_INTERFACE, UDESCSUB_CDC_ENF,
+	    usbd_get_interface_descriptor(uiaa->uiaa_iface));
 	if (!ue || usbd_get_string(dev, ue->iMacAddress, eaddr_str) ||

to the NetBSD 9.0 sources and rebuild the kernel. After reboot:

[   427.493472] umodem0 at uhub5 port 2 configuration 1 interface 0
[   427.493472] umodem0: Telit (0x1bc7) 6 CDC-ACM + 1 CDC-ECM (0x23), rev 2.00/17.30, addr 4, iclass 2/2
[   427.493472] umodem0: data interface 1, has no CM over data, has break
[   427.493472] umodem0: status change notification available
[   427.493472] ucom4 at umodem0
  ...
[   427.493472] umodem5: data interface 11, has no CM over data, has break
[   427.493472] umodem5: status change notification available
[   427.493472] ucom9 at umodem5
[   427.493472] cdce0 at uhub5 port 2 configuration 1 interface 12
[   427.493472] cdce0: Telit (0x1bc7) 6 CDC-ACM + 1 CDC-ECM (0x23), rev 2.00/17.30, addr 4
[   427.513474] cdce0: Ethernet address 00:00:11:12:13:14

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->skrll
Responsible-Changed-By: skrll@NetBSD.org
Responsible-Changed-When: Fri, 08 May 2020 06:10:09 +0000
Responsible-Changed-Why:
Take


From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55240 CVS commit: src/sys/dev/usb
Date: Fri, 8 May 2020 06:24:29 +0000

 Module Name:	src
 Committed By:	skrll
 Date:		Fri May  8 06:24:29 UTC 2020

 Modified Files:
 	src/sys/dev/usb: if_cdce.c

 Log Message:
 Search the descriptors of the appropriate interface to ensure correct
 match.

 PR kern/55240 cdce(4) error "no data interface" when ECM USB IF are
 preceded by ACM USB IF


 To generate a diff of this commit:
 cvs rdiff -u -r1.70 -r1.71 src/sys/dev/usb/if_cdce.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->pending-pullups
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Fri, 08 May 2020 06:40:48 +0000
State-Changed-Why:
[pullup-9 #896] cdce(4) fix


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55240 CVS commit: [netbsd-9] src/sys/dev/usb
Date: Sat, 9 May 2020 08:16:54 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat May  9 08:16:54 UTC 2020

 Modified Files:
 	src/sys/dev/usb [netbsd-9]: if_cdce.c

 Log Message:
 Pull up following revision(s) (requested by skrll in ticket #896):

 	sys/dev/usb/if_cdce.c: revision 1.71

 Search the descriptors of the appropriate interface to ensure correct
 match.

 PR kern/55240 cdce(4) error "no data interface" when ECM USB IF are
 preceded by ACM USB IF


 To generate a diff of this commit:
 cvs rdiff -u -r1.53.2.1 -r1.53.2.2 src/sys/dev/usb/if_cdce.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sat, 20 Feb 2021 09:19:44 +0000
State-Changed-Why:
pullup done


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.