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-08-07 18:41:39 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:46 -0400
commit20594eb0daa67f7a0cc19d74a1bafceb1bb09f4a (patch)
tree9ae022adef73139b524dcd7dde9c6f02809e8cf1 /drivers/net/wireless/iwlwifi/iwl-agn.c
parent7aafef1c6e2e24f9a10dc2972bf0ee70624ccc47 (diff)
iwlwifi: new debugging feature for dumping data traffic
The traffic buffer will only beallocated and used if either bit 23 (IWL_DX_TX) or bit 24 (IWL_DL_RX) of "debug" is set; example: "debug=0x800000" - log tx data traffic "debug=0x1000000" - log rx data traffic "debug=0x1800000" - log both tx and rx traffic The traffic log will store the beginning portion (64 bytes) of the latest 256 of tx and rx packets in the round-robbin buffer for debugging, user can examine the log through debugfs file. How to display the current logged tx/rx traffic and txfifo and rxfifo read/write point: "cat traffic_log" in /sys/kernel/debug/ieee80211/phy0/iwlagn/debug directory By echo "0" to traffic_log file will empty the traffic log buffer and reset both tx and rx taffic log index to 0. 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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 24c1ae6b8162..c9a1aacb2437 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2476,9 +2476,12 @@ static ssize_t store_debug_level(struct device *d,
2476 ret = strict_strtoul(buf, 0, &val); 2476 ret = strict_strtoul(buf, 0, &val);
2477 if (ret) 2477 if (ret)
2478 IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf); 2478 IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf);
2479 else 2479 else {
2480 priv->debug_level = val; 2480 priv->debug_level = val;
2481 2481 if (iwl_alloc_traffic_mem(priv))
2482 IWL_ERR(priv,
2483 "Not enough memory to generate traffic log\n");
2484 }
2482 return strnlen(buf, count); 2485 return strnlen(buf, count);
2483} 2486}
2484 2487
@@ -2819,6 +2822,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2819#ifdef CONFIG_IWLWIFI_DEBUG 2822#ifdef CONFIG_IWLWIFI_DEBUG
2820 atomic_set(&priv->restrict_refcnt, 0); 2823 atomic_set(&priv->restrict_refcnt, 0);
2821#endif 2824#endif
2825 if (iwl_alloc_traffic_mem(priv))
2826 IWL_ERR(priv, "Not enough memory to generate traffic log\n");
2822 2827
2823 /************************** 2828 /**************************
2824 * 2. Initializing PCI bus 2829 * 2. Initializing PCI bus
@@ -3003,6 +3008,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3003 pci_disable_device(pdev); 3008 pci_disable_device(pdev);
3004 out_ieee80211_free_hw: 3009 out_ieee80211_free_hw:
3005 ieee80211_free_hw(priv->hw); 3010 ieee80211_free_hw(priv->hw);
3011 iwl_free_traffic_mem(priv);
3006 out: 3012 out:
3007 return err; 3013 return err;
3008} 3014}
@@ -3061,6 +3067,7 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
3061 * until now... */ 3067 * until now... */
3062 destroy_workqueue(priv->workqueue); 3068 destroy_workqueue(priv->workqueue);
3063 priv->workqueue = NULL; 3069 priv->workqueue = NULL;
3070 iwl_free_traffic_mem(priv);
3064 3071
3065 free_irq(priv->pci_dev->irq, priv); 3072 free_irq(priv->pci_dev->irq, priv);
3066 pci_disable_msi(priv->pci_dev); 3073 pci_disable_msi(priv->pci_dev);