[bwn] correctly calculate RSSI level.
Tested: * BCM4311, PHY-G, STA mode * BCM4312, PHY-LP, STA mode * BCM4321, PHY-N, STA moe
This commit is contained in:
parent
da019dfdd5
commit
3095d9fbc6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=300079
@ -5770,13 +5770,25 @@ bwn_rxeof(struct bwn_mac *mac, struct mbuf *m, const void *_rxhdr)
|
||||
rssi = max(rxhdr->phy.n.power1, rxhdr->ps2.n.power2);
|
||||
else
|
||||
rssi = max(rxhdr->phy.n.power0, rxhdr->phy.n.power1);
|
||||
#if 0
|
||||
DPRINTF(mac->mac_sc, BWN_DEBUG_RECV,
|
||||
"%s: power0=%d, power1=%d, power2=%d\n",
|
||||
__func__,
|
||||
rxhdr->phy.n.power0,
|
||||
rxhdr->phy.n.power1,
|
||||
rxhdr->ps2.n.power2);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
/* XXX TODO: implement rssi for other PHYs */
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* RSSI here is absolute, not relative to the noise floor.
|
||||
*/
|
||||
noise = mac->mac_stats.link_noise;
|
||||
rssi = rssi - noise;
|
||||
|
||||
/* RX radio tap */
|
||||
if (ieee80211_radiotap_active(ic))
|
||||
|
Loading…
Reference in New Issue
Block a user