All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Wey-Yi Guy <wey-yi.w.guy@intel.com>
Subject: [PATCH 07/11] iwlwifi: change kill mask based on reduce power state
Date: Tue, 24 Apr 2012 16:46:00 -0700	[thread overview]
Message-ID: <1335311164-10252-8-git-send-email-wey-yi.w.guy@intel.com> (raw)
In-Reply-To: <1335311164-10252-1-git-send-email-wey-yi.w.guy@intel.com>

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  |   22 +++++++++++++---------
 drivers/net/wireless/iwlwifi/iwl-commands.h |    7 +++++++
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index ac483eb..9fb4c7d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -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);
 
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index e5dfbfd..83a6930 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -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
 
-- 
1.7.0.4


  parent reply	other threads:[~2012-04-24 23:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
2012-04-24 23:45 ` [PATCH 01/11] iwlwifi: remove unused macros Wey-Yi Guy
2012-04-24 23:45 ` [PATCH 02/11] iwlwifi: add BT reduced tx power flag Wey-Yi Guy
2012-04-24 23:45 ` [PATCH 03/11] iwlwifi: add checking for the condition to reduce tx power Wey-Yi Guy
2012-04-24 23:45 ` [PATCH 04/11] iwlwifi: add reduced tx power threshold define Wey-Yi Guy
2012-04-24 23:45 ` [PATCH 05/11] iwlwifi: small define change Wey-Yi Guy
2012-04-24 23:45 ` [PATCH 06/11] iwlwifi: send reduce tx power info in command Wey-Yi Guy
2012-04-24 23:46 ` Wey-Yi Guy [this message]
2012-04-24 23:46 ` [PATCH 08/11] iwlwifi: add loose coex lut Wey-Yi Guy
2012-04-24 23:46 ` [PATCH 09/11] iwlwifi: use IWL_* instead of dev_printk when possible Wey-Yi Guy
2012-04-24 23:46 ` [PATCH 10/11] iwlwifi: add option to disable 5GHz band Wey-Yi Guy
2012-04-24 23:46 ` [PATCH 11/11] iwlwifi: don't init trans->reg_lock from the op_mode Wey-Yi Guy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335311164-10252-8-git-send-email-wey-yi.w.guy@intel.com \
    --to=wey-yi.w.guy@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.