diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-calib.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c index 84ad62958535..4c5ab783737f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c | |||
@@ -631,7 +631,8 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv, void *resp) | |||
631 | } | 631 | } |
632 | 632 | ||
633 | spin_lock_irqsave(&priv->lock, flags); | 633 | spin_lock_irqsave(&priv->lock, flags); |
634 | if (priv->cfg->bt_statistics) { | 634 | if (priv->cfg->bt_params && |
635 | priv->cfg->bt_params->bt_statistics) { | ||
635 | rx_info = &(((struct iwl_bt_notif_statistics *)resp)-> | 636 | rx_info = &(((struct iwl_bt_notif_statistics *)resp)-> |
636 | rx.general.common); | 637 | rx.general.common); |
637 | ofdm = &(((struct iwl_bt_notif_statistics *)resp)->rx.ofdm); | 638 | ofdm = &(((struct iwl_bt_notif_statistics *)resp)->rx.ofdm); |
@@ -786,7 +787,8 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp) | |||
786 | } | 787 | } |
787 | 788 | ||
788 | spin_lock_irqsave(&priv->lock, flags); | 789 | spin_lock_irqsave(&priv->lock, flags); |
789 | if (priv->cfg->bt_statistics) { | 790 | if (priv->cfg->bt_params && |
791 | priv->cfg->bt_params->bt_statistics) { | ||
790 | rx_info = &(((struct iwl_bt_notif_statistics *)stat_resp)-> | 792 | rx_info = &(((struct iwl_bt_notif_statistics *)stat_resp)-> |
791 | rx.general.common); | 793 | rx.general.common); |
792 | } else { | 794 | } else { |
@@ -801,7 +803,8 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp) | |||
801 | 803 | ||
802 | rxon_band24 = !!(ctx->staging.flags & RXON_FLG_BAND_24G_MSK); | 804 | rxon_band24 = !!(ctx->staging.flags & RXON_FLG_BAND_24G_MSK); |
803 | rxon_chnum = le16_to_cpu(ctx->staging.channel); | 805 | rxon_chnum = le16_to_cpu(ctx->staging.channel); |
804 | if (priv->cfg->bt_statistics) { | 806 | if (priv->cfg->bt_params && |
807 | priv->cfg->bt_params->bt_statistics) { | ||
805 | stat_band24 = !!(((struct iwl_bt_notif_statistics *) | 808 | stat_band24 = !!(((struct iwl_bt_notif_statistics *) |
806 | stat_resp)->flag & | 809 | stat_resp)->flag & |
807 | STATISTICS_REPLY_FLG_BAND_24G_MSK); | 810 | STATISTICS_REPLY_FLG_BAND_24G_MSK); |
@@ -861,16 +864,17 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp) | |||
861 | /* If this is the "chain_noise_num_beacons", determine: | 864 | /* If this is the "chain_noise_num_beacons", determine: |
862 | * 1) Disconnected antennas (using signal strengths) | 865 | * 1) Disconnected antennas (using signal strengths) |
863 | * 2) Differential gain (using silence noise) to balance receivers */ | 866 | * 2) Differential gain (using silence noise) to balance receivers */ |
864 | if (data->beacon_count != priv->cfg->chain_noise_num_beacons) | 867 | if (data->beacon_count != |
868 | priv->cfg->base_params->chain_noise_num_beacons) | ||
865 | return; | 869 | return; |
866 | 870 | ||
867 | /* Analyze signal for disconnected antenna */ | 871 | /* Analyze signal for disconnected antenna */ |
868 | average_sig[0] = | 872 | average_sig[0] = data->chain_signal_a / |
869 | (data->chain_signal_a) / priv->cfg->chain_noise_num_beacons; | 873 | priv->cfg->base_params->chain_noise_num_beacons; |
870 | average_sig[1] = | 874 | average_sig[1] = data->chain_signal_b / |
871 | (data->chain_signal_b) / priv->cfg->chain_noise_num_beacons; | 875 | priv->cfg->base_params->chain_noise_num_beacons; |
872 | average_sig[2] = | 876 | average_sig[2] = data->chain_signal_c / |
873 | (data->chain_signal_c) / priv->cfg->chain_noise_num_beacons; | 877 | priv->cfg->base_params->chain_noise_num_beacons; |
874 | 878 | ||
875 | if (average_sig[0] >= average_sig[1]) { | 879 | if (average_sig[0] >= average_sig[1]) { |
876 | max_average_sig = average_sig[0]; | 880 | max_average_sig = average_sig[0]; |
@@ -920,7 +924,9 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp) | |||
920 | * To be safe, simply mask out any chains that we know | 924 | * To be safe, simply mask out any chains that we know |
921 | * are not on the device. | 925 | * are not on the device. |
922 | */ | 926 | */ |
923 | if (priv->cfg->advanced_bt_coexist && priv->bt_full_concurrent) { | 927 | if (priv->cfg->bt_params && |
928 | priv->cfg->bt_params->advanced_bt_coexist && | ||
929 | priv->bt_full_concurrent) { | ||
924 | /* operated as 1x1 in full concurrency mode */ | 930 | /* operated as 1x1 in full concurrency mode */ |
925 | active_chains &= first_antenna(priv->hw_params.valid_rx_ant); | 931 | active_chains &= first_antenna(priv->hw_params.valid_rx_ant); |
926 | } else | 932 | } else |
@@ -967,12 +973,12 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp) | |||
967 | active_chains); | 973 | active_chains); |
968 | 974 | ||
969 | /* Analyze noise for rx balance */ | 975 | /* Analyze noise for rx balance */ |
970 | average_noise[0] = | 976 | average_noise[0] = data->chain_noise_a / |
971 | ((data->chain_noise_a) / priv->cfg->chain_noise_num_beacons); | 977 | priv->cfg->base_params->chain_noise_num_beacons; |
972 | average_noise[1] = | 978 | average_noise[1] = data->chain_noise_b / |
973 | ((data->chain_noise_b) / priv->cfg->chain_noise_num_beacons); | 979 | priv->cfg->base_params->chain_noise_num_beacons; |
974 | average_noise[2] = | 980 | average_noise[2] = data->chain_noise_c / |
975 | ((data->chain_noise_c) / priv->cfg->chain_noise_num_beacons); | 981 | priv->cfg->base_params->chain_noise_num_beacons; |
976 | 982 | ||
977 | for (i = 0; i < NUM_RX_CHAINS; i++) { | 983 | for (i = 0; i < NUM_RX_CHAINS; i++) { |
978 | if (!(data->disconn_array[i]) && | 984 | if (!(data->disconn_array[i]) && |