mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-30 18:07:52 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			71 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			71 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From ab10243a695beaefcf48aad10d3311c81124b35e Mon Sep 17 00:00:00 2001
 | |
| From: John Crispin <john@phrozen.org>
 | |
| Date: Mon, 4 Sep 2023 09:02:22 +0200
 | |
| Subject: [PATCH 55/55] Revert: mac80211: change default ifname to
 | |
|  <phy>-<type><index>
 | |
| 
 | |
|     commit 6603748e0ca697f484adfc16a0d49d35ed36954d
 | |
|     Author: Felix Fietkau <nbd@nbd.name>
 | |
|     Date:   Fri Sep 23 14:12:32 2022 +0200
 | |
| 
 | |
|     mac80211: change default ifname to <phy>-<type><index>
 | |
| 
 | |
|     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 <nbd@nbd.name>
 | |
| 
 | |
| Signed-off-by: John Crispin <john@phrozen.org>
 | |
| ---
 | |
|  .../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 3b88af4679..f3c982e9f1 100644
 | |
| --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
 | |
| +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
 | |
| @@ -131,7 +131,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 ] &&
 | |
| @@ -656,28 +656,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
 | |
| 
 | 
