16bcf0032SMaxim Sobolev.\" Copyright (c) 2004 Daniel Hartmeier 26bcf0032SMaxim Sobolev.\" All rights reserved. 36bcf0032SMaxim Sobolev.\" 46bcf0032SMaxim Sobolev.\" Redistribution and use in source and binary forms, with or without 56bcf0032SMaxim Sobolev.\" modification, are permitted provided that the following conditions 66bcf0032SMaxim Sobolev.\" are met: 76bcf0032SMaxim Sobolev.\" 86bcf0032SMaxim Sobolev.\" - Redistributions of source code must retain the above copyright 96bcf0032SMaxim Sobolev.\" notice, this list of conditions and the following disclaimer. 106bcf0032SMaxim Sobolev.\" - Redistributions in binary form must reproduce the above 116bcf0032SMaxim Sobolev.\" copyright notice, this list of conditions and the following 126bcf0032SMaxim Sobolev.\" disclaimer in the documentation and/or other materials provided 136bcf0032SMaxim Sobolev.\" with the distribution. 146bcf0032SMaxim Sobolev.\" 156bcf0032SMaxim Sobolev.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 166bcf0032SMaxim Sobolev.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 176bcf0032SMaxim Sobolev.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 186bcf0032SMaxim Sobolev.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 196bcf0032SMaxim Sobolev.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 206bcf0032SMaxim Sobolev.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 216bcf0032SMaxim Sobolev.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 226bcf0032SMaxim Sobolev.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 236bcf0032SMaxim Sobolev.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 246bcf0032SMaxim Sobolev.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 256bcf0032SMaxim Sobolev.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 266bcf0032SMaxim Sobolev.\" POSSIBILITY OF SUCH DAMAGE. 276bcf0032SMaxim Sobolev.\" 286bcf0032SMaxim Sobolev.\" $NetBSD: cdce.4,v 1.4 2004/12/08 18:35:56 peter Exp $ 296bcf0032SMaxim Sobolev.\" 306ea4d95fSLi-Wen Hsu.Dd May 3, 2024 316bcf0032SMaxim Sobolev.Dt CDCE 4 326bcf0032SMaxim Sobolev.Os 336bcf0032SMaxim Sobolev.Sh NAME 346bcf0032SMaxim Sobolev.Nm cdce 35163de4a1SEdward Tomasz Napierala.Nd "USB Communication Device Class Ethernet (CDC ECM/NCM) driver" 366bcf0032SMaxim Sobolev.Sh SYNOPSIS 3716d78bb8STom RhodesTo compile this driver into the kernel, 3816d78bb8STom Rhodesplace the following lines in your 3990296834STom Rhodeskernel configuration file: 4086e3186eSTom Rhodes.Bd -ragged -offset indent 416bcf0032SMaxim Sobolev.Cd "device uhci" 426bcf0032SMaxim Sobolev.Cd "device ohci" 436bcf0032SMaxim Sobolev.Cd "device usb" 44ff6b30b9SKevin Lo.Cd "device miibus" 45ff6b30b9SKevin Lo.Cd "device uether" 466bcf0032SMaxim Sobolev.Cd "device cdce" 4786e3186eSTom Rhodes.Ed 4886e3186eSTom Rhodes.Pp 4958e1d010SMichael PaepckeMobile Devices (eg. Huawei E3372, E5573 and others) 5058e1d010SMichael Paepckemay need additionally the u3g command port: 5158e1d010SMichael Paepcke.Bd -ragged -offset indent 5258e1d010SMichael Paepcke.Cd "device ucom" 5358e1d010SMichael Paepcke.Cd "device u3g" 5458e1d010SMichael Paepcke.Ed 5558e1d010SMichael Paepcke.Pp 5616d78bb8STom RhodesAlternatively, to load the driver as a 5716d78bb8STom Rhodesmodule at boot time, place the following line in 5886e3186eSTom Rhodes.Xr loader.conf 5 : 5986e3186eSTom Rhodes.Bd -literal -offset indent 6086e3186eSTom Rhodesif_cdce_load="YES" 6186e3186eSTom Rhodes.Ed 626bcf0032SMaxim Sobolev.Sh DESCRIPTION 636bcf0032SMaxim SobolevThe 646bcf0032SMaxim Sobolev.Nm 656bcf0032SMaxim Sobolevdriver provides support for USB Host-to-Host (aka USB-to-USB) and 666bcf0032SMaxim SobolevUSB-to-Ethernet bridges based on the USB Communication Device Class 67163de4a1SEdward Tomasz NapieralaEthernet Control Model (CDC ECM) and Network Control Model (CDC NCM) 68163de4a1SEdward Tomasz Napieralaspecifications. 69c7ad2706SEdward Tomasz NapieralaIt also provides device-side CDC ECM support. 706bcf0032SMaxim Sobolev.Pp 716bcf0032SMaxim SobolevThe USB bridge appears as a regular network interface on both sides, 726bcf0032SMaxim Sobolevtransporting Ethernet frames. 736bcf0032SMaxim Sobolev.Pp 746bcf0032SMaxim SobolevFor more information on configuring this device, see 756bcf0032SMaxim Sobolev.Xr ifconfig 8 . 766bcf0032SMaxim Sobolev.Pp 776bcf0032SMaxim SobolevUSB 1.x bridges support speeds of up to 12Mbps, and USB 2.0 speeds of 786bcf0032SMaxim Sobolevup to 480Mbps. 796bcf0032SMaxim Sobolev.Pp 806bcf0032SMaxim SobolevPackets are 816bcf0032SMaxim Sobolevreceived and transmitted over separate USB bulk transfer endpoints. 826bcf0032SMaxim Sobolev.Pp 836bcf0032SMaxim SobolevThe 846bcf0032SMaxim Sobolev.Nm 856bcf0032SMaxim Sobolevdriver does not support different media types or options. 8658e1d010SMichael Paepcke.Pp 8758e1d010SMichael PaepckeMobile 8858e1d010SMichael Paepcke.Nm 8958e1d010SMichael PaepckeNetwork Devices may need a connect command sequence via u3g 9058e1d010SMichael Paepckeserial command port before they activate the NCM/ECM/ACM network 916957cd86SKonstantin Belousovinterface. 926957cd86SKonstantin BelousovFor example: 936957cd86SKonstantin Belousov.Dl echo 'AT^NDISUP=1,1,"internet"' > /dev/cuaU[0].0 946957cd86SKonstantin Belousovwhere 956957cd86SKonstantin Belousov.Dq internet 966957cd86SKonstantin Belousovis your providers apn name. 97d1625404SJoel Dahl.Sh HARDWARE 98d1625404SJoel DahlThe following devices are supported by the 99d1625404SJoel Dahl.Nm 100d1625404SJoel Dahldriver: 101d1625404SJoel Dahl.Pp 102d1625404SJoel Dahl.Bl -bullet -compact 103d1625404SJoel Dahl.It 104d1625404SJoel DahlProlific PL-2501 Host-to-Host Bridge Controller 105d1625404SJoel Dahl.It 106d1625404SJoel DahlSharp Zaurus PDA 107d1625404SJoel Dahl.It 108d1625404SJoel DahlTerayon TJ-715 DOCSIS Cable Modem 1092625e519SHiroki Sato.It 11058e1d010SMichael PaepckeHuawei 3G/4G LTE (eg. E3372, E5573) and other mobile network devices 111d1625404SJoel Dahl.El 1126bcf0032SMaxim Sobolev.Sh DIAGNOSTICS 1136bcf0032SMaxim Sobolev.Bl -diag 1146bcf0032SMaxim Sobolev.It "cdce%d: no union descriptor" 11510119847SJoel DahlThe driver could not fetch an interface descriptor from the USB 1166bcf0032SMaxim Sobolevdevice. 1176bcf0032SMaxim SobolevFor a manually added USB vendor/product, the CDCE_NO_UNION flag 1186bcf0032SMaxim Sobolevcan be tried to work around the missing descriptor. 1196bcf0032SMaxim Sobolev.It "cdce%d: no data interface" 1206bcf0032SMaxim Sobolev.It "cdce%d: could not read endpoint descriptor" 1216bcf0032SMaxim Sobolev.It "cdce%d: unexpected endpoint" 1226bcf0032SMaxim Sobolev.It "cdce%d: could not find data bulk in/out" 1236bcf0032SMaxim SobolevFor a manually added USB vendor/product, these errors indicate 1246bcf0032SMaxim Sobolevthat the bridge is not compatible with the driver. 1256bcf0032SMaxim Sobolev.It "cdce%d: watchdog timeout" 1266bcf0032SMaxim SobolevA packet was queued for transmission and a transmit command was 1276bcf0032SMaxim Sobolevissued, however the device failed to acknowledge the transmission 1286bcf0032SMaxim Sobolevbefore a timeout expired. 1296bcf0032SMaxim Sobolev.It "cdce%d: no memory for rx list -- packet dropped!" 1306bcf0032SMaxim SobolevMemory allocation through MGETHDR or MCLGET failed, the system 1316bcf0032SMaxim Sobolevis running low on mbufs. 1326bcf0032SMaxim Sobolev.It "cdce%d: abort/close rx/tx pipe failed" 1336bcf0032SMaxim Sobolev.It "cdce%d: rx/tx list init failed" 1346bcf0032SMaxim Sobolev.It "cdce%d: open rx/tx pipe failed" 1356bcf0032SMaxim Sobolev.It "cdce%d: usb error on rx/tx" 1366bcf0032SMaxim Sobolev.El 1376bcf0032SMaxim Sobolev.Sh SEE ALSO 1386bcf0032SMaxim Sobolev.Xr arp 4 , 13963722e52SEdward Tomasz Napierala.Xr cdceem 4 , 1406bcf0032SMaxim Sobolev.Xr intro 4 , 141425258e2SGavin Atkinson.Xr ipheth 4 , 1426bcf0032SMaxim Sobolev.Xr netintro 4 , 143*6e1fc011SGraham Percival.Xr u3g 4 , 144*6e1fc011SGraham Percival.Xr ucom 4 , 145425258e2SGavin Atkinson.Xr urndis 4 , 1466bcf0032SMaxim Sobolev.Xr usb 4 , 1476bcf0032SMaxim Sobolev.Xr ifconfig 8 1486bcf0032SMaxim Sobolev.Rs 1496bcf0032SMaxim Sobolev.%T "Universal Serial Bus Class Definitions for Communication Devices" 150aa4a335bSRuslan Ermilov.%U http://www.usb.org/developers/devclass_docs/usbcdc11.pdf 1516bcf0032SMaxim Sobolev.Re 1526bcf0032SMaxim Sobolev.Rs 1536bcf0032SMaxim Sobolev.%T "Data sheet Prolific PL-2501 Host-to-Host Bridge/Network Controller" 154aa4a335bSRuslan Ermilov.%U http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 1556bcf0032SMaxim Sobolev.Re 1566bcf0032SMaxim Sobolev.Sh HISTORY 1576bcf0032SMaxim SobolevThe 1586bcf0032SMaxim Sobolev.Nm 1596bcf0032SMaxim Sobolevdevice driver first appeared in 1606bcf0032SMaxim Sobolev.Ox 3.6 , 1616bcf0032SMaxim Sobolev.Nx 3.0 1626bcf0032SMaxim Sobolevand 1636bcf0032SMaxim Sobolev.Fx 6.0 . 1646bcf0032SMaxim Sobolev.Sh AUTHORS 165a4be0b3cSRuslan Ermilov.An -nosplit 1666bcf0032SMaxim SobolevThe 1676bcf0032SMaxim Sobolev.Nm 1686bcf0032SMaxim Sobolevdriver was written by 1696c899950SBaptiste Daroussin.An Craig Boston Aq Mt craig@tobuj.gank.org 1706bcf0032SMaxim Sobolevbased on the 1716bcf0032SMaxim Sobolev.Xr aue 4 1726bcf0032SMaxim Sobolevdriver written by 1736c899950SBaptiste Daroussin.An Bill Paul Aq Mt wpaul@windriver.com 1746bcf0032SMaxim Sobolevand ported to 1756bcf0032SMaxim Sobolev.Ox 1766bcf0032SMaxim Sobolevby 1776c899950SBaptiste Daroussin.An Daniel Hartmeier Aq Mt dhartmei@openbsd.org . 1786bcf0032SMaxim Sobolev.Sh CAVEATS 1796bcf0032SMaxim SobolevMany USB devices notoriously fail to report their class and interfaces 1806bcf0032SMaxim Sobolevcorrectly. 1816bcf0032SMaxim SobolevUndetected products might work flawlessly when their vendor and product IDs 1826bcf0032SMaxim Sobolevare added to the driver manually. 183