All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Ben Cahill <ben.m.cahill@intel.com>, Zhu Yi <yi.zhu@intel.com>
Subject: [PATCH 26/28] iwlwifi: Enhance ISR/RX/CMD debug messages
Date: Wed,  8 Aug 2007 15:33:43 +0800	[thread overview]
Message-ID: <11865584861970-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <11865584841976-git-send-email-yi.zhu@intel.com>

From: Ben Cahill <ben.m.cahill@intel.com>

This patch enhances ISR/RX/CMD debug messages and make sure
all commands are in get_cmd_string(). It also removes 2 unused
commands and enhance comments.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwl-base.c     |   84 +++++++++++++++++++++++-----------
 drivers/net/wireless/iwl-commands.h |    5 +--
 2 files changed, 58 insertions(+), 31 deletions(-)

diff --git a/drivers/net/wireless/iwl-base.c b/drivers/net/wireless/iwl-base.c
index a6cac9c..ad7e67c 100644
--- a/drivers/net/wireless/iwl-base.c
+++ b/drivers/net/wireless/iwl-base.c
@@ -593,41 +593,61 @@ static inline int iwl_is_ready_rf(struct iwl_priv *priv)
 static const char *get_cmd_string(u8 cmd)
 {
 	switch (cmd) {
-		IWL_CMD(SCAN_START_NOTIFICATION);
-		IWL_CMD(SCAN_RESULTS_NOTIFICATION);
-		IWL_CMD(SCAN_COMPLETE_NOTIFICATION);
-		IWL_CMD(STATISTICS_NOTIFICATION);
 		IWL_CMD(REPLY_ALIVE);
 		IWL_CMD(REPLY_ERROR);
-		IWL_CMD(REPLY_RXON_ASSOC);
 		IWL_CMD(REPLY_RXON);
+		IWL_CMD(REPLY_RXON_ASSOC);
 		IWL_CMD(REPLY_QOS_PARAM);
 		IWL_CMD(REPLY_RXON_TIMING);
 		IWL_CMD(REPLY_ADD_STA);
+#if IWL == 3945
+		IWL_CMD(REPLY_REMOVE_STA);
+		IWL_CMD(REPLY_REMOVE_ALL_STA);
+		IWL_CMD(REPLY_3945_RX);
+#endif
 		IWL_CMD(REPLY_TX);
 		IWL_CMD(REPLY_BCON);
+#if IWL == 4965
+		IWL_CMD(REPLY_SHUTDOWN);
+#endif
 		IWL_CMD(REPLY_RATE_SCALE);
 		IWL_CMD(REPLY_LEDS_CMD);
+		IWL_CMD(REPLY_TX_LINK_QUALITY_CMD);
+		IWL_CMD(RADAR_NOTIFICATION);
+		IWL_CMD(REPLY_QUIET_CMD);
+		IWL_CMD(REPLY_CHANNEL_SWITCH);
+		IWL_CMD(CHANNEL_SWITCH_NOTIFICATION);
+		IWL_CMD(REPLY_SPECTRUM_MEASUREMENT_CMD);
+		IWL_CMD(SPECTRUM_MEASURE_NOTIFICATION);
+		IWL_CMD(POWER_TABLE_CMD);
+		IWL_CMD(PM_SLEEP_NOTIFICATION);
+		IWL_CMD(PM_DEBUG_STATISTIC_NOTIFIC);
+		IWL_CMD(REPLY_SCAN_CMD);
 		IWL_CMD(REPLY_SCAN_ABORT_CMD);
+		IWL_CMD(SCAN_START_NOTIFICATION);
+		IWL_CMD(SCAN_RESULTS_NOTIFICATION);
+		IWL_CMD(SCAN_COMPLETE_NOTIFICATION);
+		IWL_CMD(BEACON_NOTIFICATION);
 		IWL_CMD(REPLY_TX_BEACON);
-		IWL_CMD(REPLY_BT_CONFIG);
-		IWL_CMD(REPLY_SCAN_CMD);
+		IWL_CMD(WHO_IS_AWAKE_NOTIFICATION);
+		IWL_CMD(QUIET_NOTIFICATION);
 		IWL_CMD(REPLY_TX_PWR_TABLE_CMD);
+		IWL_CMD(MEASURE_ABORT_NOTIFICATION);
+		IWL_CMD(REPLY_BT_CONFIG);
 		IWL_CMD(REPLY_STATISTICS_CMD);
+		IWL_CMD(STATISTICS_NOTIFICATION);
 		IWL_CMD(REPLY_CARD_STATE_CMD);
-		IWL_CMD(REPLY_TX_LINK_QUALITY_CMD);
-#if IWL == 3945
-		IWL_CMD(REPLY_3945_RX);
-#elif IWL == 4965
-		IWL_CMD(MISSED_BEACONS_NOTIFICATION_TH_CMD);
+		IWL_CMD(CARD_STATE_NOTIFICATION);
+		IWL_CMD(MISSED_BEACONS_NOTIFICATION);
+#if IWL == 4965
 		IWL_CMD(REPLY_CT_KILL_CONFIG_CMD);
 		IWL_CMD(SENSITIVITY_CMD);
-		IWL_CMD(REPLY_RX_MPDU_CMD);
+		IWL_CMD(REPLY_PHY_CALIBRATION_CMD);
 		IWL_CMD(REPLY_RX_PHY_CMD);
+		IWL_CMD(REPLY_RX_MPDU_CMD);
 		IWL_CMD(REPLY_4965_RX);
+		IWL_CMD(REPLY_COMPRESSED_BA);
 #endif
-	case POWER_TABLE_CMD:
-		return "POWER_TABLE_CMD";
 	default:
 		return "UNKNOWN";
 
@@ -4647,8 +4667,8 @@ int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm)
  * iwl_rx_handle - Main entry function for receiving responses from the uCode
  *
  * Uses the priv->rx_handlers callback function array to invoke
- * the appropriate handlers including command response and 802.11
- * frame availability.
+ * the appropriate handlers, including command responses,
+ * frame-received notifications, and other notifications.
  */
 static void iwl_rx_handle(struct iwl_priv *priv)
 {
@@ -4662,6 +4682,10 @@ static void iwl_rx_handle(struct iwl_priv *priv)
 	r = iwl_hw_get_rx_read(priv);
 	i = rxq->read;
 
+	/* Rx interrupt, but nothing sent from uCode */
+	if (i == r)
+		IWL_DEBUG(IWL_DL_RX | IWL_DL_ISR, "r = %d, i = %d\n", r, i);
+
 	while (i != r) {
 		rxb = rxq->queue[i];
 
@@ -4677,7 +4701,12 @@ static void iwl_rx_handle(struct iwl_priv *priv)
 					    PCI_DMA_FROMDEVICE);
 		pkt = (struct iwl_rx_packet *)rxb->skb->data;
 
-		/* need to reclaim cmd buffer(s) */
+		/* Reclaim a command buffer only if this packet is a response
+		 *   to a (driver-originated) command.
+		 * If the packet (e.g. Rx frame) originated from uCode,
+		 *   there is no command buffer to reclaim.
+		 * Ucode should set SEQ_RX_FRAME bit if ucode-originated,
+		 *   but apparently a few don't get set; catch them here. */
 		reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
 #if IWL == 4965
 			(pkt->hdr.cmd != REPLY_RX_PHY_CMD) &&
@@ -4690,21 +4719,22 @@ static void iwl_rx_handle(struct iwl_priv *priv)
 		 *   handle those that need handling via function in
 		 *   rx_handlers table.  See iwl_setup_rx_handlers() */
 		if (priv->rx_handlers[pkt->hdr.cmd]) {
+			IWL_DEBUG(IWL_DL_HOST_COMMAND | IWL_DL_RX | IWL_DL_ISR,
+				"r = %d, i = %d, %s, 0x%02x\n", r, i,
+				get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd);
 			priv->rx_handlers[pkt->hdr.cmd] (priv, rxb);
-			IWL_DEBUG(IWL_DL_RX | IWL_DL_ISR,
-				"r = %d, i = %d, rx_handler %s\n", r, i,
-				get_cmd_string(pkt->hdr.cmd));
 		} else {
 			/* No handling needed */
-			IWL_DEBUG_HC("UNHANDLED - #0x%02x %s\n",
-				     pkt->hdr.cmd,
-				     get_cmd_string(pkt->hdr.cmd));
+			IWL_DEBUG(IWL_DL_HOST_COMMAND | IWL_DL_RX | IWL_DL_ISR,
+				"r %d i %d No handler needed for %s, 0x%02x\n",
+				r, i, get_cmd_string(pkt->hdr.cmd),
+				pkt->hdr.cmd);
 		}
 
 		if (reclaim) {
-			/* Invoke any callbacks, transfer the skb to
-			 * caller, and fire off the (possibly) blocking
-			 * iwl_send_cmd() via as we reclaim the queue... */
+			/* Invoke any callbacks, transfer the skb to caller,
+			 * and fire off the (possibly) blocking iwl_send_cmd()
+			 * as we reclaim the driver command queue */
 			if (rxb && rxb->skb)
 				iwl_tx_cmd_complete(priv, rxb);
 			else
diff --git a/drivers/net/wireless/iwl-commands.h b/drivers/net/wireless/iwl-commands.h
index 1d2c091..eecb6f6 100644
--- a/drivers/net/wireless/iwl-commands.h
+++ b/drivers/net/wireless/iwl-commands.h
@@ -130,8 +130,6 @@ enum {
 	REPLY_TX_PWR_TABLE_CMD = 0x97,
 	MEASURE_ABORT_NOTIFICATION = 0x99,
 
-	REPLY_CALIBRATION_TUNE = 0x9a,
-
 	/* BT config command */
 	REPLY_BT_CONFIG = 0x9b,
 	REPLY_STATISTICS_CMD = 0x9c,
@@ -143,15 +141,14 @@ enum {
 
 	/* Missed beacons notification */
 	MISSED_BEACONS_NOTIFICATION = 0xa2,
-	MISSED_BEACONS_NOTIFICATION_TH_CMD = 0xa3,
 
 #if IWL == 4965
 	REPLY_CT_KILL_CONFIG_CMD = 0xa4,
 	SENSITIVITY_CMD = 0xa8,
 	REPLY_PHY_CALIBRATION_CMD = 0xb0,
-	REPLY_4965_RX = 0xc3,
 	REPLY_RX_PHY_CMD = 0xc0,
 	REPLY_RX_MPDU_CMD = 0xc1,
+	REPLY_4965_RX = 0xc3,
 	REPLY_COMPRESSED_BA = 0xc5,
 #endif
 	REPLY_MAX = 0xff
-- 
1.5.2

  reply	other threads:[~2007-08-08  7:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11865584251026-git-send-email-yi.zhu@intel.com>
2007-08-08  7:33 ` [PATCH 01/28] iwlwifi: fix a lot of checkpatch.pl warnings Zhu Yi
2007-08-08  7:33   ` [PATCH 02/28] iwlwifi: add more Kconfig options Zhu Yi
2007-08-08  7:33     ` [PATCH 03/28] iwlwifi: Endianity fix for 4965 rate scaling Zhu Yi
2007-08-08  7:33       ` [PATCH 04/28] iwlwifi: Endianity fix for 4965 rx chain selection Zhu Yi
2007-08-08  7:33         ` [PATCH 05/28] iwlwifi: optimize iwl_queue_{inc|dec}_wrap implementation Zhu Yi
2007-08-08  7:33           ` [PATCH 06/28] iwlwifi: use mask operation to replace '%' for index calculation Zhu Yi
2007-08-08  7:33             ` [PATCH 07/28] iwlwifi: make local functions static Zhu Yi
2007-08-08  7:33               ` [PATCH 08/28] iwlwifi: some coding styles cleanup Zhu Yi
2007-08-08  7:33                 ` [PATCH 09/28] iwlwifi: replace unnecessary GFP_ATOMIC with GFP_KERNEL Zhu Yi
2007-08-08  7:33                   ` [PATCH 10/28] iwlwifi: remove priv stuff zeroing in iwl_pci_probe Zhu Yi
2007-08-08  7:33                     ` [PATCH 11/28] iwlwifi: add name for some PCI configuration space registers Zhu Yi
2007-08-08  7:33                       ` [PATCH 12/28] iwlwifi: shorten some structure and function names Zhu Yi
2007-08-08  7:33                         ` [PATCH 13/28] iwlwifi: define iwl_rx_reply_scan only when CONFIG_IWLWIFI_DEBUG enabled Zhu Yi
2007-08-08  7:33                           ` [PATCH 14/28] iwlwifi: remove redundant quotes Zhu Yi
2007-08-08  7:33                             ` [PATCH 15/28] iwlwifi: Endianity fix for rxon host commands Zhu Yi
2007-08-08  7:33                               ` [PATCH 16/28] iwlwifi: Endianity fix for beacon host command Zhu Yi
2007-08-08  7:33                                 ` [PATCH 17/28] iwlwifi: Endianity fix for channel number Zhu Yi
2007-08-08  7:33                                   ` [PATCH 18/28] iwlwifi: shorten more function names Zhu Yi
2007-08-08  7:33                                     ` [PATCH 19/28] iwlwifi: make iwl_get_bits inline function from macro Zhu Yi
2007-08-08  7:33                                       ` [PATCH 20/28] iwlwifi: remove BIT_FMT and BIT_ARG Zhu Yi
2007-08-08  7:33                                         ` [PATCH 21/28] iwlwifi: remove WLAN_FC_GET_TYPE macros Zhu Yi
2007-08-08  7:33                                           ` [PATCH 22/28] iwlwifi: replace private snprint_line with common hex_dump_xxx Zhu Yi
2007-08-08  7:33                                             ` [PATCH 23/28] iwlwifi: Endianity fix for frame control Zhu Yi
2007-08-08  7:33                                               ` [PATCH 24/28] iwlwifi: Endianity fix for ct kill configuration Zhu Yi
2007-08-08  7:33                                                 ` [PATCH 25/28] iwlwifi: remove unused snprint_line Zhu Yi
2007-08-08  7:33                                                   ` Zhu Yi [this message]
2007-08-08  7:33                                                     ` [PATCH 27/28] iwlwifi: Correct missing hardware detection in iwl_isr() Zhu Yi
2007-08-08  7:33                                                       ` [PATCH 28/28] iwlwifi: Streamline irq_tasklet() when ISR debug not used Zhu Yi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11865584861970-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=ben.m.cahill@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.