NetBSD Problem Report #55273

From www@netbsd.org  Mon May 18 18:03:34 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 C848D1A9217
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 18 May 2020 18:03:34 +0000 (UTC)
Message-Id: <20200518180334.0887A1A921E@mollari.NetBSD.org>
Date: Mon, 18 May 2020 18:03:34 +0000 (UTC)
From: rspmn@arcor.de
Reply-To: rspmn@arcor.de
To: gnats-bugs@NetBSD.org
Subject: urndis(4) error "could not find data bulk in/out" without CDC union descriptor
X-Send-Pr-Version: www-1.0

>Number:         55273
>Category:       kern
>Synopsis:       urndis(4) error "could not find data bulk in/out" without CDC union descriptor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    skrll
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 18 18:05:00 +0000 2020
>Last-Modified:  Mon May 18 19:22:16 +0000 2020
>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:
urndis(4) returns
"autoconfiguration error: urndis0: could not find data bulk in/out"
when the corresponing CDC union descriptor is missing which seems
to be quite common for many current devices.

Obtain the corresponding information from the interface association
as it is already done in the umb(4) driver instead of adding each new
device without a CDC union descriptor to the urndis_devs table in the driver.
>How-To-Repeat:
Connect a device with a RNDIS interface which does not have a CDC union
descriptor  (e.g. Alcatel Onetouch L850V) to a USB port and check dmesg(1)
output:

[   119.859971] urndis0 at uhub4 port 6 configuration 1 interface 0
[   119.859971] urndis0: Alcatel (0x1bbb) MobileBroadBand (0x195), rev 2.01/2.28, addr 2
[   119.859971] autoconfiguration error: urndis0: could not find data bulk in
[   119.859971] autoconfiguration error: urndis0: could not find data bulk out
[   119.859971] umass0 at uhub4 port 6 configuration 1 interface 2
[   119.859971] umass0: Alcatel (0x1bbb) MobileBroadBand (0x195), rev 2.01/2.28, addr 2
[   119.859971] umass0: using SCSI over Bulk-Only
[   119.869972] scsibus0 at umass0: 2 targets, 1 lun per target
[   119.869972] sd0 at scsibus0 target 0 lun 0: <ONETOUCH, ESTORIL, 2.31> disk removable
[   119.869972] sd0: drive offline

>Fix:
Apply this patch

--- if_urndis.c.orig	2019-09-13 08:51:58.000000000 +0200
+++ if_urndis.c	2020-05-18 08:09:06.000000000 +0200
@@ -923,2 +923,3 @@
 	const usb_cdc_union_descriptor_t *ud;
+	const usb_interface_assoc_descriptor_t *ad;
 	const usb_cdc_header_descriptor_t *desc;
@@ -961,2 +962,9 @@

+		if (desc->bDescriptorType == UDESC_INTERFACE_ASSOC) {
+			ad = (const usb_interface_assoc_descriptor_t *)desc;
+			if (ad->bFirstInterface == if_ctl &&
+			    ad->bInterfaceCount > 1)
+				if_data = if_ctl + 1;
+			continue;
+		}
 		if (desc->bDescriptorType != UDESC_CS_INTERFACE) {

to the NetBSD 9.0 sources and rebuild the kernel. After reboot and
switching to the USB composition with the RNDIS interface:

[    88.189468] urndis0 at uhub4 port 6 configuration 1 interface 0
[    88.189468] urndis0: Alcatel (0x1bbb) MobileBroadBand (0x195), rev 2.01/2.28, addr 2
[    88.209470] urndis0: Ethernet address a6:27:cc:ab:d9:ae
[    88.209470] umass0 at uhub4 port 6 configuration 1 interface 2
[    88.209470] umass0: Alcatel (0x1bbb) MobileBroadBand (0x195), rev 2.01/2.28, addr 2
[    88.209470] umass0: using SCSI over Bulk-Only
[    88.209470] scsibus0 at umass0: 2 targets, 1 lun per target
[    88.209470] sd0 at scsibus0 target 0 lun 0: <ONETOUCH, ESTORIL, 2.31> disk removable
[    88.209470] sd0: drive offline

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->skrll
Responsible-Changed-By: skrll@NetBSD.org
Responsible-Changed-When: Mon, 18 May 2020 19:22:16 +0000
Responsible-Changed-Why:
take


>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.