diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-11-28 04:35:40 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-11-28 04:35:40 +0000 |
commit | 5415610b562d3d7735082afad5dc34fd875ca525 (patch) | |
tree | b0353dc6d46adf84662189aa4ce7ec01375d5bbd | |
parent | e324402fbf0968dfab274006259f278ba0b7fa0c (diff) |
The athn(4) PCI driver forgot about adding the default noisefloor to
measured RSSI values. The same is already done for USB devices.
RSSI values shown in ifconfig make sense now.
ok kevlo@
-rw-r--r-- | sys/dev/ic/ar5008.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/athnreg.h | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ic/ar5008.c b/sys/dev/ic/ar5008.c index 248960e4777..e0188134edd 100644 --- a/sys/dev/ic/ar5008.c +++ b/sys/dev/ic/ar5008.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5008.c,v 1.45 2017/07/17 14:25:29 stsp Exp $ */ +/* $OpenBSD: ar5008.c,v 1.46 2017/11/28 04:35:39 stsp Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -925,6 +925,7 @@ ar5008_rx_process(struct athn_softc *sc) /* Send the frame to the 802.11 layer. */ rxi.rxi_flags = 0; /* XXX */ rxi.rxi_rssi = MS(ds->ds_status4, AR_RXS4_RSSI_COMBINED); + rxi.rxi_rssi += AR_DEFAULT_NOISE_FLOOR; rxi.rxi_tstamp = ds->ds_status2; ieee80211_input(ifp, m, ni, &rxi); @@ -1927,7 +1928,7 @@ ar5008_bb_load_noisefloor(struct athn_softc *sc) /* Restore noisefloor values to initial (max) values. */ for (i = 0; i < AR_MAX_CHAINS; i++) - nf[i] = nf_ext[i] = -50 * 2; + nf[i] = nf_ext[i] = AR_DEFAULT_NOISE_FLOOR; ar5008_write_noisefloor(sc, nf, nf_ext); } diff --git a/sys/dev/ic/athnreg.h b/sys/dev/ic/athnreg.h index 0ed85b15afa..e8dd7005980 100644 --- a/sys/dev/ic/athnreg.h +++ b/sys/dev/ic/athnreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: athnreg.h,v 1.20 2017/05/19 11:42:48 stsp Exp $ */ +/* $OpenBSD: athnreg.h,v 1.21 2017/11/28 04:35:39 stsp Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -1449,6 +1449,8 @@ #define AR_CTL_2GHT40 7 #define AR_CTL_5GHT40 8 +#define AR_DEFAULT_NOISE_FLOOR (-95) + /* * Macros to access registers. */ |