ref: 7cf2321ffbd4a524c559ec688b5f0f2c9949bce1
parent: 34a0f4660d47cd34340fee4444af5b16ffef5d02
author: cinap_lenrek <[email protected]>
date: Fri Jul 10 14:59:57 EDT 2015
etherwpi: afra support
--- a/sys/src/9/pc/etherwpi.c
+++ b/sys/src/9/pc/etherwpi.c
@@ -1426,7 +1426,7 @@
if((w->fc[0] & 0x0c) == 0x08 && ctlr->bssnodeid != -1){
timeout = 0;
nodeid = ctlr->bssnodeid;
- p = wn->maxrate;
+ p = wn->actrate;
}
}
qunlock(ctlr);
@@ -1631,6 +1631,8 @@
rx = &ctlr->rx;
if(ctlr->broken || ctlr->shared == nil || rx->b == nil)
return;
+
+ bb = nil;
for(hw = ctlr->shared->next % Nrx; rx->i != hw; rx->i = (rx->i + 1) % Nrx){
uchar type, flags, idx, qid;
u32int len;
@@ -1651,14 +1653,15 @@
if(0) iprint("rxdesc[%d] type=%d len=%d idx=%d qid=%d\n", rx->i, type, len, idx, qid);
+ if(bb != nil){
+ freeb(bb);
+ bb = nil;
+ }
if((qid & 0x80) == 0 && qid < nelem(ctlr->tx)){
tx = &ctlr->tx[qid];
if(tx->n > 0){
bb = tx->b[idx];
- if(bb != nil){
- tx->b[idx] = nil;
- freeb(bb);
- }
+ tx->b[idx] = nil;
tx->n--;
wakeup(tx);
}
@@ -1697,6 +1700,9 @@
continue;
case 28: /* tx done */
+ if(len <= 8 || d[8] == 1)
+ break;
+ wifitxfail(ctlr->wifi, bb);
break;
case 130: /* start scan */
@@ -1710,6 +1716,8 @@
}
}
csr32w(ctlr, FhRxWptr, ((hw+Nrx-1) % Nrx) & ~7);
+ if(bb != nil)
+ freeb(bb);
}
static void