diff options
author | Bob Copeland <me@bobcopeland.com> | 2008-11-17 23:40:38 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-26 09:47:35 -0500 |
commit | 0e149cf5a1b1900484f4b808d59a5f246cd720be (patch) | |
tree | 1392d353012242c9fc313ae67b881a8dccb9040c /drivers/net/wireless/ath5k/attach.c | |
parent | 8f93b8b337763a58fcdf23333ffe752db6c93bae (diff) |
ath5k: set mac address in add_interface
Configure the mac address in add_interface and clear it in
remove_interface so that users can change the mac address
to something other than the one in the eeprom. Also avoid
setting it at attach time so that we won't ack packets
until fully set up.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/attach.c')
-rw-r--r-- | drivers/net/wireless/ath5k/attach.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath5k/attach.c b/drivers/net/wireless/ath5k/attach.c index 51d569883cdd..49d82d79d3fc 100644 --- a/drivers/net/wireless/ath5k/attach.c +++ b/drivers/net/wireless/ath5k/attach.c | |||
@@ -106,7 +106,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) | |||
106 | { | 106 | { |
107 | struct ath5k_hw *ah; | 107 | struct ath5k_hw *ah; |
108 | struct pci_dev *pdev = sc->pdev; | 108 | struct pci_dev *pdev = sc->pdev; |
109 | u8 mac[ETH_ALEN]; | 109 | u8 mac[ETH_ALEN] = {}; |
110 | int ret; | 110 | int ret; |
111 | u32 srev; | 111 | u32 srev; |
112 | 112 | ||
@@ -317,15 +317,9 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) | |||
317 | goto err_free; | 317 | goto err_free; |
318 | } | 318 | } |
319 | 319 | ||
320 | /* Set MAC address */ | 320 | /* MAC address is cleared until add_interface */ |
321 | ret = ath5k_eeprom_read_mac(ah, mac); | ||
322 | if (ret) { | ||
323 | ATH5K_ERR(sc, "unable to read address from EEPROM: 0x%04x\n", | ||
324 | sc->pdev->device); | ||
325 | goto err_free; | ||
326 | } | ||
327 | |||
328 | ath5k_hw_set_lladdr(ah, mac); | 321 | ath5k_hw_set_lladdr(ah, mac); |
322 | |||
329 | /* Set BSSID to bcast address: ff:ff:ff:ff:ff:ff for now */ | 323 | /* Set BSSID to bcast address: ff:ff:ff:ff:ff:ff for now */ |
330 | memset(ah->ah_bssid, 0xff, ETH_ALEN); | 324 | memset(ah->ah_bssid, 0xff, ETH_ALEN); |
331 | ath5k_hw_set_associd(ah, ah->ah_bssid, 0); | 325 | ath5k_hw_set_associd(ah, ah->ah_bssid, 0); |