• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/usb/core/

Lines Matching defs:anchor

117  * @urb: pointer to the urb to anchor
118 * @anchor: pointer to the anchor
123 void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor)
127 spin_lock_irqsave(&anchor->lock, flags);
129 list_add_tail(&urb->anchor_list, &anchor->urb_list);
130 urb->anchor = anchor;
132 if (unlikely(anchor->poisoned)) {
136 spin_unlock_irqrestore(&anchor->lock, flags);
140 /* Callers must hold anchor->lock */
141 static void __usb_unanchor_urb(struct urb *urb, struct usb_anchor *anchor)
143 urb->anchor = NULL;
146 if (list_empty(&anchor->urb_list))
147 wake_up(&anchor->wait);
152 * @urb: pointer to the urb to anchor
159 struct usb_anchor *anchor;
164 anchor = urb->anchor;
165 if (!anchor)
168 spin_lock_irqsave(&anchor->lock, flags);
174 if (likely(anchor == urb->anchor))
175 __usb_unanchor_urb(urb, anchor);
176 spin_unlock_irqrestore(&anchor->lock, flags);
654 * @anchor: anchor the requests are bound to
662 void usb_kill_anchored_urbs(struct usb_anchor *anchor)
666 spin_lock_irq(&anchor->lock);
667 while (!list_empty(&anchor->urb_list)) {
668 victim = list_entry(anchor->urb_list.prev, struct urb,
672 spin_unlock_irq(&anchor->lock);
676 spin_lock_irq(&anchor->lock);
678 spin_unlock_irq(&anchor->lock);
684 * usb_poison_anchored_urbs - cease all traffic from an anchor
685 * @anchor: anchor the requests are bound to
694 void usb_poison_anchored_urbs(struct usb_anchor *anchor)
698 spin_lock_irq(&anchor->lock);
699 anchor->poisoned = 1;
700 while (!list_empty(&anchor->urb_list)) {
701 victim = list_entry(anchor->urb_list.prev, struct urb,
705 spin_unlock_irq(&anchor->lock);
709 spin_lock_irq(&anchor->lock);
711 spin_unlock_irq(&anchor->lock);
716 * usb_unpoison_anchored_urbs - let an anchor be used successfully again
717 * @anchor: anchor the requests are bound to
720 * the anchor can be used normally after it returns
722 void usb_unpoison_anchored_urbs(struct usb_anchor *anchor)
727 spin_lock_irqsave(&anchor->lock, flags);
728 list_for_each_entry(lazarus, &anchor->urb_list, anchor_list) {
731 anchor->poisoned = 0;
732 spin_unlock_irqrestore(&anchor->lock, flags);
737 * @anchor: anchor the requests are bound to
747 void usb_unlink_anchored_urbs(struct usb_anchor *anchor)
751 while ((victim = usb_get_from_anchor(anchor)) != NULL) {
759 * usb_wait_anchor_empty_timeout - wait for an anchor to be unused
760 * @anchor: the anchor you want to become unused
763 * Call this is you want to be sure all an anchor's
766 int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor,
769 return wait_event_timeout(anchor->wait, list_empty(&anchor->urb_list),
775 * usb_get_from_anchor - get an anchor's oldest urb
776 * @anchor: the anchor whose urb you want
778 * this will take the oldest urb from an anchor,
781 struct urb *usb_get_from_anchor(struct usb_anchor *anchor)
786 spin_lock_irqsave(&anchor->lock, flags);
787 if (!list_empty(&anchor->urb_list)) {
788 victim = list_entry(anchor->urb_list.next, struct urb,
791 __usb_unanchor_urb(victim, anchor);
795 spin_unlock_irqrestore(&anchor->lock, flags);
803 * usb_scuttle_anchored_urbs - unanchor all an anchor's urbs
804 * @anchor: the anchor whose urbs you want to unanchor
806 * use this to get rid of all an anchor's urbs
808 void usb_scuttle_anchored_urbs(struct usb_anchor *anchor)
813 spin_lock_irqsave(&anchor->lock, flags);
814 while (!list_empty(&anchor->urb_list)) {
815 victim = list_entry(anchor->urb_list.prev, struct urb,
817 __usb_unanchor_urb(victim, anchor);
819 spin_unlock_irqrestore(&anchor->lock, flags);
825 * usb_anchor_empty - is an anchor empty
826 * @anchor: the anchor you want to query
828 * returns 1 if the anchor has no urbs associated with it
830 int usb_anchor_empty(struct usb_anchor *anchor)
832 return list_empty(&anchor->urb_list);