Commit 88e58fc5 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville

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: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Acked-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a839cf69
...@@ -741,6 +741,12 @@ static inline const struct ieee80211_supported_band *iwl_get_hw_mode( ...@@ -741,6 +741,12 @@ static inline const struct ieee80211_supported_band *iwl_get_hw_mode(
return priv->hw->wiphy->bands[band]; 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_coex_active;
extern bool bt_siso_mode; extern bool bt_siso_mode;
......
...@@ -1771,7 +1771,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) ...@@ -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_flags, dir_debug, S_IWUSR);
DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
DEBUGFS_ADD_FILE(wd_timeout, 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); DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
if (priv->cfg->base_params->sensitivity_calib_by_driver) if (priv->cfg->base_params->sensitivity_calib_by_driver)
DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf,
......
...@@ -226,8 +226,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv, ...@@ -226,8 +226,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
else else
cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA; cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA;
if (priv->cfg->bt_params && if (iwl_advanced_bt_coexist(priv)) {
priv->cfg->bt_params->advanced_bt_coexist) {
if (!priv->cfg->bt_params->bt_sco_disable) if (!priv->cfg->bt_params->bt_sco_disable)
cmd->flags |= IWL_POWER_BT_SCO_ENA; cmd->flags |= IWL_POWER_BT_SCO_ENA;
else else
...@@ -313,8 +312,7 @@ static void iwl_power_fill_sleep_cmd(struct iwl_priv *priv, ...@@ -313,8 +312,7 @@ static void iwl_power_fill_sleep_cmd(struct iwl_priv *priv,
else else
cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA; cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA;
if (priv->cfg->bt_params && if (iwl_advanced_bt_coexist(priv)) {
priv->cfg->bt_params->advanced_bt_coexist) {
if (!priv->cfg->bt_params->bt_sco_disable) if (!priv->cfg->bt_params->bt_sco_disable)
cmd->flags |= IWL_POWER_BT_SCO_ENA; cmd->flags |= IWL_POWER_BT_SCO_ENA;
else else
......
...@@ -257,8 +257,7 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv, ...@@ -257,8 +257,7 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
queue_work(priv->workqueue, &priv->scan_completed); queue_work(priv->workqueue, &priv->scan_completed);
if (priv->iw_mode != NL80211_IFTYPE_ADHOC && if (priv->iw_mode != NL80211_IFTYPE_ADHOC &&
priv->cfg->bt_params && iwl_advanced_bt_coexist(priv) &&
priv->cfg->bt_params->advanced_bt_coexist &&
priv->bt_status != scan_notif->bt_status) { priv->bt_status != scan_notif->bt_status) {
if (scan_notif->bt_status) { if (scan_notif->bt_status) {
/* BT on */ /* BT on */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment