wifi driver: rtl8723bs, rtl8723bs-vq0, rtl8723bu, rtl8812au, modify custom mac addr...
authorhwg <hwg@rock-chips.com>
Mon, 20 Apr 2015 08:07:18 +0000 (16:07 +0800)
committerhwg <hwg@rock-chips.com>
Mon, 20 Apr 2015 08:23:18 +0000 (16:23 +0800)
drivers/net/wireless/rockchip_wlan/rtl8723bs-vq0/core/rtw_ieee80211.c
drivers/net/wireless/rockchip_wlan/rtl8723bs/core/rtw_ieee80211.c
drivers/net/wireless/rockchip_wlan/rtl8723bu/core/rtw_ieee80211.c
drivers/net/wireless/rockchip_wlan/rtl8812au/core/rtw_ieee80211.c

index 6240b5306060dc1b53ffe413b54ccce483c2572a..bc6b5fb2879b1589e65061341526bbc55d28268d 100755 (executable)
@@ -1383,7 +1383,7 @@ int rtw_get_mac_addr_intel(unsigned char *buf)
 #endif //CONFIG_PLATFORM_INTEL_BYT
 
 extern char* rtw_initmac;
-extern int rockchip_wifi_mac_addr(unsigned char *buf);
+#include <linux/rfkill-wlan.h>
 void rtw_macaddr_cfg(u8 *mac_addr)
 {
        u8 mac[ETH_ALEN];
@@ -1399,19 +1399,20 @@ void rtw_macaddr_cfg(u8 *mac_addr)
                }
                _rtw_memcpy(mac_addr, mac, ETH_ALEN);
        }
