ath9k: Replace ath9k_opmode with nl80211_iftype
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / ath9k / beacon.c
index ca5782fa76279fdb53900d32044e7a1aaa023856..fe6929dc2937343dd3e3fe81b79944775d21d56d 100644 (file)
@@ -27,7 +27,7 @@ static int ath_beaconq_config(struct ath_softc *sc)
        struct ath9k_tx_queue_info qi;
 
        ath9k_hw_get_txq_props(ah, sc->sc_bhalq, &qi);
-       if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
+       if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) {
                /* Always burst out beacon and CAB traffic. */
                qi.tqi_aifs = 1;
                qi.tqi_cwmin = 0;
@@ -82,7 +82,7 @@ static void ath_beacon_setup(struct ath_softc *sc,
 
        flags = ATH9K_TXDESC_NOACK;
 
-       if (sc->sc_ah->ah_opmode == ATH9K_M_IBSS &&
+       if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC &&
            (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) {
                ds->ds_link = bf->bf_daddr; /* self-linked */
                flags |= ATH9K_TXDESC_VEOL;
@@ -302,7 +302,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
                                                 struct ath_buf, list);
                list_del(&avp->av_bcbuf->list);
 
-               if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP ||
+               if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP ||
                    !(sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) {
                        int slot;
                        /*
@@ -607,16 +607,16 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
        struct ath_hal *ah = sc->sc_ah;
        struct ath_beacon_config conf;
        struct ath_vap *avp;
-       enum ath9k_opmode av_opmode;
+       enum nl80211_iftype opmode;
        u32 nexttbtt, intval;
 
        if (if_id != ATH_IF_ID_ANY) {
                vif = sc->sc_vaps[if_id];
                ASSERT(vif);
                avp = (void *)vif->drv_priv;
-               av_opmode = avp->av_opmode;
+               opmode = avp->av_opmode;
        } else {
-               av_opmode = sc->sc_ah->ah_opmode;
+               opmode = sc->sc_ah->ah_opmode;
        }
 
        memset(&conf, 0, sizeof(struct ath_beacon_config));
@@ -632,7 +632,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
        nexttbtt = TSF_TO_TU(sc->bc_tstamp >> 32, sc->bc_tstamp);
 
        /* XXX conditionalize multi-bss support? */
-       if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
+       if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) {
                /*
                 * For multi-bss ap support beacons are either staggered
                 * evenly over N slots or burst together.  For the former
@@ -654,8 +654,8 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
        DPRINTF(sc, ATH_DBG_BEACON, "nexttbtt %u intval %u (%u)\n",
                nexttbtt, intval, conf.beacon_interval);
 
-       /* Check for ATH9K_M_HOSTAP and sc_nostabeacons for WDS client */
-       if (sc->sc_ah->ah_opmode == ATH9K_M_STA) {
+       /* Check for NL80211_IFTYPE_AP and sc_nostabeacons for WDS client */
+       if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) {
                struct ath9k_beacon_state bs;
                u64 tsf;
                u32 tsftu;
@@ -774,7 +774,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
                ath9k_hw_set_interrupts(ah, 0);
                if (nexttbtt == intval)
                        intval |= ATH9K_BEACON_RESET_TSF;
-               if (sc->sc_ah->ah_opmode == ATH9K_M_IBSS) {
+               if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC) {
                        /*
                         * Pull nexttbtt forward to reflect the current
                         * TSF
@@ -806,7 +806,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
                        if (!(ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL))
                                sc->sc_imask |= ATH9K_INT_SWBA;
                        ath_beaconq_config(sc);
-               } else if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
+               } else if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) {
                        /*
                         * In AP mode we enable the beacon timers and
                         * SWBA interrupts to prepare beacon frames.
@@ -822,7 +822,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
                 * When using a self-linked beacon descriptor in
                 * ibss mode load it once here.
                 */
-               if (sc->sc_ah->ah_opmode == ATH9K_M_IBSS &&
+               if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC &&
                    (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL))
                        ath_beacon_start_adhoc(sc, 0);
        }