Merge branch 'chanbwselector' into develop

This commit is contained in:
Conrad Lara - KG6JEI 2014-07-14 22:54:26 -07:00
commit 20e1a8ca5a
12 changed files with 44 additions and 0 deletions

View File

@ -3,6 +3,7 @@ wifi_mode = ap
wifi_ssid = <NODE>
wifi_txpower = 19
wifi_channel = 6
wifi_chanbw = 20
wifi_distance = 0
wifi_hidden = 0

View File

@ -3,6 +3,7 @@ wifi_mode = ap
wifi_ssid = <NODE>
wifi_txpower = 19
wifi_channel = 6
wifi_chanbw = 20
wifi_distance = 0
wifi_hidden = 0

View File

@ -2,6 +2,7 @@ config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option distance <wifi_distance>
config wifi-iface

View File

@ -5,6 +5,7 @@ wifi_ssid = BroadbandHamnet-v2
wifi_mode = adhoc
wifi_txpower = 19
wifi_channel = 1
wifi_chanbw = 20
wifi_distance = 0
wifi_country = 00

View File

@ -5,6 +5,7 @@ wifi_ssid = BroadbandHamnet-v2
wifi_mode = adhoc
wifi_txpower = 19
wifi_channel = 1
wifi_chanbw = 20
wifi_distance = 0
wifi_country = 00

View File

@ -2,6 +2,7 @@ config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option distance <wifi_distance>
option country <wifi_country>

View File

@ -3,6 +3,7 @@ wifi_mode = ap
wifi_ssid = <NODE>
wifi_txpower = 19
wifi_channel = 6
wifi_chanbw = 20
wifi_distance = 0
wifi_hidden = 0

View File

@ -3,6 +3,7 @@ wifi_mode = ap
wifi_ssid = <NODE>
wifi_txpower = 19
wifi_channel = 6
wifi_chanbw = 20
wifi_distance = 0
wifi_hidden = 0

View File

@ -2,6 +2,7 @@ config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option distance <wifi_distance>
config wifi-iface

View File

@ -2,6 +2,7 @@ config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option disabled 1
config wifi-iface

View File

@ -139,6 +139,25 @@ sub rf_channels_list
}
}
sub is_wifi_chanbw_valid
{
my ($wifi_chanbw,$wifi_ssid) = @_;
my $boardinfo=hardware_info();
if ( ( exists($boardinfo->{'rfband'}) ) && ( $boardinfo->{'rfband'} == "2400" ) && ( $wifi_chanbw != 20 ) )
{
if ( (( length $wifi_ssid >= 33 ) || ( length $wifi_ssid == 0 )) || ( $wifi_ssid =~ /BroadBandHamnet-v.*/i ))
{
# 2.4ghz and default ssid not 20mhz wide -- Invalid chan_bw
return 0;
} else {
# chan_bw valid
return 1;
}
}
# Not 2.4ghz or device is unknown, trust the user submission.
return 1;
}
#weird uhttpd/busybox error requires a 1 at the end of this file
1

View File

@ -179,6 +179,12 @@ if($parms{button_save})
push (@errors, "invalid WiFi channel")
}
if ( !is_wifi_chanbw_valid($wifi_chanbw,$wifi_ssid) )
{
push (@errors, "Invalid WiFi channel width");
$wifi_chanbw = 20;
}
push (@errors, "invalid WiFi distance") if $wifi_distance < 0 or $wifi_distance =~ /\D/;
$wifi_country_validated=0;
@ -523,6 +529,15 @@ if($wifi_proto ne "disabled")
push @hidden, "<input type=hidden name=wifi_channel value='$wifi_channel'>";
}
{
print "<tr><td>Channel Width</td>\n";
print "<td><select name=wifi_chanbw>\n";
selopt("20 MHz","20",$wifi_chanbw);
selopt("10 MHz","10",$wifi_chanbw);
selopt("5 MHz","5",$wifi_chanbw);
print "</select></td></tr>\n";
}
if ($config ne "mesh")
{
print "<tr><td>Country</td>\n";