-       else
-       {
-               printk("Wifi Efuse Mac => %02x:%02x:%02x:%02x:%02x:%02x\n", 
-                                                               mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
-               if (!rockchip_wifi_mac_addr(mac_addr)) {
-                       printk("Use flash MAC = %02x:%02x:%02x:%02x:%02x:%02x\n", 
-                                                                   mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
-               } else {
-                       //  Use the mac address stored in the Efuse
-                       _rtw_memcpy(mac, mac_addr, ETH_ALEN);
-               }
-       }
-       
+    else
+    {
+        printk("Wifi Efuse Mac => %02x:%02x:%02x:%02x:%02x:%02x\n", mac_addr[0], mac_addr[1],
+            mac_addr[2], mac_addr[3], mac_addr[4], 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]);
+            _rtw_memcpy(mac_addr, mac, ETH_ALEN);
+        } else {
+            //  Use the mac address stored in the Efuse
+            _rtw_memcpy(mac, mac_addr, ETH_ALEN);
+        }
+    }
+
        if (((mac[0]==0xff) &&(mac[1]==0xff) && (mac[2]==0xff) &&
             (mac[3]==0xff) && (mac[4]==0xff) &&(mac[5]==0xff)) ||
            ((mac[0]==0x0) && (mac[1]==0x0) && (mac[2]==0x0) &&
index 424e917c39624b49729462a8b748451ed68851a9..3a7ad41a0b98d264fbaa101ac56f936f410514e4 100755 (executable)
@@ -1383,11 +1383,11 @@ int rtw_get_mac_addr_intel(unsigned char *buf)
 #endif //CONFIG_PLATFORM_INTEL_BYT
 
 extern char* rtw_initmac;
-extern int rockchip_wifi_mac_addr(unsigned char *buf);
+#include <linux/rfkill-wlan.h>
 void rtw_macaddr_cfg(u8 *mac_addr)
 {
-       u8 mac[ETH_ALEN];
-        u8 macbuf[30] = {0};
+    u8 mac[ETH_ALEN];
+
        if(mac_addr == NULL)    return;
        
        if ( rtw_initmac )
@@ -1407,23 +1407,19 @@ void rtw_macaddr_cfg(u8 *mac_addr)
        }
 #endif //CONFIG_PLATFORM_INTEL_BYT
        else
-       {       //      Use the mac address stored in the Efuse
-            printk("Wifi Efuse Mac => %02x:%02x:%02x:%02x:%02x:%02x\n", mac_addr[0], mac_addr[1],
+    {
+        printk("Wifi Efuse Mac => %02x:%02x:%02x:%02x:%02x:%02x\n", mac_addr[0], mac_addr[1],
             mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
-            if (!rockchip_wifi_mac_addr(macbuf)) {
-            int jj,kk;
-            printk("=========> get mac address from flash %s\n", macbuf);
-                for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 )
-                  {
-                   mac[jj] = key_2char2num(macbuf[kk], macbuf[kk+ 1]);
-                  }
-                _rtw_memcpy(mac_addr, mac, ETH_ALEN);
-             }else{
-              //  Use the mac address stored in the Efuse
-              _rtw_memcpy(mac, mac_addr, ETH_ALEN);
-             };
-       }
-       
+        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]);
+            _rtw_memcpy(mac_addr, mac, ETH_ALEN);
+        } else {
+            //  Use the mac address stored in the Efuse
+            _rtw_memcpy(mac, mac_addr, ETH_ALEN);
+        }
+    }
+
        if (((mac[0]==0xff) &&(mac[1]==0xff) && (mac[2]==0xff) &&
             (mac[3]==0xff) && (mac[4]==0xff) &&(mac[5]==0xff)) ||
            ((mac[0]==0x0) && (mac[1]==0x0) && (mac[2]==0x0) &&
index eabc91f58e161f221efe8ee5d0c9e451de4d4199..ba6cad26514bcd58634f97d0c8bc59b8e28b021b 100755 (executable)
@@ -1383,6 +1383,7 @@ int rtw_get_mac_addr_intel(unsigned char *buf)
 #endif //CONFIG_PLATFORM_INTEL_BYT
 
 extern char* rtw_initmac;
+#include <linux/rfkill-wlan.h>
 void rtw_macaddr_cfg(u8 *mac_addr)
 {
        u8 mac[ETH_ALEN];
@@ -1405,10 +1406,19 @@ void rtw_macaddr_cfg(u8 *mac_addr)
        }
 #endif //CONFIG_PLATFORM_INTEL_BYT
        else
-       {       //      Use the mac address stored in the Efuse
-               _rtw_memcpy(mac, mac_addr, ETH_ALEN);
-       }
-       
+    {
+        printk("Wifi Efuse Mac => %02x:%02x:%02x:%02x:%02x:%02x\n", mac_addr[0], mac_addr[1],
+            mac_addr[2], mac_addr[3], mac_addr[4], 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]);
+            _rtw_memcpy(mac_addr, mac, ETH_ALEN);
+        } else {
+            //  Use the mac address stored in the Efuse
+            _rtw_memcpy(mac, mac_addr, ETH_ALEN);
+        }
+    }
+
        if (((mac[0]==0xff) &&(mac[1]==0xff) && (mac[2]==0xff) &&
             (mac[3]==0xff) && (mac[4]==0xff) &&(mac[5]==0xff)) ||
            ((mac[0]==0x0) && (mac[1]==0x0) && (mac[2]==0x0) &&
index 354e7fcee8e972519ce4352826060bd5cf1c51b7..65ee37c27b834ca20bab387d2b47b69e55fab4fd 100755 (executable)
@@ -1347,6 +1347,7 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch)
 }
 
 extern char* rtw_initmac;
+#include <linux/rfkill-wlan.h>
 void rtw_macaddr_cfg(u8 *mac_addr)
 {
        u8 mac[ETH_ALEN];
@@ -1363,10 +1364,19 @@ void rtw_macaddr_cfg(u8 *mac_addr)
                _rtw_memcpy(mac_addr, mac, ETH_ALEN);
        }
        else
-       {       //      Use the mac address stored in the Efuse
-               _rtw_memcpy(mac, mac_addr, ETH_ALEN);
-       }
-       
+    {
+        printk("Wifi Efuse Mac => %02x:%02x:%02x:%02x:%02x:%02x\n", mac_addr[0], mac_addr[1],
+            mac_addr[2], mac_addr[3], mac_addr[4], 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]);
+            _rtw_memcpy(mac_addr, mac, ETH_ALEN);
+        } else {
+            //  Use the mac address stored in the Efuse
+            _rtw_memcpy(mac, mac_addr, ETH_ALEN);
+        }
+    }
+
        if (((mac[0]==0xff) &&(mac[1]==0xff) && (mac[2]==0xff) &&
             (mac[3]==0xff) && (mac[4]==0xff) &&(mac[5]==0xff)) ||
            ((mac[0]==0x0) && (mac[1]==0x0) && (mac[2]==0x0) &&