1 --- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
2 +++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
3 @@ -97,13 +97,8 @@ ath5k_add_interface(struct ieee80211_hw
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
12 - if (sc->num_adhoc_vifs ||
13 - (sc->nvifs && vif->type == NL80211_IFTYPE_ADHOC)) {
14 + /* Don't allow more than one ad-hoc interface */
15 + if (sc->num_adhoc_vifs && vif->type == NL80211_IFTYPE_ADHOC) {
16 ATH5K_ERR(sc, "Only one single ad-hoc interface is allowed.\n");
19 --- a/drivers/net/wireless/ath/ath5k/base.c
20 +++ b/drivers/net/wireless/ath/ath5k/base.c
21 @@ -1857,7 +1857,7 @@ ath5k_beacon_send(struct ath5k_softc *sc
25 - if ((sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) ||
26 + if ((sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs + sc->num_adhoc_vifs > 1) ||
27 sc->opmode == NL80211_IFTYPE_MESH_POINT) {
28 u64 tsf = ath5k_hw_get_tsf64(ah);
29 u32 tsftu = TSF_TO_TU(tsf);
30 @@ -1935,7 +1935,7 @@ ath5k_beacon_update_timers(struct ath5k_
33 intval = sc->bintval & AR5K_BEACON_PERIOD;
34 - if (sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) {
35 + if (sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs + sc->num_adhoc_vifs > 1) {
36 intval /= ATH_BCBUF; /* staggered multi-bss beacons */
38 ATH5K_WARN(sc, "intval %u is too low, min 15\n",