aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-calib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-calib.c64
1 files changed, 45 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
index 90033e8752bb..c4c5691032a6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
@@ -605,8 +605,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
605 IWL_DEBUG_CALIB(priv, "<<return 0x%X\n", ret); 605 IWL_DEBUG_CALIB(priv, "<<return 0x%X\n", ret);
606} 606}
607 607
608void iwl_sensitivity_calibration(struct iwl_priv *priv, 608void iwl_sensitivity_calibration(struct iwl_priv *priv, void *resp)
609 struct iwl_notif_statistics *resp)
610{ 609{
611 u32 rx_enable_time; 610 u32 rx_enable_time;
612 u32 fa_cck; 611 u32 fa_cck;
@@ -616,8 +615,8 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
616 u32 norm_fa_ofdm; 615 u32 norm_fa_ofdm;
617 u32 norm_fa_cck; 616 u32 norm_fa_cck;
618 struct iwl_sensitivity_data *data = NULL; 617 struct iwl_sensitivity_data *data = NULL;
619 struct statistics_rx_non_phy *rx_info = &(resp->rx.general); 618 struct statistics_rx_non_phy *rx_info;
620 struct statistics_rx *statistics = &(resp->rx); 619 struct statistics_rx_phy *ofdm, *cck;
621 unsigned long flags; 620 unsigned long flags;
622 struct statistics_general_data statis; 621 struct statistics_general_data statis;
623 622
@@ -632,6 +631,16 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
632 } 631 }
633 632
634 spin_lock_irqsave(&priv->lock, flags); 633 spin_lock_irqsave(&priv->lock, flags);
634 if (priv->cfg->bt_statistics) {
635 rx_info = &(((struct iwl_bt_notif_statistics *)resp)->
636 rx.general.common);
637 ofdm = &(((struct iwl_bt_notif_statistics *)resp)->rx.ofdm);
638 cck = &(((struct iwl_bt_notif_statistics *)resp)->rx.cck);
639 } else {
640 rx_info = &(((struct iwl_notif_statistics *)resp)->rx.general);
641 ofdm = &(((struct iwl_notif_statistics *)resp)->rx.ofdm);
642 cck = &(((struct iwl_notif_statistics *)resp)->rx.cck);
643 }
635 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { 644 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
636 IWL_DEBUG_CALIB(priv, "<< invalid data.\n"); 645 IWL_DEBUG_CALIB(priv, "<< invalid data.\n");
637 spin_unlock_irqrestore(&priv->lock, flags); 646 spin_unlock_irqrestore(&priv->lock, flags);
@@ -640,23 +649,23 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
640 649
641 /* Extract Statistics: */ 650 /* Extract Statistics: */
642 rx_enable_time = le32_to_cpu(rx_info->channel_load); 651 rx_enable_time = le32_to_cpu(rx_info->channel_load);
643 fa_cck = le32_to_cpu(statistics->cck.false_alarm_cnt); 652 fa_cck = le32_to_cpu(cck->false_alarm_cnt);
644 fa_ofdm = le32_to_cpu(statistics->ofdm.false_alarm_cnt); 653 fa_ofdm = le32_to_cpu(ofdm->false_alarm_cnt);
645 bad_plcp_cck = le32_to_cpu(statistics->cck.plcp_err); 654 bad_plcp_cck = le32_to_cpu(cck->plcp_err);
646 bad_plcp_ofdm = le32_to_cpu(statistics->ofdm.plcp_err); 655 bad_plcp_ofdm = le32_to_cpu(ofdm->plcp_err);
647 656
648 statis.beacon_silence_rssi_a = 657 statis.beacon_silence_rssi_a =
649 le32_to_cpu(statistics->general.beacon_silence_rssi_a); 658 le32_to_cpu(rx_info->beacon_silence_rssi_a);
650 statis.beacon_silence_rssi_b = 659 statis.beacon_silence_rssi_b =
651 le32_to_cpu(statistics->general.beacon_silence_rssi_b); 660 le32_to_cpu(rx_info->beacon_silence_rssi_b);
652 statis.beacon_silence_rssi_c = 661 statis.beacon_silence_rssi_c =
653 le32_to_cpu(statistics->general.beacon_silence_rssi_c); 662 le32_to_cpu(rx_info->beacon_silence_rssi_c);
654 statis.beacon_energy_a = 663 statis.beacon_energy_a =
655 le32_to_cpu(statistics->general.beacon_energy_a); 664 le32_to_cpu(rx_info->beacon_energy_a);
656 statis.beacon_energy_b = 665 statis.beacon_energy_b =
657 le32_to_cpu(statistics->general.beacon_energy_b); 666 le32_to_cpu(rx_info->beacon_energy_b);
658 statis.beacon_energy_c = 667 statis.beacon_energy_c =
659 le32_to_cpu(statistics->general.beacon_energy_c); 668 le32_to_cpu(rx_info->beacon_energy_c);
660 669
661 spin_unlock_irqrestore(&priv->lock, flags); 670 spin_unlock_irqrestore(&priv->lock, flags);
662 671
@@ -728,8 +737,7 @@ static inline u8 find_first_chain(u8 mask)
728 * 1) Which antennas are connected. 737 * 1) Which antennas are connected.
729 * 2) Differential rx gain settings to balance the 3 receivers. 738 * 2) Differential rx gain settings to balance the 3 receivers.
730 */ 739 */
731void iwl_chain_noise_calibration(struct iwl_priv *priv, 740void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp)
732 struct iwl_notif_statistics *stat_resp)
733{ 741{
734 struct iwl_chain_noise_data *data = NULL; 742 struct iwl_chain_noise_data *data = NULL;
735 743
@@ -753,7 +761,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
753 u32 active_chains = 0; 761 u32 active_chains = 0;
754 u8 num_tx_chains; 762 u8 num_tx_chains;
755 unsigned long flags; 763 unsigned long flags;
756 struct statistics_rx_non_phy *rx_info = &(stat_resp->rx.general); 764 struct statistics_rx_non_phy *rx_info;
757 u8 first_chain; 765 u8 first_chain;
758 766
759 if (priv->disable_chain_noise_cal) 767 if (priv->disable_chain_noise_cal)
@@ -772,6 +780,13 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
772 } 780 }
773 781
774 spin_lock_irqsave(&priv->lock, flags); 782 spin_lock_irqsave(&priv->lock, flags);
783 if (priv->cfg->bt_statistics) {
784 rx_info = &(((struct iwl_bt_notif_statistics *)stat_resp)->
785 rx.general.common);
786 } else {
787 rx_info = &(((struct iwl_notif_statistics *)stat_resp)->
788 rx.general);
789 }
775 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) { 790 if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
776 IWL_DEBUG_CALIB(priv, " << Interference data unavailable\n"); 791 IWL_DEBUG_CALIB(priv, " << Interference data unavailable\n");
777 spin_unlock_irqrestore(&priv->lock, flags); 792 spin_unlock_irqrestore(&priv->lock, flags);
@@ -780,8 +795,19 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
780 795
781 rxon_band24 = !!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK); 796 rxon_band24 = !!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK);
782 rxon_chnum = le16_to_cpu(priv->staging_rxon.channel); 797 rxon_chnum = le16_to_cpu(priv->staging_rxon.channel);
783 stat_band24 = !!(stat_resp->flag & STATISTICS_REPLY_FLG_BAND_24G_MSK); 798 if (priv->cfg->bt_statistics) {
784 stat_chnum = le32_to_cpu(stat_resp->flag) >> 16; 799 stat_band24 = !!(((struct iwl_bt_notif_statistics *)
800 stat_resp)->flag &
801 STATISTICS_REPLY_FLG_BAND_24G_MSK);
802 stat_chnum = le32_to_cpu(((struct iwl_bt_notif_statistics *)
803 stat_resp)->flag) >> 16;
804 } else {
805 stat_band24 = !!(((struct iwl_notif_statistics *)
806 stat_resp)->flag &
807 STATISTICS_REPLY_FLG_BAND_24G_MSK);
808 stat_chnum = le32_to_cpu(((struct iwl_notif_statistics *)
809 stat_resp)->flag) >> 16;
810 }
785 811
786 /* Make sure we accumulate data for just the associated channel 812 /* Make sure we accumulate data for just the associated channel
787 * (even if scanning). */ 813 * (even if scanning). */