linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: replacing IPW with IWL in error messages
       [not found] <11908636643693-git-send-email-yi.zhu@intel.com>
@ 2007-09-27  3:27 ` Zhu Yi
  2007-09-27  3:27   ` [PATCH] iwlwifi: workaournd REPLY_COMPRESSED_BA command in iwl_rx_handle Zhu Yi
  2007-09-27  4:32   ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Randy Dunlap
  2007-09-27 20:41 ` iwlwifi driver updates John W. Linville
  1 sibling, 2 replies; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch repaces IPW with IWL in error messages.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    6 +++---
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 44f983b..c271418 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -204,7 +204,7 @@ static void iwl_print_hex_dump(int level, void *p, u32 len)
  * reclaiming packets (on 'tx done IRQ), if free space become > high mark,
  * Tx queue resumed.
  *
- * The IPW operates with six queues, one receive queue in the device's
+ * The IWL operates with six queues, one receive queue in the device's
  * sram, one transmit queue for sending commands to the device firmware,
  * and four transmit queues for data.
  ***************************************************/
@@ -4591,12 +4591,12 @@ static void iwl_dump_nic_event_log(struct iwl_priv *priv)
 
 	/* bail out if nothing in log */
 	if (size == 0) {
-		IWL_ERROR("Start IPW Event Log Dump: nothing in log\n");
+		IWL_ERROR("Start IWL Event Log Dump: nothing in log\n");
 		iwl_release_restricted_access(priv);
 		return;
 	}
 
-	IWL_ERROR("Start IPW Event Log Dump: display count %d, wraps %d\n",
+	IWL_ERROR("Start IWL Event Log Dump: display count %d, wraps %d\n",
 		  size, num_wraps);
 
 	/* if uCode has wrapped back to top of log, start at the oldest entry,
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 61500a2..9ad68b0 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -203,7 +203,7 @@ static void iwl_print_hex_dump(int level, void *p, u32 len)
  * reclaiming packets (on 'tx done IRQ), if free space become > high mark,
  * Tx queue resumed.
  *
- * The IPW operates with six queues, one receive queue in the device's
+ * The IWL operates with six queues, one receive queue in the device's
  * sram, one transmit queue for sending commands to the device firmware,
  * and four transmit queues for data.
  ***************************************************/
@@ -4900,12 +4900,12 @@ static void iwl_dump_nic_event_log(struct iwl_priv *priv)
 
 	/* bail out if nothing in log */
 	if (size == 0) {
-		IWL_ERROR("Start IPW Event Log Dump: nothing in log\n");
+		IWL_ERROR("Start IWL Event Log Dump: nothing in log\n");
 		iwl_release_restricted_access(priv);
 		return;
 	}
 
-	IWL_ERROR("Start IPW Event Log Dump: display count %d, wraps %d\n",
+	IWL_ERROR("Start IWL Event Log Dump: display count %d, wraps %d\n",
 		  size, num_wraps);
 
 	/* if uCode has wrapped back to top of log, start at the oldest entry,
-- 
1.5.1

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

* [PATCH] iwlwifi: workaournd REPLY_COMPRESSED_BA command in iwl_rx_handle
  2007-09-27  3:27 ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Zhu Yi
@ 2007-09-27  3:27   ` Zhu Yi
  2007-09-27  3:27     ` [PATCH] iwlwifi: Correction for sending beacon in config_ap Zhu Yi
  2007-09-27  4:32   ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Randy Dunlap
  1 sibling, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 9ad68b0..8ae7c30 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -4613,6 +4613,7 @@ static void iwl_rx_handle(struct iwl_priv *priv)
 		reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
 			(pkt->hdr.cmd != REPLY_RX_PHY_CMD) &&
 			(pkt->hdr.cmd != REPLY_4965_RX) &&
+			(pkt->hdr.cmd != REPLY_COMPRESSED_BA) &&
 			(pkt->hdr.cmd != STATISTICS_NOTIFICATION) &&
 			(pkt->hdr.cmd != REPLY_TX);
 
-- 
1.5.1

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

* [PATCH] iwlwifi: Correction for sending beacon in config_ap
  2007-09-27  3:27   ` [PATCH] iwlwifi: workaournd REPLY_COMPRESSED_BA command in iwl_rx_handle Zhu Yi
@ 2007-09-27  3:27     ` Zhu Yi
  2007-09-27  3:27       ` [PATCH] iwlwifi: clear station table in rxon unconditionally Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch takes out sending beacon from conditional in
config_ap function.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 8ae7c30..af261e6 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -7495,9 +7495,8 @@ static void iwl_config_ap(struct iwl_priv *priv)
 		iwl_activate_qos(priv, 1);
 #endif
 		iwl_rxon_add_station(priv, BROADCAST_ADDR, 0);
-		iwl_send_beacon_cmd(priv);
-	} else
-		iwl_send_beacon_cmd(priv);
+	}
+	iwl_send_beacon_cmd(priv);
 
 	/* FIXME - we need to add code here to detect a totally new
 	 * configuration, reset the AP, unassoc, rxon timing, assoc,
-- 
1.5.1

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

* [PATCH] iwlwifi: clear station table in rxon unconditionally
  2007-09-27  3:27     ` [PATCH] iwlwifi: Correction for sending beacon in config_ap Zhu Yi
@ 2007-09-27  3:27       ` Zhu Yi
  2007-09-27  3:27         ` [PATCH] iwlwifi: Fix typo in rate sacling algorithm Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch clears stations table for every rxon command.
It removes iwl_rxon_add_station function in 3945.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |   55 +++++++--------------------
 drivers/net/wireless/iwlwifi/iwl4965-base.c |   24 +++--------
 2 files changed, 21 insertions(+), 58 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index c271418..6e46920 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -407,6 +407,7 @@ const u8 BROADCAST_ADDR[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
  */
 
 /**************************************************************/
+#if 0 /* temparary disable till we add real remove station */
 static u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
 {
 	int index = IWL_INVALID_STATION;
@@ -442,7 +443,7 @@ out:
 	spin_unlock_irqrestore(&priv->sta_lock, flags);
 	return 0;
 }
-
+#endif
 static void iwl_clear_stations_table(struct iwl_priv *priv)
 {
 	unsigned long flags;
@@ -835,25 +836,6 @@ int iwl_send_statistics_request(struct iwl_priv *priv)
 }
 
 /**
- * iwl_rxon_add_station - add station into station table.
- *
- * there is only one AP station with id= IWL_AP_ID
- * NOTE: mutex must be held before calling the this fnction
-*/
-static int iwl_rxon_add_station(struct iwl_priv *priv,
-				const u8 *addr, int is_ap)
-{
-	u8 rc;
-
-	/* Remove this station if it happens to already exist */
-	iwl_remove_station(priv, addr, is_ap);
-
-	rc = iwl_add_station(priv, addr, is_ap, 0);
-
-	return rc;
-}
-
-/**
  * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON
  * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz
  * @channel: Any channel valid for the requested phymode
@@ -1123,16 +1105,6 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
 				  "configuration (%d).\n", rc);
 			return rc;
 		}
-
-		/* The RXON bit toggling will have cleared out the
-		 * station table in the uCode, so blank it in the driver
-		 * as well */
-		iwl_clear_stations_table(priv);
-	} else if (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) {
-		/* When switching from non-associated to associated, the
-		 * uCode clears out the station table; so clear it in the
-		 * driver as well */
-		iwl_clear_stations_table(priv);
 	}
 
 	IWL_DEBUG_INFO("Sending RXON\n"
@@ -1154,6 +1126,8 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
 
 	memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
 
+	iwl_clear_stations_table(priv);
+
 	/* If we issue a new RXON command which required a tune then we must
 	 * send a new TXPOWER command or we won't be able to Tx any frames */
 	rc = iwl_hw_reg_send_txpower(priv);
@@ -1163,7 +1137,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
 	}
 
 	/* Add the broadcast address so we can send broadcast frames */
