NetBSD Problem Report #59872

From www@netbsd.org  Wed Dec 31 23:29:32 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 1CBDF1A923C
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 31 Dec 2025 23:29:32 +0000 (UTC)
Message-Id: <20251231232930.7A49D1A923D@mollari.NetBSD.org>
Date: Wed, 31 Dec 2025 23:29:30 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: urndis(4): missing support for some devices
X-Send-Pr-Version: www-1.0

>Number:         59872
>Category:       kern
>Synopsis:       urndis(4): missing support for some devices
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 31 23:30:00 +0000 2025
>Closed-Date:    
>Last-Modified:  Wed Sep 02 18:50:56 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, 9, ...
>Organization:
The NetBSD Urndistination, Inc.
>Environment:
>Description:

	A device with the following USB interface -- a phone in USB
	tethering mode -- is not recognized by urndis(4) and instead
	attaches as ugen(4):

  1  59084               urndis_match:entry struct usbif_attach_arg {
    int uiaa_port = 0x4
    int uiaa_configno = 0x1
    int uiaa_ifaceno = 0
    int uiaa_vendor = 0x5c6
    int uiaa_product = 0xf00e
    int uiaa_release = 0x601
    struct usbd_device *uiaa_device = 0xfffff99eb1c23c00
    struct usbd_interface *uiaa_iface = 0xfffff99ea8d97540
    int uiaa_class = 0xef
    int uiaa_subclass = 0x4
    int uiaa_proto = 0x1
    struct usbd_interface **uiaa_ifaces = 0xfffff99eea781780
    int uiaa_nifaces = 0x2
} 

>How-To-Repeat:

	Try to use USB tethering with a matching device.

>Fix:

	Yes, please!

	According to
	https://www.usb.org/defined-class-codes#anchor_BaseClassEFh,
	this class/subclass/protocol is:

	class 0xef (Miscellaneous)
	subclass 0x04 interface 0x01 (RNDIS over Ethernet)

	According to Linux, FreeBSD, and OpenBSD, urndis(4) should also
	match the following:

   class           subclass                        protocol
1. 0x02 (CDC)      0x02 (abstract control model)   0xff (? rndis?)
2. 0xef (misc)     0x01 (sync)                     0x01 (active)
3. 0xef (misc)     0x04 (rndis)                    0x03 (wimax)
4. 0xef (misc)     0x04 (rndis)                    0x04 (wwan)

	But I don't have devices to test.

>Release-Note:

