]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath9k: use ap style beaconing for mesh
authorThomas Pedersen <thomas@cozybit.com>
Wed, 8 May 2013 17:16:48 +0000 (10:16 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 May 2013 19:05:34 +0000 (15:05 -0400)
Chun-Yeow and Javier Lopez contributed these changes to
make mesh mode use the more similar AP beaconing mode and
queue parameters. Should improve PS performance, interface
concurrency (AP modes can coexist), and beacon interval
stability.

AR9271 (ath9k_htc) mesh interfaces also need to be in AP
operating mode.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/beacon.c
drivers/net/wireless/ath/ath9k/hw.c

index 2ff570f7f8ffb49e563d0f7e6cb4d3bace3cc6da..fd1eebab8647e24a473233275256f859282963dc 100644 (file)
@@ -39,7 +39,8 @@ static void ath9k_beaconq_config(struct ath_softc *sc)
 
        ath9k_hw_get_txq_props(ah, sc->beacon.beaconq, &qi);
 
-       if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) {
+       if (sc->sc_ah->opmode == NL80211_IFTYPE_AP ||
+           sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT) {
                /* Always burst out beacon and CAB traffic. */
                qi.tqi_aifs = 1;
                qi.tqi_cwmin = 0;
@@ -273,7 +274,8 @@ static int ath9k_beacon_choose_slot(struct ath_softc *sc)
        u64 tsf;
        int slot;
 
-       if (sc->sc_ah->opmode != NL80211_IFTYPE_AP) {
+       if (sc->sc_ah->opmode != NL80211_IFTYPE_AP &&
+           sc->sc_ah->opmode != NL80211_IFTYPE_MESH_POINT) {
                ath_dbg(common, BEACON, "slot 0, tsf: %llu\n",
                        ath9k_hw_gettsf64(sc->sc_ah));
                return 0;
@@ -765,10 +767,10 @@ void ath9k_set_beacon(struct ath_softc *sc)
 
        switch (sc->sc_ah->opmode) {
        case NL80211_IFTYPE_AP:
+       case NL80211_IFTYPE_MESH_POINT:
                ath9k_beacon_config_ap(sc, cur_conf);
                break;
        case NL80211_IFTYPE_ADHOC:
-       case NL80211_IFTYPE_MESH_POINT:
                ath9k_beacon_config_adhoc(sc, cur_conf);
                break;
        case NL80211_IFTYPE_STATION:
index 7f25da8444fef35097180711080b44ee6bd951b3..a263ccc00a475438934e77bfd1531d3196a14e54 100644 (file)
@@ -1245,10 +1245,10 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode)
 
        switch (opmode) {
        case NL80211_IFTYPE_ADHOC:
-       case NL80211_IFTYPE_MESH_POINT:
                set |= AR_STA_ID1_ADHOC;
                REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION);
                break;
+       case NL80211_IFTYPE_MESH_POINT:
        case NL80211_IFTYPE_AP:
                set |= AR_STA_ID1_STA_AP;
                /* fall through */
@@ -2246,12 +2246,12 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period)
 
        switch (ah->opmode) {
        case NL80211_IFTYPE_ADHOC:
-       case NL80211_IFTYPE_MESH_POINT:
                REG_SET_BIT(ah, AR_TXCFG,
                            AR_TXCFG_ADHOC_BEACON_ATIM_TX_POLICY);
                REG_WRITE(ah, AR_NEXT_NDP_TIMER, next_beacon +
                          TU_TO_USEC(ah->atim_window ? ah->atim_window : 1));
                flags |= AR_NDP_TIMER_EN;
+       case NL80211_IFTYPE_MESH_POINT:
        case NL80211_IFTYPE_AP:
                REG_WRITE(ah, AR_NEXT_TBTT_TIMER, next_beacon);
                REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, next_beacon -