]> git.lizzy.rs Git - plan9front.git/blob - sys/man/4/nusb
/sys/man/*/*: fix perms (sorry)
[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 ther 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 .I 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 formatd as 6 digit hexadecimal.
113 .I Usbd
114 assigns a stable device unique name based on the
115 device descriptor for
116 .I 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 unique name
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 to
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 a88772
185 or
186 .BR a88178
187 (see
188 .IR nusbrc (8)).
189 On devices that support it, the mac address can be set using
190 the
191 .B -a
192 .IR addr
193 option.
194 .SS Serial and JTAG ports
195 .I Serial
196 provides a file system (usually seen under
197 .BR /dev )
198 that includes one directory per USB serial port, named
199 .BI eiaU N
200 or
201 .BI eiaU N [. M ].
202 In this directory there are two files,
203 .BR eiaU ,
204 similar to
205 .BI eia N
206 in
207 .IR uart (3),
208 and
209 .BR eiaUctl ,
210 which admits writes in the same format as
211 .BI eia N ctl
212 in
213 .IR uart (3).
214 Reading from
215 .B eiaUctl
216 gives the serial port's settings in the same format as
217 .BI eia N status
218 in
219 .IR uart (3).
220 Options are similar to those of
221 .IR disk .
222 .PP
223 JTAG ports are similar
224 but the files are named
225 .B jtag
226 and
227 .BR jtagctl .
228 .
229 .SS Audio devices
230 .I Audio
231 configures and manages a USB audio device.
232 It implements a file system, (normally seen under
233 .BI /dev )
234 compatible to
235 .IR audio (3).
236 .SH SOURCE
237 .B /sys/src/cmd/nusb
238 .SH "SEE ALSO"
239 .IR audio (3),
240 .IR ether (3),
241 .IR mouse (3),
242 .IR sd (3),
243 .IR uart (3),
244 .IR usb (3),
245 .IR shr (3),
246 .IR nusbrc (8),
247 .IR kbdfs (8)
248 .SH BUGS
249 The various device drivers are generic USB drivers and
250 may work only for certain devices of each class.
251 .PP
252 USB ATA storage devices are not supported.
253 .PP
254 The serial driver works only for the Prolific chip and Ftdi,
255 and control of the
256 .B dcd
257 and
258 .B dsr
259 signals and some of the extra features are not implemented.
260 For Ftdi, only the Sheevaplug and Guruplug have been tried.
261 There is support for the EHCI debug port, but it loses bytes.