diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-01-28 10:47:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-01-28 15:46:24 -0500 |
commit | 88e58fc5d940c3463c7070a2a7a8a0ce65af3fdc (patch) | |
tree | d877458d81401c84b740718cc65520a078190094 /drivers/net/wireless/iwlwifi | |
parent | a839cf6955fb6cb731235c310cb0c72c1a2fecbe (diff) |
iwlwifi: introduce iwl_advanced_bt_coexist()
We use priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist
conditional in few places, merge it into one function.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 3 |
4 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index bbc5aa7a7f2f..705711a01b17 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -741,6 +741,12 @@ static inline const struct ieee80211_supported_band *iwl_get_hw_mode( | |||
741 | return priv->hw->wiphy->bands[band]; | 741 | return priv->hw->wiphy->bands[band]; |
742 | } | 742 | } |
743 | 743 | ||
744 | static inline bool iwl_advanced_bt_coexist(struct iwl_priv *priv) | ||
745 | { | ||
746 | return priv->cfg->bt_params && | ||
747 | priv->cfg->bt_params->advanced_bt_coexist; | ||
748 | } | ||
749 | |||
744 | extern bool bt_coex_active; | 750 | extern bool bt_coex_active; |
745 | extern bool bt_siso_mode; | 751 | extern bool bt_siso_mode; |
746 | 752 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 418c8ac26222..bde16acb08ca 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -1771,7 +1771,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1771 | DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); | 1771 | DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); |
1772 | DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); | 1772 | DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); |
1773 | DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR); | 1773 | DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR); |
1774 | if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist) | 1774 | if (iwl_advanced_bt_coexist(priv)) |
1775 | DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); | 1775 | DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); |
1776 | if (priv->cfg->base_params->sensitivity_calib_by_driver) | 1776 | if (priv->cfg->base_params->sensitivity_calib_by_driver) |
1777 | DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, | 1777 | DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index 1eec18d909d8..25f7d474f346 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -226,8 +226,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv, | |||
226 | else | 226 | else |
227 | cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA; | 227 | cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA; |
228 | 228 | ||
229 | if (priv->cfg->bt_params && | 229 | if (iwl_advanced_bt_coexist(priv)) { |
230 | priv->cfg->bt_params->advanced_bt_coexist) { | ||
231 | if (!priv->cfg->bt_params->bt_sco_disable) | 230 | if (!priv->cfg->bt_params->bt_sco_disable) |
232 | cmd->flags |= IWL_POWER_BT_SCO_ENA; | 231 | cmd->flags |= IWL_POWER_BT_SCO_ENA; |
233 | else | 232 | else |
@@ -313,8 +312,7 @@ static void iwl_power_fill_sleep_cmd(struct iwl_priv *priv, | |||
313 | else | 312 | else |
314 | cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA; | 313 | cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA; |
315 | 314 | ||
316 | if (priv->cfg->bt_params && | 315 | if (iwl_advanced_bt_coexist(priv)) { |
317 | priv->cfg->bt_params->advanced_bt_coexist) { | ||
318 | if (!priv->cfg->bt_params->bt_sco_disable) | 316 | if (!priv->cfg->bt_params->bt_sco_disable) |
319 | cmd->flags |= IWL_POWER_BT_SCO_ENA; | 317 | cmd->flags |= IWL_POWER_BT_SCO_ENA; |
320 | else | 318 | else |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 12d9363d0afe..08f1bea8b652 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -257,8 +257,7 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv, | |||
257 | queue_work(priv->workqueue, &priv->scan_completed); | 257 | queue_work(priv->workqueue, &priv->scan_completed); |
258 | 258 | ||
259 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC && | 259 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC && |
260 | priv->cfg->bt_params && | 260 | iwl_advanced_bt_coexist(priv) && |
261 | priv->cfg->bt_params->advanced_bt_coexist && | ||
262 | priv->bt_status != scan_notif->bt_status) { | 261 | priv->bt_status != scan_notif->bt_status) { |
263 | if (scan_notif->bt_status) { | 262 | if (scan_notif->bt_status) { |
264 | /* BT on */ | 263 | /* BT on */ |