xref: /freebsd/share/man/man4/cdce.4 (revision 61e21613)
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.\"
30.Dd February 10, 2023
31.Dt CDCE 4
32.Os
33.Sh NAME
34.Nm cdce
35.Nd "USB Communication Device Class Ethernet (CDC ECM/NCM) driver"
36.Sh SYNOPSIS
37To compile this driver into the kernel,
38place the following lines in your
39kernel configuration file:
40.Bd -ragged -offset indent
41.Cd "device uhci"
42.Cd "device ohci"
43.Cd "device usb"
44.Cd "device miibus"
45.Cd "device uether"
46.Cd "device cdce"
47.Ed
48.Pp
49Mobile Devices (eg. Huawei E3372, E5573 and others)
50may need additionally the u3g command port:
51.Bd -ragged -offset indent
52.Cd "device ucom"
53.Cd "device u3g"
54.Ed
55.Pp
56Alternatively, to load the driver as a
57module at boot time, place the following line in
58.Xr loader.conf 5 :
59.Bd -literal -offset indent
60if_cdce_load="YES"
61.Ed
62.Sh DESCRIPTION
63The
64.Nm
65driver provides support for USB Host-to-Host (aka USB-to-USB) and
66USB-to-Ethernet bridges based on the USB Communication Device Class
67Ethernet Control Model (CDC ECM) and Network Control Model (CDC NCM)
68specifications.
69It also provides device-side CDC ECM support.
70.Pp
71The USB bridge appears as a regular network interface on both sides,
72transporting Ethernet frames.
73.Pp
74For more information on configuring this device, see
75.Xr ifconfig 8 .
76.Pp
77USB 1.x bridges support speeds of up to 12Mbps, and USB 2.0 speeds of
78up to 480Mbps.
79.Pp
80Packets are
81received and transmitted over separate USB bulk transfer endpoints.
82.Pp
83The
84.Nm
85driver does not support different media types or options.
86.Pp
87Mobile
88.Nm
89Network Devices may need a connect command sequence via u3g
90serial command port before they activate the NCM/ECM/ACM network
91interface.
92For example:
93.Dl echo 'AT^NDISUP=1,1,"internet"' > /dev/cuaU[0].0
94where
95.Dq internet
96is your providers apn name.
97.Sh HARDWARE
98The following devices are supported by the
99.Nm
100driver:
101.Pp
102.Bl -bullet -compact
103.It
104Prolific PL-2501 Host-to-Host Bridge Controller
105.It
106Sharp Zaurus PDA
107.It
108Terayon TJ-715 DOCSIS Cable Modem
109.It
110Realtek RTL8156 USB GBE/2.5G Ethernet Family Controller
111.It
112Planex USB-LAN2500R
113.It
114Huawei 3G/4G LTE (eg. E3372, E5573) and other mobile network devices
115.El
116.Sh DIAGNOSTICS
117.Bl -diag
118.It "cdce%d: no union descriptor"
119The driver could not fetch an interface descriptor from the USB
120device.
121For a manually added USB vendor/product, the CDCE_NO_UNION flag
122can be tried to work around the missing descriptor.
123.It "cdce%d: no data interface"
124.It "cdce%d: could not read endpoint descriptor"
125.It "cdce%d: unexpected endpoint"
126.It "cdce%d: could not find data bulk in/out"
127For a manually added USB vendor/product, these errors indicate
128that the bridge is not compatible with the driver.
129.It "cdce%d: watchdog timeout"
130A packet was queued for transmission and a transmit command was
131issued, however the device failed to acknowledge the transmission
132before a timeout expired.
133.It "cdce%d: no memory for rx list -- packet dropped!"
134Memory allocation through MGETHDR or MCLGET failed, the system
135is running low on mbufs.
136.It "cdce%d: abort/close rx/tx pipe failed"
137.It "cdce%d: rx/tx list init failed"
138.It "cdce%d: open rx/tx pipe failed"
139.It "cdce%d: usb error on rx/tx"
140.El
141.Sh SEE ALSO
142.Xr arp 4 ,
143.Xr cdceem 4 ,
144.Xr intro 4 ,
145.Xr ipheth 4 ,
146.Xr netintro 4 ,
147.Xr urndis 4 ,
148.Xr usb 4 ,
149.Xr ucom 4 ,
150.Xr u3g 4 ,
151.Xr ifconfig 8
152.Rs
153.%T "Universal Serial Bus Class Definitions for Communication Devices"
154.%U http://www.usb.org/developers/devclass_docs/usbcdc11.pdf
155.Re
156.Rs
157.%T "Data sheet Prolific PL-2501 Host-to-Host Bridge/Network Controller"
158.%U http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530
159.Re
160.Sh HISTORY
161The
162.Nm
163device driver first appeared in
164.Ox 3.6 ,
165.Nx 3.0
166and
167.Fx 6.0 .
168.Sh AUTHORS
169.An -nosplit
170The
171.Nm
172driver was written by
173.An Craig Boston Aq Mt craig@tobuj.gank.org
174based on the
175.Xr aue 4
176driver written by
177.An Bill Paul Aq Mt wpaul@windriver.com
178and ported to
179.Ox
180by
181.An Daniel Hartmeier Aq Mt dhartmei@openbsd.org .
182.Sh CAVEATS
183Many USB devices notoriously fail to report their class and interfaces
184correctly.
185Undetected products might work flawlessly when their vendor and product IDs
186are added to the driver manually.
187