From 339b35db0e1666d0d382aa7ef194ea04a689c197 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 4 Sep 2023 09:02:22 +0200 Subject: [PATCH 26/68] Revert: mac80211: change default ifname to - commit 6603748e0ca697f484adfc16a0d49d35ed36954d Author: Felix Fietkau Date: Fri Sep 23 14:12:32 2022 +0200 mac80211: change default ifname to - This makes it clear, which phy a wlan device belongs to and also helps with telling them apart by including the mode in the ifname. Preparation for automatically renaming PHYs Signed-off-by: Felix Fietkau Signed-off-by: John Crispin --- .../files/lib/netifd/wireless/mac80211.sh | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 860609305f..5dd780b473 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -132,7 +132,7 @@ mac80211_hostapd_setup_base() { json_select config - [ "$auto_channel" -gt 0 ] && channel=acs_survey + [ "$auto_channel" -gt 0 ] && channel=0 [ "$auto_channel" -gt 0 ] && json_get_vars acs_exclude_dfs [ -n "$acs_exclude_dfs" ] && [ "$acs_exclude_dfs" -gt 0 ] && @@ -620,28 +620,13 @@ mac80211_check_ap() { has_ap=1 } -mac80211_set_ifname() { - local phy="$1" - local prefix="$2" - eval "ifname=\"$phy-$prefix\${idx_$prefix:-0}\"; idx_$prefix=\$((\${idx_$prefix:-0 } + 1))" -} - mac80211_prepare_vif() { json_select config json_get_vars ifname mode ssid wds powersave macaddr enable wpa_psk_file vlan_file - [ -n "$ifname" ] || { - local prefix; - - case "$mode" in - ap|sta|mesh) prefix=$mode;; - adhoc) prefix=ibss;; - monitor) prefix=mon;; - esac - - mac80211_set_ifname "$phy" "$prefix" - } + [ -n "$ifname" ] || ifname="wlan${phy#phy}${if_idx:+-$if_idx}" + if_idx=$((${if_idx:-0} + 1)) append active_ifnames "$ifname" set_default wds 0 -- 2.34.1