Merge branch 'upgdOpenWRT1209' into develop

This commit is contained in:
Conrad Lara - KG6JEI 2014-05-06 20:04:07 -07:00
commit 9d6fe1bca4
7 changed files with 76 additions and 65 deletions

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 ram /tmp
lists_dir ext /var/opkg-lists

View File

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

View File

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

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
else {
my $channelok=0;
foreach (`iwlist wlan0 channel`)
foreach (`iwinfo wlan0 channels`)
{
next unless /Channel $channel/;
next if /\[restricted\]/;
$channelok=1;
}
return $channelok;
@ -125,11 +126,12 @@ sub rf_channels_list
else
{
my %channels = ();
foreach (`iwlist wlan0 channel` )
foreach (`iwinfo wlan0 freqlist` )
{
next unless /([0-9]+) : ([0-9]+.[0-9]+)/;
my $channelnum = $1;
my $channelfreq = $2;
next unless /([0-9]+.[0-9]+) Ghz \(Channel ([0-9]+)\)/;
next if /\[restricted\]/;
my $channelnum = $2;
my $channelfreq = $1;
$channelnum =~s/^0+//g;
$channels->{$channelnum} = "$channelfreq GHZ" ;
}

View File

@ -1,4 +1,4 @@
#############################
##########################
# html functions
# emit the http server response
@ -83,13 +83,13 @@ sub read_query_string
# c-style fgets for read_postdata
$stdinbuffer = "";
sub fgets
{
my($size) = @_;
my $line = "";
while(1)
{
unless(length $stdinbuffer)
@ -118,14 +118,14 @@ sub fgets
# (from STDIN in method=post form)
sub read_postdata
{
if ( $ENV{REQUEST_METHOD} != "POST" || !$ENV{CONTENT_LENGTH}){ return; };
my ($line, $parm, $file, $handle, $tmp);
my $state = "boundary";
my ($boundary) = $ENV{CONTENT_TYPE} =~ /boundary=(\S+)/ if $ENV{CONTENT_TYPE};
my $parsedebug = 0;
push(@parse_errors, "[$boundary]") if $parsedebug;
while(length ($line = fgets(1000)))
{
{
$line =~ s/[\r\n]+$//; # chomp doesn't strip \r!
#print "[$state] $line<br>\n";
@ -546,25 +546,15 @@ sub save_setup
sub get_wifi_signal
{
# CMLARA:
# this would be easy if /proc/net/wireless updated automatically, but it doesn't.
# 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 $wifiintf = `uci -q get network.wifi.ifname`;
chomp $wifiintf;
my ($SignalLevel) = "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/;
if ( $2 < 10000 ) {$SignalLevel=$1;}
}
foreach(`iw dev $_[0] survey dump|grep -A 1 \"\\[in use\\]\"`)
{
next unless /([\d\-]+) dBm/;
$NoiseFloor=$1;
next unless /.*Signal: ([\d\-]+) dBm.*Noise: ([\d\-]+) dBm/;
$SignalLevel=$1;
$NoiseFloor=$2;
}
if ( $SignalLevel == "N/A" || $NoiseFloor == "N/A" )
@ -592,9 +582,9 @@ sub get_free_mem
{
foreach(`free`)
{
next unless /^\s+Mem[:]/;
next unless /^Mem[:]/;
my @tmp = split /\s+/, $_;
return $tmp[4] + $tmp[6];
return $tmp[3] + $tmp[5];
}
return "N/A";
}
@ -1199,13 +1189,18 @@ sub wifi_useschains
#has increased it to a higher level.
sub wifi_txpoweroffset
{
$boardinfo = hardware_info();
if ( exists $boardinfo->{'pwroffset'} ) {
return $boardinfo->{'pwroffset'};
my $doesiwoffset=`iwinfo wlan0 info 2>/dev/null` =~ /TX power offset: (\d+)/;
if ( $doesiwoffset ) {
return $1;
} 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'};
use perlfunc;
use channelmaps;
#
# load the config parms
#
@ -95,7 +94,11 @@ $parms{dmz_dhcp_limit} = $dmz_dhcp_limit = $dmz_dhcp_end - $dmz_dhcp_start;
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()){
$wifi_txant = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/tx_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 .= "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;
}
@ -553,7 +556,8 @@ if($wifi_proto ne "disabled")
print "<tr><td><nobr>Tx Power</nobr></td>\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 "<tr><td>Distance</td>\n";

View File

@ -1,10 +1,8 @@
#!/usr/bin/perl
#!/usr/bin/perl
$debug = 0;
BEGIN {push @INC, '/www/cgi-bin'};
use perlfunc;
# collect some variables
$node = nvram_get("node");
$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 =~ 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>";
$str = "<th align=right>free space</th><td><nobr>flash = ";