ath9k: improve ANI debugfs file
[openwrt.git] / package / kernel / mac80211 / patches / 411-ath5k_allow_adhoc_and_ap.patch
1 --- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
2 +++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
3 @@ -86,13 +86,8 @@ ath5k_add_interface(struct ieee80211_hw 
4                 goto end;
5         }
6  
7 -       /* Don't allow other interfaces if one ad-hoc is configured.
8 -        * TODO: Fix the problems with ad-hoc and multiple other interfaces.
9 -        * We would need to operate the HW in ad-hoc mode to allow TSF updates
10 -        * for the IBSS, but this breaks with additional AP or STA interfaces
11 -        * at the moment. */
12 -       if (ah->num_adhoc_vifs ||
13 -           (ah->nvifs && vif->type == NL80211_IFTYPE_ADHOC)) {
14 +       /* Don't allow more than one ad-hoc interface */
15 +       if (ah->num_adhoc_vifs && vif->type == NL80211_IFTYPE_ADHOC) {
16                 ATH5K_ERR(ah, "Only one single ad-hoc interface is allowed.\n");
17                 ret = -ELNRNG;
18                 goto end;
19 --- a/drivers/net/wireless/ath/ath5k/base.c
20 +++ b/drivers/net/wireless/ath/ath5k/base.c
21 @@ -1934,7 +1934,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
22         }
23  
24         if ((ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs +
25 -                       ah->num_mesh_vifs > 1) ||
26 +                       ah->num_adhoc_vifs + ah->num_mesh_vifs > 1) ||
27                         ah->opmode == NL80211_IFTYPE_MESH_POINT) {
28                 u64 tsf = ath5k_hw_get_tsf64(ah);
29                 u32 tsftu = TSF_TO_TU(tsf);
30 @@ -2020,7 +2020,7 @@ ath5k_beacon_update_timers(struct ath5k_
31  
32         intval = ah->bintval & AR5K_BEACON_PERIOD;
33         if (ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs
34 -               + ah->num_mesh_vifs > 1) {
35 +               + ah->num_adhoc_vifs + ah->num_mesh_vifs > 1) {
36                 intval /= ATH_BCBUF;    /* staggered multi-bss beacons */
37                 if (intval < 15)
38                         ATH5K_WARN(ah, "intval %u is too low, min 15\n",
39 @@ -2487,6 +2487,7 @@ static const struct ieee80211_iface_limi
40                                  BIT(NL80211_IFTYPE_MESH_POINT) |
41  #endif
42                                  BIT(NL80211_IFTYPE_AP) },
43 +       { .max = 1,     .types = BIT(NL80211_IFTYPE_ADHOC) },
44  };
45  
46  static const struct ieee80211_iface_combination if_comb = {