-	if (iwl_rxon_add_station(priv, BROADCAST_ADDR, 0) ==
+	if (iwl_add_station(priv, BROADCAST_ADDR, 0, 0) ==
 	    IWL_INVALID_STATION) {
 		IWL_ERROR("Error adding BROADCAST address for transmit.\n");
 		return -EIO;
@@ -1173,7 +1147,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
 	 * add the IWL_AP_ID to the station rate table */
 	if (iwl_is_associated(priv) &&
 	    (priv->iw_mode == IEEE80211_IF_TYPE_STA))
-		if (iwl_rxon_add_station(priv, priv->active_rxon.bssid_addr, 1)
+		if (iwl_add_station(priv, priv->active_rxon.bssid_addr, 1, 0)
 		    == IWL_INVALID_STATION) {
 			IWL_ERROR("Error adding AP address for transmit.\n");
 			return -EIO;
@@ -4658,7 +4632,7 @@ static void iwl_error_recovery(struct iwl_priv *priv)
 	priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
 	iwl_commit_rxon(priv);
 
-	iwl_rxon_add_station(priv, priv->bssid, 1);
+	iwl_add_station(priv, priv->bssid, 1, 0);
 
 	spin_lock_irqsave(&priv->lock, flags);
 	priv->assoc_id = le16_to_cpu(priv->staging_rxon.assoc_id);
@@ -6804,8 +6778,8 @@ static void iwl_bg_post_associate(struct work_struct *data)
 		/* clear out the station table */
 		iwl_clear_stations_table(priv);
 
-		iwl_rxon_add_station(priv, BROADCAST_ADDR, 0);
-		iwl_rxon_add_station(priv, priv->bssid, 0);
+		iwl_add_station(priv, BROADCAST_ADDR, 0, 0);
+		iwl_add_station(priv, priv->bssid, 0, 0);
 		iwl3945_sync_sta(priv, IWL_STA_ID,
 				 (priv->phymode == MODE_IEEE80211A)?
 				 IWL_RATE_6M_PLCP : IWL_RATE_1M_PLCP,
@@ -7094,10 +7068,9 @@ static void iwl_config_ap(struct iwl_priv *priv)
 		/* restore RXON assoc */
 		priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
 		iwl_commit_rxon(priv);
-		iwl_rxon_add_station(priv, BROADCAST_ADDR, 0);
-		iwl_send_beacon_cmd(priv);
-	} else
-		iwl_send_beacon_cmd(priv);
+		iwl_add_station(priv, BROADCAST_ADDR, 0, 0);
+	}
+	iwl_send_beacon_cmd(priv);
 
 	/* FIXME - we need to add code here to detect a totally new
 	 * configuration, reset the AP, unassoc, rxon timing, assoc,
@@ -7181,8 +7154,8 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id,
 						RXON_FILTER_ASSOC_MSK;
 			rc = iwl_commit_rxon(priv);
 			if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc)
-				iwl_rxon_add_station(
-					priv, priv->active_rxon.bssid_addr, 1);
+				iwl_add_station(priv,
+					priv->active_rxon.bssid_addr, 1, 0);
 		}
 
 	} else {
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index af261e6..283c6a3 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -407,6 +407,7 @@ const u8 BROADCAST_ADDR[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
 
 /**************************************************************/
 
+#if 0 /* temparary disable till we add real remove station */
 static u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
 {
 	int index = IWL_INVALID_STATION;
@@ -442,6 +443,7 @@ out:
 	spin_unlock_irqrestore(&priv->sta_lock, flags);
 	return 0;
 }
+#endif
 
 static void iwl_clear_stations_table(struct iwl_priv *priv)
 {
@@ -852,16 +854,12 @@ int iwl_send_statistics_request(struct iwl_priv *priv)
 static int iwl_rxon_add_station(struct iwl_priv *priv,
 				const u8 *addr, int is_ap)
 {
-	u8 rc;
-
-	/* Remove this station if it happens to already exist */
-	iwl_remove_station(priv, addr, is_ap);
-
-	rc = iwl_add_station(priv, addr, is_ap, 0);
+	u8 sta_id;
 
+	sta_id = iwl_add_station(priv, addr, is_ap, 0);
 	iwl4965_add_station(priv, addr, is_ap);
 
-	return rc;
+	return sta_id;
 }
 
 /**
@@ -1149,16 +1147,6 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
 				  "configuration (%d).\n", rc);
 			return rc;
 		}
-
-		/* The RXON bit toggling will have cleared out the
-		 * station table in the uCode, so blank it in the driver
-		 * as well */
-		iwl_clear_stations_table(priv);
-	} else if (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) {
-		/* When switching from non-associated to associated, the
-		 * uCode clears out the station table; so clear it in the
-		 * driver as well */
-		iwl_clear_stations_table(priv);
 	}
 
 	IWL_DEBUG_INFO("Sending RXON\n"
@@ -1178,6 +1166,8 @@ static int iwl_commit_rxon(struct iwl_priv *priv)
 		return rc;
 	}
 
+	iwl_clear_stations_table(priv);
+
 #ifdef CONFIG_IWLWIFI_SENSITIVITY
 	if (!priv->error_recovering)
 		priv->start_calib = 0;
-- 
1.5.1

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

* [PATCH] iwlwifi: Fix typo in rate sacling algorithm
  2007-09-27  3:27       ` [PATCH] iwlwifi: clear station table in rxon unconditionally Zhu Yi
@ 2007-09-27  3:27         ` Zhu Yi
  2007-09-27  3:27           ` [PATCH] iwlwifi: fix add_station to avoid FW error Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch fixes tiny typo in 4965 rate sacling algorithm

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index bc5e67b..edcc542 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -1672,7 +1672,7 @@ static void rs_initialize_lq(struct iwl_priv *priv,
 	tbl->antenna_type = ANT_AUX;
 	rs_get_tbl_info_from_mcs(&mcs_rate, priv->phymode, tbl, &rate_idx);
 	if (!rs_is_ant_connected(priv->valid_antenna, tbl->antenna_type))
-	    rs_toggle_antenna(&mcs_rate, tbl),
+	    rs_toggle_antenna(&mcs_rate, tbl);
 
 	rs_mcs_from_tbl(&mcs_rate, tbl, rate_idx, use_green);
 	tbl->current_rate.rate_n_flags = mcs_rate.rate_n_flags;
-- 
1.5.1

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

* [PATCH] iwlwifi: fix add_station to avoid FW error
  2007-09-27  3:27         ` [PATCH] iwlwifi: Fix typo in rate sacling algorithm Zhu Yi
@ 2007-09-27  3:27           ` Zhu Yi
  2007-09-27  3:27             ` [PATCH] iwlwifi: removing unnecessary memset in 4965 rate scale Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Ian Schram

There were a few Firmware errors reported the most reproducible
http://bughost.org/bugzilla/show_bug.cgi?id=1471

The root cause is rate_n_flags isn't set anymore. This patch fixes
the problem.

Signed-off-by: Ian Schram <ischram@telenet.be>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 6e46920..a83934f 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -464,6 +464,7 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
 	struct iwl_station_entry *station;
 	unsigned long flags_spin;
 	DECLARE_MAC_BUF(mac);
+	u8 rate;
 
 	spin_lock_irqsave(&priv->sta_lock, flags_spin);
 	if (is_ap)
@@ -507,6 +508,15 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flags)
 	station->sta.sta.sta_id = index;
 	station->sta.station_flags = 0;
 
+	rate = (priv->phymode == MODE_IEEE80211A) ? IWL_RATE_6M_PLCP :
+				IWL_RATE_1M_PLCP | priv->hw_setting.cck_flag;
+
+	/* Turn on both antennas for the station... */
+	station->sta.rate_n_flags =
+			iwl_hw_set_rate_n_flags(rate, RATE_MCS_ANT_AB_MSK);
+	station->current_rate.rate_n_flags =
+			le16_to_cpu(station->sta.rate_n_flags);
+
 	spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
 	iwl_send_add_station(priv, &station->sta, flags);
 	return index;
-- 
1.5.1

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

* [PATCH] iwlwifi: removing unnecessary memset in 4965 rate scale
  2007-09-27  3:27           ` [PATCH] iwlwifi: fix add_station to avoid FW error Zhu Yi
@ 2007-09-27  3:27             ` Zhu Yi
  2007-09-27  3:27               ` [PATCH] iwlwifi: add debugfs framework to " Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch removes redundant memset in rate scale. In rs_alloc_sta,
kzalloc is used so the memset can be avoided. In rs_rate_init, it is
a bug fix since it overrides everything set in other handlers namely
add_debugfs.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index edcc542..86e650d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -1776,10 +1776,9 @@ static void *rs_alloc_sta(void *priv, gfp_t gfp)
 
 	if (crl == NULL)
 		return NULL;
-
-	memset(crl, 0, sizeof(struct iwl_rate_scale_priv));
 	crl->lq.sta_id = 0xff;
 
+
 	for (j = 0; j < LQ_SIZE; j++)
 		for (i = 0; i < IWL_RATE_COUNT; i++)
 			rs_rate_scale_clear_window(&(crl->lq_info[j].win[i]));
@@ -1796,9 +1795,6 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 	struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
 	struct iwl_rate_scale_priv *crl = priv_sta;
 
-	memset(crl, 0, sizeof(struct iwl_rate_scale_priv));
-
-	crl->lq.sta_id = 0xff;
 	crl->flush_timer = 0;
 	sta->txrate = 3;
 	for (j = 0; j < LQ_SIZE; j++)
-- 
1.5.1

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

* [PATCH] iwlwifi: add debugfs framework to rate scale
  2007-09-27  3:27             ` [PATCH] iwlwifi: removing unnecessary memset in 4965 rate scale Zhu Yi
@ 2007-09-27  3:27               ` Zhu Yi
  2007-09-27  3:27                 ` [PATCH] iwlwifi: add read rate scale table debugfs function Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch adds debugfs handler to rate scale algorithms.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 86e650d..e849ab5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -1999,6 +1999,23 @@ static void rs_free_sta(void *priv, void *priv_sta)
 }
 
 
+#ifdef CONFIG_MAC80211_DEBUGFS
+static void rs_add_debugfs(void *priv, void *priv_sta,
+					struct dentry *dir)
+{
+	/* struct iwl_rate_scale_priv *rs_priv = priv_sta; */
+	IWL_DEBUG_RATE("%s enter\n", __FUNCTION__);
+	IWL_DEBUG_RATE("%s leave\n", __FUNCTION__);
+}
+
+static void rs_remove_debugfs(void *priv, void *priv_sta)
+{
+	/* struct iwl_rate_scale_priv *rs_priv = priv_sta; */
+	IWL_DEBUG_RATE("%s enter\n", __FUNCTION__);
+	IWL_DEBUG_RATE("%s leave\n", __FUNCTION__);
+}
+#endif
+
 static struct rate_control_ops rs_ops = {
 	.module = NULL,
 	.name = RS_NAME,
@@ -2010,6 +2027,10 @@ static struct rate_control_ops rs_ops = {
 	.free = rs_free,
 	.alloc_sta = rs_alloc_sta,
 	.free_sta = rs_free_sta,
+#ifdef CONFIG_MAC80211_DEBUGFS
+	.add_sta_debugfs = rs_add_debugfs,
+	.remove_sta_debugfs = rs_remove_debugfs,
+#endif
 };
 
 int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
-- 
1.5.1

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

* [PATCH] iwlwifi: add read rate scale table debugfs function
  2007-09-27  3:27               ` [PATCH] iwlwifi: add debugfs framework to " Zhu Yi
@ 2007-09-27  3:27                 ` Zhu Yi
  2007-09-27  3:27                   ` [PATCH] iwlwifi: limit printouts on hot path Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch adds read rate scale table debugfs function for 4965
rate scaling module.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   67 +++++++++++++++++++++++++---
 1 files changed, 61 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index e849ab5..e3a0cca 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -121,6 +121,9 @@ struct iwl_rate_scale_priv {
 	u16 active_rate_basic;
 	struct iwl_link_quality_cmd lq;
 	struct iwl_scale_tbl_info lq_info[LQ_SIZE];
+#ifdef CONFIG_MAC80211_DEBUGFS
+       struct dentry *rs_sta_dbgfs_scale_table_file;
+#endif
 };
 
 static void rs_rate_scale_perform(struct iwl_priv *priv,
@@ -2000,19 +2003,71 @@ static void rs_free_sta(void *priv, void *priv_sta)
 
 
 #ifdef CONFIG_MAC80211_DEBUGFS
+static int open_file_generic(struct inode *inode, struct file *file)
+{
+	file->private_data = inode->i_private;
+	return 0;
+}
+
+static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
+			char __user *user_buf, size_t count, loff_t *ppos)
+{
+	char buff[1024];
+	int desc = 0;
+	int i = 0;
+
+	struct iwl_rate_scale_priv *rs_priv = file->private_data;
+
+	desc += sprintf(buff+desc, "sta_id %d\n", rs_priv->lq.sta_id);
+	desc += sprintf(buff+desc, "failed=%d success=%d rate=%X\n",
+			rs_priv->total_failed, rs_priv->total_success,
+			rs_priv->active_rate);
+	desc += sprintf(buff+desc, "general:"
+		"flags=0x%X mimo-d=%d s-ant0x%x d-ant=0x%x\n",
+		rs_priv->lq.general_params.flags,
+		rs_priv->lq.general_params.mimo_delimiter,
+		rs_priv->lq.general_params.single_stream_ant_msk,
+		rs_priv->lq.general_params.dual_stream_ant_msk);
+
+	desc += sprintf(buff+desc, "agg:"
+			"time_limit=%d dist_start_th=%d frame_cnt_limit=%d\n",
+			le16_to_cpu(rs_priv->lq.agg_params.agg_time_limit),
+			rs_priv->lq.agg_params.agg_dis_start_th,
+			rs_priv->lq.agg_params.agg_frame_cnt_limit);
+
+	desc += sprintf(buff+desc,
+			"Start idx [0]=0x%x [1]=0x%x [2]=0x%x [3]=0x%x\n",
+			rs_priv->lq.general_params.start_rate_index[0],
+			rs_priv->lq.general_params.start_rate_index[1],
+			rs_priv->lq.general_params.start_rate_index[2],
+			rs_priv->lq.general_params.start_rate_index[3]);
+
+
+	for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++)
+		desc += sprintf(buff+desc, " rate[%d] 0x%X\n",
+			i, le32_to_cpu(rs_priv->lq.rs_table[i].rate_n_flags));
+
+	return simple_read_from_buffer(user_buf, count, ppos, buff, desc);
+}
+
+static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
+	.read = rs_sta_dbgfs_scale_table_read,
+	.open = open_file_generic,
+};
+
 static void rs_add_debugfs(void *priv, void *priv_sta,
 					struct dentry *dir)
 {
-	/* struct iwl_rate_scale_priv *rs_priv = priv_sta; */
-	IWL_DEBUG_RATE("%s enter\n", __FUNCTION__);
-	IWL_DEBUG_RATE("%s leave\n", __FUNCTION__);
+	struct iwl_rate_scale_priv *rs_priv = priv_sta;
+	rs_priv->rs_sta_dbgfs_scale_table_file =
+		debugfs_create_file("rate_scale_table", 0444, dir,
+				rs_priv, &rs_sta_dbgfs_scale_table_ops);
 }
 
 static void rs_remove_debugfs(void *priv, void *priv_sta)
 {
-	/* struct iwl_rate_scale_priv *rs_priv = priv_sta; */
-	IWL_DEBUG_RATE("%s enter\n", __FUNCTION__);
-	IWL_DEBUG_RATE("%s leave\n", __FUNCTION__);
+	struct iwl_rate_scale_priv *rs_priv = priv_sta;
+	debugfs_remove(rs_priv->rs_sta_dbgfs_scale_table_file);
 }
 #endif
 
-- 
1.5.1

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

* [PATCH] iwlwifi: limit printouts on hot path
  2007-09-27  3:27                 ` [PATCH] iwlwifi: add read rate scale table debugfs function Zhu Yi
@ 2007-09-27  3:27                   ` Zhu Yi
  2007-09-27  3:27                     ` [PATCH] iwlwifi: add supp_rates to rate scale sta private data Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch change printouts on TX path to the net_ratelimit version.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |    4 ++--
 drivers/net/wireless/iwlwifi/iwl-4965.c    |    2 +-
 drivers/net/wireless/iwlwifi/iwl-debug.h   |    3 +++
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index e3a0cca..b9d7ad8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -622,7 +622,7 @@ static void rs_tx_status(void *priv_rate,
 	u16 fc = le16_to_cpu(hdr->frame_control);
 	s32 tpt = 0;
 
-	IWL_DEBUG_RATE("get frame ack response, update rate scale window\n");
+	IWL_DEBUG_RATE_LIMIT("get frame ack response, update rate scale window\n");
 
 	if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr->addr1))
 		return;
@@ -1717,7 +1717,7 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate,
 	struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
 	struct iwl_rate_scale_priv *lq;
 
-	IWL_DEBUG_RATE("rate scale calculate new rate for skb\n");
+	IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n");
 
 	memset(extra, 0, sizeof(*extra));
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index b704fe7..b41addf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -184,7 +184,7 @@ u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *addr)
 			goto out;
 		}
 
