Skip to content

Commit

Permalink
iwlwifi: Add debugfs to iwl core
Browse files Browse the repository at this point in the history
This patch adds debugfs support to iwl core
currently only iwl4965 is supported

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Tomas Winkler authored and John W. Linville committed Mar 25, 2008
1 parent 19758be commit 712b6cf
Show file tree
Hide file tree
Showing 7 changed files with 377 additions and 6 deletions.
6 changes: 6 additions & 0 deletions drivers/net/wireless/iwlwifi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ config IWLWIFI_DEBUG
as the debug information can assist others in helping you resolve
any problems you may encounter.

config IWLWIFI_DEBUGFS
bool "Iwlwifi debugfs support"
depends on IWLCORE && IWLWIFI_DEBUG && MAC80211_DEBUGFS
---help---
Enable creation of debugfs files for the iwlwifi drivers.

config IWL3945
tristate "Intel PRO/Wireless 3945ABG/BG Network Connection"
depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/iwlwifi/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
obj-$(CONFIG_IWLCORE) += iwlcore.o
iwlcore-objs = iwl-core.o iwl-eeprom.o

ifeq ($(CONFIG_IWLWIFI_DEBUGFS),y)
iwlcore-objs += iwl-debugfs.o
endif

obj-$(CONFIG_IWL3945) += iwl3945.o
iwl3945-objs = iwl3945-base.o iwl-3945.o iwl-3945-rs.o

Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-4965.h
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,11 @@ struct iwl_priv {
/* debugging info */
u32 framecnt_to_us;
atomic_t restrict_refcnt;
#endif
#ifdef CONFIG_IWLWIFI_DEBUGFS
/* debugfs */
struct iwl_debugfs *dbgfs;
#endif /* CONFIG_IWLWIFI_DEBUGFS */
#endif /* CONFIG_IWLWIFI_DEBUG */

struct work_struct txpower_work;
#ifdef CONFIG_IWL4965_SENSITIVITY
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
#include <linux/module.h>
#include <linux/version.h>

struct iwl_priv; /* FIXME: remove */
#include "iwl-debug.h"
#include "iwl-eeprom.h"
#include "iwl-core.h"

MODULE_DESCRIPTION("iwl core");
MODULE_VERSION(IWLWIFI_VERSION);
MODULE_AUTHOR(DRV_COPYRIGHT);
MODULE_LICENSE("GPL/BSD");
MODULE_LICENSE("GPL");

#ifdef CONFIG_IWLWIFI_DEBUG
u32 iwl_debug_level;
Expand Down
31 changes: 30 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,27 @@ static inline void iwl_print_hex_dump(int level, void *p, u32 len)
print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1,
p, len, 1);
}
#else

#ifdef CONFIG_IWLWIFI_DEBUGFS
struct iwl_debugfs {
const char *name;
struct dentry *dir_drv;
struct dentry *dir_data;
struct dir_data_files{
struct dentry *file_sram;
struct dentry *file_stations;
struct dentry *file_rx_statistics;
struct dentry *file_tx_statistics;
} dbgfs_data_files;
u32 sram_offset;
u32 sram_len;
};

int iwl_dbgfs_register(struct iwl_priv *priv, const char *name);
void iwl_dbgfs_unregister(struct iwl_priv *priv);
#endif

#else
static inline void IWL_DEBUG(int level, const char *fmt, ...)
{
}
Expand All @@ -64,6 +83,16 @@ static inline void iwl_print_hex_dump(int level, void *p, u32 len)



#ifndef CONFIG_IWLWIFI_DEBUGFS
static inline int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
{
return 0;
}
static inline void iwl_dbgfs_unregister(struct iwl_priv *priv)
{
}
#endif /* CONFIG_IWLWIFI_DEBUGFS */

/*
* To use the debug system;
*
Expand Down
Loading

0 comments on commit 712b6cf

Please sign in to comment.