diff mbox series

ramips: use hotplug script for EAP615-Wall MACs

Message ID 20220517145707.2749107-1-stijn@linux-ipv6.be
State Accepted, archived
Delegated to: Stijn Tintel
Headers show
Series ramips: use hotplug script for EAP615-Wall MACs | expand

Commit Message

Stijn Tintel May 17, 2022, 2:57 p.m. UTC
Using nvmem-cells to set the MAC address for a DBDC device results in
both PHY devices using the same MAC address. This in turn will result in
multiple BSSes using the same BSSID, which can cause various problems.

Use the hotplug script for the EAP615-Wall instead to avoid this.

Fixes: a1b8a4d7b3ff ("ramips: support TP-Link EAP615-Wall")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
---
 target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts      | 2 --
 .../mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Stijn Segers May 17, 2022, 8:17 p.m. UTC | #1
Hi Stijn,

Op dinsdag 17 mei 2022 om 17u57 schreef Stijn Tintel 
<stijn@linux-ipv6.be>:
> Using nvmem-cells to set the MAC address for a DBDC device results in
> both PHY devices using the same MAC address. This in turn will result 
> in
> multiple BSSes using the same BSSID, which can cause various problems.
> 
> Use the hotplug script for the EAP615-Wall instead to avoid this.
> 
> Fixes: a1b8a4d7b3ff ("ramips: support TP-Link EAP615-Wall")
> Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>


As advertised ;-). Tested on 22.03 branch, both radios use different 
MAC now.

Tested-by: Stijn Segers <foss@volatilesystems.org>

> ---
>  target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts      | 2 --
>  .../mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 
> ++++
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts 
> b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
> index a0c3912d8e..0be4af39e8 100644
> --- a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
> +++ b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
> @@ -144,8 +144,6 @@
>  		compatible = "mediatek,mt76";
>  		reg = <0x0000 0 0 0 0>;
>  		mediatek,mtd-eeprom = <&radio 0x0>;
> -		nvmem-cells = <&macaddr_info_8>;
> -		nvmem-cell-names = "mac-address";
>  	};
>  };
> 
> diff --git 
> a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac 
> b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
> index a35e9dcc28..5b12416872 100644
> --- 
> a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
> +++ 
> b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
> @@ -90,6 +90,10 @@ case "$board" in
>  		hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
>  		[ "$PHYNBR" = "1" ] &&  macaddr_add $hw_mac_addr "0x100000" > 
> /sys${DEVPATH}/macaddress
>  		;;
> +	tplink,eap615-wall-v1)
> +		hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)"
> +		macaddr_add "$hw_mac_addr" "$PHYNBR" > "/sys${DEVPATH}/macaddress"
> +		;;
>  	yuncore,ax820)
>  		[ "$PHYNBR" = "1" ] && \
>  			macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > 
> /sys${DEVPATH}/macaddress
> --
> 2.35.1
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

diff --git a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
index a0c3912d8e..0be4af39e8 100644
--- a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
+++ b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
@@ -144,8 +144,6 @@ 
 		compatible = "mediatek,mt76";
 		reg = <0x0000 0 0 0 0>;
 		mediatek,mtd-eeprom = <&radio 0x0>;
-		nvmem-cells = <&macaddr_info_8>;
-		nvmem-cell-names = "mac-address";
 	};
 };
 
diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index a35e9dcc28..5b12416872 100644
--- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -90,6 +90,10 @@  case "$board" in
 		hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
 		[ "$PHYNBR" = "1" ] &&  macaddr_add $hw_mac_addr "0x100000" > /sys${DEVPATH}/macaddress
 		;;
+	tplink,eap615-wall-v1)
+		hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)"
+		macaddr_add "$hw_mac_addr" "$PHYNBR" > "/sys${DEVPATH}/macaddress"
+		;;
 	yuncore,ax820)
 		[ "$PHYNBR" = "1" ] && \
 			macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress