aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-23 10:57:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-25 14:33:22 -0400
commit59079949faed96cc2756d5a59c185b304f1bc840 (patch)
tree2f9815c8e09ca02627adb8e4673344c2d247adf7 /drivers
parenta11741383ba6eef707b8330f0d3c1da6a7478ee3 (diff)
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: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c34
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c21
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h2
3 files changed, 45 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index f049ebc4a6aa..51419444834f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -217,7 +217,14 @@ static void iwl6000g2b_send_bt_config(struct iwl_priv *priv)
217 BUILD_BUG_ON(sizeof(iwl6000g2b_def_3w_lookup) != 217 BUILD_BUG_ON(sizeof(iwl6000g2b_def_3w_lookup) !=
218 sizeof(bt_cmd.bt3_lookup_table)); 218 sizeof(bt_cmd.bt3_lookup_table));
219 219
220 if (!bt_coex_active) { 220 /*
221 * Configure BT coex mode to "no coexistence" when the
222 * user disabled BT coexistence, we have no interface
223 * (might be in monitor mode), or the interface is in
224 * IBSS mode (no proper uCode support for coex then).
225 */
226 if (!bt_coex_active || !priv->vif ||
227 priv->iw_mode == NL80211_IFTYPE_ADHOC) {
221 bt_cmd.flags = 0; 228 bt_cmd.flags = 0;
222 } else { 229 } else {
223 bt_cmd.flags = IWL6000G2B_BT_FLAG_CHANNEL_INHIBITION | 230 bt_cmd.flags = IWL6000G2B_BT_FLAG_CHANNEL_INHIBITION |
@@ -426,18 +433,23 @@ static void iwl6000g2b_bt_coex_profile_notif(struct iwl_priv *priv,
426 coex->uart_msg[3], coex->uart_msg[4], coex->uart_msg[5], 433 coex->uart_msg[3], coex->uart_msg[4], coex->uart_msg[5],
427 coex->uart_msg[6], coex->uart_msg[7]); 434 coex->uart_msg[6], coex->uart_msg[7]);
428 435
429 if (coex->bt_traffic_load != priv->bt_traffic_load) { 436 priv->notif_bt_traffic_load = coex->bt_traffic_load;
430 priv->bt_traffic_load = coex->bt_traffic_load;
431 437
432 queue_work(priv->workqueue, &priv->bt_traffic_change_work); 438 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
433 } 439 if (coex->bt_traffic_load != priv->bt_traffic_load) {
440 priv->bt_traffic_load = coex->bt_traffic_load;
434 441
435 /* FIXME: add defines for this check */ 442 queue_work(priv->workqueue,
436 priv->bt_sco_active = coex->uart_msg[3] & 1; 443 &priv->bt_traffic_change_work);
437 if (priv->bt_sco_active) 444 }
438 sco_cmd.flags |= IWL6000G2B_BT_SCO_ACTIVE; 445
439 iwl_send_cmd_pdu_async(priv, REPLY_BT_COEX_SCO, 446 /* FIXME: add defines for this check */
440 sizeof(sco_cmd), &sco_cmd, NULL); 447 priv->bt_sco_active = coex->uart_msg[3] & 1;
448 if (priv->bt_sco_active)
449 sco_cmd.flags |= IWL6000G2B_BT_SCO_ACTIVE;
450 iwl_send_cmd_pdu_async(priv, REPLY_BT_COEX_SCO,
451 sizeof(sco_cmd), &sco_cmd, NULL);
452 }
441} 453}
442 454
443void iwl6000g2b_rx_handler_setup(struct iwl_priv *priv) 455void iwl6000g2b_rx_handler_setup(struct iwl_priv *priv)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 4beddade7423..1921307a23b8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1872,6 +1872,16 @@ int iwl_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
1872 if (err) 1872 if (err)
1873 goto out_err; 1873 goto out_err;
1874 1874
1875 if (priv->cfg->advanced_bt_coexist &&
1876 vif->type == NL80211_IFTYPE_ADHOC) {
1877 /*
1878 * pretend to have high BT traffic as long as we
1879 * are operating in IBSS mode, as this will cause
1880 * the rate scaling etc. to behave as intended.
1881 */
1882 priv->bt_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_HIGH;
1883 }
1884
1875 goto out; 1885 goto out;
1876 1886
1877 out_err: 1887 out_err:
@@ -1909,6 +1919,17 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
1909 } 1919 }
1910 memset(priv->bssid, 0, ETH_ALEN); 1920 memset(priv->bssid, 0, ETH_ALEN);
1911 } 1921 }
1922
1923 /*
1924 * When removing the IBSS interface, overwrite the
1925 * BT traffic load with the stored one from the last
1926 * notification, if any. If this is a device that
1927 * doesn't implement this, this has no effect since
1928 * both values are the same and zero.
1929 */
1930 if (vif->type == NL80211_IFTYPE_ADHOC)
1931 priv->bt_traffic_load = priv->notif_bt_traffic_load;
1932
1912 mutex_unlock(&priv->mutex); 1933 mutex_unlock(&priv->mutex);
1913 1934
1914 if (scan_completed) 1935 if (scan_completed)
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 5d327b44533b..815ba0af94ce 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1362,7 +1362,7 @@ struct iwl_priv {
1362#endif 1362#endif
1363 }; 1363 };
1364 1364
1365 u8 bt_traffic_load; 1365 u8 bt_traffic_load, notif_bt_traffic_load;
1366 bool bt_sco_active; 1366 bool bt_sco_active;
1367 struct work_struct bt_traffic_change_work; 1367 struct work_struct bt_traffic_change_work;
1368 1368