]> git.lizzy.rs Git - plan9front.git/blob - sys/man/4/nusb
man page fixes (thanks stuart morrow)
[plan9front.git] / sys / man / 4 / nusb
1 .TH NUSB 4
2 .SH NAME
3 audio,
4 disk,
5 ether,
6 kb,
7 serial,
8 ptp,
9 usbd - Universal Serial Bus drivers
10 .SH SYNOPSIS
11 .B nusb/audio
12 .I devid
13 .PP
14 .B nusb/disk
15 [
16 .B -d
17 ]
18 .I devid
19 .PP
20 .B nusb/ether
21 [
22 .B -dD
23 ] [
24 .B -t
25 .I ethertype
26 ] [
27 .B -a
28 .I addr
29 ]
30 .I devid
31 .PP
32 .B nusb/kb
33 [
34 .B -d
35 ]
36 .I devid
37 .PP
38 .B nusb/serial
39 [
40 .B -d
41 ]
42 .I devid
43 .PP
44 .B nusb/ptp
45 [
46 .B -dD
47 ]
48 .I devid
49 .PP
50 .B nusb/usbd
51 [
52 .B -dD
53 ]
54 .SH DESCRIPTION
55 These programs drive USB devices of specific classes via
56 .IR usb (3).
57 Usually they are started by
58 .IR nusbrc (8)
59 upon attachment of the device to the bus. All drivers except
60 .I usbd
61 take the decimal usb 
62 .I devid
63 of the device they should handle as their last argument. A
64 driver's instance handles only one device at a time.
65 .PP
66 Drivers that provide file systems make them available as shares under
67 .B /shr
68 (see
69 .IR shr (3))
70 or
71 .BR /shr/usb
72 (which is bound after
73 .BR /dev
74 by
75 .IR nusbrc (8)). 
76 .PP
77 Options
78 .B \-d
79 and
80 .B \-D
81 trigger debug diagnostics and file system debugging
82 diagnostics for most drivers. Repeating any one of these may
83 increase verbosity.
84 .SS Hubs
85 .I Usbd
86 enumerates the tree of USB hubs and configures the device on
87 attachment. It provides a filesystem with the file
88 .B usbevent
89 (usually seen as
90 .BR /dev/usbevent )
91 which, when read, returns a 6-column, space-separated line of
92 text, one for each event. The columns are:
93 .B attach
94 or
95 .B detach
96 followed by
97 .I addr
98 .I vid
99 .I did
100 .I csp
101 and
102 .IR hname .
103 The
104 .I addr
105 is the decimal device address assigned.
106 .I Vid
107 and
108 .I did
109 are formatted as 4 digit hexadecimal.
110 .I Csp
111 is the device class, subclass, protocol indentifier
112 formatted as 6 digit hexadecimal.
113 .I Usbd
114 assigns a stable device identifier based on the
115 device descriptor for
116 .IR hname .
117 This information is read by
118 .IR nusbrc (8)
119 and the
120 .I addr
121 and
122 .I hname
123 are passed to a suitable driver as
124 .I devid
125 in the form \fIaddr\fB:\fIhname
126 .SS Keyboards and mice
127 .I Kb
128 supports USB keyboards and mice either as separate USB devices
129 or as a single combined USB device.
130 Scan codes from the keyboard are sent to
131 .B /dev/kbin
132 to let
133 .IR kbdfs (8)
134 process them.
135 Mouse events are sent to
136 .BR /dev/mousein
137 in the same way.
138 .SS Disks
139 .I Disk
140 configures and manages USB mass storage devices. It
141 provides a file system (usually seen under
142 .BR /dev )
143 that includes one directory per storage device, named
144 .BI sdU N [. M ]
145 in correspondence with the USB device identifier
146 and the storage unit number (or LUN). The LUN is omited
147 for single lun devices.
148 .PP
149 The storage device directory contains the usual files
150 served by
151 .IR sd (3):
152 .BR data ,
153 .BR raw ,
154 and
155 .BR ctl .
156 .PP
157 The
158 .B ctl
159 file supplies the device geometry and partitions when read.
160 .SS Ethernet
161 .I Ether
162 handles USB ethernet devices. The file system provided is
163 compatible with
164 .IR ether (3)
165 and added to the share
166 .B usbnet
167 (see
168 .IR shr (3))
169 which is bound after
170 .B /net
171 by
172 .IR nusbrc (8)
173 so the device will appear as
174 .BI /net/etherU N .
175 Without specifying the
176 .B -t
177 option, the device is assumed to be a CDC compliant ethernet
178 communication device. Other devices might require setting an
179 explicit
180 .IR ethertype ,
181 such as
182 .BR rndis ,
183 .BR smsc ,
184 .BR url ,
185 .BR lan78xx ,
186 .BR aue ,
187 .BR a88772
188 or
189 .BR a88178
190 (see
191 .IR nusbrc (8)).
192 On devices that support it, the mac address can be set using
193 the
194 .B -a
195 .IR addr
196 option.
197 .SS Serial and JTAG ports
198 .I Serial
199 provides a file system (usually seen under
200 .BR /dev )
201 that includes one directory per USB serial port, named
202 .BI eiaU N
203 or
204 .BI eiaU N [. M ].
205 In this directory there are two files,
206 .BR eiaU ,
207 similar to
208 .BI eia N
209 in
210 .IR uart (3),
211 and
212 .BR eiaUctl ,
213 which admits writes in the same format as
214 .BI eia N ctl
215 in
216 .IR uart (3).
217 Reading from
218 .B eiaUctl
219 gives the serial port's settings in the same format as
220 .BI eia N status
221 in
222 .IR uart (3).
223 Options are similar to those of
224 .IR disk .
225 .PP
226 JTAG ports are similar
227 but the files are named
228 .B jtag
229 and
230 .BR jtagctl .
231 .
232 .SS Audio devices
233 .I Audio
234 configures and manages a USB audio device.
235 It implements a file system (normally seen under
236 .BR /dev ),
237 compatible with
238 .IR audio (3).
239 .SH SOURCE
240 .B /sys/src/cmd/nusb
241 .SH "SEE ALSO"
242 .IR audio (3),
243 .IR ether (3),
244 .IR mouse (3),
245 .IR sd (3),
246 .IR uart (3),
247 .IR usb (3),
248 .IR shr (3),
249 .IR nusbrc (8),
250 .IR kbdfs (8)
251 .SH BUGS
252 The various device drivers are generic USB drivers and
253 may work only for certain devices of each class.
254 .PP
255 USB ATA storage devices are not supported.
256 .PP
257 The serial driver works only for the Prolific chip and Ftdi,
258 and control of the
259 .B dcd
260 and
261 .B dsr
262 signals and some of the extra features are not implemented.
263 For Ftdi, only the Sheevaplug and Guruplug have been tried.
264 There is support for the EHCI debug port, but it loses bytes.