-	IWL_DEBUG_ASSOC("can not find STA %s total %d\n",
+	IWL_DEBUG_ASSOC_LIMIT("can not find STA " MAC_FMT " total %d\n",
 			print_mac(mac, addr), priv->num_stations);
 
  out:
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index abd344c..72318d7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -136,8 +136,11 @@ static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...)
 #define IWL_DEBUG_TXPOWER(f, a...) IWL_DEBUG(IWL_DL_TXPOWER, f, ## a)
 #define IWL_DEBUG_IO(f, a...) IWL_DEBUG(IWL_DL_IO, f, ## a)
 #define IWL_DEBUG_RATE(f, a...) IWL_DEBUG(IWL_DL_RATE, f, ## a)
+#define IWL_DEBUG_RATE_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_RATE, f, ## a)
 #define IWL_DEBUG_NOTIF(f, a...) IWL_DEBUG(IWL_DL_NOTIF, f, ## a)
 #define IWL_DEBUG_ASSOC(f, a...) IWL_DEBUG(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a)
+#define IWL_DEBUG_ASSOC_LIMIT(f, a...) \
+	IWL_DEBUG_LIMIT(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a)
 #define IWL_DEBUG_HT(f, a...) IWL_DEBUG(IWL_DL_HT, f, ## a)
 #define IWL_DEBUG_STATS(f, a...) IWL_DEBUG(IWL_DL_STATS, f, ## a)
 #define IWL_DEBUG_TX_REPLY(f, a...) IWL_DEBUG(IWL_DL_TX_REPLY, f, ## a)
