diff options
author | Luciano Coelho <coelho@ti.com> | 2011-12-23 08:32:17 +0100 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-02-15 07:38:29 +0100 |
commit | 5e037e74802a10a71dddbb05585753b2fcbd8ad7 (patch) | |
tree | 4fca005d0d5bdf06ed0d44a095e5bf3c36c27999 /drivers/net/wireless/wl12xx/boot.c | |
parent | wl12xx: read chip ID and HW PG version during probe (diff) | |
download | linux-5e037e74802a10a71dddbb05585753b2fcbd8ad7.tar.xz linux-5e037e74802a10a71dddbb05585753b2fcbd8ad7.zip |
wl12xx: use two MAC addresses based on the NVS or from fuse ROM
Add support for two MAC addresses. If the NVS has a valid MAC
address, that takes precedence and we use two sequential address
starting from the one specified.
If the NVS doesn't contain a valid MAC address (ie. if it is set to
00:00:00:00:00:00), we check if the HW PG version in use has the
BD_ADDR written in the fuse ROM. If it does, we read it and derive
the two subsequent addresses for WLAN.
During production, 3 addresses are reserved per device. The first for
Bluetooth (burnt in the fuse ROM) and the following two for WLAN.
This patch has some code by Igal and Arik (squashed from internal
patches).
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/boot.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/boot.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/wl12xx/boot.c b/drivers/net/wireless/wl12xx/boot.c index 599919e2a60d..32a7f9b69d7c 100644 --- a/drivers/net/wireless/wl12xx/boot.c +++ b/drivers/net/wireless/wl12xx/boot.c @@ -258,12 +258,12 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl) } /* update current MAC address to NVS */ - nvs_ptr[11] = wl->mac_addr[0]; - nvs_ptr[10] = wl->mac_addr[1]; - nvs_ptr[6] = wl->mac_addr[2]; - nvs_ptr[5] = wl->mac_addr[3]; - nvs_ptr[4] = wl->mac_addr[4]; - nvs_ptr[3] = wl->mac_addr[5]; + nvs_ptr[11] = wl->addresses[0].addr[0]; + nvs_ptr[10] = wl->addresses[0].addr[1]; + nvs_ptr[6] = wl->addresses[0].addr[2]; + nvs_ptr[5] = wl->addresses[0].addr[3]; + nvs_ptr[4] = wl->addresses[0].addr[4]; + nvs_ptr[3] = wl->addresses[0].addr[5]; /* * Layout before the actual NVS tables: @@ -626,7 +626,7 @@ static int wl127x_boot_clk(struct wl1271 *wl) u32 pause; u32 clk; - if (((wl->hw_pg_ver & PG_MAJOR_VER_MASK) >> PG_MAJOR_VER_OFFSET) < 3) + if (WL127X_PG_GET_MAJOR(wl->hw_pg_ver) < 3) wl->quirks |= WL12XX_QUIRK_END_OF_TRANSACTION; if (wl->ref_clock == CONF_REF_CLK_19_2_E || |