summaryrefslogtreecommitdiffstats
path: root/Documentation/usb
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-10 05:27:25 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-10 05:27:25 +0000
commitc9c06167e7933d93a6e396174c68abf242294abb (patch)
treed9a8bb30663e9a3405a1ef37ffb62bc14b9f019f /Documentation/usb
parentf79e8cc3c34e4192a3e5ef4cc9c6542fdef703c0 (diff)
Merge with Linux 2.4.0-test12.
Diffstat (limited to 'Documentation/usb')
-rw-r--r--Documentation/usb/URB.txt61
-rw-r--r--Documentation/usb/error-codes.txt44
-rw-r--r--Documentation/usb/usb-help.txt1
-rw-r--r--Documentation/usb/usb-serial.txt30
4 files changed, 93 insertions, 43 deletions
diff --git a/Documentation/usb/URB.txt b/Documentation/usb/URB.txt
index 7d99567ad..234c75cf3 100644
--- a/Documentation/usb/URB.txt
+++ b/Documentation/usb/URB.txt
@@ -1,3 +1,5 @@
+Revised: 2000-Dec-05.
+
1. Specification of the API
1.1. Basic concept or 'What is an URB?'
@@ -8,16 +10,16 @@ called USB Request Block, or URB for short.
- An URB consists of all relevant information to execute any USB transaction
and deliver the data and status back.
-- Execution of an URB is an inherently asynchronous operation, i.e. the
-submit_urb(urb) call returns immediately after it has successfully queued
+- Execution of an URB is inherently an asynchronous operation, i.e. the
+usb_submit_urb(urb) call returns immediately after it has successfully queued
the requested action.
- Ongoing transfers for one URB (e.g. ISO) can simply be canceled with
-unlink_urb(urb) at any time.
+usb_unlink_urb(urb) at any time.
- Each URB has a completion handler, which is called after the action
has been successfully completed or canceled (INT transfers behave a bit
-different, see below). The URB also contains a context-pointer for free
+differently, see below). The URB also contains a context-pointer for free
usage and information passing to the completion handler.
- URBs can be linked. After completing one URB, the next one can be
@@ -31,6 +33,8 @@ URB-machinery.
typedef struct urb
{
+ spinlock_t lock; // lock for the URB
+
// ignore, for host controller/URB machine internal use
void *hcpriv; // private data for host controller
struct list_head urb_list; // list pointer to all active urbs
@@ -39,12 +43,12 @@ typedef struct urb
struct urb* next; // pointer to next URB
struct usb_device *dev; // pointer to associated USB device
-// pipe is assembled by the various well known pipe-macros in usb.h
+// pipe is assembled by the various well-known pipe macros in usb.h
unsigned int pipe; // pipe information
// status after each completion
int status; // returned status
- unsigned int transfer_flags; // ASAP, SP_OK, etc.
+ unsigned int transfer_flags; // ASAP, DISABLE_SPD, etc.
// for data stage (CTRL), BULK, INT and ISO
void *transfer_buffer; // associated data buffer
@@ -55,7 +59,7 @@ typedef struct urb
// setup stage for CTRL (always 8 bytes!)
unsigned char* setup_packet; // setup packet (control only)
-
+
// with ASAP, start_frame is set to the determined frame
int start_frame; // start frame (iso/irq)
int number_of_packets; // # of packets (iso/int)
@@ -66,7 +70,7 @@ typedef struct urb
usb_complete_t complete; // pointer to completion routine
//
// specification of the requested data offsets and length for ISO
- iso_packet_descriptor_t iso_frame_desc[0];
+ iso_packet_descriptor_t iso_frame_desc[0];
} urb_t, *purb_t;
@@ -74,7 +78,7 @@ typedef struct urb
URBs are allocated with the following call
- purb_t alloc_urb(int isoframes)
+ purb_t usb_alloc_urb(int isoframes)
Return value is a pointer to the allocated URB, 0 if allocation failed.
The parameter isoframes specifies the number of isochronous transfer frames
@@ -82,7 +86,7 @@ you want to schedule. For CTRL/BULK/INT, use 0.
To free an URB, use
- void free_urb(purb_t purb)
+ void usb_free_urb(purb_t purb)
This call also may free internal (host controller specific) memory in the
future.
@@ -91,12 +95,13 @@ future.
1.4. What has to be filled in?
Depending on the type of transaction, there are some macros
-(FILL_CONTROL_URB, FILL_BULK_URB, and FILL_INT_URB, defined in uhci.h)
+(FILL_CONTROL_URB, FILL_CONTROL_URB_TO, FILL_BULK_URB,
+FILL_BULK_URB_TO, and FILL_INT_URB, defined in usb.h)
that simplify the URB creation. In general, all macros need the usb
-device pointer, the pipe (usual format), the transfer buffer, the
-desired transfer length, the completion handler, and its context.
-Take a look at the uhci_control_msg-function that convert the old API
-into an URB.
+device pointer, the pipe (usual format from usb.h), the transfer buffer,
+the desired transfer length, the completion handler, and its context.
+Take a look at the usb_control_msg function that converts the old API
+into the URB API.
Flags:
For ISO there are two startup behaviors: Specified start_frame or ASAP.
@@ -114,7 +119,7 @@ re-submission for INT transfers that are being continued.
Just call
- int submit_urb(purb_t purb)
+ int usb_submit_urb(purb_t purb)
It immediately returns, either with status 0 (request queued) or some
error code, usually caused by the following:
@@ -128,7 +133,7 @@ error code, usually caused by the following:
- Invalid INT interval (-EINVAL)
- More than one packet for INT (-EINVAL)
-After submission, urb->status is USB_ST_URB_PENDING.
+After submission, urb->status is USB_ST_URB_PENDING (-EINPROGRESS).
For isochronous endpoints, subsequent submitting of URBs to the same endpoint
with the ASAP flag result in a seamless ISO streaming. Exception: The
@@ -142,18 +147,18 @@ independent of the transfer flags (implicitly ASAP).
For an URB which you've submitted, but which hasn't been returned to
your driver by the host controller, call
- int unlink_urb(purb_t purb)
+ int usb_unlink_urb(purb_t purb)
It removes the urb from the internal list and frees all allocated
HW descriptors. The status is changed to USB_ST_URB_KILLED. After
-unlink_urb() returns, you can safely free the URB with free_urb(urb)
+usb_unlink_urb() returns, you can safely free the URB with usb_free_urb(urb)
and all other possibly associated data (urb->context etc.)
There is also an asynchronous unlink mode. To use this, set the
the USB_ASYNC_UNLINK flag in urb->transfer flags before calling
usb_unlink_urb(). When using async unlinking, the URB will not
-normally be unlinked when unlink_urb() returns. Instead, wait for
-the completion handler to be called.
+normally be unlinked when usb_unlink_urb() returns. Instead, wait
+for the completion handler to be called.
1.7. What about the completion handler?
@@ -187,13 +192,13 @@ in completion handlers.
1.8. How to do isochronous (ISO) transfers?
For ISO transfers you have to append the iso_packet_descriptor_t structure
-to the URB for each frame you want to schedule. When using alloc_urb(n)
-(recommended), the isoframe-parameter n can be used to allocate the
-structures for n frames.
+to the URB for each frame you want to schedule. When using usb_alloc_urb(n)
+(recommended), the iso_packets parameter can be used to allocate the
+structures for iso_packets frames.
For each entry you have to specify the data offset for this frame (base is
transfer_buffer), and the length you want to write/expect to read.
-After completion, actual_length contains the actual transfered length and
+After completion, actual_length contains the actual transferred length and
status contains the resulting USB-status for the ISO transfer for this frame.
It is allowed to specify a varying length from frame to frame (e.g. for
audio synchronisation/adaptive transfer rates). You can also use the length
@@ -217,7 +222,7 @@ for 1, 2, 4,... 128ms. Only one URB is allocated for each interrupt. After
calling the completion handler, that URB is recycled by the host controller
driver (HCD).
With the submission of one URB, the interrupt is scheduled until it is
-canceled by unlink_urb.
-
-The submit_urb()-call modifies urb->interval to the rounded value.
+canceled by usb_unlink_urb.
+The usb_submit_urb() call modifies urb->interval to the implemented interval
+value that is less than or equal to the requested interval value.
diff --git a/Documentation/usb/error-codes.txt b/Documentation/usb/error-codes.txt
index d1dccece5..964af3033 100644
--- a/Documentation/usb/error-codes.txt
+++ b/Documentation/usb/error-codes.txt
@@ -1,12 +1,12 @@
-$Id: README.error-codes,v 1.1 1999/12/14 14:03:02 fliegl Exp $
+Revised: 2000-Dec-05.
This is the documentation of (hopefully) all possible error codes (and
-their interpretation) that can be returned from the hostcontroller driver
+their interpretation) that can be returned from the host controller drivers
and from usbcore.
NOTE:
-The USB_ST_* codes are deferred and are only listed for compatibility, new
-software should use only -E* instead!
+The USB_ST_* codes are deprecated and are only listed for compatibility;
+new software should use only -E* instead!
@@ -25,12 +25,16 @@ USB-specific:
-ENODEV specified USB-device or bus doesn't exist
--ENXIO specified endpoint doesn't exist on the device
+USB_ST_REQUEST_ERROR
+-ENXIO a control or interrupt URB is already queued to this endpoint; or
+ a bulk URB is already queued to this endpoint and
+ USB_QUEUE_BULK wasn't used (UHCI HCDs only)
USB_ST_URB_INVALID_ERROR
-EINVAL a) Invalid transfer type specified (or not supported)
b) Invalid interrupt interval (0<=n<256)
c) more than one interrupt packet requested
+ d) ISO: number_of_packets is < 0
-EAGAIN a) specified ISO start frame too early
b) (using ISO-ASAP) too much scheduled for the future
@@ -38,6 +42,7 @@ USB_ST_URB_INVALID_ERROR
-EFBIG too much ISO frames requested (currently uhci>900)
+USB_ST_STALL
-EPIPE specified pipe-handle is already stalled
-EMSGSIZE endpoint message size is zero, do interface/alternate setting
@@ -59,7 +64,7 @@ USB_ST_NOERROR
0 Transfer completed successfully
USB_ST_URB_KILLED
--ENOENT URB was canceled by unlink_urb
+-ENOENT URB was canceled by usb_unlink_urb
USB_ST_URB_PENDING
-EINPROGRESS URB still pending, no results yet
@@ -73,12 +78,28 @@ USB_ST_INTERNALERROR
USB_ST_CRC
-EILSEQ CRC mismatch
+USB_ST_STALL
-EPIPE a) babble detect
b) endpoint stalled
-USB_ST_BUFFERUNDERRUN
--ENOST buffer error
+USB_ST_BUFFEROVERRUN
+-ECOMM During an IN transfer, the host controller
+ received data from an endpoint faster than it
+ could be written to system memory
+USB_ST_BUFFERUNDERRUN
+-ENOSR During an OUT transfer, the host controller
+ could not retrieve data from system memory fast
+ enough to keep up with the USB data rate
+
+USB_ST_DATAOVERRUN
+-EOVERFLOW The amount of data returned by the endpoint was
+ greater than either the max packet size of the
+ endpoint or the remaining buffer size
+
+USB_ST_DATAUNDERRUN
+-EREMOTEIO The endpoint returned less than max packet size
+ and that amount did not fill the specified buffer
USB_ST_NORESPONSE
USB_ST_TIMEOUT
-ETIMEDOUT transfer timed out, NAK
@@ -104,14 +125,7 @@ USB_ST_URB_INVALID_ERROR
**************************************************************************
usb_register():
-USB_ST_NOTSUPPORTED
-EINVAL error during registering new driver
-usb_terminate_bulk():
-USB_ST_REMOVED
--ENODEV urb already removed
-
usb_get_*/usb_set_*():
All USB errors (submit/status) can occur
-
-
diff --git a/Documentation/usb/usb-help.txt b/Documentation/usb/usb-help.txt
index 5ad2aaa57..98ade189e 100644
--- a/Documentation/usb/usb-help.txt
+++ b/Documentation/usb/usb-help.txt
@@ -7,6 +7,7 @@ linux/Documentation/usb/*, see the following:
Linux-USB project: http://www.linux-usb.org
mirrors at http://www.suse.cz/development/linux-usb/
and http://usb.in.tum.de/linux-usb/
+ and http://it.linux-usb.org
Linux USB Guide: http://linux-usb.sourceforge.net
Linux-USB device overview (working devices and drivers):
http://www.qbik.ch/usb/devices/
diff --git a/Documentation/usb/usb-serial.txt b/Documentation/usb/usb-serial.txt
index a6efeefa5..2fc5ac8eb 100644
--- a/Documentation/usb/usb-serial.txt
+++ b/Documentation/usb/usb-serial.txt
@@ -139,6 +139,9 @@ Digi AccelePort Driver
(plus a parallel port) and 4 port USB serial converters. The driver
does NOT yet support the Digi AccelePort USB 8.
+ This driver works under SMP with the usb-uhci driver. It does not
+ work under SMP with the uhci driver.
+
The driver is generally working, though we still have a few more ioctls
to implement and final testing and debugging to do. The paralled port
on the USB 2 is supported as a serial to parallel converter; in other
@@ -182,6 +185,33 @@ TO DO List:
-- Add everything else that is missing :)
+Empeg empeg-car Mark I/II Driver (empeg.c)
+
+ This is an experimental driver to provide connectivity support for the
+ client synchronization tools for an Empeg empeg-car mp3 player.
+
+ Tips:
+
+ * Don't forget to create the device nodes for ttyUSB{0,1,2,...}
+ * modprobe empeg (modprobe is your friend)
+ * emptool --usb /dev/ttyUSB0 (or whatever you named your device node)
+
+ The driver is still pretty new, so some testing 'in the wild' would be
+ helpful. :)
+
+
+MCT USB Single Port Serial Adapter U232
+
+ This driver is for the MCT USB-RS232 Converter (25 pin, Model No.
+ U232-P25) from Magic Control Technology Corp. (there is also a 9 pin
+ Model No. U232-P9). More information about this device can be found
+ at the manufacture's web-site: http://www.mct.com.tw.
+
+ The driver is generally working, though it still needs some more
+ testing. It is derived from the Belkin USB Serial Adapter F5U103
+ driver and its TODO list is valid for this driver as well.
+
+
Generic Serial driver
If your device is not one of the above listed devices, compatible with