b515e28a681f6017ea6c823b4e34bc77f7fb0889
[openwrt/openwrt.git] / package / 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 @@ -89,13 +89,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 @@ -1878,7 +1878,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 @@ -1964,7 +1964,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 @@ -2427,6 +2427,7 @@ static const struct ieee80211_iface_limi
40 #ifdef CONFIG_MAC80211_MESH
41 BIT(NL80211_IFTYPE_MESH_POINT) |
42 #endif
43 + BIT(NL80211_IFTYPE_ADHOC) |
44 BIT(NL80211_IFTYPE_AP) },
45 };
46