diff options
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-4965-rx.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-4965-rx.c | 78 |
1 files changed, 1 insertions, 77 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-rx.c b/drivers/net/wireless/iwlegacy/iwl-4965-rx.c index b9fa2f6411a7..2b144bbfc3c5 100644 --- a/drivers/net/wireless/iwlegacy/iwl-4965-rx.c +++ b/drivers/net/wireless/iwlegacy/iwl-4965-rx.c | |||
@@ -151,81 +151,6 @@ static void iwl4965_accumulative_statistics(struct iwl_priv *priv, | |||
151 | 151 | ||
152 | #define REG_RECALIB_PERIOD (60) | 152 | #define REG_RECALIB_PERIOD (60) |
153 | 153 | ||
154 | /** | ||
155 | * iwl4965_good_plcp_health - checks for plcp error. | ||
156 | * | ||
157 | * When the plcp error is exceeding the thresholds, reset the radio | ||
158 | * to improve the throughput. | ||
159 | */ | ||
160 | bool iwl4965_good_plcp_health(struct iwl_priv *priv, | ||
161 | struct iwl_rx_packet *pkt) | ||
162 | { | ||
163 | bool rc = true; | ||
164 | int combined_plcp_delta; | ||
165 | unsigned int plcp_msec; | ||
166 | unsigned long plcp_received_jiffies; | ||
167 | |||
168 | if (priv->cfg->base_params->plcp_delta_threshold == | ||
169 | IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE) { | ||
170 | IWL_DEBUG_RADIO(priv, "plcp_err check disabled\n"); | ||
171 | return rc; | ||
172 | } | ||
173 | |||
174 | /* | ||
175 | * check for plcp_err and trigger radio reset if it exceeds | ||
176 | * the plcp error threshold plcp_delta. | ||
177 | */ | ||
178 | plcp_received_jiffies = jiffies; | ||
179 | plcp_msec = jiffies_to_msecs((long) plcp_received_jiffies - | ||
180 | (long) priv->plcp_jiffies); | ||
181 | priv->plcp_jiffies = plcp_received_jiffies; | ||
182 | /* | ||
183 | * check to make sure plcp_msec is not 0 to prevent division | ||
184 | * by zero. | ||
185 | */ | ||
186 | if (plcp_msec) { | ||
187 | struct statistics_rx_phy *ofdm; | ||
188 | struct statistics_rx_ht_phy *ofdm_ht; | ||
189 | |||
190 | ofdm = &pkt->u.stats.rx.ofdm; | ||
191 | ofdm_ht = &pkt->u.stats.rx.ofdm_ht; | ||
192 | combined_plcp_delta = | ||
193 | (le32_to_cpu(ofdm->plcp_err) - | ||
194 | le32_to_cpu(priv->_4965.statistics. | ||
195 | rx.ofdm.plcp_err)) + | ||
196 | (le32_to_cpu(ofdm_ht->plcp_err) - | ||
197 | le32_to_cpu(priv->_4965.statistics. | ||
198 | rx.ofdm_ht.plcp_err)); | ||
199 | |||
200 | if ((combined_plcp_delta > 0) && | ||
201 | ((combined_plcp_delta * 100) / plcp_msec) > | ||
202 | priv->cfg->base_params->plcp_delta_threshold) { | ||
203 | /* | ||
204 | * if plcp_err exceed the threshold, | ||
205 | * the following data is printed in csv format: | ||
206 | * Text: plcp_err exceeded %d, | ||
207 | * Received ofdm.plcp_err, | ||
208 | * Current ofdm.plcp_err, | ||
209 | * Received ofdm_ht.plcp_err, | ||
210 | * Current ofdm_ht.plcp_err, | ||
211 | * combined_plcp_delta, | ||
212 | * plcp_msec | ||
213 | */ | ||
214 | IWL_DEBUG_RADIO(priv, "plcp_err exceeded %u, " | ||
215 | "%u, %u, %u, %u, %d, %u mSecs\n", | ||
216 | priv->cfg->base_params->plcp_delta_threshold, | ||
217 | le32_to_cpu(ofdm->plcp_err), | ||
218 | le32_to_cpu(ofdm->plcp_err), | ||
219 | le32_to_cpu(ofdm_ht->plcp_err), | ||
220 | le32_to_cpu(ofdm_ht->plcp_err), | ||
221 | combined_plcp_delta, plcp_msec); | ||
222 | |||
223 | rc = false; | ||
224 | } | ||
225 | } | ||
226 | return rc; | ||
227 | } | ||
228 | |||
229 | void iwl4965_rx_statistics(struct iwl_priv *priv, | 154 | void iwl4965_rx_statistics(struct iwl_priv *priv, |
230 | struct iwl_rx_mem_buffer *rxb) | 155 | struct iwl_rx_mem_buffer *rxb) |
231 | { | 156 | { |
@@ -248,8 +173,7 @@ void iwl4965_rx_statistics(struct iwl_priv *priv, | |||
248 | iwl4965_accumulative_statistics(priv, (__le32 *)&pkt->u.stats); | 173 | iwl4965_accumulative_statistics(priv, (__le32 *)&pkt->u.stats); |
249 | #endif | 174 | #endif |
250 | 175 | ||
251 | iwl_legacy_recover_from_statistics(priv, pkt); | 176 | /* TODO: reading some of statistics is unneeded */ |
252 | |||
253 | memcpy(&priv->_4965.statistics, &pkt->u.stats, | 177 | memcpy(&priv->_4965.statistics, &pkt->u.stats, |
254 | sizeof(priv->_4965.statistics)); | 178 | sizeof(priv->_4965.statistics)); |
255 | 179 | ||