]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/be2iscsi/be_main.h
[SCSI] be2iscsi: Added Logging mechanism for the driver.
[karo-tx-linux.git] / drivers / scsi / be2iscsi / be_main.h
index 8b2ce610b06de1c7b5042d465cf7100a05a3b4df..084386cc56729b8de79d6e3d58aacc6d6d58a6ab 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/pci.h>
 #include <linux/if_ether.h>
 #include <linux/in.h>
+#include <linux/ctype.h>
+#include <linux/module.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
 #define IIOC_SCSI_DATA                  0x05   /* Write Operation */
 
 #define INVALID_SESS_HANDLE    0xFFFFFFFF
-#define DBG_LVL                                0x00000001
-#define DBG_LVL_1                      0x00000001
-#define DBG_LVL_2                      0x00000002
-#define DBG_LVL_3                      0x00000004
-#define DBG_LVL_4                      0x00000008
-#define DBG_LVL_5                      0x00000010
-#define DBG_LVL_6                      0x00000020
-#define DBG_LVL_7                      0x00000040
-#define DBG_LVL_8                      0x00000080
-
-#define SE_DEBUG(debug_mask, fmt, args...)             \
-do {                                                   \
-       if (debug_mask & DBG_LVL) {                     \
-               printk(KERN_ERR "(%s():%d):", __func__, __LINE__);\
-               printk(fmt, ##args);                    \
-       }                                               \
-} while (0);
 
 #define BE_ADAPTER_UP          0x00000000
 #define BE_ADAPTER_LINK_DOWN   0x00000001
@@ -352,6 +337,8 @@ struct beiscsi_hba {
        struct mgmt_session_info boot_sess;
        struct invalidate_command_table inv_tbl[128];
 
+       unsigned int attr_log_enable;
+
 };
 
 struct beiscsi_session {
@@ -861,4 +848,20 @@ struct hwi_context_memory {
        struct hwi_async_pdu_context *pasync_ctx;
 };
 
+/* Logging related definitions */
+#define BEISCSI_LOG_INIT       0x0001  /* Initialization events */
+#define BEISCSI_LOG_MBOX       0x0002  /* Mailbox Events */
+#define BEISCSI_LOG_MISC       0x0004  /* Miscllaneous Events */
+#define BEISCSI_LOG_EH         0x0008  /* Error Handler */
+#define BEISCSI_LOG_IO         0x0010  /* IO Code Path */
+#define BEISCSI_LOG_CONFIG     0x0020  /* CONFIG Code Path */
+
+#define beiscsi_log(phba, level, mask, fmt, arg...) \
+do { \
+       uint32_t log_value = phba->attr_log_enable; \
+               if (((mask) & log_value) || (level[1] <= '3')) \
+                       shost_printk(level, phba->shost, \
+                                    fmt, __LINE__, ##arg); \
+} while (0)
+
 #endif