diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-04-21 16:44:38 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-04-21 16:44:38 +0200 |
commit | 0f98415f99948880cd25190a2aee8f5bbefcdfcb (patch) | |
tree | b6f78d4fd63b93853c5c7011909dfd5c48309d39 | |
parent | 49825fa795e89256383795a60cc365d4e4ede420 (diff) | |
download | plan9front-0f98415f99948880cd25190a2aee8f5bbefcdfcb.tar.xz |
wifi: set ether->mbps to highest supported rate of the associated ap
-rw-r--r-- | sys/src/9/pc/wifi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/src/9/pc/wifi.c b/sys/src/9/pc/wifi.c index 6d7a2536c..62c0b9b76 100644 --- a/sys/src/9/pc/wifi.c +++ b/sys/src/9/pc/wifi.c @@ -654,6 +654,7 @@ wifsproc(void *arg) Wnode wnscan; Wnode *wn; ulong now, tmout; + uchar *rate; wifi = arg; ether = wifi->ether; @@ -677,6 +678,8 @@ Scan: tmout = 0; while((wn = wifi->bss) != nil){ ether->link = (wn->status == Sassoc) || (wn->status == Sblocked); + if(ether->link && (rate = wn->maxrate) != nil) + ether->mbps = ((*rate & 0x7f)+1)/2; now = MACHP(0)->ticks; if(wn->status != Sneedauth && TK2SEC(now - wn->lastseen) > 60 || goodbss(wifi, wn) == 0){ wifideauth(wifi, wn); |