diff options
Diffstat (limited to 'include/scsi/libfc.h')
-rw-r--r-- | include/scsi/libfc.h | 78 |
1 files changed, 67 insertions, 11 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 45f9cc642c46..b92584a8843a 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -34,17 +34,72 @@ | |||
34 | 34 | ||
35 | #include <scsi/fc_frame.h> | 35 | #include <scsi/fc_frame.h> |
36 | 36 | ||
37 | #define LIBFC_DEBUG | 37 | #define FC_LIBFC_LOGGING 0x01 /* General logging, not categorized */ |
38 | 38 | #define FC_LPORT_LOGGING 0x02 /* lport layer logging */ | |
39 | #ifdef LIBFC_DEBUG | 39 | #define FC_DISC_LOGGING 0x04 /* discovery layer logging */ |
40 | /* Log messages */ | 40 | #define FC_RPORT_LOGGING 0x08 /* rport layer logging */ |
41 | #define FC_DBG(fmt, args...) \ | 41 | #define FC_FCP_LOGGING 0x10 /* I/O path logging */ |
42 | do { \ | 42 | #define FC_EM_LOGGING 0x20 /* Exchange Manager logging */ |
43 | printk(KERN_INFO "%s " fmt, __func__, ##args); \ | 43 | #define FC_EXCH_LOGGING 0x40 /* Exchange/Sequence logging */ |
44 | } while (0) | 44 | #define FC_SCSI_LOGGING 0x80 /* SCSI logging (mostly error handling) */ |
45 | #else | 45 | |
46 | #define FC_DBG(fmt, args...) | 46 | extern unsigned int fc_debug_logging; |
47 | #endif | 47 | |
48 | #define FC_CHECK_LOGGING(LEVEL, CMD) \ | ||
49 | do { \ | ||
50 | if (unlikely(fc_debug_logging & LEVEL)) \ | ||
51 | do { \ | ||
52 | CMD; \ | ||
53 | } while (0); \ | ||
54 | } while (0); | ||
55 | |||
56 | #define FC_LIBFC_DBG(fmt, args...) \ | ||
57 | FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \ | ||
58 | printk(KERN_INFO "libfc: " fmt, ##args);) | ||
59 | |||
60 | #define FC_LPORT_DBG(lport, fmt, args...) \ | ||
61 | FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ | ||
62 | printk(KERN_INFO "lport: %6x: " fmt, \ | ||
63 | fc_host_port_id(lport->host), ##args);) | ||
64 | |||
65 | #define FC_DISC_DBG(disc, fmt, args...) \ | ||
66 | FC_CHECK_LOGGING(FC_DISC_LOGGING, \ | ||
67 | printk(KERN_INFO "disc: %6x: " fmt, \ | ||
68 | fc_host_port_id(disc->lport->host), \ | ||
69 | ##args);) | ||
70 | |||
71 | #define FC_RPORT_DBG(rport, fmt, args...) \ | ||
72 | do { \ | ||
73 | struct fc_rport_libfc_priv *rdata = rport->dd_data; \ | ||
74 | struct fc_lport *lport = rdata->local_port; \ | ||
75 | FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ | ||
76 | printk(KERN_INFO "rport: %6x: %6x: " fmt, \ | ||
77 | fc_host_port_id(lport->host), \ | ||
78 | rport->port_id, ##args);) \ | ||
79 | } while (0); | ||
80 | |||
81 | #define FC_FCP_DBG(pkt, fmt, args...) \ | ||
82 | FC_CHECK_LOGGING(FC_FCP_LOGGING, \ | ||
83 | printk(KERN_INFO "fcp: %6x: %6x: " fmt, \ | ||
84 | fc_host_port_id(pkt->lp->host), \ | ||
85 | pkt->rport->port_id, ##args);) | ||
86 | |||
87 | #define FC_EM_DBG(em, fmt, args...) \ | ||
88 | FC_CHECK_LOGGING(FC_EM_LOGGING, \ | ||
89 | printk(KERN_INFO "em: %6x: " fmt, \ | ||
90 | fc_host_port_id(em->lp->host), \ | ||
91 | ##args);) | ||
92 | |||
93 | #define FC_EXCH_DBG(exch, fmt, args...) \ | ||
94 | FC_CHECK_LOGGING(FC_EXCH_LOGGING, \ | ||
95 | printk(KERN_INFO "exch: %6x: %4x: " fmt, \ | ||
96 | fc_host_port_id(exch->lp->host), \ | ||
97 | exch->xid, ##args);) | ||
98 | |||
99 | #define FC_SCSI_DBG(lport, fmt, args...) \ | ||
100 | FC_CHECK_LOGGING(FC_SCSI_LOGGING, \ | ||
101 | printk(KERN_INFO "scsi: %6x: " fmt, \ | ||
102 | fc_host_port_id(lport->host), ##args);) | ||
48 | 103 | ||
49 | /* | 104 | /* |
50 | * libfc error codes | 105 | * libfc error codes |
@@ -679,6 +734,7 @@ struct fc_lport { | |||
679 | unsigned int e_d_tov; | 734 | unsigned int e_d_tov; |
680 | unsigned int r_a_tov; | 735 | unsigned int r_a_tov; |
681 | u8 max_retry_count; | 736 | u8 max_retry_count; |
737 | u8 max_rport_retry_count; | ||
682 | u16 link_speed; | 738 | u16 link_speed; |
683 | u16 link_supported_speeds; | 739 | u16 link_supported_speeds; |
684 | u16 lro_xid; /* max xid for fcoe lro */ | 740 | u16 lro_xid; /* max xid for fcoe lro */ |