-- 
1.5.1

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

* [PATCH] iwlwifi: add supp_rates to rate scale sta private data
  2007-09-27  3:27                   ` [PATCH] iwlwifi: limit printouts on hot path Zhu Yi
@ 2007-09-27  3:27                     ` Zhu Yi
  2007-09-27  3:27                       ` [PATCH] iwlwifi: rs_rate_scale_perform clean up Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch adds supp_rate bit mask to rate scale sta private data structre
and thus removes sta from the argument list in helper functions.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   31 +++++++++++++--------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index b9d7ad8..bad7466 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -115,6 +115,7 @@ struct iwl_rate_scale_priv {
 	u8 is_dup;
 	u8 phymode;
 	u8 ibss_sta_added;
+	u32 supp_rates;
 	u16 active_rate;
 	u16 active_siso_rate;
 	u16 active_mimo_rate;
@@ -132,8 +133,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 				   struct sta_info *sta);
 static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			     struct iwl_rate *tx_mcs,
-			     struct iwl_link_quality_cmd *tbl,
-			     struct sta_info *sta);
+			     struct iwl_link_quality_cmd *tbl);
 
 
 static s32 expected_tpt_A[IWL_RATE_COUNT] = {
@@ -542,14 +542,13 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type)
 
 static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data,
 			     struct iwl_scale_tbl_info *tbl, u8 scale_index,
-			     u8 ht_possible, struct iwl_rate *mcs_rate,
-			     struct sta_info *sta)
+			     u8 ht_possible, struct iwl_rate *mcs_rate)
 {
-	u8 is_green = lq_data->is_green;
 	s32 low;
 	u16 rate_mask;
 	u16 high_low;
 	u8 switch_to_legacy = 0;
+	u8 is_green = lq_data->is_green;
 
 	/* check if we need to switch from HT to legacy rates.
 	 * assumption is that mandatory rates (1Mbps or 6Mbps)
@@ -576,9 +575,9 @@ static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data,
 	if (is_legacy(tbl->lq_type)) {
 		if (lq_data->phymode == (u8) MODE_IEEE80211A)
 			rate_mask  = (u16)(rate_mask &
-			   (sta->supp_rates << IWL_FIRST_OFDM_RATE));
+			   (lq_data->supp_rates << IWL_FIRST_OFDM_RATE));
 		else
-			rate_mask = (u16)(rate_mask & sta->supp_rates);
+			rate_mask = (u16)(rate_mask & lq_data->supp_rates);
 	}
 
 	/* if we did switched from HT to legacy check current rate */
@@ -1391,10 +1390,10 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 	if (is_legacy(tbl->lq_type)) {
 		if (lq_data->phymode == (u8) MODE_IEEE80211A)
 			rate_scale_index_msk = (u16) (rate_mask &
-				(sta->supp_rates << IWL_FIRST_OFDM_RATE));
+				(lq_data->supp_rates << IWL_FIRST_OFDM_RATE));
 		else
 			rate_scale_index_msk = (u16) (rate_mask &
-						      sta->supp_rates);
+						      lq_data->supp_rates);
 
 	} else
 		rate_scale_index_msk = rate_mask;
@@ -1434,7 +1433,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 		rs_stay_in_table(lq_data);
 		if (update_lq) {
 			rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green);
-			rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq, sta);
+			rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq);
 			rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC);
 		}
 		goto out;
@@ -1558,7 +1557,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
  lq_update:
 	if (update_lq) {
 		rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green);
-		rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq, sta);
+		rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq);
 		rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC);
 	}
 	rs_stay_in_table(lq_data);
@@ -1584,7 +1583,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 			IWL_DEBUG_HT("Switch current  mcs: %X index: %d\n",
 				     tbl->current_rate.rate_n_flags, index);
 			rs_fill_link_cmd(lq_data, &tbl->current_rate,
-					 &(lq_data->lq), sta);
+					 &lq_data->lq);
 			rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC);
 		}
 		tbl1 = &(lq_data->lq_info[lq_data->active_tbl]);
@@ -1680,7 +1679,7 @@ static void rs_initialize_lq(struct iwl_priv *priv,
 	rs_mcs_from_tbl(&mcs_rate, tbl, rate_idx, use_green);
 	tbl->current_rate.rate_n_flags = mcs_rate.rate_n_flags;
 	rs_get_expected_tpt_table(lq, tbl);
-	rs_fill_link_cmd(lq, &mcs_rate, &(lq->lq), sta);
+	rs_fill_link_cmd(lq, &mcs_rate, &lq->lq);
 	rs_send_lq_cmd(priv, &lq->lq, CMD_ASYNC);
  out:
 	return;
@@ -1799,6 +1798,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 	struct iwl_rate_scale_priv *crl = priv_sta;
 
 	crl->flush_timer = 0;
+	crl->supp_rates = sta->supp_rates;
 	sta->txrate = 3;
 	for (j = 0; j < LQ_SIZE; j++)
 		for (i = 0; i < IWL_RATE_COUNT; i++)
@@ -1875,8 +1875,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 
 static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			    struct iwl_rate *tx_mcs,
-			    struct iwl_link_quality_cmd *lq_cmd,
-			    struct sta_info *sta)
+			    struct iwl_link_quality_cmd *lq_cmd)
 {
 	int index = 0;
 	int rc = 0;
@@ -1934,7 +1933,7 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			lq_cmd->general_params.mimo_delimiter = index;
 
 		rs_get_lower_rate(lq_data, &tbl_type, rate_idx,
-				  use_ht_possible, &new_rate, sta);
+				  use_ht_possible, &new_rate);
 
 		if (is_legacy(tbl_type.lq_type)) {
 			if (ant_toggle_count < NUM_TRY_BEFORE_ANTENNA_TOGGLE)
-- 
1.5.1

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

* [PATCH] iwlwifi: rs_rate_scale_perform clean up
  2007-09-27  3:27                     ` [PATCH] iwlwifi: add supp_rates to rate scale sta private data Zhu Yi
