All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24
@ 2012-04-24 23:45 Wey-Yi Guy
  2012-04-24 23:45 ` [PATCH 01/11] iwlwifi: remove unused macros Wey-Yi Guy
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:45 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Wey-Yi Guy

We add reduce tx power feature for bluetooth coex
We also add new module parameter for disable 5GHz band

Emmanuel Grumbach (2):
  iwlwifi: use IWL_* instead of dev_printk when possible
  iwlwifi: don't init trans->reg_lock from the op_mode

Stanislaw Gruszka (1):
  iwlwifi: add option to disable 5GHz band

Wey-Yi Guy (8):
  iwlwifi: remove unused macros
  iwlwifi: add BT reduced tx power flag
  iwlwifi: add checking for the condition to reduce tx power
  iwlwifi: add reduced tx power threshold define
  iwlwifi: small define change
  iwlwifi: send reduce tx power info in command
  iwlwifi: change kill mask based on reduce power state
  iwlwifi: add loose coex lut

these patches are also available from wireless-next branch on
 git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi.git

 drivers/net/wireless/iwlwifi/iwl-agn-lib.c    |  153 ++++++++++++-------------
 drivers/net/wireless/iwlwifi/iwl-agn.c        |   15 ++-
 drivers/net/wireless/iwlwifi/iwl-commands.h   |   21 +++-
 drivers/net/wireless/iwlwifi/iwl-dev.h        |    1 +
 drivers/net/wireless/iwlwifi/iwl-drv.c        |   12 ++-
 drivers/net/wireless/iwlwifi/iwl-modparams.h  |    2 +
 drivers/net/wireless/iwlwifi/iwl-trans-pcie.c |    1 +
 7 files changed, 108 insertions(+), 97 deletions(-)


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 01/11] iwlwifi: remove unused macros
  2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
@ 2012-04-24 23:45 ` Wey-Yi Guy
  2012-04-24 23:45 ` [PATCH 02/11] iwlwifi: add BT reduced tx power flag Wey-Yi Guy
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:45 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Wey-Yi Guy

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c |   69 ----------------------------
 1 files changed, 0 insertions(+), 69 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index e1c2bb8..0642186 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -186,75 +186,6 @@ done:
 /*
  * BT coex
  */
-/*
- * Macros to access the lookup table.
- *
- * The lookup table has 7 inputs: bt3_prio, bt3_txrx, bt_rf_act, wifi_req,
-* wifi_prio, wifi_txrx and wifi_sh_ant_req.
- *
- * It has three outputs: WLAN_ACTIVE, WLAN_KILL and ANT_SWITCH
- *
- * The format is that "registers" 8 through 11 contain the WLAN_ACTIVE bits
- * one after another in 32-bit registers, and "registers" 0 through 7 contain
- * the WLAN_KILL and ANT_SWITCH bits interleaved (in that order).
- *
- * These macros encode that format.
- */
-#define LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, wifi_req, wifi_prio, \
-		  wifi_txrx, wifi_sh_ant_req) \
-	(bt3_prio | (bt3_txrx << 1) | (bt_rf_act << 2) | (wifi_req << 3) | \
-	(wifi_prio << 4) | (wifi_txrx << 5) | (wifi_sh_ant_req << 6))
-
-#define LUT_PTA_WLAN_ACTIVE_OP(lut, op, val) \
-	lut[8 + ((val) >> 5)] op (cpu_to_le32(BIT((val) & 0x1f)))
-#define LUT_TEST_PTA_WLAN_ACTIVE(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
-				 wifi_prio, wifi_txrx, wifi_sh_ant_req) \
-	(!!(LUT_PTA_WLAN_ACTIVE_OP(lut, &, LUT_VALUE(bt3_prio, bt3_txrx, \
-				   bt_rf_act, wifi_req, wifi_prio, wifi_txrx, \
-				   wifi_sh_ant_req))))
-#define LUT_SET_PTA_WLAN_ACTIVE(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
-				wifi_prio, wifi_txrx, wifi_sh_ant_req) \
-	LUT_PTA_WLAN_ACTIVE_OP(lut, |=, LUT_VALUE(bt3_prio, bt3_txrx, \
-			       bt_rf_act, wifi_req, wifi_prio, wifi_txrx, \
-			       wifi_sh_ant_req))
-#define LUT_CLEAR_PTA_WLAN_ACTIVE(lut, bt3_prio, bt3_txrx, bt_rf_act, \
-				  wifi_req, wifi_prio, wifi_txrx, \
-				  wifi_sh_ant_req) \
-	LUT_PTA_WLAN_ACTIVE_OP(lut, &= ~, LUT_VALUE(bt3_prio, bt3_txrx, \
-			       bt_rf_act, wifi_req, wifi_prio, wifi_txrx, \
-			       wifi_sh_ant_req))
-
-#define LUT_WLAN_KILL_OP(lut, op, val) \
-	lut[(val) >> 4] op (cpu_to_le32(BIT(((val) << 1) & 0x1e)))
-#define LUT_TEST_WLAN_KILL(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
-			   wifi_prio, wifi_txrx, wifi_sh_ant_req) \
-	(!!(LUT_WLAN_KILL_OP(lut, &, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
-			     wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))))
-#define LUT_SET_WLAN_KILL(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
-			  wifi_prio, wifi_txrx, wifi_sh_ant_req) \
-	LUT_WLAN_KILL_OP(lut, |=, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
-			 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
-#define LUT_CLEAR_WLAN_KILL(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
-			    wifi_prio, wifi_txrx, wifi_sh_ant_req) \
-	LUT_WLAN_KILL_OP(lut, &= ~, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
-			 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
-
-#define LUT_ANT_SWITCH_OP(lut, op, val) \
-	lut[(val) >> 4] op (cpu_to_le32(BIT((((val) << 1) & 0x1e) + 1)))
-#define LUT_TEST_ANT_SWITCH(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
-			    wifi_prio, wifi_txrx, wifi_sh_ant_req) \
-	(!!(LUT_ANT_SWITCH_OP(lut, &, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
-			      wifi_req, wifi_prio, wifi_txrx, \
-			      wifi_sh_ant_req))))
-#define LUT_SET_ANT_SWITCH(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
-			   wifi_prio, wifi_txrx, wifi_sh_ant_req) \
-	LUT_ANT_SWITCH_OP(lut, |=, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
-			  wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
-#define LUT_CLEAR_ANT_SWITCH(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
-			     wifi_prio, wifi_txrx, wifi_sh_ant_req) \
-	LUT_ANT_SWITCH_OP(lut, &= ~, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
-			  wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
-
 static const __le32 iwlagn_def_3w_lookup[12] = {
 	cpu_to_le32(0xaaaaaaaa),
 	cpu_to_le32(0xaaaaaaaa),
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 02/11] iwlwifi: add BT reduced tx power flag
  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 ` Wey-Yi Guy
  2012-04-24 23:45 ` [PATCH 03/11] iwlwifi: add checking for the condition to reduce tx power Wey-Yi Guy
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:45 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Wey-Yi Guy

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-commands.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 296347a..c212e53 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -1891,7 +1891,7 @@ struct iwl_bt_cmd {
 #define IWLAGN_BT_VALID_3W_TIMERS	cpu_to_le16(BIT(3))
 #define IWLAGN_BT_VALID_KILL_ACK_MASK	cpu_to_le16(BIT(4))
 #define IWLAGN_BT_VALID_KILL_CTS_MASK	cpu_to_le16(BIT(5))
-#define IWLAGN_BT_VALID_BT4_TIMES	cpu_to_le16(BIT(6))
+#define IWLAGN_BT_VALID_REDUCED_TX_PWR	cpu_to_le16(BIT(6))
 #define IWLAGN_BT_VALID_3W_LUT		cpu_to_le16(BIT(7))
 
 #define IWLAGN_BT_ALL_VALID_MSK		(IWLAGN_BT_VALID_ENABLE_FLAGS | \
@@ -1900,7 +1900,7 @@ struct iwl_bt_cmd {
 					IWLAGN_BT_VALID_3W_TIMERS | \
 					IWLAGN_BT_VALID_KILL_ACK_MASK | \
 					IWLAGN_BT_VALID_KILL_CTS_MASK | \
-					IWLAGN_BT_VALID_BT4_TIMES | \
+					IWLAGN_BT_VALID_REDUCED_TX_PWR | \
 					IWLAGN_BT_VALID_3W_LUT)
 
 struct iwl_basic_bt_cmd {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 03/11] iwlwifi: add checking for the condition to reduce tx power
  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 ` Wey-Yi Guy
  2012-04-24 23:45 ` [PATCH 04/11] iwlwifi: add reduced tx power threshold define Wey-Yi Guy
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:45 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Wey-Yi Guy

When bluetooth coex is active and certain condition matched,
driver need to decide should the tx power been reduce or not.
Adding the logic to manage it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c |   42 +++++++++++++++++++++++++--
 drivers/net/wireless/iwlwifi/iwl-dev.h     |    1 +
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 0642186..994a7da 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -541,9 +541,10 @@ static void iwlagn_print_uartmsg(struct iwl_priv *priv,
 			BT_UART_MSG_FRAME7CONNECTABLE_POS);
 }
 
-static void iwlagn_set_kill_msk(struct iwl_priv *priv,
+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] = {
 		IWLAGN_BT_KILL_ACK_MASK_DEFAULT,
@@ -560,10 +561,39 @@ static void iwlagn_set_kill_msk(struct iwl_priv *priv,
 		priv->kill_ack_mask = bt_kill_ack_msg[kill_msk];
 		priv->bt_valid |= IWLAGN_BT_VALID_KILL_CTS_MASK;
 		priv->kill_cts_mask = bt_kill_cts_msg[kill_msk];
+		need_update = true;
+	}
+	return need_update;
+}
 
-		/* schedule to send runtime bt_config */
-		queue_work(priv->workqueue, &priv->bt_runtime_config);
+static bool iwlagn_fill_txpower_mode(struct iwl_priv *priv,
+				struct iwl_bt_uart_msg *uart_msg)
+{
+	bool need_update = false;
+
+	if (!priv->reduced_txpower &&
+	    !iwl_is_associated(priv, IWL_RXON_CTX_PAN) &&
+	    (uart_msg->frame3 & (BT_UART_MSG_FRAME3ACL_MSK |
+	    BT_UART_MSG_FRAME3OBEX_MSK)) &&
+	    !(uart_msg->frame3 & (BT_UART_MSG_FRAME3SCOESCO_MSK |
+	    BT_UART_MSG_FRAME3SNIFF_MSK | BT_UART_MSG_FRAME3A2DP_MSK))) {
+		/* enabling reduced tx power */
+		priv->reduced_txpower = true;
+		priv->bt_valid |= IWLAGN_BT_VALID_REDUCED_TX_PWR;
+		need_update = true;
+	} else if (priv->reduced_txpower &&
+		   (iwl_is_associated(priv, IWL_RXON_CTX_PAN) ||
+		   (uart_msg->frame3 & (BT_UART_MSG_FRAME3SCOESCO_MSK |
+		   BT_UART_MSG_FRAME3SNIFF_MSK | BT_UART_MSG_FRAME3A2DP_MSK)) ||
+		   !(uart_msg->frame3 & (BT_UART_MSG_FRAME3ACL_MSK |
+		   BT_UART_MSG_FRAME3OBEX_MSK)))) {
+		/* disable reduced tx power */
+		priv->reduced_txpower = false;
+		priv->bt_valid &= ~IWLAGN_BT_VALID_REDUCED_TX_PWR;
+		need_update = true;
 	}
+
+	return need_update;
 }
 
 int iwlagn_bt_coex_profile_notif(struct iwl_priv *priv,
@@ -611,7 +641,11 @@ int iwlagn_bt_coex_profile_notif(struct iwl_priv *priv,
 		}
 	}
 
-	iwlagn_set_kill_msk(priv, uart_msg);
+	/* schedule to send runtime bt_config */
+	if (iwlagn_set_kill_msk(priv, uart_msg) ||
+	    iwlagn_fill_txpower_mode(priv, uart_msg))
+		queue_work(priv->workqueue, &priv->bt_runtime_config);
+
 
 	/* FIXME: based on notification, adjust the prio_boost */
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index f70219c..7006237 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -921,6 +921,7 @@ struct iwl_priv {
 	__le32 kill_ack_mask;
 	__le32 kill_cts_mask;
 	__le16 bt_valid;
+	bool reduced_txpower;
 	u16 bt_on_thresh;
 	u16 bt_duration;
 	u16 dynamic_frag_thresh;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 04/11] iwlwifi: add reduced tx power threshold define
  2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
                   ` (2 preceding siblings ...)
  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 ` Wey-Yi Guy
  2012-04-24 23:45 ` [PATCH 05/11] iwlwifi: small define change Wey-Yi Guy
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:45 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Wey-Yi Guy

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-commands.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index c212e53..5e02b4f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -3634,6 +3634,9 @@ enum iwl_bt_coex_profile_traffic_load {
 		(0x3<<BT_UART_MSG_2_FRAME7RESERVED_POS)
 
 
+#define BT_ENABLE_REDUCED_TXPOWER_THRESHOLD	(-62)
+#define BT_DISABLE_REDUCED_TXPOWER_THRESHOLD	(-65)
+
 struct iwl_bt_uart_msg {
 	u8 header;
 	u8 frame1;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 05/11] iwlwifi: small define change
  2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
                   ` (3 preceding siblings ...)
  2012-04-24 23:45 ` [PATCH 04/11] iwlwifi: add reduced tx power threshold define Wey-Yi Guy
@ 2012-04-24 23:45 ` Wey-Yi Guy
  2012-04-24 23:45 ` [PATCH 06/11] iwlwifi: send reduce tx power info in command Wey-Yi Guy
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:45 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Wey-Yi Guy

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-commands.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 5e02b4f..15e9bfb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -1903,6 +1903,8 @@ struct iwl_bt_cmd {
 					IWLAGN_BT_VALID_REDUCED_TX_PWR | \
 					IWLAGN_BT_VALID_3W_LUT)
 
+#define IWLAGN_BT_DECISION_LUT_SIZE	12
+
 struct iwl_basic_bt_cmd {
 	u8 flags;
 	u8 ledtime; /* unused */
@@ -1913,7 +1915,7 @@ struct iwl_basic_bt_cmd {
 	u8 bt3_prio_sample_time;
 	u8 bt3_timer_t2_value;
 	__le16 bt4_reaction_time; /* unused */
-	__le32 bt3_lookup_table[12];
+	__le32 bt3_lookup_table[IWLAGN_BT_DECISION_LUT_SIZE];
 	__le16 bt4_decision_time; /* unused */
 	__le16 valid;
 };
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 06/11] iwlwifi: send reduce tx power info in command
  2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
                   ` (4 preceding siblings ...)
  2012-04-24 23:45 ` [PATCH 05/11] iwlwifi: small define change Wey-Yi Guy
@ 2012-04-24 23:45 ` Wey-Yi Guy
  2012-04-24 23:46 ` [PATCH 07/11] iwlwifi: change kill mask based on reduce power state Wey-Yi Guy
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:45 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Wey-Yi Guy

Add the reduce tx power information in bt coex host command

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c  |    1 +
 drivers/net/wireless/iwlwifi/iwl-commands.h |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 994a7da..ac483eb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -256,6 +256,7 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
 
 	basic.kill_ack_mask = priv->kill_ack_mask;
 	basic.kill_cts_mask = priv->kill_cts_mask;
+	basic.reduce_txpower = priv->reduced_txpower;
 	basic.valid = priv->bt_valid;
 
 	/*
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 15e9bfb..e5dfbfd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -1916,7 +1916,8 @@ struct iwl_basic_bt_cmd {
 	u8 bt3_timer_t2_value;
 	__le16 bt4_reaction_time; /* unused */
 	__le32 bt3_lookup_table[IWLAGN_BT_DECISION_LUT_SIZE];
-	__le16 bt4_decision_time; /* unused */
+	u8 reduce_txpower;
+	u8 reserved;
 	__le16 valid;
 };
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 07/11] iwlwifi: change kill mask based on reduce power state
  2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
                   ` (5 preceding siblings ...)
  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
  2012-04-24 23:46 ` [PATCH 08/11] iwlwifi: add loose coex lut Wey-Yi Guy
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:46 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Wey-Yi Guy

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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 08/11] iwlwifi: add loose coex lut
  2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
                   ` (6 preceding siblings ...)
  2012-04-24 23:46 ` [PATCH 07/11] iwlwifi: change kill mask based on reduce power state Wey-Yi Guy
