OHCI: Allow broken controllers to auto-stop
[deliverable/linux.git] / Documentation / usb / anchors.txt
CommitLineData
e6a79f1f
ON
1What is anchor?
2===============
3
4A USB driver needs to support some callbacks requiring
5a driver to cease all IO to an interface. To do so, a
6driver has to keep track of the URBs it has submitted
7to know they've all completed or to call usb_kill_urb
8for them. The anchor is a data structure takes care of
9keeping track of URBs and provides methods to deal with
10multiple URBs.
11
12Allocation and Initialisation
13=============================
14
15There's no API to allocate an anchor. It is simply declared
16as struct usb_anchor. init_usb_anchor() must be called to
17initialise the data structure.
18
19Deallocation
20============
21
22Once it has no more URBs associated with it, the anchor can be
23freed with normal memory management operations.
24
25Association and disassociation of URBs with anchors
26===================================================
27
28An association of URBs to an anchor is made by an explicit
29call to usb_anchor_urb(). The association is maintained until
30an URB is finished by (successfull) completion. Thus disassociation
31is automatic. A function is provided to forcibly finish (kill)
32all URBs associated with an anchor.
33Furthermore, disassociation can be made with usb_unanchor_urb()
34
35Operations on multitudes of URBs
36================================
37
38usb_kill_anchored_urbs()
39------------------------
40
41This function kills all URBs associated with an anchor. The URBs
42are called in the reverse temporal order they were submitted.
43This way no data can be reordered.
44
697e04db
ON
45usb_unlink_anchored_urbs()
46--------------------------
47
48This function unlinks all URBs associated with an anchor. The URBs
49are processed in the reverse temporal order they were submitted.
50This is similar to usb_kill_anchored_urbs(), but it will not sleep.
51Therefore no guarantee is made that the URBs have been unlinked when
52the call returns. They may be unlinked later but will be unlinked in
53finite time.
54
e6a79f1f
ON
55usb_wait_anchor_empty_timeout()
56-------------------------------
57
58This function waits for all URBs associated with an anchor to finish
59or a timeout, whichever comes first. Its return value will tell you
60whether the timeout was reached.
697e04db
ON
61
62
This page took 0.080524 seconds and 5 git commands to generate.