projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
166d504
)
wl12xx: Read MAC address from NVS file on HW startup
author
Arik Nemtsov
<
[email protected]
>
Sat, 16 Oct 2010 19:49:52 +0000
(21:49 +0200)
committer
Luciano Coelho
<
[email protected]
>
Mon, 24 Jan 2011 20:11:51 +0000
(22:11 +0200)
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 <
[email protected]
>
Reviewed-by: Luciano Coelho <
[email protected]
>
Signed-off-by: Luciano Coelho <
[email protected]
>
drivers/net/wireless/wl12xx/main.c
patch
|
blob
|
history
diff --git
a/drivers/net/wireless/wl12xx/main.c
b/drivers/net/wireless/wl12xx/main.c
index a6de19a4ee0ef6654b2a50f34377b8dea893b406..78d61552598062ec6f73ea9b4e8ff83a09358c6b 100644
(file)
--- 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);