Patch to set MAC address for 8189fs

http://forum.armbian.com/index.php/topic/2191-orange-pi-pc-same-mac-address-on-wlan0/
This commit is contained in:
Igor Pecovnik 2016-09-30 07:30:56 +02:00
parent 32d22d733f
commit 1b4c92e53a
2 changed files with 38 additions and 6 deletions

View File

@ -0,0 +1,38 @@
diff -Nur a/drivers/net/wireless/rtl8189fs/core/rtw_ieee80211.c b/drivers/net/wireless/rtl8189fs/core/rtw_ieee80211.c
--- a/drivers/net/wireless/rtl8189fs/core/rtw_ieee80211.c 2016-02-25 06:58:52.000000000 +0100
+++ b/drivers/net/wireless/rtl8189fs/core/rtw_ieee80211.c 2016-09-27 21:44:26.470787346 +0200
@@ -1467,17 +1467,22 @@
goto func_exit;
}
+#if 0
if (check_local_bit == _TRUE) {
if (mac_addr[0] & BIT1) {
res = _TRUE;
goto func_exit;
}
}
+#else
+ (void) check_local_bit;
+#endif
func_exit:
return res;
}
+extern void wifi_hwaddr_from_chipid(u8 *addr);
extern char* rtw_initmac;
/**
* rtw_macaddr_cfg - Decide the mac address used
@@ -1510,6 +1515,11 @@
goto err_chk;
#endif
+#ifdef CONFIG_PLATFORM_ARM_SUN8I
+ wifi_hwaddr_from_chipid(mac);
+ goto err_chk;
+#endif
+
/* Use the mac address stored in the Efuse */
if (hw_mac_addr) {
_rtw_memcpy(mac, hw_mac_addr, ETH_ALEN);

View File

@ -108,12 +108,6 @@ collect_information() {
} # collect_information
adjust_sunxi_settings() {
# set some mac address for wifi
[[ "$(lsmod | grep 8189fs)" != "" ]] && \
(MACADDR=$(printf '00:E0:4C:%02X:%02X:%02X\n' $[RANDOM%256] $[RANDOM%256] $[RANDOM%256]) ; \
echo "options 8189fs rtw_initmac=${MACADDR}" > /etc/modprobe.d/8189fs.conf ; \
echo -e "\n### [firstrun] Use MAC address ${MACADDR} for Wi-Fi from now" >>${Log})
# set some mac address for BT
[[ "$(lsmod | grep bcmdhd)" != "" ]] && \
(MACADDR=$(printf '43:29:B1:%02X:%02X:%02X\n' $[RANDOM%256] $[RANDOM%256] $[RANDOM%256]) ; \