From ecbbed32e7c2ad7d9a6305b02e11502b51f2605c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 16 Apr 2013 12:51:56 +0200 Subject: [PATCH] ath: update hardware mac address with bssid mask Preparation for updating common->macaddr along with virtual interface MAC address changes. Signed-off-by: Felix Fietkau Signed-off-by: John W. Linville --- drivers/net/wireless/ath/ath9k/hw.c | 7 +++---- drivers/net/wireless/ath/ath9k/reg.h | 3 --- drivers/net/wireless/ath/hw.c | 6 ++++++ drivers/net/wireless/ath/reg.h | 4 ++++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 8a980a4bf4ec..10eb6bae12d9 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -1698,12 +1698,11 @@ static void ath9k_hw_reset_opmode(struct ath_hw *ah, ENABLE_REGWRITE_BUFFER(ah); - REG_WRITE(ah, AR_STA_ID0, get_unaligned_le32(common->macaddr)); - REG_WRITE(ah, AR_STA_ID1, get_unaligned_le16(common->macaddr + 4) - | macStaId1 + REG_RMW(ah, AR_STA_ID1, macStaId1 | AR_STA_ID1_RTS_USE_DEF | (ah->config.ack_6mb ? AR_STA_ID1_ACKCTS_6MB : 0) - | ah->sta_id1_defaults); + | ah->sta_id1_defaults, + ~AR_STA_ID1_SADH_MASK); ath_hw_setbssidmask(common); REG_WRITE(ah, AR_DEF_ANTENNA, saveDefAntenna); ath9k_hw_write_associd(ah); diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 5929850649f0..5c4ab5026dca 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h @@ -1493,9 +1493,6 @@ enum { #define AR9271_RADIO_RF_RST 0x20 #define AR9271_GATE_MAC_CTL 0x4000 -#define AR_STA_ID0 0x8000 -#define AR_STA_ID1 0x8004 -#define AR_STA_ID1_SADH_MASK 0x0000FFFF #define AR_STA_ID1_STA_AP 0x00010000 #define AR_STA_ID1_ADHOC 0x00020000 #define AR_STA_ID1_PWR_SAV 0x00040000 diff --git a/drivers/net/wireless/ath/hw.c b/drivers/net/wireless/ath/hw.c index 39e8a590d7fc..eae9abf540a7 100644 --- a/drivers/net/wireless/ath/hw.c +++ b/drivers/net/wireless/ath/hw.c @@ -118,6 +118,12 @@ void ath_hw_setbssidmask(struct ath_common *common) { void *ah = common->ah; + u32 id1; + + REG_WRITE(ah, AR_STA_ID0, get_unaligned_le32(common->macaddr)); + id1 = REG_READ(ah, AR_STA_ID1) & ~AR_STA_ID1_SADH_MASK; + id1 |= get_unaligned_le16(common->macaddr + 4); + REG_WRITE(ah, AR_STA_ID1, id1); REG_WRITE(ah, AR_BSSMSKL, get_unaligned_le32(common->bssidmask)); REG_WRITE(ah, AR_BSSMSKU, get_unaligned_le16(common->bssidmask + 4)); diff --git a/drivers/net/wireless/ath/reg.h b/drivers/net/wireless/ath/reg.h index 298e53f3fa48..3ad4c774bd22 100644 --- a/drivers/net/wireless/ath/reg.h +++ b/drivers/net/wireless/ath/reg.h @@ -23,6 +23,10 @@ #define AR_MIBC_CMC 0x00000004 #define AR_MIBC_MCS 0x00000008 +#define AR_STA_ID0 0x8000 +#define AR_STA_ID1 0x8004 +#define AR_STA_ID1_SADH_MASK 0x0000ffff + /* * BSSID mask registers. See ath_hw_set_bssid_mask() * for detailed documentation about these registers. -- 2.39.5