Commit 59079949 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

iwlagn: disable gen2b BT coexistence in IBSS

IBSS doesn't allow for coexistence, so it
should be disabled.

Additionally, disable reacting to the BT
profile notification when in IBSS mode,
it likely won't be sent by the device to
start with though.

Also, in IBSS mode, BT coexistence isn't as fully-featured
and we must use a single antenna only. So instead of
peppering the code with new checks, simply pretend
we are in high BT traffic load, which has the needed
effect of disabling antenna B use.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a1174138
...@@ -217,7 +217,14 @@ static void iwl6000g2b_send_bt_config(struct iwl_priv *priv) ...@@ -217,7 +217,14 @@ static void iwl6000g2b_send_bt_config(struct iwl_priv *priv)
BUILD_BUG_ON(sizeof(iwl6000g2b_def_3w_lookup) != BUILD_BUG_ON(sizeof(iwl6000g2b_def_3w_lookup) !=
sizeof(bt_cmd.bt3_lookup_table)); sizeof(bt_cmd.bt3_lookup_table));
if (!bt_coex_active) { /*
* Configure BT coex mode to "no coexistence" when the
* user disabled BT coexistence, we have no interface
* (might be in monitor mode), or the interface is in
* IBSS mode (no proper uCode support for coex then).
*/
if (!bt_coex_active || !priv->vif ||
priv->iw_mode == NL80211_IFTYPE_ADHOC) {
bt_cmd.flags = 0; bt_cmd.flags = 0;
} else { } else {
bt_cmd.flags = IWL6000G2B_BT_FLAG_CHANNEL_INHIBITION | bt_cmd.flags = IWL6000G2B_BT_FLAG_CHANNEL_INHIBITION |
...@@ -426,18 +433,23 @@ static void iwl6000g2b_bt_coex_profile_notif(struct iwl_priv *priv, ...@@ -426,18 +433,23 @@ static void iwl6000g2b_bt_coex_profile_notif(struct iwl_priv *priv,
coex->uart_msg[3], coex->uart_msg[4], coex->uart_msg[5], coex->uart_msg[3], coex->uart_msg[4], coex->uart_msg[5],
coex->uart_msg[6], coex->uart_msg[7]); coex->uart_msg[6], coex->uart_msg[7]);
if (coex->bt_traffic_load != priv->bt_traffic_load) { priv->notif_bt_traffic_load = coex->bt_traffic_load;
priv->bt_traffic_load = coex->bt_traffic_load;
queue_work(priv->workqueue, &priv->bt_traffic_change_work); if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
} if (coex->bt_traffic_load != priv->bt_traffic_load) {
priv->bt_traffic_load = coex->bt_traffic_load;
/* FIXME: add defines for this check */ queue_work(priv->workqueue,
priv->bt_sco_active = coex->uart_msg[3] & 1; &priv->bt_traffic_change_work);
if (priv->bt_sco_active) }
sco_cmd.flags |= IWL6000G2B_BT_SCO_ACTIVE;
iwl_send_cmd_pdu_async(priv, REPLY_BT_COEX_SCO, /* FIXME: add defines for this check */
sizeof(sco_cmd), &sco_cmd, NULL); priv->bt_sco_active = coex->uart_msg[3] & 1;
if (priv->bt_sco_active)
sco_cmd.flags |= IWL6000G2B_BT_SCO_ACTIVE;
iwl_send_cmd_pdu_async(priv, REPLY_BT_COEX_SCO,
sizeof(sco_cmd), &sco_cmd, NULL);
}
} }
void iwl6000g2b_rx_handler_setup(struct iwl_priv *priv) void iwl6000g2b_rx_handler_setup(struct iwl_priv *priv)
......
...@@ -1872,6 +1872,16 @@ int iwl_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -1872,6 +1872,16 @@ int iwl_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
if (err) if (err)
goto out_err; goto out_err;
if (priv->cfg->advanced_bt_coexist &&
vif->type == NL80211_IFTYPE_ADHOC) {
/*
* pretend to have high BT traffic as long as we
* are operating in IBSS mode, as this will cause
* the rate scaling etc. to behave as intended.
*/
priv->bt_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_HIGH;
}
goto out; goto out;
out_err: out_err:
...@@ -1909,6 +1919,17 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw, ...@@ -1909,6 +1919,17 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
} }
memset(priv->bssid, 0, ETH_ALEN); memset(priv->bssid, 0, ETH_ALEN);
} }
/*
* When removing the IBSS interface, overwrite the
* BT traffic load with the stored one from the last
* notification, if any. If this is a device that
* doesn't implement this, this has no effect since
* both values are the same and zero.
*/
if (vif->type == NL80211_IFTYPE_ADHOC)
priv->bt_traffic_load = priv->notif_bt_traffic_load;
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
if (scan_completed) if (scan_completed)
......
...@@ -1362,7 +1362,7 @@ struct iwl_priv { ...@@ -1362,7 +1362,7 @@ struct iwl_priv {
#endif #endif
}; };
u8 bt_traffic_load; u8 bt_traffic_load, notif_bt_traffic_load;
bool bt_sco_active; bool bt_sco_active;
struct work_struct bt_traffic_change_work; struct work_struct bt_traffic_change_work;
......
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