summaryrefslogtreecommitdiff
path: root/package/madwifi/patches/310-noise_get.patch
blob: d8821583b31060c5bad58415a6252364a59117fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--- a/ath/if_ath.c
+++ b/ath/if_ath.c
@@ -1699,8 +1699,6 @@ ath_uapsd_processtriggers(struct ath_sof
 	 * get to reality.  This value is used in monitor mode and by tools like
 	 * Wireshark and Kismet.
 	 */
-	ic->ic_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan));
-
 	ATH_RXBUF_LOCK_IRQ(sc);
 	if (sc->sc_rxbufcur == NULL)
 		sc->sc_rxbufcur = STAILQ_FIRST(&sc->sc_rxbuf);
@@ -8975,6 +8973,7 @@ ath_calibrate(unsigned long arg)
 			sc->sc_curchan.channel);
 		sc->sc_stats.ast_per_calfail++;
 	}
+	ic->ic_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan));
 
 	ath_hal_process_noisefloor(ah);
 	if (isIQdone == AH_TRUE) {
@@ -9043,6 +9042,7 @@ ath_set_channel(struct ieee80211com *ic)
 	struct ath_softc *sc = dev->priv;
 
 	(void) ath_chan_set(sc, ic->ic_curchan);
+	ic->ic_channoise = ath_hal_get_channel_noise(sc->sc_ah, &(sc->sc_curchan));
 	/*
 	 * If we are returning to our bss channel then mark state
 	 * so the next recv'd beacon's TSF will be used to sync the
@@ -9311,6 +9311,7 @@ ath_newstate(struct ieee80211vap *vap, e
 		}
 
 		ath_hal_process_noisefloor(ah);
+		ic->ic_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan));
 		/*
 		 * Reset rssi stats; maybe not the best place...
 		 */
--- a/net80211/ieee80211_wireless.c
+++ b/net80211/ieee80211_wireless.c
@@ -4358,6 +4358,7 @@ get_sta_info(void *arg, struct ieee80211
 	si->isi_state = ni->ni_flags;
 	si->isi_authmode = ni->ni_authmode;
 	si->isi_rssi = ic->ic_node_getrssi(ni);
+	si->isi_noise = ic->ic_channoise;
 	si->isi_capinfo = ni->ni_capinfo;
 	si->isi_athflags = ni->ni_ath_flags;
 	si->isi_erp = ni->ni_erp;
--- a/net80211/ieee80211_ioctl.h
+++ b/net80211/ieee80211_ioctl.h
@@ -311,6 +311,7 @@ struct ieee80211req_sta_info {
 	u_int16_t isi_state;		/* state flags */
 	u_int8_t isi_authmode;		/* authentication algorithm */
 	u_int8_t isi_rssi;
+	int8_t isi_noise;
 	u_int16_t isi_capinfo;		/* capabilities */
 	u_int8_t isi_athflags;		/* Atheros capabilities */
 	u_int8_t isi_erp;		/* ERP element */