@ 2012-04-24 23:46 ` Wey-Yi Guy
  2012-04-24 23:46 ` [PATCH 09/11] iwlwifi: use IWL_* instead of dev_printk when possible Wey-Yi Guy
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:46 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Wey-Yi Guy

Add the Loose coex LUT and will use later for better bt coex tpt

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 9fb4c7d..01dc442 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -186,7 +186,8 @@ done:
 /*
  * BT coex
  */
-static const __le32 iwlagn_def_3w_lookup[12] = {
+/* Notmal TDM */
+static const __le32 iwlagn_def_3w_lookup[IWLAGN_BT_DECISION_LUT_SIZE] = {
 	cpu_to_le32(0xaaaaaaaa),
 	cpu_to_le32(0xaaaaaaaa),
 	cpu_to_le32(0xaeaaaaaa),
@@ -201,7 +202,25 @@ static const __le32 iwlagn_def_3w_lookup[12] = {
 	cpu_to_le32(0xf0005000),
 };
 
-static const __le32 iwlagn_concurrent_lookup[12] = {
+
+/* Loose Coex */
+static const __le32 iwlagn_loose_lookup[IWLAGN_BT_DECISION_LUT_SIZE] = {
+	cpu_to_le32(0xaaaaaaaa),
+	cpu_to_le32(0xaaaaaaaa),
+	cpu_to_le32(0xaeaaaaaa),
+	cpu_to_le32(0xaaaaaaaa),
+	cpu_to_le32(0xcc00ff28),
+	cpu_to_le32(0x0000aaaa),
+	cpu_to_le32(0xcc00aaaa),
+	cpu_to_le32(0x0000aaaa),
+	cpu_to_le32(0x00000000),
+	cpu_to_le32(0x00000000),
+	cpu_to_le32(0xf0005000),
+	cpu_to_le32(0xf0005000),
+};
+
+/* Full concurrency */
+static const __le32 iwlagn_concurrent_lookup[IWLAGN_BT_DECISION_LUT_SIZE] = {
 	cpu_to_le32(0xaaaaaaaa),
 	cpu_to_le32(0xaaaaaaaa),
 	cpu_to_le32(0xaaaaaaaa),
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 09/11] iwlwifi: use IWL_* instead of dev_printk when possible
  2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
                   ` (7 preceding siblings ...)
  2012-04-24 23:46 ` [PATCH 08/11] iwlwifi: add loose coex lut Wey-Yi Guy
@ 2012-04-24 23:46 ` 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
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:46 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Emmanuel Grumbach, Wey-Yi Guy

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Also remove a debug print when allocation error occurred.
The kernel will complain anyway.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c |   11 +++++------
 drivers/net/wireless/iwlwifi/iwl-drv.c |    8 ++++----
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index b53852d..8f60f28 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1422,32 +1422,31 @@ void iwl_set_hw_params(struct iwl_priv *priv)
 
 void iwl_debug_config(struct iwl_priv *priv)
 {
-	dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEBUG "
+	IWL_INFO(priv, "CONFIG_IWLWIFI_DEBUG "
 #ifdef CONFIG_IWLWIFI_DEBUG
 		"enabled\n");
 #else
 		"disabled\n");
 #endif
-	dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEBUGFS "
+	IWL_INFO(priv, "CONFIG_IWLWIFI_DEBUGFS "
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 		"enabled\n");
 #else
 		"disabled\n");
 #endif
-	dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEVICE_TRACING "
+	IWL_INFO(priv, "CONFIG_IWLWIFI_DEVICE_TRACING "
 #ifdef CONFIG_IWLWIFI_DEVICE_TRACING
 		"enabled\n");
 #else
 		"disabled\n");
 #endif
-
-	dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEVICE_TESTMODE "
+	IWL_INFO(priv, "CONFIG_IWLWIFI_DEVICE_TESTMODE "
 #ifdef CONFIG_IWLWIFI_DEVICE_TESTMODE
 		"enabled\n");
 #else
 		"disabled\n");
 #endif
-	dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_P2P "
+	IWL_INFO(priv, "CONFIG_IWLWIFI_P2P "
 #ifdef CONFIG_IWLWIFI_P2P
 		"enabled\n");
 #else
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index 05302d6..430cca5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -66,6 +66,7 @@
 #include <linux/module.h>
 
 #include "iwl-drv.h"
+#include "iwl-debug.h"
 #include "iwl-trans.h"
 #include "iwl-op-mode.h"
 #include "iwl-agn-hw.h"
@@ -892,10 +893,9 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans,
 	int ret;
 
 	drv = kzalloc(sizeof(*drv), GFP_KERNEL);
-	if (!drv) {
-		dev_printk(KERN_ERR, trans->dev, "Couldn't allocate iwl_drv");
+	if (!drv)
 		return NULL;
-	}
+
 	drv->trans = trans;
 	drv->dev = trans->dev;
 	drv->cfg = cfg;
@@ -905,7 +905,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans,
 	ret = iwl_request_firmware(drv, true);
 
 	if (ret) {
-		dev_printk(KERN_ERR, trans->dev, "Couldn't request the fw");
+		IWL_ERR(trans, "Couldn't request the fw\n");
 		kfree(drv);
 		drv = NULL;
 	}
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 10/11] iwlwifi: add option to disable 5GHz band
  2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
                   ` (8 preceding siblings ...)
  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 ` 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
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:46 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Stanislaw Gruszka, Wey-Yi Guy

From: Stanislaw Gruszka <sgruszka@redhat.com>

There are various problems happened on 5GHz band not observed on
2.4 GHz (microcode errors, queue stuck, etc... ) . Also roaming
between 5GHz AP and 2GHz does not work very well. To workaround
the problems add option to disable 5GHz support. This will help
on environments where APs are dual-band, and devices will not try
to associate on band where issues happen.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c       |    3 +++
 drivers/net/wireless/iwlwifi/iwl-drv.c       |    4 ++++
 drivers/net/wireless/iwlwifi/iwl-modparams.h |    2 ++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 8f60f28..2023dd1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1310,6 +1310,9 @@ static int iwl_init_geos(struct iwl_priv *priv)
 		priv->hw_params.sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
 	}
 
+	if (iwlwifi_mod_params.disable_5ghz)
+		priv->bands[IEEE80211_BAND_5GHZ].n_channels = 0;
+
 	IWL_INFO(priv, "Tunable channels: %d 802.11bg, %d 802.11a channels\n",
 		   priv->bands[IEEE80211_BAND_2GHZ].n_channels,
 		   priv->bands[IEEE80211_BAND_5GHZ].n_channels);
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index 430cca5..3c72bad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -1012,3 +1012,7 @@ module_param_named(auto_agg, iwlwifi_mod_params.auto_agg,
 		bool, S_IRUGO);
 MODULE_PARM_DESC(auto_agg,
 		 "enable agg w/o check traffic load (default: enable)");
+
+module_param_named(5ghz_disable, iwlwifi_mod_params.disable_5ghz,
+		bool, S_IRUGO);
+MODULE_PARM_DESC(5ghz_disable, "disable 5GHz band (default: 0 [enabled])");
diff --git a/drivers/net/wireless/iwlwifi/iwl-modparams.h b/drivers/net/wireless/iwlwifi/iwl-modparams.h
index 558b2e6..ca15d9a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-modparams.h
+++ b/drivers/net/wireless/iwlwifi/iwl-modparams.h
@@ -103,6 +103,7 @@ enum iwl_power_level {
  * @ant_coupling: antenna coupling in dB, default = 0
  * @bt_ch_announce: BT channel inhibition, default = enable
  * @auto_agg: enable agg. without check, default = true
+ * @disable_5ghz: disable 5GHz capability, default = false
  */
 struct iwl_mod_params {
 	int sw_crypto;
@@ -119,6 +120,7 @@ struct iwl_mod_params {
 	int ant_coupling;
 	bool bt_ch_announce;
 	bool auto_agg;
+	bool disable_5ghz;
 };
 
 #endif /* #__iwl_shared_h__ */
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 11/11] iwlwifi: don't init trans->reg_lock from the op_mode
  2012-04-24 23:45 [PATCH 00/11] update for 3.5: iwlwifi 2012-04-24 Wey-Yi Guy
                   ` (9 preceding siblings ...)
  2012-04-24 23:46 ` [PATCH 10/11] iwlwifi: add option to disable 5GHz band Wey-Yi Guy
@ 2012-04-24 23:46 ` Wey-Yi Guy
  10 siblings, 0 replies; 12+ messages in thread
From: Wey-Yi Guy @ 2012-04-24 23:46 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Emmanuel Grumbach, Wey-Yi Guy

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

This doesn't make any sense. Init it from the transport instead.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c        |    1 -
 drivers/net/wireless/iwlwifi/iwl-trans-pcie.c |    1 +
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 2023dd1..100cbe2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1591,7 +1591,6 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
 	/* these spin locks will be used in apm_ops.init and EEPROM access
 	 * we should init now
 	 */
-	spin_lock_init(&priv->trans->reg_lock);
 	spin_lock_init(&priv->statistics.lock);
 
 	/***********************
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index 63557bb..2e57161 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -2175,6 +2175,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
 
 	/* Initialize the wait queue for commands */
 	init_waitqueue_head(&trans->wait_command_queue);
+	spin_lock_init(&trans->reg_lock);
 
 	return trans;
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-04-24 23:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 07/11] iwlwifi: change kill mask based on reduce power state Wey-Yi Guy
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

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.