next up previous contents index
Next: URB Functions Up: USB Transfers Previous: USB Transfers   Contents   Index

Transfer Data Structures & Macros

The Linux USB subsystem uses only one data transfer structure called USB Request Block (URB). This structure contains all parameters to setup any USB transfer type. All transfer requests are sent asynchronously to the USB core and the completion of the request is signalled via a callback function.

Figure 7: URB Structure
\begin{figure}
\centering\index{struct urb}
\index{URB}
\begin{verbatim}typede...
...desc[0]; // optional iso descriptors
} urb_t, *purb_t;\end{verbatim}\end{figure}

As shown in figure 7 the URB structure contains elements common to all transfer types (marked with C). Elements marked with $>$ are input parameters, M means mandatory and O means optional. Elements marked with $<$ are return values. Elements marked with T are transient parameters (input and output). All non common elements are marked on three columns which represent control, interrupt and isochronous transfers. A X marks this element to be used with the associated transfer type.

The URB structure might look confusing but this is just an overview of its versatility. There are several helping macros to setup the right parameters but first the common elements will be explained as they are very important.

The remaining elements of the URB are specific to the transfer type.


next up previous contents index
Next: URB Functions Up: USB Transfers Previous: USB Transfers   Contents   Index
Detlef Fliegl
2001-01-08