@ 2007-09-27  3:27                       ` Zhu Yi
  2007-09-27  3:27                         ` [PATCH] iwlwifi: set fixed rate through debugfs Zhu Yi
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch cleans up rs_rate_scale_perform function. It removes dead
code, shortens variable names and removes useless return i.e. function
now returns void.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index bad7466..c4b8ca1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -131,7 +131,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 				   struct net_device *dev,
 				   struct ieee80211_hdr *hdr,
 				   struct sta_info *sta);
-static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
+static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			     struct iwl_rate *tx_mcs,
 			     struct iwl_link_quality_cmd *tbl);
 
@@ -1873,16 +1873,15 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 	rs_initialize_lq(priv, sta);
 }
 
-static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
+static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			    struct iwl_rate *tx_mcs,
 			    struct iwl_link_quality_cmd *lq_cmd)
 {
 	int index = 0;
-	int rc = 0;
 	int rate_idx;
+	int repeat_rate = 0;
 	u8 ant_toggle_count = 0;
 	u8 use_ht_possible = 1;
-	u8 repeat_cur_rate = 0;
 	struct iwl_rate new_rate;
 	struct iwl_scale_tbl_info tbl_type = { 0 };
 
@@ -1891,9 +1890,9 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 
 	if (is_legacy(tbl_type.lq_type)) {
 		ant_toggle_count = 1;
-		repeat_cur_rate = IWL_NUMBER_TRY;
+		repeat_rate = IWL_NUMBER_TRY;
 	} else
-		repeat_cur_rate = IWL_HT_NUMBER_TRY;
+		repeat_rate = IWL_HT_NUMBER_TRY;
 
 	lq_cmd->general_params.mimo_delimiter =
 			is_mimo(tbl_type.lq_type) ? 1 : 0;
@@ -1907,10 +1906,10 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 		lq_cmd->general_params.single_stream_ant_msk = 2;
 
 	index++;
-	repeat_cur_rate--;
+	repeat_rate--;
 
 	while (index < LINK_QUAL_MAX_RETRY_NUM) {
-		while (repeat_cur_rate && (index < LINK_QUAL_MAX_RETRY_NUM)) {
+		while (repeat_rate > 0 && (index < LINK_QUAL_MAX_RETRY_NUM)) {
 			if (is_legacy(tbl_type.lq_type)) {
 				if (ant_toggle_count <
 				    NUM_TRY_BEFORE_ANTENNA_TOGGLE)
@@ -1922,7 +1921,7 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			}
 			lq_cmd->rs_table[index].rate_n_flags =
 					cpu_to_le32(new_rate.rate_n_flags);
-			repeat_cur_rate--;
+			repeat_rate--;
 			index++;
 		}
 
@@ -1942,26 +1941,22 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 				rs_toggle_antenna(&new_rate, &tbl_type);
 				ant_toggle_count = 1;
 			}
-			repeat_cur_rate = IWL_NUMBER_TRY;
+			repeat_rate = IWL_NUMBER_TRY;
 		} else
-			repeat_cur_rate = IWL_HT_NUMBER_TRY;
+			repeat_rate = IWL_HT_NUMBER_TRY;
 
 		use_ht_possible = 0;
 
 		lq_cmd->rs_table[index].rate_n_flags =
 				cpu_to_le32(new_rate.rate_n_flags);
-		/* lq_cmd->rs_table[index].rate_n_flags = 0x800d; */
 
 		index++;
-		repeat_cur_rate--;
+		repeat_rate--;
 	}
 
-	/* lq_cmd->rs_table[0].rate_n_flags = 0x800d; */
-
 	lq_cmd->general_params.dual_stream_ant_msk = 3;
 	lq_cmd->agg_params.agg_dis_start_th = 3;
 	lq_cmd->agg_params.agg_time_limit = cpu_to_le16(4000);
-	return rc;
 }
 
 static void *rs_alloc(struct ieee80211_local *local)
-- 
1.5.1

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

* [PATCH] iwlwifi: set fixed rate through debugfs
  2007-09-27  3:27                       ` [PATCH] iwlwifi: rs_rate_scale_perform clean up Zhu Yi
@ 2007-09-27  3:27                         ` Zhu Yi
  2007-09-27  3:27                           ` [PATCH] iwlwifi: add debugfs rate scale stats Zhu Yi
  2007-09-27  4:35                           ` [PATCH] iwlwifi: set fixed rate through debugfs Randy Dunlap
  0 siblings, 2 replies; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch adds fixed rate setting through debugfs

$ echo <rate_n_flags> > \
/sys/kernel/debug/ieee80211/phy<X>/stations/<mac>/rate_scale_table

Currently there is no way to turn to rate scaling working again.
Will be fixed in later.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   72 +++++++++++++++++++++++++++-
 1 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index c4b8ca1..e5f8cce 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -123,7 +123,9 @@ struct iwl_rate_scale_priv {
 	struct iwl_link_quality_cmd lq;
 	struct iwl_scale_tbl_info lq_info[LQ_SIZE];
 #ifdef CONFIG_MAC80211_DEBUGFS
-       struct dentry *rs_sta_dbgfs_scale_table_file;
+	struct dentry *rs_sta_dbgfs_scale_table_file;
+	struct iwl_rate dbg_fixed;
+	struct iwl_priv *drv;
 #endif
 };
 
@@ -136,6 +138,14 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			     struct iwl_link_quality_cmd *tbl);
 
 
+#ifdef CONFIG_MAC80211_DEBUGFS
+static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
+				struct iwl_rate *mcs, int index);
+#else
+static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
+				struct iwl_rate *mcs, int index)
+{}
+#endif
 static s32 expected_tpt_A[IWL_RATE_COUNT] = {
 	0, 0, 0, 0, 40, 57, 72, 98, 121, 154, 177, 186, 186
 };
@@ -1866,6 +1876,9 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 	IWL_DEBUG_HT("MIMO RATE 0x%X SISO MASK 0x%X\n", crl->active_siso_rate,
 		     crl->active_mimo_rate);
 #endif /*CONFIG_IWLWIFI_HT*/
+#ifdef CONFIG_MAC80211_DEBUGFS
+	crl->drv = priv;
+#endif
 
 	if (priv->assoc_station_added)
 		priv->lq_mngr.lq_ready = 1;
@@ -1885,6 +1898,8 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 	struct iwl_rate new_rate;
 	struct iwl_scale_tbl_info tbl_type = { 0 };
 
+	rs_dbgfs_set_mcs(lq_data, tx_mcs, index);
+
 	rs_get_tbl_info_from_mcs(tx_mcs, lq_data->phymode,
 				  &tbl_type, &rate_idx);
 
@@ -1919,6 +1934,8 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 					ant_toggle_count = 1;
 				}
 			}
+
+			rs_dbgfs_set_mcs(lq_data, &new_rate, index);
 			lq_cmd->rs_table[index].rate_n_flags =
 					cpu_to_le32(new_rate.rate_n_flags);
 			repeat_rate--;
@@ -1947,6 +1964,7 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 
 		use_ht_possible = 0;
 
+		rs_dbgfs_set_mcs(lq_data, &new_rate, index);
 		lq_cmd->rs_table[index].rate_n_flags =
 				cpu_to_le32(new_rate.rate_n_flags);
 
@@ -2002,7 +2020,54 @@ static int open_file_generic(struct inode *inode, struct file *file)
 	file->private_data = inode->i_private;
 	return 0;
 }
+static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
+				struct iwl_rate *mcs, int index)
+{
+	const u32 cck_rate = 0x820A;
+	if (rs_priv->dbg_fixed.rate_n_flags) {
+		if (index < 12)
+			mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags;
+		else
+			mcs->rate_n_flags = cck_rate;
+		IWL_DEBUG_RATE("Fixed rate ON\n");
+		return;
+	}
+
+	IWL_DEBUG_RATE("Fixed rate OFF\n");
+}
 
