提交 31d26ec6 编写于 作者: A Arik Nemtsov 提交者: Luciano Coelho

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: NArik Nemtsov <arik@wizery.com>
Reviewed-by: NLuciano Coelho <coelho@ti.com>
Signed-off-by: NLuciano Coelho <coelho@ti.com>
上级 166d504e
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册