linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8 2.6.31 and w-t] iwlwifi driver updates 06/12/2009
@ 2009-06-12 20:22 Reinette Chatre
  2009-06-12 20:22 ` [PATCH 1/8 v2.6.31 and w-t ] iwlwifi: revamp bss_info_changed Reinette Chatre
  0 siblings, 1 reply; 10+ messages in thread
From: Reinette Chatre @ 2009-06-12 20:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Reinette Chatre

We include a few bugfixes for 2.6.31 and additional changes that target
2.6.32. Here we have a few fixes for pure 40Mhz mode. We also fix a
bug that caused a few errors when you suspend/resume while being association.
The rest of the patches improve behavior of 5150 device and more cleanup.

[PATCH 1/8 v2.6.31 and w-t ] iwlwifi: revamp bss_info_changed
[PATCH 2/8 v2.6.31 and w-t ] iwlwifi: checking for 40MHz mode
[PATCH 3/8 v2.6.31 and w-t ] iwlwifi: check control channel for pure 40MHz
[PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz
[PATCH 5/8 v2.6.31 and w-t ] iwlwifi/iwl3945: fix suspend resume association bug
[PATCH 6/8] iwlwifi: modify sensitivity value for 5150
[PATCH 7/8] iwlwifi: no need to refer to max_nrg_cck range value
[PATCH 8/8] iwlwifi: remove disable_tx_power for device > 4965


Reinette

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

* [PATCH 1/8 v2.6.31 and w-t ] iwlwifi: revamp bss_info_changed
  2009-06-12 20:22 [PATCH 0/8 2.6.31 and w-t] iwlwifi driver updates 06/12/2009 Reinette Chatre
@ 2009-06-12 20:22 ` Reinette Chatre
  2009-06-12 20:22   ` [PATCH 2/8 v2.6.31 and w-t ] iwlwifi: checking for 40MHz mode Reinette Chatre
  0 siblings, 1 reply; 10+ messages in thread
From: Reinette Chatre @ 2009-06-12 20:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Reinette Chatre

From: Johannes Berg <johannes@sipsolutions.net>

My earlier patch,
	"mac80211: unify config_interface and bss_info_changed"
introduced a bug in iwlwifi where it will do some things
incorrectly now when reassociating.

Revamp iwl_bss_info_changed to fix that issue and make it
easier to read. Also, while at it, add comments about things
that it should do but currently doesn't.

Finally, also improve the locking in the function.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-core.c |  114 +++++++++++++++++++------------
 1 files changed, 70 insertions(+), 44 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index f9d16ca..e05faa0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2390,39 +2390,46 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
 		priv->ibss_beacon = ieee80211_beacon_get(hw, vif);
 	}
 
-	if ((changes & BSS_CHANGED_BSSID) && !iwl_is_rfkill(priv)) {
-		/* If there is currently a HW scan going on in the background
-		 * then we need to cancel it else the RXON below will fail. */
+	if (changes & BSS_CHANGED_BEACON_INT) {
+		priv->beacon_int = bss_conf->beacon_int;
+		/* TODO: in AP mode, do something to make this take effect */
+	}
+
+	if (changes & BSS_CHANGED_BSSID) {
+		IWL_DEBUG_MAC80211(priv, "BSSID %pM\n", bss_conf->bssid);
+
+		/*
+		 * If there is currently a HW scan going on in the
+		 * background then we need to cancel it else the RXON
+		 * below/in post_associate will fail.
+		 */
 		if (iwl_scan_cancel_timeout(priv, 100)) {
-			IWL_WARN(priv, "Aborted scan still in progress "
-				    "after 100ms\n");
+			IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
 			IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
 			mutex_unlock(&priv->mutex);
 			return;
 		}
-		memcpy(priv->staging_rxon.bssid_addr,
-		       bss_conf->bssid, ETH_ALEN);
 
-		/* TODO: Audit driver for usage of these members and see
-		 * if mac80211 deprecates them (priv->bssid looks like it
-		 * shouldn't be there, but I haven't scanned the IBSS code
-		 * to verify) - jpk */
-		memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN);
+		/* mac80211 only sets assoc when in STATION mode */
+		if (priv->iw_mode == NL80211_IFTYPE_ADHOC ||
+		    bss_conf->assoc) {
+			memcpy(priv->staging_rxon.bssid_addr,
+			       bss_conf->bssid, ETH_ALEN);
 
-		if (priv->iw_mode == NL80211_IFTYPE_AP)
-			iwlcore_config_ap(priv);
-		else {
-			int rc = iwlcore_commit_rxon(priv);
-			if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc)
-				iwl_rxon_add_station(
-					priv, priv->active_rxon.bssid_addr, 1);
+			/* currently needed in a few places */
+			memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN);
+		} else {
+			priv->staging_rxon.filter_flags &=
+				~RXON_FILTER_ASSOC_MSK;
 		}
-	} else if (!iwl_is_rfkill(priv)) {
-		iwl_scan_cancel_timeout(priv, 100);
-		priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
-		iwlcore_commit_rxon(priv);
+
 	}
 
+	/*
+	 * This needs to be after setting the BSSID in case
+	 * mac80211 decides to do both changes at once because
+	 * it will invoke post_associate.
+	 */
 	if (priv->iw_mode == NL80211_IFTYPE_ADHOC &&
 	    changes & BSS_CHANGED_BEACON) {
 		struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
@@ -2431,8 +2438,6 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
 			iwl_mac_beacon_update(hw, beacon);
 	}
 
-	mutex_unlock(&priv->mutex);
-
 	if (changes & BSS_CHANGED_ERP_PREAMBLE) {
 		IWL_DEBUG_MAC80211(priv, "ERP_PREAMBLE %d\n",
 				   bss_conf->use_short_preamble);
@@ -2450,6 +2455,23 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
 			priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
 	}
 
+	if (changes & BSS_CHANGED_BASIC_RATES) {
+		/* XXX use this information
+		 *
+		 * To do that, remove code from iwl_set_rate() and put something
+		 * like this here:
+		 *
+		if (A-band)
+			priv->staging_rxon.ofdm_basic_rates =
+				bss_conf->basic_rates;
+		else
+			priv->staging_rxon.ofdm_basic_rates =
+				bss_conf->basic_rates >> 4;
+			priv->staging_rxon.cck_basic_rates =
+				bss_conf->basic_rates & 0xF;
+		 */
+	}
+
 	if (changes & BSS_CHANGED_HT) {
 		iwl_ht_conf(priv, bss_conf);
 
@@ -2459,10 +2481,6 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
 
 	if (changes & BSS_CHANGED_ASSOC) {
 		IWL_DEBUG_MAC80211(priv, "ASSOC %d\n", bss_conf->assoc);
-		/* This should never happen as this function should
-		 * never be called from interrupt context. */
-		if (WARN_ON_ONCE(in_interrupt()))
-			return;
 		if (bss_conf->assoc) {
 			priv->assoc_id = bss_conf->aid;
 			priv->beacon_int = bss_conf->beacon_int;
@@ -2470,27 +2488,35 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
 			priv->timestamp = bss_conf->timestamp;
 			priv->assoc_capability = bss_conf->assoc_capability;
 
-			/* we have just associated, don't start scan too early
-			 * leave time for EAPOL exchange to complete
+			/*
+			 * We have just associated, don't start scan too early
+			 * leave time for EAPOL exchange to complete.
+			 *
+			 * XXX: do this in mac80211
 			 */
 			priv->next_scan_jiffies = jiffies +
 					IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
-			mutex_lock(&priv->mutex);
-			priv->cfg->ops->lib->post_associate(priv);
-			mutex_unlock(&priv->mutex);
-		} else {
+			if (!iwl_is_rfkill(priv))
+				priv->cfg->ops->lib->post_associate(priv);
+		} else
 			priv->assoc_id = 0;
-			IWL_DEBUG_MAC80211(priv, "DISASSOC %d\n", bss_conf->assoc);
+
+	}
+
+	if (changes && iwl_is_associated(priv) && priv->assoc_id) {
+		IWL_DEBUG_MAC80211(priv, "Changes (%#x) while associated\n",
+				   changes);
+		ret = iwl_send_rxon_assoc(priv);
+		if (!ret) {
+			/* Sync active_rxon with latest change. */
+			memcpy((void *)&priv->active_rxon,
+				&priv->staging_rxon,
+				sizeof(struct iwl_rxon_cmd));
 		}
-	} else if (changes && iwl_is_associated(priv) && priv->assoc_id) {
-			IWL_DEBUG_MAC80211(priv, "Associated Changes %d\n", changes);
-			ret = iwl_send_rxon_assoc(priv);
-			if (!ret)
-				/* Sync active_rxon with latest change. */
-				memcpy((void *)&priv->active_rxon,
-					&priv->staging_rxon,
-					sizeof(struct iwl_rxon_cmd));
 	}
+
+	mutex_unlock(&priv->mutex);
+
 	IWL_DEBUG_MAC80211(priv, "leave\n");
 }
 EXPORT_SYMBOL(iwl_bss_info_changed);
-- 
1.5.6.3


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

* [PATCH 2/8 v2.6.31 and w-t ] iwlwifi: checking for 40MHz mode
  2009-06-12 20:22 ` [PATCH 1/8 v2.6.31 and w-t ] iwlwifi: revamp bss_info_changed Reinette Chatre
