diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-20 12:51:58 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-01-22 16:05:31 -0500 |
commit | 9dbac67da314ccdab3bb7f429b4936e59d5389b7 (patch) | |
tree | 6a803a71bbdf81c6cca850be702b56d50e9ef1a2 /drivers | |
parent | f5ffe23aa0a8f6512952cf393daf86cbd6e4685d (diff) |
ath9k_hw: reduce struct ar5416AniState size
It is kept per-channel, so removing unnecessary (or constant) fields from
it can save quite a bit of memory.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ani.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ani.h | 7 |
2 files changed, 6 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c index 297828791167..a9218a198758 100644 --- a/drivers/net/wireless/ath/ath9k/ani.c +++ b/drivers/net/wireless/ath/ath9k/ani.c | |||
@@ -152,7 +152,8 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel, | |||
152 | ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", | 152 | ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", |
153 | aniState->ofdmNoiseImmunityLevel, | 153 | aniState->ofdmNoiseImmunityLevel, |
154 | immunityLevel, BEACON_RSSI(ah), | 154 | immunityLevel, BEACON_RSSI(ah), |
155 | aniState->rssiThrLow, aniState->rssiThrHigh); | 155 | ATH9K_ANI_RSSI_THR_LOW, |
156 | ATH9K_ANI_RSSI_THR_HIGH); | ||
156 | 157 | ||
157 | if (!scan) | 158 | if (!scan) |
158 | aniState->ofdmNoiseImmunityLevel = immunityLevel; | 159 | aniState->ofdmNoiseImmunityLevel = immunityLevel; |
@@ -173,7 +174,7 @@ static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel, | |||
173 | 174 | ||
174 | weak_sig = entry_ofdm->ofdm_weak_signal_on; | 175 | weak_sig = entry_ofdm->ofdm_weak_signal_on; |
175 | if (ah->opmode == NL80211_IFTYPE_STATION && | 176 | if (ah->opmode == NL80211_IFTYPE_STATION && |
176 | BEACON_RSSI(ah) <= aniState->rssiThrHigh) | 177 | BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_HIGH) |
177 | weak_sig = true; | 178 | weak_sig = true; |
178 | 179 | ||
179 | if (aniState->ofdmWeakSigDetect != weak_sig) | 180 | if (aniState->ofdmWeakSigDetect != weak_sig) |
@@ -216,11 +217,11 @@ static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel, | |||
216 | 217 | ||
217 | ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", | 218 | ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", |
218 | aniState->cckNoiseImmunityLevel, immunityLevel, | 219 | aniState->cckNoiseImmunityLevel, immunityLevel, |
219 | BEACON_RSSI(ah), aniState->rssiThrLow, | 220 | BEACON_RSSI(ah), ATH9K_ANI_RSSI_THR_LOW, |
220 | aniState->rssiThrHigh); | 221 | ATH9K_ANI_RSSI_THR_HIGH); |
221 | 222 | ||
222 | if (ah->opmode == NL80211_IFTYPE_STATION && | 223 | if (ah->opmode == NL80211_IFTYPE_STATION && |
223 | BEACON_RSSI(ah) <= aniState->rssiThrLow && | 224 | BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_LOW && |
224 | immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI) | 225 | immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI) |
225 | immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI; | 226 | immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI; |
226 | 227 | ||
@@ -514,8 +515,6 @@ void ath9k_hw_ani_init(struct ath_hw *ah) | |||
514 | 515 | ||
515 | ani->ofdmsTurn = true; | 516 | ani->ofdmsTurn = true; |
516 | 517 | ||
517 | ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH; | ||
518 | ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW; | ||
519 | ani->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; | 518 | ani->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; |
520 | ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; | 519 | ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; |
521 | ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL; | 520 | ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL; |
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h index 385bdba8ae50..dddb1361039a 100644 --- a/drivers/net/wireless/ath/ath9k/ani.h +++ b/drivers/net/wireless/ath/ath9k/ani.h | |||
@@ -104,7 +104,6 @@ struct ath9k_ani_default { | |||
104 | }; | 104 | }; |
105 | 105 | ||
106 | struct ar5416AniState { | 106 | struct ar5416AniState { |
107 | struct ath9k_channel *c; | ||
108 | u8 noiseImmunityLevel; | 107 | u8 noiseImmunityLevel; |
109 | u8 ofdmNoiseImmunityLevel; | 108 | u8 ofdmNoiseImmunityLevel; |
110 | u8 cckNoiseImmunityLevel; | 109 | u8 cckNoiseImmunityLevel; |
@@ -113,15 +112,9 @@ struct ar5416AniState { | |||
113 | u8 spurImmunityLevel; | 112 | u8 spurImmunityLevel; |
114 | u8 firstepLevel; | 113 | u8 firstepLevel; |
115 | u8 ofdmWeakSigDetect; | 114 | u8 ofdmWeakSigDetect; |
116 | u8 cckWeakSigThreshold; | ||
117 | u32 listenTime; | 115 | u32 listenTime; |
118 | int32_t rssiThrLow; | ||
119 | int32_t rssiThrHigh; | ||
120 | u32 ofdmPhyErrCount; | 116 | u32 ofdmPhyErrCount; |
121 | u32 cckPhyErrCount; | 117 | u32 cckPhyErrCount; |
122 | int16_t pktRssi[2]; | ||
123 | int16_t ofdmErrRssi[2]; | ||
124 | int16_t cckErrRssi[2]; | ||
125 | struct ath9k_ani_default iniDef; | 118 | struct ath9k_ani_default iniDef; |
126 | }; | 119 | }; |
127 | 120 | ||