mac80211: reorganize compat code to make cfg80211 load without usb
[openwrt.git] / package / mac80211 / patches / 011-move_ar9170_usb_compat_code.patch
1 --- a/drivers/net/wireless/ath/ar9170/usb.c
2 +++ b/drivers/net/wireless/ath/ar9170/usb.c
3 @@ -96,6 +96,34 @@ static struct usb_device_id ar9170_usb_i
4  };
5  MODULE_DEVICE_TABLE(usb, ar9170_usb_ids);
6  
7 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
8 +
9 +#ifdef CONFIG_AR9170_USB
10 +#include <linux/usb.h>
11 +
12 +/**
13 + * usb_unpoison_anchored_urbs - let an anchor be used successfully again
14 + * @anchor: anchor the requests are bound to
15 + *
16 + * Reverses the effect of usb_poison_anchored_urbs
17 + * the anchor can be used normally after it returns
18 + */
19 +void usb_unpoison_anchored_urbs(struct usb_anchor *anchor)
20 +{
21 +       unsigned long flags;
22 +       struct urb *lazarus;
23 +
24 +       spin_lock_irqsave(&anchor->lock, flags);
25 +       list_for_each_entry(lazarus, &anchor->urb_list, anchor_list) {
26 +               usb_unpoison_urb(lazarus);
27 +       }
28 +       //anchor->poisoned = 0; /* XXX: cannot backport */
29 +       spin_unlock_irqrestore(&anchor->lock, flags);
30 +}
31 +EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs);
32 +#endif /* CONFIG_AR9170_USB */
33 +
34 +
35  static void ar9170_usb_submit_urb(struct ar9170_usb *aru)
36  {
37         struct urb *urb;
38 --- a/net/wireless/compat-2.6.29.c
39 +++ b/net/wireless/compat-2.6.29.c
40 @@ -12,31 +12,7 @@
41  
42  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
43  
44 -#ifdef CONFIG_AR9170_USB
45 -#include <linux/usb.h>
46 -
47 -/**
48 - * usb_unpoison_anchored_urbs - let an anchor be used successfully again
49 - * @anchor: anchor the requests are bound to
50 - *
51 - * Reverses the effect of usb_poison_anchored_urbs
52 - * the anchor can be used normally after it returns
53 - */
54 -void usb_unpoison_anchored_urbs(struct usb_anchor *anchor)
55 -{
56 -       unsigned long flags;
57 -       struct urb *lazarus;
58 -
59 -       spin_lock_irqsave(&anchor->lock, flags);
60 -       list_for_each_entry(lazarus, &anchor->urb_list, anchor_list) {
61 -               usb_unpoison_urb(lazarus);
62 -       }
63 -       //anchor->poisoned = 0; /* XXX: cannot backport */
64 -       spin_unlock_irqrestore(&anchor->lock, flags);
65 -}
66 -EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs);
67 -#endif /* CONFIG_AR9170_USB */
68 -
69 +/* 2.6.29 compat code goes here */
70  
71  #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) */
72