aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2008-08-11 07:01:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-29 16:24:02 -0400
commit2ad67de3c8a21354b8b2721d5d2baabb7c5013c9 (patch)
treed05dd0bdc12d96df7cab6c7ef3548f2094215086 /drivers/net/wireless/ath9k
parent98deeea0b3464955ec416c30cbd0c3d21cacfa9a (diff)
ath9k: Allow AP mode to be enabled
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k')
-rw-r--r--drivers/net/wireless/ath9k/core.c12
-rw-r--r--drivers/net/wireless/ath9k/main.c19
2 files changed, 26 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c
index 0d953f9fdeeb..9737775aad3c 100644
--- a/drivers/net/wireless/ath9k/core.c
+++ b/drivers/net/wireless/ath9k/core.c
@@ -549,9 +549,15 @@ int ath_vap_listen(struct ath_softc *sc, int if_id)
549 * XXXX 549 * XXXX
550 * Disable BMISS interrupt when we're not associated 550 * Disable BMISS interrupt when we're not associated
551 */ 551 */
552 ath9k_hw_set_interrupts(ah, 552 if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
553 sc->sc_imask & ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS)); 553 ath9k_hw_set_interrupts(ah, sc->sc_imask & ~ATH9K_INT_BMISS);
554 sc->sc_imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); 554 sc->sc_imask &= ~ATH9K_INT_BMISS;
555 } else {
556 ath9k_hw_set_interrupts(
557 ah,
558 sc->sc_imask & ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS));
559 sc->sc_imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS);
560 }
555 /* need to reconfigure the beacons when it moves to RUN */ 561 /* need to reconfigure the beacons when it moves to RUN */
556 sc->sc_flags &= ~SC_OP_BEACONS; 562 sc->sc_flags &= ~SC_OP_BEACONS;
557 563
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 7fb57ee4c436..183c76e1187d 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -426,10 +426,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
426 case IEEE80211_IF_TYPE_IBSS: 426 case IEEE80211_IF_TYPE_IBSS:
427 ic_opmode = ATH9K_M_IBSS; 427 ic_opmode = ATH9K_M_IBSS;
428 break; 428 break;
429 case IEEE80211_IF_TYPE_AP:
430 ic_opmode = ATH9K_M_HOSTAP;
431 break;
429 default: 432 default:
430 DPRINTF(sc, ATH_DBG_FATAL, 433 DPRINTF(sc, ATH_DBG_FATAL,
431 "%s: Only STA and IBSS are supported currently\n", 434 "%s: Interface type %d not yet supported\n",
432 __func__); 435 __func__, conf->type);
433 return -EOPNOTSUPP; 436 return -EOPNOTSUPP;
434 } 437 }
435 438
@@ -530,6 +533,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
530 struct ieee80211_if_conf *conf) 533 struct ieee80211_if_conf *conf)
531{ 534{
532 struct ath_softc *sc = hw->priv; 535 struct ath_softc *sc = hw->priv;
536 struct ath_hal *ah = sc->sc_ah;
533 struct ath_vap *avp; 537 struct ath_vap *avp;
534 u32 rfilt = 0; 538 u32 rfilt = 0;
535 int error, i; 539 int error, i;
@@ -542,6 +546,17 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
542 return -EINVAL; 546 return -EINVAL;
543 } 547 }
544 548
549 /* TODO: Need to decide which hw opmode to use for multi-interface
550 * cases */
551 if (vif->type == IEEE80211_IF_TYPE_AP &&
552 ah->ah_opmode != ATH9K_M_HOSTAP) {
553 ah->ah_opmode = ATH9K_M_HOSTAP;
554 ath9k_hw_setopmode(ah);
555 ath9k_hw_write_associd(ah, sc->sc_myaddr, 0);
556 /* Request full reset to get hw opmode changed properly */
557 sc->sc_flags |= SC_OP_FULL_RESET;
558 }
559
545 if ((conf->changed & IEEE80211_IFCC_BSSID) && 560 if ((conf->changed & IEEE80211_IFCC_BSSID) &&
546 !is_zero_ether_addr(conf->bssid)) { 561 !is_zero_ether_addr(conf->bssid)) {
547 switch (vif->type) { 562 switch (vif->type) {