+static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
+			const char __user *user_buf, size_t count, loff_t *ppos)
+{
+	struct iwl_rate_scale_priv *rs_priv = file->private_data;
+	char buf[64];
+	int buf_size;
+	u32 parsed_rate;
+
+	memset(buf, 0, sizeof(buf));
+	buf_size = min(count, sizeof(buf) -  1);
+	if (copy_from_user(buf, user_buf, buf_size))
+		return -EFAULT;
+
+	if (sscanf(buf, "%x", &parsed_rate) == 1)
+		rs_priv->dbg_fixed.rate_n_flags = parsed_rate;
+	else
+		rs_priv->dbg_fixed.rate_n_flags = 0;
+
+	rs_priv->active_rate = 0x0FFF;
+	rs_priv->active_siso_rate = 0x1FD0;
+	rs_priv->active_mimo_rate = 0x1FD0;
+
+	IWL_DEBUG_RATE("sta_id %d rate 0x%X\n",
+		rs_priv->lq.sta_id, rs_priv->dbg_fixed.rate_n_flags);
+
+	if (rs_priv->dbg_fixed.rate_n_flags) {
+		rs_fill_link_cmd(rs_priv, &rs_priv->dbg_fixed, &rs_priv->lq);
+		rs_send_lq_cmd(rs_priv->drv, &rs_priv->lq, CMD_ASYNC);
+	}
+
+	return count;
+}
 static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
 			char __user *user_buf, size_t count, loff_t *ppos)
 {
@@ -2013,9 +2078,11 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
 	struct iwl_rate_scale_priv *rs_priv = file->private_data;
 
 	desc += sprintf(buff+desc, "sta_id %d\n", rs_priv->lq.sta_id);
-	desc += sprintf(buff+desc, "failed=%d success=%d rate=%X\n",
+	desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n",
 			rs_priv->total_failed, rs_priv->total_success,
 			rs_priv->active_rate);
+	desc += sprintf(buff+desc, "fixed rate 0x%X\n",
+			rs_priv->dbg_fixed.rate_n_flags);
 	desc += sprintf(buff+desc, "general:"
 		"flags=0x%X mimo-d=%d s-ant0x%x d-ant=0x%x\n",
 		rs_priv->lq.general_params.flags,
@@ -2045,6 +2112,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
 }
 
 static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
+	.write = rs_sta_dbgfs_scale_table_write,
 	.read = rs_sta_dbgfs_scale_table_read,
 	.open = open_file_generic,
 };
-- 
1.5.1

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

* [PATCH] iwlwifi: add debugfs rate scale stats
  2007-09-27  3:27                         ` [PATCH] iwlwifi: set fixed rate through debugfs Zhu Yi
@ 2007-09-27  3:27                           ` Zhu Yi
  2007-09-27  3:27                             ` [PATCH] iwlwifi: Update iwlwifi version stamp to 1.1.17 Zhu Yi
  2007-09-27  4:35                           ` [PATCH] iwlwifi: set fixed rate through debugfs Randy Dunlap
  1 sibling, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

This patch adds rates scale statistics to debugfs:
$ cat /sys/kernel/debug/ieee80211/phy<X>/stations/<mac>/rate_stats_table

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   40 +++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index e5f8cce..287c757 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -124,6 +124,7 @@ struct iwl_rate_scale_priv {
 	struct iwl_scale_tbl_info lq_info[LQ_SIZE];
 #ifdef CONFIG_MAC80211_DEBUGFS
 	struct dentry *rs_sta_dbgfs_scale_table_file;
+	struct dentry *rs_sta_dbgfs_stats_table_file;
 	struct iwl_rate dbg_fixed;
 	struct iwl_priv *drv;
 #endif
@@ -2068,6 +2069,7 @@ static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
 
 	return count;
 }
+
 static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
 			char __user *user_buf, size_t count, loff_t *ppos)
 {
@@ -2116,20 +2118,56 @@ static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
 	.read = rs_sta_dbgfs_scale_table_read,
 	.open = open_file_generic,
 };
