Commit 2ad67de3 authored by Jouni Malinen's avatar Jouni Malinen Committed by John W. Linville

ath9k: Allow AP mode to be enabled

Signed-off-by: default avatarJouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 98deeea0
...@@ -549,9 +549,15 @@ int ath_vap_listen(struct ath_softc *sc, int if_id) ...@@ -549,9 +549,15 @@ int ath_vap_listen(struct ath_softc *sc, int if_id)
* XXXX * XXXX
* Disable BMISS interrupt when we're not associated * Disable BMISS interrupt when we're not associated
*/ */
ath9k_hw_set_interrupts(ah, if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
sc->sc_imask & ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS)); ath9k_hw_set_interrupts(ah, sc->sc_imask & ~ATH9K_INT_BMISS);
sc->sc_imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); sc->sc_imask &= ~ATH9K_INT_BMISS;
} else {
ath9k_hw_set_interrupts(
ah,
sc->sc_imask & ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS));
sc->sc_imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS);
}
/* need to reconfigure the beacons when it moves to RUN */ /* need to reconfigure the beacons when it moves to RUN */
sc->sc_flags &= ~SC_OP_BEACONS; sc->sc_flags &= ~SC_OP_BEACONS;
......
...@@ -426,10 +426,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, ...@@ -426,10 +426,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
case IEEE80211_IF_TYPE_IBSS: case IEEE80211_IF_TYPE_IBSS:
ic_opmode = ATH9K_M_IBSS; ic_opmode = ATH9K_M_IBSS;
break; break;
case IEEE80211_IF_TYPE_AP:
ic_opmode = ATH9K_M_HOSTAP;
break;
default: default:
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc, ATH_DBG_FATAL,
"%s: Only STA and IBSS are supported currently\n", "%s: Interface type %d not yet supported\n",
__func__); __func__, conf->type);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -530,6 +533,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, ...@@ -530,6 +533,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
struct ieee80211_if_conf *conf) struct ieee80211_if_conf *conf)
{ {
struct ath_softc *sc = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_hal *ah = sc->sc_ah;
struct ath_vap *avp; struct ath_vap *avp;
u32 rfilt = 0; u32 rfilt = 0;
int error, i; int error, i;
...@@ -542,6 +546,17 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, ...@@ -542,6 +546,17 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
return -EINVAL; return -EINVAL;
} }
/* TODO: Need to decide which hw opmode to use for multi-interface
* cases */
if (vif->type == IEEE80211_IF_TYPE_AP &&
ah->ah_opmode != ATH9K_M_HOSTAP) {
ah->ah_opmode = ATH9K_M_HOSTAP;
ath9k_hw_setopmode(ah);
ath9k_hw_write_associd(ah, sc->sc_myaddr, 0);
/* Request full reset to get hw opmode changed properly */
sc->sc_flags |= SC_OP_FULL_RESET;
}
if ((conf->changed & IEEE80211_IFCC_BSSID) && if ((conf->changed & IEEE80211_IFCC_BSSID) &&
!is_zero_ether_addr(conf->bssid)) { !is_zero_ether_addr(conf->bssid)) {
switch (vif->type) { switch (vif->type) {
......
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