svn commit: r226760 - in head/sys/dev/ath/ath_hal: ar5212 ar5416
Adrian Chadd
adrian at FreeBSD.org
Tue Oct 25 23:13:36 UTC 2011
Author: adrian
Date: Tue Oct 25 23:13:36 2011
New Revision: 226760
URL: http://svn.freebsd.org/changeset/base/226760
Log:
Save and restore the association ID across interface resets.
Obtained from: Atheros
MFC after: 1 week
Modified:
head/sys/dev/ath/ath_hal/ar5212/ar5212.h
head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c
head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue Oct 25 23:09:07 2011 (r226759)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Tue Oct 25 23:13:36 2011 (r226760)
@@ -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.
Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue Oct 25 23:09:07 2011 (r226759)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Tue Oct 25 23:13:36 2011 (r226760)
@@ -218,8 +218,9 @@ ar5212WriteAssocid(struct ath_hal *ah, c
{
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));
Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Tue Oct 25 23:09:07 2011 (r226759)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Tue Oct 25 23:13:36 2011 (r226760)
@@ -438,9 +438,10 @@ ar5212Reset(struct ath_hal *ah, HAL_OPMO
/* 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);
Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Oct 25 23:09:07 2011 (r226759)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Oct 25 23:13:36 2011 (r226760)
@@ -278,9 +278,10 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
/* 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);
More information about the svn-src-all
mailing list