1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#define LOG_ELS 0x00000001
24#define LOG_DISCOVERY 0x00000002
25#define LOG_MBOX 0x00000004
26#define LOG_INIT 0x00000008
27#define LOG_LINK_EVENT 0x00000010
28#define LOG_IP 0x00000020
29#define LOG_FCP 0x00000040
30#define LOG_NODE 0x00000080
31#define LOG_TEMP 0x00000100
32#define LOG_BG 0x00000200
33#define LOG_MISC 0x00000400
34#define LOG_SLI 0x00000800
35#define LOG_FCP_ERROR 0x00001000
36#define LOG_LIBDFC 0x00002000
37#define LOG_VPORT 0x00004000
38#define LOG_SECURITY 0x00008000
39#define LOG_EVENT 0x00010000
40#define LOG_FIP 0x00020000
41#define LOG_FCP_UNDER 0x00040000
42#define LOG_SCSI_CMD 0x00080000
43#define LOG_NVME 0x00100000
44#define LOG_NVME_DISC 0x00200000
45#define LOG_NVME_ABTS 0x00400000
46#define LOG_NVME_IOERR 0x00800000
47#define LOG_TRACE_EVENT 0x80000000
48#define LOG_ALL_MSG 0x7fffffff
49
50void lpfc_dmp_dbg(struct lpfc_hba *phba);
51void lpfc_dbg_print(struct lpfc_hba *phba, const char *fmt, ...);
52
53
54#define lpfc_vlog_msg(vport, level, mask, fmt, arg...) \
55{ if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '4')) \
56 dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \
57 fmt, (vport)->phba->brd_no, vport->vpi, ##arg); }
58
59#define lpfc_log_msg(phba, level, mask, fmt, arg...) \
60do { \
61 { uint32_t log_verbose = (phba)->pport ? \
62 (phba)->pport->cfg_log_verbose : \
63 (phba)->cfg_log_verbose; \
64 if (((mask) & log_verbose) || (level[1] <= '4')) \
65 dev_printk(level, &((phba)->pcidev)->dev, "%d:" \
66 fmt, phba->brd_no, ##arg); \
67 } \
68} while (0)
69
70#define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \
71do { \
72 { if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '3')) { \
73 if ((mask) & LOG_TRACE_EVENT) \
74 lpfc_dmp_dbg((vport)->phba); \
75 dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \
76 fmt, (vport)->phba->brd_no, vport->vpi, ##arg); \
77 } else if (!(vport)->cfg_log_verbose) \
78 lpfc_dbg_print((vport)->phba, "%d:(%d):" fmt, \
79 (vport)->phba->brd_no, (vport)->vpi, ##arg); \
80 } \
81} while (0)
82
83#define lpfc_printf_log(phba, level, mask, fmt, arg...) \
84do { \
85 { uint32_t log_verbose = (phba)->pport ? \
86 (phba)->pport->cfg_log_verbose : \
87 (phba)->cfg_log_verbose; \
88 if (((mask) & log_verbose) || (level[1] <= '3')) { \
89 if ((mask) & LOG_TRACE_EVENT) \
90 lpfc_dmp_dbg(phba); \
91 dev_printk(level, &((phba)->pcidev)->dev, "%d:" \
92 fmt, phba->brd_no, ##arg); \
93 } else if (!(phba)->cfg_log_verbose)\
94 lpfc_dbg_print(phba, "%d:" fmt, phba->brd_no, ##arg); \
95 } \
96} while (0)
97