aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2011-02-18 20:23:54 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-02-26 13:29:02 -0500
commit6013270a030e370400e459922176c467a6c19293 (patch)
tree121433990e1fb94077a17cf2c09fd90b3648248a /drivers/net/wireless/iwlwifi
parent399f66fda08675e3e231ac6df9c59ea831441f4b (diff)
iwlagn: enable BT session 2 type UART for 2000 series
For 2000 series device, use session 2 type of BT UART message Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-2000.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c68
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h1
4 files changed, 57 insertions, 35 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c
index 30483e27ce5c..335adedcee43 100644
--- a/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -418,6 +418,7 @@ static struct iwl_bt_params iwl2030_bt_params = {
418 .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE, 418 .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
419 .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT, 419 .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
420 .bt_sco_disable = true, 420 .bt_sco_disable = true,
421 .bt_session_2 = true,
421}; 422};
422 423
423#define IWL_DEVICE_2000 \ 424#define IWL_DEVICE_2000 \
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index dc7055eee2d8..8e192072df15 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1804,26 +1804,39 @@ static const __le32 iwlagn_concurrent_lookup[12] = {
1804 1804
1805void iwlagn_send_advance_bt_config(struct iwl_priv *priv) 1805void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
1806{ 1806{
1807 struct iwl6000_bt_cmd bt_cmd = { 1807 struct iwl_basic_bt_cmd basic = {
1808 .max_kill = IWLAGN_BT_MAX_KILL_DEFAULT, 1808 .max_kill = IWLAGN_BT_MAX_KILL_DEFAULT,
1809 .bt3_timer_t7_value = IWLAGN_BT3_T7_DEFAULT, 1809 .bt3_timer_t7_value = IWLAGN_BT3_T7_DEFAULT,
1810 .bt3_prio_sample_time = IWLAGN_BT3_PRIO_SAMPLE_DEFAULT, 1810 .bt3_prio_sample_time = IWLAGN_BT3_PRIO_SAMPLE_DEFAULT,
1811 .bt3_timer_t2_value = IWLAGN_BT3_T2_DEFAULT, 1811 .bt3_timer_t2_value = IWLAGN_BT3_T2_DEFAULT,
1812 }; 1812 };
1813 struct iwl6000_bt_cmd bt_cmd_6000;
1814 struct iwl2000_bt_cmd bt_cmd_2000;
1815 int ret;
1813 1816
1814 BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) != 1817 BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) !=
1815 sizeof(bt_cmd.bt3_lookup_table)); 1818 sizeof(basic.bt3_lookup_table));
1816 1819
1817 if (priv->cfg->bt_params) 1820 if (priv->cfg->bt_params) {
1818 bt_cmd.prio_boost = priv->cfg->bt_params->bt_prio_boost; 1821 if (priv->cfg->bt_params->bt_session_2) {
1819 else 1822 bt_cmd_2000.prio_boost = cpu_to_le32(
1820 bt_cmd.prio_boost = 0; 1823 priv->cfg->bt_params->bt_prio_boost);
1821 bt_cmd.kill_ack_mask = priv->kill_ack_mask; 1824 bt_cmd_2000.tx_prio_boost = 0;
1822 bt_cmd.kill_cts_mask = priv->kill_cts_mask; 1825 bt_cmd_2000.rx_prio_boost = 0;
1826 } else {
1827 bt_cmd_6000.prio_boost =
1828 priv->cfg->bt_params->bt_prio_boost;
1829 bt_cmd_6000.tx_prio_boost = 0;
1830 bt_cmd_6000.rx_prio_boost = 0;
1831 }
1832 } else {
1833 IWL_ERR(priv, "failed to construct BT Coex Config\n");
1834 return;
1835 }
1823 1836
1824 bt_cmd.valid = priv->bt_valid; 1837 basic.kill_ack_mask = priv->kill_ack_mask;
1825 bt_cmd.tx_prio_boost = 0; 1838 basic.kill_cts_mask = priv->kill_cts_mask;
1826 bt_cmd.rx_prio_boost = 0; 1839 basic.valid = priv->bt_valid;
1827 1840
1828 /* 1841 /*
1829 * Configure BT coex mode to "no coexistence" when the 1842 * Configure BT coex mode to "no coexistence" when the
@@ -1832,32 +1845,43 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
1832 * IBSS mode (no proper uCode support for coex then). 1845 * IBSS mode (no proper uCode support for coex then).
1833 */ 1846 */
1834 if (!bt_coex_active || priv->iw_mode == NL80211_IFTYPE_ADHOC) { 1847 if (!bt_coex_active || priv->iw_mode == NL80211_IFTYPE_ADHOC) {
1835 bt_cmd.flags = IWLAGN_BT_FLAG_COEX_MODE_DISABLED; 1848 basic.flags = IWLAGN_BT_FLAG_COEX_MODE_DISABLED;
1836 } else { 1849 } else {
1837 bt_cmd.flags = IWLAGN_BT_FLAG_COEX_MODE_3W << 1850 basic.flags = IWLAGN_BT_FLAG_COEX_MODE_3W <<
1838 IWLAGN_BT_FLAG_COEX_MODE_SHIFT; 1851 IWLAGN_BT_FLAG_COEX_MODE_SHIFT;
1839 if (priv->cfg->bt_params && 1852 if (priv->cfg->bt_params &&
1840 priv->cfg->bt_params->bt_sco_disable) 1853 priv->cfg->bt_params->bt_sco_disable)
1841 bt_cmd.flags |= IWLAGN_BT_FLAG_SYNC_2_BT_DISABLE; 1854 basic.flags |= IWLAGN_BT_FLAG_SYNC_2_BT_DISABLE;
1842 1855
1843 if (priv->bt_ch_announce) 1856 if (priv->bt_ch_announce)
1844 bt_cmd.flags |= IWLAGN_BT_FLAG_CHANNEL_INHIBITION; 1857 basic.flags |= IWLAGN_BT_FLAG_CHANNEL_INHIBITION;
1845 IWL_DEBUG_INFO(priv, "BT coex flag: 0X%x\n", bt_cmd.flags); 1858 IWL_DEBUG_INFO(priv, "BT coex flag: 0X%x\n", basic.flags);
1846 } 1859 }
1847 priv->bt_enable_flag = bt_cmd.flags; 1860 priv->bt_enable_flag = basic.flags;
1848 if (priv->bt_full_concurrent) 1861 if (priv->bt_full_concurrent)
1849 memcpy(bt_cmd.bt3_lookup_table, iwlagn_concurrent_lookup, 1862 memcpy(basic.bt3_lookup_table, iwlagn_concurrent_lookup,
1850 sizeof(iwlagn_concurrent_lookup)); 1863 sizeof(iwlagn_concurrent_lookup));
1851 else 1864 else
1852 memcpy(bt_cmd.bt3_lookup_table, iwlagn_def_3w_lookup, 1865 memcpy(basic.bt3_lookup_table, iwlagn_def_3w_lookup,
1853 sizeof(iwlagn_def_3w_lookup)); 1866 sizeof(iwlagn_def_3w_lookup));
1854 1867
1855 IWL_DEBUG_INFO(priv, "BT coex %s in %s mode\n", 1868 IWL_DEBUG_INFO(priv, "BT coex %s in %s mode\n",
1856 bt_cmd.flags ? "active" : "disabled", 1869 basic.flags ? "active" : "disabled",
1857 priv->bt_full_concurrent ? 1870 priv->bt_full_concurrent ?
1858 "full concurrency" : "3-wire"); 1871 "full concurrency" : "3-wire");
1859 1872
1860 if (iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG, sizeof(bt_cmd), &bt_cmd)) 1873 if (priv->cfg->bt_params->bt_session_2) {
1874 memcpy(&bt_cmd_2000.basic, &basic,
1875 sizeof(basic));
1876 ret = iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG,
1877 sizeof(bt_cmd_2000), &bt_cmd_2000);
1878 } else {
1879 memcpy(&bt_cmd_6000.basic, &basic,
1880 sizeof(basic));
1881 ret = iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG,
1882 sizeof(bt_cmd_6000), &bt_cmd_6000);
1883 }
1884 if (ret)
1861 IWL_ERR(priv, "failed to send BT Coex Config\n"); 1885 IWL_ERR(priv, "failed to send BT Coex Config\n");
1862 1886
1863} 1887}
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 3629ee351478..03cfb74da2bc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -2477,7 +2477,7 @@ struct iwl_bt_cmd {
2477 IWLAGN_BT_VALID_BT4_TIMES | \ 2477 IWLAGN_BT_VALID_BT4_TIMES | \
2478 IWLAGN_BT_VALID_3W_LUT) 2478 IWLAGN_BT_VALID_3W_LUT)
2479 2479
2480struct iwl6000_bt_cmd { 2480struct iwl_basic_bt_cmd {
2481 u8 flags; 2481 u8 flags;
2482 u8 ledtime; /* unused */ 2482 u8 ledtime; /* unused */
2483 u8 max_kill; 2483 u8 max_kill;
@@ -2490,6 +2490,10 @@ struct iwl6000_bt_cmd {
2490 __le32 bt3_lookup_table[12]; 2490 __le32 bt3_lookup_table[12];
2491 __le16 bt4_decision_time; /* unused */ 2491 __le16 bt4_decision_time; /* unused */
2492 __le16 valid; 2492 __le16 valid;
2493};
2494
2495struct iwl6000_bt_cmd {
2496 struct iwl_basic_bt_cmd basic;
2493 u8 prio_boost; 2497 u8 prio_boost;
2494 /* 2498 /*
2495 * set IWLAGN_BT_VALID_BOOST to "1" in "valid" bitmask 2499 * set IWLAGN_BT_VALID_BOOST to "1" in "valid" bitmask
@@ -2500,18 +2504,7 @@ struct iwl6000_bt_cmd {
2500}; 2504};
2501 2505
2502struct iwl2000_bt_cmd { 2506struct iwl2000_bt_cmd {
2503 u8 flags; 2507 struct iwl_basic_bt_cmd basic;
2504 u8 ledtime; /* unused */
2505 u8 max_kill;
2506 u8 bt3_timer_t7_value;
2507 __le32 kill_ack_mask;
2508 __le32 kill_cts_mask;
2509 u8 bt3_prio_sample_time;
2510 u8 bt3_timer_t2_value;
2511 __le16 bt4_reaction_time; /* unused */
2512 __le32 bt3_lookup_table[12];
2513 __le16 bt4_decision_time; /* unused */
2514 __le16 valid;
2515 __le32 prio_boost; 2508 __le32 prio_boost;
2516 /* 2509 /*
2517 * set IWLAGN_BT_VALID_BOOST to "1" in "valid" bitmask 2510 * set IWLAGN_BT_VALID_BOOST to "1" in "valid" bitmask
@@ -4173,6 +4166,9 @@ enum iwl_bt_coex_profile_traffic_load {
4173 */ 4166 */
4174}; 4167};
4175 4168
4169#define BT_SESSION_ACTIVITY_1_UART_MSG 0x1
4170#define BT_SESSION_ACTIVITY_2_UART_MSG 0x2
4171
4176/* BT UART message - Share Part (BT -> WiFi) */ 4172/* BT UART message - Share Part (BT -> WiFi) */
4177#define BT_UART_MSG_FRAME1MSGTYPE_POS (0) 4173#define BT_UART_MSG_FRAME1MSGTYPE_POS (0)
4178#define BT_UART_MSG_FRAME1MSGTYPE_MSK \ 4174#define BT_UART_MSG_FRAME1MSGTYPE_MSK \
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index e0ec17079dc0..909b42d5d9c0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -339,6 +339,7 @@ struct iwl_bt_params {
339 u8 ampdu_factor; 339 u8 ampdu_factor;
340 u8 ampdu_density; 340 u8 ampdu_density;
341 bool bt_sco_disable; 341 bool bt_sco_disable;
342 bool bt_session_2;
342}; 343};
343/* 344/*
344 * @use_rts_for_aggregation: use rts/cts protection for HT traffic 345 * @use_rts_for_aggregation: use rts/cts protection for HT traffic