wifi->esp8089: add wifi mac address user-defined function.
authorli bing <libing@rock-chips.com>
Fri, 5 Dec 2014 09:20:51 +0000 (17:20 +0800)
committerli bing <libing@rock-chips.com>
Fri, 5 Dec 2014 09:41:29 +0000 (17:41 +0800)
drivers/net/wireless/rockchip_wlan/esp8089/esp_driver/esp_mac80211.c

index 21f873050563ff5e1a50b28340ec1dd47e7ff4c8..48be10c5039f49d398422b763f1b2dbaa52639d6 100755 (executable)
@@ -24,6 +24,7 @@
 #include "esp_debug.h"
 #include "esp_wl.h"
 #include "esp_utils.h"
+#include <linux/rfkill-wlan.h>
 
 #define ESP_IEEE80211_DBG esp_dbg
 
@@ -2194,14 +2195,25 @@ esp_pub_init_mac80211(struct esp_pub *epub)
 int
 esp_register_mac80211(struct esp_pub *epub)
 {
-        int ret = 0;
+       int ret = 0;
+       u8 mac[ETH_ALEN];
 #ifdef P2P_CONCURRENT
        u8 *wlan_addr;
        u8 *p2p_addr;
        int idx;
 #endif
 
-        esp_pub_init_mac80211(epub);
+       esp_pub_init_mac80211(epub);
+
+       printk("Wifi Efuse Mac => %02x:%02x:%02x:%02x:%02x:%02x\n", epub->mac_addr[0], epub->mac_addr[1],
+          epub->mac_addr[2], epub->mac_addr[3], epub->mac_addr[4], epub->mac_addr[5]);
+       
+       if (!rockchip_wifi_mac_addr(mac)) 
+       {
+               printk("=========> get mac address from flash=[%02x:%02x:%02x:%02x:%02x:%02x]\n", mac[0], mac[1],
+                mac[2], mac[3], mac[4], mac[5]);
+               memcpy(epub->mac_addr, mac, ETH_ALEN);
+       }
 
 #ifdef P2P_CONCURRENT
        epub->hw->wiphy->addresses = (struct mac_address *)esp_mac_addr;