Project

General

Profile

Actions

Feature #6574

open

Support USB RNDIS network interfaces

Added by Bruce Simpson over 8 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Hardware / Drivers
Target version:
-
Start date:
07/03/2016
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:

Description

TL;DR -- the FreeBSD urndis(4) driver needs some serious attention.

People cannot buy discrete ADSL2+ modem cards any more. Many manufacturers offer only integrated WiFi/router devices (Internet Access Devices, IADs). Sometimes these also have a USB interface. Microsoft-style Remote NDIS is a popular implementation approach. FreeBSD purports to support this through the urndis(4) driver.

USB is also desirable as an interconnect in low port count situations, and to satisfy power requirements. For ADSL2+, the data rate is probably not going to be impacted too much, given the relatively high latency of ADSL in general.

urndis(4) is not shipped as part of pfSense -- I copied a verbatim copy of the FreeBSD 10.3-RELEASE urndis.ko module for i386, testing on an ALIX 6D2.

However, I was unable to get pfSense to recognise a TP-Link TD-8817 ADSL2 modem. Linux correctly recognises it as an rndis_host device and can readily use its connectivity. With sysctl hw.usb.urndis.debug=999:

%%
ugen1.3: <vendor 0x12a7> at usbus1
urndis0: <vendor 0x12a7 product 0x3160, class 2/0, rev 2.00/2.20, addr 3> on usbus1
urndis0: No valid alternate setting found
device_attach: urndis0 attach returned 6
ugen1.3: <vendor 0x12a7> at usbus1 (disconnected)
ugen1.3: <vendor 0x12a7> at usbus1
urndis0: <vendor 0x12a7 product 0x3160, class 2/0, rev 2.00/2.20, addr 3> on usbus1
urndis0: No valid alternate setting found
device_attach: urndis0 attach returned 6
%%

On FreeBSD, it gets picked up by the generic match in urndis_host_devs[]. However, it's finding the alternate interface that bugs out. The interrupt endpoint is in the primary (default) interface containing the CDC metadata.

This appears to be off-by-one -- but that would be wrong. bInterfaceNumber is 1, but FreeBSD is going only on bDataInterface, which is 0. Ooops; dead wrong. That interface is already used for the base CDC attachment. bSlaveInterface however is set correctly. This is not examined at all by urndis(4).

Linux leverages its existing CDC stack, and correctly probes bSlaveInterface. TL;DR -- It didn't get done in FreeBSD. OpenBSD's code is too far off now for much to make sense.

(OT: There are also glaring errors in the FreeBSD manual pages. Android devices have not used RNDIS for many, many years, if at all -- they are all USB CDC ACM, just about.)


Files

td-8817-usbconfigdesc.txt (3.18 KB) td-8817-usbconfigdesc.txt Bruce Simpson, 07/03/2016 02:06 PM
Actions

Also available in: Atom PDF