iwlwifi: retfactor get_temperature functions
[safe/jmp/linux-2.6] / drivers / net / wireless / iwlwifi / iwl-debug.h
index 0677006..5838480 100644 (file)
 #define __iwl_debug_h__
 
 #ifdef CONFIG_IWLWIFI_DEBUG
-extern u32 iwl_debug_level;
 #define IWL_DEBUG(level, fmt, args...) \
-do { if (iwl_debug_level & (level)) \
-  printk(KERN_ERR DRV_NAME": %c %s " fmt, \
+do { if (priv->debug_level & (level)) \
+  dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \
         in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
 
 #define IWL_DEBUG_LIMIT(level, fmt, args...) \
-do { if ((iwl_debug_level & (level)) && net_ratelimit()) \
-  printk(KERN_ERR DRV_NAME": %c %s " fmt, \
+do { if ((priv->debug_level & (level)) && net_ratelimit()) \
+  dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%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;
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+struct iwl_debugfs {
+       const char *name;
+       struct dentry *dir_drv;
+       struct dentry *dir_data;
+       struct dentry *dir_rf;
+       struct dir_data_files {
+               struct dentry *file_sram;
+               struct dentry *file_eeprom;
+               struct dentry *file_stations;
+               struct dentry *file_rx_statistics;
+               struct dentry *file_tx_statistics;
+               struct dentry *file_log_event;
+       } dbgfs_data_files;
+       struct dir_rf_files {
+               struct dentry *file_disable_sensitivity;
+               struct dentry *file_disable_chain_noise;
+               struct dentry *file_disable_tx_power;
+       } dbgfs_rf_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
 
-       print_hex_dump(KERN_DEBUG, "iwl data: ", DUMP_PREFIX_OFFSET, 16, 1,
-                       p, len, 1);
-}
 #else
-
 static inline void IWL_DEBUG(int level, const char *fmt, ...)
 {
 }
 static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...)
 {
 }
-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;
  *