diff options
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/fc_encode.h | 2 | ||||
-rw-r--r-- | include/scsi/libfc.h | 77 | ||||
-rw-r--r-- | include/scsi/libiscsi.h | 4 | ||||
-rw-r--r-- | include/scsi/scsi_driver.h | 1 |
4 files changed, 71 insertions, 13 deletions
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h index 6300f556bce5..a0ff61c3e935 100644 --- a/include/scsi/fc_encode.h +++ b/include/scsi/fc_encode.h | |||
@@ -107,7 +107,6 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, | |||
107 | break; | 107 | break; |
108 | 108 | ||
109 | default: | 109 | default: |
110 | FC_DBG("Invalid op code %x \n", op); | ||
111 | return -EINVAL; | 110 | return -EINVAL; |
112 | } | 111 | } |
113 | *r_ctl = FC_RCTL_DD_UNSOL_CTL; | 112 | *r_ctl = FC_RCTL_DD_UNSOL_CTL; |
@@ -298,7 +297,6 @@ static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport, | |||
298 | break; | 297 | break; |
299 | 298 | ||
300 | default: | 299 | default: |
301 | FC_DBG("Invalid op code %x \n", op); | ||
302 | return -EINVAL; | 300 | return -EINVAL; |
303 | } | 301 | } |
304 | 302 | ||
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index ebdd9f4cf070..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 |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 196525cd402f..61afeb59a836 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -125,6 +125,10 @@ struct iscsi_task { | |||
125 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ | 125 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ |
126 | struct iscsi_conn *conn; /* used connection */ | 126 | struct iscsi_conn *conn; /* used connection */ |
127 | 127 | ||
128 | /* data processing tracking */ | ||
129 | unsigned long last_xfer; | ||
130 | unsigned long last_timeout; | ||
131 | bool have_checked_conn; | ||
128 | /* state set/tested under session->lock */ | 132 | /* state set/tested under session->lock */ |
129 | int state; | 133 | int state; |
130 | atomic_t refcount; | 134 | atomic_t refcount; |
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h index 1f5ca7f62116..9fd6702f02e2 100644 --- a/include/scsi/scsi_driver.h +++ b/include/scsi/scsi_driver.h | |||
@@ -32,5 +32,6 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req); | |||
32 | int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req); | 32 | int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req); |
33 | int scsi_prep_state_check(struct scsi_device *sdev, struct request *req); | 33 | int scsi_prep_state_check(struct scsi_device *sdev, struct request *req); |
34 | int scsi_prep_return(struct request_queue *q, struct request *req, int ret); | 34 | int scsi_prep_return(struct request_queue *q, struct request *req, int ret); |
35 | int scsi_prep_fn(struct request_queue *, struct request *); | ||
35 | 36 | ||
36 | #endif /* _SCSI_SCSI_DRIVER_H */ | 37 | #endif /* _SCSI_SCSI_DRIVER_H */ |