€•-4Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ*/translations/zh_CN/driver-api/usb/anchors”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/zh_TW/driver-api/usb/anchors”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/it_IT/driver-api/usb/anchors”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/ja_JP/driver-api/usb/anchors”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/ko_KR/driver-api/usb/anchors”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ*/translations/sp_SP/driver-api/usb/anchors”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ USB Anchors”h]”hŒ USB Anchors”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒD/var/lib/git/docbuild/linux/Documentation/driver-api/usb/anchors.rst”h Kubh¢)”}”(hhh]”(h§)”}”(hŒWhat is anchor?”h]”hŒWhat is anchor?”…””}”(hhºhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh·hžhhŸh¶h KubhŒ paragraph”“”)”}”(hXVA USB driver needs to support some callbacks requiring a driver to cease all IO to an interface. To do so, a driver has to keep track of the URBs it has submitted to know they've all completed or to call usb_kill_urb for them. The anchor is a data structure takes care of keeping track of URBs and provides methods to deal with multiple URBs.”h]”hXXA USB driver needs to support some callbacks requiring a driver to cease all IO to an interface. To do so, a driver has to keep track of the URBs it has submitted to know they’ve all completed or to call usb_kill_urb for them. The anchor is a data structure takes care of keeping track of URBs and provides methods to deal with multiple URBs.”…””}”(hhÊhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khh·hžhubeh}”(h]”Œwhat-is-anchor”ah ]”h"]”Œwhat is anchor?”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒAllocation and Initialisation”h]”hŒAllocation and Initialisation”…””}”(hhãhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hhàhžhhŸh¶h KubhÉ)”}”(hŒœThere's no API to allocate an anchor. It is simply declared as struct usb_anchor. :c:func:`init_usb_anchor` must be called to initialise the data structure.”h]”(hŒTThere’s no API to allocate an anchor. It is simply declared as struct usb_anchor. ”…””}”(hhñhžhhŸNh Nubh)”}”(hŒ:c:func:`init_usb_anchor`”h]”hŒliteral”“”)”}”(hhûh]”hŒinit_usb_anchor()”…””}”(hhÿhžhhŸNh Nubah}”(h]”h ]”(Œxref”Œc”Œc-func”eh"]”h$]”h&]”uh1hýhhùubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œdriver-api/usb/anchors”Œ refdomain”j Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰Œ reftarget”Œinit_usb_anchor”uh1hhŸh¶h KhhñubhŒ1 must be called to initialise the data structure.”…””}”(hhñhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khhàhžhubeh}”(h]”Œallocation-and-initialisation”ah ]”h"]”Œallocation and initialisation”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒ Deallocation”h]”hŒ Deallocation”…””}”(hj3hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj0hžhhŸh¶h KubhÉ)”}”(hŒnOnce it has no more URBs associated with it, the anchor can be freed with normal memory management operations.”h]”hŒnOnce it has no more URBs associated with it, the anchor can be freed with normal memory management operations.”…””}”(hjAhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khj0hžhubeh}”(h]”Œ deallocation”ah ]”h"]”Œ deallocation”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒ3Association and disassociation of URBs with anchors”h]”hŒ3Association and disassociation of URBs with anchors”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjWhžhhŸh¶h KubhÉ)”}”(hXnAn association of URBs to an anchor is made by an explicit call to :c:func:`usb_anchor_urb`. The association is maintained until an URB is finished by (successful) completion. Thus disassociation is automatic. A function is provided to forcibly finish (kill) all URBs associated with an anchor. Furthermore, disassociation can be made with :c:func:`usb_unanchor_urb`”h]”(hŒCAn association of URBs to an anchor is made by an explicit call to ”…””}”(hjhhžhhŸNh Nubh)”}”(hŒ:c:func:`usb_anchor_urb`”h]”hþ)”}”(hjrh]”hŒusb_anchor_urb()”…””}”(hjthžhhŸNh Nubah}”(h]”h ]”(j j Œc-func”eh"]”h$]”h&]”uh1hýhjpubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jŒusb_anchor_urb”uh1hhŸh¶h KhjhubhŒù. The association is maintained until an URB is finished by (successful) completion. Thus disassociation is automatic. A function is provided to forcibly finish (kill) all URBs associated with an anchor. Furthermore, disassociation can be made with ”…””}”(hjhhžhhŸNh Nubh)”}”(hŒ:c:func:`usb_unanchor_urb`”h]”hþ)”}”(hj•h]”hŒusb_unanchor_urb()”…””}”(hj—hžhhŸNh Nubah}”(h]”h ]”(j j Œc-func”eh"]”h$]”h&]”uh1hýhj“ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jŒusb_unanchor_urb”uh1hhŸh¶h Khjhubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KhjWhžhubeh}”(h]”Œ3association-and-disassociation-of-urbs-with-anchors”ah ]”h"]”Œ3association and disassociation of urbs with anchors”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒ Operations on multitudes of URBs”h]”hŒ Operations on multitudes of URBs”…””}”(hjÃhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjÀhžhhŸh¶h K'ubh¢)”}”(hhh]”(h§)”}”(hŒ :c:func:`usb_kill_anchored_urbs`”h]”h)”}”(hjÖh]”hþ)”}”(hjÖh]”hŒusb_kill_anchored_urbs()”…””}”(hjÛhžhhŸNh Nubah}”(h]”h ]”(j j Œc-func”eh"]”h$]”h&]”uh1hýhjØubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jŒusb_kill_anchored_urbs”uh1hhŸh¶h K)hjÔubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjÑhžhhŸh¶h K*ubhÉ)”}”(hŒ¡This function kills all URBs associated with an anchor. The URBs are called in the reverse temporal order they were submitted. This way no data can be reordered.”h]”hŒ¡This function kills all URBs associated with an anchor. The URBs are called in the reverse temporal order they were submitted. This way no data can be reordered.”…””}”(hjühžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K,hjÑhžhubeh}”(h]”Œusb-kill-anchored-urbs”ah ]”h"]”Œusb_kill_anchored_urbs()”ah$]”h&]”uh1h¡hjÀhžhhŸh¶h K*ubh¢)”}”(hhh]”(h§)”}”(hŒ#:c:func:`usb_scuttle_anchored_urbs`”h]”h)”}”(hjh]”hþ)”}”(hjh]”hŒusb_scuttle_anchored_urbs()”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(j j Œc-func”eh"]”h$]”h&]”uh1hýhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jŒusb_scuttle_anchored_urbs”uh1hhŸh¶h K0hjubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhžhhŸh¶h K1ubhÉ)”}”(hŒ.All URBs of an anchor are unanchored en masse.”h]”hŒ.All URBs of an anchor are unanchored en masse.”…””}”(hj=hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K3hjhžhubeh}”(h]”Œusb-scuttle-anchored-urbs”ah ]”h"]”Œusb_scuttle_anchored_urbs()”ah$]”h&]”uh1h¡hjÀhžhhŸh¶h K1ubh¢)”}”(hhh]”(h§)”}”(hŒ':c:func:`usb_wait_anchor_empty_timeout`”h]”h)”}”(hjXh]”hþ)”}”(hjXh]”hŒusb_wait_anchor_empty_timeout()”…””}”(hj]hžhhŸNh Nubah}”(h]”h ]”(j j Œc-func”eh"]”h$]”h&]”uh1hýhjZubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jŒusb_wait_anchor_empty_timeout”uh1hhŸh¶h K5hjVubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjShžhhŸh¶h K6ubhÉ)”}”(hŒ©This function waits for all URBs associated with an anchor to finish or a timeout, whichever comes first. Its return value will tell you whether the timeout was reached.”h]”hŒ©This function waits for all URBs associated with an anchor to finish or a timeout, whichever comes first. Its return value will tell you whether the timeout was reached.”…””}”(hj~hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K8hjShžhubeh}”(h]”Œusb-wait-anchor-empty-timeout”ah ]”h"]”Œusb_wait_anchor_empty_timeout()”ah$]”h&]”uh1h¡hjÀhžhhŸh¶h K6ubh¢)”}”(hhh]”(h§)”}”(hŒ:c:func:`usb_anchor_empty`”h]”h)”}”(hj™h]”hþ)”}”(hj™h]”hŒusb_anchor_empty()”…””}”(hjžhžhhŸNh Nubah}”(h]”h ]”(j j Œc-func”eh"]”h$]”h&]”uh1hýhj›ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jŒusb_anchor_empty”uh1hhŸh¶h K