+static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
+			char __user *user_buf, size_t count, loff_t *ppos)
+{
+	char buff[1024];
+	int desc = 0;
+	int i, j;
+
+	struct iwl_rate_scale_priv *rs_priv = file->private_data;
+	for (i = 0; i < LQ_SIZE; i++) {
+		desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n"
+				"rate=0x%X\n",
+				rs_priv->active_tbl == i?"*":"x",
+				rs_priv->lq_info[i].lq_type,
+				rs_priv->lq_info[i].is_SGI,
+				rs_priv->lq_info[i].is_fat,
+				rs_priv->lq_info[i].is_dup,
+				rs_priv->lq_info[i].current_rate.rate_n_flags);
+		for (j = 0; j < IWL_RATE_COUNT; j++) {
+			desc += sprintf(buff+desc,
+					"counter=%d success=%d %%=%d\n",
+					rs_priv->lq_info[i].win[j].counter,
+					rs_priv->lq_info[i].win[j].success_counter,
+					rs_priv->lq_info[i].win[j].success_ratio);
+		}
+	}
+	return simple_read_from_buffer(user_buf, count, ppos, buff, desc);
+}
+
+static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
+	.read = rs_sta_dbgfs_stats_table_read,
+	.open = open_file_generic,
+};
 
 static void rs_add_debugfs(void *priv, void *priv_sta,
 					struct dentry *dir)
 {
 	struct iwl_rate_scale_priv *rs_priv = priv_sta;
 	rs_priv->rs_sta_dbgfs_scale_table_file =
-		debugfs_create_file("rate_scale_table", 0444, dir,
+		debugfs_create_file("rate_scale_table", 0600, dir,
 				rs_priv, &rs_sta_dbgfs_scale_table_ops);
+	rs_priv->rs_sta_dbgfs_stats_table_file =
+		debugfs_create_file("rate_stats_table", 0600, dir,
+			rs_priv, &rs_sta_dbgfs_stats_table_ops);
 }
 
 static void rs_remove_debugfs(void *priv, void *priv_sta)
 {
 	struct iwl_rate_scale_priv *rs_priv = priv_sta;
 	debugfs_remove(rs_priv->rs_sta_dbgfs_scale_table_file);
+	debugfs_remove(rs_priv->rs_sta_dbgfs_stats_table_file);
 }
 #endif
 
-- 
1.5.1

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

* [PATCH] iwlwifi: Update iwlwifi version stamp to 1.1.17
  2007-09-27  3:27                           ` [PATCH] iwlwifi: add debugfs rate scale stats Zhu Yi
@ 2007-09-27  3:27                             ` Zhu Yi
  0 siblings, 0 replies; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  3:27 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    2 +-
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index a83934f..5db0615 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -103,7 +103,7 @@ int iwl_param_queues_num = IWL_MAX_NUM_QUEUES;
 #define VS
 #endif
 
-#define IWLWIFI_VERSION "0.1.15k" VD VS
+#define IWLWIFI_VERSION "1.1.17k" VD VS
 #define DRV_COPYRIGHT	"Copyright(c) 2003-2007 Intel Corporation"
 #define DRV_VERSION     IWLWIFI_VERSION
 
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 283c6a3..950ccfc 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -102,7 +102,7 @@ int iwl_param_queues_num = IWL_MAX_NUM_QUEUES;
 #define VS
 #endif
 
-#define IWLWIFI_VERSION "0.1.15k" VD VS
+#define IWLWIFI_VERSION "1.1.17k" VD VS
 #define DRV_COPYRIGHT	"Copyright(c) 2003-2007 Intel Corporation"
 #define DRV_VERSION     IWLWIFI_VERSION
 
-- 
1.5.1

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

* Re: [PATCH] iwlwifi: replacing IPW with IWL in error messages
  2007-09-27  3:27 ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Zhu Yi
  2007-09-27  3:27   ` [PATCH] iwlwifi: workaournd REPLY_COMPRESSED_BA command in iwl_rx_handle Zhu Yi
@ 2007-09-27  4:32   ` Randy Dunlap
  2007-09-27  4:42     ` Zhu Yi
  1 sibling, 1 reply; 23+ messages in thread
From: Randy Dunlap @ 2007-09-27  4:32 UTC (permalink / raw)
  To: Zhu Yi; +Cc: linville, linux-wireless, Tomas Winkler

On Thu, 27 Sep 2007 11:27:30 +0800 Zhu Yi wrote:

> This patch repaces IPW with IWL in error messages.
> 
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl3945-base.c |    6 +++---
>  drivers/net/wireless/iwlwifi/iwl4965-base.c |    6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)


meta-comment:  Please have git-send-mail put mail/patch numbers
in each subject line, like

[PATCH 1/14]
  [PATCH 2/14]
    ...

Thanks.
---
~Randy
Phaedrus says that Quality is about caring.

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

* Re: [PATCH] iwlwifi: set fixed rate through debugfs
  2007-09-27  3:27                         ` [PATCH] iwlwifi: set fixed rate through debugfs Zhu Yi
  2007-09-27  3:27                           ` [PATCH] iwlwifi: add debugfs rate scale stats Zhu Yi
@ 2007-09-27  4:35                           ` Randy Dunlap
  2007-09-27  4:43                             ` Zhu Yi
  1 sibling, 1 reply; 23+ messages in thread
From: Randy Dunlap @ 2007-09-27  4:35 UTC (permalink / raw)
  To: Zhu Yi; +Cc: linville, linux-wireless, Tomas Winkler

On Thu, 27 Sep 2007 11:27:42 +0800 Zhu Yi wrote:

> This patch adds fixed rate setting through debugfs

Is this just for developer/tester debug use, not for normal use?


> $ echo <rate_n_flags> > \
> /sys/kernel/debug/ieee80211/phy<X>/stations/<mac>/rate_scale_table
> 
> Currently there is no way to turn to rate scaling working again.
> Will be fixed in later.
> 
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   72 +++++++++++++++++++++++++++-
>  1 files changed, 70 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> index c4b8ca1..e5f8cce 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
> @@ -123,7 +123,9 @@ struct iwl_rate_scale_priv {
>  	struct iwl_link_quality_cmd lq;
>  	struct iwl_scale_tbl_info lq_info[LQ_SIZE];
>  #ifdef CONFIG_MAC80211_DEBUGFS
> -       struct dentry *rs_sta_dbgfs_scale_table_file;
> +	struct dentry *rs_sta_dbgfs_scale_table_file;
> +	struct iwl_rate dbg_fixed;
> +	struct iwl_priv *drv;
>  #endif
>  };
>  
> @@ -136,6 +138,14 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
>  			     struct iwl_link_quality_cmd *tbl);
>  
>  
> +#ifdef CONFIG_MAC80211_DEBUGFS
> +static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
> +				struct iwl_rate *mcs, int index);
> +#else
> +static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
> +				struct iwl_rate *mcs, int index)
> +{}
> +#endif
>  static s32 expected_tpt_A[IWL_RATE_COUNT] = {
>  	0, 0, 0, 0, 40, 57, 72, 98, 121, 154, 177, 186, 186
>  };
> @@ -1866,6 +1876,9 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
>  	IWL_DEBUG_HT("MIMO RATE 0x%X SISO MASK 0x%X\n", crl->active_siso_rate,
>  		     crl->active_mimo_rate);
>  #endif /*CONFIG_IWLWIFI_HT*/
> +#ifdef CONFIG_MAC80211_DEBUGFS
> +	crl->drv = priv;
> +#endif
>  
>  	if (priv->assoc_station_added)
>  		priv->lq_mngr.lq_ready = 1;
> @@ -1885,6 +1898,8 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
>  	struct iwl_rate new_rate;
>  	struct iwl_scale_tbl_info tbl_type = { 0 };
>  
> +	rs_dbgfs_set_mcs(lq_data, tx_mcs, index);
> +
>  	rs_get_tbl_info_from_mcs(tx_mcs, lq_data->phymode,
>  				  &tbl_type, &rate_idx);
>  
> @@ -1919,6 +1934,8 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
>  					ant_toggle_count = 1;
>  				}
>  			}
> +
> +			rs_dbgfs_set_mcs(lq_data, &new_rate, index);
>  			lq_cmd->rs_table[index].rate_n_flags =
>  					cpu_to_le32(new_rate.rate_n_flags);
>  			repeat_rate--;
> @@ -1947,6 +1964,7 @@ static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
>  
>  		use_ht_possible = 0;
>  
> +		rs_dbgfs_set_mcs(lq_data, &new_rate, index);
>  		lq_cmd->rs_table[index].rate_n_flags =
>  				cpu_to_le32(new_rate.rate_n_flags);
>  
> @@ -2002,7 +2020,54 @@ static int open_file_generic(struct inode *inode, struct file *file)
>  	file->private_data = inode->i_private;
>  	return 0;
>  }
> +static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
> +				struct iwl_rate *mcs, int index)
> +{
> +	const u32 cck_rate = 0x820A;
> +	if (rs_priv->dbg_fixed.rate_n_flags) {
> +		if (index < 12)
> +			mcs->rate_n_flags = rs_priv->dbg_fixed.rate_n_flags;
> +		else
> +			mcs->rate_n_flags = cck_rate;
> +		IWL_DEBUG_RATE("Fixed rate ON\n");
> +		return;
> +	}
> +
> +	IWL_DEBUG_RATE("Fixed rate OFF\n");
> +}
>  
> +static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
> +			const char __user *user_buf, size_t count, loff_t *ppos)
> +{
> +	struct iwl_rate_scale_priv *rs_priv = file->private_data;
> +	char buf[64];
> +	int buf_size;
> +	u32 parsed_rate;
> +
> +	memset(buf, 0, sizeof(buf));
> +	buf_size = min(count, sizeof(buf) -  1);
> +	if (copy_from_user(buf, user_buf, buf_size))
> +		return -EFAULT;
> +
> +	if (sscanf(buf, "%x", &parsed_rate) == 1)
> +		rs_priv->dbg_fixed.rate_n_flags = parsed_rate;
> +	else
> +		rs_priv->dbg_fixed.rate_n_flags = 0;
> +
> +	rs_priv->active_rate = 0x0FFF;
> +	rs_priv->active_siso_rate = 0x1FD0;
> +	rs_priv->active_mimo_rate = 0x1FD0;
> +
> +	IWL_DEBUG_RATE("sta_id %d rate 0x%X\n",
> +		rs_priv->lq.sta_id, rs_priv->dbg_fixed.rate_n_flags);
> +
> +	if (rs_priv->dbg_fixed.rate_n_flags) {
> +		rs_fill_link_cmd(rs_priv, &rs_priv->dbg_fixed, &rs_priv->lq);
> +		rs_send_lq_cmd(rs_priv->drv, &rs_priv->lq, CMD_ASYNC);
> +	}
> +
> +	return count;
> +}
>  static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
>  			char __user *user_buf, size_t count, loff_t *ppos)
>  {
> @@ -2013,9 +2078,11 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
>  	struct iwl_rate_scale_priv *rs_priv = file->private_data;
>  
>  	desc += sprintf(buff+desc, "sta_id %d\n", rs_priv->lq.sta_id);
> -	desc += sprintf(buff+desc, "failed=%d success=%d rate=%X\n",
> +	desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n",
>  			rs_priv->total_failed, rs_priv->total_success,
>  			rs_priv->active_rate);
> +	desc += sprintf(buff+desc, "fixed rate 0x%X\n",
> +			rs_priv->dbg_fixed.rate_n_flags);
>  	desc += sprintf(buff+desc, "general:"
>  		"flags=0x%X mimo-d=%d s-ant0x%x d-ant=0x%x\n",
>  		rs_priv->lq.general_params.flags,
> @@ -2045,6 +2112,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
>  }
>  
>  static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
> +	.write = rs_sta_dbgfs_scale_table_write,
>  	.read = rs_sta_dbgfs_scale_table_read,
>  	.open = open_file_generic,
>  };
> -- 
> 1.5.1
> -
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


---
~Randy
Phaedrus says that Quality is about caring.

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

* Re: [PATCH] iwlwifi: replacing IPW with IWL in error messages
  2007-09-27  4:32   ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Randy Dunlap
@ 2007-09-27  4:42     ` Zhu Yi
  0 siblings, 0 replies; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  4:42 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linville, linux-wireless, Tomas Winkler

On Wed, 2007-09-26 at 21:32 -0700, Randy Dunlap wrote:
> meta-comment:  Please have git-send-mail put mail/patch numbers
> in each subject line, like
> 
> [PATCH 1/14]
>   [PATCH 2/14]
>     ... 

Yeah, thanks! I'll use '-n' for git-format-patch next time.

Thanks,
-yi

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

* Re: [PATCH] iwlwifi: set fixed rate through debugfs
  2007-09-27  4:35                           ` [PATCH] iwlwifi: set fixed rate through debugfs Randy Dunlap
@ 2007-09-27  4:43                             ` Zhu Yi
  2007-09-27 14:26                               ` Randy Dunlap
  0 siblings, 1 reply; 23+ messages in thread
From: Zhu Yi @ 2007-09-27  4:43 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linville, linux-wireless, Tomas Winkler

On Wed, 2007-09-26 at 21:35 -0700, Randy Dunlap wrote:
> 
> Is this just for developer/tester debug use, not for normal use? 

Yeah, this is for developer debug only at this time.

Thanks,
-yi

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

* Re: [PATCH] iwlwifi: set fixed rate through debugfs
  2007-09-27  4:43                             ` Zhu Yi
@ 2007-09-27 14:26                               ` Randy Dunlap
  2007-09-28  7:44                                 ` Tomas Winkler
  0 siblings, 1 reply; 23+ messages in thread
From: Randy Dunlap @ 2007-09-27 14:26 UTC (permalink / raw)
  To: Zhu Yi; +Cc: linville, linux-wireless, Tomas Winkler

Zhu Yi wrote:
> On Wed, 2007-09-26 at 21:35 -0700, Randy Dunlap wrote:
>> Is this just for developer/tester debug use, not for normal use? 
> 
> Yeah, this is for developer debug only at this time.

Yes, as long as it's using debugfs, it's forever for developer/tester use.
You can't expect or require debugfs to be built or mounted for normal use.

-- 
~Randy
Phaedrus says that Quality is about caring.

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

* Re: iwlwifi driver updates
       [not found] <11908636643693-git-send-email-yi.zhu@intel.com>
  2007-09-27  3:27 ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Zhu Yi
@ 2007-09-27 20:41 ` John W. Linville
  1 sibling, 0 replies; 23+ messages in thread
From: John W. Linville @ 2007-09-27 20:41 UTC (permalink / raw)
  To: Zhu Yi; +Cc: linux-wireless

On Thu, Sep 27, 2007 at 11:27:29AM +0800, Zhu Yi wrote:
> Here are some updates for iwlwifi against davem's net-2.6.24 GIT.
> 
> [PATCH] iwlwifi: replacing IPW with IWL in error messages
> [PATCH] iwlwifi: workaournd REPLY_COMPRESSED_BA command in iwl_rx_handle
> [PATCH] iwlwifi: Correction for sending beacon in config_ap
> [PATCH] iwlwifi: clear station table in rxon unconditionally
> [PATCH] iwlwifi: Fix typo in rate sacling algorithm
> [PATCH] iwlwifi: fix add_station to avoid FW error
> [PATCH] iwlwifi: removing unnecessary memset in 4965 rate scale
> [PATCH] iwlwifi: add debugfs framework to rate scale
> [PATCH] iwlwifi: add read rate scale table debugfs function
> [PATCH] iwlwifi: limit printouts on hot path
> [PATCH] iwlwifi: add supp_rates to rate scale sta private data
> [PATCH] iwlwifi: rs_rate_scale_perform clean up
> [PATCH] iwlwifi: set fixed rate through debugfs
> [PATCH] iwlwifi: add debugfs rate scale stats
> [PATCH] iwlwifi: Update iwlwifi version stamp to 1.1.17

I'll accept that patches -- thanks for sending an update so
(relatively) quickly since the upstream push!

In the future, please try to be a bit more descriptive in your
changelog entries.  Several of them seemed to be either obvious
(and thereby perhaps unnecessary) or they described the patch itself
rather than the motivation for the change.  Describing the why is
more important than the what in most cases. :-)

Thanks,

John
-- 
John W. Linville
linville@tuxdriver.com

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

* Re: [PATCH] iwlwifi: set fixed rate through debugfs
  2007-09-27 14:26                               ` Randy Dunlap
@ 2007-09-28  7:44                                 ` Tomas Winkler
  0 siblings, 0 replies; 23+ messages in thread
From: Tomas Winkler @ 2007-09-28  7:44 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Zhu Yi, linville, linux-wireless

On 9/27/07, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> Zhu Yi wrote:
> > On Wed, 2007-09-26 at 21:35 -0700, Randy Dunlap wrote:
> >> Is this just for developer/tester debug use, not for normal use?
> >
> > Yeah, this is for developer debug only at this time.
>
> Yes, as long as it's using debugfs, it's forever for developer/tester use.
> You can't expect or require debugfs to be built or mounted for normal use.
>

There is no other intension then debugging for these functions.
Tomas

> --
> ~Randy
> Phaedrus says that Quality is about caring.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* iwlwifi driver updates
@ 2008-01-23 18:15 Reinette Chatre
  0 siblings, 0 replies; 23+ messages in thread
From: Reinette Chatre @ 2008-01-23 18:15 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Reinette Chatre

This series containa few updates to the iwlwifi driver.

[PATCH] iwlwifi: Fix an invalid bitmask test in iwl3945 and iwl4965
[PATCH] iwl4965: fix return code indicating one interface is supported
[PATCH] iwlwifi: initialize geo/channel information during probe
[PATCH] iwlwifi: cleanup usage of inline functions
[PATCH] iwlwifi: do not schedule tasklet when rcv unused irq
[PATCH] iwlwifi: Fix uCode error on association


Thank you

Reinette

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

end of thread, other threads:[~2008-01-23 18:15 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <11908636643693-git-send-email-yi.zhu@intel.com>
2007-09-27  3:27 ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Zhu Yi
2007-09-27  3:27   ` [PATCH] iwlwifi: workaournd REPLY_COMPRESSED_BA command in iwl_rx_handle Zhu Yi
2007-09-27  3:27     ` [PATCH] iwlwifi: Correction for sending beacon in config_ap Zhu Yi
2007-09-27  3:27       ` [PATCH] iwlwifi: clear station table in rxon unconditionally Zhu Yi
2007-09-27  3:27         ` [PATCH] iwlwifi: Fix typo in rate sacling algorithm Zhu Yi
2007-09-27  3:27           ` [PATCH] iwlwifi: fix add_station to avoid FW error Zhu Yi
2007-09-27  3:27             ` [PATCH] iwlwifi: removing unnecessary memset in 4965 rate scale Zhu Yi
2007-09-27  3:27               ` [PATCH] iwlwifi: add debugfs framework to " Zhu Yi
2007-09-27  3:27                 ` [PATCH] iwlwifi: add read rate scale table debugfs function Zhu Yi
2007-09-27  3:27                   ` [PATCH] iwlwifi: limit printouts on hot path Zhu Yi
2007-09-27  3:27                     ` [PATCH] iwlwifi: add supp_rates to rate scale sta private data Zhu Yi
2007-09-27  3:27                       ` [PATCH] iwlwifi: rs_rate_scale_perform clean up Zhu Yi
2007-09-27  3:27                         ` [PATCH] iwlwifi: set fixed rate through debugfs Zhu Yi
2007-09-27  3:27                           ` [PATCH] iwlwifi: add debugfs rate scale stats Zhu Yi
2007-09-27  3:27                             ` [PATCH] iwlwifi: Update iwlwifi version stamp to 1.1.17 Zhu Yi
2007-09-27  4:35                           ` [PATCH] iwlwifi: set fixed rate through debugfs Randy Dunlap
2007-09-27  4:43                             ` Zhu Yi
2007-09-27 14:26                               ` Randy Dunlap
2007-09-28  7:44                                 ` Tomas Winkler
2007-09-27  4:32   ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Randy Dunlap
2007-09-27  4:42     ` Zhu Yi
2007-09-27 20:41 ` iwlwifi driver updates John W. Linville
2008-01-23 18:15 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).