diff options
author | Arik Nemtsov <arik@wizery.com> | 2010-10-16 19:49:52 (GMT) |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-01-24 20:11:51 (GMT) |
commit | 31d26ec6992cc05cfd5e50a59b00b0d64c7bb4aa (patch) | |
tree | 0567bc421cee6f2117a68e7deadfc66c26b77774 /drivers | |
parent | 166d504ebaed391f1a411c69a5659632249ba711 (diff) | |
download | linux-fsl-qoriq-31d26ec6992cc05cfd5e50a59b00b0d64c7bb4aa.tar.xz |
wl12xx: Read MAC address from NVS file on HW startup
Try to read the MAC address from the on-disk NVS file.
A non-zero MAC address is required to add an AP interface.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index a6de19a..78d6155 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c @@ -3064,6 +3064,18 @@ int wl1271_register_hw(struct wl1271 *wl) if (wl->mac80211_registered) return 0; + ret = wl1271_fetch_nvs(wl); + if (ret == 0) { + u8 *nvs_ptr = (u8 *)wl->nvs->nvs; + + wl->mac_addr[0] = nvs_ptr[11]; + wl->mac_addr[1] = nvs_ptr[10]; + wl->mac_addr[2] = nvs_ptr[6]; + wl->mac_addr[3] = nvs_ptr[5]; + wl->mac_addr[4] = nvs_ptr[4]; + wl->mac_addr[5] = nvs_ptr[3]; + } + SET_IEEE80211_PERM_ADDR(wl->hw, wl->mac_addr); ret = ieee80211_register_hw(wl->hw); |