Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Felix Fietkau and committed by
John W. Linville
9dbac67d f5ffe23a

+6 -14
+6 -7
drivers/net/wireless/ath/ath9k/ani.c
··· 152 152 ath_dbg(common, ANI, "**** ofdmlevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", 153 153 aniState->ofdmNoiseImmunityLevel, 154 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 158 if (!scan) 158 159 aniState->ofdmNoiseImmunityLevel = immunityLevel; ··· 174 173 175 174 weak_sig = entry_ofdm->ofdm_weak_signal_on; 176 175 if (ah->opmode == NL80211_IFTYPE_STATION && 177 - BEACON_RSSI(ah) <= aniState->rssiThrHigh) 176 + BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_HIGH) 178 177 weak_sig = true; 179 178 180 179 if (aniState->ofdmWeakSigDetect != weak_sig) ··· 217 216 218 217 ath_dbg(common, ANI, "**** ccklevel %d=>%d, rssi=%d[lo=%d hi=%d]\n", 219 218 aniState->cckNoiseImmunityLevel, immunityLevel, 220 - BEACON_RSSI(ah), aniState->rssiThrLow, 221 - aniState->rssiThrHigh); 219 + BEACON_RSSI(ah), ATH9K_ANI_RSSI_THR_LOW, 220 + ATH9K_ANI_RSSI_THR_HIGH); 222 221 223 222 if (ah->opmode == NL80211_IFTYPE_STATION && 224 - BEACON_RSSI(ah) <= aniState->rssiThrLow && 223 + BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_LOW && 225 224 immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI) 226 225 immunityLevel = ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI; 227 226 ··· 515 514 516 515 ani->ofdmsTurn = true; 517 516 518 - ani->rssiThrHigh = ATH9K_ANI_RSSI_THR_HIGH; 519 - ani->rssiThrLow = ATH9K_ANI_RSSI_THR_LOW; 520 517 ani->ofdmWeakSigDetect = ATH9K_ANI_USE_OFDM_WEAK_SIG; 521 518 ani->cckNoiseImmunityLevel = ATH9K_ANI_CCK_DEF_LEVEL; 522 519 ani->ofdmNoiseImmunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL;
-7
drivers/net/wireless/ath/ath9k/ani.h
··· 104 104 }; 105 105 106 106 struct ar5416AniState { 107 - struct ath9k_channel *c; 108 107 u8 noiseImmunityLevel; 109 108 u8 ofdmNoiseImmunityLevel; 110 109 u8 cckNoiseImmunityLevel; ··· 112 113 u8 spurImmunityLevel; 113 114 u8 firstepLevel; 114 115 u8 ofdmWeakSigDetect; 115 - u8 cckWeakSigThreshold; 116 116 u32 listenTime; 117 - int32_t rssiThrLow; 118 - int32_t rssiThrHigh; 119 117 u32 ofdmPhyErrCount; 120 118 u32 cckPhyErrCount; 121 - int16_t pktRssi[2]; 122 - int16_t ofdmErrRssi[2]; 123 - int16_t cckErrRssi[2]; 124 119 struct ath9k_ani_default iniDef; 125 120 }; 126 121