diff options
author | John Soni Jose <sony.john-n@emulex.com> | 2012-08-20 13:30:18 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-14 12:59:27 -0400 |
commit | 99bc5d55c06cbf9ac2d8ab7fb8348c4abce5fbaf (patch) | |
tree | fbee8df63f7a62916e93fcbae5f3e0cc9d103735 /drivers/scsi/be2iscsi/be_main.h | |
parent | 9aef4200ee25636edd77b022f996b6f5870ce567 (diff) |
[SCSI] be2iscsi: Added Logging mechanism for the driver.
Added new log level mechanism for different events. These
log levels can be set at driver load time/run time. The
log level is set for each Scsi_host.
Fixed few multi-line print warning to get over the new checkpatch.pl
warnings on multi-line strings.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.h')
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.h | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index 8b2ce610b06d..084386cc5672 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/pci.h> | 24 | #include <linux/pci.h> |
25 | #include <linux/if_ether.h> | 25 | #include <linux/if_ether.h> |
26 | #include <linux/in.h> | 26 | #include <linux/in.h> |
27 | #include <linux/ctype.h> | ||
28 | #include <linux/module.h> | ||
27 | #include <scsi/scsi.h> | 29 | #include <scsi/scsi.h> |
28 | #include <scsi/scsi_cmnd.h> | 30 | #include <scsi/scsi_cmnd.h> |
29 | #include <scsi/scsi_device.h> | 31 | #include <scsi/scsi_device.h> |
@@ -85,23 +87,6 @@ | |||
85 | #define IIOC_SCSI_DATA 0x05 /* Write Operation */ | 87 | #define IIOC_SCSI_DATA 0x05 /* Write Operation */ |
86 | 88 | ||
87 | #define INVALID_SESS_HANDLE 0xFFFFFFFF | 89 | #define INVALID_SESS_HANDLE 0xFFFFFFFF |
88 | #define DBG_LVL 0x00000001 | ||
89 | #define DBG_LVL_1 0x00000001 | ||
90 | #define DBG_LVL_2 0x00000002 | ||
91 | #define DBG_LVL_3 0x00000004 | ||
92 | #define DBG_LVL_4 0x00000008 | ||
93 | #define DBG_LVL_5 0x00000010 | ||
94 | #define DBG_LVL_6 0x00000020 | ||
95 | #define DBG_LVL_7 0x00000040 | ||
96 | #define DBG_LVL_8 0x00000080 | ||
97 | |||
98 | #define SE_DEBUG(debug_mask, fmt, args...) \ | ||
99 | do { \ | ||
100 | if (debug_mask & DBG_LVL) { \ | ||
101 | printk(KERN_ERR "(%s():%d):", __func__, __LINE__);\ | ||
102 | printk(fmt, ##args); \ | ||
103 | } \ | ||
104 | } while (0); | ||
105 | 90 | ||
106 | #define BE_ADAPTER_UP 0x00000000 | 91 | #define BE_ADAPTER_UP 0x00000000 |
107 | #define BE_ADAPTER_LINK_DOWN 0x00000001 | 92 | #define BE_ADAPTER_LINK_DOWN 0x00000001 |
@@ -352,6 +337,8 @@ struct beiscsi_hba { | |||
352 | struct mgmt_session_info boot_sess; | 337 | struct mgmt_session_info boot_sess; |
353 | struct invalidate_command_table inv_tbl[128]; | 338 | struct invalidate_command_table inv_tbl[128]; |
354 | 339 | ||
340 | unsigned int attr_log_enable; | ||
341 | |||
355 | }; | 342 | }; |
356 | 343 | ||
357 | struct beiscsi_session { | 344 | struct beiscsi_session { |
@@ -861,4 +848,20 @@ struct hwi_context_memory { | |||
861 | struct hwi_async_pdu_context *pasync_ctx; | 848 | struct hwi_async_pdu_context *pasync_ctx; |
862 | }; | 849 | }; |
863 | 850 | ||
851 | /* Logging related definitions */ | ||
852 | #define BEISCSI_LOG_INIT 0x0001 /* Initialization events */ | ||
853 | #define BEISCSI_LOG_MBOX 0x0002 /* Mailbox Events */ | ||
854 | #define BEISCSI_LOG_MISC 0x0004 /* Miscllaneous Events */ | ||
855 | #define BEISCSI_LOG_EH 0x0008 /* Error Handler */ | ||
856 | #define BEISCSI_LOG_IO 0x0010 /* IO Code Path */ | ||
857 | #define BEISCSI_LOG_CONFIG 0x0020 /* CONFIG Code Path */ | ||
858 | |||
859 | #define beiscsi_log(phba, level, mask, fmt, arg...) \ | ||
860 | do { \ | ||
861 | uint32_t log_value = phba->attr_log_enable; \ | ||
862 | if (((mask) & log_value) || (level[1] <= '3')) \ | ||
863 | shost_printk(level, phba->shost, \ | ||
864 | fmt, __LINE__, ##arg); \ | ||
865 | } while (0) | ||
866 | |||
864 | #endif | 867 | #endif |