aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
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/iwl-agn-lib.c
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/iwl-agn-lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c68
1 files changed, 46 insertions, 22 deletions
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}