1.\" Copyright (c) 2004 Daniel Hartmeier 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 8.\" - Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" - Redistributions in binary form must reproduce the above 11.\" copyright notice, this list of conditions and the following 12.\" disclaimer in the documentation and/or other materials provided 13.\" with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 25.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26.\" POSSIBILITY OF SUCH DAMAGE. 27.\" 28.\" $NetBSD: cdce.4,v 1.4 2004/12/08 18:35:56 peter Exp $ 29.\" $FreeBSD$ 30.\" 31.Dd February 10, 2023 32.Dt CDCE 4 33.Os 34.Sh NAME 35.Nm cdce 36.Nd "USB Communication Device Class Ethernet (CDC ECM/NCM) driver" 37.Sh SYNOPSIS 38To compile this driver into the kernel, 39place the following lines in your 40kernel configuration file: 41.Bd -ragged -offset indent 42.Cd "device uhci" 43.Cd "device ohci" 44.Cd "device usb" 45.Cd "device miibus" 46.Cd "device uether" 47.Cd "device cdce" 48.Ed 49.Pp 50Mobile Devices (eg. Huawei E3372, E5573 and others) 51may need additionally the u3g command port: 52.Bd -ragged -offset indent 53.Cd "device ucom" 54.Cd "device u3g" 55.Ed 56.Pp 57Alternatively, to load the driver as a 58module at boot time, place the following line in 59.Xr loader.conf 5 : 60.Bd -literal -offset indent 61if_cdce_load="YES" 62.Ed 63.Sh DESCRIPTION 64The 65.Nm 66driver provides support for USB Host-to-Host (aka USB-to-USB) and 67USB-to-Ethernet bridges based on the USB Communication Device Class 68Ethernet Control Model (CDC ECM) and Network Control Model (CDC NCM) 69specifications. 70It also provides device-side CDC ECM support. 71.Pp 72The USB bridge appears as a regular network interface on both sides, 73transporting Ethernet frames. 74.Pp 75For more information on configuring this device, see 76.Xr ifconfig 8 . 77.Pp 78USB 1.x bridges support speeds of up to 12Mbps, and USB 2.0 speeds of 79up to 480Mbps. 80.Pp 81Packets are 82received and transmitted over separate USB bulk transfer endpoints. 83.Pp 84The 85.Nm 86driver does not support different media types or options. 87.Pp 88Mobile 89.Nm 90Network Devices may need a connect command sequence via u3g 91serial command port before they activate the NCM/ECM/ACM network 92interface. Example: echo 'AT^NDISUP=1,1,"internet"' > /dev/cuaU[0].0, 93where "internet" is your providers apn name. 94.Sh HARDWARE 95The following devices are supported by the 96.Nm 97driver: 98.Pp 99.Bl -bullet -compact 100.It 101Prolific PL-2501 Host-to-Host Bridge Controller 102.It 103Sharp Zaurus PDA 104.It 105Terayon TJ-715 DOCSIS Cable Modem 106.It 107Realtek RTL8156 USB GBE/2.5G Ethernet Family Controller 108.It 109Planex USB-LAN2500R 110.It 111Huawei 3G/4G LTE (eg. E3372, E5573) and other mobile network devices 112.El 113.Sh DIAGNOSTICS 114.Bl -diag 115.It "cdce%d: no union descriptor" 116The driver could not fetch an interface descriptor from the USB 117device. 118For a manually added USB vendor/product, the CDCE_NO_UNION flag 119can be tried to work around the missing descriptor. 120.It "cdce%d: no data interface" 121.It "cdce%d: could not read endpoint descriptor" 122.It "cdce%d: unexpected endpoint" 123.It "cdce%d: could not find data bulk in/out" 124For a manually added USB vendor/product, these errors indicate 125that the bridge is not compatible with the driver. 126.It "cdce%d: watchdog timeout" 127A packet was queued for transmission and a transmit command was 128issued, however the device failed to acknowledge the transmission 129before a timeout expired. 130.It "cdce%d: no memory for rx list -- packet dropped!" 131Memory allocation through MGETHDR or MCLGET failed, the system 132is running low on mbufs. 133.It "cdce%d: abort/close rx/tx pipe failed" 134.It "cdce%d: rx/tx list init failed" 135.It "cdce%d: open rx/tx pipe failed" 136.It "cdce%d: usb error on rx/tx" 137.El 138.Sh SEE ALSO 139.Xr arp 4 , 140.Xr cdceem 4 , 141.Xr intro 4 , 142.Xr ipheth 4 , 143.Xr netintro 4 , 144.Xr urndis 4 , 145.Xr usb 4 , 146.Xr ucom 4 , 147.Xr u3g 4 , 148.Xr ifconfig 8 149.Rs 150.%T "Universal Serial Bus Class Definitions for Communication Devices" 151.%U http://www.usb.org/developers/devclass_docs/usbcdc11.pdf 152.Re 153.Rs 154.%T "Data sheet Prolific PL-2501 Host-to-Host Bridge/Network Controller" 155.%U http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 156.Re 157.Sh HISTORY 158The 159.Nm 160device driver first appeared in 161.Ox 3.6 , 162.Nx 3.0 163and 164.Fx 6.0 . 165.Sh AUTHORS 166.An -nosplit 167The 168.Nm 169driver was written by 170.An Craig Boston Aq Mt craig@tobuj.gank.org 171based on the 172.Xr aue 4 173driver written by 174.An Bill Paul Aq Mt wpaul@windriver.com 175and ported to 176.Ox 177by 178.An Daniel Hartmeier Aq Mt dhartmei@openbsd.org . 179.Sh CAVEATS 180Many USB devices notoriously fail to report their class and interfaces 181correctly. 182Undetected products might work flawlessly when their vendor and product IDs 183are added to the driver manually. 184