summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/9/pc/etheriwl.c8
-rw-r--r--sys/src/9/pc/wifi.c4
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/src/9/pc/etheriwl.c b/sys/src/9/pc/etheriwl.c
index 8930a10d2..02b7de2e6 100644
--- a/sys/src/9/pc/etheriwl.c
+++ b/sys/src/9/pc/etheriwl.c
@@ -1833,7 +1833,6 @@ transmit(Wifi *wifi, Wnode *wn, Block *b)
Wifipkt *w;
char *err;
- w = (Wifipkt*)b->rp;
edev = wifi->ether;
ctlr = edev->ctlr;
@@ -1850,9 +1849,16 @@ transmit(Wifi *wifi, Wnode *wn, Block *b)
|| memcmp(wn->bssid, ctlr->bssid, Eaddrlen) != 0)
rxon(edev, wn);
+ if(b == nil){
+ /* association note has no data to transmit */
+ qunlock(ctlr);
+ return;
+ }
+
rate = 0;
flags = 0;
nodeid = ctlr->bcastnodeid;
+ w = (Wifipkt*)b->rp;
if((w->a1[0] & 1) == 0){
flags |= TFlagNeedACK;
diff --git a/sys/src/9/pc/wifi.c b/sys/src/9/pc/wifi.c
index 85b1cd886..a34ab39e9 100644
--- a/sys/src/9/pc/wifi.c
+++ b/sys/src/9/pc/wifi.c
@@ -417,6 +417,8 @@ wifiproc(void *arg)
case 0x30: /* reassoc response */
b->rp += wifihdrlen(w);
recvassoc(wifi, wn, b->rp, BLEN(b));
+ /* notify driver about node aid association */
+ (*wifi->transmit)(wifi, wn, nil);
break;
case 0xb0: /* auth */
setstatus(wifi, Sauth);
@@ -673,13 +675,13 @@ wifictl(Wifi *wifi, void *buf, long n)
memmove(wifi->bssid, addr, Eaddrlen);
goto Findbss;
case CMauth:
- setstatus(wifi, Sauth);
memset(wn->rxkey, 0, sizeof(wn->rxkey));
memset(wn->txkey, 0, sizeof(wn->txkey));
if(cb->f[1] == nil)
wn->rsnelen = 0;
else
wn->rsnelen = hextob(cb->f[1], nil, wn->rsne, sizeof(wn->rsne));
+ setstatus(wifi, Sauth);
sendassoc(wifi, wn);
break;
case CMrxkey0: case CMrxkey1: case CMrxkey2: case CMrxkey3: case CMrxkey4: