diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2009-04-20 17:36:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:57:18 -0400 |
commit | 86ddbf62c2daefebba13e3c79f88cbdfde766176 (patch) | |
tree | 2cefbe4da637fccccff29000dd0a80dd9a43129e /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | a75fbe8d68ceace836b27c216a5eda1c4687be4b (diff) |
iwl3945: calculate debugfs isr statistics
This patch calculates interrupt statistics for debugfs.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@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/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index bcfe199567e6..562dd76226cc 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1543,6 +1543,7 @@ static void iwl3945_rx_handle(struct iwl_priv *priv) | |||
1543 | "r = %d, i = %d, %s, 0x%02x\n", r, i, | 1543 | "r = %d, i = %d, %s, 0x%02x\n", r, i, |
1544 | get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd); | 1544 | get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd); |
1545 | priv->rx_handlers[pkt->hdr.cmd] (priv, rxb); | 1545 | priv->rx_handlers[pkt->hdr.cmd] (priv, rxb); |
1546 | priv->isr_stats.rx_handlers[pkt->hdr.cmd]++; | ||
1546 | } else { | 1547 | } else { |
1547 | /* No handling needed */ | 1548 | /* No handling needed */ |
1548 | IWL_DEBUG(priv, IWL_DL_HCMD | IWL_DL_RX | IWL_DL_ISR, | 1549 | IWL_DEBUG(priv, IWL_DL_HCMD | IWL_DL_RX | IWL_DL_ISR, |
@@ -1845,6 +1846,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
1845 | /* Tell the device to stop sending interrupts */ | 1846 | /* Tell the device to stop sending interrupts */ |
1846 | iwl_disable_interrupts(priv); | 1847 | iwl_disable_interrupts(priv); |
1847 | 1848 | ||
1849 | priv->isr_stats.hw++; | ||
1848 | iwl_irq_handle_error(priv); | 1850 | iwl_irq_handle_error(priv); |
1849 | 1851 | ||
1850 | handled |= CSR_INT_BIT_HW_ERR; | 1852 | handled |= CSR_INT_BIT_HW_ERR; |
@@ -1857,13 +1859,17 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
1857 | #ifdef CONFIG_IWLWIFI_DEBUG | 1859 | #ifdef CONFIG_IWLWIFI_DEBUG |
1858 | if (priv->debug_level & (IWL_DL_ISR)) { | 1860 | if (priv->debug_level & (IWL_DL_ISR)) { |
1859 | /* NIC fires this, but we don't use it, redundant with WAKEUP */ | 1861 | /* NIC fires this, but we don't use it, redundant with WAKEUP */ |
1860 | if (inta & CSR_INT_BIT_SCD) | 1862 | if (inta & CSR_INT_BIT_SCD) { |
1861 | IWL_DEBUG_ISR(priv, "Scheduler finished to transmit " | 1863 | IWL_DEBUG_ISR(priv, "Scheduler finished to transmit " |
1862 | "the frame/frames.\n"); | 1864 | "the frame/frames.\n"); |
1865 | priv->isr_stats.sch++; | ||
1866 | } | ||
1863 | 1867 | ||
1864 | /* Alive notification via Rx interrupt will do the real work */ | 1868 | /* Alive notification via Rx interrupt will do the real work */ |
1865 | if (inta & CSR_INT_BIT_ALIVE) | 1869 | if (inta & CSR_INT_BIT_ALIVE) { |
1866 | IWL_DEBUG_ISR(priv, "Alive interrupt\n"); | 1870 | IWL_DEBUG_ISR(priv, "Alive interrupt\n"); |
1871 | priv->isr_stats.alive++; | ||
1872 | } | ||
1867 | } | 1873 | } |
1868 | #endif | 1874 | #endif |
1869 | /* Safely ignore these bits for debug checks below */ | 1875 | /* Safely ignore these bits for debug checks below */ |
@@ -1873,6 +1879,8 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
1873 | if (inta & CSR_INT_BIT_SW_ERR) { | 1879 | if (inta & CSR_INT_BIT_SW_ERR) { |
1874 | IWL_ERR(priv, "Microcode SW error detected. " | 1880 | IWL_ERR(priv, "Microcode SW error detected. " |
1875 | "Restarting 0x%X.\n", inta); | 1881 | "Restarting 0x%X.\n", inta); |
1882 | priv->isr_stats.sw++; | ||
1883 | priv->isr_stats.sw_err = inta; | ||
1876 | iwl_irq_handle_error(priv); | 1884 | iwl_irq_handle_error(priv); |
1877 | handled |= CSR_INT_BIT_SW_ERR; | 1885 | handled |= CSR_INT_BIT_SW_ERR; |
1878 | } | 1886 | } |
@@ -1888,6 +1896,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
1888 | iwl_txq_update_write_ptr(priv, &priv->txq[4]); | 1896 | iwl_txq_update_write_ptr(priv, &priv->txq[4]); |
1889 | iwl_txq_update_write_ptr(priv, &priv->txq[5]); | 1897 | iwl_txq_update_write_ptr(priv, &priv->txq[5]); |
1890 | 1898 | ||
1899 | priv->isr_stats.wakeup++; | ||
1891 | handled |= CSR_INT_BIT_WAKEUP; | 1900 | handled |= CSR_INT_BIT_WAKEUP; |
1892 | } | 1901 | } |
1893 | 1902 | ||
@@ -1896,11 +1905,13 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
1896 | * notifications from uCode come through here*/ | 1905 | * notifications from uCode come through here*/ |
1897 | if (inta & (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX)) { | 1906 | if (inta & (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX)) { |
1898 | iwl3945_rx_handle(priv); | 1907 | iwl3945_rx_handle(priv); |
1908 | priv->isr_stats.rx++; | ||
1899 | handled |= (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX); | 1909 | handled |= (CSR_INT_BIT_FH_RX | CSR_INT_BIT_SW_RX); |
1900 | } | 1910 | } |
1901 | 1911 | ||
1902 | if (inta & CSR_INT_BIT_FH_TX) { | 1912 | if (inta & CSR_INT_BIT_FH_TX) { |
1903 | IWL_DEBUG_ISR(priv, "Tx interrupt\n"); | 1913 | IWL_DEBUG_ISR(priv, "Tx interrupt\n"); |
1914 | priv->isr_stats.tx++; | ||
1904 | 1915 | ||
1905 | iwl_write32(priv, CSR_FH_INT_STATUS, (1 << 6)); | 1916 | iwl_write32(priv, CSR_FH_INT_STATUS, (1 << 6)); |
1906 | if (!iwl_grab_nic_access(priv)) { | 1917 | if (!iwl_grab_nic_access(priv)) { |
@@ -1911,8 +1922,10 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
1911 | handled |= CSR_INT_BIT_FH_TX; | 1922 | handled |= CSR_INT_BIT_FH_TX; |
1912 | } | 1923 | } |
1913 | 1924 | ||
1914 | if (inta & ~handled) | 1925 | if (inta & ~handled) { |
1915 | IWL_ERR(priv, "Unhandled INTA bits 0x%08x\n", inta & ~handled); | 1926 | IWL_ERR(priv, "Unhandled INTA bits 0x%08x\n", inta & ~handled); |
1927 | priv->isr_stats.unhandled++; | ||
1928 | } | ||
1916 | 1929 | ||
1917 | if (inta & ~CSR_INI_SET_MASK) { | 1930 | if (inta & ~CSR_INI_SET_MASK) { |
1918 | IWL_WARN(priv, "Disabled INTA bits 0x%08x were pending\n", | 1931 | IWL_WARN(priv, "Disabled INTA bits 0x%08x were pending\n", |