]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
iwlwifi: introduce iwl_advanced_bt_coexist()
authorStanislaw Gruszka <sgruszka@redhat.com>
Fri, 28 Jan 2011 15:47:47 +0000 (16:47 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Jan 2011 20:46:24 +0000 (15:46 -0500)
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>
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl-debugfs.c
drivers/net/wireless/iwlwifi/iwl-power.c
drivers/net/wireless/iwlwifi/iwl-scan.c

index bbc5aa7a7f2f0cc14af831f0abd8877032f0a8e6..705711a01b1785d7b03e916c1aea9a1dc8058e86 100644 (file)
@@ -741,6 +741,12 @@ static inline const struct ieee80211_supported_band *iwl_get_hw_mode(
        return priv->hw->wiphy->bands[band];
 }
 
+static inline bool iwl_advanced_bt_coexist(struct iwl_priv *priv)
+{
+       return priv->cfg->bt_params &&
+              priv->cfg->bt_params->advanced_bt_coexist;
+}
+
 extern bool bt_coex_active;
 extern bool bt_siso_mode;
 
index 418c8ac262222a9357990b490c928682b42c90c7..bde16acb08caa1b5636d220fa4868f2ddf035aac 100644 (file)
@@ -1771,7 +1771,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
        DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
        DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
        DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR);
-       if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist)
+       if (iwl_advanced_bt_coexist(priv))
                DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
        if (priv->cfg->base_params->sensitivity_calib_by_driver)
                DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf,
index 1eec18d909d8622680877985fbb797565f84ad6c..25f7d474f34666ab2a92ad050f35dd3e0b0ae184 100644 (file)
@@ -226,8 +226,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
        else
                cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA;
 
-       if (priv->cfg->bt_params &&
-           priv->cfg->bt_params->advanced_bt_coexist) {
+       if (iwl_advanced_bt_coexist(priv)) {
                if (!priv->cfg->bt_params->bt_sco_disable)
                        cmd->flags |= IWL_POWER_BT_SCO_ENA;
                else
@@ -313,8 +312,7 @@ static void iwl_power_fill_sleep_cmd(struct iwl_priv *priv,
        else
                cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA;
 
-       if (priv->cfg->bt_params &&
-           priv->cfg->bt_params->advanced_bt_coexist) {
+       if (iwl_advanced_bt_coexist(priv)) {
                if (!priv->cfg->bt_params->bt_sco_disable)
                        cmd->flags |= IWL_POWER_BT_SCO_ENA;
                else
index 12d9363d0afe161774abd5c9b3fd3d95a9e31aa0..08f1bea8b652d2b857b4f44cd8b47f15d728e702 100644 (file)
@@ -257,8 +257,7 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
        queue_work(priv->workqueue, &priv->scan_completed);
 
        if (priv->iw_mode != NL80211_IFTYPE_ADHOC &&
-           priv->cfg->bt_params &&
-           priv->cfg->bt_params->advanced_bt_coexist &&
+           iwl_advanced_bt_coexist(priv) &&
            priv->bt_status != scan_notif->bt_status) {
                if (scan_notif->bt_status) {
                        /* BT on */