From 8cfd5b89267ea205bc74bf5a85859c70842c916e Mon Sep 17 00:00:00 2001 From: gwl Date: Wed, 17 Sep 2014 09:36:44 +0800 Subject: [PATCH] Wifi: add wifi mac address user-defined function. --- .../rtl8188eu/core/rtw_ieee80211.c | 77 +++++++++++-------- .../rtl8189es/core/rtw_ieee80211.c | 77 +++++++++++-------- .../rtl8192cu/core/rtw_ieee80211.c | 12 +-- .../rtl8192du/core/rtw_ieee80211.c | 77 +++++++++++-------- .../rtl8723au/core/rtw_ieee80211.c | 77 +++++++++++-------- .../rtl8723bs/core/rtw_ieee80211.c | 14 +--- .../rtl8723bu/core/rtw_ieee80211.c | 77 +++++++++++-------- net/rfkill/rfkill-wlan.c | 8 +- 8 files changed, 228 insertions(+), 191 deletions(-) diff --git a/drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_ieee80211.c b/drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_ieee80211.c index 97eba25e0fee..789d30fa4ec0 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_ieee80211.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8188eu/core/rtw_ieee80211.c @@ -1348,43 +1348,54 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch) } extern char* rtw_initmac; +#include void rtw_macaddr_cfg(u8 *mac_addr) { - u8 mac[ETH_ALEN]; - if(mac_addr == NULL) return; - - if ( rtw_initmac ) - { // Users specify the mac address - int jj,kk; + u8 mac[ETH_ALEN]; - for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) - { - mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[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 (((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) && - (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) - { - mac[0] = 0x00; - mac[1] = 0xe0; - mac[2] = 0x4c; - mac[3] = 0x87; - mac[4] = 0x00; - mac[5] = 0x00; - // use default mac addresss - _rtw_memcpy(mac_addr, mac, ETH_ALEN); - DBG_871X("MAC Address from efuse error, assign default one !!!\n"); - } + if(mac_addr == NULL) return; - DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); + if ( rtw_initmac ) + { // Users specify the mac address + int jj,kk; + + for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + { + mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk+ 1]); + } + _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)) { + 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) && + (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) + { + mac[0] = 0x00; + mac[1] = 0xe0; + mac[2] = 0x4c; + mac[3] = 0x87; + mac[4] = 0x00; + mac[5] = 0x00; + // use default mac addresss + _rtw_memcpy(mac_addr, mac, ETH_ALEN); + DBG_871X("MAC Address from efuse error, assign default one !!!\n"); + } + + DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); } void dump_ies(u8 *buf, u32 buf_len) diff --git a/drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ieee80211.c b/drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ieee80211.c index 97eba25e0fee..789d30fa4ec0 100644 --- a/drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ieee80211.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ieee80211.c @@ -1348,43 +1348,54 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch) } extern char* rtw_initmac; +#include void rtw_macaddr_cfg(u8 *mac_addr) { - u8 mac[ETH_ALEN]; - if(mac_addr == NULL) return; - - if ( rtw_initmac ) - { // Users specify the mac address - int jj,kk; + u8 mac[ETH_ALEN]; - for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) - { - mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[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 (((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) && - (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) - { - mac[0] = 0x00; - mac[1] = 0xe0; - mac[2] = 0x4c; - mac[3] = 0x87; - mac[4] = 0x00; - mac[5] = 0x00; - // use default mac addresss - _rtw_memcpy(mac_addr, mac, ETH_ALEN); - DBG_871X("MAC Address from efuse error, assign default one !!!\n"); - } + if(mac_addr == NULL) return; - DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); + if ( rtw_initmac ) + { // Users specify the mac address + int jj,kk; + + for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + { + mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk+ 1]); + } + _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)) { + 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) && + (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) + { + mac[0] = 0x00; + mac[1] = 0xe0; + mac[2] = 0x4c; + mac[3] = 0x87; + mac[4] = 0x00; + mac[5] = 0x00; + // use default mac addresss + _rtw_memcpy(mac_addr, mac, ETH_ALEN); + DBG_871X("MAC Address from efuse error, assign default one !!!\n"); + } + + DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); } void dump_ies(u8 *buf, u32 buf_len) diff --git a/drivers/net/wireless/rockchip_wlan/rtl8192cu/core/rtw_ieee80211.c b/drivers/net/wireless/rockchip_wlan/rtl8192cu/core/rtw_ieee80211.c index a1c5cba18ee6..a7f2150e947b 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8192cu/core/rtw_ieee80211.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8192cu/core/rtw_ieee80211.c @@ -1216,11 +1216,9 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch) extern char* rtw_initmac; #include - void rtw_macaddr_cfg(u8 *mac_addr) { u8 mac[ETH_ALEN]; - u8 macbuf[30] = {0}; if(mac_addr == NULL) return; @@ -1238,13 +1236,9 @@ void rtw_macaddr_cfg(u8 *mac_addr) { 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]); - } + 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 diff --git a/drivers/net/wireless/rockchip_wlan/rtl8192du/core/rtw_ieee80211.c b/drivers/net/wireless/rockchip_wlan/rtl8192du/core/rtw_ieee80211.c index 2edc9a9f385d..d45e5732bdd2 100644 --- a/drivers/net/wireless/rockchip_wlan/rtl8192du/core/rtw_ieee80211.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8192du/core/rtw_ieee80211.c @@ -1237,43 +1237,54 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch) } extern char* rtw_initmac; +#include void rtw_macaddr_cfg(u8 *mac_addr) { - u8 mac[ETH_ALEN]; - if(mac_addr == NULL) return; - - if ( rtw_initmac ) - { // Users specify the mac address - int jj,kk; + u8 mac[ETH_ALEN]; - for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) - { - mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[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 (((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) && - (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) - { - mac[0] = 0x00; - mac[1] = 0xe0; - mac[2] = 0x4c; - mac[3] = 0x87; - mac[4] = 0x00; - mac[5] = 0x00; - // use default mac addresss - _rtw_memcpy(mac_addr, mac, ETH_ALEN); - DBG_871X("MAC Address from efuse error, assign default one !!!\n"); - } + if(mac_addr == NULL) return; - DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); + if ( rtw_initmac ) + { // Users specify the mac address + int jj,kk; + + for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + { + mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk+ 1]); + } + _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)) { + 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) && + (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) + { + mac[0] = 0x00; + mac[1] = 0xe0; + mac[2] = 0x4c; + mac[3] = 0x87; + mac[4] = 0x00; + mac[5] = 0x00; + // use default mac addresss + _rtw_memcpy(mac_addr, mac, ETH_ALEN); + DBG_871X("MAC Address from efuse error, assign default one !!!\n"); + } + + DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); } void dump_ies(u8 *buf, u32 buf_len) { diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723au/core/rtw_ieee80211.c b/drivers/net/wireless/rockchip_wlan/rtl8723au/core/rtw_ieee80211.c index af32123cbcc0..98c92eedaca0 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8723au/core/rtw_ieee80211.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8723au/core/rtw_ieee80211.c @@ -1314,43 +1314,54 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch) } extern char* rtw_initmac; +#include void rtw_macaddr_cfg(u8 *mac_addr) { - u8 mac[ETH_ALEN]; - if(mac_addr == NULL) return; - - if ( rtw_initmac ) - { // Users specify the mac address - int jj,kk; + u8 mac[ETH_ALEN]; - for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) - { - mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[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 (((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) && - (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) - { - mac[0] = 0x00; - mac[1] = 0xe0; - mac[2] = 0x4c; - mac[3] = 0x87; - mac[4] = 0x00; - mac[5] = 0x00; - // use default mac addresss - _rtw_memcpy(mac_addr, mac, ETH_ALEN); - DBG_871X("MAC Address from efuse error, assign default one !!!\n"); - } + if(mac_addr == NULL) return; - DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); + if ( rtw_initmac ) + { // Users specify the mac address + int jj,kk; + + for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + { + mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk+ 1]); + } + _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)) { + 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) && + (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) + { + mac[0] = 0x00; + mac[1] = 0xe0; + mac[2] = 0x4c; + mac[3] = 0x87; + mac[4] = 0x00; + mac[5] = 0x00; + // use default mac addresss + _rtw_memcpy(mac_addr, mac, ETH_ALEN); + DBG_871X("MAC Address from efuse error, assign default one !!!\n"); + } + + DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); } void dump_ies(u8 *buf, u32 buf_len) diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723bs/core/rtw_ieee80211.c b/drivers/net/wireless/rockchip_wlan/rtl8723bs/core/rtw_ieee80211.c index 4eaf3809bd71..7340d469fc42 100755 --- a/drivers/net/wireless/rockchip_wlan/rtl8723bs/core/rtw_ieee80211.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8723bs/core/rtw_ieee80211.c @@ -1326,12 +1326,10 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch) } extern char* rtw_initmac; -extern int rockchip_wifi_mac_addr(unsigned char *buf); - +#include void rtw_macaddr_cfg(u8 *mac_addr) { u8 mac[ETH_ALEN]; - u8 macbuf[30] = {0}; if(mac_addr == NULL) return; @@ -1349,13 +1347,9 @@ void rtw_macaddr_cfg(u8 *mac_addr) { 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]); - } + 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 diff --git a/drivers/net/wireless/rockchip_wlan/rtl8723bu/core/rtw_ieee80211.c b/drivers/net/wireless/rockchip_wlan/rtl8723bu/core/rtw_ieee80211.c index 97eba25e0fee..789d30fa4ec0 100644 --- a/drivers/net/wireless/rockchip_wlan/rtl8723bu/core/rtw_ieee80211.c +++ b/drivers/net/wireless/rockchip_wlan/rtl8723bu/core/rtw_ieee80211.c @@ -1348,43 +1348,54 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch) } extern char* rtw_initmac; +#include void rtw_macaddr_cfg(u8 *mac_addr) { - u8 mac[ETH_ALEN]; - if(mac_addr == NULL) return; - - if ( rtw_initmac ) - { // Users specify the mac address - int jj,kk; + u8 mac[ETH_ALEN]; - for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) - { - mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[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 (((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) && - (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) - { - mac[0] = 0x00; - mac[1] = 0xe0; - mac[2] = 0x4c; - mac[3] = 0x87; - mac[4] = 0x00; - mac[5] = 0x00; - // use default mac addresss - _rtw_memcpy(mac_addr, mac, ETH_ALEN); - DBG_871X("MAC Address from efuse error, assign default one !!!\n"); - } + if(mac_addr == NULL) return; - DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); + if ( rtw_initmac ) + { // Users specify the mac address + int jj,kk; + + for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 ) + { + mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk+ 1]); + } + _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)) { + 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) && + (mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0))) + { + mac[0] = 0x00; + mac[1] = 0xe0; + mac[2] = 0x4c; + mac[3] = 0x87; + mac[4] = 0x00; + mac[5] = 0x00; + // use default mac addresss + _rtw_memcpy(mac_addr, mac, ETH_ALEN); + DBG_871X("MAC Address from efuse error, assign default one !!!\n"); + } + + DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr)); } void dump_ies(u8 *buf, u32 buf_len) diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c index 56c0de199083..1ce1da6d7912 100755 --- a/net/rfkill/rfkill-wlan.c +++ b/net/rfkill/rfkill-wlan.c @@ -508,8 +508,6 @@ u8 wifi_custom_mac_addr[6] = {0,0,0,0,0,0}; extern char GetSNSectorInfo(char * pbuf); int rockchip_wifi_mac_addr(unsigned char *buf) { - return -1; -/* char mac_buf[20] = {0}; LOG("%s: enter.\n", __func__); @@ -541,13 +539,9 @@ int rockchip_wifi_mac_addr(unsigned char *buf) return -1; } -#if defined(CONFIG_RKWIFI) memcpy(buf, wifi_custom_mac_addr, 6); -#else - memcpy(buf, mac_buf, strlen(mac_buf));//realtek's wifi use this branch -#endif + return 0; -*/ } EXPORT_SYMBOL(rockchip_wifi_mac_addr); -- 2.34.1