Merge branch 'release-1.1.0'

This commit is contained in:
Conrad Lara - KG6JEI 2014-07-07 22:44:09 -07:00
commit 9a7cdf8874
15 changed files with 138 additions and 100 deletions

View File

1
files/etc/crontabs/root Normal file
View File

@ -0,0 +1 @@
*/5 * * * * /usr/local/bin/fccid

View File

@ -51,7 +51,7 @@ is_olsrgw=`cat /etc/config.mesh/_setup|grep -i olsrd_gw|cut -d ' ' -f 3`
echo "Setting routing rules." echo "Setting routing rules."
if [ "$INTERFACE" == "wifi" ] || [ "$INTERFACE" == "dtdlink" ]; then if [ "$INTERFACE" == "wifi" ] || [ "$INTERFACE" == "dtdlink" ]; then
if [ -z /etc/config/dmz-mode ] ; then if [ -e /etc/config/dmz-mode ] ; then
ip rule add pref 20010 iif $DEVICE lookup 29 ip rule add pref 20010 iif $DEVICE lookup 29
fi fi
ip rule add pref 20020 iif $DEVICE lookup 30 ip rule add pref 20020 iif $DEVICE lookup 30

View File

@ -1,4 +1,4 @@
src/gz packages http://www.broadband-hamnet.org/download/backfire/10.03.1/ar71xx/packages src/gz packages http://www.broadband-hamnet.org/download/attitude_adjustment/12.09/ar71xx/generic/packages
dest root / dest root /
dest ram /tmp dest ram /tmp
lists_dir ext /var/opkg-lists lists_dir ext /var/opkg-lists

View File

@ -1,56 +1,66 @@
base-files base-files
bridge bridge
busybox busybox
crda
dnsmasq dnsmasq
dropbear dropbear
firewall firewall
hotplug2 hotplug2
ip
ip6tables ip6tables
iptables iptables
iptables-mod-conntrack iptables-mod-ipopt
iptables-mod-nat
iw iw
iwinfo
jshn
kernel kernel
kmod-ath kmod-ath
kmod-ath9k kmod-ath9k
kmod-ath9k-common kmod-ath9k-common
kmod-button-hotplug
kmod-cfg80211 kmod-cfg80211
kmod-crc-ccitt
kmod-crypto-aes kmod-crypto-aes
kmod-crypto-arc4 kmod-crypto-arc4
kmod-crypto-core kmod-crypto-core
kmod-input-core kmod-gpio-button-hotplug
kmod-input-gpio-buttons
kmod-input-polldev
kmod-ip6tables kmod-ip6tables
kmod-ipt-conntrack kmod-ipt-conntrack
kmod-ipt-core kmod-ipt-core
kmod-ipt-ipopt
kmod-ipt-nat kmod-ipt-nat
kmod-ipt-nathelper kmod-ipt-nathelper
kmod-ipv6 kmod-ipv6
kmod-leds-gpio kmod-leds-gpio
kmod-ledtrig-default-on
kmod-ledtrig-netdev
kmod-ledtrig-timer
kmod-ledtrig-usbdev
kmod-lib-crc-ccitt
kmod-mac80211 kmod-mac80211
kmod-nls-base kmod-nls-base
kmod-ppp kmod-ppp
kmod-pppoe kmod-pppoe
kmod-pppox
kmod-usb-core kmod-usb-core
kmod-usb-ohci kmod-usb-ohci
kmod-usb-uhci kmod-usb-uhci
kmod-usb2 kmod-usb2
kmod-wdt-ath79
libblobmsg-json
libc libc
libgcc libgcc
libip4tc libip4tc
libip6tc libip6tc
libiwinfo
libjson
libnl-tiny libnl-tiny
libpcap libpcap
libpthread libpthread
librt librt
libubox
libubus
libuci libuci
libxtables libxtables
microperl
mtd mtd
netifd
ntpclient ntpclient
olsrd olsrd
olsrd-mod-arprefresh olsrd-mod-arprefresh
@ -58,6 +68,7 @@ olsrd-mod-dot-draw
olsrd-mod-dyn-gw olsrd-mod-dyn-gw
olsrd-mod-httpinfo olsrd-mod-httpinfo
olsrd-mod-nameservice olsrd-mod-nameservice
olsrd-mod-secure
olsrd-mod-txtinfo olsrd-mod-txtinfo
olsrd-mod-watchdog olsrd-mod-watchdog
opkg opkg
@ -68,11 +79,13 @@ perlbase-perlio
perlbase-xsloader perlbase-xsloader
ppp ppp
ppp-mod-pppoe ppp-mod-pppoe
ssidident
swconfig swconfig
tcpdump-mini tcpdump-mini
uboot-envtools
ubus
ubusd
uci uci
udevtrigger
uhttpd uhttpd
wireless-tools
wpad-mini wpad-mini
xinetd xinetd

