diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-08-07 18:41:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:13:46 -0400 |
commit | 20594eb0daa67f7a0cc19d74a1bafceb1bb09f4a (patch) | |
tree | 9ae022adef73139b524dcd7dde9c6f02809e8cf1 /drivers/net | |
parent | 7aafef1c6e2e24f9a10dc2972bf0ee70624ccc47 (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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 100 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 28 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 102 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 13 |
10 files changed, 262 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 9e33507661d3..bfd509f7af24 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -679,6 +679,7 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv, | |||
679 | 679 | ||
680 | /* Set "1" to report good data frames in groups of 100 */ | 680 | /* Set "1" to report good data frames in groups of 100 */ |
681 | iwl3945_dbg_report_frame(priv, pkt, header, 1); | 681 | iwl3945_dbg_report_frame(priv, pkt, header, 1); |
682 | iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header); | ||
682 | 683 | ||
683 | if (network_packet) { | 684 | if (network_packet) { |
684 | priv->last_beacon_time = le32_to_cpu(rx_end->beacon_timestamp); | 685 | priv->last_beacon_time = le32_to_cpu(rx_end->beacon_timestamp); |
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); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 5315d347a004..1ae2ce3512c3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2953,6 +2953,106 @@ void iwl_mac_reset_tsf(struct ieee80211_hw *hw) | |||
2953 | } | 2953 | } |
2954 | EXPORT_SYMBOL(iwl_mac_reset_tsf); | 2954 | EXPORT_SYMBOL(iwl_mac_reset_tsf); |
2955 | 2955 | ||
2956 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
2957 | |||
2958 | #define IWL_TRAFFIC_DUMP_SIZE (IWL_TRAFFIC_ENTRY_SIZE * IWL_TRAFFIC_ENTRIES) | ||
2959 | |||
2960 | void iwl_reset_traffic_log(struct iwl_priv *priv) | ||
2961 | { | ||
2962 | priv->tx_traffic_idx = 0; | ||
2963 | priv->rx_traffic_idx = 0; | ||
2964 | if (priv->tx_traffic) | ||
2965 | memset(priv->tx_traffic, 0, IWL_TRAFFIC_DUMP_SIZE); | ||
2966 | if (priv->rx_traffic) | ||
2967 | memset(priv->rx_traffic, 0, IWL_TRAFFIC_DUMP_SIZE); | ||
2968 | } | ||
2969 | |||
2970 | int iwl_alloc_traffic_mem(struct iwl_priv *priv) | ||
2971 | { | ||
2972 | u32 traffic_size = IWL_TRAFFIC_DUMP_SIZE; | ||
2973 | |||
2974 | if (iwl_debug_level & IWL_DL_TX) { | ||
2975 | if (!priv->tx_traffic) { | ||
2976 | priv->tx_traffic = | ||
2977 | kzalloc(traffic_size, GFP_KERNEL); | ||
2978 | if (!priv->tx_traffic) | ||
2979 | return -ENOMEM; | ||
2980 | } | ||
2981 | } | ||
2982 | if (iwl_debug_level & IWL_DL_RX) { | ||
2983 | if (!priv->rx_traffic) { | ||
2984 | priv->rx_traffic = | ||
2985 | kzalloc(traffic_size, GFP_KERNEL); | ||
2986 | if (!priv->rx_traffic) | ||
2987 | return -ENOMEM; | ||
2988 | } | ||
2989 | } | ||
2990 | iwl_reset_traffic_log(priv); | ||
2991 | return 0; | ||
2992 | } | ||
2993 | EXPORT_SYMBOL(iwl_alloc_traffic_mem); | ||
2994 | |||
2995 | void iwl_free_traffic_mem(struct iwl_priv *priv) | ||
2996 | { | ||
2997 | kfree(priv->tx_traffic); | ||
2998 | priv->tx_traffic = NULL; | ||
2999 | |||
3000 | kfree(priv->rx_traffic); | ||
3001 | priv->rx_traffic = NULL; | ||
3002 | } | ||
3003 | EXPORT_SYMBOL(iwl_free_traffic_mem); | ||
3004 | |||
3005 | void iwl_dbg_log_tx_data_frame(struct iwl_priv *priv, | ||
3006 | u16 length, struct ieee80211_hdr *header) | ||
3007 | { | ||
3008 | __le16 fc; | ||
3009 | u16 len; | ||
3010 | |||
3011 | if (likely(!(iwl_debug_level & IWL_DL_TX))) | ||
3012 | return; | ||
3013 | |||
3014 | if (!priv->tx_traffic) | ||
3015 | return; | ||
3016 | |||
3017 | fc = header->frame_control; | ||
3018 | if (ieee80211_is_data(fc)) { | ||
3019 | len = (length > IWL_TRAFFIC_ENTRY_SIZE) | ||
3020 | ? IWL_TRAFFIC_ENTRY_SIZE : length; | ||
3021 | memcpy((priv->tx_traffic + | ||
3022 | (priv->tx_traffic_idx * IWL_TRAFFIC_ENTRY_SIZE)), | ||
3023 | header, len); | ||
3024 | priv->tx_traffic_idx = | ||
3025 | (priv->tx_traffic_idx + 1) % IWL_TRAFFIC_ENTRIES; | ||
3026 | } | ||
3027 | } | ||
3028 | EXPORT_SYMBOL(iwl_dbg_log_tx_data_frame); | ||
3029 | |||
3030 | void iwl_dbg_log_rx_data_frame(struct iwl_priv *priv, | ||
3031 | u16 length, struct ieee80211_hdr *header) | ||
3032 | { | ||
3033 | __le16 fc; | ||
3034 | u16 len; | ||
3035 | |||
3036 | if (likely(!(iwl_debug_level & IWL_DL_RX))) | ||
3037 | return; | ||
3038 | |||
3039 | if (!priv->rx_traffic) | ||
3040 | return; | ||
3041 | |||
3042 | fc = header->frame_control; | ||
3043 | if (ieee80211_is_data(fc)) { | ||
3044 | len = (length > IWL_TRAFFIC_ENTRY_SIZE) | ||
3045 | ? IWL_TRAFFIC_ENTRY_SIZE : length; | ||
3046 | memcpy((priv->rx_traffic + | ||
3047 | (priv->rx_traffic_idx * IWL_TRAFFIC_ENTRY_SIZE)), | ||
3048 | header, len); | ||
3049 | priv->rx_traffic_idx = | ||
3050 | (priv->rx_traffic_idx + 1) % IWL_TRAFFIC_ENTRIES; | ||
3051 | } | ||
3052 | } | ||
3053 | EXPORT_SYMBOL(iwl_dbg_log_rx_data_frame); | ||
3054 | #endif | ||
3055 | |||
2956 | #ifdef CONFIG_PM | 3056 | #ifdef CONFIG_PM |
2957 | 3057 | ||
2958 | int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) | 3058 | int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index dd66148a7899..40a9167cacce 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -300,7 +300,35 @@ void iwl_config_ap(struct iwl_priv *priv); | |||
300 | int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, | 300 | int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, |
301 | struct ieee80211_tx_queue_stats *stats); | 301 | struct ieee80211_tx_queue_stats *stats); |
302 | void iwl_mac_reset_tsf(struct ieee80211_hw *hw); | 302 | void iwl_mac_reset_tsf(struct ieee80211_hw *hw); |
303 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
304 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); | ||
305 | void iwl_free_traffic_mem(struct iwl_priv *priv); | ||
306 | void iwl_reset_traffic_log(struct iwl_priv *priv); | ||
307 | void iwl_dbg_log_tx_data_frame(struct iwl_priv *priv, | ||
308 | u16 length, struct ieee80211_hdr *header); | ||
309 | void iwl_dbg_log_rx_data_frame(struct iwl_priv *priv, | ||
310 | u16 length, struct ieee80211_hdr *header); | ||
303 | 311 | ||
312 | #else | ||
313 | static inline int iwl_alloc_traffic_mem(struct iwl_priv *priv) | ||
314 | { | ||
315 | return 0; | ||
316 | } | ||
317 | static inline void iwl_free_traffic_mem(struct iwl_priv *priv) | ||
318 | { | ||
319 | } | ||
320 | static inline void iwl_reset_traffic_log(struct iwl_priv *priv) | ||
321 | { | ||
322 | } | ||
323 | static inline void iwl_dbg_log_tx_data_frame(struct iwl_priv *priv, | ||
324 | u16 length, struct ieee80211_hdr *header) | ||
325 | { | ||
326 | } | ||
327 | static inline void iwl_dbg_log_rx_data_frame(struct iwl_priv *priv, | ||
328 | u16 length, struct ieee80211_hdr *header) | ||
329 | { | ||
330 | } | ||
331 | #endif | ||
304 | /***************************************************** | 332 | /***************************************************** |
305 | * RX handlers. | 333 | * RX handlers. |
306 | * **************************************************/ | 334 | * **************************************************/ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 09af046927ab..335ff5c43966 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h | |||
@@ -72,6 +72,7 @@ struct iwl_debugfs { | |||
72 | const char *name; | 72 | const char *name; |
73 | struct dentry *dir_drv; | 73 | struct dentry *dir_drv; |
74 | struct dentry *dir_data; | 74 | struct dentry *dir_data; |
75 | struct dentry *dir_debug; | ||
75 | struct dentry *dir_rf; | 76 | struct dentry *dir_rf; |
76 | struct dir_data_files { | 77 | struct dir_data_files { |
77 | struct dentry *file_sram; | 78 | struct dentry *file_sram; |
@@ -95,6 +96,9 @@ struct iwl_debugfs { | |||
95 | struct dentry *file_disable_chain_noise; | 96 | struct dentry *file_disable_chain_noise; |
96 | struct dentry *file_disable_tx_power; | 97 | struct dentry *file_disable_tx_power; |
97 | } dbgfs_rf_files; | 98 | } dbgfs_rf_files; |
99 | struct dir_debug_files { | ||
100 | struct dentry *file_traffic_log; | ||
101 | } dbgfs_debug_files; | ||
98 | u32 sram_offset; | 102 | u32 sram_offset; |
99 | u32 sram_len; | 103 | u32 sram_len; |
100 | }; | 104 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 6748a3fb9669..031538c42063 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -712,6 +712,104 @@ DEBUGFS_READ_FILE_OPS(led); | |||
712 | DEBUGFS_READ_FILE_OPS(thermal_throttling); | 712 | DEBUGFS_READ_FILE_OPS(thermal_throttling); |
713 | DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40); | 713 | DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40); |
714 | 714 | ||
715 | static ssize_t iwl_dbgfs_traffic_log_read(struct file *file, | ||
716 | char __user *user_buf, | ||
717 | size_t count, loff_t *ppos) | ||
718 | { | ||
719 | struct iwl_priv *priv = file->private_data; | ||
720 | int pos = 0, ofs = 0; | ||
721 | int cnt = 0, entry; | ||
722 | struct iwl_tx_queue *txq; | ||
723 | struct iwl_queue *q; | ||
724 | struct iwl_rx_queue *rxq = &priv->rxq; | ||
725 | char *buf; | ||
726 | int bufsz = ((IWL_TRAFFIC_ENTRIES * IWL_TRAFFIC_ENTRY_SIZE * 64) * 2) + | ||
727 | (IWL_MAX_NUM_QUEUES * 32 * 8) + 400; | ||
728 | const u8 *ptr; | ||
729 | ssize_t ret; | ||
730 | |||
731 | buf = kzalloc(bufsz, GFP_KERNEL); | ||
732 | if (!buf) { | ||
733 | IWL_ERR(priv, "Can not allocate buffer\n"); | ||
734 | return -ENOMEM; | ||
735 | } | ||
736 | pos += scnprintf(buf + pos, bufsz - pos, "Tx Queue\n"); | ||
737 | for (cnt = 0; cnt < priv->hw_params.max_txq_num; cnt++) { | ||
738 | txq = &priv->txq[cnt]; | ||
739 | q = &txq->q; | ||
740 | pos += scnprintf(buf + pos, bufsz - pos, | ||
741 | "q[%d]: read_ptr: %u, write_ptr: %u\n", | ||
742 | cnt, q->read_ptr, q->write_ptr); | ||
743 | } | ||
744 | if (priv->tx_traffic && (iwl_debug_level & IWL_DL_TX)) { | ||
745 | ptr = priv->tx_traffic; | ||
746 | pos += scnprintf(buf + pos, bufsz - pos, | ||
747 | "Tx Traffic idx: %u\n", priv->tx_traffic_idx); | ||
748 | for (cnt = 0, ofs = 0; cnt < IWL_TRAFFIC_ENTRIES; cnt++) { | ||
749 | for (entry = 0; entry < IWL_TRAFFIC_ENTRY_SIZE / 16; | ||
750 | entry++, ofs += 16) { | ||
751 | pos += scnprintf(buf + pos, bufsz - pos, | ||
752 | "0x%.4x ", ofs); | ||
753 | hex_dump_to_buffer(ptr + ofs, 16, 16, 2, | ||
754 | buf + pos, bufsz - pos, 0); | ||
755 | pos += strlen(buf); | ||
756 | if (bufsz - pos > 0) | ||
757 | buf[pos++] = '\n'; | ||
758 | } | ||
759 | } | ||
760 | } | ||
761 | |||
762 | pos += scnprintf(buf + pos, bufsz - pos, "Rx Queue\n"); | ||
763 | pos += scnprintf(buf + pos, bufsz - pos, | ||
764 | "read: %u, write: %u\n", | ||
765 | rxq->read, rxq->write); | ||
766 | |||
767 | if (priv->rx_traffic && (iwl_debug_level & IWL_DL_RX)) { | ||
768 | ptr = priv->rx_traffic; | ||
769 | pos += scnprintf(buf + pos, bufsz - pos, | ||
770 | "Rx Traffic idx: %u\n", priv->rx_traffic_idx); | ||
771 | for (cnt = 0, ofs = 0; cnt < IWL_TRAFFIC_ENTRIES; cnt++) { | ||
772 | for (entry = 0; entry < IWL_TRAFFIC_ENTRY_SIZE / 16; | ||
773 | entry++, ofs += 16) { | ||
774 | pos += scnprintf(buf + pos, bufsz - pos, | ||
775 | "0x%.4x ", ofs); | ||
776 | hex_dump_to_buffer(ptr + ofs, 16, 16, 2, | ||
777 | buf + pos, bufsz - pos, 0); | ||
778 | pos += strlen(buf); | ||
779 | if (bufsz - pos > 0) | ||
780 | buf[pos++] = '\n'; | ||
781 | } | ||
782 | } | ||
783 | } | ||
784 | |||
785 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
786 | kfree(buf); | ||
787 | return ret; | ||
788 | } | ||
789 | |||
790 | static ssize_t iwl_dbgfs_traffic_log_write(struct file *file, | ||
791 | const char __user *user_buf, | ||
792 | size_t count, loff_t *ppos) | ||
793 | { | ||
794 | struct iwl_priv *priv = file->private_data; | ||
795 | char buf[8]; | ||
796 | int buf_size; | ||
797 | int traffic_log; | ||
798 | |||
799 | memset(buf, 0, sizeof(buf)); | ||
800 | buf_size = min(count, sizeof(buf) - 1); | ||
801 | if (copy_from_user(buf, user_buf, buf_size)) | ||
802 | return -EFAULT; | ||
803 | if (sscanf(buf, "%d", &traffic_log) != 1) | ||
804 | return -EFAULT; | ||
805 | if (traffic_log == 0) | ||
806 | iwl_reset_traffic_log(priv); | ||
807 | |||
808 | return count; | ||
809 | } | ||
810 | |||
811 | DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); | ||
812 | |||
715 | /* | 813 | /* |
716 | * Create the debugfs files and directories | 814 | * Create the debugfs files and directories |
717 | * | 815 | * |
@@ -738,6 +836,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
738 | 836 | ||
739 | DEBUGFS_ADD_DIR(data, dbgfs->dir_drv); | 837 | DEBUGFS_ADD_DIR(data, dbgfs->dir_drv); |
740 | DEBUGFS_ADD_DIR(rf, dbgfs->dir_drv); | 838 | DEBUGFS_ADD_DIR(rf, dbgfs->dir_drv); |
839 | DEBUGFS_ADD_DIR(debug, dbgfs->dir_drv); | ||
741 | DEBUGFS_ADD_FILE(nvm, data); | 840 | DEBUGFS_ADD_FILE(nvm, data); |
742 | DEBUGFS_ADD_FILE(sram, data); | 841 | DEBUGFS_ADD_FILE(sram, data); |
743 | DEBUGFS_ADD_FILE(log_event, data); | 842 | DEBUGFS_ADD_FILE(log_event, data); |
@@ -753,6 +852,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
753 | #endif | 852 | #endif |
754 | DEBUGFS_ADD_FILE(thermal_throttling, data); | 853 | DEBUGFS_ADD_FILE(thermal_throttling, data); |
755 | DEBUGFS_ADD_FILE(disable_ht40, data); | 854 | DEBUGFS_ADD_FILE(disable_ht40, data); |
855 | DEBUGFS_ADD_FILE(traffic_log, debug); | ||
756 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); | 856 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); |
757 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, | 857 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, |
758 | &priv->disable_chain_noise_cal); | 858 | &priv->disable_chain_noise_cal); |
@@ -794,6 +894,8 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
794 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling); | 894 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling); |
795 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_disable_ht40); | 895 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_disable_ht40); |
796 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); | 896 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); |
897 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_traffic_log); | ||
898 | DEBUGFS_REMOVE(priv->dbgfs->dir_debug); | ||
797 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); | 899 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); |
798 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); | 900 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); |
799 | if (((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) || | 901 | if (((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) || |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 624656a2bbaa..899b75f28a23 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -877,6 +877,8 @@ struct iwl_chain_noise_data { | |||
877 | #define EEPROM_SEM_TIMEOUT 10 /* milliseconds */ | 877 | #define EEPROM_SEM_TIMEOUT 10 /* milliseconds */ |
878 | #define EEPROM_SEM_RETRY_LIMIT 1000 /* number of attempts (not time) */ | 878 | #define EEPROM_SEM_RETRY_LIMIT 1000 /* number of attempts (not time) */ |
879 | 879 | ||
880 | #define IWL_TRAFFIC_ENTRIES (256) | ||
881 | #define IWL_TRAFFIC_ENTRY_SIZE (64) | ||
880 | 882 | ||
881 | enum { | 883 | enum { |
882 | MEASUREMENT_READY = (1 << 0), | 884 | MEASUREMENT_READY = (1 << 0), |
@@ -1182,6 +1184,10 @@ struct iwl_priv { | |||
1182 | bool disable_ht40; | 1184 | bool disable_ht40; |
1183 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 1185 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
1184 | /* debugfs */ | 1186 | /* debugfs */ |
1187 | u16 tx_traffic_idx; | ||
1188 | u16 rx_traffic_idx; | ||
1189 | u8 *tx_traffic; | ||
1190 | u8 *rx_traffic; | ||
1185 | struct iwl_debugfs *dbgfs; | 1191 | struct iwl_debugfs *dbgfs; |
1186 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ | 1192 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ |
1187 | #endif /* CONFIG_IWLWIFI_DEBUG */ | 1193 | #endif /* CONFIG_IWLWIFI_DEBUG */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index 9e63f9d149ed..55860037f98a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -1063,6 +1063,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, | |||
1063 | if (unlikely(iwl_get_debug_level(priv) & IWL_DL_RX)) | 1063 | if (unlikely(iwl_get_debug_level(priv) & IWL_DL_RX)) |
1064 | iwl_dbg_report_frame(priv, rx_start, len, header, 1); | 1064 | iwl_dbg_report_frame(priv, rx_start, len, header, 1); |
1065 | #endif | 1065 | #endif |
1066 | iwl_dbg_log_rx_data_frame(priv, len, header); | ||
1066 | IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, noise %d, qual %d, TSF %llu\n", | 1067 | IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, noise %d, qual %d, TSF %llu\n", |
1067 | rx_status.signal, rx_status.noise, rx_status.qual, | 1068 | rx_status.signal, rx_status.noise, rx_status.qual, |
1068 | (unsigned long long)rx_status.mactime); | 1069 | (unsigned long long)rx_status.mactime); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 0cac06c43f9a..c85e54cb31d2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -808,6 +808,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
808 | 808 | ||
809 | /* TODO need this for burst mode later on */ | 809 | /* TODO need this for burst mode later on */ |
810 | iwl_tx_cmd_build_basic(priv, tx_cmd, info, hdr, sta_id); | 810 | iwl_tx_cmd_build_basic(priv, tx_cmd, info, hdr, sta_id); |
811 | iwl_dbg_log_tx_data_frame(priv, len, hdr); | ||
811 | 812 | ||
812 | /* set is_hcca to 0; it probably will never be implemented */ | 813 | /* set is_hcca to 0; it probably will never be implemented */ |
813 | iwl_tx_cmd_build_rate(priv, tx_cmd, info, fc, sta_id, 0); | 814 | iwl_tx_cmd_build_rate(priv, tx_cmd, info, fc, sta_id, 0); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 0babce250ea4..4f5a3d035b0e 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -598,7 +598,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
598 | len = (u16)skb->len; | 598 | len = (u16)skb->len; |
599 | tx->len = cpu_to_le16(len); | 599 | tx->len = cpu_to_le16(len); |
600 | 600 | ||
601 | 601 | iwl_dbg_log_tx_data_frame(priv, len, hdr); | |
602 | tx->tx_flags &= ~TX_CMD_FLG_ANT_A_MSK; | 602 | tx->tx_flags &= ~TX_CMD_FLG_ANT_A_MSK; |
603 | tx->tx_flags &= ~TX_CMD_FLG_ANT_B_MSK; | 603 | tx->tx_flags &= ~TX_CMD_FLG_ANT_B_MSK; |
604 | 604 | ||
@@ -3332,9 +3332,12 @@ static ssize_t store_debug_level(struct device *d, | |||
3332 | ret = strict_strtoul(buf, 0, &val); | 3332 | ret = strict_strtoul(buf, 0, &val); |
3333 | if (ret) | 3333 | if (ret) |
3334 | IWL_INFO(priv, "%s is not in hex or decimal form.\n", buf); | 3334 | IWL_INFO(priv, "%s is not in hex or decimal form.\n", buf); |
3335 | else | 3335 | else { |
3336 | priv->debug_level = val; | 3336 | priv->debug_level = val; |
3337 | 3337 | if (iwl_alloc_traffic_mem(priv)) | |
3338 | IWL_ERR(priv, | ||
3339 | "Not enough memory to generate traffic log\n"); | ||
3340 | } | ||
3338 | return strnlen(buf, count); | 3341 | return strnlen(buf, count); |
3339 | } | 3342 | } |
3340 | 3343 | ||
@@ -3976,6 +3979,8 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
3976 | #ifdef CONFIG_IWLWIFI_DEBUG | 3979 | #ifdef CONFIG_IWLWIFI_DEBUG |
3977 | atomic_set(&priv->restrict_refcnt, 0); | 3980 | atomic_set(&priv->restrict_refcnt, 0); |
3978 | #endif | 3981 | #endif |
3982 | if (iwl_alloc_traffic_mem(priv)) | ||
3983 | IWL_ERR(priv, "Not enough memory to generate traffic log\n"); | ||
3979 | 3984 | ||
3980 | /*************************** | 3985 | /*************************** |
3981 | * 2. Initializing PCI bus | 3986 | * 2. Initializing PCI bus |
@@ -4138,6 +4143,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
4138 | pci_disable_device(pdev); | 4143 | pci_disable_device(pdev); |
4139 | out_ieee80211_free_hw: | 4144 | out_ieee80211_free_hw: |
4140 | ieee80211_free_hw(priv->hw); | 4145 | ieee80211_free_hw(priv->hw); |
4146 | iwl_free_traffic_mem(priv); | ||
4141 | out: | 4147 | out: |
4142 | return err; | 4148 | return err; |
4143 | } | 4149 | } |
@@ -4193,6 +4199,7 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) | |||
4193 | * until now... */ | 4199 | * until now... */ |
4194 | destroy_workqueue(priv->workqueue); | 4200 | destroy_workqueue(priv->workqueue); |
4195 | priv->workqueue = NULL; | 4201 | priv->workqueue = NULL; |
4202 | iwl_free_traffic_mem(priv); | ||
4196 | 4203 | ||
4197 | free_irq(pdev->irq, priv); | 4204 | free_irq(pdev->irq, priv); |
4198 | pci_disable_msi(pdev); | 4205 | pci_disable_msi(pdev); |