]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
wl1271: Fix random MAC address setting
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>
Thu, 18 Feb 2010 11:25:46 +0000 (13:25 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 19 Feb 2010 20:52:44 +0000 (15:52 -0500)
If reverting to a random MAC address, the driver would not update it to the
NVS file, and hence the firmware frame filtering would not work properly.

So update the randomized MAC address to the NVS image.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/wl1271_main.c

index e698dec40511c56fa1422e774da37fe86e3dde14..c7f5191e7dbfaa9b2df83e1ebf55f9671782285a 100644 (file)
@@ -562,6 +562,14 @@ static int wl1271_update_mac_addr(struct wl1271 *wl)
                static const u8 nokia_oui[3] = {0x00, 0x1f, 0xdf};
                memcpy(wl->mac_addr, nokia_oui, 3);
                get_random_bytes(wl->mac_addr + 3, 3);
+
+               /* update this address to the 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];
        }
 
        SET_IEEE80211_PERM_ADDR(wl->hw, wl->mac_addr);