summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k
diff options
context:
space:
mode:
authorBob Copeland2008-11-26 22:17:11 +0100
committerJohn W. Linville2008-12-05 15:32:12 +0100
commitf6bac3ea5990653765700b2c3778b08782abebe5 (patch)
tree325d799b06b76c207047db0ff35ee8a4e6b90140 /drivers/net/wireless/ath5k
parentiwlwifi: remove uses of __constant_{endian} helpers (diff)
downloadkernel-qcow2-linux-f6bac3ea5990653765700b2c3778b08782abebe5.tar.gz
kernel-qcow2-linux-f6bac3ea5990653765700b2c3778b08782abebe5.tar.xz
kernel-qcow2-linux-f6bac3ea5990653765700b2c3778b08782abebe5.zip
ath5k: preserve higher order bits when setting mac address
In some cases we would like to set the mac address without changing the operating mode. However, Atheros cards store PCU data in the high 16 bits of the mac address register. Change ath5k_hw_set_lladdr() to not clobber the PCU settings. Changes-licensed-under: ISC Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r--drivers/net/wireless/ath5k/pcu.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath5k/pcu.c b/drivers/net/wireless/ath5k/pcu.c
index d7f0c1017bda..79879f2d426c 100644
--- a/drivers/net/wireless/ath5k/pcu.c
+++ b/drivers/net/wireless/ath5k/pcu.c
@@ -267,24 +267,23 @@ void ath5k_hw_get_lladdr(struct ath5k_hw *ah, u8 *mac)
* @mac: The card's mac address
*
* Set station id on hw using the provided mac address
- *
- * NOTE: This is only called during attach, don't call it
- * on reset because it overwrites all AR5K_STA_ID1 settings.
- * We have set_opmode (above) for reset.
*/
int ath5k_hw_set_lladdr(struct ath5k_hw *ah, const u8 *mac)
{
u32 low_id, high_id;
+ u32 pcu_reg;
ATH5K_TRACE(ah->ah_sc);
/* Set new station ID */
memcpy(ah->ah_sta_id, mac, ETH_ALEN);
+ pcu_reg = ath5k_hw_reg_read(ah, AR5K_STA_ID1) & 0xffff0000;
+
low_id = AR5K_LOW_ID(mac);
high_id = AR5K_HIGH_ID(mac);
ath5k_hw_reg_write(ah, low_id, AR5K_STA_ID0);
- ath5k_hw_reg_write(ah, high_id, AR5K_STA_ID1);
+ ath5k_hw_reg_write(ah, pcu_reg | high_id, AR5K_STA_ID1);
return 0;
}