diff mbox

[OpenWrt-Devel] mac80211: restricted automatic channel selection

Message ID 1445940323-27905-1-git-send-email-helmut.schaa@googlemail.com
State Accepted
Headers show

Commit Message

Helmut Schaa Oct. 27, 2015, 10:05 a.m. UTC
Add a new config option "channels" for mac80211 wifi devices. It's only
valid if automatic channel selection is used and restricts the channel
selection to one of the given channels.

config wifi-device
	list channels	1
	list channels	6
	list channels	11

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 3 +++
 1 file changed, 3 insertions(+)

Comments

Karl Palsson Oct. 27, 2015, 4:58 p.m. UTC | #1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Helmut Schaa <helmut.schaa@googlemail.com> wrote:
> Add a new config option "channels" for mac80211 wifi devices.
> It's only valid if automatic channel selection is used and
> restricts the channel selection to one of the given channels.

Why is auto required explicitly? Isn't that implied if you have
multiple "channels" listed?

Your example below then isn't complete? you need "option channel
auto" as well?

> 
> config wifi-device
> 	list channels	1
> 	list channels	6
> 	list channels	11
> 
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
> ---
>  package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git
> a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
> b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
> index 2a8d2f9..7fc7d92 100644
> --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
> +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
> @@ -23,6 +23,7 @@ drv_mac80211_init_device_config() {
>  	config_add_int rxantenna txantenna antenna_gain txpower distance
>  	config_add_boolean noscan ht_coex
>  	config_add_array ht_capab
> +	config_add_array channels
>  	config_add_boolean \
>  		rxldpc \
>  		short_gi_80 \
> @@ -89,6 +90,7 @@ mac80211_hostapd_setup_base() {
>  	json_select config
>  
>  	[ "$auto_channel" -gt 0 ] && channel=acs_survey
> +	[ "$auto_channel" -gt 0 ] && json_get_values channel_list channels
>  
>  	json_get_vars noscan ht_coex
>  	json_get_values ht_capab_list ht_capab
> @@ -301,6 +303,7 @@ mac80211_hostapd_setup_base() {
>  	hostapd_prepare_device_config "$hostapd_conf_file" nl80211
>  	cat >> "$hostapd_conf_file" <<EOF
>  ${channel:+channel=$channel}
> +${channel_list:+chanlist=$channel_list}
>  ${noscan:+noscan=$noscan}
>  $base_cfg
>  
> -- 
> 1.8.4.5
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

- -- 
Sent using Mailpile, Free Software from www.mailpile.is

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJWL60hAAoJEBmotQ/U1cr2pcQQAItADyz+iVHcaUZTD4e/fI2E
Gs4M7UFF0KZbixE19GRWI0bEmOrMEUtlRF5xLFISGhw4BhKiDlY4K/pGTT2Cf6I3
1mdHGbx+rJ8KbwF2DjgUODHB47LyFvMi48GmgaEQMAgbIRgAN8W5fLUrF6JfYrTx
zUkYgpZJ0PVSHBbbjdhIVS4mfbdHJjsdIsyj1GR9X6hxKvLwv8s+m2PGR6OFJJKG
HNLarViM1cXwLotoTbEkTTPaSNuaU/ccVthQueCYooSjP0WqM2JDBXdYceT0HOjf
DM6wiAm+vQQ94RtObtp6/0Nh+ADUeFP0NE7UATpUfbcwjmnzrJK5mdT0iXlAula0
pFQfTemQe5sjW7rhfAMwyKIWAhcTNm9sS22k+iq9dXOoTZB7QdXAvbE+iRsfgPHL
1rOsgXXKOy42yiu+SNUREUNR44momxOlI+/yttaxEJGzyg2bROQXtPxnEHJkBBp0
OJ0Y1F/Yv2fdagQ9CceVxVzL4rDL9icklJmnB8sVVhEUHGk35CpQeQ4X2un6PMgj
PGT4a92lF16sMhvJEloeBtuQhnpCZglAIiW4hQ3ErQmrvmK+52LDm0En9MkoyxtO
49LSQgvm/XnZMkyAK10e58B37hfZSZLUl7e6WN70EXPf3/s6yHquDxvVu6oMsj9q
ztAlT9mIcj4S++IR7QPE
=g14m
-----END PGP SIGNATURE-----
Helmut Schaa Oct. 27, 2015, 6:45 p.m. UTC | #2
On Tue, Oct 27, 2015 at 5:58 PM, Karl Palsson <karlp@tweak.net.au> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Helmut Schaa <helmut.schaa@googlemail.com> wrote:
>> Add a new config option "channels" for mac80211 wifi devices.
>> It's only valid if automatic channel selection is used and
>> restricts the channel selection to one of the given channels.
>
> Why is auto required explicitly? Isn't that implied if you have
> multiple "channels" listed?

Sort of, yes. This part only enforces that the channel list is not
handed to hostapd if a fixed channel is used.

> Your example below then isn't complete? you need "option channel
> auto" as well?

Default in netifd is "auto" even if you don't provide it in the config.

Helmut

>>
>> config wifi-device
>>       list channels   1
>>       list channels   6
>>       list channels   11
>>
>> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
>> ---
>>  package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git
>> a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
>> b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
>> index 2a8d2f9..7fc7d92 100644
>> --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
>> +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
>> @@ -23,6 +23,7 @@ drv_mac80211_init_device_config() {
>>       config_add_int rxantenna txantenna antenna_gain txpower distance
>>       config_add_boolean noscan ht_coex
>>       config_add_array ht_capab
>> +     config_add_array channels
>>       config_add_boolean \
>>               rxldpc \
>>               short_gi_80 \
>> @@ -89,6 +90,7 @@ mac80211_hostapd_setup_base() {
>>       json_select config
>>
>>       [ "$auto_channel" -gt 0 ] && channel=acs_survey
>> +     [ "$auto_channel" -gt 0 ] && json_get_values channel_list channels
>>
>>       json_get_vars noscan ht_coex
>>       json_get_values ht_capab_list ht_capab
>> @@ -301,6 +303,7 @@ mac80211_hostapd_setup_base() {
>>       hostapd_prepare_device_config "$hostapd_conf_file" nl80211
>>       cat >> "$hostapd_conf_file" <<EOF
>>  ${channel:+channel=$channel}
>> +${channel_list:+chanlist=$channel_list}
>>  ${noscan:+noscan=$noscan}
>>  $base_cfg
>>
>> --
>> 1.8.4.5
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
> - --
> Sent using Mailpile, Free Software from www.mailpile.is
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iQIcBAEBAgAGBQJWL60hAAoJEBmotQ/U1cr2pcQQAItADyz+iVHcaUZTD4e/fI2E
> Gs4M7UFF0KZbixE19GRWI0bEmOrMEUtlRF5xLFISGhw4BhKiDlY4K/pGTT2Cf6I3
> 1mdHGbx+rJ8KbwF2DjgUODHB47LyFvMi48GmgaEQMAgbIRgAN8W5fLUrF6JfYrTx
> zUkYgpZJ0PVSHBbbjdhIVS4mfbdHJjsdIsyj1GR9X6hxKvLwv8s+m2PGR6OFJJKG
> HNLarViM1cXwLotoTbEkTTPaSNuaU/ccVthQueCYooSjP0WqM2JDBXdYceT0HOjf
> DM6wiAm+vQQ94RtObtp6/0Nh+ADUeFP0NE7UATpUfbcwjmnzrJK5mdT0iXlAula0
> pFQfTemQe5sjW7rhfAMwyKIWAhcTNm9sS22k+iq9dXOoTZB7QdXAvbE+iRsfgPHL
> 1rOsgXXKOy42yiu+SNUREUNR44momxOlI+/yttaxEJGzyg2bROQXtPxnEHJkBBp0
> OJ0Y1F/Yv2fdagQ9CceVxVzL4rDL9icklJmnB8sVVhEUHGk35CpQeQ4X2un6PMgj
> PGT4a92lF16sMhvJEloeBtuQhnpCZglAIiW4hQ3ErQmrvmK+52LDm0En9MkoyxtO
> 49LSQgvm/XnZMkyAK10e58B37hfZSZLUl7e6WN70EXPf3/s6yHquDxvVu6oMsj9q
> ztAlT9mIcj4S++IR7QPE
> =g14m
> -----END PGP SIGNATURE-----
diff mbox

Patch

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 2a8d2f9..7fc7d92 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -23,6 +23,7 @@  drv_mac80211_init_device_config() {
 	config_add_int rxantenna txantenna antenna_gain txpower distance
 	config_add_boolean noscan ht_coex
 	config_add_array ht_capab
+	config_add_array channels
 	config_add_boolean \
 		rxldpc \
 		short_gi_80 \
@@ -89,6 +90,7 @@  mac80211_hostapd_setup_base() {
 	json_select config
 
 	[ "$auto_channel" -gt 0 ] && channel=acs_survey
+	[ "$auto_channel" -gt 0 ] && json_get_values channel_list channels
 
 	json_get_vars noscan ht_coex
 	json_get_values ht_capab_list ht_capab
@@ -301,6 +303,7 @@  mac80211_hostapd_setup_base() {
 	hostapd_prepare_device_config "$hostapd_conf_file" nl80211
 	cat >> "$hostapd_conf_file" <<EOF
 ${channel:+channel=$channel}
+${channel_list:+chanlist=$channel_list}
 ${noscan:+noscan=$noscan}
 $base_cfg