ath9k: make ath9k_hw_setbssidmask() and ath9k_hw_write_associd() use ath_hw

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Luis R. Rodriguez 2009-09-10 08:50:20 -07:00 committed by John W. Linville
parent bcd8f54a84
commit f2b2143e60
5 changed files with 17 additions and 16 deletions

View File

@ -4024,17 +4024,17 @@ void ath9k_hw_setmcastfilter(struct ath_hw *ah, u32 filter0, u32 filter1)
REG_WRITE(ah, AR_MCAST_FIL1, filter1); REG_WRITE(ah, AR_MCAST_FIL1, filter1);
} }
void ath9k_hw_setbssidmask(struct ath_softc *sc) void ath9k_hw_setbssidmask(struct ath_hw *ah)
{ {
REG_WRITE(sc->sc_ah, AR_BSSMSKL, get_unaligned_le32(sc->bssidmask)); REG_WRITE(ah, AR_BSSMSKL, get_unaligned_le32(ah->ah_sc->bssidmask));
REG_WRITE(sc->sc_ah, AR_BSSMSKU, get_unaligned_le16(sc->bssidmask + 4)); REG_WRITE(ah, AR_BSSMSKU, get_unaligned_le16(ah->ah_sc->bssidmask + 4));
} }
void ath9k_hw_write_associd(struct ath_softc *sc) void ath9k_hw_write_associd(struct ath_hw *ah)
{ {
REG_WRITE(sc->sc_ah, AR_BSS_ID0, get_unaligned_le32(sc->curbssid)); REG_WRITE(ah, AR_BSS_ID0, get_unaligned_le32(ah->ah_sc->curbssid));
REG_WRITE(sc->sc_ah, AR_BSS_ID1, get_unaligned_le16(sc->curbssid + 4) | REG_WRITE(ah, AR_BSS_ID1, get_unaligned_le16(ah->ah_sc->curbssid + 4) |
((sc->curaid & 0x3fff) << AR_BSS_ID1_AID_S)); ((ah->ah_sc->curaid & 0x3fff) << AR_BSS_ID1_AID_S));
} }
u64 ath9k_hw_gettsf64(struct ath_hw *ah) u64 ath9k_hw_gettsf64(struct ath_hw *ah)

View File

@ -641,8 +641,8 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit);
void ath9k_hw_setmac(struct ath_hw *ah, const u8 *mac); void ath9k_hw_setmac(struct ath_hw *ah, const u8 *mac);
void ath9k_hw_setopmode(struct ath_hw *ah); void ath9k_hw_setopmode(struct ath_hw *ah);
void ath9k_hw_setmcastfilter(struct ath_hw *ah, u32 filter0, u32 filter1); void ath9k_hw_setmcastfilter(struct ath_hw *ah, u32 filter0, u32 filter1);
void ath9k_hw_setbssidmask(struct ath_softc *sc); void ath9k_hw_setbssidmask(struct ath_hw *ah);
void ath9k_hw_write_associd(struct ath_softc *sc); void ath9k_hw_write_associd(struct ath_hw *ah);
u64 ath9k_hw_gettsf64(struct ath_hw *ah); u64 ath9k_hw_gettsf64(struct ath_hw *ah);
void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64); void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64);
void ath9k_hw_reset_tsf(struct ath_hw *ah); void ath9k_hw_reset_tsf(struct ath_hw *ah);

View File

@ -975,14 +975,15 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf) struct ieee80211_bss_conf *bss_conf)
{ {
struct ath_hw *ah = sc->sc_ah;
if (bss_conf->assoc) { if (bss_conf->assoc) {
DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, "Bss Info ASSOC %d, bssid: %pM\n", DPRINTF(ah, ATH_DBG_CONFIG, "Bss Info ASSOC %d, bssid: %pM\n",
bss_conf->aid, sc->curbssid); bss_conf->aid, sc->curbssid);
/* New association, store aid */ /* New association, store aid */
sc->curaid = bss_conf->aid; sc->curaid = bss_conf->aid;
ath9k_hw_write_associd(sc); ath9k_hw_write_associd(ah);
/* /*
* Request a re-configuration of Beacon related timers * Request a re-configuration of Beacon related timers
@ -999,7 +1000,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
ath_start_ani(sc); ath_start_ani(sc);
} else { } else {
DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); DPRINTF(ah, ATH_DBG_CONFIG, "Bss Info DISASSOC\n");
sc->curaid = 0; sc->curaid = 0;
/* Stop ANI */ /* Stop ANI */
del_timer_sync(&sc->ani.timer); del_timer_sync(&sc->ani.timer);
@ -2801,7 +2802,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
ath9k_hw_setopmode(ah); ath9k_hw_setopmode(ah);
memcpy(sc->curbssid, sc->sc_ah->macaddr, ETH_ALEN); memcpy(sc->curbssid, sc->sc_ah->macaddr, ETH_ALEN);
sc->curaid = 0; sc->curaid = 0;
ath9k_hw_write_associd(sc); ath9k_hw_write_associd(ah);
/* Request full reset to get hw opmode changed properly */ /* Request full reset to get hw opmode changed properly */
sc->sc_flags |= SC_OP_FULL_RESET; sc->sc_flags |= SC_OP_FULL_RESET;
} }
@ -2816,7 +2817,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
memcpy(sc->curbssid, bss_conf->bssid, ETH_ALEN); memcpy(sc->curbssid, bss_conf->bssid, ETH_ALEN);
memcpy(avp->bssid, bss_conf->bssid, ETH_ALEN); memcpy(avp->bssid, bss_conf->bssid, ETH_ALEN);
sc->curaid = 0; sc->curaid = 0;
ath9k_hw_write_associd(sc); ath9k_hw_write_associd(ah);
/* Set aggregation protection mode parameters */ /* Set aggregation protection mode parameters */
sc->config.ath_aggr_prot = 0; sc->config.ath_aggr_prot = 0;

View File

@ -280,7 +280,7 @@ static void ath_opmode_init(struct ath_softc *sc)
/* configure bssid mask */ /* configure bssid mask */
if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
ath9k_hw_setbssidmask(sc); ath9k_hw_setbssidmask(ah);
/* configure operational mode */ /* configure operational mode */
ath9k_hw_setopmode(ah); ath9k_hw_setopmode(ah);

View File

@ -93,7 +93,7 @@ void ath9k_set_bssid_mask(struct ieee80211_hw *hw)
sc->bssidmask[4] = ~mask[4]; sc->bssidmask[4] = ~mask[4];
sc->bssidmask[5] = ~mask[5]; sc->bssidmask[5] = ~mask[5];
ath9k_hw_setbssidmask(sc); ath9k_hw_setbssidmask(sc->sc_ah);
} }
int ath9k_wiphy_add(struct ath_softc *sc) int ath9k_wiphy_add(struct ath_softc *sc)