Commit d97809db authored by Colin McCabe's avatar Colin McCabe Committed by John W. Linville

ath9k: Replace ath9k_opmode with nl80211_iftype

This patch kills ath9k's ath9k_opmode enum by replacing it with nl80211_iftype.
Signed-off-by: default avatarColin McCabe <colin@cozybit.com>
Signed-off-by: default avatarAndrey Yurovsky <andrey@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 33fd8195
...@@ -303,7 +303,7 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hal *ah) ...@@ -303,7 +303,7 @@ static void ath9k_hw_ani_ofdm_err_trigger(struct ath_hal *ah)
} }
} }
if (ah->ah_opmode == ATH9K_M_HOSTAP) { if (ah->ah_opmode == NL80211_IFTYPE_AP) {
if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) {
ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL,
aniState->firstepLevel + 1); aniState->firstepLevel + 1);
...@@ -368,7 +368,7 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hal *ah) ...@@ -368,7 +368,7 @@ static void ath9k_hw_ani_cck_err_trigger(struct ath_hal *ah)
return; return;
} }
} }
if (ah->ah_opmode == ATH9K_M_HOSTAP) { if (ah->ah_opmode == NL80211_IFTYPE_AP) {
if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) { if (aniState->firstepLevel < HAL_FIRST_STEP_MAX) {
ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL,
aniState->firstepLevel + 1); aniState->firstepLevel + 1);
...@@ -398,7 +398,7 @@ static void ath9k_hw_ani_lower_immunity(struct ath_hal *ah) ...@@ -398,7 +398,7 @@ static void ath9k_hw_ani_lower_immunity(struct ath_hal *ah)
aniState = ahp->ah_curani; aniState = ahp->ah_curani;
if (ah->ah_opmode == ATH9K_M_HOSTAP) { if (ah->ah_opmode == NL80211_IFTYPE_AP) {
if (aniState->firstepLevel > 0) { if (aniState->firstepLevel > 0) {
if (ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL, if (ath9k_hw_ani_control(ah, ATH9K_ANI_FIRSTEP_LEVEL,
aniState->firstepLevel - 1)) aniState->firstepLevel - 1))
...@@ -487,8 +487,8 @@ void ath9k_ani_reset(struct ath_hal *ah) ...@@ -487,8 +487,8 @@ void ath9k_ani_reset(struct ath_hal *ah)
aniState = &ahp->ah_ani[index]; aniState = &ahp->ah_ani[index];
ahp->ah_curani = aniState; ahp->ah_curani = aniState;
if (DO_ANI(ah) && ah->ah_opmode != ATH9K_M_STA if (DO_ANI(ah) && ah->ah_opmode != NL80211_IFTYPE_STATION
&& ah->ah_opmode != ATH9K_M_IBSS) { && ah->ah_opmode != NL80211_IFTYPE_ADHOC) {
DPRINTF(ah->ah_sc, ATH_DBG_ANI, DPRINTF(ah->ah_sc, ATH_DBG_ANI,
"Reset ANI state opmode %u\n", ah->ah_opmode); "Reset ANI state opmode %u\n", ah->ah_opmode);
ahp->ah_stats.ast_ani_reset++; ahp->ah_stats.ast_ani_reset++;
...@@ -504,7 +504,7 @@ void ath9k_ani_reset(struct ath_hal *ah) ...@@ -504,7 +504,7 @@ void ath9k_ani_reset(struct ath_hal *ah)
ath9k_hw_setrxfilter(ah, ath9k_hw_getrxfilter(ah) | ath9k_hw_setrxfilter(ah, ath9k_hw_getrxfilter(ah) |
ATH9K_RX_FILTER_PHYERR); ATH9K_RX_FILTER_PHYERR);
if (ah->ah_opmode == ATH9K_M_HOSTAP) { if (ah->ah_opmode == NL80211_IFTYPE_AP) {
ahp->ah_curani->ofdmTrigHigh = ahp->ah_curani->ofdmTrigHigh =
ah->ah_config.ofdm_trig_high; ah->ah_config.ofdm_trig_high;
ahp->ah_curani->ofdmTrigLow = ahp->ah_curani->ofdmTrigLow =
......
...@@ -647,13 +647,6 @@ enum ath9k_ant_setting { ...@@ -647,13 +647,6 @@ enum ath9k_ant_setting {
ATH9K_ANT_FIXED_B ATH9K_ANT_FIXED_B
}; };
enum ath9k_opmode {
ATH9K_M_STA = 1,
ATH9K_M_IBSS = 0,
ATH9K_M_HOSTAP = 6,
ATH9K_M_MONITOR = 8
};
#define ATH9K_SLOT_TIME_6 6 #define ATH9K_SLOT_TIME_6 6
#define ATH9K_SLOT_TIME_9 9 #define ATH9K_SLOT_TIME_9 9
#define ATH9K_SLOT_TIME_20 20 #define ATH9K_SLOT_TIME_20 20
...@@ -780,7 +773,8 @@ struct ath_hal { ...@@ -780,7 +773,8 @@ struct ath_hal {
void __iomem *ah_sh; void __iomem *ah_sh;
struct ath_softc *ah_sc; struct ath_softc *ah_sc;
enum ath9k_opmode ah_opmode;
enum nl80211_iftype ah_opmode;
struct ath9k_ops_config ah_config; struct ath9k_ops_config ah_config;
struct ath9k_hw_capabilities ah_caps; struct ath9k_hw_capabilities ah_caps;
......
...@@ -27,7 +27,7 @@ static int ath_beaconq_config(struct ath_softc *sc) ...@@ -27,7 +27,7 @@ static int ath_beaconq_config(struct ath_softc *sc)
struct ath9k_tx_queue_info qi; struct ath9k_tx_queue_info qi;
ath9k_hw_get_txq_props(ah, sc->sc_bhalq, &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. */ /* Always burst out beacon and CAB traffic. */
qi.tqi_aifs = 1; qi.tqi_aifs = 1;
qi.tqi_cwmin = 0; qi.tqi_cwmin = 0;
...@@ -82,7 +82,7 @@ static void ath_beacon_setup(struct ath_softc *sc, ...@@ -82,7 +82,7 @@ static void ath_beacon_setup(struct ath_softc *sc,
flags = ATH9K_TXDESC_NOACK; 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)) { (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) {
ds->ds_link = bf->bf_daddr; /* self-linked */ ds->ds_link = bf->bf_daddr; /* self-linked */
flags |= ATH9K_TXDESC_VEOL; flags |= ATH9K_TXDESC_VEOL;
...@@ -302,7 +302,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id) ...@@ -302,7 +302,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
struct ath_buf, list); struct ath_buf, list);
list_del(&avp->av_bcbuf->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)) { !(sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) {
int slot; int slot;
/* /*
...@@ -607,16 +607,16 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) ...@@ -607,16 +607,16 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
struct ath_hal *ah = sc->sc_ah; struct ath_hal *ah = sc->sc_ah;
struct ath_beacon_config conf; struct ath_beacon_config conf;
struct ath_vap *avp; struct ath_vap *avp;
enum ath9k_opmode av_opmode; enum nl80211_iftype opmode;
u32 nexttbtt, intval; u32 nexttbtt, intval;
if (if_id != ATH_IF_ID_ANY) { if (if_id != ATH_IF_ID_ANY) {
vif = sc->sc_vaps[if_id]; vif = sc->sc_vaps[if_id];
ASSERT(vif); ASSERT(vif);
avp = (void *)vif->drv_priv; avp = (void *)vif->drv_priv;
av_opmode = avp->av_opmode; opmode = avp->av_opmode;
} else { } else {
av_opmode = sc->sc_ah->ah_opmode; opmode = sc->sc_ah->ah_opmode;
} }
memset(&conf, 0, sizeof(struct ath_beacon_config)); memset(&conf, 0, sizeof(struct ath_beacon_config));
...@@ -632,7 +632,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) ...@@ -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); nexttbtt = TSF_TO_TU(sc->bc_tstamp >> 32, sc->bc_tstamp);
/* XXX conditionalize multi-bss support? */ /* 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 * For multi-bss ap support beacons are either staggered
* evenly over N slots or burst together. For the former * 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) ...@@ -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", DPRINTF(sc, ATH_DBG_BEACON, "nexttbtt %u intval %u (%u)\n",
nexttbtt, intval, conf.beacon_interval); nexttbtt, intval, conf.beacon_interval);
/* Check for ATH9K_M_HOSTAP and sc_nostabeacons for WDS client */ /* Check for NL80211_IFTYPE_AP and sc_nostabeacons for WDS client */
if (sc->sc_ah->ah_opmode == ATH9K_M_STA) { if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) {
struct ath9k_beacon_state bs; struct ath9k_beacon_state bs;
u64 tsf; u64 tsf;
u32 tsftu; u32 tsftu;
...@@ -774,7 +774,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) ...@@ -774,7 +774,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
ath9k_hw_set_interrupts(ah, 0); ath9k_hw_set_interrupts(ah, 0);
if (nexttbtt == intval) if (nexttbtt == intval)
intval |= ATH9K_BEACON_RESET_TSF; 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 * Pull nexttbtt forward to reflect the current
* TSF * TSF
...@@ -806,7 +806,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) ...@@ -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)) if (!(ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL))
sc->sc_imask |= ATH9K_INT_SWBA; sc->sc_imask |= ATH9K_INT_SWBA;
ath_beaconq_config(sc); 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 * In AP mode we enable the beacon timers and
* SWBA interrupts to prepare beacon frames. * SWBA interrupts to prepare beacon frames.
...@@ -822,7 +822,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) ...@@ -822,7 +822,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
* When using a self-linked beacon descriptor in * When using a self-linked beacon descriptor in
* ibss mode load it once here. * 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)) (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL))
ath_beacon_start_adhoc(sc, 0); ath_beacon_start_adhoc(sc, 0);
} }
......
...@@ -474,7 +474,7 @@ void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid ...@@ -474,7 +474,7 @@ void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid
struct ath_vap { struct ath_vap {
int av_bslot; int av_bslot;
enum ath9k_opmode av_opmode; enum nl80211_iftype av_opmode;
struct ath_buf *av_bcbuf; struct ath_buf *av_bcbuf;
struct ath_tx_control av_btxctl; struct ath_tx_control av_btxctl;
}; };
......
...@@ -1040,7 +1040,8 @@ static void ath9k_hw_init_chain_masks(struct ath_hal *ah) ...@@ -1040,7 +1040,8 @@ static void ath9k_hw_init_chain_masks(struct ath_hal *ah)
REG_READ(ah, AR_PHY_ANALOG_SWAP) | 0x00000001); REG_READ(ah, AR_PHY_ANALOG_SWAP) | 0x00000001);
} }
static void ath9k_hw_init_interrupt_masks(struct ath_hal *ah, enum ath9k_opmode opmode) static void ath9k_hw_init_interrupt_masks(struct ath_hal *ah,
enum nl80211_iftype opmode)
{ {
struct ath_hal_5416 *ahp = AH5416(ah); struct ath_hal_5416 *ahp = AH5416(ah);
...@@ -1057,7 +1058,7 @@ static void ath9k_hw_init_interrupt_masks(struct ath_hal *ah, enum ath9k_opmode ...@@ -1057,7 +1058,7 @@ static void ath9k_hw_init_interrupt_masks(struct ath_hal *ah, enum ath9k_opmode
ahp->ah_maskReg |= AR_IMR_TXOK; ahp->ah_maskReg |= AR_IMR_TXOK;
if (opmode == ATH9K_M_HOSTAP) if (opmode == NL80211_IFTYPE_AP)
ahp->ah_maskReg |= AR_IMR_MIB; ahp->ah_maskReg |= AR_IMR_MIB;
REG_WRITE(ah, AR_IMR, ahp->ah_maskReg); REG_WRITE(ah, AR_IMR, ahp->ah_maskReg);
...@@ -1423,18 +1424,18 @@ static void ath9k_hw_set_operating_mode(struct ath_hal *ah, int opmode) ...@@ -1423,18 +1424,18 @@ static void ath9k_hw_set_operating_mode(struct ath_hal *ah, int opmode)
val = REG_READ(ah, AR_STA_ID1); val = REG_READ(ah, AR_STA_ID1);
val &= ~(AR_STA_ID1_STA_AP | AR_STA_ID1_ADHOC); val &= ~(AR_STA_ID1_STA_AP | AR_STA_ID1_ADHOC);
switch (opmode) { switch (opmode) {
case ATH9K_M_HOSTAP: case NL80211_IFTYPE_AP:
REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_STA_AP REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_STA_AP
| AR_STA_ID1_KSRCH_MODE); | AR_STA_ID1_KSRCH_MODE);
REG_CLR_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION); REG_CLR_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION);
break; break;
case ATH9K_M_IBSS: case NL80211_IFTYPE_ADHOC:
REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_ADHOC REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_ADHOC
| AR_STA_ID1_KSRCH_MODE); | AR_STA_ID1_KSRCH_MODE);
REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION); REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION);
break; break;
case ATH9K_M_STA: case NL80211_IFTYPE_STATION:
case ATH9K_M_MONITOR: case NL80211_IFTYPE_MONITOR:
REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE); REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE);
break; break;
} }
...@@ -3054,14 +3055,14 @@ void ath9k_hw_beaconinit(struct ath_hal *ah, u32 next_beacon, u32 beacon_period) ...@@ -3054,14 +3055,14 @@ void ath9k_hw_beaconinit(struct ath_hal *ah, u32 next_beacon, u32 beacon_period)
ahp->ah_beaconInterval = beacon_period; ahp->ah_beaconInterval = beacon_period;
switch (ah->ah_opmode) { switch (ah->ah_opmode) {
case ATH9K_M_STA: case NL80211_IFTYPE_STATION:
case ATH9K_M_MONITOR: case NL80211_IFTYPE_MONITOR:
REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon)); REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon));
REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff); REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff);
REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff); REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff);
flags |= AR_TBTT_TIMER_EN; flags |= AR_TBTT_TIMER_EN;
break; break;
case ATH9K_M_IBSS: case NL80211_IFTYPE_ADHOC:
REG_SET_BIT(ah, AR_TXCFG, REG_SET_BIT(ah, AR_TXCFG,
AR_TXCFG_ADHOC_BEACON_ATIM_TX_POLICY); AR_TXCFG_ADHOC_BEACON_ATIM_TX_POLICY);
REG_WRITE(ah, AR_NEXT_NDP_TIMER, REG_WRITE(ah, AR_NEXT_NDP_TIMER,
...@@ -3069,7 +3070,7 @@ void ath9k_hw_beaconinit(struct ath_hal *ah, u32 next_beacon, u32 beacon_period) ...@@ -3069,7 +3070,7 @@ void ath9k_hw_beaconinit(struct ath_hal *ah, u32 next_beacon, u32 beacon_period)
(ahp->ah_atimWindow ? ahp-> (ahp->ah_atimWindow ? ahp->
ah_atimWindow : 1))); ah_atimWindow : 1)));
flags |= AR_NDP_TIMER_EN; flags |= AR_NDP_TIMER_EN;
case ATH9K_M_HOSTAP: case NL80211_IFTYPE_AP:
REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon)); REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon));
REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT,
TU_TO_USEC(next_beacon - TU_TO_USEC(next_beacon -
...@@ -3082,6 +3083,12 @@ void ath9k_hw_beaconinit(struct ath_hal *ah, u32 next_beacon, u32 beacon_period) ...@@ -3082,6 +3083,12 @@ void ath9k_hw_beaconinit(struct ath_hal *ah, u32 next_beacon, u32 beacon_period)
flags |= flags |=
AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN; AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN;
break; break;
default:
DPRINTF(ah->ah_sc, ATH_DBG_BEACON,
"%s: unsupported opmode: %d\n",
__func__, ah->ah_opmode);
return;
break;
} }
REG_WRITE(ah, AR_BEACON_PERIOD, TU_TO_USEC(beacon_period)); REG_WRITE(ah, AR_BEACON_PERIOD, TU_TO_USEC(beacon_period));
...@@ -3177,7 +3184,7 @@ bool ath9k_hw_fill_cap_info(struct ath_hal *ah) ...@@ -3177,7 +3184,7 @@ bool ath9k_hw_fill_cap_info(struct ath_hal *ah)
capField = ath9k_hw_get_eeprom(ah, EEP_OP_CAP); capField = ath9k_hw_get_eeprom(ah, EEP_OP_CAP);
if (ah->ah_opmode != ATH9K_M_HOSTAP && if (ah->ah_opmode != NL80211_IFTYPE_AP &&
ah->ah_subvendorid == AR_SUBVENDOR_ID_NEW_A) { ah->ah_subvendorid == AR_SUBVENDOR_ID_NEW_A) {
if (ah->ah_currentRD == 0x64 || ah->ah_currentRD == 0x65) if (ah->ah_currentRD == 0x64 || ah->ah_currentRD == 0x65)
ah->ah_currentRD += 5; ah->ah_currentRD += 5;
......
...@@ -754,13 +754,17 @@ static int ath_key_config(struct ath_softc *sc, ...@@ -754,13 +754,17 @@ static int ath_key_config(struct ath_softc *sc,
/* /*
* Strategy: * Strategy:
* For _M_STA mc tx, we will not setup a key at all since we never * For STA mc tx, we will not setup a key at
* tx mc. * all since we never tx mc.
* _M_STA mc rx, we will use the keyID. *
* for _M_IBSS mc tx, we will use the keyID, and no macaddr. * For STA mc rx, we will use the keyID.
* for _M_IBSS mc rx, we will alloc a slot and plumb the mac of the *
* peer node. BUT we will plumb a cleartext key so that we can do * For ADHOC mc tx, we will use the keyID, and no macaddr.
* perSta default key table lookup in software. *
* For ADHOC mc rx, we will alloc a slot and plumb the mac of
* the peer node.
* BUT we will plumb a cleartext key so that we can do
* per-Sta default key table lookup in software.
*/ */
if (is_broadcast_ether_addr(addr)) { if (is_broadcast_ether_addr(addr)) {
switch (opmode) { switch (opmode) {
...@@ -861,7 +865,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, ...@@ -861,7 +865,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info ASSOC %d\n", bss_conf->aid); DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info ASSOC %d\n", bss_conf->aid);
/* New association, store aid */ /* New association, store aid */
if (avp->av_opmode == ATH9K_M_STA) { if (avp->av_opmode == NL80211_IFTYPE_STATION) {
sc->sc_curaid = bss_conf->aid; sc->sc_curaid = bss_conf->aid;
ath9k_hw_write_associd(sc->sc_ah, sc->sc_curbssid, ath9k_hw_write_associd(sc->sc_ah, sc->sc_curbssid,
sc->sc_curaid); sc->sc_curaid);
...@@ -1373,7 +1377,8 @@ static int ath_init(u16 devid, struct ath_softc *sc) ...@@ -1373,7 +1377,8 @@ static int ath_init(u16 devid, struct ath_softc *sc)
goto bad; goto bad;
/* default to MONITOR mode */ /* default to MONITOR mode */
sc->sc_ah->ah_opmode = ATH9K_M_MONITOR; sc->sc_ah->ah_opmode = NL80211_IFTYPE_MONITOR;
/* Setup rate tables */ /* Setup rate tables */
...@@ -1938,8 +1943,8 @@ static int ath9k_start(struct ieee80211_hw *hw) ...@@ -1938,8 +1943,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
* Note we only do this (at the moment) for station mode. * Note we only do this (at the moment) for station mode.
*/ */
if (ath9k_hw_phycounters(sc->sc_ah) && if (ath9k_hw_phycounters(sc->sc_ah) &&
((sc->sc_ah->ah_opmode == ATH9K_M_STA) || ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) ||
(sc->sc_ah->ah_opmode == ATH9K_M_IBSS))) (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC)))
sc->sc_imask |= ATH9K_INT_MIB; sc->sc_imask |= ATH9K_INT_MIB;
/* /*
* Some hardware processes the TIM IE and fires an * Some hardware processes the TIM IE and fires an
...@@ -1948,7 +1953,7 @@ static int ath9k_start(struct ieee80211_hw *hw) ...@@ -1948,7 +1953,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
* enable the TIM interrupt when operating as station. * enable the TIM interrupt when operating as station.
*/ */
if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) && if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) &&
(sc->sc_ah->ah_opmode == ATH9K_M_STA) && (sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) &&
!sc->sc_config.swBeaconProcess) !sc->sc_config.swBeaconProcess)
sc->sc_imask |= ATH9K_INT_TIM; sc->sc_imask |= ATH9K_INT_TIM;
...@@ -2064,7 +2069,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, ...@@ -2064,7 +2069,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
{ {
struct ath_softc *sc = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_vap *avp = (void *)conf->vif->drv_priv; struct ath_vap *avp = (void *)conf->vif->drv_priv;
int ic_opmode = 0; enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED;
/* Support only vap for now */ /* Support only vap for now */
...@@ -2073,13 +2078,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, ...@@ -2073,13 +2078,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
switch (conf->type) { switch (conf->type) {
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
ic_opmode = ATH9K_M_STA; ic_opmode = NL80211_IFTYPE_STATION;
break; break;
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
ic_opmode = ATH9K_M_IBSS; ic_opmode = NL80211_IFTYPE_ADHOC;
break; break;
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
ic_opmode = ATH9K_M_HOSTAP; ic_opmode = NL80211_IFTYPE_AP;
break; break;
default: default:
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc, ATH_DBG_FATAL,
...@@ -2093,7 +2098,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, ...@@ -2093,7 +2098,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
avp->av_opmode = ic_opmode; avp->av_opmode = ic_opmode;
avp->av_bslot = -1; avp->av_bslot = -1;
if (ic_opmode == ATH9K_M_HOSTAP) if (ic_opmode == NL80211_IFTYPE_AP)
ath9k_hw_set_tsfadjust(sc->sc_ah, 1); ath9k_hw_set_tsfadjust(sc->sc_ah, 1);
sc->sc_vaps[0] = conf->vif; sc->sc_vaps[0] = conf->vif;
...@@ -2127,8 +2132,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, ...@@ -2127,8 +2132,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
del_timer_sync(&sc->sc_ani.timer); del_timer_sync(&sc->sc_ani.timer);
/* Reclaim beacon resources */ /* Reclaim beacon resources */
if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP || if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP ||
sc->sc_ah->ah_opmode == ATH9K_M_IBSS) { sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC) {
ath9k_hw_stoptxdma(sc->sc_ah, sc->sc_bhalq); ath9k_hw_stoptxdma(sc->sc_ah, sc->sc_bhalq);
ath_beacon_return(sc, avp); ath_beacon_return(sc, avp);
} }
...@@ -2163,7 +2168,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) ...@@ -2163,7 +2168,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
(curchan->band == IEEE80211_BAND_2GHZ) ? (curchan->band == IEEE80211_BAND_2GHZ) ?
CHANNEL_G : CHANNEL_A; CHANNEL_G : CHANNEL_A;
if ((sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) && if ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) &&
(conf->ht.enabled)) { (conf->ht.enabled)) {
sc->tx_chan_width = (!!conf->ht.sec_chan_offset) ? sc->tx_chan_width = (!!conf->ht.sec_chan_offset) ?
ATH9K_HT_MACMODE_2040 : ATH9K_HT_MACMODE_20; ATH9K_HT_MACMODE_2040 : ATH9K_HT_MACMODE_20;
...@@ -2202,8 +2207,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, ...@@ -2202,8 +2207,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
/* TODO: Need to decide which hw opmode to use for multi-interface /* TODO: Need to decide which hw opmode to use for multi-interface
* cases */ * cases */
if (vif->type == NL80211_IFTYPE_AP && if (vif->type == NL80211_IFTYPE_AP &&
ah->ah_opmode != ATH9K_M_HOSTAP) { ah->ah_opmode != NL80211_IFTYPE_AP) {
ah->ah_opmode = ATH9K_M_HOSTAP; ah->ah_opmode = NL80211_IFTYPE_STATION;
ath9k_hw_setopmode(ah); ath9k_hw_setopmode(ah);
ath9k_hw_write_associd(ah, sc->sc_myaddr, 0); ath9k_hw_write_associd(ah, sc->sc_myaddr, 0);
/* Request full reset to get hw opmode changed properly */ /* Request full reset to get hw opmode changed properly */
...@@ -2258,7 +2263,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, ...@@ -2258,7 +2263,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
} }
/* Check for WLAN_CAPABILITY_PRIVACY ? */ /* Check for WLAN_CAPABILITY_PRIVACY ? */
if ((avp->av_opmode != ATH9K_M_STA)) { if ((avp->av_opmode != NL80211_IFTYPE_STATION)) {
for (i = 0; i < IEEE80211_WEP_NKID; i++) for (i = 0; i < IEEE80211_WEP_NKID; i++)
if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i))
ath9k_hw_keysetmac(sc->sc_ah, ath9k_hw_keysetmac(sc->sc_ah,
......
...@@ -1347,13 +1347,13 @@ static void ath_rc_init(struct ath_softc *sc, ...@@ -1347,13 +1347,13 @@ static void ath_rc_init(struct ath_softc *sc,
u8 i, j, k, hi = 0, hthi = 0; u8 i, j, k, hi = 0, hthi = 0;
/* FIXME: Adhoc */ /* FIXME: Adhoc */
if ((sc->sc_ah->ah_opmode == ATH9K_M_STA) || if ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) ||
(sc->sc_ah->ah_opmode == ATH9K_M_IBSS)) { (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC)) {
bool is_cw_40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40; bool is_cw_40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40;
rate_table = ath_choose_rate_table(sc, sband->band, rate_table = ath_choose_rate_table(sc, sband->band,
sta->ht_cap.ht_supported, sta->ht_cap.ht_supported,
is_cw_40); is_cw_40);
} else if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) { } else if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) {
/* sc_curmode would be set on init through config() */ /* sc_curmode would be set on init through config() */
rate_table = sc->hw_rate_table[sc->sc_curmode]; rate_table = sc->hw_rate_table[sc->sc_curmode];
} }
......
...@@ -165,7 +165,7 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds, ...@@ -165,7 +165,7 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
* discard the frame. Enable this if you want to see * discard the frame. Enable this if you want to see
* error frames in Monitor mode. * error frames in Monitor mode.
*/ */
if (sc->sc_ah->ah_opmode != ATH9K_M_MONITOR) if (sc->sc_ah->ah_opmode != NL80211_IFTYPE_MONITOR)
goto rx_next; goto rx_next;
} else if (ds->ds_rxstat.rs_status != 0) { } else if (ds->ds_rxstat.rs_status != 0) {
if (ds->ds_rxstat.rs_status & ATH9K_RXERR_CRC) if (ds->ds_rxstat.rs_status & ATH9K_RXERR_CRC)
...@@ -191,7 +191,7 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds, ...@@ -191,7 +191,7 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
* decryption and MIC failures. For monitor mode, * decryption and MIC failures. For monitor mode,
* we also ignore the CRC error. * we also ignore the CRC error.
*/ */
if (sc->sc_ah->ah_opmode == ATH9K_M_MONITOR) { if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_MONITOR) {
if (ds->ds_rxstat.rs_status & if (ds->ds_rxstat.rs_status &
~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC | ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
ATH9K_RXERR_CRC)) ATH9K_RXERR_CRC))
...@@ -361,25 +361,25 @@ u32 ath_calcrxfilter(struct ath_softc *sc) ...@@ -361,25 +361,25 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
| ATH9K_RX_FILTER_MCAST; | ATH9K_RX_FILTER_MCAST;
/* If not a STA, enable processing of Probe Requests */ /* If not a STA, enable processing of Probe Requests */
if (sc->sc_ah->ah_opmode != ATH9K_M_STA) if (sc->sc_ah->ah_opmode != NL80211_IFTYPE_STATION)
rfilt |= ATH9K_RX_FILTER_PROBEREQ; rfilt |= ATH9K_RX_FILTER_PROBEREQ;
/* Can't set HOSTAP into promiscous mode */ /* Can't set HOSTAP into promiscous mode */
if (((sc->sc_ah->ah_opmode != ATH9K_M_HOSTAP) && if (((sc->sc_ah->ah_opmode != NL80211_IFTYPE_AP) &&
(sc->rx_filter & FIF_PROMISC_IN_BSS)) || (sc->rx_filter & FIF_PROMISC_IN_BSS)) ||
(sc->sc_ah->ah_opmode == ATH9K_M_MONITOR)) { (sc->sc_ah->ah_opmode == NL80211_IFTYPE_MONITOR)) {
rfilt |= ATH9K_RX_FILTER_PROM; rfilt |= ATH9K_RX_FILTER_PROM;
/* ??? To prevent from sending ACK */ /* ??? To prevent from sending ACK */
rfilt &= ~ATH9K_RX_FILTER_UCAST; rfilt &= ~ATH9K_RX_FILTER_UCAST;
} }
if (sc->sc_ah->ah_opmode == ATH9K_M_STA || if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION ||
sc->sc_ah->ah_opmode == ATH9K_M_IBSS) sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC)
rfilt |= ATH9K_RX_FILTER_BEACON; rfilt |= ATH9K_RX_FILTER_BEACON;
/* If in HOSTAP mode, want to enable reception of PSPOLL frames /* If in HOSTAP mode, want to enable reception of PSPOLL frames
& beacon frames */ & beacon frames */
if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP)
rfilt |= (ATH9K_RX_FILTER_BEACON | ATH9K_RX_FILTER_PSPOLL); rfilt |= (ATH9K_RX_FILTER_BEACON | ATH9K_RX_FILTER_PSPOLL);
return rfilt; return rfilt;
......
...@@ -456,7 +456,7 @@ ath9k_regd_add_channel(struct ath_hal *ah, ...@@ -456,7 +456,7 @@ ath9k_regd_add_channel(struct ath_hal *ah,
return false; return false;
} }
if ((rd->flags & NO_HOSTAP) && (ah->ah_opmode == ATH9K_M_HOSTAP)) { if ((rd->flags & NO_HOSTAP) && (ah->ah_opmode == NL80211_IFTYPE_AP)) {
DPRINTF(ah->ah_sc, ATH_DBG_REGULATORY, DPRINTF(ah->ah_sc, ATH_DBG_REGULATORY,
"Skipping HOSTAP channel\n"); "Skipping HOSTAP channel\n");
return false; return false;
......
...@@ -760,7 +760,8 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc, ...@@ -760,7 +760,8 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc,
* when perform internal reset in this routine. * when perform internal reset in this routine.
* Only enable reset in STA mode for now. * Only enable reset in STA mode for now.
*/ */
if (sc->sc_ah->ah_opmode == ATH9K_M_STA) if (sc->sc_ah->ah_opmode ==
NL80211_IFTYPE_STATION)
needreset = 1; needreset = 1;
} }
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment