shithub: riscv

Download patch

ref: 0f98415f99948880cd25190a2aee8f5bbefcdfcb
parent: 49825fa795e89256383795a60cc365d4e4ede420
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Apr 21 12:44:38 EDT 2014

wifi: set ether->mbps to highest supported rate of the associated ap

--- a/sys/src/9/pc/wifi.c
+++ b/sys/src/9/pc/wifi.c
@@ -654,6 +654,7 @@
 	Wnode wnscan;
 	Wnode *wn;
 	ulong now, tmout;
+	uchar *rate;
 
 	wifi = arg;
 	ether = wifi->ether;
@@ -677,6 +678,8 @@
 	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);