From 0f98415f99948880cd25190a2aee8f5bbefcdfcb Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 21 Apr 2014 16:44:38 +0200 Subject: [PATCH] wifi: set ether->mbps to highest supported rate of the associated ap --- sys/src/9/pc/wifi.c | 3 +++ 1 file changed, 3 insertions(+) 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);