wifi: berlin prime bunny hopping
- reduce delay for channel hop to 200ms - use 1000ms timeout for auth response (dont hop channels while we wait) - bunny hop sequence is mathematically prooven
This commit is contained in:
parent
6b4a9c5d8d
commit
ee735f1088
|
@ -533,6 +533,7 @@ wifiproc(void *arg)
|
|||
&& goodbss(wifi, wn)){
|
||||
setstatus(wifi, wn, Sconn);
|
||||
sendauth(wifi, wn);
|
||||
wifi->lastauth = wn->lastsend;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -664,9 +665,12 @@ Scan:
|
|||
/* scan for access point */
|
||||
while(wifi->bss == nil){
|
||||
ether->link = 0;
|
||||
wnscan.channel = 1 + wnscan.channel % 11;
|
||||
wnscan.channel = 1 + ((wnscan.channel+4) % 13);
|
||||
wifiprobe(wifi, &wnscan);
|
||||
tsleep(&up->sleep, return0, 0, 1000);
|
||||
do {
|
||||
tsleep(&up->sleep, return0, 0, 200);
|
||||
now = MACHP(0)->ticks;
|
||||
} while(TK2MS(now-wifi->lastauth) < 1000);
|
||||
}
|
||||
|
||||
/* maintain access point */
|
||||
|
@ -716,6 +720,8 @@ wifiattach(Ether *ether, void (*transmit)(Wifi*, Wnode*, Block*))
|
|||
wifi->essid[0] = 0;
|
||||
memmove(wifi->bssid, ether->bcast, Eaddrlen);
|
||||
|
||||
wifi->lastauth = MACHP(0)->ticks;
|
||||
|
||||
snprint(name, sizeof(name), "#l%dwifi", ether->ctlrno);
|
||||
kproc(name, wifiproc, wifi);
|
||||
snprint(name, sizeof(name), "#l%dwifo", ether->ctlrno);
|
||||
|
|
|
@ -56,6 +56,7 @@ struct Wifi
|
|||
|
||||
Queue *iq;
|
||||
ulong watchdog;
|
||||
ulong lastauth;
|
||||
Ref txseq;
|
||||
void (*transmit)(Wifi*, Wnode*, Block*);
|
||||
|
||||
|
|
Loading…
Reference in a new issue