From dd551ab7b47ace14753b0d73f79437cc35adcf6b Mon Sep 17 00:00:00 2001 From: Wey-Yi Guy Date: Thu, 3 May 2012 14:22:01 -0700 Subject: iwlwifi: include rssi as part of decision making for reduce txpower In bt coex, consider the average rssi as part of decision making process Change-Id: I8d11d7f177a6875e2a9d08f7539d42253226fd7a Signed-off-by: Wey-Yi Guy Reviewed-on: http://git-mwg.jer.intel.com/gerrit/1945 Tested-by: Jenkins Reviewed-by: Emmanuel Grumbach Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c') diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 01dc44267317..9d88565cabf8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "iwl-dev.h" #include "iwl-io.h" @@ -593,9 +594,18 @@ static bool iwlagn_fill_txpower_mode(struct iwl_priv *priv, struct iwl_bt_uart_msg *uart_msg) { bool need_update = false; + struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; + int ave_rssi; + ave_rssi = ieee80211_ave_rssi(ctx->vif); + if (!ave_rssi) { + /* no rssi data, no changes to reduce tx power */ + IWL_DEBUG_COEX(priv, "no rssi data available\n"); + return need_update; + } if (!priv->reduced_txpower && !iwl_is_associated(priv, IWL_RXON_CTX_PAN) && + (ave_rssi > BT_ENABLE_REDUCED_TXPOWER_THRESHOLD) && (uart_msg->frame3 & (BT_UART_MSG_FRAME3ACL_MSK | BT_UART_MSG_FRAME3OBEX_MSK)) && !(uart_msg->frame3 & (BT_UART_MSG_FRAME3SCOESCO_MSK | @@ -606,6 +616,7 @@ static bool iwlagn_fill_txpower_mode(struct iwl_priv *priv, need_update = true; } else if (priv->reduced_txpower && (iwl_is_associated(priv, IWL_RXON_CTX_PAN) || + (ave_rssi < BT_DISABLE_REDUCED_TXPOWER_THRESHOLD) || (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 | -- cgit v1.2.1 From 83ce21de686a67b74ae9ba419c0fc144029a3063 Mon Sep 17 00:00:00 2001 From: Wey-Yi Guy Date: Thu, 3 May 2012 14:22:02 -0700 Subject: iwlwifi: add documentation for bt reduced tx power Change-Id: Ia6294d651dcffdcaf8b62e67bcef52bd8c158dea Signed-off-by: Wey-Yi Guy Reviewed-on: http://git-mwg.jer.intel.com/gerrit/1947 Tested-by: Jenkins Reviewed-by: Emmanuel Grumbach Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c') diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 9d88565cabf8..cb4b31f658c3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c @@ -274,9 +274,20 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv) return; } + /* + * Possible situations when BT needs to take over for receive, + * at the same time where STA needs to response to AP's frame(s), + * reduce the tx power of the required response frames, by that, + * allow the concurrent BT receive & WiFi transmit + * (BT - ANT A, WiFi -ANT B), without interference to one another + * + * Reduced tx power apply to control frames only (ACK/Back/CTS) + * when indicated by the BT config command + */ basic.kill_ack_mask = priv->kill_ack_mask; basic.kill_cts_mask = priv->kill_cts_mask; - basic.reduce_txpower = priv->reduced_txpower; + if (priv->reduced_txpower) + basic.reduce_txpower = IWLAGN_BT_REDUCED_TX_PWR; basic.valid = priv->bt_valid; /* @@ -590,6 +601,15 @@ static bool iwlagn_set_kill_msk(struct iwl_priv *priv, return need_update; } +/* + * Upon RSSI changes, sends a bt config command with following changes + * 1. enable/disable "reduced control frames tx power + * 2. update the "kill)ack_mask" and "kill_cts_mask" + * + * If "reduced tx power" is enabled, uCode shall + * 1. ACK/Back/CTS rate shall reduced to 6Mbps + * 2. not use duplciate 20/40MHz mode + */ static bool iwlagn_fill_txpower_mode(struct iwl_priv *priv, struct iwl_bt_uart_msg *uart_msg) { -- cgit v1.2.1 From f6be8b7845434a509348afa125d967ffd6801bae Mon Sep 17 00:00:00 2001 From: Wey-Yi Guy Date: Thu, 3 May 2012 14:22:03 -0700 Subject: iwlwifi: make sure reduced tx power bit is valid Once driver decide to change reduced tx power behavior, make sure the reduce tx power valid bit is set Change-Id: I3afae96319292d8cb347a812a948085c5db7ad91 Signed-off-by: Wey-Yi Guy Reviewed-on: http://git-mwg.jer.intel.com/gerrit/1948 Tested-by: Jenkins Reviewed-by: Emmanuel Grumbach Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c') diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index cb4b31f658c3..e55ec6c8a920 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c @@ -643,7 +643,7 @@ static bool iwlagn_fill_txpower_mode(struct iwl_priv *priv, BT_UART_MSG_FRAME3OBEX_MSK)))) { /* disable reduced tx power */ priv->reduced_txpower = false; - priv->bt_valid &= ~IWLAGN_BT_VALID_REDUCED_TX_PWR; + priv->bt_valid |= IWLAGN_BT_VALID_REDUCED_TX_PWR; need_update = true; } -- cgit v1.2.1