Save and restore the association ID across interface resets.

Obtained from:	Atheros
MFC after:	1 week
This commit is contained in:
Adrian Chadd 2011-10-25 23:13:36 +00:00
parent 5916ef68df
commit 0047ff7096
4 changed files with 9 additions and 5 deletions

View File

@ -252,6 +252,7 @@ struct ath_hal_5212 {
uint8_t ah_macaddr[IEEE80211_ADDR_LEN];
uint8_t ah_bssid[IEEE80211_ADDR_LEN];
uint8_t ah_bssidmask[IEEE80211_ADDR_LEN];
uint16_t ah_assocId;
/*
* Runtime state.

View File

@ -218,8 +218,9 @@ ar5212WriteAssocid(struct ath_hal *ah, const uint8_t *bssid, uint16_t assocId)
{
struct ath_hal_5212 *ahp = AH5212(ah);
/* XXX save bssid for possible re-use on reset */
/* save bssid for possible re-use on reset */
OS_MEMCPY(ahp->ah_bssid, bssid, IEEE80211_ADDR_LEN);
ahp->ah_assocId = assocId;
OS_REG_WRITE(ah, AR_BSS_ID0, LE_READ_4(ahp->ah_bssid));
OS_REG_WRITE(ah, AR_BSS_ID1, LE_READ_2(ahp->ah_bssid+4) |
((assocId & 0x3fff)<<AR_BSS_ID1_AID_S));

View File

@ -438,9 +438,10 @@ ar5212Reset(struct ath_hal *ah, HAL_OPMODE opmode,
/* Restore previous antenna */
OS_REG_WRITE(ah, AR_DEF_ANTENNA, saveDefAntenna);
/* then our BSSID */
/* then our BSSID and associate id */
OS_REG_WRITE(ah, AR_BSS_ID0, LE_READ_4(ahp->ah_bssid));
OS_REG_WRITE(ah, AR_BSS_ID1, LE_READ_2(ahp->ah_bssid + 4));
OS_REG_WRITE(ah, AR_BSS_ID1, LE_READ_2(ahp->ah_bssid + 4) |
(ahp->ah_assocId & 0x3fff) << AR_BSS_ID1_AID_S);
/* Restore bmiss rssi & count thresholds */
OS_REG_WRITE(ah, AR_RSSI_THR, ahp->ah_rssiThr);

View File

@ -278,9 +278,10 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode,
/* Restore previous antenna */
OS_REG_WRITE(ah, AR_DEF_ANTENNA, saveDefAntenna);
/* then our BSSID */
/* then our BSSID and associate id */
OS_REG_WRITE(ah, AR_BSS_ID0, LE_READ_4(ahp->ah_bssid));
OS_REG_WRITE(ah, AR_BSS_ID1, LE_READ_2(ahp->ah_bssid + 4));
OS_REG_WRITE(ah, AR_BSS_ID1, LE_READ_2(ahp->ah_bssid + 4) |
(ahp->ah_assocId & 0x3fff) << AR_BSS_ID1_AID_S);
/* Restore bmiss rssi & count thresholds */
OS_REG_WRITE(ah, AR_RSSI_THR, ahp->ah_rssiThr);