@ 2009-06-12 20:22   ` Reinette Chatre
  2009-06-12 20:22     ` [PATCH 3/8 v2.6.31 and w-t ] iwlwifi: check control channel for pure 40MHz Reinette Chatre
  0 siblings, 1 reply; 10+ messages in thread
From: Reinette Chatre @ 2009-06-12 20:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

when checking for 40MHz, compare ht_protection to
IEEE80211_HT_OP_MODE_PROTECTION_20MHZ. ht_protection is not a bit-mask
field

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

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index e05faa0..b2875fe 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -630,7 +630,7 @@ u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv,
 			return 0;
 	}
 
-	if (iwl_ht_conf->ht_protection & IEEE80211_HT_OP_MODE_PROTECTION_20MHZ)
+	if (iwl_ht_conf->ht_protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ)
 		return 1;
 	else
 		return iwl_is_channel_extension(priv, priv->band,
@@ -826,7 +826,7 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)
 			 RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
 	if (iwl_is_fat_tx_allowed(priv, NULL)) {
 		/* pure 40 fat */
-		if (rxon->flags & RXON_FLG_FAT_PROT_MSK)
+		if (ht_info->ht_protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ)
 			rxon->flags |= RXON_FLG_CHANNEL_MODE_PURE_40;
 		else {
 			/* Note: control channel is opposite of extension channel */
-- 
1.5.6.3


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

* [PATCH 3/8 v2.6.31 and w-t ] iwlwifi: check control channel for pure 40MHz
  2009-06-12 20:22   ` [PATCH 2/8 v2.6.31 and w-t ] iwlwifi: checking for 40MHz mode Reinette Chatre
@ 2009-06-12 20:22     ` Reinette Chatre
  2009-06-12 20:22       ` [PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz Reinette Chatre
  0 siblings, 1 reply; 10+ messages in thread
From: Reinette Chatre @ 2009-06-12 20:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

for pure 40MHz mode, set the control channel location if provided, but not
like Mixed mode; if information is not provided, still allow 40MHz
operation.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-core.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index b2875fe..b122eed 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -826,9 +826,18 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)
 			 RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
 	if (iwl_is_fat_tx_allowed(priv, NULL)) {
 		/* pure 40 fat */
-		if (ht_info->ht_protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ)
+		if (ht_info->ht_protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ) {
 			rxon->flags |= RXON_FLG_CHANNEL_MODE_PURE_40;
-		else {
+			/* Note: control channel is opposite of extension channel */
+			switch (ht_info->extension_chan_offset) {
+			case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
+				rxon->flags &= ~RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
+				break;
+			case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
+				rxon->flags |= RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
+				break;
+			}
+		} else {
 			/* Note: control channel is opposite of extension channel */
 			switch (ht_info->extension_chan_offset) {
 			case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
-- 
1.5.6.3


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

* [PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz
  2009-06-12 20:22     ` [PATCH 3/8 v2.6.31 and w-t ] iwlwifi: check control channel for pure 40MHz Reinette Chatre
@ 2009-06-12 20:22       ` Reinette Chatre
  2009-06-12 20:22         ` [PATCH 5/8 v2.6.31 and w-t ] iwlwifi/iwl3945: fix suspend resume association bug Reinette Chatre
  2009-06-12 20:55         ` [PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz reinette chatre
  0 siblings, 2 replies; 10+ messages in thread
From: Reinette Chatre @ 2009-06-12 20:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

for both mixed and pure 40MHz, need to check for valid channel location.
if the specified channel not allow the channel location requested
(ABOVE, BELOW), then reject the Fat channel access

This fixes http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1988

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-core.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index b122eed..6ab0716 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -629,13 +629,9 @@ u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv,
 		if (!sta_ht_inf->ht_supported)
 			return 0;
 	}
-
-	if (iwl_ht_conf->ht_protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ)
-		return 1;
-	else
-		return iwl_is_channel_extension(priv, priv->band,
-				le16_to_cpu(priv->staging_rxon.channel),
-				iwl_ht_conf->extension_chan_offset);
+	return iwl_is_channel_extension(priv, priv->band,
+			le16_to_cpu(priv->staging_rxon.channel),
+			iwl_ht_conf->extension_chan_offset);
 }
 EXPORT_SYMBOL(iwl_is_fat_tx_allowed);
 
-- 
1.5.6.3


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

* [PATCH 5/8 v2.6.31 and w-t ] iwlwifi/iwl3945: fix suspend resume association bug
  2009-06-12 20:22       ` [PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz Reinette Chatre
@ 2009-06-12 20:22         ` Reinette Chatre
  2009-06-12 20:22           ` [PATCH 6/8] iwlwifi: modify sensitivity value for 5150 Reinette Chatre
  2009-06-12 20:55         ` [PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz reinette chatre
  1 sibling, 1 reply; 10+ messages in thread
From: Reinette Chatre @ 2009-06-12 20:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Abhijeet Kolekar, Reinette Chatre

From: Abhijeet Kolekar <abhijeet.kolekar@intel.com>

Patch fixes the following bugs at
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=2005
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=2007

If we suspend with an association and then resumed,
we need to synchronize the active rxon with staging rxon,
else we will get an error when iwl_alive_start try to commit
rxon and staging is set to channel 0. Before going to suspend
staging and active rxon are in sync. After resuming from the
suspend, iwl_mac_start is called and it clears the staging
rxon. Patch fixes the bug by not clearing the staging rxon
in iwl_mac_start.

Patch also adds similar fix to 3945.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c      |    1 -
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    4 +---
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index a5637c4..6d1519e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2152,7 +2152,6 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
 	/* we should be verifying the device is ready to be opened */
 	mutex_lock(&priv->mutex);
 
-	memset(&priv->staging_rxon, 0, sizeof(struct iwl_rxon_cmd));
 	/* fetch ucode file from disk, alloc and copy to bus-master buffers ...
 	 * ucode filename and max sizes are card-specific. */
 
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 83d3160..cb9bd4c 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2498,8 +2498,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
 		struct iwl3945_rxon_cmd *active_rxon =
 				(struct iwl3945_rxon_cmd *)(&priv->active_rxon);
 
-		memcpy(&priv->staging_rxon, &priv->active_rxon,
-		       sizeof(priv->staging_rxon));
+		priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
 		active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
 	} else {
 		/* Initialize our rx_config data */
@@ -3147,7 +3146,6 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
 	/* we should be verifying the device is ready to be opened */
 	mutex_lock(&priv->mutex);
 
-	memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon));
 	/* fetch ucode file from disk, alloc and copy to bus-master buffers ...
 	 * ucode filename and max sizes are card-specific. */
 
-- 
1.5.6.3


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

* [PATCH 6/8] iwlwifi: modify sensitivity value for 5150
  2009-06-12 20:22         ` [PATCH 5/8 v2.6.31 and w-t ] iwlwifi/iwl3945: fix suspend resume association bug Reinette Chatre
@ 2009-06-12 20:22           ` Reinette Chatre
  2009-06-12 20:22             ` [PATCH 7/8] iwlwifi: no need to refer to max_nrg_cck range value Reinette Chatre
  0 siblings, 1 reply; 10+ messages in thread
From: Reinette Chatre @ 2009-06-12 20:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

In 5150 there is a long delay between the AGC(Automatic Gain Control) command
till the RF is stabilized causing us to miss detections when there was
adjacent channel noise, so we need to adjusted the Sensitivity calibration
for 5150 differently.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-5000.c |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index b3c648c..0e445a9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -407,6 +407,28 @@ static struct iwl_sensitivity_ranges iwl5000_sensitivity = {
 	.nrg_th_ofdm = 95,
 };
 
+static struct iwl_sensitivity_ranges iwl5150_sensitivity = {
+	.min_nrg_cck = 95,
+	.max_nrg_cck = 0, /* not used, set to 0 */
+	.auto_corr_min_ofdm = 90,
+	.auto_corr_min_ofdm_mrc = 170,
+	.auto_corr_min_ofdm_x1 = 105,
+	.auto_corr_min_ofdm_mrc_x1 = 220,
+
+	.auto_corr_max_ofdm = 120,
+	.auto_corr_max_ofdm_mrc = 210,
+	/* max = min for performance bug in 5150 DSP */
+	.auto_corr_max_ofdm_x1 = 105,
+	.auto_corr_max_ofdm_mrc_x1 = 220,
+
+	.auto_corr_min_cck = 125,
+	.auto_corr_max_cck = 200,
+	.auto_corr_min_cck_mrc = 170,
+	.auto_corr_max_cck_mrc = 400,
+	.nrg_th_cck = 95,
+	.nrg_th_ofdm = 95,
+};
+
 static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
 					   size_t offset)
 {
@@ -826,8 +848,6 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
 					BIT(IEEE80211_BAND_5GHZ);
 	priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
 
-	priv->hw_params.sens = &iwl5000_sensitivity;
-
 	priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
 	priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
 	priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
@@ -836,9 +856,11 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
 	if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
 		priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
 
+	/* Set initial sensitivity parameters */
 	/* Set initial calibration set */
 	switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
 	case CSR_HW_REV_TYPE_5150:
+		priv->hw_params.sens = &iwl5150_sensitivity;
 		priv->hw_params.calib_init_cfg =
 			BIT(IWL_CALIB_DC)		|
 			BIT(IWL_CALIB_LO)		|
@@ -847,6 +869,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
 
 		break;
 	default:
+		priv->hw_params.sens = &iwl5000_sensitivity;
 		priv->hw_params.calib_init_cfg =
 			BIT(IWL_CALIB_XTAL)		|
 			BIT(IWL_CALIB_LO)		|
-- 
1.5.6.3


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

* [PATCH 7/8] iwlwifi: no need to refer to max_nrg_cck range value
  2009-06-12 20:22           ` [PATCH 6/8] iwlwifi: modify sensitivity value for 5150 Reinette Chatre
@ 2009-06-12 20:22             ` Reinette Chatre
  2009-06-12 20:22               ` [PATCH 8/8] iwlwifi: remove disable_tx_power for device > 4965 Reinette Chatre
  0 siblings, 1 reply; 10+ messages in thread
From: Reinette Chatre @ 2009-06-12 20:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

max_nrg_cck value inside the sensitivity range structure is not needed
for sensitivity calibration.
Keep the parameter in sensitivity structure but set the value to "0" in case
needed in the future implementation.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965.c  |    2 +-
 drivers/net/wireless/iwlwifi/iwl-5000.c  |    2 +-
 drivers/net/wireless/iwlwifi/iwl-calib.c |    7 +------
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 8f3d4bc..edbb0bf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -728,7 +728,7 @@ static int iwl4965_alive_notify(struct iwl_priv *priv)
 
 static struct iwl_sensitivity_ranges iwl4965_sensitivity = {
 	.min_nrg_cck = 97,
-	.max_nrg_cck = 0,
+	.max_nrg_cck = 0, /* not used, set to 0 */
 
 	.auto_corr_min_ofdm = 85,
 	.auto_corr_min_ofdm_mrc = 170,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 0e445a9..85e8bac 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -388,7 +388,7 @@ void iwl5000_rts_tx_cmd_flag(struct ieee80211_tx_info *info,
 
 static struct iwl_sensitivity_ranges iwl5000_sensitivity = {
 	.min_nrg_cck = 95,
-	.max_nrg_cck = 0,
+	.max_nrg_cck = 0, /* not used, set to 0 */
 	.auto_corr_min_ofdm = 90,
 	.auto_corr_min_ofdm_mrc = 170,
 	.auto_corr_min_ofdm_x1 = 120,
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.c b/drivers/net/wireless/iwlwifi/iwl-calib.c
index a5d6367..f8bf592 100644
--- a/drivers/net/wireless/iwlwifi/iwl-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-calib.c
@@ -251,12 +251,7 @@ static int iwl_sens_energy_cck(struct iwl_priv *priv,
 
 		/* increase energy threshold (reduce nrg value)
 		 *   to decrease sensitivity */
-		if (data->nrg_th_cck >
-			(ranges->max_nrg_cck + NRG_STEP_CCK))
-			data->nrg_th_cck = data->nrg_th_cck
-						 - NRG_STEP_CCK;
-		else
-			data->nrg_th_cck = ranges->max_nrg_cck;
+		data->nrg_th_cck = data->nrg_th_cck - NRG_STEP_CCK;
 	/* Else if we got fewer than desired, increase sensitivity */
 	} else if (false_alarms < min_false_alarms) {
 		data->nrg_curr_state = IWL_FA_TOO_FEW;
-- 
1.5.6.3


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

* [PATCH 8/8] iwlwifi: remove disable_tx_power for device > 4965
  2009-06-12 20:22             ` [PATCH 7/8] iwlwifi: no need to refer to max_nrg_cck range value Reinette Chatre
@ 2009-06-12 20:22               ` Reinette Chatre
  0 siblings, 0 replies; 10+ messages in thread
From: Reinette Chatre @ 2009-06-12 20:22 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Reinette Chatre

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

After 4965, tx_power_calibration moved from driver to uCode.
remove "disable_tx_power" from debugfs to minimize the confusion.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-debugfs.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 11e08c0..f32ac74 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -615,7 +615,10 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
 	DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal);
 	DEBUGFS_ADD_BOOL(disable_chain_noise, rf,
 			 &priv->disable_chain_noise_cal);
-	DEBUGFS_ADD_BOOL(disable_tx_power, rf, &priv->disable_tx_power_cal);
+	if (((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) ||
+	    ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_3945))
+		DEBUGFS_ADD_BOOL(disable_tx_power, rf,
+				&priv->disable_tx_power_cal);
 	return 0;
 
 err:
@@ -646,7 +649,9 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)
 	DEBUGFS_REMOVE(priv->dbgfs->dir_data);
 	DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity);
 	DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise);
-	DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_tx_power);
+	if (((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) ||
+	    ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_3945))
+		DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_tx_power);
 	DEBUGFS_REMOVE(priv->dbgfs->dir_rf);
 	DEBUGFS_REMOVE(priv->dbgfs->dir_drv);
 	kfree(priv->dbgfs);
-- 
1.5.6.3


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

* Re: [PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz
  2009-06-12 20:22       ` [PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz Reinette Chatre
  2009-06-12 20:22         ` [PATCH 5/8 v2.6.31 and w-t ] iwlwifi/iwl3945: fix suspend resume association bug Reinette Chatre
@ 2009-06-12 20:55         ` reinette chatre
  1 sibling, 0 replies; 10+ messages in thread
From: reinette chatre @ 2009-06-12 20:55 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Guy, Wey-Yi W

John,

On Fri, 2009-06-12 at 13:22 -0700, Chatre, Reinette wrote:
> From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> 
> for both mixed and pure 40MHz, need to check for valid channel location.
> if the specified channel not allow the channel location requested
> (ABOVE, BELOW), then reject the Fat channel access
> 
> This fixes http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1988

To be more accurate ... patches 2, 3, and 4 combine to address this bug.

Reinette



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

end of thread, other threads:[~2009-06-12 20:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-12 20:22 [PATCH 0/8 2.6.31 and w-t] iwlwifi driver updates 06/12/2009 Reinette Chatre
2009-06-12 20:22 ` [PATCH 1/8 v2.6.31 and w-t ] iwlwifi: revamp bss_info_changed Reinette Chatre
2009-06-12 20:22   ` [PATCH 2/8 v2.6.31 and w-t ] iwlwifi: checking for 40MHz mode Reinette Chatre
2009-06-12 20:22     ` [PATCH 3/8 v2.6.31 and w-t ] iwlwifi: check control channel for pure 40MHz Reinette Chatre
2009-06-12 20:22       ` [PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz Reinette Chatre
2009-06-12 20:22         ` [PATCH 5/8 v2.6.31 and w-t ] iwlwifi/iwl3945: fix suspend resume association bug Reinette Chatre
2009-06-12 20:22           ` [PATCH 6/8] iwlwifi: modify sensitivity value for 5150 Reinette Chatre
2009-06-12 20:22             ` [PATCH 7/8] iwlwifi: no need to refer to max_nrg_cck range value Reinette Chatre
2009-06-12 20:22               ` [PATCH 8/8] iwlwifi: remove disable_tx_power for device > 4965 Reinette Chatre
2009-06-12 20:55         ` [PATCH 4/8 v2.6.31 and w-t ] iwlwifi: check for channel location for 40MHz reinette chatre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).