>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59872 CVS commit: src/sys/dev/usb
Date: Thu, 1 Jan 2026 00:48:30 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Thu Jan  1 00:48:30 UTC 2026

 Modified Files:
 	src/sys/dev/usb: usb.h

 Log Message:
 usb.h: Provide definitions for USB class 0xef: miscellaneous.

 Source: https://usb.org/defined-class-codes
 https://web.archive.org/web/20251216031858/https://usb.org/defined-class-codes

 PR kern/59872: urndis(4): missing support for some devices


 To generate a diff of this commit:
 cvs rdiff -u -r1.124 -r1.125 src/sys/dev/usb/usb.h

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

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59872 CVS commit: src/sys/dev/usb
Date: Thu, 1 Jan 2026 00:48:42 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Thu Jan  1 00:48:42 UTC 2026

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

 Log Message:
 urndis(4): Match more interface ids.

 There are some others we should consider too, based on what OpenBSD,
 FreeBSD, and Linux match, but I haven't tested with these devices:

    class           subclass                        protocol
 1. 0x02 (CDC)      0x02 (abstract control model)   0xff (? rndis?)
 2. 0xef (misc)     0x01 (sync)                     0x01 (active)
 3. 0xef (misc)     0x04 (rndis)                    0x03 (wimax)
 4. 0xef (misc)     0x04 (rndis)                    0x04 (wwan)

 Note: FreeBSD uses `UIPROTO_RNDIS' for (3) even though the USB-IF
 registry lists class 0xef, subclass 0x04, protocol 0x04 as `RNDIS
 over WiMAX'; likewise `UIPROTO_ACTIVESYNC' for (4) even though it's
 listed as `RNDIS over WWAN'.  My guess is that for class 0xef
 subclass 0x04, _any_ protocol will really be RNDIS, and it was a
 mistake for FreeBSD to use those protocol numbers (which context
 suggests were supposed to apply to different subclasses).

 PR kern/59872: urndis(4): missing support for some devices


 To generate a diff of this commit:
 cvs rdiff -u -r1.49 -r1.50 src/sys/dev/usb/if_urndis.c

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

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59872 CVS commit: src/sys/modules/if_urndis
Date: Thu, 1 Jan 2026 00:49:09 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Thu Jan  1 00:49:09 UTC 2026

 Modified Files:
 	src/sys/modules/if_urndis: if_urndis.ioconf

 Log Message:
 urndis(4): Attach at usbifif, not usbdevif, in the if_urndis module.

 We really ought to have a static type system for config(5) interface
 attributes to catch mistakes like this!

 Came up while trying to test a fix for:

 PR kern/59872: urndis(4): missing support for some devices


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/sys/modules/if_urndis/if_urndis.ioconf

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

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Thu, 01 Jan 2026 01:32:00 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-9, pullup-10, pullup-11


State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Mon, 02 Feb 2026 04:56:47 +0000
State-Changed-Why:
pullup-11 #178 https://releng.netbsd.org/cgi-bin/req-11.cgi?show=178
could probably do 10 too
maybe not worth it for 9


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59872 CVS commit: [netbsd-11] src/sys
Date: Mon, 2 Feb 2026 19:58:45 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Feb  2 19:58:44 UTC 2026

 Modified Files:
 	src/sys/dev/usb [netbsd-11]: if_urndis.c usb.h
 	src/sys/modules/if_urndis [netbsd-11]: if_urndis.ioconf

 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #178):

 	sys/dev/usb/if_urndis.c: revision 1.50
 	sys/dev/usb/usb.h: revision 1.125
 	sys/modules/if_urndis/if_urndis.ioconf: revision 1.2

 usb.h: Provide definitions for USB class 0xef: miscellaneous.

 Source: https://usb.org/defined-class-codes
 https://web.archive.org/web/20251216031858/https://usb.org/defined-class-codes

 PR kern/59872: urndis(4): missing support for some devices

 urndis(4): Match more interface ids.

 There are some others we should consider too, based on what OpenBSD,
 FreeBSD, and Linux match, but I haven't tested with these devices:
    class           subclass                        protocol
 1. 0x02 (CDC)      0x02 (abstract control model)   0xff (? rndis?)
 2. 0xef (misc)     0x01 (sync)                     0x01 (active)
 3. 0xef (misc)     0x04 (rndis)                    0x03 (wimax)
 4. 0xef (misc)     0x04 (rndis)                    0x04 (wwan)

 Note: FreeBSD uses `UIPROTO_RNDIS' for (3) even though the USB-IF
 registry lists class 0xef, subclass 0x04, protocol 0x04 as `RNDIS
 over WiMAX'; likewise `UIPROTO_ACTIVESYNC' for (4) even though it's
 listed as `RNDIS over WWAN'.  My guess is that for class 0xef
 subclass 0x04, _any_ protocol will really be RNDIS, and it was a
 mistake for FreeBSD to use those protocol numbers (which context
 suggests were supposed to apply to different subclasses).

 PR kern/59872: urndis(4): missing support for some devices

 urndis(4): Attach at usbifif, not usbdevif, in the if_urndis module.

 We really ought to have a static type system for config(5) interface
 attributes to catch mistakes like this!

 Came up while trying to test a fix for:
 PR kern/59872: urndis(4): missing support for some devices


 To generate a diff of this commit:
 cvs rdiff -u -r1.49 -r1.49.8.1 src/sys/dev/usb/if_urndis.c
 cvs rdiff -u -r1.124 -r1.124.4.1 src/sys/dev/usb/usb.h
 cvs rdiff -u -r1.1 -r1.1.36.1 src/sys/modules/if_urndis/if_urndis.ioconf

 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->needs-pullups
State-Changed-By: maya@NetBSD.org
State-Changed-When: Wed, 02 Sep 2026 18:50:56 +0000
State-Changed-Why:
No pullup filed for netbsd-10 but suggested.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.