bugfix: TxMbps compatibility with Chaos Calmer

fixes AREDN->ticket:176

Change-Id: I005b391ecdc3611dc7fc59632743759b04d76728
This commit is contained in:
AE6XE 2016-07-29 17:02:48 -07:00
parent ca24742bbb
commit 7de59de3b9
1 changed files with 17 additions and 22 deletions

View File

@ -42,8 +42,12 @@ BEGIN {push @INC, '/www/cgi-bin'};
use perlfunc;
%rateL = (
'MCS0' => '6.5',
'MCS1' => '13',
'1.0M' => '1', # CCP LP
'2.0M' => '2', # CCP LP
'5.5M' => '5.5', # CCP LP
'MCS0' => '6.5', # HT20 LGI
'11.0M'=> '11', # CCP LP
'MCS1' => '13', # HT20 LGI...
'MCS2' => '19.5',
'MCS3' => '26',
'MCS4' => '39',
@ -129,34 +133,25 @@ foreach(`echo /all | nc 127.0.0.1 2006 2>$tmperr`)
}
else
{
#802.11n
$mbps = `egrep 'HT(4|2)0\\\/\(L|S\)GI[ \t]+(A|T)' /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0/stations/$mac/rc_stats`;
#802.11b/n
$mbps = `egrep '^([^,]*,){3}A' /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0/stations/$mac/rc_stats_csv`;
if ($mbps)
{
$mbps =~ /HT[42]0\/([LS]GI)[ \tTtPABCD]+(MCS[0-9]+)[ \t]*[0-9\.]+[ \t]*([0-9\.]+).*$/ ;
$mbps = $1 eq "LGI" ? $rateL{$2}*$3/100 : $rateS{$2}*$3/100 ;
($gi, $dummy, $rate, $dummy, $ewma) = $mbps =~ /^[^,]*,([^,]*),([^,]*,){2}([^,]*),([^,]*,){4}([^,]*).*$/ ;
$rate =~ s/[ \t]//g;
$mbps = $gi eq "SGI" ? $rateS{$rate}*$ewma/100 : $rateL{$rate}*$ewma/100 ;
}
else
{
#802.11a/g
$mbps = `egrep \"^A[BCDP \t]+[0-9\.]+\" /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0/stations/$mac/rc_stats`;
#802.11a/b/g
$mbps = `egrep \"^A" /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0/stations/$mac/rc_stats_csv`;
if ($mbps)
{
$mbps =~ /^A[ \tBCDP]+([0-9\.]+)[ \t]+[0-9\.]+[ \t]+([0-9\.]+).*$/;
$mbps = $1*$2/100;
}
else
{
#802.11b
$mbps = `egrep \"CCK\/LP[ \t]*T\" /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0/stations/$mac/rc_stats`;
if ($mbps)
{
$mbps =~ /CCK\/LP[ \tTtP]+([0-9\.]+)M[ \t]*[0-9\.]+[ \t]*([0-9\.]+).*$/ ;
$mbps = $1*$2/100;
$mbps =~ /^[^,]*,([^,]*),([^,]*,){4}([^,]*).*$/;
$mbps = $1*$3/100;
}
else { $mbps = "0"; }
}
}
if ( ! $mbps eq "" )
{
$mbps /= $chanbw;