aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-08-23 18:24:49 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-09-03 15:31:35 -0400
commitf7322f8f05f5755252e96d772fdcf9ca4304dc69 (patch)
tree93ba6e6025fb4d964e87c9a5b2e040a9270ac5f2 /drivers/net
parent85f72bc839705294b32b6c16b491c0422f0a71b3 (diff)
iwlagn: open/close envlope to force move BT state machine
In uCode, BT state machine need to receive open envlope command before perform calibration; followed by close envlope command to move to next stage. Since Linux has two separated uCode, one for init and the second one for runtime; we use open envlope commands for init uCode to indicate we are ready to perform calibration operation. But for runtime uCode, we are not doing any init calibration, so we issue open/close envlope commands to force uCode move to "BT COEX ON" state. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-ucode.c34
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h2
3 files changed, 31 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
index a7961bf395fc..8bfb0495a76b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
@@ -307,6 +307,17 @@ void iwlagn_init_alive_start(struct iwl_priv *priv)
307 goto restart; 307 goto restart;
308 } 308 }
309 309
310 if (priv->cfg->advanced_bt_coexist) {
311 /*
312 * Tell uCode we are ready to perform calibration
313 * need to perform this before any calibration
314 * no need to close the envlope since we are going
315 * to load the runtime uCode later.
316 */
317 iwlagn_send_bt_env(priv, IWL_BT_COEX_ENV_OPEN,
318 BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
319
320 }
310 iwlagn_send_calib_cfg(priv); 321 iwlagn_send_calib_cfg(priv);
311 return; 322 return;
312 323
@@ -364,7 +375,7 @@ static const u8 iwlagn_bt_prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX] = {
364 0, 0, 0, 0, 0, 0, 0 375 0, 0, 0, 0, 0, 0, 0
365}; 376};
366 377
367static void iwlagn_send_prio_tbl(struct iwl_priv *priv) 378void iwlagn_send_prio_tbl(struct iwl_priv *priv)
368{ 379{
369 struct iwl_bt_coex_prio_table_cmd prio_tbl_cmd; 380 struct iwl_bt_coex_prio_table_cmd prio_tbl_cmd;
370 381
@@ -375,7 +386,7 @@ static void iwlagn_send_prio_tbl(struct iwl_priv *priv)
375 IWL_ERR(priv, "failed to send BT prio tbl command\n"); 386 IWL_ERR(priv, "failed to send BT prio tbl command\n");
376} 387}
377 388
378static void iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type) 389void iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type)
379{ 390{
380 struct iwl_bt_coex_prot_env_cmd env_cmd; 391 struct iwl_bt_coex_prot_env_cmd env_cmd;
381 392
@@ -482,25 +493,6 @@ int iwlagn_alive_notify(struct iwl_priv *priv)
482 493
483 spin_unlock_irqrestore(&priv->lock, flags); 494 spin_unlock_irqrestore(&priv->lock, flags);
484 495
485 if (priv->cfg->advanced_bt_coexist) {
486 /* Configure Bluetooth device coexistence support */
487 /* need to perform this before any calibration */
488 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK;
489 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT;
490 priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT;
491 priv->cfg->ops->hcmd->send_bt_config(priv);
492 priv->bt_valid = IWLAGN_BT_VALID_ENABLE_FLAGS;
493
494 if (bt_coex_active && priv->iw_mode != NL80211_IFTYPE_ADHOC) {
495 iwlagn_send_prio_tbl(priv);
496 iwlagn_send_bt_env(priv, IWL_BT_COEX_ENV_OPEN,
497 BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
498 iwlagn_send_bt_env(priv, IWL_BT_COEX_ENV_CLOSE,
499 BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
500 }
501
502 }
503
504 iwlagn_send_wimax_coex(priv); 496 iwlagn_send_wimax_coex(priv);
505 497
506 iwlagn_set_Xtal_calib(priv); 498 iwlagn_set_Xtal_calib(priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index ad0e67f5c0d4..55ac079916d7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2813,6 +2813,22 @@ static void iwl_alive_start(struct iwl_priv *priv)
2813 if (iwl_is_rfkill(priv)) 2813 if (iwl_is_rfkill(priv))
2814 return; 2814 return;
2815 2815
2816 if (priv->cfg->advanced_bt_coexist) {
2817 /* Configure Bluetooth device coexistence support */
2818 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK;
2819 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT;
2820 priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT;
2821 priv->cfg->ops->hcmd->send_bt_config(priv);
2822 priv->bt_valid = IWLAGN_BT_VALID_ENABLE_FLAGS;
2823 if (bt_coex_active && priv->iw_mode != NL80211_IFTYPE_ADHOC)
2824 iwlagn_send_prio_tbl(priv);
2825
2826 /* FIXME: w/a to force change uCode BT state machine */
2827 iwlagn_send_bt_env(priv, IWL_BT_COEX_ENV_OPEN,
2828 BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
2829 iwlagn_send_bt_env(priv, IWL_BT_COEX_ENV_CLOSE,
2830 BT_COEX_PRIO_TBL_EVT_INIT_CALIB2);
2831 }
2816 ieee80211_wake_queues(priv->hw); 2832 ieee80211_wake_queues(priv->hw);
2817 2833
2818 priv->active_rate = IWL_RATES_MASK; 2834 priv->active_rate = IWL_RATES_MASK;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index 7c542a8c8f81..ab7c16f365f0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -134,6 +134,8 @@ void iwlagn_rx_calib_complete(struct iwl_priv *priv,
134void iwlagn_init_alive_start(struct iwl_priv *priv); 134void iwlagn_init_alive_start(struct iwl_priv *priv);
135int iwlagn_alive_notify(struct iwl_priv *priv); 135int iwlagn_alive_notify(struct iwl_priv *priv);
136int iwl_verify_ucode(struct iwl_priv *priv); 136int iwl_verify_ucode(struct iwl_priv *priv);
137void iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type);
138void iwlagn_send_prio_tbl(struct iwl_priv *priv);
137 139
138/* lib */ 140/* lib */
139void iwl_check_abort_status(struct iwl_priv *priv, 141void iwl_check_abort_status(struct iwl_priv *priv,