Skip to contentSkip to conversation

update for 2.6.38

PATCH New Wey-Yi Guy 1 participant 6 messages Dec 2, 2010 Networking drivers (wireless)

lore
Share & tools
lore

Wey-Yi Guy

author
#0 lore raw

cover update for 2.6.38

We enable PCI L1 state after uCode load to improve device power consumption
We also fix the error when sending rxon command to uCode while the device is on the way to shutdown

Grumbach, Emmanuel (1):
iwlagn: Enable PCI L1 ACTIVE state after uCode has been loaded

Wey-Yi Guy (4):
iwlagn: fix race condition when reprogram sta
iwlagn: remove structure name reference to gen2
iwlwifi: check for STATUS_EXIT_PENDING when send RXON command
iwlagn: name change for bt_ch_announce module parameter

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

 drivers/net/wireless/iwlwifi/iwl-3945.c      |    3 +
 drivers/net/wireless/iwlwifi/iwl-6000.c      |   20 ++++----
 drivers/net/wireless/iwlwifi/iwl-agn-rxon.c  |    3 +
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c |    4 ++
 drivers/net/wireless/iwlwifi/iwl-agn.c       |   70 +++++++++++++------------
 drivers/net/wireless/iwlwifi/iwl-agn.h       |   20 ++++----
 drivers/net/wireless/iwlwifi/iwl-sta.c       |   13 +++++
 7 files changed, 79 insertions(+), 54 deletions(-)
author
#1 lore raw

PATCH 1/5 iwlagn: fix race condition when reprogram sta

From: Wey-Yi Guy <[email protected]>

During reprogram stations, do not send link quality command. uCode will crash if receive link quality command for invalid station

---
 drivers/net/wireless/iwlwifi/iwl-sta.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-sta.c +13 -0
