diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-rx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index 0a5d7cf25196..5cd756077422 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -251,7 +251,7 @@ EXPORT_SYMBOL(iwl_rx_spectrum_measure_notif); | |||
251 | static void iwl_rx_calc_noise(struct iwl_priv *priv) | 251 | static void iwl_rx_calc_noise(struct iwl_priv *priv) |
252 | { | 252 | { |
253 | struct statistics_rx_non_phy *rx_info | 253 | struct statistics_rx_non_phy *rx_info |
254 | = &(priv->statistics.rx.general); | 254 | = &(priv->_agn.statistics.rx.general); |
255 | int num_active_rx = 0; | 255 | int num_active_rx = 0; |
256 | int total_silence = 0; | 256 | int total_silence = 0; |
257 | int bcn_silence_a = | 257 | int bcn_silence_a = |
@@ -286,7 +286,7 @@ static void iwl_rx_calc_noise(struct iwl_priv *priv) | |||
286 | last_rx_noise); | 286 | last_rx_noise); |
287 | } | 287 | } |
288 | 288 | ||
289 | #ifdef CONFIG_IWLWIFI_DEBUG | 289 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
290 | /* | 290 | /* |
291 | * based on the assumption of all statistics counter are in DWORD | 291 | * based on the assumption of all statistics counter are in DWORD |
292 | * FIXME: This function is for debugging, do not deal with | 292 | * FIXME: This function is for debugging, do not deal with |
@@ -300,10 +300,10 @@ static void iwl_accumulative_statistics(struct iwl_priv *priv, | |||
300 | u32 *accum_stats; | 300 | u32 *accum_stats; |
301 | u32 *delta, *max_delta; | 301 | u32 *delta, *max_delta; |
302 | 302 | ||
303 | prev_stats = (__le32 *)&priv->statistics; | 303 | prev_stats = (__le32 *)&priv->_agn.statistics; |
304 | accum_stats = (u32 *)&priv->accum_statistics; | 304 | accum_stats = (u32 *)&priv->_agn.accum_statistics; |
305 | delta = (u32 *)&priv->delta_statistics; | 305 | delta = (u32 *)&priv->_agn.delta_statistics; |
306 | max_delta = (u32 *)&priv->max_delta; | 306 | max_delta = (u32 *)&priv->_agn.max_delta; |
307 | 307 | ||
308 | for (i = sizeof(__le32); i < sizeof(struct iwl_notif_statistics); | 308 | for (i = sizeof(__le32); i < sizeof(struct iwl_notif_statistics); |
309 | i += sizeof(__le32), stats++, prev_stats++, delta++, | 309 | i += sizeof(__le32), stats++, prev_stats++, delta++, |
@@ -318,18 +318,18 @@ static void iwl_accumulative_statistics(struct iwl_priv *priv, | |||
318 | } | 318 | } |
319 | 319 | ||
320 | /* reset accumulative statistics for "no-counter" type statistics */ | 320 | /* reset accumulative statistics for "no-counter" type statistics */ |
321 | priv->accum_statistics.general.temperature = | 321 | priv->_agn.accum_statistics.general.temperature = |
322 | priv->statistics.general.temperature; | 322 | priv->_agn.statistics.general.temperature; |
323 | priv->accum_statistics.general.temperature_m = | 323 | priv->_agn.accum_statistics.general.temperature_m = |
324 | priv->statistics.general.temperature_m; | 324 | priv->_agn.statistics.general.temperature_m; |
325 | priv->accum_statistics.general.ttl_timestamp = | 325 | priv->_agn.accum_statistics.general.ttl_timestamp = |
326 | priv->statistics.general.ttl_timestamp; | 326 | priv->_agn.statistics.general.ttl_timestamp; |
327 | priv->accum_statistics.tx.tx_power.ant_a = | 327 | priv->_agn.accum_statistics.tx.tx_power.ant_a = |
328 | priv->statistics.tx.tx_power.ant_a; | 328 | priv->_agn.statistics.tx.tx_power.ant_a; |
329 | priv->accum_statistics.tx.tx_power.ant_b = | 329 | priv->_agn.accum_statistics.tx.tx_power.ant_b = |
330 | priv->statistics.tx.tx_power.ant_b; | 330 | priv->_agn.statistics.tx.tx_power.ant_b; |
331 | priv->accum_statistics.tx.tx_power.ant_c = | 331 | priv->_agn.accum_statistics.tx.tx_power.ant_c = |
332 | priv->statistics.tx.tx_power.ant_c; | 332 | priv->_agn.statistics.tx.tx_power.ant_c; |
333 | } | 333 | } |
334 | #endif | 334 | #endif |
335 | 335 | ||
@@ -364,9 +364,9 @@ bool iwl_good_plcp_health(struct iwl_priv *priv, | |||
364 | if (plcp_msec) { | 364 | if (plcp_msec) { |
365 | combined_plcp_delta = | 365 | combined_plcp_delta = |
366 | (le32_to_cpu(pkt->u.stats.rx.ofdm.plcp_err) - | 366 | (le32_to_cpu(pkt->u.stats.rx.ofdm.plcp_err) - |
367 | le32_to_cpu(priv->statistics.rx.ofdm.plcp_err)) + | 367 | le32_to_cpu(priv->_agn.statistics.rx.ofdm.plcp_err)) + |
368 | (le32_to_cpu(pkt->u.stats.rx.ofdm_ht.plcp_err) - | 368 | (le32_to_cpu(pkt->u.stats.rx.ofdm_ht.plcp_err) - |
369 | le32_to_cpu(priv->statistics.rx.ofdm_ht.plcp_err)); | 369 | le32_to_cpu(priv->_agn.statistics.rx.ofdm_ht.plcp_err)); |
370 | 370 | ||
371 | if ((combined_plcp_delta > 0) && | 371 | if ((combined_plcp_delta > 0) && |
372 | ((combined_plcp_delta * 100) / plcp_msec) > | 372 | ((combined_plcp_delta * 100) / plcp_msec) > |
@@ -386,10 +386,10 @@ bool iwl_good_plcp_health(struct iwl_priv *priv, | |||
386 | "%u, %u, %u, %u, %d, %u mSecs\n", | 386 | "%u, %u, %u, %u, %d, %u mSecs\n", |
387 | priv->cfg->plcp_delta_threshold, | 387 | priv->cfg->plcp_delta_threshold, |
388 | le32_to_cpu(pkt->u.stats.rx.ofdm.plcp_err), | 388 | le32_to_cpu(pkt->u.stats.rx.ofdm.plcp_err), |
389 | le32_to_cpu(priv->statistics.rx.ofdm.plcp_err), | 389 | le32_to_cpu(priv->_agn.statistics.rx.ofdm.plcp_err), |
390 | le32_to_cpu(pkt->u.stats.rx.ofdm_ht.plcp_err), | 390 | le32_to_cpu(pkt->u.stats.rx.ofdm_ht.plcp_err), |
391 | le32_to_cpu( | 391 | le32_to_cpu( |
392 | priv->statistics.rx.ofdm_ht.plcp_err), | 392 | priv->_agn.statistics.rx.ofdm_ht.plcp_err), |
393 | combined_plcp_delta, plcp_msec); | 393 | combined_plcp_delta, plcp_msec); |
394 | rc = false; | 394 | rc = false; |
395 | } | 395 | } |
@@ -439,21 +439,22 @@ void iwl_rx_statistics(struct iwl_priv *priv, | |||
439 | 439 | ||
440 | 440 | ||
441 | IWL_DEBUG_RX(priv, "Statistics notification received (%d vs %d).\n", | 441 | IWL_DEBUG_RX(priv, "Statistics notification received (%d vs %d).\n", |
442 | (int)sizeof(priv->statistics), | 442 | (int)sizeof(priv->_agn.statistics), |
443 | le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK); | 443 | le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK); |
444 | 444 | ||
445 | change = ((priv->statistics.general.temperature != | 445 | change = ((priv->_agn.statistics.general.temperature != |
446 | pkt->u.stats.general.temperature) || | 446 | pkt->u.stats.general.temperature) || |
447 | ((priv->statistics.flag & | 447 | ((priv->_agn.statistics.flag & |
448 | STATISTICS_REPLY_FLG_HT40_MODE_MSK) != | 448 | STATISTICS_REPLY_FLG_HT40_MODE_MSK) != |
449 | (pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK))); | 449 | (pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK))); |
450 | 450 | ||
451 | #ifdef CONFIG_IWLWIFI_DEBUG | 451 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
452 | iwl_accumulative_statistics(priv, (__le32 *)&pkt->u.stats); | 452 | iwl_accumulative_statistics(priv, (__le32 *)&pkt->u.stats); |
453 | #endif | 453 | #endif |
454 | iwl_recover_from_statistics(priv, pkt); | 454 | iwl_recover_from_statistics(priv, pkt); |
455 | 455 | ||
456 | memcpy(&priv->statistics, &pkt->u.stats, sizeof(priv->statistics)); | 456 | memcpy(&priv->_agn.statistics, &pkt->u.stats, |
457 | sizeof(priv->_agn.statistics)); | ||
457 | 458 | ||
458 | set_bit(STATUS_STATISTICS, &priv->status); | 459 | set_bit(STATUS_STATISTICS, &priv->status); |
459 | 460 | ||
@@ -480,12 +481,12 @@ void iwl_reply_statistics(struct iwl_priv *priv, | |||
480 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | 481 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
481 | 482 | ||
482 | if (le32_to_cpu(pkt->u.stats.flag) & UCODE_STATISTICS_CLEAR_MSK) { | 483 | if (le32_to_cpu(pkt->u.stats.flag) & UCODE_STATISTICS_CLEAR_MSK) { |
483 | #ifdef CONFIG_IWLWIFI_DEBUG | 484 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
484 | memset(&priv->accum_statistics, 0, | 485 | memset(&priv->_agn.accum_statistics, 0, |
485 | sizeof(struct iwl_notif_statistics)); | 486 | sizeof(struct iwl_notif_statistics)); |
486 | memset(&priv->delta_statistics, 0, | 487 | memset(&priv->_agn.delta_statistics, 0, |
487 | sizeof(struct iwl_notif_statistics)); | 488 | sizeof(struct iwl_notif_statistics)); |
488 | memset(&priv->max_delta, 0, | 489 | memset(&priv->_agn.max_delta, 0, |
489 | sizeof(struct iwl_notif_statistics)); | 490 | sizeof(struct iwl_notif_statistics)); |
490 | #endif | 491 | #endif |
491 | IWL_DEBUG_RX(priv, "Statistics have been cleared\n"); | 492 | IWL_DEBUG_RX(priv, "Statistics have been cleared\n"); |