Commit 9d85833d authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Use random ethaddr if EEPROM address is corrupted

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent be1bc0c9
...@@ -904,30 +904,6 @@ u8 key_2char2num23a(u8 hch, u8 lch) ...@@ -904,30 +904,6 @@ u8 key_2char2num23a(u8 hch, u8 lch)
return key_char2num(hch) << 4 | key_char2num(lch); return key_char2num(hch) << 4 | key_char2num(lch);
} }
void rtw_macaddr_cfg23a(u8 *mac_addr)
{
u8 mac[ETH_ALEN];
if (!mac_addr)
return;
memcpy(mac, mac_addr, ETH_ALEN);
if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
mac[0] = 0x00;
mac[1] = 0xe0;
mac[2] = 0x4c;
mac[3] = 0x87;
mac[4] = 0x00;
mac[5] = 0x00;
/* use default mac addresss */
memcpy(mac_addr, mac, ETH_ALEN);
DBG_8723A("MAC Address from efuse error, assign default "
"one !!!\n");
}
DBG_8723A("rtw_macaddr_cfg23a MAC Address = "MAC_FMT"\n",
MAC_ARG(mac_addr));
}
static int rtw_get_cipher_info(struct wlan_network *pnetwork) static int rtw_get_cipher_info(struct wlan_network *pnetwork)
{ {
const u8 *pbuf; const u8 *pbuf;
......
...@@ -451,8 +451,6 @@ int rtw_check_network_type23a(unsigned char *rate, int ratelen, int channel); ...@@ -451,8 +451,6 @@ int rtw_check_network_type23a(unsigned char *rate, int ratelen, int channel);
void rtw_get_bcn_info23a(struct wlan_network *pnetwork); void rtw_get_bcn_info23a(struct wlan_network *pnetwork);
void rtw_macaddr_cfg23a(u8 *mac_addr);
u16 rtw_mcs_rate23a(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char * MCS_rate); u16 rtw_mcs_rate23a(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char * MCS_rate);
int rtw_action_frame_parse23a(const u8 *frame, u32 frame_len, u8* category, u8 *action); int rtw_action_frame_parse23a(const u8 *frame, u32 frame_len, u8* category, u8 *action);
......
...@@ -659,8 +659,10 @@ static struct rtw_adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, ...@@ -659,8 +659,10 @@ static struct rtw_adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
padapter->pwrctrlpriv.autopm_cnt = 1; padapter->pwrctrlpriv.autopm_cnt = 1;
#endif #endif
/* set mac addr */ /* If the eeprom mac address is corrupted, assign a random address */
rtw_macaddr_cfg23a(padapter->eeprompriv.mac_addr); if (is_broadcast_ether_addr(padapter->eeprompriv.mac_addr) ||
is_zero_ether_addr(padapter->eeprompriv.mac_addr))
eth_random_addr(padapter->eeprompriv.mac_addr);
DBG_8723A("bDriverStopped:%d, bSurpriseRemoved:%d, bup:%d, hw_init_completed:%d\n", DBG_8723A("bDriverStopped:%d, bSurpriseRemoved:%d, bup:%d, hw_init_completed:%d\n",
padapter->bDriverStopped, padapter->bSurpriseRemoved, padapter->bDriverStopped, padapter->bSurpriseRemoved,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment