diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /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')
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 @@ | |||
1 | Credits for the Simple Linux USB Driver: | ||
2 | |||
3 | The following people have contributed to this code (in alphabetical | ||
4 | order by last name). I'm sure this list should be longer, its | ||
5 | difficult 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 | |||
28 | Special 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 | |||
37 | Additional thanks to the following companies and people for donations | ||
38 | of hardware, support, time and development (this is from the original | ||
39 | THANKS 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 @@ | |||
1 | Revised: 2000-Dec-05. | ||
2 | Again: 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 | |||
12 | 1.1. Basic concept or 'What is an URB?' | ||
13 | |||
14 | The basic idea of the new driver is message passing, the message itself is | ||
15 | called 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 | |||
37 | 1.2. The URB structure | ||
38 | |||
39 | Some of the fields in an URB are: | ||
40 | |||
41 | struct 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 | |||
77 | Your driver must create the "pipe" value using values from the appropriate | ||
78 | endpoint descriptor in an interface that it's claimed. | ||
79 | |||
80 | |||
81 | 1.3. How to get an URB? | ||
82 | |||
83 | URBs are allocated with the following call | ||
84 | |||
85 | struct urb *usb_alloc_urb(int isoframes, int mem_flags) | ||
86 | |||
87 | Return value is a pointer to the allocated URB, 0 if allocation failed. | ||
88 | The parameter isoframes specifies the number of isochronous transfer frames | ||
89 | you want to schedule. For CTRL/BULK/INT, use 0. The mem_flags parameter | ||
90 | holds standard memory allocation flags, letting you control (among other | ||
91 | things) whether the underlying code may block or not. | ||
92 | |||
93 | To free an URB, use | ||
94 | |||
95 | void usb_free_urb(struct urb *urb) | ||
96 | |||
97 | You may not free an urb that you've submitted, but which hasn't yet been | ||
98 | returned to you in a completion callback. | ||
99 | |||
100 | |||
101 | 1.4. What has to be filled in? | ||
102 | |||
103 | Depending on the type of transaction, there are some inline functions | ||
104 | defined in <linux/usb.h> to simplify the initialization, such as | ||
105 | fill_control_urb() and fill_bulk_urb(). In general, they need the usb | ||
106 | device pointer, the pipe (usual format from usb.h), the transfer buffer, | ||
107 | the desired transfer length, the completion handler, and its context. | ||
108 | Take a look at the some existing drivers to see how they're used. | ||
109 | |||
110 | Flags: | ||
111 | For ISO there are two startup behaviors: Specified start_frame or ASAP. | ||
112 | For ASAP set URB_ISO_ASAP in transfer_flags. | ||
113 | |||
114 | If short packets should NOT be tolerated, set URB_SHORT_NOT_OK in | ||
115 | transfer_flags. | ||
116 | |||
117 | |||
118 | 1.5. How to submit an URB? | ||
119 | |||
120 | Just call | ||
121 | |||
122 | int usb_submit_urb(struct urb *urb, int mem_flags) | ||
123 | |||
124 | The mem_flags parameter, such as SLAB_ATOMIC, controls memory allocation, | ||
125 | such as whether the lower levels may block when memory is tight. | ||
126 | |||
127 | It immediately returns, either with status 0 (request queued) or some | ||
128 | error 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 | |||
138 | After submission, urb->status is -EINPROGRESS; however, you should never | ||
139 | look at that value except in your completion callback. | ||
140 | |||
141 | For isochronous endpoints, your completion handlers should (re)submit | ||
142 | URBs to the same endpoint with the ISO_ASAP flag, using multi-buffering, | ||
143 | to get seamless ISO streaming. | ||
144 | |||
145 | |||
146 | 1.6. How to cancel an already running URB? | ||
147 | |||
148 | For an URB which you've submitted, but which hasn't been returned to | ||
149 | your driver by the host controller, call | ||
150 | |||
151 | int usb_unlink_urb(struct urb *urb) | ||
152 | |||
153 | It removes the urb from the internal list and frees all allocated | ||
154 | HW descriptors. The status is changed to reflect unlinking. After | ||
155 | usb_unlink_urb() returns with that status code, you can free the URB | ||
156 | with usb_free_urb(). | ||
157 | |||
158 | There is also an asynchronous unlink mode. To use this, set the | ||
159 | the URB_ASYNC_UNLINK flag in urb->transfer flags before calling | ||
160 | usb_unlink_urb(). When using async unlinking, the URB will not | ||
161 | normally be unlinked when usb_unlink_urb() returns. Instead, wait | ||
162 | for the completion handler to be called. | ||
163 | |||
164 | |||
165 | 1.7. What about the completion handler? | ||
166 | |||
167 | The handler is of the following type: | ||
168 | |||
169 | typedef void (*usb_complete_t)(struct urb *); | ||
170 | |||
171 | i.e. it gets just the URB that caused the completion call. | ||
172 | In the completion handler, you should have a look at urb->status to | ||
173 | detect any USB errors. Since the context parameter is included in the URB, | ||
174 | you can pass information to the completion handler. | ||
175 | |||
176 | Note that even when an error (or unlink) is reported, data may have been | ||
177 | transferred. That's because USB transfers are packetized; it might take | ||
178 | sixteen packets to transfer your 1KByte buffer, and ten of them might | ||
179 | have transferred succesfully before the completion is called. | ||
180 | |||
181 | |||
182 | NOTE: ***** WARNING ***** | ||
183 | Don't use urb->dev field in your completion handler; it's cleared | ||
184 | as part of giving urbs back to drivers. (Addressing an issue with | ||
185 | ownership of periodic URBs, which was otherwise ambiguous.) Instead, | ||
186 | use urb->context to hold all the data your driver needs. | ||
187 | |||
188 | NOTE: ***** WARNING ***** | ||
189 | Also, NEVER SLEEP IN A COMPLETION HANDLER. These are normally called | ||
190 | during hardware interrupt processing. If you can, defer substantial | ||
191 | work to a tasklet (bottom half) to keep system latencies low. You'll | ||
192 | probably need to use spinlocks to protect data structures you manipulate | ||
193 | in completion handlers. | ||
194 | |||
195 | |||
196 | 1.8. How to do isochronous (ISO) transfers? | ||
197 | |||
198 | For ISO transfers you have to fill a usb_iso_packet_descriptor structure, | ||
199 | allocated at the end of the URB by usb_alloc_urb(n,mem_flags), for each | ||
200 | packet you want to schedule. You also have to set urb->interval to say | ||
201 | how often to make transfers; it's often one per frame (which is once | ||
202 | every microframe for highspeed devices). The actual interval used will | ||
203 | be a power of two that's no bigger than what you specify. | ||
204 | |||
205 | The usb_submit_urb() call modifies urb->interval to the implemented interval | ||
206 | value that is less than or equal to the requested interval value. If | ||
207 | ISO_ASAP scheduling is used, urb->start_frame is also updated. | ||
208 | |||
209 | For each entry you have to specify the data offset for this frame (base is | ||
210 | transfer_buffer), and the length you want to write/expect to read. | ||
211 | After completion, actual_length contains the actual transferred length and | ||
212 | status contains the resulting status for the ISO transfer for this frame. | ||
213 | It is allowed to specify a varying length from frame to frame (e.g. for | ||
214 | audio synchronisation/adaptive transfer rates). You can also use the length | ||
215 | 0 to omit one or more frames (striping). | ||
216 | |||
217 | For scheduling you can choose your own start frame or ISO_ASAP. As explained | ||
218 | earlier, if you always keep at least one URB queued and your completion | ||
219 | keeps (re)submitting a later URB, you'll get smooth ISO streaming (if usb | ||
220 | bandwidth utilization allows). | ||
221 | |||
222 | If you specify your own start frame, make sure it's several frames in advance | ||
223 | of the current frame. You might want this model if you're synchronizing | ||
224 | ISO data with some other event stream. | ||
225 | |||
226 | |||
227 | 1.9. How to start interrupt (INT) transfers? | ||
228 | |||
229 | Interrupt transfers, like isochronous transfers, are periodic, and happen | ||
230 | in intervals that are powers of two (1, 2, 4 etc) units. Units are frames | ||
231 | for full and low speed devices, and microframes for high speed ones. | ||
232 | |||
233 | Currently, after you submit one interrupt URB, that urb is owned by the | ||
234 | host controller driver until you cancel it with usb_unlink_urb(). You | ||
235 | may unlink interrupt urbs in their completion handlers, if you need to. | ||
236 | |||
237 | After a transfer completion is called, the URB is automagically resubmitted. | ||
238 | THIS BEHAVIOR IS EXPECTED TO BE REMOVED!! | ||
239 | |||
240 | Interrupt transfers may only send (or receive) the "maxpacket" value for | ||
241 | the given interrupt endpoint; if you need more data, you will need to | ||
242 | copy that data out of (or into) another buffer. Similarly, you can't | ||
243 | queue interrupt transfers. | ||
244 | THESE RESTRICTIONS ARE EXPECTED TO BE REMOVED!! | ||
245 | |||
246 | Note that this automagic resubmission model does make it awkward to use | ||
247 | interrupt OUT transfers. The portable solution involves unlinking those | ||
248 | OUT urbs after the data is transferred, and perhaps submitting a final | ||
249 | URB for a short packet. | ||
250 | |||
251 | The usb_submit_urb() call modifies urb->interval to the implemented interval | ||
252 | value 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 | |||
6 | 0. Disclaimer | ||
7 | ~~~~~~~~~~~~~ | ||
8 | This program is free software; you can redistribute it and/or modify it | ||
9 | under the terms of the GNU General Public License as published by the Free | ||
10 | Software Foundation; either version 2 of the License, or (at your option) | ||
11 | any later version. | ||
12 | |||
13 | This program is distributed in the hope that it will be useful, but | ||
14 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
15 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
16 | more details. | ||
17 | |||
18 | You should have received a copy of the GNU General Public License along | ||
19 | with this program; if not, write to the Free Software Foundation, Inc., 59 | ||
20 | Temple 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, | ||
24 | Ucitelska 1576, Prague 8, 182 00 Czech Republic | ||
25 | |||
26 | For your convenience, the GNU General Public License version 2 is included | ||
27 | in the package: See the file COPYING. | ||
28 | |||
29 | 1. Usage | ||
30 | ~~~~~~~~ | ||
31 | The drivers/usb/class/cdc-acm.c drivers works with USB modems and USB ISDN terminal | ||
32 | adapters that conform to the Universal Serial Bus Communication Device Class | ||
33 | Abstract 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 | ||
50 | thus 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 | ||
59 | to 256, so you can use up to 256 USB modems with one computer (you'll need | ||
60 | three USB cards for that, though). | ||
61 | |||
62 | If you don't use devfs, then you can create device nodes with the same | ||
63 | minor/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 | ||
73 | minicom, ppp and mgetty with them. | ||
74 | |||
75 | 2. Verifying that it works | ||
76 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
77 | The first step would be to check /proc/bus/usb/devices, it should look | ||
78 | like this: | ||
79 | |||
80 | T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 | ||
81 | B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 | ||
82 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
83 | P: Vendor=0000 ProdID=0000 Rev= 0.00 | ||
84 | S: Product=USB UHCI Root Hub | ||
85 | S: SerialNumber=6800 | ||
86 | C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA | ||
87 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
88 | E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms | ||
89 | T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 | ||
90 | D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2 | ||
91 | P: Vendor=04c1 ProdID=008f Rev= 2.07 | ||
92 | S: Manufacturer=3Com Inc. | ||
93 | S: Product=3Com U.S. Robotics Pro ISDN TA | ||
94 | S: SerialNumber=UFT53A49BVT7 | ||
95 | C: #Ifs= 1 Cfg#= 1 Atr=60 MxPwr= 0mA | ||
96 | I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=acm | ||
97 | E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms | ||
98 | E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms | ||
99 | E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms | ||
100 | C:* #Ifs= 2 Cfg#= 2 Atr=60 MxPwr= 0mA | ||
101 | I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm | ||
102 | E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms | ||
103 | I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm | ||
104 | E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms | ||
105 | E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms | ||
106 | |||
107 | The presence of these three lines (and the Cls= 'comm' and 'data' classes) | ||
108 | is important, it means it's an ACM device. The Driver=acm means the acm | ||
109 | driver is used for the device. If you see only Cls=ff(vend.) then you're out | ||
110 | of luck, you have a device with vendor specific-interface. | ||
111 | |||
112 | D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2 | ||
113 | I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm | ||
114 | I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm | ||
115 | |||
116 | In the system log you should see: | ||
117 | |||
118 | usb.c: USB new device connect, assigned device number 2 | ||
119 | usb.c: kmalloc IF c7691fa0, numif 1 | ||
120 | usb.c: kmalloc IF c7b5f3e0, numif 2 | ||
121 | usb.c: skipped 4 class/vendor specific interface descriptors | ||
122 | usb.c: new device strings: Mfr=1, Product=2, SerialNumber=3 | ||
123 | usb.c: USB device number 2 default language ID 0x409 | ||
124 | Manufacturer: 3Com Inc. | ||
125 | Product: 3Com U.S. Robotics Pro ISDN TA | ||
126 | SerialNumber: UFT53A49BVT7 | ||
127 | acm.c: probing config 1 | ||
128 | acm.c: probing config 2 | ||
129 | ttyACM0: USB ACM device | ||
130 | acm.c: acm_control_msg: rq: 0x22 val: 0x0 len: 0x0 result: 0 | ||
131 | acm.c: acm_control_msg: rq: 0x20 val: 0x0 len: 0x7 result: 7 | ||
132 | usb.c: acm driver claimed interface c7b5f3e0 | ||
133 | usb.c: acm driver claimed interface c7b5f3f8 | ||
134 | usb.c: acm driver claimed interface c7691fa0 | ||
135 | |||
136 | If all this seems to be OK, fire up minicom and set it to talk to the ttyACM | ||
137 | device and try typing 'at'. If it responds with 'OK', then everything is | ||
138 | working. | ||
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 | |||
4 | What is it? What can I do with it? | ||
5 | ================================== | ||
6 | The auerswald USB kernel driver connects your linux 2.4.x | ||
7 | system to the auerswald usb-enabled devices. | ||
8 | |||
9 | There are two types of auerswald usb devices: | ||
10 | a) small PBX systems (ISDN) | ||
11 | b) COMfort system telephones (ISDN) | ||
12 | |||
13 | The driver installation creates the devices | ||
14 | /dev/usb/auer0..15. These devices carry a vendor- | ||
15 | specific protocol. You may run all auerswald java | ||
16 | software on it. The java software needs a native | ||
17 | library "libAuerUsbJNINative.so" installed on | ||
18 | your system. This library is available from | ||
19 | auerswald and shipped as part of the java software. | ||
20 | |||
21 | You 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 | |||
26 | Future plans | ||
27 | ============ | ||
28 | - Connection to ISDN4LINUX (the hisax interface) | ||
29 | |||
30 | The 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 @@ | |||
1 | INTRODUCTION | ||
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 | |||
9 | CONFIGURATION | ||
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 | |||
35 | CONTACT: | ||
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 | |||
43 | Greg Kroah-Hartman | ||
44 | greg@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 @@ | |||
1 | In Linux 2.5 kernels (and later), USB device drivers have additional control | ||
2 | over how DMA may be used to perform I/O operations. The APIs are detailed | ||
3 | in the kernel usb programming guide (kerneldoc, from the source code). | ||
4 | |||
5 | |||
6 | API OVERVIEW | ||
7 | |||
8 | The big picture is that USB drivers can continue to ignore most DMA issues, | ||
9 | though they still must provide DMA-ready buffers (see DMA-mapping.txt). | ||
10 | That's how they've worked through the 2.4 (and earlier) kernels. | ||
11 | |||
12 | OR: 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 | |||
30 | ELIMINATING COPIES | ||
31 | |||
32 | It's good to avoid making CPUs copy data needlessly. The costs can add up, | ||
33 | and 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 | |||
76 | WORKING WITH EXISTING BUFFERS | ||
77 | |||
78 | Existing buffers aren't usable for DMA without first being mapped into the | ||
79 | DMA 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 @@ | |||
1 | 27-Dec-2002 | ||
2 | |||
3 | The EHCI driver is used to talk to high speed USB 2.0 devices using | ||
4 | USB 2.0-capable host controller hardware. The USB 2.0 standard is | ||
5 | compatible 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 | |||
11 | USB 1.1 only addressed full speed and low speed. High speed devices | ||
12 | can be used on USB 1.1 systems, but they slow down to USB 1.1 speeds. | ||
13 | |||
14 | USB 1.1 devices may also be used on USB 2.0 systems. When plugged | ||
15 | into an EHCI controller, they are given to a USB 1.1 "companion" | ||
16 | controller, which is a OHCI or UHCI controller as normally used with | ||
17 | such devices. When USB 1.1 devices plug into USB 2.0 hubs, they | ||
18 | interact with the EHCI controller through a "Transaction Translator" | ||
19 | (TT) in the hub, which turns low or full speed transactions into | ||
20 | high speed "split transactions" that don't waste transfer bandwidth. | ||
21 | |||
22 | At this writing, this driver has been seen to work with implementations | ||
23 | of EHCI from (in alphabetical order): Intel, NEC, Philips, and VIA. | ||
24 | Other EHCI implementations are becoming available from other vendors; | ||
25 | you should expect this driver to work with them too. | ||
26 | |||
27 | While usb-storage devices have been available since mid-2001 (working | ||
28 | quite speedily on the 2.4 version of this driver), hubs have only | ||
29 | been available since late 2001, and other kinds of high speed devices | ||
30 | appear to be on hold until more systems come with USB 2.0 built-in. | ||
31 | Such new systems have been available since early 2002, and became much | ||
32 | more typical in the second half of 2002. | ||
33 | |||
34 | Note that USB 2.0 support involves more than just EHCI. It requires | ||
35 | other changes to the Linux-USB core APIs, including the hub driver, | ||
36 | but those changes haven't needed to really change the basic "usbcore" | ||
37 | APIs exposed to USB device drivers. | ||
38 | |||
39 | - David Brownell | ||
40 | <dbrownell@users.sourceforge.net> | ||
41 | |||
42 | |||
43 | FUNCTIONALITY | ||
44 | |||
45 | This driver is regularly tested on x86 hardware, and has also been | ||
46 | used on PPC hardware so big/little endianness issues should be gone. | ||
47 | It's believed to do all the right PCI magic so that I/O works even on | ||
48 | systems with interesting DMA mapping issues. | ||
49 | |||
50 | Transfer Types | ||
51 | |||
52 | At this writing the driver should comfortably handle all control, bulk, | ||
53 | and interrupt transfers, including requests to USB 1.1 devices through | ||
54 | transaction translators (TTs) in USB 2.0 hubs. But you may find bugs. | ||
55 | |||
56 | High Speed Isochronous (ISO) transfer support is also functional, but | ||
57 | at this writing no Linux drivers have been using that support. | ||
58 | |||
59 | Full Speed Isochronous transfer support, through transaction translators, | ||
60 | is not yet available. Note that split transaction support for ISO | ||
61 | transfers can't share much code with the code for high speed ISO transfers, | ||
62 | since EHCI represents these with a different data structure. So for now, | ||
63 | most USB audio and video devices can't be connected to high speed buses. | ||
64 | |||
65 | Driver Behavior | ||
66 | |||
67 | Transfers of all types can be queued. This means that control transfers | ||
68 | from a driver on one interface (or through usbfs) won't interfere with | ||
69 | ones from another driver, and that interrupt transfers can use periods | ||
70 | of one frame without risking data loss due to interrupt processing costs. | ||
71 | |||
72 | The EHCI root hub code hands off USB 1.1 devices to its companion | ||
73 | controller. This driver doesn't need to know anything about those | ||
74 | drivers; a OHCI or UHCI driver that works already doesn't need to change | ||
75 | just because the EHCI driver is also present. | ||
76 | |||
77 | There are some issues with power management; suspend/resume doesn't | ||
78 | behave quite right at the moment. | ||
79 | |||
80 | Also, some shortcuts have been taken with the scheduling periodic | ||
81 | transactions (interrupt and isochronous transfers). These place some | ||
82 | limits on the number of periodic transactions that can be scheduled, | ||
83 | and prevent use of polling intervals of less than one frame. | ||
84 | |||
85 | |||
86 | USE BY | ||
87 | |||
88 | Assuming you have an EHCI controller (on a PCI card or motherboard) | ||
89 | and have compiled this driver as a module, load this like: | ||
90 | |||
91 | # modprobe ehci-hcd | ||
92 | |||
93 | and remove it by: | ||
94 | |||
95 | # rmmod ehci-hcd | ||
96 | |||
97 | You 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, | ||
99 | remove its module and then the driver for that companion controller will | ||
100 | take over (at lower speed) all the devices that were previously handled | ||
101 | by the EHCI driver. | ||
102 | |||
103 | Module 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 | |||
111 | If you're using this driver on a 2.5 kernel, and you've enabled USB | ||
112 | debugging support, you'll see three files in the "sysfs" directory for | ||
113 | any 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 | |||
123 | The contents of those files can help identify driver problems. | ||
124 | |||
125 | |||
126 | Device drivers shouldn't care whether they're running over EHCI or not, | ||
127 | but they may want to check for "usb_device->speed == USB_SPEED_HIGH". | ||
128 | High speed devices can do things that full speed (or low speed) ones | ||
129 | can't, such as "high bandwidth" periodic (interrupt or ISO) transfers. | ||
130 | Also, some values in device descriptors (such as polling intervals for | ||
131 | periodic transfers) use different encodings when operating at high speed. | ||
132 | |||
133 | However, do make a point of testing device drivers through USB 2.0 hubs. | ||
134 | Those hubs report some failures, such as disconnections, differently when | ||
135 | transaction translators are in use; some drivers have been seen to behave | ||
136 | badly when they see different faults than OHCI or UHCI report. | ||
137 | |||
138 | |||
139 | PERFORMANCE | ||
140 | |||
141 | USB 2.0 throughput is gated by two main factors: how fast the host | ||
142 | controller can process requests, and how fast devices can respond to | ||
143 | them. The 480 Mbit/sec "raw transfer rate" is obeyed by all devices, | ||
144 | but aggregate throughput is also affected by issues like delays between | ||
145 | individual high speed packets, driver intelligence, and of course the | ||
146 | overall system load. Latency is also a performance concern. | ||
147 | |||
148 | Bulk transfers are most often used where throughput is an issue. It's | ||
149 | good to keep in mind that bulk transfers are always in 512 byte packets, | ||
150 | and at most 13 of those fit into one USB 2.0 microframe. Eight USB 2.0 | ||
151 | microframes fit in a USB 1.1 frame; a microframe is 1 msec/8 = 125 usec. | ||
152 | |||
153 | So more than 50 MByte/sec is available for bulk transfers, when both | ||
154 | hardware and device driver software allow it. Periodic transfer modes | ||
155 | (isochronous and interrupt) allow the larger packet sizes which let you | ||
156 | approach the quoted 480 MBit/sec transfer rate. | ||
157 | |||
158 | Hardware Performance | ||
159 | |||
160 | At this writing, individual USB 2.0 devices tend to max out at around | ||
161 | 20 MByte/sec transfer rates. This is of course subject to change; | ||
162 | and some devices now go faster, while others go slower. | ||
163 | |||
164 | The first NEC implementation of EHCI seems to have a hardware bottleneck | ||
165 | at around 28 MByte/sec aggregate transfer rate. While this is clearly | ||
166 | enough for a single device at 20 MByte/sec, putting three such devices | ||
167 | onto one bus does not get you 60 MByte/sec. The issue appears to be | ||
168 | that the controller hardware won't do concurrent USB and PCI access, | ||
169 | so that it's only trying six (or maybe seven) USB transactions each | ||
170 | microframe rather than thirteen. (Seems like a reasonable trade off | ||
171 | for a product that beat all the others to market by over a year!) | ||
172 | |||
173 | It's expected that newer implementations will better this, throwing | ||
174 | more silicon real estate at the problem so that new motherboard chip | ||
175 | sets will get closer to that 60 MByte/sec target. That includes an | ||
176 | updated implementation from NEC, as well as other vendors' silicon. | ||
177 | |||
178 | There's a minimum latency of one microframe (125 usec) for the host | ||
179 | to receive interrupts from the EHCI controller indicating completion | ||
180 | of requests. That latency is tunable; there's a module option. By | ||
181 | default ehci-hcd driver uses the minimum latency, which means that if | ||
182 | you issue a control or bulk request you can often expect to learn that | ||
183 | it completed in less than 250 usec (depending on transfer size). | ||
184 | |||
185 | Software Performance | ||
186 | |||
187 | To get even 20 MByte/sec transfer rates, Linux-USB device drivers will | ||
188 | need to keep the EHCI queue full. That means issuing large requests, | ||
189 | or using bulk queuing if a series of small requests needs to be issued. | ||
190 | When drivers don't do that, their performance results will show it. | ||
191 | |||
192 | In typical situations, a usb_bulk_msg() loop writing out 4 KB chunks is | ||
193 | going to waste more than half the USB 2.0 bandwidth. Delays between the | ||
194 | I/O completion and the driver issuing the next request will take longer | ||
195 | than the I/O. If that same loop used 16 KB chunks, it'd be better; a | ||
196 | sequence of 128 KB chunks would waste a lot less. | ||
197 | |||
198 | But rather than depending on such large I/O buffers to make synchronous | ||
199 | I/O be efficient, it's better to just queue up several (bulk) requests | ||
200 | to the HC, and wait for them all to complete (or be canceled on error). | ||
201 | Such URB queuing should work with all the USB 1.1 HC drivers too. | ||
202 | |||
203 | In the Linux 2.5 kernels, new usb_sg_*() api calls have been defined; they | ||
204 | queue all the buffers from a scatterlist. They also use scatterlist DMA | ||
205 | mapping (which might apply an IOMMU) and IRQ reduction, all of which will | ||
206 | help make high speed transfers run as fast as they can. | ||
207 | |||
208 | |||
209 | TBD: Interrupt and ISO transfer performance issues. Those periodic | ||
210 | transfers are fully scheduled, so the main issue is likely to be how | ||
211 | to 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 @@ | |||
1 | Revised: 2004-Oct-21 | ||
2 | |||
3 | This is the documentation of (hopefully) all possible error codes (and | ||
4 | their interpretation) that can be returned from usbcore. | ||
5 | |||
6 | Some of them are returned by the Host Controller Drivers (HCDs), which | ||
7 | device drivers only see through usbcore. As a rule, all the HCDs should | ||
8 | behave the same except for transfer speed dependent behaviors and the | ||
9 | way certain faults are reported. | ||
10 | |||
11 | |||
12 | ************************************************************************** | ||
13 | * Error codes returned by usb_submit_urb * | ||
14 | ************************************************************************** | ||
15 | |||
16 | Non-USB-specific: | ||
17 | |||
18 | 0 URB submission went fine | ||
19 | |||
20 | -ENOMEM no memory for allocation of internal structures | ||
21 | |||
22 | USB-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 | |||
68 | USB device drivers may only test urb status values in completion handlers. | ||
69 | This is because otherwise there would be a race between HCDs updating | ||
70 | these values on one CPU, and device drivers testing them on another CPU. | ||
71 | |||
72 | A transfer's actual_length may be positive even when an error has been | ||
73 | reported. That's because transfers often involve several packets, so that | ||
74 | one or more packets could finish before an error stops further endpoint I/O. | ||
75 | |||
76 | |||
77 | 0 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 | ||
144 | hardware problems such as bad devices (including firmware) or cables. | ||
145 | |||
146 | (**) This is also one of several codes that different kinds of host | ||
147 | controller use to to indicate a transfer has failed because of device | ||
148 | disconnect. In the interval before the hub driver starts disconnect | ||
149 | processing, 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 | |||
158 | usb_register(): | ||
159 | -EINVAL error during registering new driver | ||
160 | |||
161 | usb_get_*/usb_set_*(): | ||
162 | usb_control_msg(): | ||
163 | usb_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 | |||
6 | License and Disclaimer | ||
7 | ---------------------- | ||
8 | This program is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU General Public License as | ||
10 | published by the Free Software Foundation; either version 2 of | ||
11 | the License, or (at your option) any later version. | ||
12 | |||
13 | This program is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | GNU General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU General Public | ||
19 | License along with this program; if not, write to the Free | ||
20 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
21 | MA 02111-1307 USA. | ||
22 | |||
23 | This document and the the gadget serial driver itself are | ||
24 | Copyright (C) 2004 by Al Borchers (alborchers@steinerpoint.com). | ||
25 | |||
26 | If you have questions, problems, or suggestions for this driver | ||
27 | please contact Al Borchers at alborchers@steinerpoint.com. | ||
28 | |||
29 | |||
30 | Prerequisites | ||
31 | ------------- | ||
32 | Versions of the gadget serial driver are available for the | ||
33 | 2.4 Linux kernels, but this document assumes you are using | ||
34 | version 2.0 or later of the gadget serial driver in a 2.6 | ||
35 | Linux kernel. | ||
36 | |||
37 | This document assumes that you are familiar with Linux and | ||
38 | Windows and know how to configure and build Linux kernels, run | ||
39 | standard utilities, use minicom and HyperTerminal, and work with | ||
40 | USB and serial devices. It also assumes you configure the Linux | ||
41 | gadget and usb drivers as modules. | ||
42 | |||
43 | |||
44 | Overview | ||
45 | -------- | ||
46 | The gadget serial driver is a Linux USB gadget driver, a USB device | ||
47 | side driver. It runs on a Linux system that has USB device side | ||
48 | hardware; for example, a PDA, an embedded Linux system, or a PC | ||
49 | with a USB development card. | ||
50 | |||
51 | The gadget serial driver talks over USB to either a CDC ACM driver | ||
52 | or 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 | |||
74 | On the device-side Linux system, the gadget serial driver looks | ||
75 | like a serial device. | ||
76 | |||
77 | On the host-side system, the gadget serial device looks like a | ||
78 | CDC ACM compliant class device or a simple vendor specific device | ||
79 | with bulk in and bulk out endpoints, and it is treated similarly | ||
80 | to other serial devices. | ||
81 | |||
82 | The host side driver can potentially be any ACM compliant driver | ||
83 | or any driver that can talk to a device with a simple bulk in/out | ||
84 | interface. Gadget serial has been tested with the Linux ACM driver, | ||
85 | the Windows usbser.sys ACM driver, and the Linux USB generic serial | ||
86 | driver. | ||
87 | |||
88 | With the gadget serial driver and the host side ACM or generic | ||
89 | serial driver running, you should be able to communicate between | ||
90 | the host and the gadget side systems as if they were connected by a | ||
91 | serial cable. | ||
92 | |||
93 | The gadget serial driver only provides simple unreliable data | ||
94 | communication. It does not yet handle flow control or many other | ||
95 | features of normal serial devices. | ||
96 | |||
97 | |||
98 | Installing the Gadget Serial Driver | ||
99 | ----------------------------------- | ||
100 | To use the gadget serial driver you must configure the Linux gadget | ||
101 | side kernel for "Support for USB Gadgets", for a "USB Peripheral | ||
102 | Controller" (for example, net2280), and for the "Serial Gadget" | ||
103 | driver. All this are listed under "USB Gadget Support" when | ||
104 | configuring the kernel. Then rebuild and install the kernel or | ||
105 | modules. | ||
106 | |||
107 | The gadget serial driver uses major number 127, for now. So you | ||
108 | will need to create a device node for it, like this: | ||
109 | |||
110 | mknod /dev/ttygserial c 127 0 | ||
111 | |||
112 | You only need to do this once. | ||
113 | |||
114 | Then you must load the gadget serial driver. To load it as an | ||
115 | ACM device, do this: | ||
116 | |||
117 | modprobe g_serial use_acm=1 | ||
118 | |||
119 | To load it as a vendor specific bulk in/out device, do this: | ||
120 | |||
121 | modprobe g_serial | ||
122 | |||
123 | This will also automatically load the underlying gadget peripheral | ||
124 | controller driver. This must be done each time you reboot the gadget | ||
125 | side Linux system. You can add this to the start up scripts, if | ||
126 | desired. | ||
127 | |||
128 | If gadget serial is loaded as an ACM device you will want to use | ||
129 | either the Windows or Linux ACM driver on the host side. If gadget | ||
130 | serial is loaded as a bulk in/out device, you will want to use the | ||
131 | Linux generic serial driver on the host side. Follow the appropriate | ||
132 | instructions below to install the host side driver. | ||
133 | |||
134 | |||
135 | Installing the Windows Host ACM Driver | ||
136 | -------------------------------------- | ||
137 | To use the Windows ACM driver you must have the files "gserial.inf" | ||
138 | and "usbser.sys" together in a folder on the Windows machine. | ||
139 | |||
140 | The "gserial.inf" file is given here. | ||
141 | |||
142 | -------------------- CUT HERE -------------------- | ||
143 | [Version] | ||
144 | Signature="$Windows NT$" | ||
145 | Class=Ports | ||
146 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} | ||
147 | Provider=%LINUX% | ||
148 | DriverVer=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] | ||
158 | DefaultDestDir=10,System32\Drivers | ||
159 | |||
160 | [GSerialInstall] | ||
161 | CopyFiles=GSerialCopyFiles | ||
162 | AddReg=GSerialAddReg | ||
163 | |||
164 | [GSerialCopyFiles] | ||
165 | usbser.sys | ||
166 | |||
167 | [GSerialAddReg] | ||
168 | HKR,,DevLoader,,*ntkern | ||
169 | HKR,,NTMPDriver,,usbser.sys | ||
170 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" | ||
171 | |||
172 | [GSerialInstall.Services] | ||
173 | AddService = usbser,0x0002,GSerialService | ||
174 | |||
175 | [GSerialService] | ||
176 | DisplayName = %GSERIAL_DISPLAY_NAME% | ||
177 | ServiceType = 1 ; SERVICE_KERNEL_DRIVER | ||
178 | StartType = 3 ; SERVICE_DEMAND_START | ||
179 | ErrorControl = 1 ; SERVICE_ERROR_NORMAL | ||
180 | ServiceBinary = %10%\System32\Drivers\usbser.sys | ||
181 | LoadOrderGroup = Base | ||
182 | |||
183 | [Strings] | ||
184 | LINUX = "Linux" | ||
185 | GSERIAL = "Gadget Serial" | ||
186 | GSERIAL_DISPLAY_NAME = "USB Gadget Serial Driver" | ||
187 | -------------------- CUT HERE -------------------- | ||
188 | |||
189 | The "usbser.sys" file comes with various versions of Windows. | ||
190 | For example, it can be found on Windows XP typically in | ||
191 | |||
192 | C:\WINDOWS\Driver Cache\i386\driver.cab | ||
193 | |||
194 | Or it can be found on the Windows 98SE CD in the "win98" folder | ||
195 | in the "DRIVER11.CAB" through "DRIVER20.CAB" cab files. You will | ||
196 | need the DOS "expand" program, the Cygwin "cabextract" program, or | ||
197 | a similar program to unpack these cab files and extract "usbser.sys". | ||
198 | |||
199 | For example, to extract "usbser.sys" into the current directory | ||
200 | on 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 | |||
206 | When the gadget serial driver is loaded and the USB device connected | ||
207 | to the Windows host with a USB cable, Windows should recognize the | ||
208 | gadget serial device and ask for a driver. Tell Windows to find the | ||
209 | driver in the folder that contains "gserial.inf" and "usbser.sys". | ||
210 | |||
211 | For example, on Windows XP, when the gadget serial device is first | ||
212 | plugged in, the "Found New Hardware Wizard" starts up. Select | ||
213 | "Install from a list or specific location (Advanced)", then on | ||
214 | the next screen select "Include this location in the search" and | ||
215 | enter the path or browse to the folder containing "gserial.inf" and | ||
216 | "usbser.sys". Windows will complain that the Gadget Serial driver | ||
217 | has not passed Windows Logo testing, but select "Continue anyway" | ||
218 | and finish the driver installation. | ||
219 | |||
220 | On Windows XP, in the "Device Manager" (under "Control Panel", | ||
221 | "System", "Hardware") expand the "Ports (COM & LPT)" entry and you | ||
222 | should see "Gadget Serial" listed as the driver for one of the COM | ||
223 | ports. | ||
224 | |||
225 | To uninstall the Windows XP driver for "Gadget Serial", right click | ||
226 | on the "Gadget Serial" entry in the "Device Manager" and select | ||
227 | "Uninstall". | ||
228 | |||
229 | |||
230 | Installing the Linux Host ACM Driver | ||
231 | ------------------------------------ | ||
232 | To use the Linux ACM driver you must configure the Linux host side | ||
233 | kernel for "Support for Host-side USB" and for "USB Modem (CDC ACM) | ||
234 | support". | ||
235 | |||
236 | Once the gadget serial driver is loaded and the USB device connected | ||
237 | to the Linux host with a USB cable, the host system should recognize | ||
238 | the gadget serial device. For example, the command | ||
239 | |||
240 | cat /proc/bus/usb/devices | ||
241 | |||
242 | should show something like this: | ||
243 | |||
244 | T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 5 Spd=480 MxCh= 0 | ||
245 | D: Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 | ||
246 | P: Vendor=0525 ProdID=a4a7 Rev= 2.01 | ||
247 | S: Manufacturer=Linux 2.6.8.1 with net2280 | ||
248 | S: Product=Gadget Serial | ||
249 | S: SerialNumber=0 | ||
250 | C:* #Ifs= 2 Cfg#= 2 Atr=c0 MxPwr= 2mA | ||
251 | I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm | ||
252 | E: Ad=83(I) Atr=03(Int.) MxPS= 8 Ivl=32ms | ||
253 | I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm | ||
254 | E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
255 | E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
256 | |||
257 | If the host side Linux system is configured properly, the ACM driver | ||
258 | should be loaded automatically. The command "lsmod" should show the | ||
259 | "acm" module is loaded. | ||
260 | |||
261 | |||
262 | Installing the Linux Host Generic USB Serial Driver | ||
263 | --------------------------------------------------- | ||
264 | To use the Linux generic USB serial driver you must configure the | ||
265 | Linux host side kernel for "Support for Host-side USB", for "USB | ||
266 | Serial Converter support", and for the "USB Generic Serial Driver". | ||
267 | |||
268 | Once the gadget serial driver is loaded and the USB device connected | ||
269 | to the Linux host with a USB cable, the host system should recognize | ||
270 | the gadget serial device. For example, the command | ||
271 | |||
272 | cat /proc/bus/usb/devices | ||
273 | |||
274 | should show something like this: | ||
275 | |||
276 | T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 6 Spd=480 MxCh= 0 | ||
277 | D: Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 | ||
278 | P: Vendor=0525 ProdID=a4a6 Rev= 2.01 | ||
279 | S: Manufacturer=Linux 2.6.8.1 with net2280 | ||
280 | S: Product=Gadget Serial | ||
281 | S: SerialNumber=0 | ||
282 | C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA | ||
283 | I: If#= 0 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=serial | ||
284 | E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
285 | E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
286 | |||
287 | You must explicitly load the usbserial driver with parameters to | ||
288 | configure it to recognize the gadget serial device, like this: | ||
289 | |||
290 | modprobe usbserial vendor=0x0525 product=0xA4A6 | ||
291 | |||
292 | If everything is working, usbserial will print a message in the | ||
293 | system log saying something like "Gadget Serial converter now | ||
294 | attached to ttyUSB0". | ||
295 | |||
296 | |||
297 | Testing with Minicom or HyperTerminal | ||
298 | ------------------------------------- | ||
299 | Once the gadget serial driver and the host driver are both installed, | ||
300 | and a USB cable connects the gadget device to the host, you should | ||
301 | be able to communicate over USB between the gadget and host systems. | ||
302 | You can use minicom or HyperTerminal to try this out. | ||
303 | |||
304 | On the gadget side run "minicom -s" to configure a new minicom | ||
305 | session. Under "Serial port setup" set "/dev/ttygserial" as the | ||
306 | "Serial Device". Set baud rate, data bits, parity, and stop bits, | ||
307 | to 9600, 8, none, and 1--these settings mostly do not matter. | ||
308 | Under "Modem and dialing" erase all the modem and dialing strings. | ||
309 | |||
310 | On a Linux host running the ACM driver, configure minicom similarly | ||
311 | but use "/dev/ttyACM0" as the "Serial Device". (If you have other | ||
312 | ACM devices connected, change the device name appropriately.) | ||
313 | |||
314 | On a Linux host running the USB generic serial driver, configure | ||
315 | minicom similarly, but use "/dev/ttyUSB0" as the "Serial Device". | ||
316 | (If you have other USB serial devices connected, change the device | ||
317 | name appropriately.) | ||
318 | |||
319 | On a Windows host configure a new HyperTerminal session to use the | ||
320 | COM port assigned to Gadget Serial. The "Port Settings" will be | ||
321 | set automatically when HyperTerminal connects to the gadget serial | ||
322 | device, so you can leave them set to the default values--these | ||
323 | settings mostly do not matter. | ||
324 | |||
325 | With minicom configured and running on the gadget side and with | ||
326 | minicom or HyperTerminal configured and running on the host side, | ||
327 | you should be able to send data back and forth between the gadget | ||
328 | side and host side systems. Anything you type on the terminal | ||
329 | window on the gadget side should appear in the terminal window on | ||
330 | the 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 @@ | |||
1 | Care and feeding of your Human Interface Devices | ||
2 | |||
3 | INTRODUCTION | ||
4 | |||
5 | In addition to the normal input type HID devices, USB also uses the | ||
6 | human interface device protocols for things that are not really human | ||
7 | interfaces, but have similar sorts of communication needs. The two big | ||
8 | examples for this are power devices (especially uninterruptable power | ||
9 | supplies) and monitor control on higher end monitors. | ||
10 | |||
11 | To support these disparite requirements, the Linux USB system provides | ||
12 | HID events to two separate interfaces: | ||
13 | * the input subsystem, which converts HID events into normal input | ||
14 | device interfaces (such as keyboard, mouse and joystick) and a | ||
15 | normalised event interface - see Documentation/input/input.txt | ||
16 | * the hiddev interface, which provides fairly raw HID events | ||
17 | |||
18 | The data flow for a HID event produced by a device is something like | ||
19 | the following : | ||
20 | |||
21 | usb.c ---> hid-core.c ----> hid-input.c ----> [keyboard/mouse/joystick/event] | ||
22 | | | ||
23 | | | ||
24 | --> hiddev.c ----> POWER / MONITOR CONTROL | ||
25 | |||
26 | In addition, other subsystems (apart from USB) can potentially feed | ||
27 | events into the input subsystem, but these have no effect on the hid | ||
28 | device interface. | ||
29 | |||
30 | USING THE HID DEVICE INTERFACE | ||
31 | |||
32 | The hiddev interface is a char interface using the normal USB major, | ||
33 | with the minor numbers starting at 96 and finishing at 111. Therefore, | ||
34 | you need the following commands: | ||
35 | mknod /dev/usb/hiddev0 c 180 96 | ||
36 | mknod /dev/usb/hiddev1 c 180 97 | ||
37 | mknod /dev/usb/hiddev2 c 180 98 | ||
38 | mknod /dev/usb/hiddev3 c 180 99 | ||
39 | mknod /dev/usb/hiddev4 c 180 100 | ||
40 | mknod /dev/usb/hiddev5 c 180 101 | ||
41 | mknod /dev/usb/hiddev6 c 180 102 | ||
42 | mknod /dev/usb/hiddev7 c 180 103 | ||
43 | mknod /dev/usb/hiddev8 c 180 104 | ||
44 | mknod /dev/usb/hiddev9 c 180 105 | ||
45 | mknod /dev/usb/hiddev10 c 180 106 | ||
46 | mknod /dev/usb/hiddev11 c 180 107 | ||
47 | mknod /dev/usb/hiddev12 c 180 108 | ||
48 | mknod /dev/usb/hiddev13 c 180 109 | ||
49 | mknod /dev/usb/hiddev14 c 180 110 | ||
50 | mknod /dev/usb/hiddev15 c 180 111 | ||
51 | |||
52 | So you point your hiddev compliant user-space program at the correct | ||
53 | interface for your device, and it all just works. | ||
54 | |||
55 | Assuming that you have a hiddev compliant user-space program, of | ||
56 | course. If you need to write one, read on. | ||
57 | |||
58 | |||
59 | THE HIDDEV API | ||
60 | This description should be read in conjunction with the HID | ||
61 | specification, freely available from http://www.usb.org, and | ||
62 | conveniently linked of http://www.linux-usb.org. | ||
63 | |||
64 | The hiddev API uses a read() interface, and a set of ioctl() calls. | ||
65 | |||
66 | HID devices exchange data with the host computer using data | ||
67 | bundles called "reports". Each report is divided into "fields", | ||
68 | each of which can have one or more "usages". In the hid-core, | ||
69 | each one of these usages has a single signed 32 bit value. | ||
70 | |||
71 | read(): | ||
72 | This is the event interface. When the HID device's state changes, | ||
73 | it performs an interrupt transfer containing a report which contains | ||
74 | the changed value. The hid-core.c module parses the report, and | ||
75 | returns to hiddev.c the individual usages that have changed within | ||
76 | the report. In its basic mode, the hiddev will make these individual | ||
77 | usage changes available to the reader using a struct hiddev_event: | ||
78 | |||
79 | struct hiddev_event { | ||
80 | unsigned hid; | ||
81 | signed int value; | ||
82 | }; | ||
83 | |||
84 | containing the HID usage identifier for the status that changed, and | ||
85 | the value that it was changed to. Note that the structure is defined | ||
86 | within <linux/hiddev.h>, along with some other useful #defines and | ||
87 | structures. The HID usage identifier is a composite of the HID usage | ||
88 | page shifted to the 16 high order bits ORed with the usage code. The | ||
89 | behavior of the read() function can be modified using the HIDIOCSFLAG | ||
90 | ioctl() described below. | ||
91 | |||
92 | |||
93 | ioctl(): | ||
94 | This is the control interface. There are a number of controls: | ||
95 | |||
96 | HIDIOCGVERSION - int (read) | ||
97 | Gets the version code out of the hiddev driver. | ||
98 | |||
99 | HIDIOCAPPLICATION - (none) | ||
100 | This ioctl call returns the HID application usage associated with the | ||
101 | hid device. The third argument to ioctl() specifies which application | ||
102 | index to get. This is useful when the device has more than one | ||
103 | application collection. If the index is invalid (greater or equal to | ||
104 | the number of application collections this device has) the ioctl | ||
105 | returns -1. You can find out beforehand how many application | ||
106 | collections the device has from the num_applications field from the | ||
107 | hiddev_devinfo structure. | ||
108 | |||
109 | HIDIOCGCOLLECTIONINFO - struct hiddev_collection_info (read/write) | ||
110 | This returns a superset of the information above, providing not only | ||
111 | application collections, but all the collections the device has. It | ||
112 | also returns the level the collection lives in the hierarchy. | ||
113 | The user passes in a hiddev_collection_info struct with the index | ||
114 | field set to the index that should be returned. The ioctl fills in | ||
115 | the other fields. If the index is larger than the last collection | ||
116 | index, the ioctl returns -1 and sets errno to -EINVAL. | ||
117 | |||
118 | HIDIOCGDEVINFO - struct hiddev_devinfo (read) | ||
119 | Gets a hiddev_devinfo structure which describes the device. | ||
120 | |||
121 | HIDIOCGSTRING - struct struct hiddev_string_descriptor (read/write) | ||
122 | Gets a string descriptor from the device. The caller must fill in the | ||
123 | "index" field to indicate which descriptor should be returned. | ||
124 | |||
125 | HIDIOCINITREPORT - (none) | ||
126 | Instructs the kernel to retrieve all input and feature report values | ||
127 | from the device. At this point, all the usage structures will contain | ||
128 | current values for the device, and will maintain it as the device | ||
129 | changes. Note that the use of this ioctl is unnecessary in general, | ||
130 | since later kernels automatically initialize the reports from the | ||
131 | device at attach time. | ||
132 | |||
133 | HIDIOCGNAME - string (variable length) | ||
134 | Gets the device name | ||
135 | |||
136 | HIDIOCGREPORT - struct hiddev_report_info (write) | ||
137 | Instructs the kernel to get a feature or input report from the device, | ||
138 | in order to selectively update the usage structures (in contrast to | ||
139 | INITREPORT). | ||
140 | |||
141 | HIDIOCSREPORT - struct hiddev_report_info (write) | ||
142 | Instructs the kernel to send a report to the device. This report can | ||
143 | be filled in by the user through HIDIOCSUSAGE calls (below) to fill in | ||
144 | individual usage values in the report before sending the report in full | ||
145 | to the device. | ||
146 | |||
147 | HIDIOCGREPORTINFO - struct hiddev_report_info (read/write) | ||
148 | Fills in a hiddev_report_info structure for the user. The report is | ||
149 | looked up by type (input, output or feature) and id, so these fields | ||
150 | must be filled in by the user. The ID can be absolute -- the actual | ||
151 | report id as reported by the device -- or relative -- | ||
152 | HID_REPORT_ID_FIRST for the first report, and (HID_REPORT_ID_NEXT | | ||
153 | report_id) for the next report after report_id. Without a-priori | ||
154 | information about report ids, the right way to use this ioctl is to | ||
155 | use the relative IDs above to enumerate the valid IDs. The ioctl | ||
156 | returns non-zero when there is no more next ID. The real report ID is | ||
157 | filled into the returned hiddev_report_info structure. | ||
158 | |||
159 | HIDIOCGFIELDINFO - struct hiddev_field_info (read/write) | ||
160 | Returns the field information associated with a report in a | ||
161 | hiddev_field_info structure. The user must fill in report_id and | ||
162 | report_type in this structure, as above. The field_index should also | ||
163 | be filled in, which should be a number from 0 and maxfield-1, as | ||
164 | returned from a previous HIDIOCGREPORTINFO call. | ||
165 | |||
166 | HIDIOCGUCODE - struct hiddev_usage_ref (read/write) | ||
167 | Returns the usage_code in a hiddev_usage_ref structure, given that | ||
168 | given its report type, report id, field index, and index within the | ||
169 | field have already been filled into the structure. | ||
170 | |||
171 | HIDIOCGUSAGE - struct hiddev_usage_ref (read/write) | ||
172 | Returns the value of a usage in a hiddev_usage_ref structure. The | ||
173 | usage to be retrieved can be specified as above, or the user can | ||
174 | choose to fill in the report_type field and specify the report_id as | ||
175 | HID_REPORT_ID_UNKNOWN. In this case, the hiddev_usage_ref will be | ||
176 | filled in with the report and field information associated with this | ||
177 | usage if it is found. | ||
178 | |||
179 | HIDIOCSUSAGE - struct hiddev_usage_ref (write) | ||
180 | Sets the value of a usage in an output report. The user fills in | ||
181 | the hiddev_usage_ref structure as above, but additionally fills in | ||
182 | the value field. | ||
183 | |||
184 | HIDIOGCOLLECTIONINDEX - struct hiddev_usage_ref (write) | ||
185 | Returns the collection index associated with this usage. This | ||
186 | indicates where in the collection hierarchy this usage sits. | ||
187 | |||
188 | HIDIOCGFLAG - int (read) | ||
189 | HIDIOCSFLAG - int (write) | ||
190 | These operations respectively inspect and replace the mode flags | ||
191 | that 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 @@ | |||
1 | LINUX HOTPLUGGING | ||
2 | |||
3 | In hotpluggable busses like USB (and Cardbus PCI), end-users plug devices | ||
4 | into the bus with power on. In most cases, users expect the devices to become | ||
5 | immediately 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 | |||
19 | This involves a mix of kernel mode and user mode actions. Making devices | ||
20 | be immediately usable means that any user mode actions can't wait for an | ||
21 | administrator to do them: the kernel must trigger them, either passively | ||
22 | (triggering some monitoring daemon to invoke a helper program) or | ||
23 | actively (calling such a user mode helper program directly). | ||
24 | |||
25 | Those triggered actions must support a system's administrative policies; | ||
26 | such programs are called "policy agents" here. Typically they involve | ||
27 | shell scripts that dispatch to more familiar administration tools. | ||
28 | |||
29 | Because some of those actions rely on information about drivers (metadata) | ||
30 | that is currently available only when the drivers are dynamically linked, | ||
31 | you get the best hotplugging when you configure a highly modular system. | ||
32 | |||
33 | |||
34 | KERNEL HOTPLUG HELPER (/sbin/hotplug) | ||
35 | |||
36 | When you compile with CONFIG_HOTPLUG, you get a new kernel parameter: | ||
37 | /proc/sys/kernel/hotplug, which normally holds the pathname "/sbin/hotplug". | ||
38 | That parameter names a program which the kernel may invoke at various times. | ||
39 | |||
40 | The /sbin/hotplug program can be invoked by any subsystem as part of its | ||
41 | reaction to a configuration change, from a thread in that subsystem. | ||
42 | Only one parameter is required: the name of a subsystem being notified of | ||
43 | some kernel event. That name is used as the first key for further event | ||
44 | dispatch; any other argument and environment parameters are specified by | ||
45 | the subsystem making that invocation. | ||
46 | |||
47 | Hotplug software and other resources is available at: | ||
48 | |||
49 | http://linux-hotplug.sourceforge.net | ||
50 | |||
51 | Mailing list information is also available at that site. | ||
52 | |||
53 | |||
54 | -------------------------------------------------------------------------- | ||
55 | |||
56 | |||
57 | USB POLICY AGENT | ||
58 | |||
59 | The USB subsystem currently invokes /sbin/hotplug when USB devices | ||
60 | are added or removed from system. The invocation is done by the kernel | ||
61 | hub daemon thread [khubd], or else as part of root hub initialization | ||
62 | (done by init, modprobe, kapmd, etc). Its single command line parameter | ||
63 | is 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 | |||
70 | If "usbdevfs" is configured, DEVICE and DEVFS are also passed. DEVICE is | ||
71 | the pathname of the device, and is useful for devices with multiple and/or | ||
72 | alternate interfaces that complicate driver selection. By design, USB | ||
73 | hotplugging is independent of "usbdevfs": you can do most essential parts | ||
74 | of USB device setup without using that filesystem, and without running a | ||
75 | user mode daemon to detect changes in system configuration. | ||
76 | |||
77 | Currently available policy agent implementations can load drivers for | ||
78 | modules, and can invoke driver-specific setup scripts. The newest ones | ||
79 | leverage USB module-init-tools support. Later agents might unload drivers. | ||
80 | |||
81 | |||
82 | USB MODUTILS SUPPORT | ||
83 | |||
84 | Current versions of module-init-tools will create a "modules.usbmap" file | ||
85 | which contains the entries from each driver's MODULE_DEVICE_TABLE. Such | ||
86 | files can be used by various user mode policy agents to make sure all the | ||
87 | right driver modules get loaded, either at boot time or later. | ||
88 | |||
89 | See <linux/usb.h> for full information about such table entries; or look | ||
90 | at existing drivers. Each table entry describes one or more criteria to | ||
91 | be used when matching a driver to a device or class of devices. The | ||
92 | specific criteria are identified by bits set in "match_flags", paired | ||
93 | with field values. You can construct the criteria directly, or with | ||
94 | macros 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 | |||
105 | A short example, for a driver that supports several specific USB devices | ||
106 | and 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 | |||
116 | Most USB device drivers should pass these tables to the USB subsystem as | ||
117 | well as to the module management subsystem. Not all, though: some driver | ||
118 | frameworks connect using interfaces layered over USB, and so they won't | ||
119 | need such a "struct usb_driver". | ||
120 | |||
121 | Drivers that connect directly to the USB subsystem should be declared | ||
122 | something 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 | |||
139 | When the USB subsystem knows about a driver's device ID table, it's used when | ||
140 | choosing drivers to probe(). The thread doing new device processing checks | ||
141 | drivers' device ID entries from the MODULE_DEVICE_TABLE against interface and | ||
142 | device descriptors for the device. It will only call probe() if there is a | ||
143 | match, and the third argument to probe() will be the entry that matched. | ||
144 | |||
145 | If you don't provide an id_table for your driver, then your driver may get | ||
146 | probed 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 @@ | |||
1 | README for Linux device driver for the IBM "C-It" USB video camera | ||
2 | |||
3 | INTRODUCTION: | ||
4 | |||
5 | This driver does not use all features known to exist in | ||
6 | the IBM camera. However most of needed features work well. | ||
7 | |||
8 | This driver was developed using logs of observed USB traffic | ||
9 | which was produced by standard Windows driver (c-it98.sys). | ||
10 | I did not have data sheets from Xirlink. | ||
11 | |||
12 | Video formats: | ||
13 | 128x96 [model 1] | ||
14 | 176x144 | ||
15 | 320x240 [model 2] | ||
16 | 352x240 [model 2] | ||
17 | 352x288 | ||
18 | Frame rate: 3 - 30 frames per second (FPS) | ||
19 | External interface: USB | ||
20 | Internal interface: Video For Linux (V4L) | ||
21 | Supported controls: | ||
22 | - by V4L: Contrast, Brightness, Color, Hue | ||
23 | - by driver options: frame rate, lighting conditions, video format, | ||
24 | default picture settings, sharpness. | ||
25 | |||
26 | SUPPORTED CAMERAS: | ||
27 | |||
28 | Xirlink "C-It" camera, also known as "IBM PC Camera". | ||
29 | The device uses proprietary ASIC (and compression method); | ||
30 | it is manufactured by Xirlink. See http://www.xirlink.com/ | ||
31 | http://www.ibmpccamera.com or http://www.c-itnow.com/ for | ||
32 | details and pictures. | ||
33 | |||
34 | This very chipset ("X Chip", as marked at the factory) | ||
35 | is used in several other cameras, and they are supported | ||
36 | as well: | ||
37 | |||
38 | - IBM NetCamera | ||
39 | - Veo Stingray | ||
40 | |||
41 | The Linux driver was developed with camera with following | ||
42 | model number (or FCC ID): KSX-XVP510. This camera has three | ||
43 | interfaces, each with one endpoint (control, iso, iso). This | ||
44 | type of cameras is referred to as "model 1". These cameras are | ||
45 | no longer manufactured. | ||
46 | |||
47 | Xirlink now manufactures new cameras which are somewhat different. | ||
48 | In particular, following models [FCC ID] belong to that category: | ||
49 | |||
50 | XVP300 [KSX-X9903] | ||
51 | XVP600 [KSX-X9902] | ||
52 | XVP610 [KSX-X9902] | ||
53 | |||
54 | (see http://www.xirlink.com/ibmpccamera/ for updates, they refer | ||
55 | to these new cameras by Windows driver dated 12-27-99, v3005 BETA) | ||
56 | These cameras have two interfaces, one endpoint in each (iso, bulk). | ||
57 | Such type of cameras is referred to as "model 2". They are supported | ||
58 | (with exception of 352x288 native mode). | ||
59 | |||
60 | Some IBM NetCameras (Model 4) are made to generate only compressed | ||
61 | video streams. This is great for performance, but unfortunately | ||
62 | nobody knows how to decompress the stream :-( Therefore, these | ||
63 | cameras are *unsupported* and if you try to use one of those, all | ||
64 | you get is random colored horizontal streaks, not the image! | ||
65 | If you have one of those cameras, you probably should return it | ||
66 | to the store and get something that is supported. | ||
67 | |||
68 | Tell me more about all that "model" business | ||
69 | -------------------------------------------- | ||
70 | |||
71 | I just invented model numbers to uniquely identify flavors of the | ||
72 | hardware/firmware that were sold. It was very confusing to use | ||
73 | brand names or some other internal numbering schemes. So I found | ||
74 | by experimentation that all Xirlink chipsets fall into four big | ||
75 | classes, and I called them "models". Each model is programmed in | ||
76 | its own way, and each model sends back the video in its own way. | ||
77 | |||
78 | Quirks of Model 2 cameras: | ||
79 | ------------------------- | ||
80 | |||
81 | Model 2 does not have hardware contrast control. Corresponding V4L | ||
82 | control is implemented in software, which is not very nice to your | ||
83 | CPU, but at least it works. | ||
84 | |||
85 | This driver provides 352x288 mode by switching the camera into | ||
86 | quasi-352x288 RGB mode (800 Kbits per frame) essentially limiting | ||
87 | this mode to 10 frames per second or less, in ideal conditions on | ||
88 | the bus (USB is shared, after all). The frame rate | ||
89 | has to be programmed very conservatively. Additional concern is that | ||
90 | frame rate depends on brightness setting; therefore the picture can | ||
91 | be good at one brightness and broken at another! I did not want to fix | ||
92 | the frame rate at slowest setting, but I had to move it pretty much down | ||
93 | the scale (so that framerate option barely matters). I also noticed that | ||
94 | camera after first powering up produces frames slightly faster than during | ||
95 | consecutive uses. All this means that if you use 352x288 (which is | ||
96 | default), be warned - you may encounter broken picture on first connect; | ||
97 | try to adjust brightness - brighter image is slower, so USB will be able | ||
98 | to send all data. However if you regularly use Model 2 cameras you may | ||
99 | prefer 176x144 which makes perfectly good I420, with no scaling and | ||
100 | lesser demands on USB (300 Kbits per second, or 26 frames per second). | ||
101 | |||
102 | Another strange effect of 352x288 mode is the fine vertical grid visible | ||
103 | on some colored surfaces. I am sure it is caused by me not understanding | ||
104 | what the camera is trying to say. Blame trade secrets for that. | ||
105 | |||
106 | The camera that I had also has a hardware quirk: if disconnected, | ||
107 | it 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 | ||
111 | observed this particular flaw in it.] | ||
112 | |||
113 | Model 2 camera can be programmed for very high sensitivity (even starlight | ||
114 | may be enough), this makes it convenient for tinkering with. The driver | ||
115 | code has enough comments to help a programmer to tweak the camera | ||
116 | as s/he feels necessary. | ||
117 | |||
118 | WHAT 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 | |||
126 | HOW TO COMPILE THE DRIVER: | ||
127 | |||
128 | You need to compile the driver only if you are a developer | ||
129 | or if you want to make changes to the code. Most distributions | ||
130 | precompile all modules, so you can go directly to the next | ||
131 | section "HOW TO USE THE DRIVER". | ||
132 | |||
133 | The ibmcam driver uses usbvideo helper library (module), | ||
134 | so if you are studying the ibmcam code you will be led there. | ||
135 | |||
136 | The driver itself consists of only one file in usb/ directory: | ||
137 | ibmcam.c. This file is included into the Linux kernel build | ||
138 | process if you configure the kernel for CONFIG_USB_IBMCAM. | ||
139 | Run "make xconfig" and in USB section you will find the IBM | ||
140 | camera driver. Select it, save the configuration and recompile. | ||
141 | |||
142 | HOW TO USE THE DRIVER: | ||
143 | |||
144 | I recommend to compile driver as a module. This gives you an | ||
145 | easier access to its configuration. The camera has many more | ||
146 | settings than V4L can operate, so some settings are done using | ||
147 | module options. | ||
148 | |||
149 | To begin with, on most modern Linux distributions the driver | ||
150 | will be automatically loaded whenever you plug the supported | ||
151 | camera in. Therefore, you don't need to do anything. However | ||
152 | if you want to experiment with some module parameters then | ||
153 | you can load and unload the driver manually, with camera | ||
154 | plugged in or unplugged. | ||
155 | |||
156 | Typically module is installed with command 'modprobe', like this: | ||
157 | |||
158 | # modprobe ibmcam framerate=1 | ||
159 | |||
160 | Alternatively you can use 'insmod' in similar fashion: | ||
161 | |||
162 | # insmod /lib/modules/2.x.y/usb/ibmcam.o framerate=1 | ||
163 | |||
164 | Module can be inserted with camera connected or disconnected. | ||
165 | |||
166 | The driver can have options, though some defaults are provided. | ||
167 | |||
168 | Driver options: (* indicates that option is model-dependent) | ||
169 | |||
170 | Name Type Range [default] Example | ||
171 | -------------- -------------- -------------- ------------------ | ||
172 | debug Integer 0-9 [0] debug=1 | ||
173 | flags Integer 0-0xFF [0] flags=0x0d | ||
174 | framerate Integer 0-6 [2] framerate=1 | ||
175 | hue_correction Integer 0-255 [128] hue_correction=115 | ||
176 | init_brightness Integer 0-255 [128] init_brightness=100 | ||
177 | init_contrast Integer 0-255 [192] init_contrast=200 | ||
178 | init_color Integer 0-255 [128] init_color=130 | ||
179 | init_hue Integer 0-255 [128] init_hue=115 | ||
180 | lighting Integer 0-2* [1] lighting=2 | ||
181 | sharpness Integer 0-6* [4] sharpness=3 | ||
182 | size Integer 0-2* [2] size=1 | ||
183 | |||
184 | Options for Model 2 only: | ||
185 | |||
186 | Name Type Range [default] Example | ||
187 | -------------- -------------- -------------- ------------------ | ||
188 | init_model2_rg Integer 0..255 [0x70] init_model2_rg=128 | ||
189 | init_model2_rg2 Integer 0..255 [0x2f] init_model2_rg2=50 | ||
190 | init_model2_sat Integer 0..255 [0x34] init_model2_sat=65 | ||
191 | init_model2_yb Integer 0..255 [0xa0] init_model2_yb=200 | ||
192 | |||
193 | debug 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 | |||
197 | flags 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 | |||
231 | framerate 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 | |||
238 | hue_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 | |||
248 | init_brightness These settings specify _initial_ values which will be | ||
249 | init_contrast used to set up the camera. If your V4L application has | ||
250 | init_color its own controls to adjust the picture then these | ||
251 | init_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 | |||
255 | init_model2_rg These initial settings alter color balance of the | ||
256 | init_model2_rg2 camera on hardware level. All four settings may be used | ||
257 | init_model2_sat to tune the camera to specific lighting conditions. These | ||
258 | init_model2_yb settings only apply to Model 2 cameras. | ||
259 | |||
260 | lighting 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 | |||
269 | sharpness 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 | |||
276 | size 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 | |||
299 | For more information and the Troubleshooting FAQ visit this URL: | ||
300 | |||
301 | http://www.linux-usb.org/ibmcam/ | ||
302 | |||
303 | WHAT 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 | |||
318 | CREDITS: | ||
319 | |||
320 | The code is based in no small part on the CPiA driver by Johannes Erdfelt, | ||
321 | Randy Dunlap, and others. Big thanks to them for their pioneering work on that | ||
322 | and the USB stack. | ||
323 | |||
324 | I 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] | ||
16 | Signature = "$CHICAGO$" | ||
17 | Class = Net | ||
18 | ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} | ||
19 | Provider = %Linux% | ||
20 | Compatible = 1 | ||
21 | MillenniumPreferred = .ME | ||
22 | DriverVer = 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] | ||
37 | ExcludeFromSelect=* | ||
38 | |||
39 | ; Windows 98, Windows 98 Second Edition specific sections -------- | ||
40 | |||
41 | [RNDIS] | ||
42 | DeviceID = usb8023 | ||
43 | MaxInstance = 512 | ||
44 | DriverVer = 03/30/2004,0.0.0.0 | ||
45 | AddReg = RNDIS_AddReg_98, RNDIS_AddReg_Common | ||
46 | |||
47 | [RNDIS_AddReg_98] | ||
48 | HKR, , DevLoader, 0, *ndis | ||
49 | HKR, , DeviceVxDs, 0, usb8023.sys | ||
50 | HKR, NDIS, LogDriverName, 0, "usb8023" | ||
51 | HKR, NDIS, MajorNdisVersion, 1, 5 | ||
52 | HKR, NDIS, MinorNdisVersion, 1, 0 | ||
53 | HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5" | ||
54 | HKR, Ndi\Interfaces, DefLower, 0, "ethernet" | ||
55 | HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5" | ||
56 | HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" | ||
57 | HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_98" | ||
58 | HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_98" | ||
59 | HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_98" | ||
60 | HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2" | ||
61 | |||
62 | [RNDIS_Install_98] | ||
63 | CopyFiles=RNDIS_CopyFiles_98 | ||
64 | |||
65 | [RNDIS_CopyFiles_98] | ||
66 | usb8023.sys, usb8023w.sys, , 0 | ||
67 | rndismp.sys, rndismpw.sys, , 0 | ||
68 | |||
69 | ; Windows Millennium Edition specific sections -------------------- | ||
70 | |||
71 | [RNDIS.ME] | ||
72 | DeviceID = usb8023 | ||
73 | MaxInstance = 512 | ||
74 | DriverVer = 03/30/2004,0.0.0.0 | ||
75 | AddReg = RNDIS_AddReg_ME, RNDIS_AddReg_Common | ||
76 | Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI | ||
77 | BusType = 15 | ||
78 | |||
79 | [RNDIS_AddReg_ME] | ||
80 | HKR, , DevLoader, 0, *ndis | ||
81 | HKR, , DeviceVxDs, 0, usb8023.sys | ||
82 | HKR, NDIS, LogDriverName, 0, "usb8023" | ||
83 | HKR, NDIS, MajorNdisVersion, 1, 5 | ||
84 | HKR, NDIS, MinorNdisVersion, 1, 0 | ||
85 | HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5" | ||
86 | HKR, Ndi\Interfaces, DefLower, 0, "ethernet" | ||
87 | HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5" | ||
88 | HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" | ||
89 | HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_ME" | ||
90 | HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_ME" | ||
91 | HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_ME" | ||
92 | HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2" | ||
93 | |||
94 | [RNDIS_Install_ME] | ||
95 | CopyFiles=RNDIS_CopyFiles_ME | ||
96 | |||
97 | [RNDIS_CopyFiles_ME] | ||
98 | usb8023.sys, usb8023m.sys, , 0 | ||
99 | rndismp.sys, rndismpm.sys, , 0 | ||
100 | |||
101 | ; Windows 2000 specific sections --------------------------------- | ||
102 | |||
103 | [RNDIS.NT] | ||
104 | Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI | ||
105 | BusType = 15 | ||
106 | DriverVer = 03/30/2004,0.0.0.0 | ||
107 | AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common | ||
108 | CopyFiles = RNDIS_CopyFiles_NT | ||
109 | |||
110 | [RNDIS.NT.Services] | ||
111 | AddService = 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 | ||
115 | usb8023k.sys, , , 0 | ||
116 | rndismpk.sys, , , 0 | ||
117 | |||
118 | [RNDIS_ServiceInst_NT] | ||
119 | DisplayName = %ServiceDisplayName% | ||
120 | ServiceType = 1 | ||
121 | StartType = 3 | ||
122 | ErrorControl = 1 | ||
123 | ServiceBinary = %12%\usb8023k.sys | ||
124 | LoadOrderGroup = NDIS | ||
125 | AddReg = RNDIS_WMI_AddReg_NT | ||
126 | |||
127 | [RNDIS_WMI_AddReg_NT] | ||
128 | HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismpk.sys" | ||
129 | |||
130 | ; Windows XP specific sections ----------------------------------- | ||
131 | |||
132 | [RNDIS.NT.5.1] | ||
133 | Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI | ||
134 | BusType = 15 | ||
135 | DriverVer = 03/30/2004,0.0.0.0 | ||
136 | AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common | ||
137 | ; no copyfiles - the files are already in place | ||
138 | |||
139 | [RNDIS.NT.5.1.Services] | ||
140 | AddService = USB_RNDIS, 2, RNDIS_ServiceInst_51, RNDIS_EventLog | ||
141 | |||
142 | [RNDIS_ServiceInst_51] | ||
143 | DisplayName = %ServiceDisplayName% | ||
144 | ServiceType = 1 | ||
145 | StartType = 3 | ||
146 | ErrorControl = 1 | ||
147 | ServiceBinary = %12%\usb8023.sys | ||
148 | LoadOrderGroup = NDIS | ||
149 | AddReg = RNDIS_WMI_AddReg_51 | ||
150 | |||
151 | [RNDIS_WMI_AddReg_51] | ||
152 | HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismp.sys" | ||
153 | |||
154 | ; Windows 2000 and Windows XP common sections -------------------- | ||
155 | |||
156 | [RNDIS_AddReg_NT] | ||
157 | HKR, Ndi, Service, 0, "USB_RNDIS" | ||
158 | HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" | ||
159 | HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" | ||
160 | |||
161 | [RNDIS_EventLog] | ||
162 | AddReg = RNDIS_EventLog_AddReg | ||
163 | |||
164 | [RNDIS_EventLog_AddReg] | ||
165 | HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll" | ||
166 | HKR, , TypesSupported, 0x00010001, 7 | ||
167 | |||
168 | ; Common Sections ------------------------------------------------- | ||
169 | |||
170 | [RNDIS_AddReg_Common] | ||
171 | HKR, NDI\params\NetworkAddress, ParamDesc, 0, %NetworkAddress% | ||
172 | HKR, NDI\params\NetworkAddress, type, 0, "edit" | ||
173 | HKR, NDI\params\NetworkAddress, LimitText, 0, "12" | ||
174 | HKR, NDI\params\NetworkAddress, UpperCase, 0, "1" | ||
175 | HKR, NDI\params\NetworkAddress, default, 0, " " | ||
176 | HKR, NDI\params\NetworkAddress, optional, 0, "1" | ||
177 | |||
178 | [SourceDisksNames] | ||
179 | 1=%SourceDisk%,,1 | ||
180 | |||
181 | [SourceDisksFiles] | ||
182 | usb8023m.sys=1 | ||
183 | rndismpm.sys=1 | ||
184 | usb8023w.sys=1 | ||
185 | rndismpw.sys=1 | ||
186 | usb8023k.sys=1 | ||
187 | rndismpk.sys=1 | ||
188 | |||
189 | [DestinationDirs] | ||
190 | RNDIS_CopyFiles_98 = 10, system32/drivers | ||
191 | RNDIS_CopyFiles_ME = 10, system32/drivers | ||
192 | RNDIS_CopyFiles_NT = 12 | ||
193 | |||
194 | [Strings] | ||
195 | ServiceDisplayName = "USB Remote NDIS Network Device Driver" | ||
196 | NetworkAddress = "Network Address" | ||
197 | Linux = "Linux Developer Community" | ||
198 | LinuxDevice = "Linux USB Ethernet/RNDIS Gadget" | ||
199 | SourceDisk = "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 @@ | |||
1 | CHANGES | ||
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 | |||
16 | SUPPORTED 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 | |||
32 | DRIVER NOTES: | ||
33 | |||
34 | Installation is simple, you only need to add Linux Input, Linux USB, and the | ||
35 | driver to the kernel. The driver can also be optionally built as a module. | ||
36 | |||
37 | This driver appears to be one of possible 2 Linux USB Input Touchscreen | ||
38 | drivers. Although 3M produces a binary only driver available for | ||
39 | download, I persist in updating this driver since I would like to use the | ||
40 | touchscreen for embedded apps using QTEmbedded, DirectFB, etc. So I feel the | ||
41 | logical choice is to use Linux Imput. | ||
42 | |||
43 | Currently there is no way to calibrate the device via this driver. Even if | ||
44 | the device could be calibrated, the driver pulls to raw coordinate data from | ||
45 | the controller. This means calibration must be performed within the | ||
46 | userspace. | ||
47 | |||
48 | The controller screen resolution is now 0 to 16384 for both X and Y reporting | ||
49 | the raw touch data. This is the same for the old and new capacitive USB | ||
50 | controllers. | ||
51 | |||
52 | Perhaps at some point an abstract function will be placed into evdev so | ||
53 | generic functions like calibrations, resets, and vendor information can be | ||
54 | requested from the userspace (And the drivers would handle the vendor specific | ||
55 | tasks). | ||
56 | |||
57 | ADDITIONAL INFORMATION/UPDATES/X CONFIGURATION EXAMPLE: | ||
58 | |||
59 | http://groomlakelabs.com/grandamp/code/microtouch/ | ||
60 | |||
61 | TODO: | ||
62 | |||
63 | Implement a control urb again to handle requests to and from the device | ||
64 | such as calibration, etc once/if it becomes available. | ||
65 | |||
66 | DISCLAMER: | ||
67 | |||
68 | I am not a MicroTouch/3M employee, nor have I ever been. 3M does not support | ||
69 | this driver! If you want touch drivers only supported within X, please go to: | ||
70 | |||
71 | http://www.3m.com/3MTouchSystems/downloads/ | ||
72 | |||
73 | THANKS: | ||
74 | |||
75 | A huge thank you to 3M Touch Systems for the EXII-5010UC controllers for | ||
76 | testing! | ||
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 @@ | |||
1 | 23-Aug-2002 | ||
2 | |||
3 | The "ohci-hcd" driver is a USB Host Controller Driver (HCD) that is derived | ||
4 | from the "usb-ohci" driver from the 2.4 kernel series. The "usb-ohci" code | ||
5 | was written primarily by Roman Weissgaerber <weissg@vienna.at> but with | ||
6 | contributions from many others (read its copyright/licencing header). | ||
7 | |||
8 | It supports the "Open Host Controller Interface" (OHCI), which standardizes | ||
9 | hardware register protocols used to talk to USB 1.1 host controllers. As | ||
10 | compared to the earlier "Universal Host Controller Interface" (UHCI) from | ||
11 | Intel, it pushes more intelligence into the hardware. USB 1.1 controllers | ||
12 | from vendors other than Intel and VIA generally use OHCI. | ||
13 | |||
14 | Changes 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 | |||
23 | The "ohci-hcd" driver handles all USB 1.1 transfer types. Transfers of all | ||
24 | types can be queued. That was also true in "usb-ohci", except for interrupt | ||
25 | transfers. Previously, using periods of one frame would risk data loss due | ||
26 | to overhead in IRQ processing. When interrupt transfers are queued, those | ||
27 | risks can be minimized by making sure the hardware always has transfers to | ||
28 | work 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 | ------------------------------------------------------------------------------- | ||
2 | Readme for Linux device driver for the OmniVision OV511 USB to camera bridge IC | ||
3 | ------------------------------------------------------------------------------- | ||
4 | |||
5 | Author: Mark McClelland | ||
6 | Homepage: http://alpha.dyndns.org/ov511 | ||
7 | |||
8 | INTRODUCTION: | ||
9 | |||
10 | This is a driver for the OV511, a USB-only chip used in many "webcam" devices. | ||
11 | Any camera using the OV511/OV511+ and the OV6620/OV7610/20/20AE should work. | ||
12 | Video capture devices that use the Philips SAA7111A decoder also work. It | ||
13 | supports streaming and capture of color or monochrome video via the Video4Linux | ||
14 | API. Most V4L apps are compatible with it. Most resolutions with a width and | ||
15 | height that are a multiple of 8 are supported. | ||
16 | |||
17 | If you need more information, please visit the OV511 homepage at the above URL. | ||
18 | |||
19 | WHAT 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 | |||
28 | HOW TO USE IT: | ||
29 | |||
30 | Note: These are simplified instructions. For complete instructions see: | ||
31 | http://alpha.dyndns.org/ov511/install.html | ||
32 | |||
33 | You must have first compiled USB support, support for your specific USB host | ||
34 | controller (UHCI or OHCI), and Video4Linux support for your kernel (I recommend | ||
35 | making them modules.) Make sure "Enforce bandwidth allocation" is NOT enabled. | ||
36 | |||
37 | Next, (as root): | ||
38 | |||
39 | modprobe usbcore | ||
40 | modprobe usb-uhci <OR> modprobe usb-ohci | ||
41 | modprobe videodev | ||
42 | modprobe ov511 | ||
43 | |||
44 | If it is not already there (it usually is), create the video device: | ||
45 | |||
46 | mknod /dev/video0 c 81 0 | ||
47 | |||
48 | Optionally, symlink /dev/video to /dev/video0 | ||
49 | |||
50 | You will have to set permissions on this device to allow you to read/write | ||
51 | from it: | ||
52 | |||
53 | chmod 666 /dev/video | ||
54 | chmod 666 /dev/video0 (if necessary) | ||
55 | |||
56 | Now you are ready to run a video app! Both vidcat and xawtv work well for me | ||
57 | at 640x480. | ||
58 | |||
59 | [Using vidcat:] | ||
60 | |||
61 | vidcat -s 640x480 -p c > test.jpg | ||
62 | xview test.jpg | ||
63 | |||
64 | [Using xawtv:] | ||
65 | |||
66 | From the main xawtv directory: | ||
67 | |||
68 | make clean | ||
69 | ./configure | ||
70 | make | ||
71 | make install | ||
72 | |||
73 | Now you should be able to run xawtv. Right click for the options dialog. | ||
74 | |||
75 | MODULE 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 | |||
267 | WORKING 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 | |||
277 | HOW TO CONTACT ME: | ||
278 | |||
279 | You can email me at mark@alpha.dyndns.org . Please prefix the subject line | ||
280 | with "OV511: " so that I am certain to notice your message. | ||
281 | |||
282 | CREDITS: | ||
283 | |||
284 | The code is based in no small part on the CPiA driver by Johannes Erdfelt, | ||
285 | Randy Dunlap, and others. Big thanks to them for their pioneering work on that | ||
286 | and the USB stack. Thanks to Bret Wallach for getting camera reg IO, ISOC, and | ||
287 | image capture working. Thanks to Orion Sky Lawlor, Kevin Moore, and Claudio | ||
288 | Matsuoka 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 | |||
6 | The usbfs filesystem for USB devices is traditionally mounted at | ||
7 | /proc/bus/usb. It provides the /proc/bus/usb/devices file, as well as | ||
8 | the /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 | |||
34 | For more information on mounting the usbfs file system, see the | ||
35 | "USB Device Filesystem" section of the USB Guide. The latest copy | ||
36 | of the USB Guide can be found at http://www.linux-usb.org/ | ||
37 | |||
38 | |||
39 | THE /proc/bus/usb/BBB/DDD FILES: | ||
40 | -------------------------------- | ||
41 | Each connected USB device has one file. The BBB indicates the bus | ||
42 | number. The DDD indicates the device address on that bus. Both | ||
43 | of these numbers are assigned sequentially, and can be reused, so | ||
44 | you can't rely on them for stable access to devices. For example, | ||
45 | it's relatively common for devices to re-enumerate while they are | ||
46 | still connected (perhaps someone jostled their power supply, hub, | ||
47 | or USB cable), so a device might be 002/027 when you first connect | ||
48 | it and 002/048 sometime later. | ||
49 | |||
50 | These files can be read as binary data. The binary data consists | ||
51 | of first the device descriptor, then the descriptors for each | ||
52 | configuration of the device. That information is also shown in | ||
53 | text form by the /proc/bus/usb/devices file, described later. | ||
54 | |||
55 | These files may also be used to write user-level drivers for the USB | ||
56 | devices. You would open the /proc/bus/usb/BBB/DDD file read/write, | ||
57 | read its descriptors to make sure it's the device you expect, and then | ||
58 | bind to an interface (or perhaps several) using an ioctl call. You | ||
59 | would issue more ioctls to the device to communicate to it using | ||
60 | control, bulk, or other kinds of USB transfers. The IOCTLs are | ||
61 | listed in the <linux/usbdevice_fs.h> file, and at this writing the | ||
62 | source code (linux/drivers/usb/devio.c) is the primary reference | ||
63 | for how to access devices through those files. | ||
64 | |||
65 | Note that since by default these BBB/DDD files are writable only by | ||
66 | root, only root can write such user mode drivers. You can selectively | ||
67 | grant read/write permissions to other users by using "chmod". Also, | ||
68 | usbfs mount options such as "devmode=0666" may be helpful. | ||
69 | |||
70 | |||
71 | |||
72 | THE /proc/bus/usb/devices FILE: | ||
73 | ------------------------------- | ||
74 | In /proc/bus/usb/devices, each device's output has multiple | ||
75 | lines of ASCII output. | ||
76 | I made it ASCII instead of binary on purpose, so that someone | ||
77 | can obtain some useful data from it without the use of an | ||
78 | auxiliary program. However, with an auxiliary program, the numbers | ||
79 | in the first 4 columns of each "T:" line (topology info: | ||
80 | Lev, Prnt, Port, Cnt) can be used to build a USB topology diagram. | ||
81 | |||
82 | Each line is tagged with a one-character ID for that line: | ||
83 | |||
84 | T = Topology (etc.) | ||
85 | B = Bandwidth (applies only to USB host controllers, which are | ||
86 | virtualized as root hubs) | ||
87 | D = Device descriptor info. | ||
88 | P = Product ID info. (from Device descriptor, but they won't fit | ||
89 | together on one line) | ||
90 | S = String descriptors. | ||
91 | C = Configuration descriptor info. (* = active configuration) | ||
92 | I = Interface descriptor info. | ||
93 | E = Endpoint descriptor info. | ||
94 | |||
95 | ======================================================================= | ||
96 | |||
97 | /proc/bus/usb/devices output format: | ||
98 | |||
99 | Legend: | ||
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 | |||
105 | Topology info: | ||
106 | |||
107 | T: 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 | |||
124 | Bandwidth info: | ||
125 | B: 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 | |||
143 | Device descriptor info & Product ID info: | ||
144 | |||
145 | D: Ver=x.xx Cls=xx(s) Sub=xx Prot=xx MxPS=dd #Cfgs=dd | ||
146 | P: Vendor=xxxx ProdID=xxxx Rev=xx.xx | ||
147 | |||
148 | where | ||
149 | D: 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 | |||
158 | where | ||
159 | P: 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 | |||
166 | String descriptor info: | ||
167 | |||
168 | S: 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 | |||
175 | S: 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 | |||
182 | S: 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 | |||
191 | Configuration descriptor info: | ||
192 | |||
193 | C:* #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 | |||
214 | Interface descriptor info (can be multiple per Config): | ||
215 | |||
216 | I: 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 | |||
237 | Endpoint descriptor info (can be multiple per Interface): | ||
238 | |||
239 | E: 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 | |||
263 | If a user or script is interested only in Topology info, for | ||
264 | example, use something like "grep ^T: /proc/bus/usb/devices" | ||
265 | for only the Topology lines. A command like | ||
266 | "grep -i ^[tdp]: /proc/bus/usb/devices" can be used to list | ||
267 | only the lines that begin with the characters in square brackets, | ||
268 | where the valid characters are TDPCIE. With a slightly more able | ||
269 | script, it can display any selected lines (for example, only T, D, | ||
270 | and P lines) and change their output format. (The "procusb" | ||
271 | Perl script is the beginning of this idea. It will list only | ||
272 | selected lines [selected from TBDPSCIE] or "All" lines from | ||
273 | /proc/bus/usb/devices.) | ||
274 | |||
275 | The Topology lines can be used to generate a graphic/pictorial | ||
276 | of the USB devices on a system's root hub. (See more below | ||
277 | on how to do this.) | ||
278 | |||
279 | The Interface lines can be used to determine what driver is | ||
280 | being used for each device. | ||
281 | |||
282 | The Configuration lines could be used to list maximum power | ||
283 | (in milliamps) that a system's USB devices are using. | ||
284 | For example, "grep ^C: /proc/bus/usb/devices". | ||
285 | |||
286 | |||
287 | Here's an example, from a system which has a UHCI root hub, | ||
288 | an external hub connected to the root hub, and a mouse and | ||
289 | a serial converter connected to the external hub. | ||
290 | |||
291 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 | ||
292 | B: Alloc= 28/900 us ( 3%), #Int= 2, #Iso= 0 | ||
293 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
294 | P: Vendor=0000 ProdID=0000 Rev= 0.00 | ||
295 | S: Product=USB UHCI Root Hub | ||
296 | S: SerialNumber=dce0 | ||
297 | C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA | ||
298 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
299 | E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms | ||
300 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 | ||
301 | D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
302 | P: Vendor=0451 ProdID=1446 Rev= 1.00 | ||
303 | C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA | ||
304 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
305 | E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=255ms | ||
306 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 | ||
307 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
308 | P: Vendor=04b4 ProdID=0001 Rev= 0.00 | ||
309 | C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA | ||
310 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse | ||
311 | E: Ad=81(I) Atr=03(Int.) MxPS= 3 Ivl= 10ms | ||
312 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 | ||
313 | D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
314 | P: Vendor=0565 ProdID=0001 Rev= 1.08 | ||
315 | S: Manufacturer=Peracom Networks, Inc. | ||
316 | S: Product=Peracom USB to Serial Converter | ||
317 | C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA | ||
318 | I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial | ||
319 | E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl= 16ms | ||
320 | E: Ad=01(O) Atr=02(Bulk) MxPS= 16 Ivl= 16ms | ||
321 | E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl= 8ms | ||
322 | |||
323 | |||
324 | Selecting only the "T:" and "I:" lines from this (for example, by using | ||
325 | "procusb ti"), we have: | ||
326 | |||
327 | T: Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 | ||
328 | T: Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 4 | ||
329 | I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub | ||
330 | T: Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=1.5 MxCh= 0 | ||
331 | I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=mouse | ||
332 | T: Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 | ||
333 | I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial | ||
334 | |||
335 | |||
336 | Physically 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 | |||
359 | Or, in a more tree-like structure (ports [Connectors] without | ||
360 | connections could be omitted): | ||
361 | |||
362 | PC: 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 @@ | |||
1 | Copyright (C) 1999, 2000 Bruce Tenison | ||
2 | Portions Copyright (C) 1999, 2000 David Nelson | ||
3 | Thanks to David Nelson for guidance and the usage of the scanner.txt | ||
4 | and scanner.c files to model our driver and this informative file. | ||
5 | |||
6 | Mar. 2, 2000 | ||
7 | |||
8 | CHANGES | ||
9 | |||
10 | - Initial Revision | ||
11 | |||
12 | |||
13 | OVERVIEW | ||
14 | |||
15 | This README will address issues regarding how to configure the kernel | ||
16 | to access a RIO 500 mp3 player. | ||
17 | Before I explain how to use this to access the Rio500 please be warned: | ||
18 | |||
19 | W A R N I N G: | ||
20 | -------------- | ||
21 | |||
22 | Please note that this software is still under development. The authors | ||
23 | are in no way responsible for any damage that may occur, no matter how | ||
24 | inconsequential. | ||
25 | |||
26 | It seems that the Rio has a problem when sending .mp3 with low batteries. | ||
27 | I suggest when the batteries are low and want to transfer stuff that you | ||
28 | replace it with a fresh one. In my case, what happened is I lost two 16kb | ||
29 | blocks (they are no longer usable to store information to it). But I don't | ||
30 | know if thats normal or not. It could simply be a problem with the flash | ||
31 | memory. | ||
32 | |||
33 | In an extreme case, I left my Rio playing overnight and the batteries wore | ||
34 | down to nothing and appear to have corrupted the flash memory. My RIO | ||
35 | needed to be replaced as a result. Diamond tech support is aware of the | ||
36 | problem. Do NOT allow your batteries to wear down to nothing before | ||
37 | changing them. It appears RIO 500 firmware does not handle low battery | ||
38 | power well at all. | ||
39 | |||
40 | On systems with OHCI controllers, the kernel OHCI code appears to have | ||
41 | power on problems with some chipsets. If you are having problems | ||
42 | connecting to your RIO 500, try turning it on first and then plugging it | ||
43 | into the USB cable. | ||
44 | |||
45 | Contact 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 | |||
53 | Authors: | ||
54 | ------- | ||
55 | |||
56 | Most of the code was written by Cesar Miquel <miquel@df.uba.ar>. Keith | ||
57 | Clayton <kclayton@jps.net> is incharge of the PPC port and making sure | ||
58 | things work there. Bruce Tenison <btenison@dibbs.net> is adding support | ||
59 | for .fon files and also does testing. The program will mostly sure be | ||
60 | re-written and Pete Ikusz along with the rest will re-design it. I would | ||
61 | also like to thank Tri Nguyen <tmn_3022000@hotmail.com> who provided use | ||
62 | with some important information regarding the communication with the Rio. | ||
63 | |||
64 | ADDITIONAL INFORMATION and Userspace tools | ||
65 | |||
66 | http://rio500.sourceforge.net/ | ||
67 | |||
68 | |||
69 | REQUIREMENTS | ||
70 | |||
71 | A host with a USB port. Ideally, either a UHCI (Intel) or OHCI | ||
72 | (Compaq and others) hardware port should work. | ||
73 | |||
74 | A Linux development kernel (2.3.x) with USB support enabled or a | ||
75 | backported version to linux-2.2.x. See http://www.linux-usb.org for | ||
76 | more information on accomplishing this. | ||
77 | |||
78 | A Linux kernel with RIO 500 support enabled. | ||
79 | |||
80 | 'lspci' which is only needed to determine the type of USB hardware | ||
81 | available in your machine. | ||
82 | |||
83 | CONFIGURATION | ||
84 | |||
85 | Using `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 | |||
103 | Using `make menuconfig` or your preferred method for configuring the | ||
104 | kernel, select 'Support for USB', 'OHCI/UHCI' depending on your | ||
105 | hardware (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 | ||
108 | dependencies). | ||
109 | |||
110 | Add a device for the USB rio500: | ||
111 | `mknod /dev/usb/rio500 c 180 64` | ||
112 | |||
113 | Set appropriate permissions for /dev/usb/rio500 (don't forget about | ||
114 | group and world permissions). Both read and write permissions are | ||
115 | required for proper operation. | ||
116 | |||
117 | Load 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 | |||
129 | That's it. The Rio500 Utils at: http://rio500.sourceforge.net should | ||
130 | be able to access the rio500. | ||
131 | |||
132 | BUGS | ||
133 | |||
134 | If you encounter any problems feel free to drop me an email. | ||
135 | |||
136 | Bruce Tenison | ||
137 | btenison@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 @@ | |||
1 | Linux driver for SE401 based USB cameras | ||
2 | |||
3 | Copyright, 2001, Jeroen Vreeken | ||
4 | |||
5 | |||
6 | INTRODUCTION: | ||
7 | |||
8 | The SE401 chip is the used in low-cost usb webcams. | ||
9 | It is produced by Endpoints Inc. (www.endpoints.com). | ||
10 | It interfaces directly to a cmos image sensor and USB. The only other major | ||
11 | part in a se401 based camera is a dram chip. | ||
12 | |||
13 | The following cameras are known to work with this driver: | ||
14 | |||
15 | Aox se401 (non-branded) cameras | ||
16 | Philips PVCV665 USB VGA webcam 'Vesta Fun' | ||
17 | Kensington VideoCAM PC Camera Model 67014 | ||
18 | Kensington VideoCAM PC Camera Model 67015 | ||
19 | Kensington VideoCAM PC Camera Model 67016 | ||
20 | Kensington VideoCAM PC Camera Model 67017 | ||
21 | |||
22 | |||
23 | WHAT YOU NEED: | ||
24 | |||
25 | - USB support | ||
26 | - VIDEO4LINUX support | ||
27 | |||
28 | More information about USB support for linux can be found at: | ||
29 | http://www.linux-usb.org | ||
30 | |||
31 | |||
32 | MODULE OPTIONS: | ||
33 | |||
34 | When the driver is compiled as a module you can also use the 'flickerless' | ||
35 | option. With it exposure is limited to values that do not interfere with the | ||
36 | net frequency. Valid options for this option are 0, 50 and 60. (0=disable, | ||
37 | 50=50hz, 60=60hz) | ||
38 | |||
39 | |||
40 | KNOWN PROBLEMS: | ||
41 | |||
42 | The driver works fine with the usb-ohci and uhci host controller drivers, | ||
43 | the default settings also work with usb-uhci. But sending more than one bulk | ||
44 | transfer at a time with usb-uhci doesn't work yet. | ||
45 | Users of usb-ohci and uhci can safely enlarge SE401_NUMSBUF in se401.h in | ||
46 | order to increase the throughput (and thus framerate). | ||
47 | |||
48 | |||
49 | HELP: | ||
50 | |||
51 | The latest info on this driver can be found at: | ||
52 | http://www.chello.nl/~j.vreeken/se401/ | ||
53 | And questions to me can be send to: | ||
54 | pe1rxq@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 | |||
9 | Index | ||
10 | ===== | ||
11 | 1. Copyright | ||
12 | 2. Disclaimer | ||
13 | 3. License | ||
14 | 4. Overview and features | ||
15 | 5. Module dependencies | ||
16 | 6. Module loading | ||
17 | 7. Module parameters | ||
18 | 8. Optional device control through "sysfs" | ||
19 | 9. Supported devices | ||
20 | 10. How to add plug-in's for new image sensors | ||
21 | 11. Notes for V4L2 application developers | ||
22 | 12. Video frame formats | ||
23 | 13. Contact information | ||
24 | 14. Credits | ||
25 | |||
26 | |||
27 | 1. Copyright | ||
28 | ============ | ||
29 | Copyright (C) 2004-2005 by Luca Risolia <luca.risolia@studio.unibo.it> | ||
30 | |||
31 | |||
32 | 2. Disclaimer | ||
33 | ============= | ||
34 | SONiX is a trademark of SONiX Technology Company Limited, inc. | ||
35 | This software is not sponsored or developed by SONiX. | ||
36 | |||
37 | |||
38 | 3. License | ||
39 | ========== | ||
40 | This program is free software; you can redistribute it and/or modify | ||
41 | it under the terms of the GNU General Public License as published by | ||
42 | the Free Software Foundation; either version 2 of the License, or | ||
43 | (at your option) any later version. | ||
44 | |||
45 | This program is distributed in the hope that it will be useful, | ||
46 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
47 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
48 | GNU General Public License for more details. | ||
49 | |||
50 | You should have received a copy of the GNU General Public License | ||
51 | along with this program; if not, write to the Free Software | ||
52 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
53 | |||
54 | |||
55 | 4. Overview and features | ||
56 | ======================== | ||
57 | This driver attempts to support the video and audio streaming capabilities of | ||
58 | the devices mounting the SONiX SN9C101, SN9C102 and SN9C103 PC Camera | ||
59 | Controllers. | ||
60 | |||
61 | It's worth to note that SONiX has never collaborated with the author during the | ||
62 | development of this project, despite several requests for enough detailed | ||
63 | specifications of the register tables, compression engine and video data format | ||
64 | of the above chips. Nevertheless, these informations are no longer necessary, | ||
65 | becouse all the aspects related to these chips are known and have been | ||
66 | described in detail in this documentation. | ||
67 | |||
68 | The driver relies on the Video4Linux2 and USB core modules. It has been | ||
69 | designed to run properly on SMP systems as well. | ||
70 | |||
71 | The latest version of the SN9C10x driver can be found at the following URL: | ||
72 | http://www.linux-projects.org/ | ||
73 | |||
74 | Some 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 | |||
103 | 5. Module dependencies | ||
104 | ====================== | ||
105 | For it to work properly, the driver needs kernel support for Video4Linux and | ||
106 | USB. | ||
107 | |||
108 | The following options of the kernel configuration file must be enabled and | ||
109 | corresponding modules must be compiled: | ||
110 | |||
111 | # Multimedia devices | ||
112 | # | ||
113 | CONFIG_VIDEO_DEV=m | ||
114 | |||
115 | # USB support | ||
116 | # | ||
117 | CONFIG_USB=m | ||
118 | |||
119 | In addition, depending on the hardware being used, the modules below are | ||
120 | necessary: | ||
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 | |||
128 | And finally: | ||
129 | |||
130 | # USB Multimedia devices | ||
131 | # | ||
132 | CONFIG_USB_SN9C102=m | ||
133 | |||
134 | |||
135 | 6. Module loading | ||
136 | ================= | ||
137 | To use the driver, it is necessary to load the "sn9c102" module into memory | ||
138 | after every other module required: "videodev", "usbcore" and, depending on | ||
139 | the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd". | ||
140 | |||
141 | Loading can be done as shown below: | ||
142 | |||
143 | [root@localhost home]# modprobe sn9c102 | ||
144 | |||
145 | At this point the devices should be recognized. You can invoke "dmesg" to | ||
146 | analyze kernel messages and verify that the loading process has gone well: | ||
147 | |||
148 | [user@localhost home]$ dmesg | ||
149 | |||
150 | |||
151 | 7. Module parameters | ||
152 | ==================== | ||
153 | Module parameters are listed below: | ||
154 | ------------------------------------------------------------------------------- | ||
155 | Name: video_nr | ||
156 | Type: int array (min = 0, max = 64) | ||
157 | Syntax: <-1|n[,...]> | ||
158 | Description: 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. | ||
166 | Default: -1 | ||
167 | ------------------------------------------------------------------------------- | ||
168 | Name: force_munmap; | ||
169 | Type: bool array (min = 0, max = 64) | ||
170 | Syntax: <0|1[,...]> | ||
171 | Description: 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)" | ||
177 | Default: 0 | ||
178 | ------------------------------------------------------------------------------- | ||
179 | Name: debug | ||
180 | Type: int | ||
181 | Syntax: <n> | ||
182 | Description: 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. | ||
191 | Default: 2 | ||
192 | ------------------------------------------------------------------------------- | ||
193 | |||
194 | |||
195 | 8. Optional device control through "sysfs" [1] | ||
196 | ========================================== | ||
197 | It is possible to read and write both the SN9C10x and the image sensor | ||
198 | registers by using the "sysfs" filesystem interface. | ||
199 | |||
200 | Every time a supported device is recognized, a write-only file named "green" is | ||
201 | created in the /sys/class/video4linux/videoX directory. You can set the green | ||
202 | channel's gain by writing the desired value to it. The value may range from 0 | ||
203 | to 15 for SN9C101 or SN9C102 bridges, from 0 to 127 for SN9C103 bridges. | ||
204 | Similarly, only for SN9C103 controllers, blue and red gain control files are | ||
205 | available in the same directory, for which accepted values may range from 0 to | ||
206 | 127. | ||
207 | |||
208 | There 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 | ||
210 | SN9C10x 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 | ||
212 | reading/writing operations are addressed at through "val" and "i2c_val". Their | ||
213 | use is not intended for end-users. Note that "i2c_reg" and "i2c_val" will not | ||
214 | be created if the sensor does not actually support the standard I2C protocol or | ||
215 | its registers are not 8-bit long. Also, remember that you must be logged in as | ||
216 | root before writing to them. | ||
217 | |||
218 | As an example, suppose we were to want to read the value contained in the | ||
219 | register number 1 of the sensor register table - which is usually the product | ||
220 | identifier - 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 | |||
226 | Note that "cat" will fail if sensor registers cannot be read. | ||
227 | |||
228 | Now 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 | |||
233 | Note that the SN9C10x always returns 0 when some of its registers are read. | ||
234 | To avoid race conditions, all the I/O accesses to the above files are | ||
235 | serialized. | ||
236 | |||
237 | The sysfs interface also provides the "frame_header" entry, which exports the | ||
238 | frame header of the most recent requested and captured video frame. The header | ||
239 | is 12-bytes long and is appended to every video frame by the SN9C10x | ||
240 | controllers. As an example, this additional information can be used by the user | ||
241 | application for implementing auto-exposure features via software. | ||
242 | |||
243 | The following table describes the frame header: | ||
244 | |||
245 | Byte # Value Description | ||
246 | ------ ----- ----------- | ||
247 | 0x00 0xFF Frame synchronisation pattern. | ||
248 | 0x01 0xFF Frame synchronisation pattern. | ||
249 | 0x02 0x00 Frame synchronisation pattern. | ||
250 | 0x03 0xC4 Frame synchronisation pattern. | ||
251 | 0x04 0xC4 Frame synchronisation pattern. | ||
252 | 0x05 0x96 Frame synchronisation pattern. | ||
253 | 0x06 0x00 or 0x01 Unknown meaning. The exact value depends on the chip. | ||
254 | 0x07 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). | ||
258 | 0x08 0xXX Brightness sum inside Auto-Exposure area (low-byte). | ||
259 | 0x09 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. | ||
264 | 0x0A 0xXX Brightness sum outside Auto-Exposure area (low-byte). | ||
265 | 0x0B 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 | |||
271 | The AE area (sx, sy, ex, ey) in the active window can be set by programming the | ||
272 | registers 0x1c, 0x1d, 0x1e and 0x1f of the SN9C10x controllers, where one unit | ||
273 | corresponds to 32 pixels. | ||
274 | |||
275 | [1] The frame header has been documented by Bertrik Sikken. | ||
276 | |||
277 | |||
278 | 9. Supported devices | ||
279 | ==================== | ||
280 | None of the names of the companies as well as their products will be mentioned | ||
281 | here. They have never collaborated with the author, so no advertising. | ||
282 | |||
283 | From the point of view of a driver, what unambiguously identify a device are | ||
284 | its vendor and product USB identifiers. Below is a list of known identifiers of | ||
285 | devices mounting the SN9C10x PC camera controllers: | ||
286 | |||
287 | Vendor ID Product ID | ||
288 | --------- ---------- | ||
289 | 0x0c45 0x6001 | ||
290 | 0x0c45 0x6005 | ||
291 | 0x0c45 0x6009 | ||
292 | 0x0c45 0x600d | ||
293 | 0x0c45 0x6024 | ||
294 | 0x0c45 0x6025 | ||
295 | 0x0c45 0x6028 | ||
296 | 0x0c45 0x6029 | ||
297 | 0x0c45 0x602a | ||
298 | 0x0c45 0x602b | ||
299 | 0x0c45 0x602c | ||
300 | 0x0c45 0x6030 | ||
301 | 0x0c45 0x6080 | ||
302 | 0x0c45 0x6082 | ||
303 | 0x0c45 0x6083 | ||
304 | 0x0c45 0x6088 | ||
305 | 0x0c45 0x608a | ||
306 | 0x0c45 0x608b | ||
307 | 0x0c45 0x608c | ||
308 | 0x0c45 0x608e | ||
309 | 0x0c45 0x608f | ||
310 | 0x0c45 0x60a0 | ||
311 | 0x0c45 0x60a2 | ||
312 | 0x0c45 0x60a3 | ||
313 | 0x0c45 0x60a8 | ||
314 | 0x0c45 0x60aa | ||
315 | 0x0c45 0x60ab | ||
316 | 0x0c45 0x60ac | ||
317 | 0x0c45 0x60ae | ||
318 | 0x0c45 0x60af | ||
319 | 0x0c45 0x60b0 | ||
320 | 0x0c45 0x60b2 | ||
321 | 0x0c45 0x60b3 | ||
322 | 0x0c45 0x60b8 | ||
323 | 0x0c45 0x60ba | ||
324 | 0x0c45 0x60bb | ||
325 | 0x0c45 0x60bc | ||
326 | 0x0c45 0x60be | ||
327 | |||
328 | The list above does not imply that all those devices work with this driver: up | ||
329 | until now only the ones that mount the following image sensors are supported; | ||
330 | kernel messages will always tell you whether this is the case: | ||
331 | |||
332 | Model Manufacturer | ||
333 | ----- ------------ | ||
334 | HV7131D Hynix Semiconductor, Inc. | ||
335 | MI-0343 Micron Technology, Inc. | ||
336 | PAS106B PixArt Imaging, Inc. | ||
337 | PAS202BCB PixArt Imaging, Inc. | ||
338 | TAS5110C1B Taiwan Advanced Sensor Corporation | ||
339 | TAS5130D1B Taiwan Advanced Sensor Corporation | ||
340 | |||
341 | All the available control settings of each image sensor are supported through | ||
342 | the V4L2 interface. | ||
343 | |||
344 | Donations of new models for further testing and support would be much | ||
345 | appreciated. Non-available hardware will not be supported by the author of this | ||
346 | driver. | ||
347 | |||
348 | |||
349 | 10. How to add plug-in's for new image sensors | ||
350 | ============================================== | ||
351 | It should be easy to write plug-in's for new sensors by using the small API | ||
352 | that 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 | |||
356 | At the moment, possible unsupported image sensors are: CIS-VF10 (VGA), | ||
357 | OV7620 (VGA), OV7630 (VGA). | ||
358 | |||
359 | |||
360 | 11. Notes for V4L2 application developers | ||
361 | ========================================= | ||
362 | This driver follows the V4L2 API specifications. In particular, it enforces two | ||
363 | rules: | ||
364 | |||
365 | - exactly one I/O method, either "mmap" or "read", is associated with each | ||
366 | file descriptor. Once it is selected, the application must close and reopen the | ||
367 | device to switch to the other I/O method; | ||
368 | |||
369 | - although it is not mandatory, previously mapped buffer memory should always | ||
370 | be unmapped before calling any "VIDIOC_S_CROP" or "VIDIOC_S_FMT" ioctl's. | ||
371 | The same number of buffers as before will be allocated again to match the size | ||
372 | of the new video frames, so you have to map the buffers again before any I/O | ||
373 | attempts on them. | ||
374 | |||
375 | Consistently with the hardware limits, this driver also supports image | ||
376 | downscaling with arbitrary scaling factors from 1, 2 and 4 in both directions. | ||
377 | However, the V4L2 API specifications don't correctly define how the scaling | ||
378 | factor can be chosen arbitrarily by the "negotiation" of the "source" and | ||
379 | "target" rectangles. To work around this flaw, we have added the convention | ||
380 | that, during the negotiation, whenever the "VIDIOC_S_CROP" ioctl is issued, the | ||
381 | scaling factor is restored to 1. | ||
382 | |||
383 | This driver supports two different video formats: the first one is the "8-bit | ||
384 | Sequential Bayer" format and can be used to obtain uncompressed video data | ||
385 | from 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 | ||
387 | compressed data). The compression quality may vary from 0 to 1 and can be | ||
388 | selected or queried thanks to the VIDIOC_S_JPEGCOMP and VIDIOC_G_JPEGCOMP V4L2 | ||
389 | ioctl's. For maximum flexibility, both the default active video format and the | ||
390 | default compression quality depend on how the image sensor being used is | ||
391 | initialized (as described in the documentation of the API for the image sensors | ||
392 | supplied by this driver). | ||
393 | |||
394 | |||
395 | 12. Video frame formats [1] | ||
396 | ======================= | ||
397 | The SN9C10x PC Camera Controllers can send images in two possible video | ||
398 | formats over the USB: either native "Sequential RGB Bayer" or Huffman | ||
399 | compressed. The latter is used to achieve high frame rates. The current video | ||
400 | format may be selected or queried from the user application by calling the | ||
401 | VIDIOC_S_FMT or VIDIOC_G_FMT ioctl's, as described in the V4L2 API | ||
402 | specifications. | ||
403 | |||
404 | The name "Sequential Bayer" indicates the organization of the red, green and | ||
405 | blue pixels in one video frame. Each pixel is associated with a 8-bit long | ||
406 | value and is disposed in memory according to the pattern shown below: | ||
407 | |||
408 | B[0] G[1] B[2] G[3] ... B[m-2] G[m-1] | ||
409 | G[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 | |||
414 | The above matrix also represents the sequential or progressive read-out mode of | ||
415 | the (n, m) Bayer color filter array used in many CCD/CMOS image sensors. | ||
416 | |||
417 | One compressed video frame consists of a bitstream that encodes for every R, G, | ||
418 | or B pixel the difference between the value of the pixel itself and some | ||
419 | reference pixel value. Pixels are organised in the Bayer pattern and the Bayer | ||
420 | sub-pixels are tracked individually and alternatingly. For example, in the | ||
421 | first line values for the B and G1 pixels are alternatingly encoded, while in | ||
422 | the second line values for the G2 and R pixels are alternatingly encoded. | ||
423 | |||
424 | The 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 | |||
437 | The algorithm purely describes the conversion from compressed Bayer code used | ||
438 | in the SN9C10x chips to uncompressed Bayer. Additional steps are required to | ||
439 | convert this to a color image (i.e. a color interpolation algorithm). | ||
440 | |||
441 | The following Huffman codes have been found: | ||
442 | 0: +0 (relative to reference pixel value) | ||
443 | 100: +4 | ||
444 | 101: -4? | ||
445 | 1110xxxx: set absolute value to xxxx.0000 | ||
446 | 1101: +11 | ||
447 | 1111: -11 | ||
448 | 11001: +20 | ||
449 | 110000: -20 | ||
450 | 110001: ??? - 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 | |||
456 | 13. Contact information | ||
457 | ======================= | ||
458 | The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>. | ||
459 | |||
460 | GPG/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; | ||
462 | the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. | ||
463 | |||
464 | |||
465 | 14. Credits | ||
466 | =========== | ||
467 | Many thanks to following persons for their contribute (listed in alphabetical | ||
468 | order): | ||
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 @@ | |||
1 | Linux driver for STV0680 based USB cameras | ||
2 | |||
3 | Copyright, 2001, Kevin Sisson | ||
4 | |||
5 | |||
6 | INTRODUCTION: | ||
7 | |||
8 | STMicroelectronics produces the STV0680B chip, which comes in two | ||
9 | types, -001 and -003. The -003 version allows the recording and downloading | ||
10 | of sound clips from the camera, and allows a flash attachment. Otherwise, | ||
11 | it uses the same commands as the -001 version. Both versions support a | ||
12 | variety of SDRAM sizes and sensors, allowing for a maximum of 26 VGA or 20 | ||
13 | CIF pictures. The STV0680 supports either a serial or a usb interface, and | ||
14 | video is possible through the usb interface. | ||
15 | |||
16 | The following cameras are known to work with this driver, although any | ||
17 | camera with Vendor/Product codes of 0553/0202 should work: | ||
18 | |||
19 | Aiptek Pencam (various models) | ||
20 | Nisis QuickPix 2 | ||
21 | Radio Shack 'Kid's digital camera' (#60-1207) | ||
22 | At least one Trust Spycam model | ||
23 | Several other European brand models | ||
24 | |||
25 | WHAT YOU NEED: | ||
26 | |||
27 | - USB support | ||
28 | - VIDEO4LINUX support | ||
29 | |||
30 | More information about USB support for linux can be found at: | ||
31 | http://www.linux-usb.org | ||
32 | |||
33 | |||
34 | MODULE OPTIONS: | ||
35 | |||
36 | When the driver is compiled as a module, you can set a "swapRGB=1" | ||
37 | option, if necessary, for those applications that require it | ||
38 | (such as xawtv). However, the driver should detect and set this | ||
39 | automatically, so this option should not normally be used. | ||
40 | |||
41 | |||
42 | KNOWN PROBLEMS: | ||
43 | |||
44 | The driver seems to work better with the usb-ohci than the usb-uhci host | ||
45 | controller driver. | ||
46 | |||
47 | HELP: | ||
48 | |||
49 | The latest info on this driver can be found at: | ||
50 | http://personal.clt.bellsouth.net/~kjsisson or at | ||
51 | http://stv0680-usb.sourceforge.net | ||
52 | |||
53 | Any 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 @@ | |||
1 | Specification 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 | |||
11 | This document and the new uhci sources can be found on | ||
12 | http://hotswap.in.tum.de/usb | ||
13 | |||
14 | 1. General issues | ||
15 | |||
16 | 1.1 Why a new UHCI driver, we already have one?!? | ||
17 | |||
18 | Correct, but its internal structure got more and more mixed up by the (still | ||
19 | ongoing) efforts to get isochronous transfers (ISO) to work. | ||
20 | Since there is an increasing need for reliable ISO-transfers (especially | ||
21 | for USB-audio needed by TS and for a DAB-USB-Receiver build by GA and DF), | ||
22 | this state was a bit unsatisfying in our opinion, so we've decided (based | ||
23 | on knowledge and experiences with the old UHCI driver) to start | ||
24 | from scratch with a new approach, much simpler but at the same time more | ||
25 | powerful. | ||
26 | It is inspired by the way Win98/Win2000 handles USB requests via URBs, | ||
27 | but it's definitely 100% free of MS-code and doesn't crash while | ||
28 | unplugging an used ISO-device like Win98 ;-) | ||
29 | Some code for HW setup and root hub management was taken from the | ||
30 | original UHCI driver, but heavily modified to fit into the new code. | ||
31 | The invention of the basic concept, and major coding were completed in two | ||
32 | days (and nights) on the 16th and 17th of October 1999, now known as the | ||
33 | great USB-October-Revolution started by GA, DF, and TS ;-) | ||
34 | |||
35 | Since the concept is in no way UHCI dependent, we hope that it will also be | ||
36 | transferred to the OHCI-driver, so both drivers share a common API. | ||
37 | |||
38 | 1.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 | |||
52 | 1.3. Is there some compatibility to the old API? | ||
53 | |||
54 | Yes, but only for control, bulk and interrupt transfers. We've implemented | ||
55 | some wrapper calls for these transfer types. The usbcore works fine with | ||
56 | these wrappers. For ISO there's no compatibility, because the old ISO-API | ||
57 | and its semantics were unnecessary complicated in our opinion. | ||
58 | |||
59 | 1.4. What's really working? | ||
60 | |||
61 | As said above, CTRL and BULK already work fine even with the wrappers, | ||
62 | so legacy code wouldn't notice the change. | ||
63 | Regarding to Thomas, ISO transfers now run stable with USB audio. | ||
64 | INT transfers (e.g. mouse driver) work fine, too. | ||
65 | |||
66 | 1.5. Are there any bugs? | ||
67 | |||
68 | No ;-) | ||
69 | Hm... | ||
70 | Well, of course this implementation needs extensive testing on all available | ||
71 | hardware, but we believe that any fixes shouldn't harm the overall concept. | ||
72 | |||
73 | 1.6. What should be done next? | ||
74 | |||
75 | A large part of the request handling seems to be identical for UHCI and | ||
76 | OHCI, so it would be a good idea to extract the common parts and have only | ||
77 | the HW specific stuff in uhci.c. Furthermore, all other USB device drivers | ||
78 | should need URBification, if they use isochronous or interrupt transfers. | ||
79 | One thing missing in the current implementation (and the old UHCI driver) | ||
80 | is fair queueing for BULK transfers. Since this would need (in principle) | ||
81 | the alteration of already constructed TD chains (to switch from depth to | ||
82 | breadth execution), another way has to be found. Maybe some simple | ||
83 | heuristics work with the same effect. | ||
84 | |||
85 | --------------------------------------------------------------------------- | ||
86 | |||
87 | 2. Internal structure and mechanisms | ||
88 | |||
89 | To get quickly familiar with the internal structures, here's a short | ||
90 | description how the new UHCI driver works. However, the ultimate source of | ||
91 | truth is only uhci.c! | ||
92 | |||
93 | 2.1. Descriptor structure (QHs and TDs) | ||
94 | |||
95 | During initialization, the following skeleton is allocated in init_skel: | ||
96 | |||
97 | framespecific | common chain | ||
98 | |||
99 | framelist[] | ||
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 | |||
109 | For each CTRL or BULK transfer a new QH is allocated and the containing data | ||
110 | transfers are appended as (vertical) TDs. After building the whole QH with its | ||
111 | dangling TDs, the QH is inserted before the BULK Chain QH (for CTRL) or | ||
112 | before the End Chain QH (for BULK). Since only the QH->next pointers are | ||
113 | affected, no atomic memory operation is required. The three QHs in the | ||
114 | common chain are never equipped with TDs! | ||
115 | |||
116 | For ISO or INT, the TD for each frame is simply inserted into the appropriate | ||
117 | ISO/INT-TD-chain for the desired frame. The 7 skeleton INT-TDs are scattered | ||
118 | among the 1024 frames similar to the old UHCI driver. | ||
119 | |||
120 | For CTRL/BULK/ISO, the last TD in the transfer has the IOC-bit set. For INT, | ||
121 | every TD (there is only one...) has the IOC-bit set. | ||
122 | |||
123 | Besides the data for the UHCI controller (2 or 4 32bit words), the descriptors | ||
124 | are double-linked through the .vertical and .horizontal elements in the | ||
125 | SW data of the descriptor (using the double-linked list structures and | ||
126 | operations), but SW-linking occurs only in closed domains, i.e. for each of | ||
127 | the 1024 ISO-chains and the 8 INT-chains there is a closed cycle. This | ||
128 | simplifies all insertions and unlinking operations and avoids costly | ||
129 | bus_to_virt()-calls. | ||
130 | |||
131 | 2.2. URB structure and linking to QH/TDs | ||
132 | |||
133 | During assembly of the QH and TDs of the requested action, these descriptors | ||
134 | are stored in urb->urb_list, so the allocated QH/TD descriptors are bound to | ||
135 | this URB. | ||
136 | If the assembly was successful and the descriptors were added to the HW chain, | ||
137 | the corresponding URB is inserted into a global URB list for this controller. | ||
138 | This list stores all pending URBs. | ||
139 | |||
140 | 2.3. Interrupt processing | ||
141 | |||
142 | Since UHCI provides no means to directly detect completed transactions, the | ||
143 | following is done in each UHCI interrupt (uhci_interrupt()): | ||
144 | |||
145 | For each URB in the pending queue (process_urb()), the ACTIVE-flag of the | ||
146 | associated TDs are processed (depending on the transfer type | ||
147 | process_{transfer|interrupt|iso}()). If the TDs are not active anymore, | ||
148 | they indicate the completion of the transaction and the status is calculated. | ||
149 | Inactive QH/TDs are removed from the HW chain (since the host controller | ||
150 | already removed the TDs from the QH, no atomic access is needed) and | ||
151 | eventually the URB is marked as completed (OK or errors) and removed from the | ||
152 | pending queue. Then the next linked URB is submitted. After (or immediately | ||
153 | before) that, the completion handler is called. | ||
154 | |||
155 | 2.4. Unlinking URBs | ||
156 | |||
157 | First, all QH/TDs stored in the URB are unlinked from the HW chain. | ||
158 | To ensure that the host controller really left a vertical TD chain, we | ||
159 | wait for one frame. After that, the TDs are physically destroyed. | ||
160 | |||
161 | 2.5. URB linking and the consequences | ||
162 | |||
163 | Since URBs can be linked and the corresponding submit_urb is called in | ||
164 | the UHCI-interrupt, all work associated with URB/QH/TD assembly has to be | ||
165 | interrupt 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 @@ | |||
1 | usb-help.txt | ||
2 | 2000-July-12 | ||
3 | |||
4 | For USB help other than the readme files that are located in | ||
5 | Documentation/usb/*, see the following: | ||
6 | |||
7 | Linux-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 | ||
11 | Linux USB Guide: http://linux-usb.sourceforge.net | ||
12 | Linux-USB device overview (working devices and drivers): | ||
13 | http://www.qbik.ch/usb/devices/ | ||
14 | |||
15 | The 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 @@ | |||
1 | INTRODUCTION | ||
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 | |||
11 | CONFIGURATION | ||
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 | |||
38 | SPECIFIC DEVICES SUPPORTED | ||
39 | |||
40 | |||
41 | ConnectTech 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 | |||
53 | HandSpring 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 | |||
97 | PocketPC 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 | |||
148 | Keyspan 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 | |||
176 | Keyspan 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 | |||
198 | FTDI 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 | |||
208 | ZyXEL 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 | |||
214 | Cypress 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 | |||
270 | Digi 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 | |||
291 | Belkin 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 | |||
327 | Empeg 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 | |||
341 | MCT 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 | |||
361 | Inside 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 | |||
386 | REINER 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 | |||
400 | Prolific 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 | |||
411 | KL5KUSB105 chipset / PalmConnect USB single-port adapter | ||
412 | |||
413 | Current 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 | |||
424 | Options 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 | |||
437 | Generic 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 | |||
460 | CONTACT: | ||
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 | |||
469 | Greg Kroah-Hartman | ||
470 | greg@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 | |||
3 | The name "usbmon" in lowercase refers to a facility in kernel which is | ||
4 | used to collect traces of I/O on the USB bus. This function is analogous | ||
5 | to a packet socket used by network monitoring tools such as tcpdump(1) | ||
6 | or Ethereal. Similarly, it is expected that a tool such as usbdump or | ||
7 | USBMon (with uppercase letters) is used to examine raw traces produced | ||
8 | by usbmon. | ||
9 | |||
10 | The usbmon reports requests made by peripheral-specific drivers to Host | ||
11 | Controller Drivers (HCD). So, if HCD is buggy, the traces reported by | ||
12 | usbmon may not correspond to bus transactions precisely. This is the same | ||
13 | situation as with tcpdump. | ||
14 | |||
15 | * How to use usbmon to collect raw text traces | ||
16 | |||
17 | Unlike the packet socket, usbmon has an interface which provides traces | ||
18 | in a text format. This is used for two purposes. First, it serves as a | ||
19 | common trace exchange format for tools while most sophisticated formats | ||
20 | are finalized. Second, humans can read it in case tools are not available. | ||
21 | |||
22 | To collect a raw text trace, execute following steps. | ||
23 | |||
24 | 1. Prepare | ||
25 | |||
26 | Mount debugfs (it has to be enabled in your kernel configuration), and | ||
27 | load the usbmon module (if built as module). The second step is skipped | ||
28 | if usbmon is built into the kernel. | ||
29 | |||
30 | # mount -t debugfs none_debugs /sys/kernel/debug | ||
31 | # modprobe usbmon | ||
32 | |||
33 | Verify that bus sockets are present. | ||
34 | |||
35 | [root@lembas zaitcev]# ls /sys/kernel/debug/usbmon | ||
36 | 1s 1t 2s 2t 3s 3t 4s 4t | ||
37 | [root@lembas zaitcev]# | ||
38 | |||
39 | # ls /sys/kernel | ||
40 | |||
41 | 2. Find which bus connects to the desired device | ||
42 | |||
43 | Run "cat /proc/bus/usb/devices", and find the T-line which corresponds to | ||
44 | the device. Usually you do it by looking for the vendor string. If you have | ||
45 | many similar devices, unplug one and compare two /proc/bus/usb/devices outputs. | ||
46 | The T-line will have a bus number. Example: | ||
47 | |||
48 | T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 | ||
49 | D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 | ||
50 | P: Vendor=0557 ProdID=2004 Rev= 1.00 | ||
51 | S: Manufacturer=ATEN | ||
52 | S: Product=UC100KM V2.00 | ||
53 | |||
54 | Bus=03 means it's bus 3. | ||
55 | |||
56 | 3. Start 'cat' | ||
57 | |||
58 | # cat /sys/kernel/debug/usbmon/3t > /tmp/1.mon.out | ||
59 | |||
60 | This process will be reading until killed. Naturally, the output can be | ||
61 | redirected to a desirable location. This is preferred, because it is going | ||
62 | to be quite long. | ||
63 | |||
64 | 4. Perform the desired operation on the USB bus | ||
65 | |||
66 | This is where you do something that creates the traffic: plug in a flash key, | ||
67 | copy files, control a webcam, etc. | ||
68 | |||
69 | 5. Kill cat | ||
70 | |||
71 | Usually it's done with a keyboard interrupt (Control-C). | ||
72 | |||
73 | At this point the output file (/tmp/1.mon.out in this example) can be saved, | ||
74 | sent by e-mail, or inspected with a text editor. In the last case make sure | ||
75 | that the file size is not excessive for your favourite editor. | ||
76 | |||
77 | * Raw text data format | ||
78 | |||
79 | The '0t' type data consists of a stream of events, such as URB submission, | ||
80 | URB callback, submission error. Every event is a text line, which consists | ||
81 | of whitespace separated words. The number of position of words may depend | ||
82 | on the event type, but there is a set of words, common for all types. | ||
83 | |||
84 | Here 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 | |||
113 | Here is an example of code to read the data stream in a well known programming | ||
114 | language: | ||
115 | |||
116 | class 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 | |||
138 | This format is obviously deficient. For example, the setup packet for control | ||
139 | transfers is not delivered. This will change in the future. | ||
140 | |||
141 | Examples: | ||
142 | |||
143 | An input control transfer to get a port status: | ||
144 | |||
145 | d74ff9a0 2640288196 S Ci:001:00 -115 4 < | ||
146 | d74ff9a0 2640288202 C Ci:001:00 0 4 = 01010100 | ||
147 | |||
148 | An output bulk transfer to send a SCSI command 0x5E in a 31-byte Bulk wrapper | ||
149 | to a storage device at address 5: | ||
150 | |||
151 | dd65f0e8 4128379752 S Bo:005:02 -115 31 = 55534243 5e000000 00000000 00000600 00000000 00000000 00000000 000000 | ||
152 | dd65f0e8 4128379808 C Bo:005:02 0 31 > | ||
153 | |||
154 | * Raw binary format and API | ||
155 | |||
156 | TBD | ||
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 | |||
9 | Index | ||
10 | ===== | ||
11 | 1. Copyright | ||
12 | 2. Disclaimer | ||
13 | 3. License | ||
14 | 4. Overview | ||
15 | 5. Supported devices | ||
16 | 6. Module dependencies | ||
17 | 7. Module loading | ||
18 | 8. Module paramaters | ||
19 | 9. Contact information | ||
20 | 10. Credits | ||
21 | |||
22 | |||
23 | 1. Copyright | ||
24 | ============ | ||
25 | Copyright (C) 2002-2004 by Luca Risolia <luca.risolia@studio.unibo.it> | ||
26 | |||
27 | |||
28 | 2. Disclaimer | ||
29 | ============= | ||
30 | Winbond is a trademark of Winbond Electronics Corporation. | ||
31 | This software is not sponsored or developed by Winbond. | ||
32 | |||
33 | |||
34 | 3. License | ||
35 | ========== | ||
36 | This program is free software; you can redistribute it and/or modify | ||
37 | it under the terms of the GNU General Public License as published by | ||
38 | the Free Software Foundation; either version 2 of the License, or | ||
39 | (at your option) any later version. | ||
40 | |||
41 | This program is distributed in the hope that it will be useful, | ||
42 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
43 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
44 | GNU General Public License for more details. | ||
45 | |||
46 | You should have received a copy of the GNU General Public License | ||
47 | along with this program; if not, write to the Free Software | ||
48 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
49 | |||
50 | |||
51 | 4. Overview | ||
52 | =========== | ||
53 | This driver supports the video streaming capabilities of the devices mounting | ||
54 | Winbond W9967CF and Winbond W9968CF JPEG USB Dual Mode Camera Chips. OV681 | ||
55 | based cameras should be supported as well. | ||
56 | |||
57 | The driver is divided into two modules: the basic one, "w9968cf", is needed for | ||
58 | the supported devices to work; the second one, "w9968cf-vpp", is an optional | ||
59 | module, which provides some useful video post-processing functions like video | ||
60 | decoding, up-scaling and colour conversions. Once the driver is installed, | ||
61 | every time an application tries to open a recognized device, "w9968cf" checks | ||
62 | the presence of the "w9968cf-vpp" module and loads it automatically by default. | ||
63 | |||
64 | Please keep in mind that official kernels do not include the second module for | ||
65 | performance purposes. However it is always recommended to download and install | ||
66 | the latest and complete release of the driver, replacing the existing one, if | ||
67 | present: it will be still even possible not to load the "w9968cf-vpp" module at | ||
68 | all, if you ever want to. Another important missing feature of the version in | ||
69 | the official Linux 2.4 kernels is the writeable /proc filesystem interface. | ||
70 | |||
71 | The latest and full-featured version of the W996[87]CF driver can be found at: | ||
72 | http://www.linux-projects.org. Please refer to the documentation included in | ||
73 | that package, if you are going to use it. | ||
74 | |||
75 | Up to 32 cameras can be handled at the same time. They can be connected and | ||
76 | disconnected from the host many times without turning off the computer, if | ||
77 | your system supports the hotplug facility. | ||
78 | |||
79 | To change the default settings for each camera, many parameters can be passed | ||
80 | through command line when the module is loaded into memory. | ||
81 | |||
82 | The driver relies on the Video4Linux, USB and I2C core modules. It has been | ||
83 | designed to run properly on SMP systems as well. An additional module, | ||
84 | "ovcamchip", is mandatory; it provides support for some OmniVision image | ||
85 | sensors connected to the W996[87]CF chips; if found in the system, the module | ||
86 | will be automatically loaded by default (provided that the kernel has been | ||
87 | compiled with the automatic module loading option). | ||
88 | |||
89 | |||
90 | 5. Supported devices | ||
91 | ==================== | ||
92 | At 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 | |||
104 | If you know any other W996[87]CF or OV681 based cameras, please contact me. | ||
105 | |||
106 | The list above does not imply that all those devices work with this driver: up | ||
107 | until now only webcams that have an image sensor supported by the "ovcamchip" | ||
108 | module work. Kernel messages will always tell you whether this is case. | ||
109 | |||
110 | Possible external microcontrollers of those webcams are not supported: this | ||
111 | means that still images cannot be downloaded from the device memory. | ||
112 | |||
113 | Furthermore, 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 | ||
115 | additional testing and full support, would be much appreciated. | ||
116 | |||
117 | |||
118 | 6. Module dependencies | ||
119 | ====================== | ||
120 | For it to work properly, the driver needs kernel support for Video4Linux, USB | ||
121 | and I2C, and the "ovcamchip" module for the image sensor. Make sure you are not | ||
122 | actually using any external "ovcamchip" module, given that the W996[87]CF | ||
123 | driver depends on the version of the module present in the official kernels. | ||
124 | |||
125 | The following options of the kernel configuration file must be enabled and | ||
126 | corresponding modules must be compiled: | ||
127 | |||
128 | # Multimedia devices | ||
129 | # | ||
130 | CONFIG_VIDEO_DEV=m | ||
131 | |||
132 | # I2C support | ||
133 | # | ||
134 | CONFIG_I2C=m | ||
135 | |||
136 | The 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 | |||
146 | In addition, depending on the hardware being used, only one of the modules | ||
147 | below 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 | |||
155 | And finally: | ||
156 | |||
157 | # USB Multimedia devices | ||
158 | # | ||
159 | CONFIG_USB_W9968CF=m | ||
160 | |||
161 | |||
162 | 7. Module loading | ||
163 | ================= | ||
164 | To use the driver, it is necessary to load the "w9968cf" module into memory | ||
165 | after every other module required. | ||
166 | |||
167 | Loading 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 | |||
174 | At this point the pertinent devices should be recognized: "dmesg" can be used | ||
175 | to analyze kernel messages: | ||
176 | |||
177 | [user@localhost home]$ dmesg | ||
178 | |||
179 | There are a lot of parameters the module can use to change the default | ||
180 | settings for each device. To list every possible parameter with a brief | ||
181 | explanation 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 | |||
187 | 8. Module parameters | ||
188 | ==================== | ||
189 | Module parameters are listed below: | ||
190 | ------------------------------------------------------------------------------- | ||
191 | Name: ovmod_load | ||
192 | Type: bool | ||
193 | Syntax: <0|1> | ||
194 | Description: 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. | ||
199 | Default: 1 | ||
200 | Note: 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 | ------------------------------------------------------------------------------- | ||
204 | Name: vppmod_load | ||
205 | Type: bool | ||
206 | Syntax: <0|1> | ||
207 | Description: 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. | ||
215 | Default: 1 | ||
216 | Note: 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 | ------------------------------------------------------------------------------- | ||
220 | Name: simcams | ||
221 | Type: int | ||
222 | Syntax: <n> | ||
223 | Description: Number of cameras allowed to stream simultaneously. | ||
224 | n may vary from 0 to 32. | ||
225 | Default: 32 | ||
226 | ------------------------------------------------------------------------------- | ||
227 | Name: video_nr | ||
228 | Type: int array (min = 0, max = 32) | ||
229 | Syntax: <-1|n[,...]> | ||
230 | Description: 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. | ||
238 | Default: -1 | ||
239 | ------------------------------------------------------------------------------- | ||
240 | Name: packet_size | ||
241 | Type: int array (min = 0, max = 32) | ||
242 | Syntax: <n[,...]> | ||
243 | Description: Specify the maximum data payload size in bytes for alternate | ||
244 | settings, for each device. n is scaled between 63 and 1023. | ||
245 | Default: 1023 | ||
246 | ------------------------------------------------------------------------------- | ||
247 | Name: max_buffers | ||
248 | Type: int array (min = 0, max = 32) | ||
249 | Syntax: <n[,...]> | ||
250 | Description: For advanced users. | ||
251 | Specify the maximum number of video frame buffers to allocate | ||
252 | for each device, from 2 to 32. | ||
253 | Default: 2 | ||
254 | ------------------------------------------------------------------------------- | ||
255 | Name: double_buffer | ||
256 | Type: bool array (min = 0, max = 32) | ||
257 | Syntax: <0|1[,...]> | ||
258 | Description: 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. | ||
262 | Default: 1 for every device. | ||
263 | ------------------------------------------------------------------------------- | ||
264 | Name: clamping | ||
265 | Type: bool array (min = 0, max = 32) | ||
266 | Syntax: <0|1[,...]> | ||
267 | Description: Video data clamping: 0 disabled, 1 enabled. | ||
268 | Default: 0 for every device. | ||
269 | ------------------------------------------------------------------------------- | ||
270 | Name: filter_type | ||
271 | Type: int array (min = 0, max = 32) | ||
272 | Syntax: <0|1|2[,...]> | ||
273 | Description: 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. | ||
277 | Default: 0 for every device. | ||
278 | ------------------------------------------------------------------------------- | ||
279 | Name: largeview | ||
280 | Type: bool array (min = 0, max = 32) | ||
281 | Syntax: <0|1[,...]> | ||
282 | Description: Large view: 0 disabled, 1 enabled. | ||
283 | Default: 1 for every device. | ||
284 | ------------------------------------------------------------------------------- | ||
285 | Name: upscaling | ||
286 | Type: bool array (min = 0, max = 32) | ||
287 | Syntax: <0|1[,...]> | ||
288 | Description: 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. | ||
292 | Default: 0 for every device. | ||
293 | Note: If 'w9968cf-vpp' is not present, this parameter is set to 0. | ||
294 | ------------------------------------------------------------------------------- | ||
295 | Name: decompression | ||
296 | Type: int array (min = 0, max = 32) | ||
297 | Syntax: <0|1|2[,...]> | ||
298 | Description: 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. | ||
307 | Default: 2 for every device. | ||
308 | Note: If 'w9968cf-vpp' is not present, forcing decompression is not | ||
309 | allowed; in this case this parameter is set to 2. | ||
310 | ------------------------------------------------------------------------------- | ||
311 | Name: force_palette | ||
312 | Type: int array (min = 0, max = 32) | ||
313 | Syntax: <0|9|10|13|15|8|7|1|6|3|4|5[,...]> | ||
314 | Description: 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'. | ||
329 | Default: 0 for every device. Initial palette is 9 (UYVY). | ||
330 | Note: If 'w9968cf-vpp' is not present, this parameter is set to 9. | ||
331 | ------------------------------------------------------------------------------- | ||
332 | Name: force_rgb | ||
333 | Type: bool array (min = 0, max = 32) | ||
334 | Syntax: <0|1[,...]> | ||
335 | Description: 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. | ||
339 | Default: 0 for every device. | ||
340 | ------------------------------------------------------------------------------- | ||
341 | Name: autobright | ||
342 | Type: bool array (min = 0, max = 32) | ||
343 | Syntax: <0|1[,...]> | ||
344 | Description: Image sensor automatically changes brightness: | ||
345 | 0 = no, 1 = yes | ||
346 | Default: 0 for every device. | ||
347 | ------------------------------------------------------------------------------- | ||
348 | Name: autoexp | ||
349 | Type: bool array (min = 0, max = 32) | ||
350 | Syntax: <0|1[,...]> | ||
351 | Description: Image sensor automatically changes exposure: | ||
352 | 0 = no, 1 = yes | ||
353 | Default: 1 for every device. | ||
354 | ------------------------------------------------------------------------------- | ||
355 | Name: lightfreq | ||
356 | Type: int array (min = 0, max = 32) | ||
357 | Syntax: <50|60[,...]> | ||
358 | Description: Light frequency in Hz: | ||
359 | 50 for European and Asian lighting, 60 for American lighting. | ||
360 | Default: 50 for every device. | ||
361 | ------------------------------------------------------------------------------- | ||
362 | Name: bandingfilter | ||
363 | Type: bool array (min = 0, max = 32) | ||
364 | Syntax: <0|1[,...]> | ||
365 | Description: 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. | ||
370 | Default: 0 for every device. | ||
371 | ------------------------------------------------------------------------------- | ||
372 | Name: clockdiv | ||
373 | Type: int array (min = 0, max = 32) | ||
374 | Syntax: <-1|n[,...]> | ||
375 | Description: 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. | ||
379 | Default: -1 for every device. | ||
380 | ------------------------------------------------------------------------------- | ||
381 | Name: backlight | ||
382 | Type: bool array (min = 0, max = 32) | ||
383 | Syntax: <0|1[,...]> | ||
384 | Description: Objects are lit from behind: | ||
385 | 0 = no, 1 = yes | ||
386 | Default: 0 for every device. | ||
387 | ------------------------------------------------------------------------------- | ||
388 | Name: mirror | ||
389 | Type: bool array (min = 0, max = 32) | ||
390 | Syntax: <0|1[,...]> | ||
391 | Description: Reverse image horizontally: | ||
392 | 0 = no, 1 = yes | ||
393 | Default: 0 for every device. | ||
394 | ------------------------------------------------------------------------------- | ||
395 | Name: monochrome | ||
396 | Type: bool array (min = 0, max = 32) | ||
397 | Syntax: <0|1[,...]> | ||
398 | Description: The image sensor is monochrome: | ||
399 | 0 = no, 1 = yes | ||
400 | Default: 0 for every device. | ||
401 | ------------------------------------------------------------------------------- | ||
402 | Name: brightness | ||
403 | Type: long array (min = 0, max = 32) | ||
404 | Syntax: <n[,...]> | ||
405 | Description: Set picture brightness (0-65535). | ||
406 | This parameter has no effect if 'autobright' is enabled. | ||
407 | Default: 31000 for every device. | ||
408 | ------------------------------------------------------------------------------- | ||
409 | Name: hue | ||
410 | Type: long array (min = 0, max = 32) | ||
411 | Syntax: <n[,...]> | ||
412 | Description: Set picture hue (0-65535). | ||
413 | Default: 32768 for every device. | ||
414 | ------------------------------------------------------------------------------- | ||
415 | Name: colour | ||
416 | Type: long array (min = 0, max = 32) | ||
417 | Syntax: <n[,...]> | ||
418 | Description: Set picture saturation (0-65535). | ||
419 | Default: 32768 for every device. | ||
420 | ------------------------------------------------------------------------------- | ||
421 | Name: contrast | ||
422 | Type: long array (min = 0, max = 32) | ||
423 | Syntax: <n[,...]> | ||
424 | Description: Set picture contrast (0-65535). | ||
425 | Default: 50000 for every device. | ||
426 | ------------------------------------------------------------------------------- | ||
427 | Name: whiteness | ||
428 | Type: long array (min = 0, max = 32) | ||
429 | Syntax: <n[,...]> | ||
430 | Description: Set picture whiteness (0-65535). | ||
431 | Default: 32768 for every device. | ||
432 | ------------------------------------------------------------------------------- | ||
433 | Name: debug | ||
434 | Type: int | ||
435 | Syntax: <n> | ||
436 | Description: 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. | ||
446 | Default: 2 | ||
447 | ------------------------------------------------------------------------------- | ||
448 | Name: specific_debug | ||
449 | Type: bool | ||
450 | Syntax: <0|1> | ||
451 | Description: 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'. | ||
454 | Default: 0 | ||
455 | ------------------------------------------------------------------------------- | ||
456 | |||
457 | |||
458 | 9. Contact information | ||
459 | ====================== | ||
460 | I may be contacted by e-mail at <luca.risolia@studio.unibo.it>. | ||
461 | |||
462 | I can accept GPG/PGP encrypted e-mail. My GPG key ID is 'FCE635A4'. | ||
463 | My public 1024-bit key should be available at your keyserver; the fingerprint | ||
464 | is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'. | ||
465 | |||
466 | |||
467 | 10. Credits | ||
468 | ========== | ||
469 | The development would not have proceed much further without having looked at | ||
470 | the source code of other drivers and without the help of several persons; in | ||
471 | particular: | ||
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. | ||