aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /Documentation/usb
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'Documentation/usb')
-rw-r--r--Documentation/usb/CREDITS175
-rw-r--r--Documentation/usb/URB.txt252
-rw-r--r--Documentation/usb/acm.txt138
-rw-r--r--Documentation/usb/auerswald.txt30
-rw-r--r--Documentation/usb/bluetooth.txt44
-rw-r--r--Documentation/usb/dma.txt116
-rw-r--r--Documentation/usb/ehci.txt212
-rw-r--r--Documentation/usb/error-codes.txt167
-rw-r--r--Documentation/usb/gadget_serial.txt332
-rw-r--r--Documentation/usb/hiddev.txt205
-rw-r--r--Documentation/usb/hotplug.txt148
-rw-r--r--Documentation/usb/ibmcam.txt324
-rw-r--r--Documentation/usb/linux.inf200
-rw-r--r--Documentation/usb/mtouchusb.txt76
-rw-r--r--Documentation/usb/ohci.txt32
-rw-r--r--Documentation/usb/ov511.txt289
-rw-r--r--Documentation/usb/proc_usb_info.txt371
-rw-r--r--Documentation/usb/rio.txt138
-rw-r--r--Documentation/usb/se401.txt54
-rw-r--r--Documentation/usb/sn9c102.txt480
-rw-r--r--Documentation/usb/stv680.txt55
-rw-r--r--Documentation/usb/uhci.txt165
-rw-r--r--Documentation/usb/usb-help.txt19
-rw-r--r--Documentation/usb/usb-serial.txt470
-rw-r--r--Documentation/usb/usbmon.txt156
-rw-r--r--Documentation/usb/w9968cf.txt481
26 files changed, 5129 insertions, 0 deletions
diff --git a/Documentation/usb/CREDITS b/Documentation/usb/CREDITS
new file mode 100644
index 000000000000..01e7f857ef35
--- /dev/null
+++ b/Documentation/usb/CREDITS
@@ -0,0 +1,175 @@
1Credits for the Simple Linux USB Driver:
2
3The following people have contributed to this code (in alphabetical
4order by last name). I'm sure this list should be longer, its
5difficult to maintain, add yourself with a patch if desired.
6
7 Georg Acher <acher@informatik.tu-muenchen.de>
8 David Brownell <dbrownell@users.sourceforge.net>
9 Alan Cox <alan@lxorguk.ukuu.org.uk>
10 Randy Dunlap <randy.dunlap@intel.com>
11 Johannes Erdfelt <johannes@erdfelt.com>
12 Deti Fliegl <deti@fliegl.de>
13 ham <ham@unsuave.com>
14 Bradley M Keryan <keryan@andrew.cmu.edu>
15 Greg Kroah-Hartman <greg@kroah.com>
16 Pavel Machek <pavel@suse.cz>
17 Paul Mackerras <paulus@cs.anu.edu.au>
18 Petko Manlolov <petkan@dce.bg>
19 David E. Nelson <dnelson@jump.net>
20 Vojtech Pavlik <vojtech@suse.cz>
21 Bill Ryder <bryder@sgi.com>
22 Thomas Sailer <sailer@ife.ee.ethz.ch>
23 Gregory P. Smith <greg@electricrain.com>
24 Linus Torvalds <torvalds@osdl.org>
25 Roman Weissgaerber <weissg@vienna.at>
26 <Kazuki.Yasumatsu@fujixerox.co.jp>
27
28Special thanks to:
29
30 Inaky Perez Gonzalez <inaky@peloncho.fis.ucm.es> for starting the
31 Linux USB driver effort and writing much of the larger uusbd driver.
32 Much has been learned from that effort.
33
34 The NetBSD & FreeBSD USB developers. For being on the Linux USB list
35 and offering suggestions and sharing implementation experiences.
36
37Additional thanks to the following companies and people for donations
38of hardware, support, time and development (this is from the original
39THANKS file in Inaky's driver):
40
41 The following corporations have helped us in the development
42 of Linux USB / UUSBD:
43
44 - 3Com GmbH for donating a ISDN Pro TA and supporting me
45 in technical questions and with test equipment. I'd never
46 expect such a great help.
47
48 - USAR Systems provided us with one of their excellent USB
49 Evaluation Kits. It allows us to test the Linux-USB driver
50 for compliance with the latest USB specification. USAR
51 Systems recognized the importance of an up-to-date open
52 Operating System and supports this project with
53 Hardware. Thanks!.
54
55 - Thanks to Intel Corporation for their precious help.
56
57 - We teamed up with Cherry to make Linux the first OS with
58 built-in USB support. Cherry is one of the biggest keyboard
59 makers in the world.
60
61 - CMD Technology, Inc. sponsored us kindly donating a CSA-6700
62 PCI-to-USB Controller Board to test the OHCI implementation.
63
64 - Due to their support to us, Keytronic can be sure that they
65 will sell keyboards to some of the 3 million (at least)
66 Linux users.
67
68 - Many thanks to ing büro h doran [http://www.ibhdoran.com]!
69 It was almost impossible to get a PC backplate USB connector
70 for the motherboard here at Europe (mine, home-made, was
71 quite lousy :). Now I know where to acquire nice USB stuff!
72
73 - Genius Germany donated a USB mouse to test the mouse boot
74 protocol. They've also donated a F-23 digital joystick and a
75 NetMouse Pro. Thanks!
76
77 - AVM GmbH Berlin is supporting the development of the Linux
78 USB driver for the AVM ISDN Controller B1 USB. AVM is a
79 leading manufacturer for active and passive ISDN Controllers
80 and CAPI 2.0-based software. The active design of the AVM B1
81 is open for all OS platforms, including Linux.
82
83 - Thanks to Y-E Data, Inc. for donating their FlashBuster-U
84 USB Floppy Disk Drive, so we could test the bulk transfer
85 code.
86
87 - Many thanks to Logitech for contributing a three axis USB
88 mouse.
89
90 Logitech designs, manufactures and markets
91 Human Interface Devices, having a long history and
92 experience in making devices such as keyboards, mice,
93 trackballs, cameras, loudspeakers and control devices for
94 gaming and professional use.
95
96 Being a recognized vendor and seller for all these devices,
97 they have donated USB mice, a joystick and a scanner, as a
98 way to acknowledge the importance of Linux and to allow
99 Logitech customers to enjoy support in their favorite
100 operating systems and all Linux users to use Logitech and
101 other USB hardware.
102
103 Logitech is official sponsor of the Linux Conference on
104 Feb. 11th 1999 in Vienna, where we'll will present the
105 current state of the Linux USB effort.
106
107 - CATC has provided means to uncover dark corners of the UHCI
108 inner workings with a USB Inspector.
109
110 - Thanks to Entrega for providing PCI to USB cards, hubs and
111 converter products for development.
112
113 - Thanks to ConnectTech for providing a WhiteHEAT usb to
114 serial converter, and the documentation for the device to
115 allow a driver to be written.
116
117 - Thanks to ADMtek for providing Pegasus and Pegasus II
118 evaluation boards, specs and valuable advices during
119 the driver development.
120
121 And thanks go to (hey! in no particular order :)
122
123 - Oren Tirosh <orenti@hishome.net>, for standing so patiently
124 all my doubts'bout USB and giving lots of cool ideas.
125
126 - Jochen Karrer <karrer@wpfd25.physik.uni-wuerzburg.de>, for
127 pointing out mortal bugs and giving advice.
128
129 - Edmund Humemberger <ed@atnet.at>, for it's great work on
130 public relationships and general management stuff for the
131 Linux-USB effort.
132
133 - Alberto Menegazzi <flash@flash.iol.it> is starting the
134 documentation for the UUSBD. Go for it!
135
136 - Ric Klaren <ia_ric@cs.utwente.nl> for doing nice
137 introductory documents (competing with Alberto's :).
138
139 - Christian Groessler <cpg@aladdin.de>, for it's help on those
140 itchy bits ... :)
141
142 - Paul MacKerras for polishing OHCI and pushing me harder for
143 the iMac support, giving improvements and enhancements.
144
145 - Fernando Herrera <fherrera@eurielec.etsit.upm.es> has taken
146 charge of composing, maintaining and feeding the
147 long-awaited, unique and marvelous UUSBD FAQ! Tadaaaa!!!
148
149 - Rasca Gmelch <thron@gmx.de> has revived the raw driver and
150 pointed bugs, as well as started the uusbd-utils package.
151
152 - Peter Dettori <dettori@ozy.dec.com> is uncovering bugs like
153 crazy, as well as making cool suggestions, great :)
154
155 - All the Free Software and Linux community, the FSF & the GNU
156 project, the MIT X consortium, the TeX people ... everyone!
157 You know who you are!
158
159 - Big thanks to Richard Stallman for creating Emacs!
160
161 - The people at the linux-usb mailing list, for reading so
162 many messages :) Ok, no more kidding; for all your advises!
163
164 - All the people at the USB Implementors Forum for their
165 help and assistance.
166
167 - Nathan Myers <ncm@cantrip.org>, for his advice! (hope you
168 liked Cibeles' party).
169
170 - Linus Torvalds, for starting, developing and managing Linux.
171
172 - Mike Smith, Craig Keithley, Thierry Giron and Janet Schank
173 for convincing me USB Standard hubs are not that standard
174 and that's good to allow for vendor specific quirks on the
175 standard hub driver.
diff --git a/Documentation/usb/URB.txt b/Documentation/usb/URB.txt
new file mode 100644
index 000000000000..d59b95cc6f1b
--- /dev/null
+++ b/Documentation/usb/URB.txt
@@ -0,0 +1,252 @@
1Revised: 2000-Dec-05.
2Again: 2002-Jul-06
3
4 NOTE:
5
6 The USB subsystem now has a substantial section in "The Linux Kernel API"
7 guide (in Documentation/DocBook), generated from the current source
8 code. This particular documentation file isn't particularly current or
9 complete; don't rely on it except for a quick overview.
10
11
121.1. Basic concept or 'What is an URB?'
13
14The basic idea of the new driver is message passing, the message itself is
15called USB Request Block, or URB for short.
16
17- An URB consists of all relevant information to execute any USB transaction
18 and deliver the data and status back.
19
20- Execution of an URB is inherently an asynchronous operation, i.e. the
21 usb_submit_urb(urb) call returns immediately after it has successfully queued
22 the requested action.
23
24- Transfers for one URB can be canceled with usb_unlink_urb(urb) at any time.
25
26- Each URB has a completion handler, which is called after the action
27 has been successfully completed or canceled. The URB also contains a
28 context-pointer for passing information to the completion handler.
29
30- Each endpoint for a device logically supports a queue of requests.
31 You can fill that queue, so that the USB hardware can still transfer
32 data to an endpoint while your driver handles completion of another.
33 This maximizes use of USB bandwidth, and supports seamless streaming
34 of data to (or from) devices when using periodic transfer modes.
35
36
371.2. The URB structure
38
39Some of the fields in an URB are:
40
41struct urb
42{
43// (IN) device and pipe specify the endpoint queue
44 struct usb_device *dev; // pointer to associated USB device
45 unsigned int pipe; // endpoint information
46
47 unsigned int transfer_flags; // ISO_ASAP, SHORT_NOT_OK, etc.
48
49// (IN) all urbs need completion routines
50 void *context; // context for completion routine
51 void (*complete)(struct urb *); // pointer to completion routine
52
53// (OUT) status after each completion
54 int status; // returned status
55
56// (IN) buffer used for data transfers
57 void *transfer_buffer; // associated data buffer
58 int transfer_buffer_length; // data buffer length
59 int number_of_packets; // size of iso_frame_desc
60
61// (OUT) sometimes only part of CTRL/BULK/INTR transfer_buffer is used
62 int actual_length; // actual data buffer length
63
64// (IN) setup stage for CTRL (pass a struct usb_ctrlrequest)
65 unsigned char* setup_packet; // setup packet (control only)
66
67// Only for PERIODIC transfers (ISO, INTERRUPT)
68 // (IN/OUT) start_frame is set unless ISO_ASAP isn't set
69 int start_frame; // start frame
70 int interval; // polling interval
71
72 // ISO only: packets are only "best effort"; each can have errors
73 int error_count; // number of errors
74 struct usb_iso_packet_descriptor iso_frame_desc[0];
75};
76
77Your driver must create the "pipe" value using values from the appropriate
78endpoint descriptor in an interface that it's claimed.
79
80
811.3. How to get an URB?
82
83URBs are allocated with the following call
84
85 struct urb *usb_alloc_urb(int isoframes, int mem_flags)
86
87Return value is a pointer to the allocated URB, 0 if allocation failed.
88The parameter isoframes specifies the number of isochronous transfer frames
89you want to schedule. For CTRL/BULK/INT, use 0. The mem_flags parameter
90holds standard memory allocation flags, letting you control (among other
91things) whether the underlying code may block or not.
92
93To free an URB, use
94
95 void usb_free_urb(struct urb *urb)
96
97You may not free an urb that you've submitted, but which hasn't yet been
98returned to you in a completion callback.
99
100
1011.4. What has to be filled in?
102
103Depending on the type of transaction, there are some inline functions
104defined in <linux/usb.h> to simplify the initialization, such as
105fill_control_urb() and fill_bulk_urb(). In general, they need the usb
106device pointer, the pipe (usual format from usb.h), the transfer buffer,
107the desired transfer length, the completion handler, and its context.
108Take a look at the some existing drivers to see how they're used.
109
110Flags:
111For ISO there are two startup behaviors: Specified start_frame or ASAP.
112For ASAP set URB_ISO_ASAP in transfer_flags.
113
114If short packets should NOT be tolerated, set URB_SHORT_NOT_OK in
115transfer_flags.
116
117
1181.5. How to submit an URB?
119
120Just call
121
122 int usb_submit_urb(struct urb *urb, int mem_flags)
123
124The mem_flags parameter, such as SLAB_ATOMIC, controls memory allocation,
125such as whether the lower levels may block when memory is tight.
126
127It immediately returns, either with status 0 (request queued) or some
128error code, usually caused by the following:
129
130- Out of memory (-ENOMEM)
131- Unplugged device (-ENODEV)
132- Stalled endpoint (-EPIPE)
133- Too many queued ISO transfers (-EAGAIN)
134- Too many requested ISO frames (-EFBIG)
135- Invalid INT interval (-EINVAL)
136- More than one packet for INT (-EINVAL)
137
138After submission, urb->status is -EINPROGRESS; however, you should never
139look at that value except in your completion callback.
140
141For isochronous endpoints, your completion handlers should (re)submit
142URBs to the same endpoint with the ISO_ASAP flag, using multi-buffering,
143to get seamless ISO streaming.
144
145
1461.6. How to cancel an already running URB?
147
148For an URB which you've submitted, but which hasn't been returned to
149your driver by the host controller, call
150
151 int usb_unlink_urb(struct urb *urb)
152
153It removes the urb from the internal list and frees all allocated
154HW descriptors. The status is changed to reflect unlinking. After
155usb_unlink_urb() returns with that status code, you can free the URB
156with usb_free_urb().
157
158There is also an asynchronous unlink mode. To use this, set the
159the URB_ASYNC_UNLINK flag in urb->transfer flags before calling
160usb_unlink_urb(). When using async unlinking, the URB will not
161normally be unlinked when usb_unlink_urb() returns. Instead, wait
162for the completion handler to be called.
163
164
1651.7. What about the completion handler?
166
167The handler is of the following type:
168
169 typedef void (*usb_complete_t)(struct urb *);
170
171i.e. it gets just the URB that caused the completion call.
172In the completion handler, you should have a look at urb->status to
173detect any USB errors. Since the context parameter is included in the URB,
174you can pass information to the completion handler.
175
176Note that even when an error (or unlink) is reported, data may have been
177transferred. That's because USB transfers are packetized; it might take
178sixteen packets to transfer your 1KByte buffer, and ten of them might
179have transferred succesfully before the completion is called.
180
181
182NOTE: ***** WARNING *****
183Don't use urb->dev field in your completion handler; it's cleared
184as part of giving urbs back to drivers. (Addressing an issue with
185ownership of periodic URBs, which was otherwise ambiguous.) Instead,
186use urb->context to hold all the data your driver needs.
187
188NOTE: ***** WARNING *****
189Also, NEVER SLEEP IN A COMPLETION HANDLER. These are normally called
190during hardware interrupt processing. If you can, defer substantial
191work to a tasklet (bottom half) to keep system latencies low. You'll
192probably need to use spinlocks to protect data structures you manipulate
193in completion handlers.
194
195
1961.8. How to do isochronous (ISO) transfers?
197
198For ISO transfers you have to fill a usb_iso_packet_descriptor structure,
199allocated at the end of the URB by usb_alloc_urb(n,mem_flags), for each
200packet you want to schedule. You also have to set urb->interval to say
201how often to make transfers; it's often one per frame (which is once
202every microframe for highspeed devices). The actual interval used will
203be a power of two that's no bigger than what you specify.
204
205The usb_submit_urb() call modifies urb->interval to the implemented interval
206value that is less than or equal to the requested interval value. If
207ISO_ASAP scheduling is used, urb->start_frame is also updated.
208
209For each entry you have to specify the data offset for this frame (base is
210transfer_buffer), and the length you want to write/expect to read.
211After completion, actual_length contains the actual transferred length and
212status contains the resulting status for the ISO transfer for this frame.
213It is allowed to specify a varying length from frame to frame (e.g. for
214audio synchronisation/adaptive transfer rates). You can also use the length
2150 to omit one or more frames (striping).
216
217For scheduling you can choose your own start frame or ISO_ASAP. As explained
218earlier, if you always keep at least one URB queued and your completion
219keeps (re)submitting a later URB, you'll get smooth ISO streaming (if usb
220bandwidth utilization allows).
221
222If you specify your own start frame, make sure it's several frames in advance
223of the current frame. You might want this model if you're synchronizing
224ISO data with some other event stream.
225
226
2271.9. How to start interrupt (INT) transfers?
228
229Interrupt transfers, like isochronous transfers, are periodic, and happen
230in intervals that are powers of two (1, 2, 4 etc) units. Units are frames
231for full and low speed devices, and microframes for high speed ones.
232
233Currently, after you submit one interrupt URB, that urb is owned by the
234host controller driver until you cancel it with usb_unlink_urb(). You
235may unlink interrupt urbs in their completion handlers, if you need to.
236
237After a transfer completion is called, the URB is automagically resubmitted.
238THIS BEHAVIOR IS EXPECTED TO BE REMOVED!!
239
240Interrupt transfers may only send (or receive) the "maxpacket" value for
241the given interrupt endpoint; if you need more data, you will need to
242copy that data out of (or into) another buffer. Similarly, you can't
243queue interrupt transfers.
244THESE RESTRICTIONS ARE EXPECTED TO BE REMOVED!!
245
246Note that this automagic resubmission model does make it awkward to use
247interrupt OUT transfers. The portable solution involves unlinking those
248OUT urbs after the data is transferred, and perhaps submitting a final
249URB for a short packet.
250
251The usb_submit_urb() call modifies urb->interval to the implemented interval
252value that is less than or equal to the requested interval value.
diff --git a/Documentation/usb/acm.txt b/Documentation/usb/acm.txt
new file mode 100644
index 000000000000..8ef45ea8f691
--- /dev/null
+++ b/Documentation/usb/acm.txt
@@ -0,0 +1,138 @@
1 Linux ACM driver v0.16
2 (c) 1999 Vojtech Pavlik <vojtech@suse.cz>
3 Sponsored by SuSE
4----------------------------------------------------------------------------
5
60. Disclaimer
7~~~~~~~~~~~~~
8 This program is free software; you can redistribute it and/or modify it
9under the terms of the GNU General Public License as published by the Free
10Software Foundation; either version 2 of the License, or (at your option)
11any later version.
12
13 This program is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16more details.
17
18 You should have received a copy of the GNU General Public License along
19with this program; if not, write to the Free Software Foundation, Inc., 59
20Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 Should you need to contact me, the author, you can do so either by e-mail
23- mail your message to <vojtech@suse.cz>, or by paper mail: Vojtech Pavlik,
24Ucitelska 1576, Prague 8, 182 00 Czech Republic
25
26 For your convenience, the GNU General Public License version 2 is included
27in the package: See the file COPYING.
28
291. Usage
30~~~~~~~~
31 The drivers/usb/class/cdc-acm.c drivers works with USB modems and USB ISDN terminal
32adapters that conform to the Universal Serial Bus Communication Device Class
33Abstract Control Model (USB CDC ACM) specification.
34
35 Many modems do, here is a list of those I know of:
36
37 3Com OfficeConnect 56k
38 3Com Voice FaxModem Pro
39 3Com Sportster
40 MultiTech MultiModem 56k
41 Zoom 2986L FaxModem
42 Compaq 56k FaxModem
43 ELSA Microlink 56k
44
45 I know of one ISDN TA that does work with the acm driver:
46
47 3Com USR ISDN Pro TA
48
49 Unfortunately many modems and most ISDN TAs use proprietary interfaces and
50thus won't work with this drivers. Check for ACM compliance before buying.
51
52 The driver (with devfs) creates these devices in /dev/usb/acm:
53
54 crw-r--r-- 1 root root 166, 0 Apr 1 10:49 0
55 crw-r--r-- 1 root root 166, 1 Apr 1 10:49 1
56 crw-r--r-- 1 root root 166, 2 Apr 1 10:49 2
57
58 And so on, up to 31, with the limit being possible to change in acm.c to up
59to 256, so you can use up to 256 USB modems with one computer (you'll need
60three USB cards for that, though).
61
62 If you don't use devfs, then you can create device nodes with the same
63minor/major numbers anywhere you want, but either the above location or
64/dev/usb/ttyACM0 is preferred.
65
66 To use the modems you need these modules loaded:
67
68 usbcore.ko
69 uhci-hcd.ko ohci-hcd.ko or ehci-hcd.ko
70 cdc-acm.ko
71
72 After that, the modem[s] should be accessible. You should be able to use
73minicom, ppp and mgetty with them.
74
752. Verifying that it works
76~~~~~~~~~~~~~~~~~~~~~~~~~~
77 The first step would be to check /proc/bus/usb/devices, it should look
78like this:
79
80T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
81B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
82D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
83P: Vendor=0000 ProdID=0000 Rev= 0.00
84S: Product=USB UHCI Root Hub
85S: SerialNumber=6800
86C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
87I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
88E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
89T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
90D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2
91P: Vendor=04c1 ProdID=008f Rev= 2.07
92S: Manufacturer=3Com Inc.
93S: Product=3Com U.S. Robotics Pro ISDN TA
94S: SerialNumber=UFT53A49BVT7
95C: #Ifs= 1 Cfg#= 1 Atr=60 MxPwr= 0mA
96I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=acm
97E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
98E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
99E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
100C:* #Ifs= 2 Cfg#= 2 Atr=60 MxPwr= 0mA
101I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
102E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
103I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm
104E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
105E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
106
107The presence of these three lines (and the Cls= 'comm' and 'data' classes)
108is important, it means it's an ACM device. The Driver=acm means the acm
109driver is used for the device. If you see only Cls=ff(vend.) then you're out
110of luck, you have a device with vendor specific-interface.
111
112D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2
113I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
114I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm
115
116In the system log you should see:
117
118usb.c: USB new device connect, assigned device number 2
119usb.c: kmalloc IF c7691fa0, numif 1
120usb.c: kmalloc IF c7b5f3e0, numif 2
121usb.c: skipped 4 class/vendor specific interface descriptors
122usb.c: new device strings: Mfr=1, Product=2, SerialNumber=3
123usb.c: USB device number 2 default language ID 0x409
124Manufacturer: 3Com Inc.
125Product: 3Com U.S. Robotics Pro ISDN TA
126SerialNumber: UFT53A49BVT7
127acm.c: probing config 1
128acm.c: probing config 2
129ttyACM0: USB ACM device
130acm.c: acm_control_msg: rq: 0x22 val: 0x0 len: 0x0 result: 0
131acm.c: acm_control_msg: rq: 0x20 val: 0x0 len: 0x7 result: 7
132usb.c: acm driver claimed interface c7b5f3e0
133usb.c: acm driver claimed interface c7b5f3f8
134usb.c: acm driver claimed interface c7691fa0
135
136If all this seems to be OK, fire up minicom and set it to talk to the ttyACM
137device and try typing 'at'. If it responds with 'OK', then everything is
138working.
diff --git a/Documentation/usb/auerswald.txt b/Documentation/usb/auerswald.txt
new file mode 100644
index 000000000000..7ee4d8f69116
--- /dev/null
+++ b/Documentation/usb/auerswald.txt
@@ -0,0 +1,30 @@
1 Auerswald USB kernel driver
2 ===========================
3
4What is it? What can I do with it?
5==================================
6The auerswald USB kernel driver connects your linux 2.4.x
7system to the auerswald usb-enabled devices.
8
9There are two types of auerswald usb devices:
10a) small PBX systems (ISDN)
11b) COMfort system telephones (ISDN)
12
13The driver installation creates the devices
14/dev/usb/auer0..15. These devices carry a vendor-
15specific protocol. You may run all auerswald java
16software on it. The java software needs a native
17library "libAuerUsbJNINative.so" installed on
18your system. This library is available from
19auerswald and shipped as part of the java software.
20
21You may create the devices with:
22 mknod -m 666 /dev/usb/auer0 c 180 112
23 ...
24 mknod -m 666 /dev/usb/auer15 c 180 127
25
26Future plans
27============
28- Connection to ISDN4LINUX (the hisax interface)
29
30The maintainer of this driver is wolfgang@iksw-muees.de
diff --git a/Documentation/usb/bluetooth.txt b/Documentation/usb/bluetooth.txt
new file mode 100644
index 000000000000..774f5d3835cc
--- /dev/null
+++ b/Documentation/usb/bluetooth.txt
@@ -0,0 +1,44 @@
1INTRODUCTION
2
3 The USB Bluetooth driver supports any USB Bluetooth device.
4 It currently works well with the Linux USB Bluetooth stack from Axis
5 (available at http://developer.axis.com/software/bluetooth/ ) and
6 has been rumored to work with other Linux USB Bluetooth stacks.
7
8
9CONFIGURATION
10
11 Currently the driver can handle up to 256 different USB Bluetooth
12 devices at once.
13
14 If you are not using devfs:
15 The major number that the driver uses is 216 so to use the driver,
16 create the following nodes:
17 mknod /dev/ttyUB0 c 216 0
18 mknod /dev/ttyUB1 c 216 1
19 mknod /dev/ttyUB2 c 216 2
20 mknod /dev/ttyUB3 c 216 3
21 .
22 .
23 .
24 mknod /dev/ttyUB254 c 216 254
25 mknod /dev/ttyUB255 c 216 255
26
27 If you are using devfs:
28 The devices supported by this driver will show up as
29 /dev/usb/ttub/{0,1,...}
30
31 When the device is connected and recognized by the driver, the driver
32 will print to the system log, which node the device has been bound to.
33
34
35CONTACT:
36
37 If anyone has any problems using this driver, please contact me, or
38 join the Linux-USB mailing list (information on joining the mailing
39 list, as well as a link to its searchable archive is at
40 http://www.linux-usb.org/ )
41
42
43Greg Kroah-Hartman
44greg@kroah.com
diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt
new file mode 100644
index 000000000000..62844aeba69c
--- /dev/null
+++ b/Documentation/usb/dma.txt
@@ -0,0 +1,116 @@
1In Linux 2.5 kernels (and later), USB device drivers have additional control
2over how DMA may be used to perform I/O operations. The APIs are detailed
3in the kernel usb programming guide (kerneldoc, from the source code).
4
5
6API OVERVIEW
7
8The big picture is that USB drivers can continue to ignore most DMA issues,
9though they still must provide DMA-ready buffers (see DMA-mapping.txt).
10That's how they've worked through the 2.4 (and earlier) kernels.
11
12OR: they can now be DMA-aware.
13
14- New calls enable DMA-aware drivers, letting them allocate dma buffers and
15 manage dma mappings for existing dma-ready buffers (see below).
16
17- URBs have an additional "transfer_dma" field, as well as a transfer_flags
18 bit saying if it's valid. (Control requests also have "setup_dma" and a
19 corresponding transfer_flags bit.)
20
21- "usbcore" will map those DMA addresses, if a DMA-aware driver didn't do
22 it first and set URB_NO_TRANSFER_DMA_MAP or URB_NO_SETUP_DMA_MAP. HCDs
23 don't manage dma mappings for URBs.
24
25- There's a new "generic DMA API", parts of which are usable by USB device
26 drivers. Never use dma_set_mask() on any USB interface or device; that
27 would potentially break all devices sharing that bus.
28
29
30ELIMINATING COPIES
31
32It's good to avoid making CPUs copy data needlessly. The costs can add up,
33and effects like cache-trashing can impose subtle penalties.
34
35- When you're allocating a buffer for DMA purposes anyway, use the buffer
36 primitives. Think of them as kmalloc and kfree that give you the right
37 kind of addresses to store in urb->transfer_buffer and urb->transfer_dma,
38 while guaranteeing that no hidden copies through DMA "bounce" buffers will
39 slow things down. You'd also set URB_NO_TRANSFER_DMA_MAP in
40 urb->transfer_flags:
41
42 void *usb_buffer_alloc (struct usb_device *dev, size_t size,
43 int mem_flags, dma_addr_t *dma);
44
45 void usb_buffer_free (struct usb_device *dev, size_t size,
46 void *addr, dma_addr_t dma);
47
48 For control transfers you can use the buffer primitives or not for each
49 of the transfer buffer and setup buffer independently. Set the flag bits
50 URB_NO_TRANSFER_DMA_MAP and URB_NO_SETUP_DMA_MAP to indicate which
51 buffers you have prepared. For non-control transfers URB_NO_SETUP_DMA_MAP
52 is ignored.
53
54 The memory buffer returned is "dma-coherent"; sometimes you might need to
55 force a consistent memory access ordering by using memory barriers. It's
56 not using a streaming DMA mapping, so it's good for small transfers on
57 systems where the I/O would otherwise tie up an IOMMU mapping. (See
58 Documentation/DMA-mapping.txt for definitions of "coherent" and "streaming"
59 DMA mappings.)
60
61 Asking for 1/Nth of a page (as well as asking for N pages) is reasonably
62 space-efficient.
63
64- Devices on some EHCI controllers could handle DMA to/from high memory.
65 Driver probe() routines can notice this using a generic DMA call, then
66 tell higher level code (network, scsi, etc) about it like this:
67
68 if (dma_supported (&intf->dev, 0xffffffffffffffffULL))
69 net->features |= NETIF_F_HIGHDMA;
70
71 That can eliminate dma bounce buffering of requests that originate (or
72 terminate) in high memory, in cases where the buffers aren't allocated
73 with usb_buffer_alloc() but instead are dma-mapped.
74
75
76WORKING WITH EXISTING BUFFERS
77
78Existing buffers aren't usable for DMA without first being mapped into the
79DMA address space of the device.
80
81- When you're using scatterlists, you can map everything at once. On some
82 systems, this kicks in an IOMMU and turns the scatterlists into single
83 DMA transactions:
84
85 int usb_buffer_map_sg (struct usb_device *dev, unsigned pipe,
86 struct scatterlist *sg, int nents);
87
88 void usb_buffer_dmasync_sg (struct usb_device *dev, unsigned pipe,
89 struct scatterlist *sg, int n_hw_ents);
90
91 void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
92 struct scatterlist *sg, int n_hw_ents);
93
94 It's probably easier to use the new usb_sg_*() calls, which do the DMA
95 mapping and apply other tweaks to make scatterlist i/o be fast.
96
97- Some drivers may prefer to work with the model that they're mapping large
98 buffers, synchronizing their safe re-use. (If there's no re-use, then let
99 usbcore do the map/unmap.) Large periodic transfers make good examples
100 here, since it's cheaper to just synchronize the buffer than to unmap it
101 each time an urb completes and then re-map it on during resubmission.
102
103 These calls all work with initialized urbs: urb->dev, urb->pipe,
104 urb->transfer_buffer, and urb->transfer_buffer_length must all be
105 valid when these calls are used (urb->setup_packet must be valid too
106 if urb is a control request):
107
108 struct urb *usb_buffer_map (struct urb *urb);
109
110 void usb_buffer_dmasync (struct urb *urb);
111
112 void usb_buffer_unmap (struct urb *urb);
113
114 The calls manage urb->transfer_dma for you, and set URB_NO_TRANSFER_DMA_MAP
115 so that usbcore won't map or unmap the buffer. The same goes for
116 urb->setup_dma and URB_NO_SETUP_DMA_MAP for control requests.
diff --git a/Documentation/usb/ehci.txt b/Documentation/usb/ehci.txt
new file mode 100644
index 000000000000..1536b7e75134
--- /dev/null
+++ b/Documentation/usb/ehci.txt
@@ -0,0 +1,212 @@
127-Dec-2002
2
3The EHCI driver is used to talk to high speed USB 2.0 devices using
4USB 2.0-capable host controller hardware. The USB 2.0 standard is
5compatible with the USB 1.1 standard. It defines three transfer speeds:
6
7 - "High Speed" 480 Mbit/sec (60 MByte/sec)
8 - "Full Speed" 12 Mbit/sec (1.5 MByte/sec)
9 - "Low Speed" 1.5 Mbit/sec
10
11USB 1.1 only addressed full speed and low speed. High speed devices
12can be used on USB 1.1 systems, but they slow down to USB 1.1 speeds.
13
14USB 1.1 devices may also be used on USB 2.0 systems. When plugged
15into an EHCI controller, they are given to a USB 1.1 "companion"
16controller, which is a OHCI or UHCI controller as normally used with
17such devices. When USB 1.1 devices plug into USB 2.0 hubs, they
18interact with the EHCI controller through a "Transaction Translator"
19(TT) in the hub, which turns low or full speed transactions into
20high speed "split transactions" that don't waste transfer bandwidth.
21
22At this writing, this driver has been seen to work with implementations
23of EHCI from (in alphabetical order): Intel, NEC, Philips, and VIA.
24Other EHCI implementations are becoming available from other vendors;
25you should expect this driver to work with them too.
26
27While usb-storage devices have been available since mid-2001 (working
28quite speedily on the 2.4 version of this driver), hubs have only
29been available since late 2001, and other kinds of high speed devices
30appear to be on hold until more systems come with USB 2.0 built-in.
31Such new systems have been available since early 2002, and became much
32more typical in the second half of 2002.
33
34Note that USB 2.0 support involves more than just EHCI. It requires
35other changes to the Linux-USB core APIs, including the hub driver,
36but those changes haven't needed to really change the basic "usbcore"
37APIs exposed to USB device drivers.
38
39- David Brownell
40 <dbrownell@users.sourceforge.net>
41
42
43FUNCTIONALITY
44
45This driver is regularly tested on x86 hardware, and has also been
46used on PPC hardware so big/little endianness issues should be gone.
47It's believed to do all the right PCI magic so that I/O works even on
48systems with interesting DMA mapping issues.
49
50Transfer Types
51
52At this writing the driver should comfortably handle all control, bulk,
53and interrupt transfers, including requests to USB 1.1 devices through
54transaction translators (TTs) in USB 2.0 hubs. But you may find bugs.
55
56High Speed Isochronous (ISO) transfer support is also functional, but
57at this writing no Linux drivers have been using that support.
58
59Full Speed Isochronous transfer support, through transaction translators,
60is not yet available. Note that split transaction support for ISO
61transfers can't share much code with the code for high speed ISO transfers,
62since EHCI represents these with a different data structure. So for now,
63most USB audio and video devices can't be connected to high speed buses.
64
65Driver Behavior
66
67Transfers of all types can be queued. This means that control transfers
68from a driver on one interface (or through usbfs) won't interfere with
69ones from another driver, and that interrupt transfers can use periods
70of one frame without risking data loss due to interrupt processing costs.
71
72The EHCI root hub code hands off USB 1.1 devices to its companion
73controller. This driver doesn't need to know anything about those
74drivers; a OHCI or UHCI driver that works already doesn't need to change
75just because the EHCI driver is also present.
76
77There are some issues with power management; suspend/resume doesn't
78behave quite right at the moment.
79
80Also, some shortcuts have been taken with the scheduling periodic
81transactions (interrupt and isochronous transfers). These place some
82limits on the number of periodic transactions that can be scheduled,
83and prevent use of polling intervals of less than one frame.
84
85
86USE BY
87
88Assuming you have an EHCI controller (on a PCI card or motherboard)
89and have compiled this driver as a module, load this like:
90
91 # modprobe ehci-hcd
92
93and remove it by:
94
95 # rmmod ehci-hcd
96
97You should also have a driver for a "companion controller", such as
98"ohci-hcd" or "uhci-hcd". In case of any trouble with the EHCI driver,
99remove its module and then the driver for that companion controller will
100take over (at lower speed) all the devices that were previously handled
101by the EHCI driver.
102
103Module parameters (pass to "modprobe") include:
104
105 log2_irq_thresh (default 0):
106 Log2 of default interrupt delay, in microframes. The default
107 value is 0, indicating 1 microframe (125 usec). Maximum value
108 is 6, indicating 2^6 = 64 microframes. This controls how often
109 the EHCI controller can issue interrupts.
110
111If you're using this driver on a 2.5 kernel, and you've enabled USB
112debugging support, you'll see three files in the "sysfs" directory for
113any EHCI controller:
114
115 "async" dumps the asynchronous schedule, used for control
116 and bulk transfers. Shows each active qh and the qtds
117 pending, usually one qtd per urb. (Look at it with
118 usb-storage doing disk I/O; watch the request queues!)
119 "periodic" dumps the periodic schedule, used for interrupt
120 and isochronous transfers. Doesn't show qtds.
121 "registers" show controller register state, and
122
123The contents of those files can help identify driver problems.
124
125
126Device drivers shouldn't care whether they're running over EHCI or not,
127but they may want to check for "usb_device->speed == USB_SPEED_HIGH".
128High speed devices can do things that full speed (or low speed) ones
129can't, such as "high bandwidth" periodic (interrupt or ISO) transfers.
130Also, some values in device descriptors (such as polling intervals for
131periodic transfers) use different encodings when operating at high speed.
132
133However, do make a point of testing device drivers through USB 2.0 hubs.
134Those hubs report some failures, such as disconnections, differently when
135transaction translators are in use; some drivers have been seen to behave
136badly when they see different faults than OHCI or UHCI report.
137
138
139PERFORMANCE
140
141USB 2.0 throughput is gated by two main factors: how fast the host
142controller can process requests, and how fast devices can respond to
143them. The 480 Mbit/sec "raw transfer rate" is obeyed by all devices,
144but aggregate throughput is also affected by issues like delays between
145individual high speed packets, driver intelligence, and of course the
146overall system load. Latency is also a performance concern.
147
148Bulk transfers are most often used where throughput is an issue. It's
149good to keep in mind that bulk transfers are always in 512 byte packets,
150and at most 13 of those fit into one USB 2.0 microframe. Eight USB 2.0
151microframes fit in a USB 1.1 frame; a microframe is 1 msec/8 = 125 usec.
152
153So more than 50 MByte/sec is available for bulk transfers, when both
154hardware and device driver software allow it. Periodic transfer modes
155(isochronous and interrupt) allow the larger packet sizes which let you
156approach the quoted 480 MBit/sec transfer rate.
157
158Hardware Performance
159
160At this writing, individual USB 2.0 devices tend to max out at around
16120 MByte/sec transfer rates. This is of course subject to change;
162and some devices now go faster, while others go slower.
163
164The first NEC implementation of EHCI seems to have a hardware bottleneck
165at around 28 MByte/sec aggregate transfer rate. While this is clearly
166enough for a single device at 20 MByte/sec, putting three such devices
167onto one bus does not get you 60 MByte/sec. The issue appears to be
168that the controller hardware won't do concurrent USB and PCI access,
169so that it's only trying six (or maybe seven) USB transactions each
170microframe rather than thirteen. (Seems like a reasonable trade off
171for a product that beat all the others to market by over a year!)
172
173It's expected that newer implementations will better this, throwing
174more silicon real estate at the problem so that new motherboard chip
175sets will get closer to that 60 MByte/sec target. That includes an
176updated implementation from NEC, as well as other vendors' silicon.
177
178There's a minimum latency of one microframe (125 usec) for the host
179to receive interrupts from the EHCI controller indicating completion
180of requests. That latency is tunable; there's a module option. By
181default ehci-hcd driver uses the minimum latency, which means that if
182you issue a control or bulk request you can often expect to learn that
183it completed in less than 250 usec (depending on transfer size).
184
185Software Performance
186
187To get even 20 MByte/sec transfer rates, Linux-USB device drivers will
188need to keep the EHCI queue full. That means issuing large requests,
189or using bulk queuing if a series of small requests needs to be issued.
190When drivers don't do that, their performance results will show it.
191
192In typical situations, a usb_bulk_msg() loop writing out 4 KB chunks is
193going to waste more than half the USB 2.0 bandwidth. Delays between the
194I/O completion and the driver issuing the next request will take longer
195than the I/O. If that same loop used 16 KB chunks, it'd be better; a
196sequence of 128 KB chunks would waste a lot less.
197
198But rather than depending on such large I/O buffers to make synchronous
199I/O be efficient, it's better to just queue up several (bulk) requests
200to the HC, and wait for them all to complete (or be canceled on error).
201Such URB queuing should work with all the USB 1.1 HC drivers too.
202
203In the Linux 2.5 kernels, new usb_sg_*() api calls have been defined; they
204queue all the buffers from a scatterlist. They also use scatterlist DMA
205mapping (which might apply an IOMMU) and IRQ reduction, all of which will
206help make high speed transfers run as fast as they can.
207
208
209TBD: Interrupt and ISO transfer performance issues. Those periodic
210transfers are fully scheduled, so the main issue is likely to be how
211to trigger "high bandwidth" modes.
212
diff --git a/Documentation/usb/error-codes.txt b/Documentation/usb/error-codes.txt
new file mode 100644
index 000000000000..1e36f1661cd0
--- /dev/null
+++ b/Documentation/usb/error-codes.txt
@@ -0,0 +1,167 @@
1Revised: 2004-Oct-21
2
3This is the documentation of (hopefully) all possible error codes (and
4their interpretation) that can be returned from usbcore.
5
6Some of them are returned by the Host Controller Drivers (HCDs), which
7device drivers only see through usbcore. As a rule, all the HCDs should
8behave the same except for transfer speed dependent behaviors and the
9way certain faults are reported.
10
11
12**************************************************************************
13* Error codes returned by usb_submit_urb *
14**************************************************************************
15
16Non-USB-specific:
17
180 URB submission went fine
19
20-ENOMEM no memory for allocation of internal structures
21
22USB-specific:
23
24-ENODEV specified USB-device or bus doesn't exist
25
26-ENOENT specified interface or endpoint does not exist or
27 is not enabled
28
29-ENXIO host controller driver does not support queuing of this type
30 of urb. (treat as a host controller bug.)
31
32-EINVAL a) Invalid transfer type specified (or not supported)
33 b) Invalid or unsupported periodic transfer interval
34 c) ISO: attempted to change transfer interval
35 d) ISO: number_of_packets is < 0
36 e) various other cases
37
38-EAGAIN a) specified ISO start frame too early
39 b) (using ISO-ASAP) too much scheduled for the future
40 wait some time and try again.
41
42-EFBIG Host controller driver can't schedule that many ISO frames.
43
44-EPIPE Specified endpoint is stalled. For non-control endpoints,
45 reset this status with usb_clear_halt().
46
47-EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable
48 in the current interface altsetting.
49 (b) ISO packet is biger than endpoint maxpacket
50 (c) requested data transfer size is invalid (negative)
51
52-ENOSPC This request would overcommit the usb bandwidth reserved
53 for periodic transfers (interrupt, isochronous).
54
55-ESHUTDOWN The device or host controller has been disabled due to some
56 problem that could not be worked around.
57
58-EPERM Submission failed because urb->reject was set.
59
60-EHOSTUNREACH URB was rejected because the device is suspended.
61
62
63**************************************************************************
64* Error codes returned by in urb->status *
65* or in iso_frame_desc[n].status (for ISO) *
66**************************************************************************
67
68USB device drivers may only test urb status values in completion handlers.
69This is because otherwise there would be a race between HCDs updating
70these values on one CPU, and device drivers testing them on another CPU.
71
72A transfer's actual_length may be positive even when an error has been
73reported. That's because transfers often involve several packets, so that
74one or more packets could finish before an error stops further endpoint I/O.
75
76
770 Transfer completed successfully
78
79-ENOENT URB was synchronously unlinked by usb_unlink_urb
80
81-EINPROGRESS URB still pending, no results yet
82 (That is, if drivers see this it's a bug.)
83
84-EPROTO (*, **) a) bitstuff error
85 b) no response packet received within the
86 prescribed bus turn-around time
87 c) unknown USB error
88
89-EILSEQ (*, **) a) CRC mismatch
90 b) no response packet received within the
91 prescribed bus turn-around time
92 c) unknown USB error
93
94 Note that often the controller hardware does not
95 distinguish among cases a), b), and c), so a
96 driver cannot tell whether there was a protocol
97 error, a failure to respond (often caused by
98 device disconnect), or some other fault.
99
100-ETIMEDOUT (**) No response packet received within the prescribed
101 bus turn-around time. This error may instead be
102 reported as -EPROTO or -EILSEQ.
103
104 Note that the synchronous USB message functions
105 also use this code to indicate timeout expired
106 before the transfer completed.
107
108-EPIPE (**) Endpoint stalled. For non-control endpoints,
109 reset this status with usb_clear_halt().
110
111-ECOMM During an IN transfer, the host controller
112 received data from an endpoint faster than it
113 could be written to system memory
114
115-ENOSR During an OUT transfer, the host controller
116 could not retrieve data from system memory fast
117 enough to keep up with the USB data rate
118
119-EOVERFLOW (*) The amount of data returned by the endpoint was
120 greater than either the max packet size of the
121 endpoint or the remaining buffer size. "Babble".
122
123-EREMOTEIO The data read from the endpoint did not fill the
124 specified buffer, and URB_SHORT_NOT_OK was set in
125 urb->transfer_flags.
126
127-ENODEV Device was removed. Often preceded by a burst of
128 other errors, since the hub driver does't detect
129 device removal events immediately.
130
131-EXDEV ISO transfer only partially completed
132 look at individual frame status for details
133
134-EINVAL ISO madness, if this happens: Log off and go home
135
136-ECONNRESET URB was asynchronously unlinked by usb_unlink_urb
137
138-ESHUTDOWN The device or host controller has been disabled due
139 to some problem that could not be worked around,
140 such as a physical disconnect.
141
142
143(*) Error codes like -EPROTO, -EILSEQ and -EOVERFLOW normally indicate
144hardware problems such as bad devices (including firmware) or cables.
145
146(**) This is also one of several codes that different kinds of host
147controller use to to indicate a transfer has failed because of device
148disconnect. In the interval before the hub driver starts disconnect
149processing, devices may receive such fault reports for every request.
150
151
152
153**************************************************************************
154* Error codes returned by usbcore-functions *
155* (expect also other submit and transfer status codes) *
156**************************************************************************
157
158usb_register():
159-EINVAL error during registering new driver
160
161usb_get_*/usb_set_*():
162usb_control_msg():
163usb_bulk_msg():
164-ETIMEDOUT Timeout expired before the transfer completed.
165 In the future this code may change to -ETIME,
166 whose definition is a closer match to this sort
167 of error.
diff --git a/Documentation/usb/gadget_serial.txt b/Documentation/usb/gadget_serial.txt
new file mode 100644
index 000000000000..a938c3dd13d6
--- /dev/null
+++ b/Documentation/usb/gadget_serial.txt
@@ -0,0 +1,332 @@
1
2 Linux Gadget Serial Driver v2.0
3 11/20/2004
4
5
6License and Disclaimer
7----------------------
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License as
10published by the Free Software Foundation; either version 2 of
11the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public
19License along with this program; if not, write to the Free
20Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21MA 02111-1307 USA.
22
23This document and the the gadget serial driver itself are
24Copyright (C) 2004 by Al Borchers (alborchers@steinerpoint.com).
25
26If you have questions, problems, or suggestions for this driver
27please contact Al Borchers at alborchers@steinerpoint.com.
28
29
30Prerequisites
31-------------
32Versions of the gadget serial driver are available for the
332.4 Linux kernels, but this document assumes you are using
34version 2.0 or later of the gadget serial driver in a 2.6
35Linux kernel.
36
37This document assumes that you are familiar with Linux and
38Windows and know how to configure and build Linux kernels, run
39standard utilities, use minicom and HyperTerminal, and work with
40USB and serial devices. It also assumes you configure the Linux
41gadget and usb drivers as modules.
42
43
44Overview
45--------
46The gadget serial driver is a Linux USB gadget driver, a USB device
47side driver. It runs on a Linux system that has USB device side
48hardware; for example, a PDA, an embedded Linux system, or a PC
49with a USB development card.
50
51The gadget serial driver talks over USB to either a CDC ACM driver
52or a generic USB serial driver running on a host PC.
53
54 Host
55 --------------------------------------
56 | Host-Side CDC ACM USB Host |
57 | Operating | or | Controller | USB
58 | System | Generic USB | Driver |--------
59 | (Linux or | Serial | and | |
60 | Windows) Driver USB Stack | |
61 -------------------------------------- |
62 |
63 |
64 |
65 Gadget |
66 -------------------------------------- |
67 | Gadget USB Periph. | |
68 | Device-Side | Gadget | Controller | |
69 | Linux | Serial | Driver |--------
70 | Operating | Driver | and |
71 | System USB Stack |
72 --------------------------------------
73
74On the device-side Linux system, the gadget serial driver looks
75like a serial device.
76
77On the host-side system, the gadget serial device looks like a
78CDC ACM compliant class device or a simple vendor specific device
79with bulk in and bulk out endpoints, and it is treated similarly
80to other serial devices.
81
82The host side driver can potentially be any ACM compliant driver
83or any driver that can talk to a device with a simple bulk in/out
84interface. Gadget serial has been tested with the Linux ACM driver,
85the Windows usbser.sys ACM driver, and the Linux USB generic serial
86driver.
87
88With the gadget serial driver and the host side ACM or generic
89serial driver running, you should be able to communicate between
90the host and the gadget side systems as if they were connected by a
91serial cable.
92
93The gadget serial driver only provides simple unreliable data
94communication. It does not yet handle flow control or many other
95features of normal serial devices.
96
97
98Installing the Gadget Serial Driver
99-----------------------------------
100To use the gadget serial driver you must configure the Linux gadget
101side kernel for "Support for USB Gadgets", for a "USB Peripheral
102Controller" (for example, net2280), and for the "Serial Gadget"
103driver. All this are listed under "USB Gadget Support" when
104configuring the kernel. Then rebuild and install the kernel or
105modules.
106
107The gadget serial driver uses major number 127, for now. So you
108will need to create a device node for it, like this:
109
110 mknod /dev/ttygserial c 127 0
111
112You only need to do this once.
113
114Then you must load the gadget serial driver. To load it as an
115ACM device, do this:
116
117 modprobe g_serial use_acm=1
118
119To load it as a vendor specific bulk in/out device, do this:
120
121 modprobe g_serial
122
123This will also automatically load the underlying gadget peripheral
124controller driver. This must be done each time you reboot the gadget
125side Linux system. You can add this to the start up scripts, if
126desired.
127
128If gadget serial is loaded as an ACM device you will want to use
129either the Windows or Linux ACM driver on the host side. If gadget
130serial is loaded as a bulk in/out device, you will want to use the
131Linux generic serial driver on the host side. Follow the appropriate
132instructions below to install the host side driver.
133
134
135Installing the Windows Host ACM Driver
136--------------------------------------
137To use the Windows ACM driver you must have the files "gserial.inf"
138and "usbser.sys" together in a folder on the Windows machine.
139
140The "gserial.inf" file is given here.
141
142-------------------- CUT HERE --------------------
143[Version]
144Signature="$Windows NT$"
145Class=Ports
146ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
147Provider=%LINUX%
148DriverVer=08/17/2004,0.0.2.0
149; Copyright (C) 2004 Al Borchers (alborchers@steinerpoint.com)
150
151[Manufacturer]
152%LINUX%=GSerialDeviceList
153
154[GSerialDeviceList]
155%GSERIAL%=GSerialInstall, USB\VID_0525&PID_A4A7
156
157[DestinationDirs]
158DefaultDestDir=10,System32\Drivers
159
160[GSerialInstall]
161CopyFiles=GSerialCopyFiles
162AddReg=GSerialAddReg
163
164[GSerialCopyFiles]
165usbser.sys
166
167[GSerialAddReg]
168HKR,,DevLoader,,*ntkern
169HKR,,NTMPDriver,,usbser.sys
170HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
171
172[GSerialInstall.Services]
173AddService = usbser,0x0002,GSerialService
174
175[GSerialService]
176DisplayName = %GSERIAL_DISPLAY_NAME%
177ServiceType = 1 ; SERVICE_KERNEL_DRIVER
178StartType = 3 ; SERVICE_DEMAND_START
179ErrorControl = 1 ; SERVICE_ERROR_NORMAL
180ServiceBinary = %10%\System32\Drivers\usbser.sys
181LoadOrderGroup = Base
182
183[Strings]
184LINUX = "Linux"
185GSERIAL = "Gadget Serial"
186GSERIAL_DISPLAY_NAME = "USB Gadget Serial Driver"
187-------------------- CUT HERE --------------------
188
189The "usbser.sys" file comes with various versions of Windows.
190For example, it can be found on Windows XP typically in
191
192 C:\WINDOWS\Driver Cache\i386\driver.cab
193
194Or it can be found on the Windows 98SE CD in the "win98" folder
195in the "DRIVER11.CAB" through "DRIVER20.CAB" cab files. You will
196need the DOS "expand" program, the Cygwin "cabextract" program, or
197a similar program to unpack these cab files and extract "usbser.sys".
198
199For example, to extract "usbser.sys" into the current directory
200on Windows XP, open a DOS window and run a command like
201
202 expand C:\WINDOWS\Driver~1\i386\driver.cab -F:usbser.sys .
203
204(Thanks to Nishant Kamat for pointing out this DOS command.)
205
206When the gadget serial driver is loaded and the USB device connected
207to the Windows host with a USB cable, Windows should recognize the
208gadget serial device and ask for a driver. Tell Windows to find the
209driver in the folder that contains "gserial.inf" and "usbser.sys".
210
211For example, on Windows XP, when the gadget serial device is first
212plugged in, the "Found New Hardware Wizard" starts up. Select
213"Install from a list or specific location (Advanced)", then on
214the next screen select "Include this location in the search" and
215enter the path or browse to the folder containing "gserial.inf" and
216"usbser.sys". Windows will complain that the Gadget Serial driver
217has not passed Windows Logo testing, but select "Continue anyway"
218and finish the driver installation.
219
220On Windows XP, in the "Device Manager" (under "Control Panel",
221"System", "Hardware") expand the "Ports (COM & LPT)" entry and you
222should see "Gadget Serial" listed as the driver for one of the COM
223ports.
224
225To uninstall the Windows XP driver for "Gadget Serial", right click
226on the "Gadget Serial" entry in the "Device Manager" and select
227"Uninstall".
228
229
230Installing the Linux Host ACM Driver
231------------------------------------
232To use the Linux ACM driver you must configure the Linux host side
233kernel for "Support for Host-side USB" and for "USB Modem (CDC ACM)
234support".
235
236Once the gadget serial driver is loaded and the USB device connected
237to the Linux host with a USB cable, the host system should recognize
238the gadget serial device. For example, the command
239
240 cat /proc/bus/usb/devices
241
242should show something like this:
243
244T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 5 Spd=480 MxCh= 0
245D: Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
246P: Vendor=0525 ProdID=a4a7 Rev= 2.01
247S: Manufacturer=Linux 2.6.8.1 with net2280
248S: Product=Gadget Serial
249S: SerialNumber=0
250C:* #Ifs= 2 Cfg#= 2 Atr=c0 MxPwr= 2mA
251I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
252E: Ad=83(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
253I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm
254E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
255E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
256
257If the host side Linux system is configured properly, the ACM driver
258should be loaded automatically. The command "lsmod" should show the
259"acm" module is loaded.
260
261
262Installing the Linux Host Generic USB Serial Driver
263---------------------------------------------------
264To use the Linux generic USB serial driver you must configure the
265Linux host side kernel for "Support for Host-side USB", for "USB
266Serial Converter support", and for the "USB Generic Serial Driver".
267
268Once the gadget serial driver is loaded and the USB device connected
269to the Linux host with a USB cable, the host system should recognize
270the gadget serial device. For example, the command
271
272 cat /proc/bus/usb/devices
273
274should show something like this:
275
276T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 6 Spd=480 MxCh= 0
277D: Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
278P: Vendor=0525 ProdID=a4a6 Rev= 2.01
279S: Manufacturer=Linux 2.6.8.1 with net2280
280S: Product=Gadget Serial
281S: SerialNumber=0
282C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA
283I: If#= 0 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=serial
284E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
285E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
286
287You must explicitly load the usbserial driver with parameters to
288configure it to recognize the gadget serial device, like this:
289
290 modprobe usbserial vendor=0x0525 product=0xA4A6
291
292If everything is working, usbserial will print a message in the
293system log saying something like "Gadget Serial converter now
294attached to ttyUSB0".
295
296
297Testing with Minicom or HyperTerminal
298-------------------------------------
299Once the gadget serial driver and the host driver are both installed,
300and a USB cable connects the gadget device to the host, you should
301be able to communicate over USB between the gadget and host systems.
302You can use minicom or HyperTerminal to try this out.
303
304On the gadget side run "minicom -s" to configure a new minicom
305session. Under "Serial port setup" set "/dev/ttygserial" as the
306"Serial Device". Set baud rate, data bits, parity, and stop bits,
307to 9600, 8, none, and 1--these settings mostly do not matter.
308Under "Modem and dialing" erase all the modem and dialing strings.
309
310On a Linux host running the ACM driver, configure minicom similarly
311but use "/dev/ttyACM0" as the "Serial Device". (If you have other
312ACM devices connected, change the device name appropriately.)
313
314On a Linux host running the USB generic serial driver, configure
315minicom similarly, but use "/dev/ttyUSB0" as the "Serial Device".
316(If you have other USB serial devices connected, change the device
317name appropriately.)
318
319On a Windows host configure a new HyperTerminal session to use the
320COM port assigned to Gadget Serial. The "Port Settings" will be
321set automatically when HyperTerminal connects to the gadget serial
322device, so you can leave them set to the default values--these
323settings mostly do not matter.
324
325With minicom configured and running on the gadget side and with
326minicom or HyperTerminal configured and running on the host side,
327you should be able to send data back and forth between the gadget
328side and host side systems. Anything you type on the terminal
329window on the gadget side should appear in the terminal window on
330the host side and vice versa.
331
332
diff --git a/Documentation/usb/hiddev.txt b/Documentation/usb/hiddev.txt
new file mode 100644
index 000000000000..cd6fb4b58e1f
--- /dev/null
+++ b/Documentation/usb/hiddev.txt
@@ -0,0 +1,205 @@
1Care and feeding of your Human Interface Devices
2
3INTRODUCTION
4
5In addition to the normal input type HID devices, USB also uses the
6human interface device protocols for things that are not really human
7interfaces, but have similar sorts of communication needs. The two big
8examples for this are power devices (especially uninterruptable power
9supplies) and monitor control on higher end monitors.
10
11To support these disparite requirements, the Linux USB system provides
12HID events to two separate interfaces:
13* the input subsystem, which converts HID events into normal input
14device interfaces (such as keyboard, mouse and joystick) and a
15normalised event interface - see Documentation/input/input.txt
16* the hiddev interface, which provides fairly raw HID events
17
18The data flow for a HID event produced by a device is something like
19the following :
20
21 usb.c ---> hid-core.c ----> hid-input.c ----> [keyboard/mouse/joystick/event]
22 |
23 |
24 --> hiddev.c ----> POWER / MONITOR CONTROL
25
26In addition, other subsystems (apart from USB) can potentially feed
27events into the input subsystem, but these have no effect on the hid
28device interface.
29
30USING THE HID DEVICE INTERFACE
31
32The hiddev interface is a char interface using the normal USB major,
33with the minor numbers starting at 96 and finishing at 111. Therefore,
34you need the following commands:
35mknod /dev/usb/hiddev0 c 180 96
36mknod /dev/usb/hiddev1 c 180 97
37mknod /dev/usb/hiddev2 c 180 98
38mknod /dev/usb/hiddev3 c 180 99
39mknod /dev/usb/hiddev4 c 180 100
40mknod /dev/usb/hiddev5 c 180 101
41mknod /dev/usb/hiddev6 c 180 102
42mknod /dev/usb/hiddev7 c 180 103
43mknod /dev/usb/hiddev8 c 180 104
44mknod /dev/usb/hiddev9 c 180 105
45mknod /dev/usb/hiddev10 c 180 106
46mknod /dev/usb/hiddev11 c 180 107
47mknod /dev/usb/hiddev12 c 180 108
48mknod /dev/usb/hiddev13 c 180 109
49mknod /dev/usb/hiddev14 c 180 110
50mknod /dev/usb/hiddev15 c 180 111
51
52So you point your hiddev compliant user-space program at the correct
53interface for your device, and it all just works.
54
55Assuming that you have a hiddev compliant user-space program, of
56course. If you need to write one, read on.
57
58
59THE HIDDEV API
60This description should be read in conjunction with the HID
61specification, freely available from http://www.usb.org, and
62conveniently linked of http://www.linux-usb.org.
63
64The hiddev API uses a read() interface, and a set of ioctl() calls.
65
66HID devices exchange data with the host computer using data
67bundles called "reports". Each report is divided into "fields",
68each of which can have one or more "usages". In the hid-core,
69each one of these usages has a single signed 32 bit value.
70
71read():
72This is the event interface. When the HID device's state changes,
73it performs an interrupt transfer containing a report which contains
74the changed value. The hid-core.c module parses the report, and
75returns to hiddev.c the individual usages that have changed within
76the report. In its basic mode, the hiddev will make these individual
77usage changes available to the reader using a struct hiddev_event:
78
79 struct hiddev_event {
80 unsigned hid;
81 signed int value;
82 };
83
84containing the HID usage identifier for the status that changed, and
85the value that it was changed to. Note that the structure is defined
86within <linux/hiddev.h>, along with some other useful #defines and
87structures. The HID usage identifier is a composite of the HID usage
88page shifted to the 16 high order bits ORed with the usage code. The
89behavior of the read() function can be modified using the HIDIOCSFLAG
90ioctl() described below.
91
92
93ioctl():
94This is the control interface. There are a number of controls:
95
96HIDIOCGVERSION - int (read)
97Gets the version code out of the hiddev driver.
98
99HIDIOCAPPLICATION - (none)
100This ioctl call returns the HID application usage associated with the
101hid device. The third argument to ioctl() specifies which application
102index to get. This is useful when the device has more than one
103application collection. If the index is invalid (greater or equal to
104the number of application collections this device has) the ioctl
105returns -1. You can find out beforehand how many application
106collections the device has from the num_applications field from the
107hiddev_devinfo structure.
108
109HIDIOCGCOLLECTIONINFO - struct hiddev_collection_info (read/write)
110This returns a superset of the information above, providing not only
111application collections, but all the collections the device has. It
112also returns the level the collection lives in the hierarchy.
113The user passes in a hiddev_collection_info struct with the index
114field set to the index that should be returned. The ioctl fills in
115the other fields. If the index is larger than the last collection
116index, the ioctl returns -1 and sets errno to -EINVAL.
117
118HIDIOCGDEVINFO - struct hiddev_devinfo (read)
119Gets a hiddev_devinfo structure which describes the device.
120
121HIDIOCGSTRING - struct struct hiddev_string_descriptor (read/write)
122Gets a string descriptor from the device. The caller must fill in the
123"index" field to indicate which descriptor should be returned.
124
125HIDIOCINITREPORT - (none)
126Instructs the kernel to retrieve all input and feature report values
127from the device. At this point, all the usage structures will contain
128current values for the device, and will maintain it as the device
129changes. Note that the use of this ioctl is unnecessary in general,
130since later kernels automatically initialize the reports from the
131device at attach time.
132
133HIDIOCGNAME - string (variable length)
134Gets the device name
135
136HIDIOCGREPORT - struct hiddev_report_info (write)
137Instructs the kernel to get a feature or input report from the device,
138in order to selectively update the usage structures (in contrast to
139INITREPORT).
140
141HIDIOCSREPORT - struct hiddev_report_info (write)
142Instructs the kernel to send a report to the device. This report can
143be filled in by the user through HIDIOCSUSAGE calls (below) to fill in
144individual usage values in the report before sending the report in full
145to the device.
146
147HIDIOCGREPORTINFO - struct hiddev_report_info (read/write)
148Fills in a hiddev_report_info structure for the user. The report is
149looked up by type (input, output or feature) and id, so these fields
150must be filled in by the user. The ID can be absolute -- the actual
151report id as reported by the device -- or relative --
152HID_REPORT_ID_FIRST for the first report, and (HID_REPORT_ID_NEXT |
153report_id) for the next report after report_id. Without a-priori
154information about report ids, the right way to use this ioctl is to
155use the relative IDs above to enumerate the valid IDs. The ioctl
156returns non-zero when there is no more next ID. The real report ID is
157filled into the returned hiddev_report_info structure.
158
159HIDIOCGFIELDINFO - struct hiddev_field_info (read/write)
160Returns the field information associated with a report in a
161hiddev_field_info structure. The user must fill in report_id and
162report_type in this structure, as above. The field_index should also
163be filled in, which should be a number from 0 and maxfield-1, as
164returned from a previous HIDIOCGREPORTINFO call.
165
166HIDIOCGUCODE - struct hiddev_usage_ref (read/write)
167Returns the usage_code in a hiddev_usage_ref structure, given that
168given its report type, report id, field index, and index within the
169field have already been filled into the structure.
170
171HIDIOCGUSAGE - struct hiddev_usage_ref (read/write)
172Returns the value of a usage in a hiddev_usage_ref structure. The
173usage to be retrieved can be specified as above, or the user can
174choose to fill in the report_type field and specify the report_id as
175HID_REPORT_ID_UNKNOWN. In this case, the hiddev_usage_ref will be
176filled in with the report and field information associated with this
177usage if it is found.
178
179HIDIOCSUSAGE - struct hiddev_usage_ref (write)
180Sets the value of a usage in an output report. The user fills in
181the hiddev_usage_ref structure as above, but additionally fills in
182the value field.
183
184HIDIOGCOLLECTIONINDEX - struct hiddev_usage_ref (write)
185Returns the collection index associated with this usage. This
186indicates where in the collection hierarchy this usage sits.
187
188HIDIOCGFLAG - int (read)
189HIDIOCSFLAG - int (write)
190These operations respectively inspect and replace the mode flags
191that influence the read() call above. The flags are as follows:
192
193 HIDDEV_FLAG_UREF - read() calls will now return
194 struct hiddev_usage_ref instead of struct hiddev_event.
195 This is a larger structure, but in situations where the
196 device has more than one usage in its reports with the
197 same usage code, this mode serves to resolve such
198 ambiguity.
199
200 HIDDEV_FLAG_REPORT - This flag can only be used in conjunction
201 with HIDDEV_FLAG_UREF. With this flag set, when the device
202 sends a report, a struct hiddev_usage_ref will be returned
203 to read() filled in with the report_type and report_id, but
204 with field_index set to FIELD_INDEX_NONE. This serves as
205 additional notification when the device has sent a report.
diff --git a/Documentation/usb/hotplug.txt b/Documentation/usb/hotplug.txt
new file mode 100644
index 000000000000..f53170665f37
--- /dev/null
+++ b/Documentation/usb/hotplug.txt
@@ -0,0 +1,148 @@
1LINUX HOTPLUGGING
2
3In hotpluggable busses like USB (and Cardbus PCI), end-users plug devices
4into the bus with power on. In most cases, users expect the devices to become
5immediately usable. That means the system must do many things, including:
6
7 - Find a driver that can handle the device. That may involve
8 loading a kernel module; newer drivers can use module-init-tools
9 to publish their device (and class) support to user utilities.
10
11 - Bind a driver to that device. Bus frameworks do that using a
12 device driver's probe() routine.
13
14 - Tell other subsystems to configure the new device. Print
15 queues may need to be enabled, networks brought up, disk
16 partitions mounted, and so on. In some cases these will
17 be driver-specific actions.
18
19This involves a mix of kernel mode and user mode actions. Making devices
20be immediately usable means that any user mode actions can't wait for an
21administrator to do them: the kernel must trigger them, either passively
22(triggering some monitoring daemon to invoke a helper program) or
23actively (calling such a user mode helper program directly).
24
25Those triggered actions must support a system's administrative policies;
26such programs are called "policy agents" here. Typically they involve
27shell scripts that dispatch to more familiar administration tools.
28
29Because some of those actions rely on information about drivers (metadata)
30that is currently available only when the drivers are dynamically linked,
31you get the best hotplugging when you configure a highly modular system.
32
33
34KERNEL HOTPLUG HELPER (/sbin/hotplug)
35
36When you compile with CONFIG_HOTPLUG, you get a new kernel parameter:
37/proc/sys/kernel/hotplug, which normally holds the pathname "/sbin/hotplug".
38That parameter names a program which the kernel may invoke at various times.
39
40The /sbin/hotplug program can be invoked by any subsystem as part of its
41reaction to a configuration change, from a thread in that subsystem.
42Only one parameter is required: the name of a subsystem being notified of
43some kernel event. That name is used as the first key for further event
44dispatch; any other argument and environment parameters are specified by
45the subsystem making that invocation.
46
47Hotplug software and other resources is available at:
48
49 http://linux-hotplug.sourceforge.net
50
51Mailing list information is also available at that site.
52
53
54--------------------------------------------------------------------------
55
56
57USB POLICY AGENT
58
59The USB subsystem currently invokes /sbin/hotplug when USB devices
60are added or removed from system. The invocation is done by the kernel
61hub daemon thread [khubd], or else as part of root hub initialization
62(done by init, modprobe, kapmd, etc). Its single command line parameter
63is the string "usb", and it passes these environment variables:
64
65 ACTION ... "add", "remove"
66 PRODUCT ... USB vendor, product, and version codes (hex)
67 TYPE ... device class codes (decimal)
68 INTERFACE ... interface 0 class codes (decimal)
69
70If "usbdevfs" is configured, DEVICE and DEVFS are also passed. DEVICE is
71the pathname of the device, and is useful for devices with multiple and/or
72alternate interfaces that complicate driver selection. By design, USB
73hotplugging is independent of "usbdevfs": you can do most essential parts
74of USB device setup without using that filesystem, and without running a
75user mode daemon to detect changes in system configuration.
76
77Currently available policy agent implementations can load drivers for
78modules, and can invoke driver-specific setup scripts. The newest ones
79leverage USB module-init-tools support. Later agents might unload drivers.
80
81
82USB MODUTILS SUPPORT
83
84Current versions of module-init-tools will create a "modules.usbmap" file
85which contains the entries from each driver's MODULE_DEVICE_TABLE. Such
86files can be used by various user mode policy agents to make sure all the
87right driver modules get loaded, either at boot time or later.
88
89See <linux/usb.h> for full information about such table entries; or look
90at existing drivers. Each table entry describes one or more criteria to
91be used when matching a driver to a device or class of devices. The
92specific criteria are identified by bits set in "match_flags", paired
93with field values. You can construct the criteria directly, or with
94macros such as these, and use driver_info to store more information.
95
96 USB_DEVICE (vendorId, productId)
97 ... matching devices with specified vendor and product ids
98 USB_DEVICE_VER (vendorId, productId, lo, hi)
99 ... like USB_DEVICE with lo <= productversion <= hi
100 USB_INTERFACE_INFO (class, subclass, protocol)
101 ... matching specified interface class info
102 USB_DEVICE_INFO (class, subclass, protocol)
103 ... matching specified device class info
104
105A short example, for a driver that supports several specific USB devices
106and their quirks, might have a MODULE_DEVICE_TABLE like this:
107
108 static const struct usb_device_id mydriver_id_table = {
109 { USB_DEVICE (0x9999, 0xaaaa), driver_info: QUIRK_X },
110 { USB_DEVICE (0xbbbb, 0x8888), driver_info: QUIRK_Y|QUIRK_Z },
111 ...
112 { } /* end with an all-zeroes entry */
113 }
114 MODULE_DEVICE_TABLE (usb, mydriver_id_table);
115
116Most USB device drivers should pass these tables to the USB subsystem as
117well as to the module management subsystem. Not all, though: some driver
118frameworks connect using interfaces layered over USB, and so they won't
119need such a "struct usb_driver".
120
121Drivers that connect directly to the USB subsystem should be declared
122something like this:
123
124 static struct usb_driver mydriver = {
125 .name = "mydriver",
126 .id_table = mydriver_id_table,
127 .probe = my_probe,
128 .disconnect = my_disconnect,
129
130 /*
131 if using the usb chardev framework:
132 .minor = MY_USB_MINOR_START,
133 .fops = my_file_ops,
134 if exposing any operations through usbdevfs:
135 .ioctl = my_ioctl,
136 */
137 }
138
139When the USB subsystem knows about a driver's device ID table, it's used when
140choosing drivers to probe(). The thread doing new device processing checks
141drivers' device ID entries from the MODULE_DEVICE_TABLE against interface and
142device descriptors for the device. It will only call probe() if there is a
143match, and the third argument to probe() will be the entry that matched.
144
145If you don't provide an id_table for your driver, then your driver may get
146probed for each new device; the third parameter to probe() will be null.
147
148
diff --git a/Documentation/usb/ibmcam.txt b/Documentation/usb/ibmcam.txt
new file mode 100644
index 000000000000..ce2f21a3eac4
--- /dev/null
+++ b/Documentation/usb/ibmcam.txt
@@ -0,0 +1,324 @@
1README for Linux device driver for the IBM "C-It" USB video camera
2
3INTRODUCTION:
4
5This driver does not use all features known to exist in
6the IBM camera. However most of needed features work well.
7
8This driver was developed using logs of observed USB traffic
9which was produced by standard Windows driver (c-it98.sys).
10I did not have data sheets from Xirlink.
11
12Video formats:
13 128x96 [model 1]
14 176x144
15 320x240 [model 2]
16 352x240 [model 2]
17 352x288
18Frame rate: 3 - 30 frames per second (FPS)
19External interface: USB
20Internal interface: Video For Linux (V4L)
21Supported controls:
22- by V4L: Contrast, Brightness, Color, Hue
23- by driver options: frame rate, lighting conditions, video format,
24 default picture settings, sharpness.
25
26SUPPORTED CAMERAS:
27
28Xirlink "C-It" camera, also known as "IBM PC Camera".
29The device uses proprietary ASIC (and compression method);
30it is manufactured by Xirlink. See http://www.xirlink.com/
31http://www.ibmpccamera.com or http://www.c-itnow.com/ for
32details and pictures.
33
34This very chipset ("X Chip", as marked at the factory)
35is used in several other cameras, and they are supported
36as well:
37
38- IBM NetCamera
39- Veo Stingray
40
41The Linux driver was developed with camera with following
42model number (or FCC ID): KSX-XVP510. This camera has three
43interfaces, each with one endpoint (control, iso, iso). This
44type of cameras is referred to as "model 1". These cameras are
45no longer manufactured.
46
47Xirlink now manufactures new cameras which are somewhat different.
48In particular, following models [FCC ID] belong to that category:
49
50XVP300 [KSX-X9903]
51XVP600 [KSX-X9902]
52XVP610 [KSX-X9902]
53
54(see http://www.xirlink.com/ibmpccamera/ for updates, they refer
55to these new cameras by Windows driver dated 12-27-99, v3005 BETA)
56These cameras have two interfaces, one endpoint in each (iso, bulk).
57Such type of cameras is referred to as "model 2". They are supported
58(with exception of 352x288 native mode).
59
60Some IBM NetCameras (Model 4) are made to generate only compressed
61video streams. This is great for performance, but unfortunately
62nobody knows how to decompress the stream :-( Therefore, these
63cameras are *unsupported* and if you try to use one of those, all
64you get is random colored horizontal streaks, not the image!
65If you have one of those cameras, you probably should return it
66to the store and get something that is supported.
67
68Tell me more about all that "model" business
69--------------------------------------------
70
71I just invented model numbers to uniquely identify flavors of the
72hardware/firmware that were sold. It was very confusing to use
73brand names or some other internal numbering schemes. So I found
74by experimentation that all Xirlink chipsets fall into four big
75classes, and I called them "models". Each model is programmed in
76its own way, and each model sends back the video in its own way.
77
78Quirks of Model 2 cameras:
79-------------------------
80
81Model 2 does not have hardware contrast control. Corresponding V4L
82control is implemented in software, which is not very nice to your
83CPU, but at least it works.
84
85This driver provides 352x288 mode by switching the camera into
86quasi-352x288 RGB mode (800 Kbits per frame) essentially limiting
87this mode to 10 frames per second or less, in ideal conditions on
88the bus (USB is shared, after all). The frame rate
89has to be programmed very conservatively. Additional concern is that
90frame rate depends on brightness setting; therefore the picture can
91be good at one brightness and broken at another! I did not want to fix
92the frame rate at slowest setting, but I had to move it pretty much down
93the scale (so that framerate option barely matters). I also noticed that
94camera after first powering up produces frames slightly faster than during
95consecutive uses. All this means that if you use 352x288 (which is
96default), be warned - you may encounter broken picture on first connect;
97try to adjust brightness - brighter image is slower, so USB will be able
98to send all data. However if you regularly use Model 2 cameras you may
99prefer 176x144 which makes perfectly good I420, with no scaling and
100lesser demands on USB (300 Kbits per second, or 26 frames per second).
101
102Another strange effect of 352x288 mode is the fine vertical grid visible
103on some colored surfaces. I am sure it is caused by me not understanding
104what the camera is trying to say. Blame trade secrets for that.
105
106The camera that I had also has a hardware quirk: if disconnected,
107it needs few minutes to "relax" before it can be plugged in again
108(poorly designed USB processor reset circuit?)
109
110[Veo Stingray with Product ID 0x800C is also Model 2, but I haven't
111observed this particular flaw in it.]
112
113Model 2 camera can be programmed for very high sensitivity (even starlight
114may be enough), this makes it convenient for tinkering with. The driver
115code has enough comments to help a programmer to tweak the camera
116as s/he feels necessary.
117
118WHAT YOU NEED:
119
120- A supported IBM PC (C-it) camera (model 1 or 2)
121
122- A Linux box with USB support (2.3/2.4; 2.2 w/backport may work)
123
124- A Video4Linux compatible frame grabber program such as xawtv.
125
126HOW TO COMPILE THE DRIVER:
127
128You need to compile the driver only if you are a developer
129or if you want to make changes to the code. Most distributions
130precompile all modules, so you can go directly to the next
131section "HOW TO USE THE DRIVER".
132
133The ibmcam driver uses usbvideo helper library (module),
134so if you are studying the ibmcam code you will be led there.
135
136The driver itself consists of only one file in usb/ directory:
137ibmcam.c. This file is included into the Linux kernel build
138process if you configure the kernel for CONFIG_USB_IBMCAM.
139Run "make xconfig" and in USB section you will find the IBM
140camera driver. Select it, save the configuration and recompile.
141
142HOW TO USE THE DRIVER:
143
144I recommend to compile driver as a module. This gives you an
145easier access to its configuration. The camera has many more
146settings than V4L can operate, so some settings are done using
147module options.
148
149To begin with, on most modern Linux distributions the driver
150will be automatically loaded whenever you plug the supported
151camera in. Therefore, you don't need to do anything. However
152if you want to experiment with some module parameters then
153you can load and unload the driver manually, with camera
154plugged in or unplugged.
155
156Typically module is installed with command 'modprobe', like this:
157
158# modprobe ibmcam framerate=1
159
160Alternatively you can use 'insmod' in similar fashion:
161
162# insmod /lib/modules/2.x.y/usb/ibmcam.o framerate=1
163
164Module can be inserted with camera connected or disconnected.
165
166The driver can have options, though some defaults are provided.
167
168Driver options: (* indicates that option is model-dependent)
169
170Name Type Range [default] Example
171-------------- -------------- -------------- ------------------
172debug Integer 0-9 [0] debug=1
173flags Integer 0-0xFF [0] flags=0x0d
174framerate Integer 0-6 [2] framerate=1
175hue_correction Integer 0-255 [128] hue_correction=115
176init_brightness Integer 0-255 [128] init_brightness=100
177init_contrast Integer 0-255 [192] init_contrast=200
178init_color Integer 0-255 [128] init_color=130
179init_hue Integer 0-255 [128] init_hue=115
180lighting Integer 0-2* [1] lighting=2
181sharpness Integer 0-6* [4] sharpness=3
182size Integer 0-2* [2] size=1
183
184Options for Model 2 only:
185
186Name Type Range [default] Example
187-------------- -------------- -------------- ------------------
188init_model2_rg Integer 0..255 [0x70] init_model2_rg=128
189init_model2_rg2 Integer 0..255 [0x2f] init_model2_rg2=50
190init_model2_sat Integer 0..255 [0x34] init_model2_sat=65
191init_model2_yb Integer 0..255 [0xa0] init_model2_yb=200
192
193debug You don't need this option unless you are a developer.
194 If you are a developer then you will see in the code
195 what values do what. 0=off.
196
197flags This is a bit mask, and you can combine any number of
198 bits to produce what you want. Usually you don't want
199 any of extra features this option provides:
200
201 FLAGS_RETRY_VIDIOCSYNC 1 This bit allows to retry failed
202 VIDIOCSYNC ioctls without failing.
203 Will work with xawtv, will not
204 with xrealproducer. Default is
205 not set.
206 FLAGS_MONOCHROME 2 Activates monochrome (b/w) mode.
207 FLAGS_DISPLAY_HINTS 4 Shows colored pixels which have
208 magic meaning to developers.
209 FLAGS_OVERLAY_STATS 8 Shows tiny numbers on screen,
210 useful only for debugging.
211 FLAGS_FORCE_TESTPATTERN 16 Shows blue screen with numbers.
212 FLAGS_SEPARATE_FRAMES 32 Shows each frame separately, as
213 it was received from the camera.
214 Default (not set) is to mix the
215 preceding frame in to compensate
216 for occasional loss of Isoc data
217 on high frame rates.
218 FLAGS_CLEAN_FRAMES 64 Forces "cleanup" of each frame
219 prior to use; relevant only if
220 FLAGS_SEPARATE_FRAMES is set.
221 Default is not to clean frames,
222 this is a little faster but may
223 produce flicker if frame rate is
224 too high and Isoc data gets lost.
225 FLAGS_NO_DECODING 128 This flag turns the video stream
226 decoder off, and dumps the raw
227 Isoc data from the camera into
228 the reading process. Useful to
229 developers, but not to users.
230
231framerate This setting controls frame rate of the camera. This is
232 an approximate setting (in terms of "worst" ... "best")
233 because camera changes frame rate depending on amount
234 of light available. Setting 0 is slowest, 6 is fastest.
235 Beware - fast settings are very demanding and may not
236 work well with all video sizes. Be conservative.
237
238hue_correction This highly optional setting allows to adjust the
239 hue of the image in a way slightly different from
240 what usual "hue" control does. Both controls affect
241 YUV colorspace: regular "hue" control adjusts only
242 U component, and this "hue_correction" option similarly
243 adjusts only V component. However usually it is enough
244 to tweak only U or V to compensate for colored light or
245 color temperature; this option simply allows more
246 complicated correction when and if it is necessary.
247
248init_brightness These settings specify _initial_ values which will be
249init_contrast used to set up the camera. If your V4L application has
250init_color its own controls to adjust the picture then these
251init_hue controls will be used too. These options allow you to
252 preconfigure the camera when it gets connected, before
253 any V4L application connects to it. Good for webcams.
254
255init_model2_rg These initial settings alter color balance of the
256init_model2_rg2 camera on hardware level. All four settings may be used
257init_model2_sat to tune the camera to specific lighting conditions. These
258init_model2_yb settings only apply to Model 2 cameras.
259
260lighting This option selects one of three hardware-defined
261 photosensitivity settings of the camera. 0=bright light,
262 1=Medium (default), 2=Low light. This setting affects
263 frame rate: the dimmer the lighting the lower the frame
264 rate (because longer exposition time is needed). The
265 Model 2 cameras allow values more than 2 for this option,
266 thus enabling extremely high sensitivity at cost of frame
267 rate, color saturation and imaging sensor noise.
268
269sharpness This option controls smoothing (noise reduction)
270 made by camera. Setting 0 is most smooth, setting 6
271 is most sharp. Be aware that CMOS sensor used in the
272 camera is pretty noisy, so if you choose 6 you will
273 be greeted with "snowy" image. Default is 4. Model 2
274 cameras do not support this feature.
275
276size This setting chooses one of several image sizes that are
277 supported by this driver. Cameras may support more, but
278 it's difficult to reverse-engineer all formats.
279 Following video sizes are supported:
280
281 size=0 128x96 (Model 1 only)
282 size=1 160x120
283 size=2 176x144
284 size=3 320x240 (Model 2 only)
285 size=4 352x240 (Model 2 only)
286 size=5 352x288
287 size=6 640x480 (Model 3 only)
288
289 The 352x288 is the native size of the Model 1 sensor
290 array, so it's the best resolution the camera can
291 yield. The best resolution of Model 2 is 176x144, and
292 larger images are produced by stretching the bitmap.
293 Model 3 has sensor with 640x480 grid, and it works too,
294 but the frame rate will be exceptionally low (1-2 FPS);
295 it may be still OK for some applications, like security.
296 Choose the image size you need. The smaller image can
297 support faster frame rate. Default is 352x288.
298
299For more information and the Troubleshooting FAQ visit this URL:
300
301 http://www.linux-usb.org/ibmcam/
302
303WHAT NEEDS TO BE DONE:
304
305- The button on the camera is not used. I don't know how to get to it.
306 I know now how to read button on Model 2, but what to do with it?
307
308- Camera reports its status back to the driver; however I don't know
309 what returned data means. If camera fails at some initialization
310 stage then something should be done, and I don't do that because
311 I don't even know that some command failed. This is mostly Model 1
312 concern because Model 2 uses different commands which do not return
313 status (and seem to complete successfully every time).
314
315- Some flavors of Model 4 NetCameras produce only compressed video
316 streams, and I don't know how to decode them.
317
318CREDITS:
319
320The code is based in no small part on the CPiA driver by Johannes Erdfelt,
321Randy Dunlap, and others. Big thanks to them for their pioneering work on that
322and the USB stack.
323
324I also thank John Lightsey for his donation of the Veo Stingray camera.
diff --git a/Documentation/usb/linux.inf b/Documentation/usb/linux.inf
new file mode 100644
index 000000000000..2f7217d124ff
--- /dev/null
+++ b/Documentation/usb/linux.inf
@@ -0,0 +1,200 @@
1; MS-Windows driver config matching some basic modes of the
2; Linux-USB Ethernet/RNDIS gadget firmware:
3;
4; - RNDIS plus CDC Ethernet ... this may be familiar as a DOCSIS
5; cable modem profile, and supports most non-Microsoft USB hosts
6;
7; - RNDIS plus CDC Subset ... used by hardware that incapable of
8; full CDC Ethernet support.
9;
10; Microsoft only directly supports RNDIS drivers, and bundled them into XP.
11; The Microsoft "Remote NDIS USB Driver Kit" is currently found at:
12; http://www.microsoft.com/whdc/hwdev/resources/HWservices/rndis.mspx
13
14
15[Version]
16Signature = "$CHICAGO$"
17Class = Net
18ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
19Provider = %Linux%
20Compatible = 1
21MillenniumPreferred = .ME
22DriverVer = 03/30/2004,0.0.0.0
23; catalog file would be used by WHQL
24;CatalogFile = Linux.cat
25
26[Manufacturer]
27%Linux% = LinuxDevices,NT.5.1
28
29[LinuxDevices]
30; NetChip IDs, used by both firmware modes
31%LinuxDevice% = RNDIS, USB\VID_0525&PID_a4a2
32
33[LinuxDevices.NT.5.1]
34%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2
35
36[ControlFlags]
37ExcludeFromSelect=*
38
39; Windows 98, Windows 98 Second Edition specific sections --------
40
41[RNDIS]
42DeviceID = usb8023
43MaxInstance = 512
44DriverVer = 03/30/2004,0.0.0.0
45AddReg = RNDIS_AddReg_98, RNDIS_AddReg_Common
46
47[RNDIS_AddReg_98]
48HKR, , DevLoader, 0, *ndis
49HKR, , DeviceVxDs, 0, usb8023.sys
50HKR, NDIS, LogDriverName, 0, "usb8023"
51HKR, NDIS, MajorNdisVersion, 1, 5
52HKR, NDIS, MinorNdisVersion, 1, 0
53HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5"
54HKR, Ndi\Interfaces, DefLower, 0, "ethernet"
55HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5"
56HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
57HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_98"
58HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_98"
59HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_98"
60HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2"
61
62[RNDIS_Install_98]
63CopyFiles=RNDIS_CopyFiles_98
64
65[RNDIS_CopyFiles_98]
66usb8023.sys, usb8023w.sys, , 0
67rndismp.sys, rndismpw.sys, , 0
68
69; Windows Millennium Edition specific sections --------------------
70
71[RNDIS.ME]
72DeviceID = usb8023
73MaxInstance = 512
74DriverVer = 03/30/2004,0.0.0.0
75AddReg = RNDIS_AddReg_ME, RNDIS_AddReg_Common
76Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
77BusType = 15
78
79[RNDIS_AddReg_ME]
80HKR, , DevLoader, 0, *ndis
81HKR, , DeviceVxDs, 0, usb8023.sys
82HKR, NDIS, LogDriverName, 0, "usb8023"
83HKR, NDIS, MajorNdisVersion, 1, 5
84HKR, NDIS, MinorNdisVersion, 1, 0
85HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5"
86HKR, Ndi\Interfaces, DefLower, 0, "ethernet"
87HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5"
88HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
89HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_ME"
90HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_ME"
91HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_ME"
92HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2"
93
94[RNDIS_Install_ME]
95CopyFiles=RNDIS_CopyFiles_ME
96
97[RNDIS_CopyFiles_ME]
98usb8023.sys, usb8023m.sys, , 0
99rndismp.sys, rndismpm.sys, , 0
100
101; Windows 2000 specific sections ---------------------------------
102
103[RNDIS.NT]
104Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
105BusType = 15
106DriverVer = 03/30/2004,0.0.0.0
107AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common
108CopyFiles = RNDIS_CopyFiles_NT
109
110[RNDIS.NT.Services]
111AddService = USB_RNDIS, 2, RNDIS_ServiceInst_NT, RNDIS_EventLog
112
113[RNDIS_CopyFiles_NT]
114; no rename of files on Windows 2000, use the 'k' names as is
115usb8023k.sys, , , 0
116rndismpk.sys, , , 0
117
118[RNDIS_ServiceInst_NT]
119DisplayName = %ServiceDisplayName%
120ServiceType = 1
121StartType = 3
122ErrorControl = 1
123ServiceBinary = %12%\usb8023k.sys
124LoadOrderGroup = NDIS
125AddReg = RNDIS_WMI_AddReg_NT
126
127[RNDIS_WMI_AddReg_NT]
128HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismpk.sys"
129
130; Windows XP specific sections -----------------------------------
131
132[RNDIS.NT.5.1]
133Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
134BusType = 15
135DriverVer = 03/30/2004,0.0.0.0
136AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common
137; no copyfiles - the files are already in place
138
139[RNDIS.NT.5.1.Services]
140AddService = USB_RNDIS, 2, RNDIS_ServiceInst_51, RNDIS_EventLog
141
142[RNDIS_ServiceInst_51]
143DisplayName = %ServiceDisplayName%
144ServiceType = 1
145StartType = 3
146ErrorControl = 1
147ServiceBinary = %12%\usb8023.sys
148LoadOrderGroup = NDIS
149AddReg = RNDIS_WMI_AddReg_51
150
151[RNDIS_WMI_AddReg_51]
152HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismp.sys"
153
154; Windows 2000 and Windows XP common sections --------------------
155
156[RNDIS_AddReg_NT]
157HKR, Ndi, Service, 0, "USB_RNDIS"
158HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
159HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
160
161[RNDIS_EventLog]
162AddReg = RNDIS_EventLog_AddReg
163
164[RNDIS_EventLog_AddReg]
165HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll"
166HKR, , TypesSupported, 0x00010001, 7
167
168; Common Sections -------------------------------------------------
169
170[RNDIS_AddReg_Common]
171HKR, NDI\params\NetworkAddress, ParamDesc, 0, %NetworkAddress%
172HKR, NDI\params\NetworkAddress, type, 0, "edit"
173HKR, NDI\params\NetworkAddress, LimitText, 0, "12"
174HKR, NDI\params\NetworkAddress, UpperCase, 0, "1"
175HKR, NDI\params\NetworkAddress, default, 0, " "
176HKR, NDI\params\NetworkAddress, optional, 0, "1"
177
178[SourceDisksNames]
1791=%SourceDisk%,,1
180
181[SourceDisksFiles]
182usb8023m.sys=1
183rndismpm.sys=1
184usb8023w.sys=1
185rndismpw.sys=1
186usb8023k.sys=1
187rndismpk.sys=1
188
189[DestinationDirs]
190RNDIS_CopyFiles_98 = 10, system32/drivers
191RNDIS_CopyFiles_ME = 10, system32/drivers
192RNDIS_CopyFiles_NT = 12
193
194[Strings]
195ServiceDisplayName = "USB Remote NDIS Network Device Driver"
196NetworkAddress = "Network Address"
197Linux = "Linux Developer Community"
198LinuxDevice = "Linux USB Ethernet/RNDIS Gadget"
199SourceDisk = "Ethernet/RNDIS Gadget Driver Install Disk"
200
diff --git a/Documentation/usb/mtouchusb.txt b/Documentation/usb/mtouchusb.txt
new file mode 100644
index 000000000000..cd806bfc8b81
--- /dev/null
+++ b/Documentation/usb/mtouchusb.txt
@@ -0,0 +1,76 @@
1CHANGES
2
3- 0.3 - Created based off of scanner & INSTALL from the original touchscreen
4 driver on freshmeat (http://freshmeat.net/projects/3mtouchscreendriver)
5- Amended for linux-2.4.18, then 2.4.19
6
7- 0.5 - Complete rewrite using Linux Input in 2.6.3
8 Unfortunately no calibration support at this time
9
10- 1.4 - Multiple changes to support the EXII 5000UC and house cleaning
11 Changed reset from standard USB dev reset to vendor reset
12 Changed data sent to host from compensated to raw coordinates
13 Eliminated vendor/product module params
14 Performed multiple successfull tests with an EXII-5010UC
15
16SUPPORTED HARDWARE:
17
18 All controllers have the Vendor: 0x0596 & Product: 0x0001
19
20
21 Controller Description Part Number
22 ------------------------------------------------------
23
24 USB Capacitive - Pearl Case 14-205 (Discontinued)
25 USB Capacitive - Black Case 14-124 (Discontinued)
26 USB Capacitive - No Case 14-206 (Discontinued)
27
28 USB Capacitive - Pearl Case EXII-5010UC
29 USB Capacitive - Black Case EXII-5030UC
30 USB Capacitive - No Case EXII-5050UC
31
32DRIVER NOTES:
33
34Installation is simple, you only need to add Linux Input, Linux USB, and the
35driver to the kernel. The driver can also be optionally built as a module.
36
37This driver appears to be one of possible 2 Linux USB Input Touchscreen
38drivers. Although 3M produces a binary only driver available for
39download, I persist in updating this driver since I would like to use the
40touchscreen for embedded apps using QTEmbedded, DirectFB, etc. So I feel the
41logical choice is to use Linux Imput.
42
43Currently there is no way to calibrate the device via this driver. Even if
44the device could be calibrated, the driver pulls to raw coordinate data from
45the controller. This means calibration must be performed within the
46userspace.
47
48The controller screen resolution is now 0 to 16384 for both X and Y reporting
49the raw touch data. This is the same for the old and new capacitive USB
50controllers.
51
52Perhaps at some point an abstract function will be placed into evdev so
53generic functions like calibrations, resets, and vendor information can be
54requested from the userspace (And the drivers would handle the vendor specific
55tasks).
56
57ADDITIONAL INFORMATION/UPDATES/X CONFIGURATION EXAMPLE:
58
59http://groomlakelabs.com/grandamp/code/microtouch/
60
61TODO:
62
63Implement a control urb again to handle requests to and from the device
64such as calibration, etc once/if it becomes available.
65
66DISCLAMER:
67
68I am not a MicroTouch/3M employee, nor have I ever been. 3M does not support
69this driver! If you want touch drivers only supported within X, please go to:
70
71http://www.3m.com/3MTouchSystems/downloads/
72
73THANKS:
74
75A huge thank you to 3M Touch Systems for the EXII-5010UC controllers for
76testing!
diff --git a/Documentation/usb/ohci.txt b/Documentation/usb/ohci.txt
new file mode 100644
index 000000000000..99320d9fa523
--- /dev/null
+++ b/Documentation/usb/ohci.txt
@@ -0,0 +1,32 @@
123-Aug-2002
2
3The "ohci-hcd" driver is a USB Host Controller Driver (HCD) that is derived
4from the "usb-ohci" driver from the 2.4 kernel series. The "usb-ohci" code
5was written primarily by Roman Weissgaerber <weissg@vienna.at> but with
6contributions from many others (read its copyright/licencing header).
7
8It supports the "Open Host Controller Interface" (OHCI), which standardizes
9hardware register protocols used to talk to USB 1.1 host controllers. As
10compared to the earlier "Universal Host Controller Interface" (UHCI) from
11Intel, it pushes more intelligence into the hardware. USB 1.1 controllers
12from vendors other than Intel and VIA generally use OHCI.
13
14Changes since the 2.4 kernel include
15
16 - improved robustness; bugfixes; and less overhead
17 - supports the updated and simplified usbcore APIs
18 - interrupt transfers can be larger, and can be queued
19 - less code, by using the upper level "hcd" framework
20 - supports some non-PCI implementations of OHCI
21 - ... more
22
23The "ohci-hcd" driver handles all USB 1.1 transfer types. Transfers of all
24types can be queued. That was also true in "usb-ohci", except for interrupt
25transfers. Previously, using periods of one frame would risk data loss due
26to overhead in IRQ processing. When interrupt transfers are queued, those
27risks can be minimized by making sure the hardware always has transfers to
28work on while the OS is getting around to the relevant IRQ processing.
29
30- David Brownell
31 <dbrownell@users.sourceforge.net>
32
diff --git a/Documentation/usb/ov511.txt b/Documentation/usb/ov511.txt
new file mode 100644
index 000000000000..e1974ec8217e
--- /dev/null
+++ b/Documentation/usb/ov511.txt
@@ -0,0 +1,289 @@
1-------------------------------------------------------------------------------
2Readme for Linux device driver for the OmniVision OV511 USB to camera bridge IC
3-------------------------------------------------------------------------------
4
5Author: Mark McClelland
6Homepage: http://alpha.dyndns.org/ov511
7
8INTRODUCTION:
9
10This is a driver for the OV511, a USB-only chip used in many "webcam" devices.
11Any camera using the OV511/OV511+ and the OV6620/OV7610/20/20AE should work.
12Video capture devices that use the Philips SAA7111A decoder also work. It
13supports streaming and capture of color or monochrome video via the Video4Linux
14API. Most V4L apps are compatible with it. Most resolutions with a width and
15height that are a multiple of 8 are supported.
16
17If you need more information, please visit the OV511 homepage at the above URL.
18
19WHAT YOU NEED:
20
21- If you want to help with the development, get the chip's specification docs at
22 http://www.ovt.com/omniusbp.html
23
24- A Video4Linux compatible frame grabber program (I recommend vidcat and xawtv)
25 vidcat is part of the w3cam package: http://www.hdk-berlin.de/~rasca/w3cam/
26 xawtv is available at: http://www.in-berlin.de/User/kraxel/xawtv.html
27
28HOW TO USE IT:
29
30Note: These are simplified instructions. For complete instructions see:
31 http://alpha.dyndns.org/ov511/install.html
32
33You must have first compiled USB support, support for your specific USB host
34controller (UHCI or OHCI), and Video4Linux support for your kernel (I recommend
35making them modules.) Make sure "Enforce bandwidth allocation" is NOT enabled.
36
37Next, (as root):
38
39 modprobe usbcore
40 modprobe usb-uhci <OR> modprobe usb-ohci
41 modprobe videodev
42 modprobe ov511
43
44If it is not already there (it usually is), create the video device:
45
46 mknod /dev/video0 c 81 0
47
48Optionally, symlink /dev/video to /dev/video0
49
50You will have to set permissions on this device to allow you to read/write
51from it:
52
53 chmod 666 /dev/video
54 chmod 666 /dev/video0 (if necessary)
55
56Now you are ready to run a video app! Both vidcat and xawtv work well for me
57at 640x480.
58
59[Using vidcat:]
60
61 vidcat -s 640x480 -p c > test.jpg
62 xview test.jpg
63
64[Using xawtv:]
65
66From the main xawtv directory:
67
68 make clean
69 ./configure
70 make
71 make install
72
73Now you should be able to run xawtv. Right click for the options dialog.
74
75MODULE PARAMETERS:
76
77 You can set these with: insmod ov511 NAME=VALUE
78 There is currently no way to set these on a per-camera basis.
79
80 NAME: autobright
81 TYPE: integer (Boolean)
82 DEFAULT: 1
83 DESC: Brightness is normally under automatic control and can't be set
84 manually by the video app. Set to 0 for manual control.
85
86 NAME: autogain
87 TYPE: integer (Boolean)
88 DEFAULT: 1
89 DESC: Auto Gain Control enable. This feature is not yet implemented.
90
91 NAME: autoexp
92 TYPE: integer (Boolean)
93 DEFAULT: 1
94 DESC: Auto Exposure Control enable. This feature is not yet implemented.
95
96 NAME: debug
97 TYPE: integer (0-6)
98 DEFAULT: 3
99 DESC: Sets the threshold for printing debug messages. The higher the value,
100 the more is printed. The levels are cumulative, and are as follows:
101 0=no debug messages
102 1=init/detection/unload and other significant messages
103 2=some warning messages
104 3=config/control function calls
105 4=most function calls and data parsing messages
106 5=highly repetitive mesgs
107
108 NAME: snapshot
109 TYPE: integer (Boolean)
110 DEFAULT: 0
111 DESC: Set to 1 to enable snapshot mode. read()/VIDIOCSYNC will block until
112 the snapshot button is pressed. Note: enabling this mode disables
113 /proc/video/ov511/<minor#>/button
114
115 NAME: cams
116 TYPE: integer (1-4 for OV511, 1-31 for OV511+)
117 DEFAULT: 1
118 DESC: Number of cameras allowed to stream simultaneously on a single bus.
119 Values higher than 1 reduce the data rate of each camera, allowing two
120 or more to be used at once. If you have a complicated setup involving
121 both OV511 and OV511+ cameras, trial-and-error may be necessary for
122 finding the optimum setting.
123
124 NAME: compress
125 TYPE: integer (Boolean)
126 DEFAULT: 0
127 DESC: Set this to 1 to turn on the camera's compression engine. This can
128 potentially increase the frame rate at the expense of quality, if you
129 have a fast CPU. You must load the proper compression module for your
130 camera before starting your application (ov511_decomp or ov518_decomp).
131
132 NAME: testpat
133 TYPE: integer (Boolean)
134 DEFAULT: 0
135 DESC: This configures the camera's sensor to transmit a colored test-pattern
136 instead of an image. This does not work correctly yet.
137
138 NAME: dumppix
139 TYPE: integer (0-2)
140 DEFAULT: 0
141 DESC: Dumps raw pixel data and skips post-processing and format conversion.
142 It is for debugging purposes only. Options are:
143 0: Disable (default)
144 1: Dump raw data from camera, excluding headers and trailers
145 2: Dumps data exactly as received from camera
146
147 NAME: led
148 TYPE: integer (0-2)
149 DEFAULT: 1 (Always on)
150 DESC: Controls whether the LED (the little light) on the front of the camera
151 is always off (0), always on (1), or only on when driver is open (2).
152 This is not supported with the OV511, and might only work with certain
153 cameras (ones that actually have the LED wired to the control pin, and
154 not just hard-wired to be on all the time).
155
156 NAME: dump_bridge
157 TYPE: integer (Boolean)
158 DEFAULT: 0
159 DESC: Dumps the bridge (OV511[+] or OV518[+]) register values to the system
160 log. Only useful for serious debugging/development purposes.
161
162 NAME: dump_sensor
163 TYPE: integer (Boolean)
164 DEFAULT: 0
165 DESC: Dumps the sensor register values to the system log. Only useful for
166 serious debugging/development purposes.
167
168 NAME: printph
169 TYPE: integer (Boolean)
170 DEFAULT: 0
171 DESC: Setting this to 1 will dump the first 12 bytes of each isoc frame. This
172 is only useful if you are trying to debug problems with the isoc data
173 stream (i.e.: camera initializes, but vidcat hangs until Ctrl-C). Be
174 warned that this dumps a large number of messages to your kernel log.
175
176 NAME: phy, phuv, pvy, pvuv, qhy, qhuv, qvy, qvuv
177 TYPE: integer (0-63 for phy and phuv, 0-255 for rest)
178 DEFAULT: OV511 default values
179 DESC: These are registers 70h - 77h of the OV511, which control the
180 prediction ranges and quantization thresholds of the compressor, for
181 the Y and UV channels in the horizontal and vertical directions. See
182 the OV511 or OV511+ data sheet for more detailed descriptions. These
183 normally do not need to be changed.
184
185 NAME: lightfreq
186 TYPE: integer (0, 50, or 60)
187 DEFAULT: 0 (use sensor default)
188 DESC: Sets the sensor to match your lighting frequency. This can reduce the
189 appearance of "banding", i.e. horizontal lines or waves of light and
190 dark that are often caused by artificial lighting. Valid values are:
191 0 - Use default (depends on sensor, most likely 60 Hz)
192 50 - For European and Asian 50 Hz power
193 60 - For American 60 Hz power
194
195 NAME: bandingfilter
196 TYPE: integer (Boolean)
197 DEFAULT: 0 (off)
198 DESC: Enables the sensor´s banding filter exposure algorithm. This reduces
199 or stabilizes the "banding" caused by some artificial light sources
200 (especially fluorescent). You might have to set lightfreq correctly for
201 this to work right. As an added bonus, this sometimes makes it
202 possible to capture your monitor´s output.
203
204 NAME: fastset
205 TYPE: integer (Boolean)
206 DEFAULT: 0 (off)
207 DESC: Allows picture settings (brightness, contrast, color, and hue) to take
208 effect immediately, even in the middle of a frame. This reduces the
209 time to change settings, but can ruin frames during the change. Only
210 affects OmniVision sensors.
211
212 NAME: force_palette
213 TYPE: integer (Boolean)
214 DEFAULT: 0 (off)
215 DESC: Forces the palette (color format) to a specific value. If an
216 application requests a different palette, it will be rejected, thereby
217 forcing it to try others until it succeeds. This is useful for forcing
218 greyscale mode with a color camera, for example. Supported modes are:
219 0 (Allows all the following formats)
220 1 VIDEO_PALETTE_GREY (Linear greyscale)
221 10 VIDEO_PALETTE_YUV420 (YUV 4:2:0 Planar)
222 15 VIDEO_PALETTE_YUV420P (YUV 4:2:0 Planar, same as 10)
223
224 NAME: backlight
225 TYPE: integer (Boolean)
226 DEFAULT: 0 (off)
227 DESC: Setting this flag changes the exposure algorithm for OmniVision sensors
228 such that objects in the camera's view (i.e. your head) can be clearly
229 seen when they are illuminated from behind. It reduces or eliminates
230 the sensor's auto-exposure function, so it should only be used when
231 needed. Additionally, it is only supported with the OV6620 and OV7620.
232
233 NAME: unit_video
234 TYPE: Up to 16 comma-separated integers
235 DEFAULT: 0,0,0... (automatically assign the next available minor(s))
236 DESC: You can specify up to 16 minor numbers to be assigned to ov511 devices.
237 For example, "unit_video=1,3" will make the driver use /dev/video1 and
238 /dev/video3 for the first two devices it detects. Additional devices
239 will be assigned automatically starting at the first available device
240 node (/dev/video0 in this case). Note that you cannot specify 0 as a
241 minor number. This feature requires kernel version 2.4.5 or higher.
242
243 NAME: remove_zeros
244 TYPE: integer (Boolean)
245 DEFAULT: 0 (do not skip any incoming data)
246 DESC: Setting this to 1 will remove zero-padding from incoming data. This
247 will compensate for the blocks of corruption that can appear when the
248 camera cannot keep up with the speed of the USB bus (eg. at low frame
249 resolutions). This feature is always enabled when compression is on.
250
251 NAME: mirror
252 TYPE: integer (Boolean)
253 DEFAULT: 0 (off)
254 DESC: Setting this to 1 will reverse ("mirror") the image horizontally. This
255 might be necessary if your camera has a custom lens assembly. This has
256 no effect with video capture devices.
257
258 NAME: ov518_color
259 TYPE: integer (Boolean)
260 DEFAULT: 0 (off)
261 DESC: Enable OV518 color support. This is off by default since it doesn't
262 work most of the time. If you want to try it, you must also load
263 ov518_decomp with the "nouv=0" parameter. If you get improper colors or
264 diagonal lines through the image, restart your video app and try again.
265 Repeat as necessary.
266
267WORKING FEATURES:
268 o Color streaming/capture at most widths and heights that are multiples of 8.
269 o Monochrome (use force_palette=1 to enable)
270 o Setting/getting of saturation, contrast, brightness, and hue (only some of
271 them work the OV7620 and OV7620AE)
272 o /proc status reporting
273 o SAA7111A video capture support at 320x240 and 640x480
274 o Compression support
275 o SMP compatibility
276
277HOW TO CONTACT ME:
278
279You can email me at mark@alpha.dyndns.org . Please prefix the subject line
280with "OV511: " so that I am certain to notice your message.
281
282CREDITS:
283
284The code is based in no small part on the CPiA driver by Johannes Erdfelt,
285Randy Dunlap, and others. Big thanks to them for their pioneering work on that
286and the USB stack. Thanks to Bret Wallach for getting camera reg IO, ISOC, and
287image capture working. Thanks to Orion Sky Lawlor, Kevin Moore, and Claudio
288Matsuoka for their work as well.
289
diff --git a/Documentation/usb/proc_usb_info.txt b/Documentation/usb/proc_usb_info.txt
new file mode 100644
index 000000000000..729c72d34c89
--- /dev/null
+++ b/Documentation/usb/proc_usb_info.txt
@@ -0,0 +1,371 @@
1/proc/bus/usb filesystem output
2===============================
3(version 2003.05.30)
4
5
6The usbfs filesystem for USB devices is traditionally mounted at
7/proc/bus/usb. It provides the /proc/bus/usb/devices file, as well as
8the /proc/bus/usb/BBB/DDD files.
9
10
11**NOTE**: If /proc/bus/usb appears empty, and a host controller
12 driver has been linked, then you need to mount the
13 filesystem. Issue the command (as root):
14
15 mount -t usbfs none /proc/bus/usb
16
17 An alternative and more permanent method would be to add
18
19 none /proc/bus/usb usbfs defaults 0 0
20
21 to /etc/fstab. This will mount usbfs at each reboot.
22 You can then issue `cat /proc/bus/usb/devices` to extract
23 USB device information, and user mode drivers can use usbfs
24 to interact with USB devices.
25
26 There are a number of mount options supported by usbfs.
27 Consult the source code (linux/drivers/usb/core/inode.c) for
28 information about those options.
29
30**NOTE**: The filesystem has been renamed from "usbdevfs" to
31 "usbfs", to reduce confusion with "devfs". You may
32 still see references to the older "usbdevfs" name.
33
34For more information on mounting the usbfs file system, see the
35"USB Device Filesystem" section of the USB Guide. The latest copy
36of the USB Guide can be found at http://www.linux-usb.org/
37
38
39THE /proc/bus/usb/BBB/DDD FILES:
40--------------------------------
41Each connected USB device has one file. The BBB indicates the bus
42number. The DDD indicates the device address on that bus. Both
43of these numbers are assigned sequentially, and can be reused, so
44you can't rely on them for stable access to devices. For example,
45it's relatively common for devices to re-enumerate while they are
46still connected (perhaps someone jostled their power supply, hub,
47or USB cable), so a device might be 002/027 when you first connect
48it and 002/048 sometime later.
49
50These files can be read as binary data. The binary data consists
51of first the device descriptor, then the descriptors for each
52configuration of the device. That information is also shown in
53text form by the /proc/bus/usb/devices file, described later.
54
55These files may also be used to write user-level drivers for the USB
56devices. You would open the /proc/bus/usb/BBB/DDD file read/write,
57read its descriptors to make sure it's the device you expect, and then
58bind to an interface (or perhaps several) using an ioctl call. You
59would issue more ioctls to the device to communicate to it using
60control, bulk, or other kinds of USB transfers. The IOCTLs are
61listed in the <linux/usbdevice_fs.h> file, and at this writing the
62source code (linux/drivers/usb/devio.c) is the primary reference
63for how to access devices through those files.
64
65Note that since by default these BBB/DDD files are writable only by
66root, only root can write such user mode drivers. You can selectively
67grant read/write permissions to other users by using "chmod". Also,
68usbfs mount options such as "devmode=0666" may be helpful.
69
70
71
72THE /proc/bus/usb/devices FILE:
73-------------------------------
74In /proc/bus/usb/devices, each device's output has multiple
75lines of ASCII output.
76I made it ASCII instead of binary on purpose, so that someone
77can obtain some useful data from it without the use of an
78auxiliary program. However, with an auxiliary program, the numbers
79in the first 4 columns of each "T:" line (topology info:
80Lev, Prnt, Port, Cnt) can be used to build a USB topology diagram.
81
82Each line is tagged with a one-character ID for that line:
83
84T = Topology (etc.)
85B = Bandwidth (applies only to USB host controllers, which are
86 virtualized as root hubs)
87D = Device descriptor info.
88P = Product ID info. (from Device descriptor, but they won't fit
89 together on one line)
90S = String descriptors.
91C = Configuration descriptor info. (* = active configuration)
92I = Interface descriptor info.
93E = Endpoint descriptor info.
94
95=======================================================================
96
97/proc/bus/usb/devices output format:
98
99Legend:
100 d = decimal number (may have leading spaces or 0's)
101 x = hexadecimal number (may have leading spaces or 0's)
102 s = string
103
104
105Topology info:
106
107T: Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd
108| | | | | | | | |__MaxChildren
109| | | | | | | |__Device Speed in Mbps
110| | | | | | |__DeviceNumber
111| | | | | |__Count of devices at this level
112| | | | |__Connector/Port on Parent for this device
113| | | |__Parent DeviceNumber
114| | |__Level in topology for this bus
115| |__Bus number
116|__Topology info tag
117
118 Speed may be:
119 1.5 Mbit/s for low speed USB
120 12 Mbit/s for full speed USB
121 480 Mbit/s for high speed USB (added for USB 2.0)
122
123
124Bandwidth info:
125B: Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd
126| | | |__Number of isochronous requests
127| | |__Number of interrupt requests
128| |__Total Bandwidth allocated to this bus
129|__Bandwidth info tag
130
131 Bandwidth allocation is an approximation of how much of one frame
132 (millisecond) is in use. It reflects only periodic transfers, which
133 are the only transfers that reserve bandwidth. Control and bulk
134 transfers use all other bandwidth, including reserved bandwidth that
135 is not used for transfers (such as for short packets).
136
137 The percentage is how much of the "reserved" bandwidth is scheduled by
138 those transfers. For a low or full speed bus (loosely, "USB 1.1"),
139 90% of the bus bandwidth is reserved. For a high speed bus (loosely,
140 "USB 2.0") 80% is reserved.
141
142
143Device descriptor info & Product ID info:
144
145D: Ver=x.xx Cls=xx(s) Sub=xx Prot=xx MxPS=dd #Cfgs=dd
146P: Vendor=xxxx ProdID=xxxx Rev=xx.xx
147
148where
149D: Ver=x.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd
150| | | | | | |__NumberConfigurations
151| | | | | |__MaxPacketSize of Default Endpoint
152| | | | |__DeviceProtocol
153| | | |__DeviceSubClass
154| | |__DeviceClass
155| |__Device USB version
156|__Device info tag #1
157
158where
159P: Vendor=xxxx ProdID=xxxx Rev=xx.xx
160| | | |__Product revision number
161| | |__Product ID code
162| |__Vendor ID code
163|__Device info tag #2
164
165
166String descriptor info:
167
168S: Manufacturer=ssss
169| |__Manufacturer of this device as read from the device.
170| For USB host controller drivers (virtual root hubs) this may
171| be omitted, or (for newer drivers) will identify the kernel
172| version and the driver which provides this hub emulation.
173|__String info tag
174
175S: Product=ssss
176| |__Product description of this device as read from the device.
177| For older USB host controller drivers (virtual root hubs) this
178| indicates the driver; for newer ones, it's a product (and vendor)
179| description that often comes from the kernel's PCI ID database.
180|__String info tag
181
182S: SerialNumber=ssss
183| |__Serial Number of this device as read from the device.
184| For USB host controller drivers (virtual root hubs) this is
185| some unique ID, normally a bus ID (address or slot name) that
186| can't be shared with any other device.
187|__String info tag
188
189
190
191Configuration descriptor info:
192
193C:* #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA
194| | | | | |__MaxPower in mA
195| | | | |__Attributes
196| | | |__ConfiguratioNumber
197| | |__NumberOfInterfaces
198| |__ "*" indicates the active configuration (others are " ")
199|__Config info tag
200
201 USB devices may have multiple configurations, each of which act
202 rather differently. For example, a bus-powered configuration
203 might be much less capable than one that is self-powered. Only
204 one device configuration can be active at a time; most devices
205 have only one configuration.
206
207 Each configuration consists of one or more interfaces. Each
208 interface serves a distinct "function", which is typically bound
209 to a different USB device driver. One common example is a USB
210 speaker with an audio interface for playback, and a HID interface
211 for use with software volume control.
212
213
214Interface descriptor info (can be multiple per Config):
215
216I: If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=ssss
217| | | | | | | |__Driver name
218| | | | | | | or "(none)"
219| | | | | | |__InterfaceProtocol
220| | | | | |__InterfaceSubClass
221| | | | |__InterfaceClass
222| | | |__NumberOfEndpoints
223| | |__AlternateSettingNumber
224| |__InterfaceNumber
225|__Interface info tag
226
227 A given interface may have one or more "alternate" settings.
228 For example, default settings may not use more than a small
229 amount of periodic bandwidth. To use significant fractions
230 of bus bandwidth, drivers must select a non-default altsetting.
231
232 Only one setting for an interface may be active at a time, and
233 only one driver may bind to an interface at a time. Most devices
234 have only one alternate setting per interface.
235
236
237Endpoint descriptor info (can be multiple per Interface):
238
239E: Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=dddss
240| | | | |__Interval (max) between transfers
241| | | |__EndpointMaxPacketSize
242| | |__Attributes(EndpointType)
243| |__EndpointAddress(I=In,O=Out)
244|__Endpoint info tag
245
246 The interval is nonzero for all periodic (interrupt or isochronous)
247 endpoints. For high speed endpoints the transfer interval may be
248 measured in microseconds rather than milliseconds.
249
250 For high speed periodic endpoints, the "MaxPacketSize" reflects
251 the per-microframe data transfer size. For "high bandwidth"
252 endpoints, that can reflect two or three packets (for up to
253 3KBytes every 125 usec) per endpoint.
254
255 With the Linux-USB stack, periodic bandwidth reservations use the
256 transfer intervals and sizes provided by URBs, which can be less
257 than those found in endpoint descriptor.
258
259
260=======================================================================
261
262
263If a user or script is interested only in Topology info, for
264example, use something like "grep ^T: /proc/bus/usb/devices"
265for only the Topology lines. A command like
266"grep -i ^[tdp]: /proc/bus/usb/devices" can be used to list
267only the lines that begin with the characters in square brackets,
268where the valid characters are TDPCIE. With a slightly more able
269script, it can display any selected lines (for example, only T, D,
270and P lines) and change their output format. (The "procusb"
271Perl script is the beginning of this idea. It will list only
272selected lines [selected from TBDPSCIE] or "All" lines from
273/proc/bus/usb/devices.)
274
275The Topology lines can be used to generate a graphic/pictorial
276of the USB devices on a system's root hub. (See more below
277on how to do this.)
278
279The Interface lines can be used to determine what driver is
280being used for each device.
281
282The Configuration lines could be used to list maximum power
283(in milliamps) that a system's USB devices are using.
284For example, "grep ^C: /proc/bus/usb/devices".
285
286
287Here's an example, from a system which has a UHCI root hub,
288an external hub connected to the root hub, and a mouse and
289a serial converter connected to the external hub.
290
291T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
292B: Alloc= 28/900 us ( 3%), #Int= 2, #Iso= 0
293D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
294P: Vendor=0000 ProdID=0000 Rev= 0.00
295S: Product=USB UHCI Root Hub
296S: SerialNumber=dce0
297C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
298I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
299E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
300T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4
301D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
302P: Vendor=0451 ProdID=1446 Rev= 1.00
303C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
304I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
305E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms
306T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0
307D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
308P: Vendor=04b4 ProdID=0001 Rev= 0.00
309C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
310I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse
311E: Ad=81(I) Atr=03(Int.) MxPS= 3 Ivl= 10ms
312T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
313D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
314P: Vendor=0565 ProdID=0001 Rev= 1.08
315S: Manufacturer=Peracom Networks, Inc.
316S: Product=Peracom USB to Serial Converter
317C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
318I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial
319E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl= 16ms
320E: Ad=01(O) Atr=02(Bulk) MxPS= 16 Ivl= 16ms
321E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl= 8ms
322
323
324Selecting only the "T:" and "I:" lines from this (for example, by using
325"procusb ti"), we have:
326
327T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
328T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4
329I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
330T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0
331I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse
332T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
333I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial
334
335
336Physically this looks like (or could be converted to):
337
338 +------------------+
339 | PC/root_hub (12)| Dev# = 1
340 +------------------+ (nn) is Mbps.
341 Level 0 | CN.0 | CN.1 | [CN = connector/port #]
342 +------------------+
343 /
344 /
345 +-----------------------+
346 Level 1 | Dev#2: 4-port hub (12)|
347 +-----------------------+
348 |CN.0 |CN.1 |CN.2 |CN.3 |
349 +-----------------------+
350 \ \____________________
351 \_____ \
352 \ \
353 +--------------------+ +--------------------+
354 Level 2 | Dev# 3: mouse (1.5)| | Dev# 4: serial (12)|
355 +--------------------+ +--------------------+
356
357
358
359Or, in a more tree-like structure (ports [Connectors] without
360connections could be omitted):
361
362PC: Dev# 1, root hub, 2 ports, 12 Mbps
363|_ CN.0: Dev# 2, hub, 4 ports, 12 Mbps
364 |_ CN.0: Dev #3, mouse, 1.5 Mbps
365 |_ CN.1:
366 |_ CN.2: Dev #4, serial, 12 Mbps
367 |_ CN.3:
368|_ CN.1:
369
370
371 ### END ###
diff --git a/Documentation/usb/rio.txt b/Documentation/usb/rio.txt
new file mode 100644
index 000000000000..0aa79ab0088c
--- /dev/null
+++ b/Documentation/usb/rio.txt
@@ -0,0 +1,138 @@
1Copyright (C) 1999, 2000 Bruce Tenison
2Portions Copyright (C) 1999, 2000 David Nelson
3Thanks to David Nelson for guidance and the usage of the scanner.txt
4and scanner.c files to model our driver and this informative file.
5
6Mar. 2, 2000
7
8CHANGES
9
10- Initial Revision
11
12
13OVERVIEW
14
15This README will address issues regarding how to configure the kernel
16to access a RIO 500 mp3 player.
17Before I explain how to use this to access the Rio500 please be warned:
18
19W A R N I N G:
20--------------
21
22Please note that this software is still under development. The authors
23are in no way responsible for any damage that may occur, no matter how
24inconsequential.
25
26It seems that the Rio has a problem when sending .mp3 with low batteries.
27I suggest when the batteries are low and want to transfer stuff that you
28replace it with a fresh one. In my case, what happened is I lost two 16kb
29blocks (they are no longer usable to store information to it). But I don't
30know if thats normal or not. It could simply be a problem with the flash
31memory.
32
33In an extreme case, I left my Rio playing overnight and the batteries wore
34down to nothing and appear to have corrupted the flash memory. My RIO
35needed to be replaced as a result. Diamond tech support is aware of the
36problem. Do NOT allow your batteries to wear down to nothing before
37changing them. It appears RIO 500 firmware does not handle low battery
38power well at all.
39
40On systems with OHCI controllers, the kernel OHCI code appears to have
41power on problems with some chipsets. If you are having problems
42connecting to your RIO 500, try turning it on first and then plugging it
43into the USB cable.
44
45Contact information:
46--------------------
47
48 The main page for the project is hosted at sourceforge.net in the following
49 address: http://rio500.sourceforge.net You can also go to the sourceforge
50 project page at: http://sourceforge.net/project/?group_id=1944 There is
51 also a mailing list: rio500-users@lists.sourceforge.net
52
53Authors:
54-------
55
56Most of the code was written by Cesar Miquel <miquel@df.uba.ar>. Keith
57Clayton <kclayton@jps.net> is incharge of the PPC port and making sure
58things work there. Bruce Tenison <btenison@dibbs.net> is adding support
59for .fon files and also does testing. The program will mostly sure be
60re-written and Pete Ikusz along with the rest will re-design it. I would
61also like to thank Tri Nguyen <tmn_3022000@hotmail.com> who provided use
62with some important information regarding the communication with the Rio.
63
64ADDITIONAL INFORMATION and Userspace tools
65
66http://rio500.sourceforge.net/
67
68
69REQUIREMENTS
70
71A host with a USB port. Ideally, either a UHCI (Intel) or OHCI
72(Compaq and others) hardware port should work.
73
74A Linux development kernel (2.3.x) with USB support enabled or a
75backported version to linux-2.2.x. See http://www.linux-usb.org for
76more information on accomplishing this.
77
78A Linux kernel with RIO 500 support enabled.
79
80'lspci' which is only needed to determine the type of USB hardware
81available in your machine.
82
83CONFIGURATION
84
85Using `lspci -v`, determine the type of USB hardware available.
86
87 If you see something like:
88
89 USB Controller: ......
90 Flags: .....
91 I/O ports at ....
92
93 Then you have a UHCI based controller.
94
95 If you see something like:
96
97 USB Controller: .....
98 Flags: ....
99 Memory at .....
100
101 Then you have a OHCI based controller.
102
103Using `make menuconfig` or your preferred method for configuring the
104kernel, select 'Support for USB', 'OHCI/UHCI' depending on your
105hardware (determined from the steps above), 'USB Diamond Rio500 support', and
106'Preliminary USB device filesystem'. Compile and install the modules
107(you may need to execute `depmod -a` to update the module
108dependencies).
109
110Add a device for the USB rio500:
111 `mknod /dev/usb/rio500 c 180 64`
112
113Set appropriate permissions for /dev/usb/rio500 (don't forget about
114group and world permissions). Both read and write permissions are
115required for proper operation.
116
117Load the appropriate modules (if compiled as modules):
118
119 OHCI:
120 modprobe usbcore
121 modprobe usb-ohci
122 modprobe rio500
123
124 UHCI:
125 modprobe usbcore
126 modprobe usb-uhci (or uhci)
127 modprobe rio500
128
129That's it. The Rio500 Utils at: http://rio500.sourceforge.net should
130be able to access the rio500.
131
132BUGS
133
134If you encounter any problems feel free to drop me an email.
135
136Bruce Tenison
137btenison@dibbs.net
138
diff --git a/Documentation/usb/se401.txt b/Documentation/usb/se401.txt
new file mode 100644
index 000000000000..7b9d1c960a10
--- /dev/null
+++ b/Documentation/usb/se401.txt
@@ -0,0 +1,54 @@
1Linux driver for SE401 based USB cameras
2
3Copyright, 2001, Jeroen Vreeken
4
5
6INTRODUCTION:
7
8The SE401 chip is the used in low-cost usb webcams.
9It is produced by Endpoints Inc. (www.endpoints.com).
10It interfaces directly to a cmos image sensor and USB. The only other major
11part in a se401 based camera is a dram chip.
12
13The following cameras are known to work with this driver:
14
15Aox se401 (non-branded) cameras
16Philips PVCV665 USB VGA webcam 'Vesta Fun'
17Kensington VideoCAM PC Camera Model 67014
18Kensington VideoCAM PC Camera Model 67015
19Kensington VideoCAM PC Camera Model 67016
20Kensington VideoCAM PC Camera Model 67017
21
22
23WHAT YOU NEED:
24
25- USB support
26- VIDEO4LINUX support
27
28More information about USB support for linux can be found at:
29http://www.linux-usb.org
30
31
32MODULE OPTIONS:
33
34When the driver is compiled as a module you can also use the 'flickerless'
35option. With it exposure is limited to values that do not interfere with the
36net frequency. Valid options for this option are 0, 50 and 60. (0=disable,
3750=50hz, 60=60hz)
38
39
40KNOWN PROBLEMS:
41
42The driver works fine with the usb-ohci and uhci host controller drivers,
43the default settings also work with usb-uhci. But sending more than one bulk
44transfer at a time with usb-uhci doesn't work yet.
45Users of usb-ohci and uhci can safely enlarge SE401_NUMSBUF in se401.h in
46order to increase the throughput (and thus framerate).
47
48
49HELP:
50
51The latest info on this driver can be found at:
52http://www.chello.nl/~j.vreeken/se401/
53And questions to me can be send to:
54pe1rxq@amsat.org
diff --git a/Documentation/usb/sn9c102.txt b/Documentation/usb/sn9c102.txt
new file mode 100644
index 000000000000..cf9a1187edce
--- /dev/null
+++ b/Documentation/usb/sn9c102.txt
@@ -0,0 +1,480 @@
1
2 SN9C10x PC Camera Controllers
3 Driver for Linux
4 =============================
5
6 - Documentation -
7
8
9Index
10=====
111. Copyright
122. Disclaimer
133. License
144. Overview and features
155. Module dependencies
166. Module loading
177. Module parameters
188. Optional device control through "sysfs"
199. Supported devices
2010. How to add plug-in's for new image sensors
2111. Notes for V4L2 application developers
2212. Video frame formats
2313. Contact information
2414. Credits
25
26
271. Copyright
28============
29Copyright (C) 2004-2005 by Luca Risolia <luca.risolia@studio.unibo.it>
30
31
322. Disclaimer
33=============
34SONiX is a trademark of SONiX Technology Company Limited, inc.
35This software is not sponsored or developed by SONiX.
36
37
383. License
39==========
40This program is free software; you can redistribute it and/or modify
41it under the terms of the GNU General Public License as published by
42the Free Software Foundation; either version 2 of the License, or
43(at your option) any later version.
44
45This program is distributed in the hope that it will be useful,
46but WITHOUT ANY WARRANTY; without even the implied warranty of
47MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48GNU General Public License for more details.
49
50You should have received a copy of the GNU General Public License
51along with this program; if not, write to the Free Software
52Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
53
54
554. Overview and features
56========================
57This driver attempts to support the video and audio streaming capabilities of
58the devices mounting the SONiX SN9C101, SN9C102 and SN9C103 PC Camera
59Controllers.
60
61It's worth to note that SONiX has never collaborated with the author during the
62development of this project, despite several requests for enough detailed
63specifications of the register tables, compression engine and video data format
64of the above chips. Nevertheless, these informations are no longer necessary,
65becouse all the aspects related to these chips are known and have been
66described in detail in this documentation.
67
68The driver relies on the Video4Linux2 and USB core modules. It has been
69designed to run properly on SMP systems as well.
70
71The latest version of the SN9C10x driver can be found at the following URL:
72http://www.linux-projects.org/
73
74Some of the features of the driver are:
75
76- full compliance with the Video4Linux2 API (see also "Notes for V4L2
77 application developers" paragraph);
78- available mmap or read/poll methods for video streaming through isochronous
79 data transfers;
80- automatic detection of image sensor;
81- support for any window resolutions and optional panning within the maximum
82 pixel area of image sensor;
83- image downscaling with arbitrary scaling factors from 1, 2 and 4 in both
84 directions (see "Notes for V4L2 application developers" paragraph);
85- two different video formats for uncompressed or compressed data in low or
86 high compression quality (see also "Notes for V4L2 application developers"
87 and "Video frame formats" paragraphs);
88- full support for the capabilities of many of the possible image sensors that
89 can be connected to the SN9C10x bridges, including, for istance, red, green,
90 blue and global gain adjustments and exposure (see "Supported devices"
91 paragraph for details);
92- use of default color settings for sunlight conditions;
93- dynamic I/O interface for both SN9C10x and image sensor control and
94 monitoring (see "Optional device control through 'sysfs'" paragraph);
95- dynamic driver control thanks to various module parameters (see "Module
96 parameters" paragraph);
97- up to 64 cameras can be handled at the same time; they can be connected and
98 disconnected from the host many times without turning off the computer, if
99 your system supports hotplugging;
100- no known bugs.
101
102
1035. Module dependencies
104======================
105For it to work properly, the driver needs kernel support for Video4Linux and
106USB.
107
108The following options of the kernel configuration file must be enabled and
109corresponding modules must be compiled:
110
111 # Multimedia devices
112 #
113 CONFIG_VIDEO_DEV=m
114
115 # USB support
116 #
117 CONFIG_USB=m
118
119In addition, depending on the hardware being used, the modules below are
120necessary:
121
122 # USB Host Controller Drivers
123 #
124 CONFIG_USB_EHCI_HCD=m
125 CONFIG_USB_UHCI_HCD=m
126 CONFIG_USB_OHCI_HCD=m
127
128And finally:
129
130 # USB Multimedia devices
131 #
132 CONFIG_USB_SN9C102=m
133
134
1356. Module loading
136=================
137To use the driver, it is necessary to load the "sn9c102" module into memory
138after every other module required: "videodev", "usbcore" and, depending on
139the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd".
140
141Loading can be done as shown below:
142
143 [root@localhost home]# modprobe sn9c102
144
145At this point the devices should be recognized. You can invoke "dmesg" to
146analyze kernel messages and verify that the loading process has gone well:
147
148 [user@localhost home]$ dmesg
149
150
1517. Module parameters
152====================
153Module parameters are listed below:
154-------------------------------------------------------------------------------
155Name: video_nr
156Type: int array (min = 0, max = 64)
157Syntax: <-1|n[,...]>
158Description: Specify V4L2 minor mode number:
159 -1 = use next available
160 n = use minor number n
161 You can specify up to 64 cameras this way.
162 For example:
163 video_nr=-1,2,-1 would assign minor number 2 to the second
164 recognized camera and use auto for the first one and for every
165 other camera.
166Default: -1
167-------------------------------------------------------------------------------
168Name: force_munmap;
169Type: bool array (min = 0, max = 64)
170Syntax: <0|1[,...]>
171Description: Force the application to unmap previously mapped buffer memory
172 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not
173 all the applications support this feature. This parameter is
174 specific for each detected camera.
175 0 = do not force memory unmapping"
176 1 = force memory unmapping (save memory)"
177Default: 0
178-------------------------------------------------------------------------------
179Name: debug
180Type: int
181Syntax: <n>
182Description: Debugging information level, from 0 to 3:
183 0 = none (use carefully)
184 1 = critical errors
185 2 = significant informations
186 3 = more verbose messages
187 Level 3 is useful for testing only, when only one device
188 is used. It also shows some more informations about the
189 hardware being detected. This parameter can be changed at
190 runtime thanks to the /sys filesystem.
191Default: 2
192-------------------------------------------------------------------------------
193
194
1958. Optional device control through "sysfs" [1]
196==========================================
197It is possible to read and write both the SN9C10x and the image sensor
198registers by using the "sysfs" filesystem interface.
199
200Every time a supported device is recognized, a write-only file named "green" is
201created in the /sys/class/video4linux/videoX directory. You can set the green
202channel's gain by writing the desired value to it. The value may range from 0
203to 15 for SN9C101 or SN9C102 bridges, from 0 to 127 for SN9C103 bridges.
204Similarly, only for SN9C103 controllers, blue and red gain control files are
205available in the same directory, for which accepted values may range from 0 to
206127.
207
208There are other four entries in the directory above for each registered camera:
209"reg", "val", "i2c_reg" and "i2c_val". The first two files control the
210SN9C10x bridge, while the other two control the sensor chip. "reg" and
211"i2c_reg" hold the values of the current register index where the following
212reading/writing operations are addressed at through "val" and "i2c_val". Their
213use is not intended for end-users. Note that "i2c_reg" and "i2c_val" will not
214be created if the sensor does not actually support the standard I2C protocol or
215its registers are not 8-bit long. Also, remember that you must be logged in as
216root before writing to them.
217
218As an example, suppose we were to want to read the value contained in the
219register number 1 of the sensor register table - which is usually the product
220identifier - of the camera registered as "/dev/video0":
221
222 [root@localhost #] cd /sys/class/video4linux/video0
223 [root@localhost #] echo 1 > i2c_reg
224 [root@localhost #] cat i2c_val
225
226Note that "cat" will fail if sensor registers cannot be read.
227
228Now let's set the green gain's register of the SN9C101 or SN9C102 chips to 2:
229
230 [root@localhost #] echo 0x11 > reg
231 [root@localhost #] echo 2 > val
232
233Note that the SN9C10x always returns 0 when some of its registers are read.
234To avoid race conditions, all the I/O accesses to the above files are
235serialized.
236
237The sysfs interface also provides the "frame_header" entry, which exports the
238frame header of the most recent requested and captured video frame. The header
239is 12-bytes long and is appended to every video frame by the SN9C10x
240controllers. As an example, this additional information can be used by the user
241application for implementing auto-exposure features via software.
242
243The following table describes the frame header:
244
245Byte # Value Description
246------ ----- -----------
2470x00 0xFF Frame synchronisation pattern.
2480x01 0xFF Frame synchronisation pattern.
2490x02 0x00 Frame synchronisation pattern.
2500x03 0xC4 Frame synchronisation pattern.
2510x04 0xC4 Frame synchronisation pattern.
2520x05 0x96 Frame synchronisation pattern.
2530x06 0x00 or 0x01 Unknown meaning. The exact value depends on the chip.
2540x07 0xXX Variable value, whose bits are ff00uzzc, where ff is a
255 frame counter, u is unknown, zz is a size indicator
256 (00 = VGA, 01 = SIF, 10 = QSIF) and c stands for
257 "compression enabled" (1 = yes, 0 = no).
2580x08 0xXX Brightness sum inside Auto-Exposure area (low-byte).
2590x09 0xXX Brightness sum inside Auto-Exposure area (high-byte).
260 For a pure white image, this number will be equal to 500
261 times the area of the specified AE area. For images
262 that are not pure white, the value scales down according
263 to relative whiteness.
2640x0A 0xXX Brightness sum outside Auto-Exposure area (low-byte).
2650x0B 0xXX Brightness sum outside Auto-Exposure area (high-byte).
266 For a pure white image, this number will be equal to 125
267 times the area outside of the specified AE area. For
268 images that are not pure white, the value scales down
269 according to relative whiteness.
270
271The AE area (sx, sy, ex, ey) in the active window can be set by programming the
272registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C10x controllers, where one unit
273corresponds to 32 pixels.
274
275[1] The frame header has been documented by Bertrik Sikken.
276
277
2789. Supported devices
279====================
280None of the names of the companies as well as their products will be mentioned
281here. They have never collaborated with the author, so no advertising.
282
283From the point of view of a driver, what unambiguously identify a device are
284its vendor and product USB identifiers. Below is a list of known identifiers of
285devices mounting the SN9C10x PC camera controllers:
286
287Vendor ID Product ID
288--------- ----------
2890x0c45 0x6001
2900x0c45 0x6005
2910x0c45 0x6009
2920x0c45 0x600d
2930x0c45 0x6024
2940x0c45 0x6025
2950x0c45 0x6028
2960x0c45 0x6029
2970x0c45 0x602a
2980x0c45 0x602b
2990x0c45 0x602c
3000x0c45 0x6030
3010x0c45 0x6080
3020x0c45 0x6082
3030x0c45 0x6083
3040x0c45 0x6088
3050x0c45 0x608a
3060x0c45 0x608b
3070x0c45 0x608c
3080x0c45 0x608e
3090x0c45 0x608f
3100x0c45 0x60a0
3110x0c45 0x60a2
3120x0c45 0x60a3
3130x0c45 0x60a8
3140x0c45 0x60aa
3150x0c45 0x60ab
3160x0c45 0x60ac
3170x0c45 0x60ae
3180x0c45 0x60af
3190x0c45 0x60b0
3200x0c45 0x60b2
3210x0c45 0x60b3
3220x0c45 0x60b8
3230x0c45 0x60ba
3240x0c45 0x60bb
3250x0c45 0x60bc
3260x0c45 0x60be
327
328The list above does not imply that all those devices work with this driver: up
329until now only the ones that mount the following image sensors are supported;
330kernel messages will always tell you whether this is the case:
331
332Model Manufacturer
333----- ------------
334HV7131D Hynix Semiconductor, Inc.
335MI-0343 Micron Technology, Inc.
336PAS106B PixArt Imaging, Inc.
337PAS202BCB PixArt Imaging, Inc.
338TAS5110C1B Taiwan Advanced Sensor Corporation
339TAS5130D1B Taiwan Advanced Sensor Corporation
340
341All the available control settings of each image sensor are supported through
342the V4L2 interface.
343
344Donations of new models for further testing and support would be much
345appreciated. Non-available hardware will not be supported by the author of this
346driver.
347
348
34910. How to add plug-in's for new image sensors
350==============================================
351It should be easy to write plug-in's for new sensors by using the small API
352that has been created for this purpose, which is present in "sn9c102_sensor.h"
353(documentation is included there). As an example, have a look at the code in
354"sn9c102_pas106b.c", which uses the mentioned interface.
355
356At the moment, possible unsupported image sensors are: CIS-VF10 (VGA),
357OV7620 (VGA), OV7630 (VGA).
358
359
36011. Notes for V4L2 application developers
361=========================================
362This driver follows the V4L2 API specifications. In particular, it enforces two
363rules:
364
365- exactly one I/O method, either "mmap" or "read", is associated with each
366file descriptor. Once it is selected, the application must close and reopen the
367device to switch to the other I/O method;
368
369- although it is not mandatory, previously mapped buffer memory should always
370be unmapped before calling any "VIDIOC_S_CROP" or "VIDIOC_S_FMT" ioctl's.
371The same number of buffers as before will be allocated again to match the size
372of the new video frames, so you have to map the buffers again before any I/O
373attempts on them.
374
375Consistently with the hardware limits, this driver also supports image
376downscaling with arbitrary scaling factors from 1, 2 and 4 in both directions.
377However, the V4L2 API specifications don't correctly define how the scaling
378factor can be chosen arbitrarily by the "negotiation" of the "source" and
379"target" rectangles. To work around this flaw, we have added the convention
380that, during the negotiation, whenever the "VIDIOC_S_CROP" ioctl is issued, the
381scaling factor is restored to 1.
382
383This driver supports two different video formats: the first one is the "8-bit
384Sequential Bayer" format and can be used to obtain uncompressed video data
385from the device through the current I/O method, while the second one provides
386"raw" compressed video data (without frame headers not related to the
387compressed data). The compression quality may vary from 0 to 1 and can be
388selected or queried thanks to the VIDIOC_S_JPEGCOMP and VIDIOC_G_JPEGCOMP V4L2
389ioctl's. For maximum flexibility, both the default active video format and the
390default compression quality depend on how the image sensor being used is
391initialized (as described in the documentation of the API for the image sensors
392supplied by this driver).
393
394
39512. Video frame formats [1]
396=======================
397The SN9C10x PC Camera Controllers can send images in two possible video
398formats over the USB: either native "Sequential RGB Bayer" or Huffman
399compressed. The latter is used to achieve high frame rates. The current video
400format may be selected or queried from the user application by calling the
401VIDIOC_S_FMT or VIDIOC_G_FMT ioctl's, as described in the V4L2 API
402specifications.
403
404The name "Sequential Bayer" indicates the organization of the red, green and
405blue pixels in one video frame. Each pixel is associated with a 8-bit long
406value and is disposed in memory according to the pattern shown below:
407
408B[0] G[1] B[2] G[3] ... B[m-2] G[m-1]
409G[m] R[m+1] G[m+2] R[m+2] ... G[2m-2] R[2m-1]
410...
411... B[(n-1)(m-2)] G[(n-1)(m-1)]
412... G[n(m-2)] R[n(m-1)]
413
414The above matrix also represents the sequential or progressive read-out mode of
415the (n, m) Bayer color filter array used in many CCD/CMOS image sensors.
416
417One compressed video frame consists of a bitstream that encodes for every R, G,
418or B pixel the difference between the value of the pixel itself and some
419reference pixel value. Pixels are organised in the Bayer pattern and the Bayer
420sub-pixels are tracked individually and alternatingly. For example, in the
421first line values for the B and G1 pixels are alternatingly encoded, while in
422the second line values for the G2 and R pixels are alternatingly encoded.
423
424The pixel reference value is calculated as follows:
425- the 4 top left pixels are encoded in raw uncompressed 8-bit format;
426- the value in the top two rows is the value of the pixel left of the current
427 pixel;
428- the value in the left column is the value of the pixel above the current
429 pixel;
430- for all other pixels, the reference value is the average of the value of the
431 pixel on the left and the value of the pixel above the current pixel;
432- there is one code in the bitstream that specifies the value of a pixel
433 directly (in 4-bit resolution);
434- pixel values need to be clamped inside the range [0..255] for proper
435 decoding.
436
437The algorithm purely describes the conversion from compressed Bayer code used
438in the SN9C10x chips to uncompressed Bayer. Additional steps are required to
439convert this to a color image (i.e. a color interpolation algorithm).
440
441The following Huffman codes have been found:
4420: +0 (relative to reference pixel value)
443100: +4
444101: -4?
4451110xxxx: set absolute value to xxxx.0000
4461101: +11
4471111: -11
44811001: +20
449110000: -20
450110001: ??? - these codes are apparently not used
451
452[1] The Huffman compression algorithm has been reverse-engineered and
453 documented by Bertrik Sikken.
454
455
45613. Contact information
457=======================
458The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>.
459
460GPG/PGP encrypted e-mail's are accepted. The GPG key ID of the author is
461'FCE635A4'; the public 1024-bit key should be available at any keyserver;
462the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
463
464
46514. Credits
466===========
467Many thanks to following persons for their contribute (listed in alphabetical
468order):
469
470- Luca Capello for the donation of a webcam;
471- Joao Rodrigo Fuzaro, Joao Limirio, Claudio Filho and Caio Begotti for the
472 donation of a webcam;
473- Carlos Eduardo Medaglia Dyonisio, who added the support for the PAS202BCB
474 image sensor;
475- Stefano Mozzi, who donated 45 EU;
476- Bertrik Sikken, who reverse-engineered and documented the Huffman compression
477 algorithm used in the SN9C10x controllers and implemented the first decoder;
478- Mizuno Takafumi for the donation of a webcam;
479- An "anonymous" donator (who didn't want his name to be revealed) for the
480 donation of a webcam.
diff --git a/Documentation/usb/stv680.txt b/Documentation/usb/stv680.txt
new file mode 100644
index 000000000000..6448041e7a37
--- /dev/null
+++ b/Documentation/usb/stv680.txt
@@ -0,0 +1,55 @@
1Linux driver for STV0680 based USB cameras
2
3Copyright, 2001, Kevin Sisson
4
5
6INTRODUCTION:
7
8STMicroelectronics produces the STV0680B chip, which comes in two
9types, -001 and -003. The -003 version allows the recording and downloading
10of sound clips from the camera, and allows a flash attachment. Otherwise,
11it uses the same commands as the -001 version. Both versions support a
12variety of SDRAM sizes and sensors, allowing for a maximum of 26 VGA or 20
13CIF pictures. The STV0680 supports either a serial or a usb interface, and
14video is possible through the usb interface.
15
16The following cameras are known to work with this driver, although any
17camera with Vendor/Product codes of 0553/0202 should work:
18
19Aiptek Pencam (various models)
20Nisis QuickPix 2
21Radio Shack 'Kid's digital camera' (#60-1207)
22At least one Trust Spycam model
23Several other European brand models
24
25WHAT YOU NEED:
26
27- USB support
28- VIDEO4LINUX support
29
30More information about USB support for linux can be found at:
31http://www.linux-usb.org
32
33
34MODULE OPTIONS:
35
36When the driver is compiled as a module, you can set a "swapRGB=1"
37option, if necessary, for those applications that require it
38(such as xawtv). However, the driver should detect and set this
39automatically, so this option should not normally be used.
40
41
42KNOWN PROBLEMS:
43
44The driver seems to work better with the usb-ohci than the usb-uhci host
45controller driver.
46
47HELP:
48
49The latest info on this driver can be found at:
50http://personal.clt.bellsouth.net/~kjsisson or at
51http://stv0680-usb.sourceforge.net
52
53Any questions to me can be send to: kjsisson@bellsouth.net
54
55
diff --git a/Documentation/usb/uhci.txt b/Documentation/usb/uhci.txt
new file mode 100644
index 000000000000..2f25952c86c6
--- /dev/null
+++ b/Documentation/usb/uhci.txt
@@ -0,0 +1,165 @@
1Specification and Internals for the New UHCI Driver (Whitepaper...)
2
3 brought to you by
4
5 Georg Acher, acher@in.tum.de (executive slave) (base guitar)
6 Deti Fliegl, deti@fliegl.de (executive slave) (lead voice)
7 Thomas Sailer, sailer@ife.ee.ethz.ch (chief consultant) (cheer leader)
8
9 $Id: README.uhci,v 1.1 1999/12/14 14:03:02 fliegl Exp $
10
11This document and the new uhci sources can be found on
12 http://hotswap.in.tum.de/usb
13
141. General issues
15
161.1 Why a new UHCI driver, we already have one?!?
17
18Correct, but its internal structure got more and more mixed up by the (still
19ongoing) efforts to get isochronous transfers (ISO) to work.
20Since there is an increasing need for reliable ISO-transfers (especially
21for USB-audio needed by TS and for a DAB-USB-Receiver build by GA and DF),
22this state was a bit unsatisfying in our opinion, so we've decided (based
23on knowledge and experiences with the old UHCI driver) to start
24from scratch with a new approach, much simpler but at the same time more
25powerful.
26It is inspired by the way Win98/Win2000 handles USB requests via URBs,
27but it's definitely 100% free of MS-code and doesn't crash while
28unplugging an used ISO-device like Win98 ;-)
29Some code for HW setup and root hub management was taken from the
30original UHCI driver, but heavily modified to fit into the new code.
31The invention of the basic concept, and major coding were completed in two
32days (and nights) on the 16th and 17th of October 1999, now known as the
33great USB-October-Revolution started by GA, DF, and TS ;-)
34
35Since the concept is in no way UHCI dependent, we hope that it will also be
36transferred to the OHCI-driver, so both drivers share a common API.
37
381.2. Advantages and disadvantages
39
40+ All USB transfer types work now!
41+ Asynchronous operation
42+ Simple, but powerful interface (only two calls for start and cancel)
43+ Easy migration to the new API, simplified by a compatibility API
44+ Simple usage of ISO transfers
45+ Automatic linking of requests
46+ ISO transfers allow variable length for each frame and striping
47+ No CPU dependent and non-portable atomic memory access, no asm()-inlines
48+ Tested on x86 and Alpha
49
50- Rewriting for ISO transfers needed
51
521.3. Is there some compatibility to the old API?
53
54Yes, but only for control, bulk and interrupt transfers. We've implemented
55some wrapper calls for these transfer types. The usbcore works fine with
56these wrappers. For ISO there's no compatibility, because the old ISO-API
57and its semantics were unnecessary complicated in our opinion.
58
591.4. What's really working?
60
61As said above, CTRL and BULK already work fine even with the wrappers,
62so legacy code wouldn't notice the change.
63Regarding to Thomas, ISO transfers now run stable with USB audio.
64INT transfers (e.g. mouse driver) work fine, too.
65
661.5. Are there any bugs?
67
68No ;-)
69Hm...
70Well, of course this implementation needs extensive testing on all available
71hardware, but we believe that any fixes shouldn't harm the overall concept.
72
731.6. What should be done next?
74
75A large part of the request handling seems to be identical for UHCI and
76OHCI, so it would be a good idea to extract the common parts and have only
77the HW specific stuff in uhci.c. Furthermore, all other USB device drivers
78should need URBification, if they use isochronous or interrupt transfers.
79One thing missing in the current implementation (and the old UHCI driver)
80is fair queueing for BULK transfers. Since this would need (in principle)
81the alteration of already constructed TD chains (to switch from depth to
82breadth execution), another way has to be found. Maybe some simple
83heuristics work with the same effect.
84
85---------------------------------------------------------------------------
86
872. Internal structure and mechanisms
88
89To get quickly familiar with the internal structures, here's a short
90description how the new UHCI driver works. However, the ultimate source of
91truth is only uhci.c!
92
932.1. Descriptor structure (QHs and TDs)
94
95During initialization, the following skeleton is allocated in init_skel:
96
97 framespecific | common chain
98
99framelist[]
100[ 0 ]-----> TD --> TD -------\
101[ 1 ]-----> TD --> TD --------> TD ----> QH -------> QH -------> QH ---> NULL
102 ... TD --> TD -------/
103[1023]-----> TD --> TD ------/
104
105 ^^ ^^ ^^ ^^ ^^ ^^
106 1024 TDs for 7 TDs for 1 TD for Start of Start of End Chain
107 ISO INT (2-128ms) 1ms-INT CTRL Chain BULK Chain
108
109For each CTRL or BULK transfer a new QH is allocated and the containing data
110transfers are appended as (vertical) TDs. After building the whole QH with its
111dangling TDs, the QH is inserted before the BULK Chain QH (for CTRL) or
112before the End Chain QH (for BULK). Since only the QH->next pointers are
113affected, no atomic memory operation is required. The three QHs in the
114common chain are never equipped with TDs!
115
116For ISO or INT, the TD for each frame is simply inserted into the appropriate
117ISO/INT-TD-chain for the desired frame. The 7 skeleton INT-TDs are scattered
118among the 1024 frames similar to the old UHCI driver.
119
120For CTRL/BULK/ISO, the last TD in the transfer has the IOC-bit set. For INT,
121every TD (there is only one...) has the IOC-bit set.
122
123Besides the data for the UHCI controller (2 or 4 32bit words), the descriptors
124are double-linked through the .vertical and .horizontal elements in the
125SW data of the descriptor (using the double-linked list structures and
126operations), but SW-linking occurs only in closed domains, i.e. for each of
127the 1024 ISO-chains and the 8 INT-chains there is a closed cycle. This
128simplifies all insertions and unlinking operations and avoids costly
129bus_to_virt()-calls.
130
1312.2. URB structure and linking to QH/TDs
132
133During assembly of the QH and TDs of the requested action, these descriptors
134are stored in urb->urb_list, so the allocated QH/TD descriptors are bound to
135this URB.
136If the assembly was successful and the descriptors were added to the HW chain,
137the corresponding URB is inserted into a global URB list for this controller.
138This list stores all pending URBs.
139
1402.3. Interrupt processing
141
142Since UHCI provides no means to directly detect completed transactions, the
143following is done in each UHCI interrupt (uhci_interrupt()):
144
145For each URB in the pending queue (process_urb()), the ACTIVE-flag of the
146associated TDs are processed (depending on the transfer type
147process_{transfer|interrupt|iso}()). If the TDs are not active anymore,
148they indicate the completion of the transaction and the status is calculated.
149Inactive QH/TDs are removed from the HW chain (since the host controller
150already removed the TDs from the QH, no atomic access is needed) and
151eventually the URB is marked as completed (OK or errors) and removed from the
152pending queue. Then the next linked URB is submitted. After (or immediately
153before) that, the completion handler is called.
154
1552.4. Unlinking URBs
156
157First, all QH/TDs stored in the URB are unlinked from the HW chain.
158To ensure that the host controller really left a vertical TD chain, we
159wait for one frame. After that, the TDs are physically destroyed.
160
1612.5. URB linking and the consequences
162
163Since URBs can be linked and the corresponding submit_urb is called in
164the UHCI-interrupt, all work associated with URB/QH/TD assembly has to be
165interrupt save. This forces kmalloc to use GFP_ATOMIC in the interrupt.
diff --git a/Documentation/usb/usb-help.txt b/Documentation/usb/usb-help.txt
new file mode 100644
index 000000000000..b7c324973695
--- /dev/null
+++ b/Documentation/usb/usb-help.txt
@@ -0,0 +1,19 @@
1usb-help.txt
22000-July-12
3
4For USB help other than the readme files that are located in
5Documentation/usb/*, see the following:
6
7Linux-USB project: http://www.linux-usb.org
8 mirrors at http://www.suse.cz/development/linux-usb/
9 and http://usb.in.tum.de/linux-usb/
10 and http://it.linux-usb.org
11Linux USB Guide: http://linux-usb.sourceforge.net
12Linux-USB device overview (working devices and drivers):
13 http://www.qbik.ch/usb/devices/
14
15The Linux-USB mailing lists are:
16 linux-usb-users@lists.sourceforge.net for general user help
17 linux-usb-devel@lists.sourceforge.net for developer discussions
18
19###
diff --git a/Documentation/usb/usb-serial.txt b/Documentation/usb/usb-serial.txt
new file mode 100644
index 000000000000..f001cd93b79b
--- /dev/null
+++ b/Documentation/usb/usb-serial.txt
@@ -0,0 +1,470 @@
1INTRODUCTION
2
3 The USB serial driver currently supports a number of different USB to
4 serial converter products, as well as some devices that use a serial
5 interface from userspace to talk to the device.
6
7 See the individual product section below for specific information about
8 the different devices.
9
10
11CONFIGURATION
12
13 Currently the driver can handle up to 256 different serial interfaces at
14 one time.
15
16 If you are not using devfs:
17 The major number that the driver uses is 188 so to use the driver,
18 create the following nodes:
19 mknod /dev/ttyUSB0 c 188 0
20 mknod /dev/ttyUSB1 c 188 1
21 mknod /dev/ttyUSB2 c 188 2
22 mknod /dev/ttyUSB3 c 188 3
23 .
24 .
25 .
26 mknod /dev/ttyUSB254 c 188 254
27 mknod /dev/ttyUSB255 c 188 255
28
29 If you are using devfs:
30 The devices supported by this driver will show up as
31 /dev/usb/tts/{0,1,...}
32
33 When the device is connected and recognized by the driver, the driver
34 will print to the system log, which node(s) the device has been bound
35 to.
36
37
38SPECIFIC DEVICES SUPPORTED
39
40
41ConnectTech WhiteHEAT 4 port converter
42
43 ConnectTech has been very forthcoming with information about their
44 device, including providing a unit to test with.
45
46 The driver is officially supported by Connect Tech Inc.
47 http://www.connecttech.com
48
49 For any questions or problems with this driver, please contact
50 Stuart MacDonald at stuartm@connecttech.com
51
52
53HandSpring Visor, Palm USB, and Clié USB driver
54
55 This driver works with all HandSpring USB, Palm USB, and Sony Clié USB
56 devices.
57
58 Only when the device tries to connect to the host, will the device show
59 up to the host as a valid USB device. When this happens, the device is
60 properly enumerated, assigned a port, and then communication _should_ be
61 possible. The driver cleans up properly when the device is removed, or
62 the connection is canceled on the device.
63
64 NOTE:
65 This means that in order to talk to the device, the sync button must be
66 pressed BEFORE trying to get any program to communicate to the device.
67 This goes against the current documentation for pilot-xfer and other
68 packages, but is the only way that it will work due to the hardware
69 in the device.
70
71 When the device is connected, try talking to it on the second port
72 (this is usually /dev/ttyUSB1 if you do not have any other usb-serial
73 devices in the system.) The system log should tell you which port is
74 the port to use for the HotSync transfer. The "Generic" port can be used
75 for other device communication, such as a PPP link.
76
77 For some Sony Clié devices, /dev/ttyUSB0 must be used to talk to the
78 device. This is true for all OS version 3.5 devices, and most devices
79 that have had a flash upgrade to a newer version of the OS. See the
80 kernel system log for information on which is the correct port to use.
81
82 If after pressing the sync button, nothing shows up in the system log,
83 try resetting the device, first a hot reset, and then a cold reset if
84 necessary. Some devices need this before they can talk to the USB port
85 properly.
86
87 Devices that are not compiled into the kernel can be specified with module
88 parameters. e.g. modprobe visor vendor=0x54c product=0x66
89
90 There is a webpage and mailing lists for this portion of the driver at:
91 http://usbvisor.sourceforge.net/
92
93 For any questions or problems with this driver, please contact Greg
94 Kroah-Hartman at greg@kroah.com
95
96
97PocketPC PDA Driver
98
99 This driver can be used to connect to Compaq iPAQ, HP Jornada, Casio EM500
100 and other PDAs running Windows CE 3.0 or PocketPC 2002 using a USB
101 cable/cradle.
102 Most devices supported by ActiveSync are supported out of the box.
103 For others, please use module parameters to specify the product and vendor
104 id. e.g. modprobe ipaq vendor=0x3f0 product=0x1125
105
106 The driver presents a serial interface (usually on /dev/ttyUSB0) over
107 which one may run ppp and establish a TCP/IP link to the PDA. Once this
108 is done, you can transfer files, backup, download email etc. The most
109 significant advantage of using USB is speed - I can get 73 to 113
110 kbytes/sec for download/upload to my iPAQ.
111
112 This driver is only one of a set of components required to utilize
113 the USB connection. Please visit http://synce.sourceforge.net which
114 contains the necessary packages and a simple step-by-step howto.
115
116 Once connected, you can use Win CE programs like ftpView, Pocket Outlook
117 from the PDA and xcerdisp, synce utilities from the Linux side.
118
119 To use Pocket IE, follow the instructions given at
120 http://www.tekguru.co.uk/EM500/usbtonet.htm to achieve the same thing
121 on Win98. Omit the proxy server part; Linux is quite capable of forwarding
122 packets unlike Win98. Another modification is required at least for the
123 iPAQ - disable autosync by going to the Start/Settings/Connections menu
124 and unchecking the "Automatically synchronize ..." box. Go to
125 Start/Programs/Connections, connect the cable and select "usbdial" (or
126 whatever you named your new USB connection). You should finally wind
127 up with a "Connected to usbdial" window with status shown as connected.
128 Now start up PIE and browse away.
129
130 If it doesn't work for some reason, load both the usbserial and ipaq module
131 with the module parameter "debug" set to 1 and examine the system log.
132 You can also try soft-resetting your PDA before attempting a connection.
133
134 Other functionality may be possible depending on your PDA. According to
135 Wes Cilldhaire <billybobjoehenrybob@hotmail.com>, with the Toshiba E570,
136 ...if you boot into the bootloader (hold down the power when hitting the
137 reset button, continuing to hold onto the power until the bootloader screen
138 is displayed), then put it in the cradle with the ipaq driver loaded, open
139 a terminal on /dev/ttyUSB0, it gives you a "USB Reflash" terminal, which can
140 be used to flash the ROM, as well as the microP code.. so much for needing
141 Toshiba's $350 serial cable for flashing!! :D
142 NOTE: This has NOT been tested. Use at your own risk.
143
144 For any questions or problems with the driver, please contact Ganesh
145 Varadarajan <ganesh@veritas.com>
146
147
148Keyspan PDA Serial Adapter
149
150 Single port DB-9 serial adapter, pushed as a PDA adapter for iMacs (mostly
151 sold in Macintosh catalogs, comes in a translucent white/green dongle).
152 Fairly simple device. Firmware is homebrew.
153 This driver also works for the Xircom/Entrgra single port serial adapter.
154
155 Current status:
156 Things that work:
157 basic input/output (tested with 'cu')
158 blocking write when serial line can't keep up
159 changing baud rates (up to 115200)
160 getting/setting modem control pins (TIOCM{GET,SET,BIS,BIC})
161 sending break (although duration looks suspect)
162 Things that don't:
163 device strings (as logged by kernel) have trailing binary garbage
164 device ID isn't right, might collide with other Keyspan products
165 changing baud rates ought to flush tx/rx to avoid mangled half characters
166 Big Things on the todo list:
167 parity, 7 vs 8 bits per char, 1 or 2 stop bits
168 HW flow control
169 not all of the standard USB descriptors are handled: Get_Status, Set_Feature
170 O_NONBLOCK, select()
171
172 For any questions or problems with this driver, please contact Brian
173 Warner at warner@lothar.com
174
175
176Keyspan USA-series Serial Adapters
177
178 Single, Dual and Quad port adapters - driver uses Keyspan supplied
179 firmware and is being developed with their support.
180
181 Current status:
182 The USA-18X, USA-28X, USA-19, USA-19W and USA-49W are supported and
183 have been pretty throughly tested at various baud rates with 8-N-1
184 character settings. Other character lengths and parity setups are
185 presently untested.
186
187 The USA-28 isn't yet supported though doing so should be pretty
188 straightforward. Contact the maintainer if you require this
189 functionality.
190
191 More information is available at:
192 http://misc.nu/hugh/keyspan.html
193
194 For any questions or problems with this driver, please contact Hugh
195 Blemings at hugh@misc.nu
196
197
198FTDI Single Port Serial Driver
199
200 This is a single port DB-25 serial adapter. More information about this
201 device and the Linux driver can be found at:
202 http://reality.sgi.com/bryder_wellington/ftdi_sio/
203
204 For any questions or problems with this driver, please contact Bill Ryder
205 at bryder@sgi.com
206
207
208ZyXEL omni.net lcd plus ISDN TA
209
210 This is an ISDN TA. Please report both successes and troubles to
211 azummo@towertech.it
212
213
214Cypress M8 CY4601 Family Serial Driver
215
216 This driver was in most part developed by Neil "koyama" Whelchel. It
217 has been improved since that previous form to support dynamic serial
218 line settings and improved line handling. The driver is for the most
219 part stable and has been tested on an smp machine. (dual p2)
220
221 Chipsets supported under CY4601 family:
222
223 CY7C63723, CY7C63742, CY7C63743, CY7C64013
224
225 Devices supported:
226
227 -DeLorme's USB Earthmate (SiRF Star II lp arch)
228 -Cypress HID->COM RS232 adapter
229
230 Note: Cypress Semiconductor claims no affiliation with the
231 the hid->com device.
232
233 Most devices using chipsets under the CY4601 family should
234 work with the driver. As long as they stay true to the CY4601
235 usbserial specification.
236
237 Technical notes:
238
239 The Earthmate starts out at 4800 8N1 by default... the driver will
240 upon start init to this setting. usbserial core provides the rest
241 of the termios settings, along with some custom termios so that the
242 output is in proper format and parsable.
243
244 The device can be put into sirf mode by issuing NMEA command:
245 $PSRF100,<protocol>,<baud>,<databits>,<stopbits>,<parity>*CHECKSUM
246 $PSRF100,0,9600,8,1,0*0C
247
248 It should then be sufficient to change the port termios to match this
249 to begin communicating.
250
251 As far as I can tell it supports pretty much every sirf command as
252 documented online available with firmware 2.31, with some unknown
253 message ids.
254
255 The hid->com adapter can run at a maximum baud of 115200bps. Please note
256 that the device has trouble or is incapable of raising line voltage properly.
257 It will be fine with null modem links, as long as you do not try to link two
258 together without hacking the adapter to set the line high.
259
260 The driver is smp safe. Performance with the driver is rather low when using
261 it for transfering files. This is being worked on, but I would be willing to
262 accept patches. An urb queue or packet buffer would likely fit the bill here.
263
264 If you have any questions, problems, patches, feature requests, etc. you can
265 contact me here via email:
266 dignome@gmail.com
267 (your problems/patches can alternately be submitted to usb-devel)
268
269
270Digi AccelePort Driver
271
272 This driver supports the Digi AccelePort USB 2 and 4 devices, 2 port
273 (plus a parallel port) and 4 port USB serial converters. The driver
274 does NOT yet support the Digi AccelePort USB 8.
275
276 This driver works under SMP with the usb-uhci driver. It does not
277 work under SMP with the uhci driver.
278
279 The driver is generally working, though we still have a few more ioctls
280 to implement and final testing and debugging to do. The paralled port
281 on the USB 2 is supported as a serial to parallel converter; in other
282 words, it appears as another USB serial port on Linux, even though
283 physically it is really a parallel port. The Digi Acceleport USB 8
284 is not yet supported.
285
286 Please contact Peter Berger (pberger@brimson.com) or Al Borchers
287 (alborchers@steinerpoint.com) for questions or problems with this
288 driver.
289
290
291Belkin USB Serial Adapter F5U103
292
293 Single port DB-9/PS-2 serial adapter from Belkin with firmware by eTEK Labs.
294 The Peracom single port serial adapter also works with this driver, as
295 well as the GoHubs adapter.
296
297 Current status:
298 The following have been tested and work:
299 Baud rate 300-230400
300 Data bits 5-8
301 Stop bits 1-2
302 Parity N,E,O,M,S
303 Handshake None, Software (XON/XOFF), Hardware (CTSRTS,CTSDTR)*
304 Break Set and clear
305 Line contrl Input/Output query and control **
306
307 * Hardware input flow control is only enabled for firmware
308 levels above 2.06. Read source code comments describing Belkin
309 firmware errata. Hardware output flow control is working for all
310 firmware versions.
311 ** Queries of inputs (CTS,DSR,CD,RI) show the last
312 reported state. Queries of outputs (DTR,RTS) show the last
313 requested state and may not reflect current state as set by
314 automatic hardware flow control.
315
316 TO DO List:
317 -- Add true modem contol line query capability. Currently tracks the
318 states reported by the interrupt and the states requested.
319 -- Add error reporting back to application for UART error conditions.
320 -- Add support for flush ioctls.
321 -- Add everything else that is missing :)
322
323 For any questions or problems with this driver, please contact William
324 Greathouse at wgreathouse@smva.com
325
326
327Empeg empeg-car Mark I/II Driver
328
329 This is an experimental driver to provide connectivity support for the
330 client synchronization tools for an Empeg empeg-car mp3 player.
331
332 Tips:
333 * Don't forget to create the device nodes for ttyUSB{0,1,2,...}
334 * modprobe empeg (modprobe is your friend)
335 * emptool --usb /dev/ttyUSB0 (or whatever you named your device node)
336
337 For any questions or problems with this driver, please contact Gary
338 Brubaker at xavyer@ix.netcom.com
339
340
341MCT USB Single Port Serial Adapter U232
342
343 This driver is for the MCT USB-RS232 Converter (25 pin, Model No.
344 U232-P25) from Magic Control Technology Corp. (there is also a 9 pin
345 Model No. U232-P9). More information about this device can be found at
346 the manufacture's web-site: http://www.mct.com.tw.
347
348 The driver is generally working, though it still needs some more testing.
349 It is derived from the Belkin USB Serial Adapter F5U103 driver and its
350 TODO list is valid for this driver as well.
351
352 This driver has also been found to work for other products, which have
353 the same Vendor ID but different Product IDs. Sitecom's U232-P25 serial
354 converter uses Product ID 0x230 and Vendor ID 0x711 and works with this
355 driver. Also, D-Link's DU-H3SP USB BAY also works with this driver.
356
357 For any questions or problems with this driver, please contact Wolfgang
358 Grandegger at wolfgang@ces.ch
359
360
361Inside Out Networks Edgeport Driver
362
363 This driver supports all devices made by Inside Out Networks, specifically
364 the following models:
365 Edgeport/4
366 Rapidport/4
367 Edgeport/4t
368 Edgeport/2
369 Edgeport/4i
370 Edgeport/2i
371 Edgeport/421
372 Edgeport/21
373 Edgeport/8
374 Edgeport/8 Dual
375 Edgeport/2D8
376 Edgeport/4D8
377 Edgeport/8i
378 Edgeport/2 DIN
379 Edgeport/4 DIN
380 Edgeport/16 Dual
381
382 For any questions or problems with this driver, please contact Greg
383 Kroah-Hartman at greg@kroah.com
384
385
386REINER SCT cyberJack pinpad/e-com USB chipcard reader
387
388 Interface to ISO 7816 compatible contactbased chipcards, e.g. GSM SIMs.
389
390 Current status:
391 This is the kernel part of the driver for this USB card reader.
392 There is also a user part for a CT-API driver available. A site
393 for downloading is TBA. For now, you can request it from the
394 maintainer (linux-usb@sii.li).
395
396 For any questions or problems with this driver, please contact
397 linux-usb@sii.li
398
399
400Prolific PL2303 Driver
401
402 This driver support any device that has the PL2303 chip from Prolific
403 in it. This includes a number of single port USB to serial
404 converters and USB GPS devices. Devices from Aten (the UC-232) and
405 IO-Data work with this driver.
406
407 For any questions or problems with this driver, please contact Greg
408 Kroah-Hartman at greg@kroah.com
409
410
411KL5KUSB105 chipset / PalmConnect USB single-port adapter
412
413Current status:
414 The driver was put together by looking at the usb bus transactions
415 done by Palm's driver under Windows, so a lot of functionality is
416 still missing. Notably, serial ioctls are sometimes faked or not yet
417 implemented. Support for finding out about DSR and CTS line status is
418 however implemented (though not nicely), so your favorite autopilot(1)
419 and pilot-manager -daemon calls will work. Baud rates up to 115200
420 are supported, but handshaking (software or hardware) is not, which is
421 why it is wise to cut down on the rate used is wise for large
422 transfers until this is settled.
423
424Options supported:
425 If this driver is compiled as a module you can pass the following
426 options to it:
427 debug - extra verbose debugging info
428 (default: 0; nonzero enables)
429 use_lowlatency - use low_latency flag to speed up tty layer
430 when reading from from the device.
431 (default: 0; nonzero enables)
432
433 See http://www.uuhaus.de/linux/palmconnect.html for up-to-date
434 information on this driver.
435
436
437Generic Serial driver
438
439 If your device is not one of the above listed devices, compatible with
440 the above models, you can try out the "generic" interface. This
441 interface does not provide any type of control messages sent to the
442 device, and does not support any kind of device flow control. All that
443 is required of your device is that it has at least one bulk in endpoint,
444 or one bulk out endpoint.
445
446 To enable the generic driver to recognize your device, build the driver
447 as a module and load it by the following invocation:
448 insmod usbserial vendor=0x#### product=0x####
449 where the #### is replaced with the hex representation of your device's
450 vendor id and product id.
451
452 This driver has been successfully used to connect to the NetChip USB
453 development board, providing a way to develop USB firmware without
454 having to write a custom driver.
455
456 For any questions or problems with this driver, please contact Greg
457 Kroah-Hartman at greg@kroah.com
458
459
460CONTACT:
461
462 If anyone has any problems using these drivers, with any of the above
463 specified products, please contact the specific driver's author listed
464 above, or join the Linux-USB mailing list (information on joining the
465 mailing list, as well as a link to its searchable archive is at
466 http://www.linux-usb.org/ )
467
468
469Greg Kroah-Hartman
470greg@kroah.com
diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt
new file mode 100644
index 000000000000..2f8431f92b77
--- /dev/null
+++ b/Documentation/usb/usbmon.txt
@@ -0,0 +1,156 @@
1* Introduction
2
3The name "usbmon" in lowercase refers to a facility in kernel which is
4used to collect traces of I/O on the USB bus. This function is analogous
5to a packet socket used by network monitoring tools such as tcpdump(1)
6or Ethereal. Similarly, it is expected that a tool such as usbdump or
7USBMon (with uppercase letters) is used to examine raw traces produced
8by usbmon.
9
10The usbmon reports requests made by peripheral-specific drivers to Host
11Controller Drivers (HCD). So, if HCD is buggy, the traces reported by
12usbmon may not correspond to bus transactions precisely. This is the same
13situation as with tcpdump.
14
15* How to use usbmon to collect raw text traces
16
17Unlike the packet socket, usbmon has an interface which provides traces
18in a text format. This is used for two purposes. First, it serves as a
19common trace exchange format for tools while most sophisticated formats
20are finalized. Second, humans can read it in case tools are not available.
21
22To collect a raw text trace, execute following steps.
23
241. Prepare
25
26Mount debugfs (it has to be enabled in your kernel configuration), and
27load the usbmon module (if built as module). The second step is skipped
28if usbmon is built into the kernel.
29
30# mount -t debugfs none_debugs /sys/kernel/debug
31# modprobe usbmon
32
33Verify that bus sockets are present.
34
35[root@lembas zaitcev]# ls /sys/kernel/debug/usbmon
361s 1t 2s 2t 3s 3t 4s 4t
37[root@lembas zaitcev]#
38
39# ls /sys/kernel
40
412. Find which bus connects to the desired device
42
43Run "cat /proc/bus/usb/devices", and find the T-line which corresponds to
44the device. Usually you do it by looking for the vendor string. If you have
45many similar devices, unplug one and compare two /proc/bus/usb/devices outputs.
46The T-line will have a bus number. Example:
47
48T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
49D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
50P: Vendor=0557 ProdID=2004 Rev= 1.00
51S: Manufacturer=ATEN
52S: Product=UC100KM V2.00
53
54Bus=03 means it's bus 3.
55
563. Start 'cat'
57
58# cat /sys/kernel/debug/usbmon/3t > /tmp/1.mon.out
59
60This process will be reading until killed. Naturally, the output can be
61redirected to a desirable location. This is preferred, because it is going
62to be quite long.
63
644. Perform the desired operation on the USB bus
65
66This is where you do something that creates the traffic: plug in a flash key,
67copy files, control a webcam, etc.
68
695. Kill cat
70
71Usually it's done with a keyboard interrupt (Control-C).
72
73At this point the output file (/tmp/1.mon.out in this example) can be saved,
74sent by e-mail, or inspected with a text editor. In the last case make sure
75that the file size is not excessive for your favourite editor.
76
77* Raw text data format
78
79The '0t' type data consists of a stream of events, such as URB submission,
80URB callback, submission error. Every event is a text line, which consists
81of whitespace separated words. The number of position of words may depend
82on the event type, but there is a set of words, common for all types.
83
84Here is the list of words, from left to right:
85- URB Tag. This is used to identify URBs is normally a kernel mode address
86 of the URB structure in hexadecimal.
87- Timestamp in microseconds, a decimal number. The timestamp's resolution
88 depends on available clock, and so it can be much worse than a microsecond
89 (if the implementation uses jiffies, for example).
90- Event Type. This type refers to the format of the event, not URB type.
91 Available types are: S - submission, C - callback, E - submission error.
92- "Pipe". The pipe concept is deprecated. This is a composite word, used to
93 be derived from information in pipes. It consists of three fields, separated
94 by colons: URB type and direction, Device address, Endpoint number.
95 Type and direction are encoded with two bytes in the following manner:
96 Ci Co Control input and output
97 Zi Zo Isochronous input and output
98 Ii Io Interrupt input and output
99 Bi Bo Bulk input and output
100 Device address and Endpoint number are decimal numbers with leading zeroes
101 or 3 and 2 positions, correspondingly.
102- URB Status. This field makes no sense for submissions, but is present
103 to help scripts with parsing. In error case, it contains the error code.
104- Data Length. This is the actual length in the URB.
105- Data tag. The usbmon may not always capture data, even if length is nonzero.
106 Only if tag is '=', the data words are present.
107- Data words follow, in big endian hexadecimal format. Notice that they are
108 not machine words, but really just a byte stream split into words to make
109 it easier to read. Thus, the last word may contain from one to four bytes.
110 The length of collected data is limited and can be less than the data length
111 report in Data Length word.
112
113Here is an example of code to read the data stream in a well known programming
114language:
115
116class ParsedLine {
117 int data_len; /* Available length of data */
118 byte data[];
119
120 void parseData(StringTokenizer st) {
121 int availwords = st.countTokens();
122 data = new byte[availwords * 4];
123 data_len = 0;
124 while (st.hasMoreTokens()) {
125 String data_str = st.nextToken();
126 int len = data_str.length() / 2;
127 int i;
128 for (i = 0; i < len; i++) {
129 data[data_len] = Byte.parseByte(
130 data_str.substring(i*2, i*2 + 2),
131 16);
132 data_len++;
133 }
134 }
135 }
136}
137
138This format is obviously deficient. For example, the setup packet for control
139transfers is not delivered. This will change in the future.
140
141Examples:
142
143An input control transfer to get a port status:
144
145d74ff9a0 2640288196 S Ci:001:00 -115 4 <
146d74ff9a0 2640288202 C Ci:001:00 0 4 = 01010100
147
148An output bulk transfer to send a SCSI command 0x5E in a 31-byte Bulk wrapper
149to a storage device at address 5:
150
151dd65f0e8 4128379752 S Bo:005:02 -115 31 = 55534243 5e000000 00000000 00000600 00000000 00000000 00000000 000000
152dd65f0e8 4128379808 C Bo:005:02 0 31 >
153
154* Raw binary format and API
155
156TBD
diff --git a/Documentation/usb/w9968cf.txt b/Documentation/usb/w9968cf.txt
new file mode 100644
index 000000000000..18a47738d56c
--- /dev/null
+++ b/Documentation/usb/w9968cf.txt
@@ -0,0 +1,481 @@
1
2 W996[87]CF JPEG USB Dual Mode Camera Chip
3 Driver for Linux 2.6 (basic version)
4 =========================================
5
6 - Documentation -
7
8
9Index
10=====
111. Copyright
122. Disclaimer
133. License
144. Overview
155. Supported devices
166. Module dependencies
177. Module loading
188. Module paramaters
199. Contact information
2010. Credits
21
22
231. Copyright
24============
25Copyright (C) 2002-2004 by Luca Risolia <luca.risolia@studio.unibo.it>
26
27
282. Disclaimer
29=============
30Winbond is a trademark of Winbond Electronics Corporation.
31This software is not sponsored or developed by Winbond.
32
33
343. License
35==========
36This program is free software; you can redistribute it and/or modify
37it under the terms of the GNU General Public License as published by
38the Free Software Foundation; either version 2 of the License, or
39(at your option) any later version.
40
41This program is distributed in the hope that it will be useful,
42but WITHOUT ANY WARRANTY; without even the implied warranty of
43MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44GNU General Public License for more details.
45
46You should have received a copy of the GNU General Public License
47along with this program; if not, write to the Free Software
48Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
49
50
514. Overview
52===========
53This driver supports the video streaming capabilities of the devices mounting
54Winbond W9967CF and Winbond W9968CF JPEG USB Dual Mode Camera Chips. OV681
55based cameras should be supported as well.
56
57The driver is divided into two modules: the basic one, "w9968cf", is needed for
58the supported devices to work; the second one, "w9968cf-vpp", is an optional
59module, which provides some useful video post-processing functions like video
60decoding, up-scaling and colour conversions. Once the driver is installed,
61every time an application tries to open a recognized device, "w9968cf" checks
62the presence of the "w9968cf-vpp" module and loads it automatically by default.
63
64Please keep in mind that official kernels do not include the second module for
65performance purposes. However it is always recommended to download and install
66the latest and complete release of the driver, replacing the existing one, if
67present: it will be still even possible not to load the "w9968cf-vpp" module at
68all, if you ever want to. Another important missing feature of the version in
69the official Linux 2.4 kernels is the writeable /proc filesystem interface.
70
71The latest and full-featured version of the W996[87]CF driver can be found at:
72http://www.linux-projects.org. Please refer to the documentation included in
73that package, if you are going to use it.
74
75Up to 32 cameras can be handled at the same time. They can be connected and
76disconnected from the host many times without turning off the computer, if
77your system supports the hotplug facility.
78
79To change the default settings for each camera, many parameters can be passed
80through command line when the module is loaded into memory.
81
82The driver relies on the Video4Linux, USB and I2C core modules. It has been
83designed to run properly on SMP systems as well. An additional module,
84"ovcamchip", is mandatory; it provides support for some OmniVision image
85sensors connected to the W996[87]CF chips; if found in the system, the module
86will be automatically loaded by default (provided that the kernel has been
87compiled with the automatic module loading option).
88
89
905. Supported devices
91====================
92At the moment, known W996[87]CF and OV681 based devices are:
93- Aroma Digi Pen VGA Dual Mode ADG-5000 (unknown image sensor)
94- AVerMedia AVerTV USB (SAA7111A, Philips FI1216Mk2 tuner, PT2313L audio chip)
95- Creative Labs Video Blaster WebCam Go (OmniVision OV7610 sensor)
96- Creative Labs Video Blaster WebCam Go Plus (OmniVision OV7620 sensor)
97- Lebon LDC-035A (unknown image sensor)
98- Ezonics EZ-802 EZMega Cam (OmniVision OV8610C sensor)
99- OmniVision OV8610-EDE (OmniVision OV8610 sensor)
100- OPCOM Digi Pen VGA Dual Mode Pen Camera (unknown image sensor)
101- Pretec Digi Pen-II (OmniVision OV7620 sensor)
102- Pretec DigiPen-480 (OmniVision OV8610 sensor)
103
104If you know any other W996[87]CF or OV681 based cameras, please contact me.
105
106The list above does not imply that all those devices work with this driver: up
107until now only webcams that have an image sensor supported by the "ovcamchip"
108module work. Kernel messages will always tell you whether this is case.
109
110Possible external microcontrollers of those webcams are not supported: this
111means that still images cannot be downloaded from the device memory.
112
113Furthermore, it's worth to note that I was only able to run tests on my
114"Creative Labs Video Blaster WebCam Go". Donations of other models, for
115additional testing and full support, would be much appreciated.
116
117
1186. Module dependencies
119======================
120For it to work properly, the driver needs kernel support for Video4Linux, USB
121and I2C, and the "ovcamchip" module for the image sensor. Make sure you are not
122actually using any external "ovcamchip" module, given that the W996[87]CF
123driver depends on the version of the module present in the official kernels.
124
125The following options of the kernel configuration file must be enabled and
126corresponding modules must be compiled:
127
128 # Multimedia devices
129 #
130 CONFIG_VIDEO_DEV=m
131
132 # I2C support
133 #
134 CONFIG_I2C=m
135
136The I2C core module can be compiled statically in the kernel as well.
137
138 # OmniVision Camera Chip support
139 #
140 CONFIG_VIDEO_OVCAMCHIP=m
141
142 # USB support
143 #
144 CONFIG_USB=m
145
146In addition, depending on the hardware being used, only one of the modules
147below is necessary:
148
149 # USB Host Controller Drivers
150 #
151 CONFIG_USB_EHCI_HCD=m
152 CONFIG_USB_UHCI_HCD=m
153 CONFIG_USB_OHCI_HCD=m
154
155And finally:
156
157 # USB Multimedia devices
158 #
159 CONFIG_USB_W9968CF=m
160
161
1627. Module loading
163=================
164To use the driver, it is necessary to load the "w9968cf" module into memory
165after every other module required.
166
167Loading can be done this way, from root:
168
169 [root@localhost home]# modprobe usbcore
170 [root@localhost home]# modprobe i2c-core
171 [root@localhost home]# modprobe videodev
172 [root@localhost home]# modprobe w9968cf
173
174At this point the pertinent devices should be recognized: "dmesg" can be used
175to analyze kernel messages:
176
177 [user@localhost home]$ dmesg
178
179There are a lot of parameters the module can use to change the default
180settings for each device. To list every possible parameter with a brief
181explanation about them and which syntax to use, it is recommended to run the
182"modinfo" command:
183
184 [root@locahost home]# modinfo w9968cf
185
186
1878. Module parameters
188====================
189Module parameters are listed below:
190-------------------------------------------------------------------------------
191Name: ovmod_load
192Type: bool
193Syntax: <0|1>
194Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled.
195 If enabled, 'insmod' searches for the required 'ovcamchip'
196 module in the system, according to its configuration, and
197 loads that module automatically. This action is performed as
198 once soon as the 'w9968cf' module is loaded into memory.
199Default: 1
200Note: The kernel must be compiled with the CONFIG_KMOD option
201 enabled for the 'ovcamchip' module to be loaded and for
202 this parameter to be present.
203-------------------------------------------------------------------------------
204Name: vppmod_load
205Type: bool
206Syntax: <0|1>
207Description: Automatic 'w9968cf-vpp' module loading: 0 disabled, 1 enabled.
208 If enabled, every time an application attempts to open a
209 camera, 'insmod' searches for the video post-processing module
210 in the system and loads it automatically (if present).
211 The optional 'w9968cf-vpp' module adds extra image manipulation
212 capabilities to the 'w9968cf' module,like software up-scaling,
213 colour conversions and video decompression for very high frame
214 rates.
215Default: 1
216Note: The kernel must be compiled with the CONFIG_KMOD option
217 enabled for the 'w9968cf-vpp' module to be loaded and for
218 this parameter to be present.
219-------------------------------------------------------------------------------
220Name: simcams
221Type: int
222Syntax: <n>
223Description: Number of cameras allowed to stream simultaneously.
224 n may vary from 0 to 32.
225Default: 32
226-------------------------------------------------------------------------------
227Name: video_nr
228Type: int array (min = 0, max = 32)
229Syntax: <-1|n[,...]>
230Description: Specify V4L minor mode number.
231 -1 = use next available
232 n = use minor number n
233 You can specify up to 32 cameras this way.
234 For example:
235 video_nr=-1,2,-1 would assign minor number 2 to the second
236 recognized camera and use auto for the first one and for every
237 other camera.
238Default: -1
239-------------------------------------------------------------------------------
240Name: packet_size
241Type: int array (min = 0, max = 32)
242Syntax: <n[,...]>
243Description: Specify the maximum data payload size in bytes for alternate
244 settings, for each device. n is scaled between 63 and 1023.
245Default: 1023
246-------------------------------------------------------------------------------
247Name: max_buffers
248Type: int array (min = 0, max = 32)
249Syntax: <n[,...]>
250Description: For advanced users.
251 Specify the maximum number of video frame buffers to allocate
252 for each device, from 2 to 32.
253Default: 2
254-------------------------------------------------------------------------------
255Name: double_buffer
256Type: bool array (min = 0, max = 32)
257Syntax: <0|1[,...]>
258Description: Hardware double buffering: 0 disabled, 1 enabled.
259 It should be enabled if you want smooth video output: if you
260 obtain out of sync. video, disable it, or try to
261 decrease the 'clockdiv' module parameter value.
262Default: 1 for every device.
263-------------------------------------------------------------------------------
264Name: clamping
265Type: bool array (min = 0, max = 32)
266Syntax: <0|1[,...]>
267Description: Video data clamping: 0 disabled, 1 enabled.
268Default: 0 for every device.
269-------------------------------------------------------------------------------
270Name: filter_type
271Type: int array (min = 0, max = 32)
272Syntax: <0|1|2[,...]>
273Description: Video filter type.
274 0 none, 1 (1-2-1) 3-tap filter, 2 (2-3-6-3-2) 5-tap filter.
275 The filter is used to reduce noise and aliasing artifacts
276 produced by the CCD or CMOS image sensor.
277Default: 0 for every device.
278-------------------------------------------------------------------------------
279Name: largeview
280Type: bool array (min = 0, max = 32)
281Syntax: <0|1[,...]>
282Description: Large view: 0 disabled, 1 enabled.
283Default: 1 for every device.
284-------------------------------------------------------------------------------
285Name: upscaling
286Type: bool array (min = 0, max = 32)
287Syntax: <0|1[,...]>
288Description: Software scaling (for non-compressed video only):
289 0 disabled, 1 enabled.
290 Disable it if you have a slow CPU or you don't have enough
291 memory.
292Default: 0 for every device.
293Note: If 'w9968cf-vpp' is not present, this parameter is set to 0.
294-------------------------------------------------------------------------------
295Name: decompression
296Type: int array (min = 0, max = 32)
297Syntax: <0|1|2[,...]>
298Description: Software video decompression:
299 0 = disables decompression
300 (doesn't allow formats needing decompression).
301 1 = forces decompression
302 (allows formats needing decompression only).
303 2 = allows any permitted formats.
304 Formats supporting (de)compressed video are YUV422P and
305 YUV420P/YUV420 in any resolutions where width and height are
306 multiples of 16.
307Default: 2 for every device.
308Note: If 'w9968cf-vpp' is not present, forcing decompression is not
309 allowed; in this case this parameter is set to 2.
310-------------------------------------------------------------------------------
311Name: force_palette
312Type: int array (min = 0, max = 32)
313Syntax: <0|9|10|13|15|8|7|1|6|3|4|5[,...]>
314Description: Force picture palette.
315 In order:
316 0 = Off - allows any of the following formats:
317 9 = UYVY 16 bpp - Original video, compression disabled
318 10 = YUV420 12 bpp - Original video, compression enabled
319 13 = YUV422P 16 bpp - Original video, compression enabled
320 15 = YUV420P 12 bpp - Original video, compression enabled
321 8 = YUVY 16 bpp - Software conversion from UYVY
322 7 = YUV422 16 bpp - Software conversion from UYVY
323 1 = GREY 8 bpp - Software conversion from UYVY
324 6 = RGB555 16 bpp - Software conversion from UYVY
325 3 = RGB565 16 bpp - Software conversion from UYVY
326 4 = RGB24 24 bpp - Software conversion from UYVY
327 5 = RGB32 32 bpp - Software conversion from UYVY
328 When not 0, this parameter will override 'decompression'.
329Default: 0 for every device. Initial palette is 9 (UYVY).
330Note: If 'w9968cf-vpp' is not present, this parameter is set to 9.
331-------------------------------------------------------------------------------
332Name: force_rgb
333Type: bool array (min = 0, max = 32)
334Syntax: <0|1[,...]>
335Description: Read RGB video data instead of BGR:
336 1 = use RGB component ordering.
337 0 = use BGR component ordering.
338 This parameter has effect when using RGBX palettes only.
339Default: 0 for every device.
340-------------------------------------------------------------------------------
341Name: autobright
342Type: bool array (min = 0, max = 32)
343Syntax: <0|1[,...]>
344Description: Image sensor automatically changes brightness:
345 0 = no, 1 = yes
346Default: 0 for every device.
347-------------------------------------------------------------------------------
348Name: autoexp
349Type: bool array (min = 0, max = 32)
350Syntax: <0|1[,...]>
351Description: Image sensor automatically changes exposure:
352 0 = no, 1 = yes
353Default: 1 for every device.
354-------------------------------------------------------------------------------
355Name: lightfreq
356Type: int array (min = 0, max = 32)
357Syntax: <50|60[,...]>
358Description: Light frequency in Hz:
359 50 for European and Asian lighting, 60 for American lighting.
360Default: 50 for every device.
361-------------------------------------------------------------------------------
362Name: bandingfilter
363Type: bool array (min = 0, max = 32)
364Syntax: <0|1[,...]>
365Description: Banding filter to reduce effects of fluorescent
366 lighting:
367 0 disabled, 1 enabled.
368 This filter tries to reduce the pattern of horizontal
369 light/dark bands caused by some (usually fluorescent) lighting.
370Default: 0 for every device.
371-------------------------------------------------------------------------------
372Name: clockdiv
373Type: int array (min = 0, max = 32)
374Syntax: <-1|n[,...]>
375Description: Force pixel clock divisor to a specific value (for experts):
376 n may vary from 0 to 127.
377 -1 for automatic value.
378 See also the 'double_buffer' module parameter.
379Default: -1 for every device.
380-------------------------------------------------------------------------------
381Name: backlight
382Type: bool array (min = 0, max = 32)
383Syntax: <0|1[,...]>
384Description: Objects are lit from behind:
385 0 = no, 1 = yes
386Default: 0 for every device.
387-------------------------------------------------------------------------------
388Name: mirror
389Type: bool array (min = 0, max = 32)
390Syntax: <0|1[,...]>
391Description: Reverse image horizontally:
392 0 = no, 1 = yes
393Default: 0 for every device.
394-------------------------------------------------------------------------------
395Name: monochrome
396Type: bool array (min = 0, max = 32)
397Syntax: <0|1[,...]>
398Description: The image sensor is monochrome:
399 0 = no, 1 = yes
400Default: 0 for every device.
401-------------------------------------------------------------------------------
402Name: brightness
403Type: long array (min = 0, max = 32)
404Syntax: <n[,...]>
405Description: Set picture brightness (0-65535).
406 This parameter has no effect if 'autobright' is enabled.
407Default: 31000 for every device.
408-------------------------------------------------------------------------------
409Name: hue
410Type: long array (min = 0, max = 32)
411Syntax: <n[,...]>
412Description: Set picture hue (0-65535).
413Default: 32768 for every device.
414-------------------------------------------------------------------------------
415Name: colour
416Type: long array (min = 0, max = 32)
417Syntax: <n[,...]>
418Description: Set picture saturation (0-65535).
419Default: 32768 for every device.
420-------------------------------------------------------------------------------
421Name: contrast
422Type: long array (min = 0, max = 32)
423Syntax: <n[,...]>
424Description: Set picture contrast (0-65535).
425Default: 50000 for every device.
426-------------------------------------------------------------------------------
427Name: whiteness
428Type: long array (min = 0, max = 32)
429Syntax: <n[,...]>
430Description: Set picture whiteness (0-65535).
431Default: 32768 for every device.
432-------------------------------------------------------------------------------
433Name: debug
434Type: int
435Syntax: <n>
436Description: Debugging information level, from 0 to 6:
437 0 = none (use carefully)
438 1 = critical errors
439 2 = significant informations
440 3 = configuration or general messages
441 4 = warnings
442 5 = called functions
443 6 = function internals
444 Level 5 and 6 are useful for testing only, when only one
445 device is used.
446Default: 2
447-------------------------------------------------------------------------------
448Name: specific_debug
449Type: bool
450Syntax: <0|1>
451Description: Enable or disable specific debugging messages:
452 0 = print messages concerning every level <= 'debug' level.
453 1 = print messages concerning the level indicated by 'debug'.
454Default: 0
455-------------------------------------------------------------------------------
456
457
4589. Contact information
459======================
460I may be contacted by e-mail at <luca.risolia@studio.unibo.it>.
461
462I can accept GPG/PGP encrypted e-mail. My GPG key ID is 'FCE635A4'.
463My public 1024-bit key should be available at your keyserver; the fingerprint
464is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
465
466
46710. Credits
468==========
469The development would not have proceed much further without having looked at
470the source code of other drivers and without the help of several persons; in
471particular:
472
473- the I2C interface to kernel and high-level image sensor control routines have
474 been taken from the OV511 driver by Mark McClelland;
475
476- memory management code has been copied from the bttv driver by Ralph Metzler,
477 Marcus Metzler and Gerd Knorr;
478
479- the low-level I2C read function has been written by Frederic Jouault;
480
481- the low-level I2C fast write function has been written by Piotr Czerczak.