diff options
Diffstat (limited to '')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h (renamed from drivers/net/wireless/iwlwifi/iwl-4965-debug.h) | 65 |
1 files changed, 55 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 36696bbf170c..c60724c21db8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved. + * Copyright(c) 2003 - 2008 Intel Corporation. All rights reserved. * * Portions of this file are derived from the ipw3945 project. * @@ -26,20 +26,49 @@ * *****************************************************************************/ -#ifndef __iwl4965_debug_h__ -#define __iwl4965_debug_h__ +#ifndef __iwl_debug_h__ +#define __iwl_debug_h__ -#ifdef CONFIG_IWL4965_DEBUG -extern u32 iwl4965_debug_level; +#ifdef CONFIG_IWLWIFI_DEBUG +extern u32 iwl_debug_level; #define IWL_DEBUG(level, fmt, args...) \ -do { if (iwl4965_debug_level & (level)) \ +do { if (iwl_debug_level & (level)) \ printk(KERN_ERR DRV_NAME": %c %s " fmt, \ in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) #define IWL_DEBUG_LIMIT(level, fmt, args...) \ -do { if ((iwl4965_debug_level & (level)) && net_ratelimit()) \ +do { if ((iwl_debug_level & (level)) && net_ratelimit()) \ printk(KERN_ERR DRV_NAME": %c %s " fmt, \ in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) + +static inline void iwl_print_hex_dump(int level, void *p, u32 len) +{ + if (!(iwl_debug_level & level)) + return; + + print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1, + p, len, 1); +} + +#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, ...) { @@ -47,7 +76,22 @@ static inline void IWL_DEBUG(int level, const char *fmt, ...) static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...) { } -#endif /* CONFIG_IWL4965_DEBUG */ +static inline void iwl_print_hex_dump(int level, void *p, u32 len) +{ +} +#endif /* CONFIG_IWLWIFI_DEBUG */ + + + +#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; @@ -68,10 +112,10 @@ static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...) * * % cat /proc/net/iwl/debug_level * - * you simply need to add your entry to the iwl4965_debug_levels array. + * you simply need to add your entry to the iwl_debug_levels array. * * If you do not see debug_level in /proc/net/iwl then you do not have - * CONFIG_IWL4965_DEBUG defined in your kernel configuration + * CONFIG_IWLWIFI_DEBUG defined in your kernel configuration * */ @@ -143,6 +187,7 @@ static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...) IWL_DEBUG_LIMIT(IWL_DL_ASSOC | IWL_DL_INFO, f, ## a) #define IWL_DEBUG_HT(f, a...) IWL_DEBUG(IWL_DL_HT, f, ## a) #define IWL_DEBUG_STATS(f, a...) IWL_DEBUG(IWL_DL_STATS, f, ## a) +#define IWL_DEBUG_STATS_LIMIT(f, a...) IWL_DEBUG_LIMIT(IWL_DL_STATS, f, ## a) #define IWL_DEBUG_TX_REPLY(f, a...) IWL_DEBUG(IWL_DL_TX_REPLY, f, ## a) #define IWL_DEBUG_QOS(f, a...) IWL_DEBUG(IWL_DL_QOS, f, ## a) #define IWL_DEBUG_RADIO(f, a...) IWL_DEBUG(IWL_DL_RADIO, f, ## a) |