iwlwifi: change kill mask based on reduce power state
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Thu, 19 Apr 2012 16:50:06 +0000 (09:50 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 9 May 2012 00:56:09 +0000 (20:56 -0400)
In bt coex, consider reduce tx power as part of ack/cts kill mask

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn-lib.c
drivers/net/wireless/iwlwifi/iwl-commands.h

index ac483eb2c69dc8ce7a68a34e9a3f273e36d9c754..9fb4c7d1bf3b07db610027e6af65c339e2f175d5 100644 (file)
@@ -546,16 +546,19 @@ static bool iwlagn_set_kill_msk(struct iwl_priv *priv,
                                struct iwl_bt_uart_msg *uart_msg)
 {
        bool need_update = false;
-       u8 kill_msk;
-       static const __le32 bt_kill_ack_msg[2] = {
+       u8 kill_msk = IWL_BT_KILL_REDUCE;
+       static const __le32 bt_kill_ack_msg[3] = {
                IWLAGN_BT_KILL_ACK_MASK_DEFAULT,
-               IWLAGN_BT_KILL_ACK_CTS_MASK_SCO };
-       static const __le32 bt_kill_cts_msg[2] = {
+               IWLAGN_BT_KILL_ACK_CTS_MASK_SCO,
+               IWLAGN_BT_KILL_ACK_CTS_MASK_REDUCE};
+       static const __le32 bt_kill_cts_msg[3] = {
                IWLAGN_BT_KILL_CTS_MASK_DEFAULT,
-               IWLAGN_BT_KILL_ACK_CTS_MASK_SCO };
+               IWLAGN_BT_KILL_ACK_CTS_MASK_SCO,
+               IWLAGN_BT_KILL_ACK_CTS_MASK_REDUCE};
 
-       kill_msk = (BT_UART_MSG_FRAME3SCOESCO_MSK & uart_msg->frame3)
-               ? 1 : 0;
+       if (!priv->reduced_txpower)
+               kill_msk = (BT_UART_MSG_FRAME3SCOESCO_MSK & uart_msg->frame3)
+                       ? IWL_BT_KILL_OVERRIDE : IWL_BT_KILL_DEFAULT;
        if (priv->kill_ack_mask != bt_kill_ack_msg[kill_msk] ||
            priv->kill_cts_mask != bt_kill_cts_msg[kill_msk]) {
                priv->bt_valid |= IWLAGN_BT_VALID_KILL_ACK_MASK;
@@ -643,8 +646,9 @@ int iwlagn_bt_coex_profile_notif(struct iwl_priv *priv,
        }
 
        /* schedule to send runtime bt_config */
-       if (iwlagn_set_kill_msk(priv, uart_msg) ||
-           iwlagn_fill_txpower_mode(priv, uart_msg))
+       /* check reduce power before change ack/cts kill mask */
+       if (iwlagn_fill_txpower_mode(priv, uart_msg) ||
+           iwlagn_set_kill_msk(priv, uart_msg))
                queue_work(priv->workqueue, &priv->bt_runtime_config);
 
 
index e5dfbfd5fb24a9225bb994459970d17f29ddb161..83a6930f3658204838f6d0bb041d8b13c3f9d836 100644 (file)
@@ -1877,9 +1877,16 @@ struct iwl_bt_cmd {
 
 #define IWLAGN_BT3_T7_DEFAULT          1
 
+enum iwl_bt_kill_idx {
+       IWL_BT_KILL_DEFAULT = 0,
+       IWL_BT_KILL_OVERRIDE = 1,
+       IWL_BT_KILL_REDUCE = 2,
+};
+
 #define IWLAGN_BT_KILL_ACK_MASK_DEFAULT        cpu_to_le32(0xffff0000)
 #define IWLAGN_BT_KILL_CTS_MASK_DEFAULT        cpu_to_le32(0xffff0000)
 #define IWLAGN_BT_KILL_ACK_CTS_MASK_SCO        cpu_to_le32(0xffffffff)
+#define IWLAGN_BT_KILL_ACK_CTS_MASK_REDUCE     cpu_to_le32(0)
 
 #define IWLAGN_BT3_PRIO_SAMPLE_DEFAULT 2