aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-04-08 14:39:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:44 -0400
commita83b9141b540f96dd59409c6487828e880113a29 (patch)
tree040301dd80eb0307c9dcd5208f88082b4d3922cf /drivers/net/wireless/iwlwifi/iwl-agn.c
parent1620108910b07bc41f4ad462ca56e899faf7e61a (diff)
iwlwifi: adding interrupt counter in debugfs for debugging
This patch adds interrupt statistics report to debugfs, this can help to understand number of interrupts happened which including HW/SW error for easier and better debugging. in /sys/kernel/debug/ieee80211/phyN/iwlagn/data directory use "cat interrupt" to view the current interrupt counter use "echo 0 > interrupt" to clear interrupt counter Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 9dda3d547d0d..12de63e9c720 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -911,6 +911,7 @@ void iwl_rx_handle(struct iwl_priv *priv)
911 IWL_DEBUG_RX(priv, "r = %d, i = %d, %s, 0x%02x\n", r, 911 IWL_DEBUG_RX(priv, "r = %d, i = %d, %s, 0x%02x\n", r,
912 i, get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd); 912 i, get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd);
913 priv->rx_handlers[pkt->hdr.cmd] (priv, rxb); 913 priv->rx_handlers[pkt->hdr.cmd] (priv, rxb);
914 priv->isr_stats.rx_handlers[pkt->hdr.cmd]++;
914 } else { 915 } else {
915 /* No handling needed */ 916 /* No handling needed */
916 IWL_DEBUG_RX(priv, 917 IWL_DEBUG_RX(priv,
@@ -1035,6 +1036,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1035 /* Tell the device to stop sending interrupts */ 1036 /* Tell the device to stop sending interrupts */
1036 iwl_disable_interrupts(priv); 1037 iwl_disable_interrupts(priv);
1037 1038
1039 priv->isr_stats.hw++;
1038 iwl_irq_handle_error(priv); 1040 iwl_irq_handle_error(priv);
1039 1041
1040 handled |= CSR_INT_BIT_HW_ERR; 1042 handled |= CSR_INT_BIT_HW_ERR;
@@ -1047,13 +1049,17 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1047#ifdef CONFIG_IWLWIFI_DEBUG 1049#ifdef CONFIG_IWLWIFI_DEBUG
1048 if (priv->debug_level & (IWL_DL_ISR)) { 1050 if (priv->debug_level & (IWL_DL_ISR)) {
1049 /* NIC fires this, but we don't use it, redundant with WAKEUP */ 1051 /* NIC fires this, but we don't use it, redundant with WAKEUP */
1050 if (inta & CSR_INT_BIT_SCD) 1052 if (inta & CSR_INT_BIT_SCD) {
1051 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit " 1053 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
1052 "the frame/frames.\n"); 1054 "the frame/frames.\n");
1055 priv->isr_stats.sch++;
1056 }
1053 1057
1054 /* Alive notification via Rx interrupt will do the real work */ 1058 /* Alive notification via Rx interrupt will do the real work */
1055 if (inta & CSR_INT_BIT_ALIVE) 1059 if (inta & CSR_INT_BIT_ALIVE) {
1056 IWL_DEBUG_ISR(priv, "Alive interrupt\n"); 1060 IWL_DEBUG_ISR(priv, "Alive interrupt\n");
1061 priv->isr_stats.alive++;
1062 }
1057 } 1063 }
1058#endif 1064#endif
1059 /* Safely ignore these bits for debug checks below */ 1065 /* Safely ignore these bits for debug checks below */
@@ -1069,6 +1075,8 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1069 IWL_DEBUG_RF_KILL(priv, "RF_KILL bit toggled to %s.\n", 1075 IWL_DEBUG_RF_KILL(priv, "RF_KILL bit toggled to %s.\n",
1070 hw_rf_kill ? "disable radio" : "enable radio"); 1076 hw_rf_kill ? "disable radio" : "enable radio");
1071 1077
1078 priv->isr_stats.rfkill++;
1079
1072 /* driver only loads ucode once setting the interface up. 1080 /* driver only loads ucode once setting the interface up.
1073 * the driver allows loading the ucode even if the radio 1081 * the driver allows loading the ucode even if the radio
1074 * is killed. Hence update the killswitch state here. The 1082 * is killed. Hence update the killswitch state here. The
@@ -1088,6 +1096,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1088 /* Chip got too hot and stopped itself */ 1096 /* Chip got too hot and stopped itself */
1089 if (inta & CSR_INT_BIT_CT_KILL) { 1097 if (inta & CSR_INT_BIT_CT_KILL) {
1090 IWL_ERR(priv, "Microcode CT kill error detected.\n"); 1098 IWL_ERR(priv, "Microcode CT kill error detected.\n");
1099 priv->isr_stats.ctkill++;
1091 handled |= CSR_INT_BIT_CT_KILL; 1100 handled |= CSR_INT_BIT_CT_KILL;
1092 } 1101 }
1093 1102
@@ -1095,6 +1104,8 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1095 if (inta & CSR_INT_BIT_SW_ERR) { 1104 if (inta & CSR_INT_BIT_SW_ERR) {
1096 IWL_ERR(priv, "Microcode SW error detected. " 1105 IWL_ERR(priv, "Microcode SW error detected. "
1097 " Restarting 0x%X.\n", inta); 1106 " Restarting 0x%X.\n", inta);
1107 priv->isr_stats.sw++;
1108 priv->isr_stats.sw_err = inta;
1098 iwl_irq_handle_error(priv); 1109 iwl_irq_handle_error(priv);
1099 handled |= CSR_INT_BIT_SW_ERR; 1110 handled |= CSR_INT_BIT_SW_ERR;
1100 } 1111 }
@@ -1110,6 +1121,8 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1110 iwl_txq_update_write_ptr(priv, &priv->txq[4]); 1121 iwl_txq_update_write_ptr(priv, &priv->txq[4]);
1111 iwl_txq_update_write_ptr(priv, &priv->txq[5]); 1122 iwl_txq_update_write_ptr(priv, &priv->txq[5]);
1112 1123
1124 priv->isr_stats.wakeup++;
1125
1113 handled |= CSR_INT_BIT_WAKEUP; 1126 handled |= CSR_INT_BIT_WAKEUP;
1114 } 1127 }
1115 1128
@@ -1118,19 +1131,23 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1118 * notifications from uCode come through here*/ 1131 * notifications from uCode come through here*/
1119 if (inta & (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX)) { 1132 if (inta & (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX)) {
1120 iwl_rx_handle(priv); 1133 iwl_rx_handle(priv);
1134 priv->isr_stats.rx++;
1121 handled |= (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX); 1135 handled |= (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX);
1122 } 1136 }
1123 1137
1124 if (inta & CSR_INT_BIT_FH_TX) { 1138 if (inta & CSR_INT_BIT_FH_TX) {
1125 IWL_DEBUG_ISR(priv, "Tx interrupt\n"); 1139 IWL_DEBUG_ISR(priv, "Tx interrupt\n");
1140 priv->isr_stats.tx++;
1126 handled |= CSR_INT_BIT_FH_TX; 1141 handled |= CSR_INT_BIT_FH_TX;
1127 /* FH finished to write, send event */ 1142 /* FH finished to write, send event */
1128 priv->ucode_write_complete = 1; 1143 priv->ucode_write_complete = 1;
1129 wake_up_interruptible(&priv->wait_command_queue); 1144 wake_up_interruptible(&priv->wait_command_queue);
1130 } 1145 }
1131 1146
1132 if (inta & ~handled) 1147 if (inta & ~handled) {
1133 IWL_ERR(priv, "Unhandled INTA bits 0x%08x\n", inta & ~handled); 1148 IWL_ERR(priv, "Unhandled INTA bits 0x%08x\n", inta & ~handled);
1149 priv->isr_stats.unhandled++;
1150 }
1134 1151
1135 if (inta & ~CSR_INI_SET_MASK) { 1152 if (inta & ~CSR_INI_SET_MASK) {
1136 IWL_WARN(priv, "Disabled INTA bits 0x%08x were pending\n", 1153 IWL_WARN(priv, "Disabled INTA bits 0x%08x were pending\n",
@@ -1155,6 +1172,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1155 spin_unlock_irqrestore(&priv->lock, flags); 1172 spin_unlock_irqrestore(&priv->lock, flags);
1156} 1173}
1157 1174
1175
1158/****************************************************************************** 1176/******************************************************************************
1159 * 1177 *
1160 * uCode download functions 1178 * uCode download functions
@@ -1983,6 +2001,8 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
1983 2001
1984out: 2002out:
1985 priv->is_open = 1; 2003 priv->is_open = 1;
2004 /* default to MONITOR mode */
2005 priv->iw_mode = NL80211_IFTYPE_MONITOR;
1986 IWL_DEBUG_MAC80211(priv, "leave\n"); 2006 IWL_DEBUG_MAC80211(priv, "leave\n");
1987 return 0; 2007 return 0;
1988} 2008}