9
files/usr/local/bin/fccid Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
[ -f /etc/config/run-fccid ] || exit
# stagger the beacons between nodes
N=`ifconfig wlan0 | grep "inet addr" | cut -f4 -d. | cut -c1-3`
sleep $N
echo "ID: `uname -n`" | socat - udp4:10.255.255.255:4919,broadcast,so-bindtodevice=wlan0

View File

@ -227,6 +227,7 @@ print HOSTS "127.0.0.1\tlocalhost\n";
print HOSTS "$cfg{lan_ip}\tlocalnode "; print HOSTS "$cfg{lan_ip}\tlocalnode ";
print HOSTS "\n$cfg{wifi_ip}\t" if $cfg{wifi_ip}; print HOSTS "\n$cfg{wifi_ip}\t" if $cfg{wifi_ip};
print HOSTS "$node $tactical\n"; print HOSTS "$node $tactical\n";
print HOSTS "$cfg{dtdlink_ip}\tdtdlink.$node.local.mesh dtdlink.$node" if $cfg{dtdlink_ip};
print HOSTS add_ip_address($cfg{lan_ip}, 1), "\tlocalap\n" unless $cfg{dmz_mode}; print HOSTS add_ip_address($cfg{lan_ip}, 1), "\tlocalap\n" unless $cfg{dmz_mode};
open(ETHER, ">/etc/ethers") or die; open(ETHER, ">/etc/ethers") or die;
@ -384,7 +385,7 @@ unless($cfg{wifi_proto} eq "disabled")
if(wifi_useschains()){ if(wifi_useschains()){
print FILE "/usr/local/bin/wifi-onbootchains\n"; print FILE "/usr/local/bin/wifi-onbootchains\n";
} }
print FILE "/usr/sbin/iwconfig wlan0 txpower $cfg{wifi_txpower}\n"; print FILE "/usr/sbin/iw dev wlan0 set txpower fixed $cfg{wifi_txpower}00\n";
if(defined $cfg{aprs_lat} and defined $cfg{aprs_lon}) if(defined $cfg{aprs_lat} and defined $cfg{aprs_lon})
{ {
printf FILE "echo %s,%s > /tmp/latlon.txt\n", $cfg{aprs_lat}, $cfg{aprs_lon}; printf FILE "echo %s,%s > /tmp/latlon.txt\n", $cfg{aprs_lat}, $cfg{aprs_lon};

View File

@ -25,6 +25,14 @@ if(-f "/etc/config/dmz-mode")
} }
} }
# Add a name for the dtdlink interface.
if ($name = nvram_get("node"))
{
my ($dtdip,$dtdmask,$dtdbcast,$dtdnet);
($dtdip, $dtdmask, $dtdbcast, $dtdnet) = get_ip4_network("eth0.2");
push @hosts, qq("$dtdip" "dtdlink.$name.local.mesh");
}
# load the services # load the services
foreach(`cat /etc/config/services 2>/dev/null`) foreach(`cat /etc/config/services 2>/dev/null`)
{ {

View File

@ -186,8 +186,8 @@ sub pushAP
if($ssid eq "") { $ssid = "(hidden)" } if($ssid eq "") { $ssid = "(hidden)" }
if($key eq "off") { $key = " " } if($key eq "none") { $key = " " }
else { $key = "*" } else { $key = "*" }
$mac =~ /^(\w\w):(\w\w):(\w\w):(\w\w):(\w\w):(\w\w)/; $mac =~ /^(\w\w):(\w\w):(\w\w):(\w\w):(\w\w):(\w\w)/;
$mac1 = $1 . $2 . $3; $mac1 = $1 . $2 . $3;
@ -248,36 +248,35 @@ die "bad interface" if not defined $iface;
if($raw) if($raw)
{ {
system("/usr/sbin/iwlist $iface scan"); system("/usr/bin/iwinfo $iface scan");
exit; exit;
} }
while(1) while(1)
{ {
open(FILE, "/usr/sbin/iwlist $iface scan 2>&1 |") or die "iwlist failed"; open(FILE, "/usr/bin/iwinfo $iface scan 2>&1 |") or die "iwinfo failed";
$mode = ""; $mode = "";
@list = (); @list = ();
++$iters; ++$iters;
while($line = <FILE>) while($line = <FILE>)
{ {
if($line =~ /\s+Cell \d+ - Address: (\S+)/) if($line =~ /Cell \d+ - Address: (\S+)/)
{ {
if ( $lastseen < 10000 ) { pushAP($signal, $chan, $key, $ssid, $mac, $mode) } pushAP($signal, $chan, $key, $ssid, $mac, $mode);
$mac = $1; $mac = $1;
$mode = ""; $mode = "";
} }
if($line =~ /\bESSID:"(.*)"/) { $ssid = $1 } if($line =~ /\bESSID: "(.*)"/) { $ssid = $1 }
if($line =~ /\bMode:(\S+)/) { $mode = $1 } if($line =~ /\bMode: (\S+)/) { $mode = $1 }
if($line =~ /\bChannel:(\d+)/) { $chan = $1 } if($line =~ /\bChannel: (\d+)/) { $chan = $1 }
if($line =~ /\bSignal level=([\d-]+)/) { $signal = $1 } if($line =~ /\bSignal: ([\d-]+)/) { $signal = $1 }
if($line =~ /\bEncryption key:(\w+)/) { $key = $1 } if($line =~ /\bEncryption: (\w+)/) { $key = $1 }
if($line =~ /\bExtra: Last beacon: (\d+)ms/) { $lastseen = $1 }
} }
close(FILE); close(FILE);
if ( $lastseen < 10000 ) { pushAP($signal, $chan, $key, $ssid, $mac, $mode) } pushAP($signal, $chan, $key, $ssid, $mac, $mode);
sleep 1 if not scalar @list and $loops != 1; sleep 1 if not scalar @list and $loops != 1;
if(not $batch) if(not $batch)

View File

@ -321,7 +321,7 @@ foreach(`cat /etc/permpkg 2>/dev/null`)
if($parms{button_ul_pkg} and -f "/tmp/web/upload/file") if($parms{button_ul_pkg} and -f "/tmp/web/upload/file")
{ {
system "mv -f /tmp/web/upload/file /tmp/web/upload/newpkg.ipk"; system "mv -f /tmp/web/upload/file /tmp/web/upload/newpkg.ipk";
push @pkg_output, `yes | opkg -force-overwrite install /tmp/web/upload/newpkg.ipk 2>&1`; push @pkg_output, `opkg -force-overwrite install /tmp/web/upload/newpkg.ipk 2>&1`;
system "rm -rf /tmp/opkg-*"; system "rm -rf /tmp/opkg-*";
} }
@ -330,7 +330,7 @@ if($parms{button_dl_pkg} and $parms{dl_pkg} ne "default")
{ {
if(get_default_gw() ne "none") if(get_default_gw() ne "none")
{ {
push @pkg_output, `yes | opkg -force-overwrite install $parms{dl_pkg} 2>&1`; push @pkg_output, `opkg -force-overwrite install $parms{dl_pkg} 2>&1`;
} }
else else
{ {

View File

@ -99,9 +99,10 @@ sub is_channel_valid
# We don't have the device band in the data file so lets fall back to checking manually # We don't have the device band in the data file so lets fall back to checking manually
else { else {
my $channelok=0; my $channelok=0;
foreach (`iwlist wlan0 channel`) foreach (`iwinfo wlan0 freqlist`)
{ {
next unless /Channel $channel/; next unless /Channel $channel/;
next if /\[restricted\]/;
$channelok=1; $channelok=1;
} }
return $channelok; return $channelok;
@ -125,11 +126,12 @@ sub rf_channels_list
else else
{ {
my %channels = (); my %channels = ();
foreach (`iwlist wlan0 channel` ) foreach (`iwinfo wlan0 freqlist` )
{ {
next unless /([0-9]+) : ([0-9]+.[0-9]+)/; next unless /([0-9]+.[0-9]+) GHz \(Channel ([0-9]+)\)/;
my $channelnum = $1; next if /\[restricted\]/;
my $channelfreq = $2; my $channelnum = $2;
my $channelfreq = $1;
$channelnum =~s/^0+//g; $channelnum =~s/^0+//g;
$channels->{$channelnum} = "$channelfreq GHZ" ; $channels->{$channelnum} = "$channelfreq GHZ" ;
} }

View File

@ -73,7 +73,7 @@ foreach(`cat /etc/hosts`)
next unless /^10[.]/; next unless /^10[.]/;
chomp; chomp;
($ip, $name, $tactical) = split /\s+/, $_; ($ip, $name, $tactical) = split /\s+/, $_;
next if $name =~ /^(localhost|localnode|localap)$/; next if $name =~ /^(localhost|localnode|localap|dtdlink\..*)$/;
if($ip eq $my_ip) if($ip eq $my_ip)
{ {
$tactical = "" unless $tactical; $tactical = "" unless $tactical;
@ -94,10 +94,18 @@ foreach(`cat /var/run/hosts_olsr 2>/dev/null`)
($ip, $name, $junk, $originator, $mid, $midnum) = split /\s+/, $_; ($ip, $name, $junk, $originator, $mid, $midnum) = split /\s+/, $_;
next unless $originator; next unless $originator;
next if $originator eq "myself"; next if $originator eq "myself";
if ( $name =~ /^dtdlink\..*$/ )
{
$hosts{$ip}{name} = $name;
next;
}
if(defined $mid and $midnum =~ /^\#(\d+)/) if(defined $mid and $midnum =~ /^\#(\d+)/)
{ {
$hosts{$ip}{name} = $name; if ( !exists $hosts{$ip}{name} )
{
$hosts{$ip}{name} = $name;
}
$hosts{$ip}{hide} = 1; $hosts{$ip}{hide} = 1;
$hosts{$originator}{mid} = $1; $hosts{$originator}{mid} = $1;
} }

View File

@ -1,4 +1,4 @@
############################# ##########################
# html functions # html functions
# emit the http server response # emit the http server response
@ -83,13 +83,13 @@ sub read_query_string
# c-style fgets for read_postdata # c-style fgets for read_postdata
$stdinbuffer = ""; $stdinbuffer = "";
sub fgets sub fgets
{ {
my($size) = @_; my($size) = @_;
my $line = ""; my $line = "";
while(1) while(1)
{ {
unless(length $stdinbuffer) unless(length $stdinbuffer)
@ -118,14 +118,14 @@ sub fgets
# (from STDIN in method=post form) # (from STDIN in method=post form)
sub read_postdata sub read_postdata
{ {
if ( $ENV{REQUEST_METHOD} != "POST" || !$ENV{CONTENT_LENGTH}){ return; };
my ($line, $parm, $file, $handle, $tmp); my ($line, $parm, $file, $handle, $tmp);
my $state = "boundary"; my $state = "boundary";
my ($boundary) = $ENV{CONTENT_TYPE} =~ /boundary=(\S+)/ if $ENV{CONTENT_TYPE}; my ($boundary) = $ENV{CONTENT_TYPE} =~ /boundary=(\S+)/ if $ENV{CONTENT_TYPE};
my $parsedebug = 0; my $parsedebug = 0;
push(@parse_errors, "[$boundary]") if $parsedebug; push(@parse_errors, "[$boundary]") if $parsedebug;
while(length ($line = fgets(1000))) while(length ($line = fgets(1000)))
{ {
$line =~ s/[\r\n]+$//; # chomp doesn't strip \r! $line =~ s/[\r\n]+$//; # chomp doesn't strip \r!
#print "[$state] $line<br>\n"; #print "[$state] $line<br>\n";
@ -546,25 +546,15 @@ sub save_setup
sub get_wifi_signal sub get_wifi_signal
{ {
# CMLARA: my $wifiintf = `uci -q get network.wifi.ifname`;
# this would be easy if /proc/net/wireless updated automatically, but it doesn't. chomp $wifiintf;
# the hack is to re-scan
# also iwlist doesnt correctly limit to single ssid
# and we have to call from 2 programs now instead of 1
my ($ssid) = (`uci -q get wireless.\@wifi-iface[0].ssid`);
chomp $ssid;
my ($SignalLevel) = "N/A"; my ($SignalLevel) = "N/A";
my ($NoiseFloor) = "N/A"; my ($NoiseFloor) = "N/A";
foreach(`iwlist $_[0] scanning essid "$ssid" |tr '\n' ' '|sed 's/Cell \\([0-9]\\{2,\\}\\) - Address:/\\nCell \\1 - Address:/g'|grep -i "$ssid"`) foreach(`iwinfo $wifiintf info`)
{ {
next unless /.*Signal level=([\d\-]+) dBm.* Extra: Last beacon: ([\d]+)ms/; next unless /.*Signal: ([\d\-]+) dBm.*Noise: ([\d\-]+) dBm/;
if ( $2 < 10000 ) {$SignalLevel=$1;} $SignalLevel=$1;
} $NoiseFloor=$2;
foreach(`iw dev $_[0] survey dump|grep -A 1 \"\\[in use\\]\"`)
{
next unless /([\d\-]+) dBm/;
$NoiseFloor=$1;
} }
if ( $SignalLevel == "N/A" || $NoiseFloor == "N/A" ) if ( $SignalLevel == "N/A" || $NoiseFloor == "N/A" )
@ -592,9 +582,9 @@ sub get_free_mem
{ {
foreach(`free`) foreach(`free`)
{ {
next unless /^\s+Mem[:]/; next unless /^Mem[:]/;
my @tmp = split /\s+/, $_; my @tmp = split /\s+/, $_;
return $tmp[4] + $tmp[6]; return $tmp[3] + $tmp[5];
} }
return "N/A"; return "N/A";
} }
@ -946,8 +936,8 @@ sub hardware_info
}, },
'0xe1b5' => { '0xe1b5' => {
'name' => 'Rocket M5', 'name' => 'Rocket M5',
'comment' => 'Rocket M5 in testing', 'comment' => 'Rocket M5',
'supported' => '-2', 'supported' => '1',
'maxpower' => '22', 'maxpower' => '22',
'pwroffset' => '5', 'pwroffset' => '5',
'antennas' => { 1 => "Chain0", 2 => "Chain1", 3 => "Diversity"}, 'antennas' => { 1 => "Chain0", 2 => "Chain1", 3 => "Diversity"},
@ -968,8 +958,8 @@ sub hardware_info
}, },
'0xe205' => { '0xe205' => {
'name' => 'Bullet M5', 'name' => 'Bullet M5',
'comment' => 'Bullet M5 In testing.', 'comment' => 'Bullet M5',
'supported' => '-2', 'supported' => '1',
'maxpower' => '19', 'maxpower' => '19',
'pwroffset' => '6', 'pwroffset' => '6',
'antennas' => { 1 => 'N Connector' }, 'antennas' => { 1 => 'N Connector' },
@ -979,8 +969,8 @@ sub hardware_info
}, },
'0xe215' => { '0xe215' => {
'name' => 'airGrid M5', 'name' => 'airGrid M5',
'comment' => 'airGrid M5 in testing', 'comment' => 'airGrid M5',
'supported' => '-2', 'supported' => '1',
'maxpower' => '19', 'maxpower' => '19',
'pwroffset' => '1', 'pwroffset' => '1',
'antennas' => { 1 => 'airGrid' }, 'antennas' => { 1 => 'airGrid' },
@ -990,8 +980,8 @@ sub hardware_info
}, },
'0xe232' => { '0xe232' => {
'name' => 'NannoBridge M2', 'name' => 'NannoBridge M2',
'comment' => 'NanoBridge M2 in testing', 'comment' => 'NanoBridge M2',
'supported' => '-2', 'supported' => '1',
'maxpower' => '21', 'maxpower' => '21',
'pwroffset' => '2', 'pwroffset' => '2',
'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity"}, 'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity"},
@ -1001,8 +991,8 @@ sub hardware_info
}, },
'0xe242' => { '0xe242' => {
'name' => 'airGrid M2 HP', 'name' => 'airGrid M2 HP',
'comment' => 'airGrid M2 HP in testing', 'comment' => 'airGrid M2 HP',
'supported' => '-2', 'supported' => '1',
'maxpower' => '19', 'maxpower' => '19',
'pwroffset' => '9', 'pwroffset' => '9',
'antennas' => { 1 => 'airGrid' }, 'antennas' => { 1 => 'airGrid' },
@ -1013,7 +1003,7 @@ sub hardware_info
'0xe243' => { '0xe243' => {
'name' => 'NannoBridge M3', 'name' => 'NannoBridge M3',
'comment' => 'Not Tested', 'comment' => 'Not Tested',
'supported' => '-1', 'supported' => '-2',
'maxpower' => '22', 'maxpower' => '22',
'pwroffset' => '3', 'pwroffset' => '3',
'antennas' => { 1 => "Chain0", 2 => "Chain1", 3 => "Diversity"}, 'antennas' => { 1 => "Chain0", 2 => "Chain1", 3 => "Diversity"},
@ -1034,8 +1024,8 @@ sub hardware_info
}, },
'0xe255' => { '0xe255' => {
'name' => 'airGrid M5 HP', 'name' => 'airGrid M5 HP',
'comment' => 'airGrid M5 HP in testing', 'comment' => 'airGrid M5',
'supported' => '-2', 'supported' => '1',
'maxpower' => '19', 'maxpower' => '19',
'pwroffset' => '6', 'pwroffset' => '6',
'antennas' => { 1 => 'airGrid' }, 'antennas' => { 1 => 'airGrid' },
@ -1045,8 +1035,8 @@ sub hardware_info
}, },
'0xe2b5' => { '0xe2b5' => {
'name' => 'NannoBridge M5', 'name' => 'NannoBridge M5',
'comment' => 'NanoBridge M5 in testing', 'comment' => 'NanoBridge M5',
'supported' => '-2', 'supported' => '1',
'maxpower' => '22', 'maxpower' => '22',
'pwroffset' => '1', 'pwroffset' => '1',
'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity"}, 'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity"},
@ -1056,8 +1046,8 @@ sub hardware_info
}, },
'0xe2c2' => { '0xe2c2' => {
'name' => 'NannoBeam M2 International', 'name' => 'NannoBeam M2 International',
'comment' => 'NanoBeam M2 International in testing', 'comment' => 'NanoBeam M2 International -- XW board unsupported at this time',
'supported' => '-2', 'supported' => '-1',
'maxpower' => '18', 'maxpower' => '18',
'pwroffset' => '10', 'pwroffset' => '10',
'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity"}, 'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity"},
@ -1067,8 +1057,8 @@ sub hardware_info
}, },
'0xe2d2' => { '0xe2d2' => {
'name' => 'Bullet M2 Titanium HP', 'name' => 'Bullet M2 Titanium HP',
'comment' => 'Bullet M2 TI in testing', 'comment' => 'Bullet M2 Titanium',
'supported' => '-2', 'supported' => '1',
'maxpower' => '16', 'maxpower' => '16',
'pwroffset' => '12', 'pwroffset' => '12',
'antennas' => { 1 => 'N Connector' }, 'antennas' => { 1 => 'N Connector' },
@ -1078,8 +1068,8 @@ sub hardware_info
}, },
'0xe2d5' => { '0xe2d5' => {
'name' => 'Bullet M5 Titanium', 'name' => 'Bullet M5 Titanium',
'comment' => 'Bullet M5 TI in testing', 'comment' => 'Bullet M5 Titanium',
'supported' => '-2', 'supported' => '1',
'maxpower' => '19', 'maxpower' => '19',
'pwroffset' => '6', 'pwroffset' => '6',
'antennas' => { 1 => 'N Connector' }, 'antennas' => { 1 => 'N Connector' },
@ -1089,8 +1079,8 @@ sub hardware_info
}, },
'0xe302' => { '0xe302' => {
'name' => 'PicoStation M2', 'name' => 'PicoStation M2',
'comment' => 'PicoStation M2 in testing', 'comment' => 'PicoStation M2',
'supported' => '-2', 'supported' => '1',
'maxpower' => '16', 'maxpower' => '16',
'pwroffset' => '12', 'pwroffset' => '12',
'antennas' => { 1 => 'Antenna' }, 'antennas' => { 1 => 'Antenna' },
@ -1100,8 +1090,8 @@ sub hardware_info
}, },
'0xe4e5' => { '0xe4e5' => {
'name' => 'NannoBeam M5 International', 'name' => 'NannoBeam M5 International',
'comment' => 'NanoBeam M5 International in testing', 'comment' => 'NanoBeam M5 International XW series unsuported at this time',
'supported' => '-2', 'supported' => '-1',
'maxpower' => '22', 'maxpower' => '22',
'pwroffset' => '1', 'pwroffset' => '1',
'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity"}, 'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity"},
@ -1111,8 +1101,8 @@ sub hardware_info
}, },
'0xe805' => { '0xe805' => {
'name' => 'NanoStation M5', 'name' => 'NanoStation M5',
'comment' => 'NanoStation M5 in testing', 'comment' => 'NanoStation M5',
'supported' => '-2', 'supported' => '1',
'maxpower' => '22', 'maxpower' => '22',
'pwroffset' => '5', 'pwroffset' => '5',
'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity" }, 'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity" },
@ -1122,8 +1112,8 @@ sub hardware_info
}, },
'0xe8a5' => { '0xe8a5' => {
'name' => 'NanoStation Loco M5', 'name' => 'NanoStation Loco M5',
'comment' => 'NanoStation Loco M5 in testing', 'comment' => 'NanoStation Loco M5',
'supported' => '-2', 'supported' => '1',
'maxpower' => '22', 'maxpower' => '22',
'pwroffset' => '1', 'pwroffset' => '1',
'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity" }, 'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity" },
@ -1199,13 +1189,18 @@ sub wifi_useschains
#has increased it to a higher level. #has increased it to a higher level.
sub wifi_txpoweroffset sub wifi_txpoweroffset
{ {
my $doesiwoffset=`iwinfo wlan0 info 2>/dev/null` =~ /TX power offset: (\d+)/;
$boardinfo = hardware_info(); if ( $doesiwoffset ) {
if ( exists $boardinfo->{'pwroffset'} ) { return $1;
return $boardinfo->{'pwroffset'};
} else } else
{ {
return 0; $boardinfo = hardware_info();
if ( exists $boardinfo->{'pwroffset'} ) {
return $boardinfo->{'pwroffset'};
} else
{
return 0;
}
} }
} }

View File

@ -5,7 +5,6 @@ $debug = 0;
BEGIN {push @INC, '/www/cgi-bin'}; BEGIN {push @INC, '/www/cgi-bin'};
use perlfunc; use perlfunc;
use channelmaps; use channelmaps;
# #
# load the config parms # load the config parms
# #
@ -95,7 +94,11 @@ $parms{dmz_dhcp_limit} = $dmz_dhcp_limit = $dmz_dhcp_end - $dmz_dhcp_start;
unless($parms{reload}) unless($parms{reload})
{ {
($wifi_txpower) = `iwconfig wlan0 2>/dev/null` =~ /Tx-Power=(\d+)/; ($wifi_txpower) = `iwinfo wlan0 info 2>/dev/null` =~ /Tx-Power: (\d+)/;
(my $doesiwoffset) = `iwinfo wlan0 info 2>/dev/null` =~ /TX power offset: (\d+)/;
if ( $doesiwoffset ) {
$wifi_txpower -= $1;
}
if (wifi_useschains()){ if (wifi_useschains()){
$wifi_txant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask`; $wifi_txant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/tx_chainmask`;
$wifi_rxant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/rx_chainmask`; $wifi_rxant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/rx_chainmask`;
@ -146,7 +149,7 @@ if($parms{button_apply} or $parms{button_save})
$cmd .= "ifup wifi_mon >/dev/null 2>&1;"; $cmd .= "ifup wifi_mon >/dev/null 2>&1;";
} }
$cmd .= "iw phy phy0 set distance $wifi_distance >/dev/null 2>&1;"; $cmd .= "iw phy phy0 set distance $wifi_distance >/dev/null 2>&1;";
$cmd .= "iwconfig wlan0 txpower $wifi_txpower >/dev/null 2>&1;"; $cmd .= "iw dev wlan0 set txpower fixed ${wifi_txpower}00 >/dev/null 2>&1;";
system $cmd; system $cmd;
} }
@ -553,7 +556,8 @@ if($wifi_proto ne "disabled")
print "<tr><td><nobr>Tx Power</nobr></td>\n"; print "<tr><td><nobr>Tx Power</nobr></td>\n";
print "<td><select name=wifi_txpower>\n"; print "<td><select name=wifi_txpower>\n";
for($i = wifi_maxpower(); $i >= 1; --$i) { selopt($i+wifi_txpoweroffset()." dBm", $i, $wifi_txpower) } my $txpoweroffset = wifi_txpoweroffset();
for($i = wifi_maxpower(); $i >= 1; --$i) { selopt($i+$txpoweroffset ." dBm", $i, $wifi_txpower) }
print "</select></td></tr>\n"; print "</select></td></tr>\n";
print "<tr><td>Distance</td>\n"; print "<tr><td>Distance</td>\n";

View File

@ -1,10 +1,8 @@
#!/usr/bin/perl #!/usr/bin/perl
$debug = 0; $debug = 0;
BEGIN {push @INC, '/www/cgi-bin'}; BEGIN {push @INC, '/www/cgi-bin'};
use perlfunc; use perlfunc;
# collect some variables # collect some variables
$node = nvram_get("node"); $node = nvram_get("node");
$node = "NOCALL" if $node eq ""; $node = "NOCALL" if $node eq "";
@ -212,7 +210,7 @@ push @col2, "<th align=right>system time</th><td>" . `date +'%a %b %e %Y<br>%T %
$uptime = `uptime`; $uptime = `uptime`;
$uptime =~ s/^ ..:..:.. up //; $uptime =~ s/^ ..:..:.. up //;
($uptime, $load) = $uptime =~ /(.*), load average: (.*)/; ($uptime, $load) = $uptime =~ /(.*), load average: (.*)/;
push @col2, "<th align=right>uptime<br>load average</th><td>$uptime<br>$load</td>"; push @col2, "<th align=right>uptime<br>load average</th><td>$uptime<br>$load</td>";
$str = "<th align=right>free space</th><td><nobr>flash = "; $str = "<th align=right>free space</th><td><nobr>flash = ";