etheriwl: use first available antenna from eeprom txantmask instead of hardcode to antenna A
This commit is contained in:
parent
27a8b509c9
commit
f6290afb14
|
@ -1725,7 +1725,7 @@ enum {
|
||||||
static void
|
static void
|
||||||
transmit(Wifi *wifi, Wnode *wn, Block *b)
|
transmit(Wifi *wifi, Wnode *wn, Block *b)
|
||||||
{
|
{
|
||||||
int flags, nodeid, rate;
|
int flags, nodeid, rate, ant;
|
||||||
uchar c[Tcmdsize], *p;
|
uchar c[Tcmdsize], *p;
|
||||||
Ether *edev;
|
Ether *edev;
|
||||||
Ctlr *ctlr;
|
Ctlr *ctlr;
|
||||||
|
@ -1773,6 +1773,11 @@ transmit(Wifi *wifi, Wnode *wn, Block *b)
|
||||||
}
|
}
|
||||||
qunlock(ctlr);
|
qunlock(ctlr);
|
||||||
|
|
||||||
|
/* select first available antenna */
|
||||||
|
ant = ctlr->rfcfg.txantmask & 7;
|
||||||
|
ant |= (ant == 0);
|
||||||
|
ant = ((ant - 1) & ant) ^ ant;
|
||||||
|
|
||||||
memset(p = c, 0, sizeof(c));
|
memset(p = c, 0, sizeof(c));
|
||||||
put16(p, BLEN(b));
|
put16(p, BLEN(b));
|
||||||
p += 2;
|
p += 2;
|
||||||
|
@ -1783,7 +1788,7 @@ transmit(Wifi *wifi, Wnode *wn, Block *b)
|
||||||
p += 4; /* scratch */
|
p += 4; /* scratch */
|
||||||
|
|
||||||
*p++ = ratetab[rate].plcp;
|
*p++ = ratetab[rate].plcp;
|
||||||
*p++ = ratetab[rate].flags | (1<<6);
|
*p++ = ratetab[rate].flags | (ant<<6);
|
||||||
|
|
||||||
p += 2; /* xflags */
|
p += 2; /* xflags */
|
||||||
*p++ = nodeid;
|
*p++ = nodeid;
|
||||||
|
|
Loading…
Reference in a new issue