index 0a67b2f..4776323 100644
@@ -647,6 +647,7 @@ void iwl_reprogram_ap_sta(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 	memcpy(&lq, priv->stations[sta_id].lq, sizeof(lq));
 
 	active = priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE;
+	priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE;
 	spin_unlock_irqrestore(&priv->sta_lock, flags);
 
 	if (active) {
@@ -657,6 +658,10 @@ void iwl_reprogram_ap_sta(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 			IWL_ERR(priv, "failed to remove STA %pM (%d)\n",
 				priv->stations[sta_id].sta.sta.addr, ret);
 	}
+	spin_lock_irqsave(&priv->sta_lock, flags);
+	priv->stations[sta_id].used |= IWL_STA_DRIVER_ACTIVE;
+	spin_unlock_irqrestore(&priv->sta_lock, flags);
+
 	ret = iwl_send_add_sta(priv, &sta_cmd, CMD_SYNC);
 	if (ret)
 		IWL_ERR(priv, "failed to re-add STA %pM (%d)\n",
@@ -777,6 +782,14 @@ int iwl_send_lq_cmd(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
 	if (WARN_ON(lq->sta_id == IWL_INVALID_STATION))
 		return -EINVAL;
 
+
+	spin_lock_irqsave(&priv->sta_lock, flags_spin);
+	if (!(priv->stations[lq->sta_id].used & IWL_STA_DRIVER_ACTIVE)) {
+		spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
+		return -EINVAL;
+	}
+	spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
+
 	iwl_dump_lq_cmd(priv, lq);
 	BUG_ON(init && (cmd.flags & CMD_ASYNC));
 
Signature · 1 line
1.7.0.4
author
#2 lore raw

PATCH 2/5 iwlagn: Enable PCI L1 ACTIVE state after uCode has been loaded

In reply to Wey-Yi Guy

From: Grumbach, Emmanuel <[email protected]>

PCI L1 Active needs to be disabled while loading the uCode so that the bus doesn't go to sleep. The enablement of L1 Active should be done after the uCode has sent the ALIVE response. The enablement of L1 Active was missing.
Enabling L1 Active allows to save power if the BIOS / bus driver allows it.

I measured the power consumption while not associated and idle/associated:
L1 Active disabled: 39 mA = 130mW
L1 Active enabled: 6 mA = 20 mW

---
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-ucode.c +4 -0
index 0bdd2bb..24dabcd 100644
@@ -531,6 +531,10 @@ int iwlagn_alive_notify(struct iwl_priv *priv)
 
 	spin_unlock_irqrestore(&priv->lock, flags);
 
+	/* Enable L1-Active */
+	iwl_clear_bits_prph(priv, APMG_PCIDEV_STT_REG,
+			  APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
+
 	iwlagn_send_wimax_coex(priv);
 
 	iwlagn_set_Xtal_calib(priv);
Signature · 1 line
1.7.0.4
author
#3 lore raw

PATCH 3/5 iwlagn: remove structure name reference to gen2

In reply to Wey-Yi Guy

From: Wey-Yi Guy <[email protected]>

Give the corresponding name for .cfg data structure

---
 drivers/net/wireless/iwlwifi/iwl-6000.c |   20 +++++-----
 drivers/net/wireless/iwlwifi/iwl-agn.c  |   58 +++++++++++++++---------------
 drivers/net/wireless/iwlwifi/iwl-agn.h  |   20 +++++-----
 3 files changed, 49 insertions(+), 49 deletions(-)
drivers/net/wireless/iwlwifi/iwl-6000.c +10 -10
index ec41f27..8018f38 100644
@@ -552,7 +552,7 @@ static struct iwl_bt_params iwl6000_bt_params = {
 	.bt_sco_disable = true,
 };
 
-struct iwl_cfg iwl6000g2a_2agn_cfg = {
+struct iwl_cfg iwl6005_2agn_cfg = {
 	.name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
 	.fw_name_pre = IWL6000G2A_FW_PRE,
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,
@@ -568,7 +568,7 @@ struct iwl_cfg iwl6000g2a_2agn_cfg = {
 	.led_mode = IWL_LED_RF_STATE,
 };
 
-struct iwl_cfg iwl6000g2a_2abg_cfg = {
+struct iwl_cfg iwl6005_2abg_cfg = {
 	.name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
 	.fw_name_pre = IWL6000G2A_FW_PRE,
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,
@@ -583,7 +583,7 @@ struct iwl_cfg iwl6000g2a_2abg_cfg = {
 	.led_mode = IWL_LED_RF_STATE,
 };
 
-struct iwl_cfg iwl6000g2a_2bg_cfg = {
+struct iwl_cfg iwl6005_2bg_cfg = {
 	.name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
 	.fw_name_pre = IWL6000G2A_FW_PRE,
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,
@@ -598,7 +598,7 @@ struct iwl_cfg iwl6000g2a_2bg_cfg = {
 	.led_mode = IWL_LED_RF_STATE,
 };
 
-struct iwl_cfg iwl6000g2b_2agn_cfg = {
+struct iwl_cfg iwl6030_2agn_cfg = {
 	.name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
 	.fw_name_pre = IWL6000G2B_FW_PRE,
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,
@@ -618,7 +618,7 @@ struct iwl_cfg iwl6000g2b_2agn_cfg = {
 	.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
 };
 
-struct iwl_cfg iwl6000g2b_2abg_cfg = {
+struct iwl_cfg iwl6030_2abg_cfg = {
 	.name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
 	.fw_name_pre = IWL6000G2B_FW_PRE,
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,
@@ -637,7 +637,7 @@ struct iwl_cfg iwl6000g2b_2abg_cfg = {
 	.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
 };
 
-struct iwl_cfg iwl6000g2b_2bgn_cfg = {
+struct iwl_cfg iwl6030_2bgn_cfg = {
 	.name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
 	.fw_name_pre = IWL6000G2B_FW_PRE,
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,
@@ -657,7 +657,7 @@ struct iwl_cfg iwl6000g2b_2bgn_cfg = {
 	.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
 };
 
-struct iwl_cfg iwl6000g2b_2bg_cfg = {
+struct iwl_cfg iwl6030_2bg_cfg = {
 	.name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
 	.fw_name_pre = IWL6000G2B_FW_PRE,
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,
@@ -676,7 +676,7 @@ struct iwl_cfg iwl6000g2b_2bg_cfg = {
 	.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
 };
 
-struct iwl_cfg iwl6000g2b_bgn_cfg = {
+struct iwl_cfg iwl1030_bgn_cfg = {
 	.name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
 	.fw_name_pre = IWL6000G2B_FW_PRE,
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,
@@ -696,7 +696,7 @@ struct iwl_cfg iwl6000g2b_bgn_cfg = {
 	.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
 };
 
-struct iwl_cfg iwl6000g2b_bg_cfg = {
+struct iwl_cfg iwl1030_bg_cfg = {
 	.name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
 	.fw_name_pre = IWL6000G2B_FW_PRE,
 	.ucode_api_max = IWL6000G2_UCODE_API_MAX,
@@ -782,7 +782,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
 	.led_mode = IWL_LED_BLINK,
 };
 
-struct iwl_cfg iwl6050g2_bgn_cfg = {
+struct iwl_cfg iwl6150_bgn_cfg = {
 	.name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
 	.fw_name_pre = IWL6050_FW_PRE,
 	.ucode_api_max = IWL6050_UCODE_API_MAX,
drivers/net/wireless/iwlwifi/iwl-agn.c +29 -29

72 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-agn.h +10 -10
index 28837a1..da30358 100644
@@ -74,22 +74,22 @@ extern struct iwl_cfg iwl5100_bgn_cfg;
 extern struct iwl_cfg iwl5100_abg_cfg;
 extern struct iwl_cfg iwl5150_agn_cfg;
 extern struct iwl_cfg iwl5150_abg_cfg;
-extern struct iwl_cfg iwl6000g2a_2agn_cfg;
-extern struct iwl_cfg iwl6000g2a_2abg_cfg;
-extern struct iwl_cfg iwl6000g2a_2bg_cfg;
-extern struct iwl_cfg iwl6000g2b_bgn_cfg;
-extern struct iwl_cfg iwl6000g2b_bg_cfg;
-extern struct iwl_cfg iwl6000g2b_2agn_cfg;
-extern struct iwl_cfg iwl6000g2b_2abg_cfg;
-extern struct iwl_cfg iwl6000g2b_2bgn_cfg;
-extern struct iwl_cfg iwl6000g2b_2bg_cfg;
+extern struct iwl_cfg iwl6005_2agn_cfg;
+extern struct iwl_cfg iwl6005_2abg_cfg;
+extern struct iwl_cfg iwl6005_2bg_cfg;
+extern struct iwl_cfg iwl1030_bgn_cfg;
+extern struct iwl_cfg iwl1030_bg_cfg;
+extern struct iwl_cfg iwl6030_2agn_cfg;
+extern struct iwl_cfg iwl6030_2abg_cfg;
+extern struct iwl_cfg iwl6030_2bgn_cfg;
+extern struct iwl_cfg iwl6030_2bg_cfg;
 extern struct iwl_cfg iwl6000i_2agn_cfg;
 extern struct iwl_cfg iwl6000i_2abg_cfg;
 extern struct iwl_cfg iwl6000i_2bg_cfg;
 extern struct iwl_cfg iwl6000_3agn_cfg;
 extern struct iwl_cfg iwl6050_2agn_cfg;
 extern struct iwl_cfg iwl6050_2abg_cfg;
-extern struct iwl_cfg iwl6050g2_bgn_cfg;
+extern struct iwl_cfg iwl6150_bgn_cfg;
 extern struct iwl_cfg iwl1000_bgn_cfg;
 extern struct iwl_cfg iwl1000_bg_cfg;
 extern struct iwl_cfg iwl100_bgn_cfg;
Signature · 1 line
1.7.0.4
author
#4 lore raw

PATCH 4/5 iwlwifi: check for STATUS_EXIT_PENDING when send RXON command

In reply to Wey-Yi Guy

From: Wey-Yi Guy <[email protected]>

If driver is on the way down, there is no need to send RXON to uCode, check the condition before continuous the process.

---
 drivers/net/wireless/iwlwifi/iwl-3945.c     |    3 +++
 drivers/net/wireless/iwlwifi/iwl-agn-rxon.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945.c +3 -0
index d39f449..cac9647 100644
@@ -1784,6 +1784,9 @@ int iwl3945_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 	int rc = 0;
 	bool new_assoc = !!(staging_rxon->filter_flags & RXON_FILTER_ASSOC_MSK);
 
+	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+		return -EINVAL;
+
 	if (!iwl_is_alive(priv))
 		return -1;
 
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +3 -0
index 203ee60..4865b82 100644
@@ -130,6 +130,9 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 
 	lockdep_assert_held(&priv->mutex);
 
+	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+		return -EINVAL;
+
 	if (!iwl_is_alive(priv))
 		return -EBUSY;
 
Signature · 1 line
1.7.0.4
author
#5 lore raw

PATCH 5/5 iwlagn: name change for bt_ch_announce module parameter

In reply to Wey-Yi Guy

From: Wey-Yi Guy <[email protected]>

Change the module parameter name to bt_ch_inhibition from bt_ch_announce to better describe the functionality

In order to allow Bluetooth to activate a smart AFH mechanism and to maximize its available bandwidth the WiFi will request BT Core to inhibit its activity in channels that interfere with WiFi activity (and vice versa) if bt_ch_inhibition is enabled

Set module parameter "bt_ch_inhibition=0" will disable the channel inhibition function

---
 drivers/net/wireless/iwlwifi/iwl-agn.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +7 -5
index 9a6f7a0..32ab4a0 100644
@@ -2502,7 +2502,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
 		return pos;
 	}
 
-	/* enable/disable bt channel announcement */
+	/* enable/disable bt channel inhibition */
 	priv->bt_ch_announce = iwlagn_bt_ch_announce;
 
 #ifdef CONFIG_IWLWIFI_DEBUG
@@ -4044,8 +4044,10 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		(iwlagn_ant_coupling > IWL_BT_ANTENNA_COUPLING_THRESHOLD) ?
 		true : false;
 
-	/* enable/disable bt channel announcement */
+	/* enable/disable bt channel inhibition */
 	priv->bt_ch_announce = iwlagn_bt_ch_announce;
+	IWL_DEBUG_INFO(priv, "BT channel inhibition is %s\n",
+		       (priv->bt_ch_announce) ? "On" : "Off");
 
 	if (iwl_alloc_traffic_mem(priv))
 		IWL_ERR(priv, "Not enough memory to generate traffic log\n");
@@ -4588,6 +4590,6 @@ module_param_named(antenna_coupling, iwlagn_ant_coupling, int, S_IRUGO);
 MODULE_PARM_DESC(antenna_coupling,
 		 "specify antenna coupling in dB (defualt: 0 dB)");
 
-module_param_named(bt_ch_announce, iwlagn_bt_ch_announce, bool, S_IRUGO);
-MODULE_PARM_DESC(bt_ch_announce,
-		 "Enable BT channel announcement mode (default: enable)");
+module_param_named(bt_ch_inhibition, iwlagn_bt_ch_announce, bool, S_IRUGO);
+MODULE_PARM_DESC(bt_ch_inhibition,
+		 "Disable BT channel inhibition (default: enable)");
Signature · 1 line
1.7.0.4