diff options
author | Michael Wu <flamingice@sourmilk.net> | 2007-09-24 18:10:25 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:08 -0400 |
commit | fb9bc28f8bd8a6b9bc5fba7bcacc4bb131d2d5dc (patch) | |
tree | 3ba55a34149b7c6888be22f80adb7938ab2fe8ea /drivers/net/wireless/adm8211.c | |
parent | 2e08ac7e27c1e54ebf0f82abc03285663efe7d89 (diff) |
[PATCH] adm8211: Improve writing of mac addrs to registers
The mac address write is broken for big endian and the bssid write can be
simplified. This patch does both.
Signed-off-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/adm8211.c')
-rw-r--r-- | drivers/net/wireless/adm8211.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c index 0893d0d4a5eb..4c43cdb567c9 100644 --- a/drivers/net/wireless/adm8211.c +++ b/drivers/net/wireless/adm8211.c | |||
@@ -1283,8 +1283,7 @@ static void adm8211_set_bssid(struct ieee80211_hw *dev, const u8 *bssid) | |||
1283 | struct adm8211_priv *priv = dev->priv; | 1283 | struct adm8211_priv *priv = dev->priv; |
1284 | u32 reg; | 1284 | u32 reg; |
1285 | 1285 | ||
1286 | reg = bssid[0] | (bssid[1] << 8) | (bssid[2] << 16) | (bssid[3] << 24); | 1286 | ADM8211_CSR_WRITE(BSSID0, le32_to_cpu(*(__le32 *)bssid)); |
1287 | ADM8211_CSR_WRITE(BSSID0, reg); | ||
1288 | reg = ADM8211_CSR_READ(ABDA1); | 1287 | reg = ADM8211_CSR_READ(ABDA1); |
1289 | reg &= 0x0000ffff; | 1288 | reg &= 0x0000ffff; |
1290 | reg |= (bssid[4] << 16) | (bssid[5] << 24); | 1289 | reg |= (bssid[4] << 16) | (bssid[5] << 24); |
@@ -1414,8 +1413,8 @@ static int adm8211_add_interface(struct ieee80211_hw *dev, | |||
1414 | 1413 | ||
1415 | ADM8211_IDLE(); | 1414 | ADM8211_IDLE(); |
1416 | 1415 | ||
1417 | ADM8211_CSR_WRITE(PAR0, *(u32 *)conf->mac_addr); | 1416 | ADM8211_CSR_WRITE(PAR0, le32_to_cpu(*(__le32 *)conf->mac_addr)); |
1418 | ADM8211_CSR_WRITE(PAR1, *(u16 *)(conf->mac_addr + 4)); | 1417 | ADM8211_CSR_WRITE(PAR1, le16_to_cpu(*(__le16 *)(conf->mac_addr + 4))); |
1419 | 1418 | ||
1420 | adm8211_update_mode(dev); | 1419 | adm8211_update_mode(dev); |
1421 | 1420 | ||