}
extern char* rtw_initmac;
+#include <linux/rfkill-wlan.h>
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)
}
extern char* rtw_initmac;
+#include <linux/rfkill-wlan.h>
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)
extern char* rtw_initmac;
#include <linux/rfkill-wlan.h>
-
void rtw_macaddr_cfg(u8 *mac_addr)
{
u8 mac[ETH_ALEN];
- u8 macbuf[30] = {0};
if(mac_addr == NULL) return;
{
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
}
extern char* rtw_initmac;
+#include <linux/rfkill-wlan.h>
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) {
}
extern char* rtw_initmac;
+#include <linux/rfkill-wlan.h>
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)
}
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};
if(mac_addr == NULL) return;
{
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
}
extern char* rtw_initmac;
+#include <linux/rfkill-wlan.h>
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)
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__);
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);