aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_dbf.h
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2009-08-18 09:43:21 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-05 09:49:30 -0400
commit5771710bd5edfafcb8656f49b93690a6fae5a4d2 (patch)
treef7ca88bc0f3d780794aa564855c0ed0ddeb9af18 /drivers/s390/scsi/zfcp_dbf.h
parent799b76d09aeee558d18c1f5b93e63f58f1d1fc11 (diff)
[SCSI] zfcp: Update dbf calls
Change the dbf data and functions to use the zfcp_dbf prefix throughout the code. Also change the calls to dbf to use zfcp_dbf instead of zfcp_adapter. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.h')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.h152
1 files changed, 73 insertions, 79 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h
index bceaff449033..6b1461e8f847 100644
--- a/drivers/s390/scsi/zfcp_dbf.h
+++ b/drivers/s390/scsi/zfcp_dbf.h
@@ -37,13 +37,13 @@ struct zfcp_dbf_dump {
37 u8 data[]; /* dump data */ 37 u8 data[]; /* dump data */
38} __attribute__ ((packed)); 38} __attribute__ ((packed));
39 39
40struct zfcp_rec_dbf_record_thread { 40struct zfcp_dbf_rec_record_thread {
41 u32 total; 41 u32 total;
42 u32 ready; 42 u32 ready;
43 u32 running; 43 u32 running;
44}; 44};
45 45
46struct zfcp_rec_dbf_record_target { 46struct zfcp_dbf_rec_record_target {
47 u64 ref; 47 u64 ref;
48 u32 status; 48 u32 status;
49 u32 d_id; 49 u32 d_id;
@@ -52,7 +52,7 @@ struct zfcp_rec_dbf_record_target {
52 u32 erp_count; 52 u32 erp_count;
53}; 53};
54 54
55struct zfcp_rec_dbf_record_trigger { 55struct zfcp_dbf_rec_record_trigger {
56 u8 want; 56 u8 want;
57 u8 need; 57 u8 need;
58 u32 as; 58 u32 as;
@@ -64,21 +64,21 @@ struct zfcp_rec_dbf_record_trigger {
64 u64 fcp_lun; 64 u64 fcp_lun;
65}; 65};
66 66
67struct zfcp_rec_dbf_record_action { 67struct zfcp_dbf_rec_record_action {
68 u32 status; 68 u32 status;
69 u32 step; 69 u32 step;
70 u64 action; 70 u64 action;
71 u64 fsf_req; 71 u64 fsf_req;
72}; 72};
73 73
74struct zfcp_rec_dbf_record { 74struct zfcp_dbf_rec_record {
75 u8 id; 75 u8 id;
76 char id2[7]; 76 char id2[7];
77 union { 77 union {
78 struct zfcp_rec_dbf_record_action action; 78 struct zfcp_dbf_rec_record_action action;
79 struct zfcp_rec_dbf_record_thread thread; 79 struct zfcp_dbf_rec_record_thread thread;
80 struct zfcp_rec_dbf_record_target target; 80 struct zfcp_dbf_rec_record_target target;
81 struct zfcp_rec_dbf_record_trigger trigger; 81 struct zfcp_dbf_rec_record_trigger trigger;
82 } u; 82 } u;
83}; 83};
84 84
@@ -89,7 +89,7 @@ enum {
89 ZFCP_REC_DBF_ID_TRIGGER, 89 ZFCP_REC_DBF_ID_TRIGGER,
90}; 90};
91 91
92struct zfcp_hba_dbf_record_response { 92struct zfcp_dbf_hba_record_response {
93 u32 fsf_command; 93 u32 fsf_command;
94 u64 fsf_reqid; 94 u64 fsf_reqid;
95 u32 fsf_seqno; 95 u32 fsf_seqno;
@@ -127,7 +127,7 @@ struct zfcp_hba_dbf_record_response {
127 } u; 127 } u;
128} __attribute__ ((packed)); 128} __attribute__ ((packed));
129 129
130struct zfcp_hba_dbf_record_status { 130struct zfcp_dbf_hba_record_status {
131 u8 failed; 131 u8 failed;
132 u32 status_type; 132 u32 status_type;
133 u32 status_subtype; 133 u32 status_subtype;
@@ -141,24 +141,24 @@ struct zfcp_hba_dbf_record_status {
141 u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; 141 u8 payload[ZFCP_DBF_UNSOL_PAYLOAD];
142} __attribute__ ((packed)); 142} __attribute__ ((packed));
143 143
144struct zfcp_hba_dbf_record_qdio { 144struct zfcp_dbf_hba_record_qdio {
145 u32 qdio_error; 145 u32 qdio_error;
146 u8 sbal_index; 146 u8 sbal_index;
147 u8 sbal_count; 147 u8 sbal_count;
148} __attribute__ ((packed)); 148} __attribute__ ((packed));
149 149
150struct zfcp_hba_dbf_record { 150struct zfcp_dbf_hba_record {
151 u8 tag[ZFCP_DBF_TAG_SIZE]; 151 u8 tag[ZFCP_DBF_TAG_SIZE];
152 u8 tag2[ZFCP_DBF_TAG_SIZE]; 152 u8 tag2[ZFCP_DBF_TAG_SIZE];
153 union { 153 union {
154 struct zfcp_hba_dbf_record_response response; 154 struct zfcp_dbf_hba_record_response response;
155 struct zfcp_hba_dbf_record_status status; 155 struct zfcp_dbf_hba_record_status status;
156 struct zfcp_hba_dbf_record_qdio qdio; 156 struct zfcp_dbf_hba_record_qdio qdio;
157 struct fsf_bit_error_payload berr; 157 struct fsf_bit_error_payload berr;
158 } u; 158 } u;
159} __attribute__ ((packed)); 159} __attribute__ ((packed));
160 160
161struct zfcp_san_dbf_record_ct_request { 161struct zfcp_dbf_san_record_ct_request {
162 u16 cmd_req_code; 162 u16 cmd_req_code;
163 u8 revision; 163 u8 revision;
164 u8 gs_type; 164 u8 gs_type;
@@ -168,7 +168,7 @@ struct zfcp_san_dbf_record_ct_request {
168 u32 len; 168 u32 len;
169} __attribute__ ((packed)); 169} __attribute__ ((packed));
170 170
171struct zfcp_san_dbf_record_ct_response { 171struct zfcp_dbf_san_record_ct_response {
172 u16 cmd_rsp_code; 172 u16 cmd_rsp_code;
173 u8 revision; 173 u8 revision;
174 u8 reason_code; 174 u8 reason_code;
@@ -178,27 +178,27 @@ struct zfcp_san_dbf_record_ct_response {
178 u32 len; 178 u32 len;
179} __attribute__ ((packed)); 179} __attribute__ ((packed));
180 180
181struct zfcp_san_dbf_record_els { 181struct zfcp_dbf_san_record_els {
182 u8 ls_code; 182 u8 ls_code;
183 u32 len; 183 u32 len;
184} __attribute__ ((packed)); 184} __attribute__ ((packed));
185 185
186struct zfcp_san_dbf_record { 186struct zfcp_dbf_san_record {
187 u8 tag[ZFCP_DBF_TAG_SIZE]; 187 u8 tag[ZFCP_DBF_TAG_SIZE];
188 u64 fsf_reqid; 188 u64 fsf_reqid;
189 u32 fsf_seqno; 189 u32 fsf_seqno;
190 u32 s_id; 190 u32 s_id;
191 u32 d_id; 191 u32 d_id;
192 union { 192 union {
193 struct zfcp_san_dbf_record_ct_request ct_req; 193 struct zfcp_dbf_san_record_ct_request ct_req;
194 struct zfcp_san_dbf_record_ct_response ct_resp; 194 struct zfcp_dbf_san_record_ct_response ct_resp;
195 struct zfcp_san_dbf_record_els els; 195 struct zfcp_dbf_san_record_els els;
196 } u; 196 } u;
197#define ZFCP_DBF_SAN_MAX_PAYLOAD 1024 197#define ZFCP_DBF_SAN_MAX_PAYLOAD 1024
198 u8 payload[32]; 198 u8 payload[32];
199} __attribute__ ((packed)); 199} __attribute__ ((packed));
200 200
201struct zfcp_scsi_dbf_record { 201struct zfcp_dbf_scsi_record {
202 u8 tag[ZFCP_DBF_TAG_SIZE]; 202 u8 tag[ZFCP_DBF_TAG_SIZE];
203 u8 tag2[ZFCP_DBF_TAG_SIZE]; 203 u8 tag2[ZFCP_DBF_TAG_SIZE];
204 u32 scsi_id; 204 u32 scsi_id;
@@ -225,86 +225,84 @@ struct zfcp_scsi_dbf_record {
225} __attribute__ ((packed)); 225} __attribute__ ((packed));
226 226
227struct zfcp_dbf { 227struct zfcp_dbf {
228 debug_info_t *rec_dbf; 228 debug_info_t *rec;
229 debug_info_t *hba_dbf; 229 debug_info_t *hba;
230 debug_info_t *san_dbf; 230 debug_info_t *san;
231 debug_info_t *scsi_dbf; 231 debug_info_t *scsi;
232 spinlock_t rec_dbf_lock; 232 spinlock_t rec_lock;
233 spinlock_t hba_dbf_lock; 233 spinlock_t hba_lock;
234 spinlock_t san_dbf_lock; 234 spinlock_t san_lock;
235 spinlock_t scsi_dbf_lock; 235 spinlock_t scsi_lock;
236 struct zfcp_rec_dbf_record rec_dbf_buf; 236 struct zfcp_dbf_rec_record rec_buf;
237 struct zfcp_hba_dbf_record hba_dbf_buf; 237 struct zfcp_dbf_hba_record hba_buf;
238 struct zfcp_san_dbf_record san_dbf_buf; 238 struct zfcp_dbf_san_record san_buf;
239 struct zfcp_scsi_dbf_record scsi_dbf_buf; 239 struct zfcp_dbf_scsi_record scsi_buf;
240 struct zfcp_adapter *adapter;
240}; 241};
241 242
242static inline 243static inline
243void zfcp_hba_dbf_event_fsf_resp(const char *tag2, int level, 244void zfcp_dbf_hba_fsf_resp(const char *tag2, int level,
244 struct zfcp_fsf_req *req, struct zfcp_dbf *dbf) 245 struct zfcp_fsf_req *req, struct zfcp_dbf *dbf)
245{ 246{
246 if (level <= dbf->hba_dbf->level) 247 if (level <= dbf->hba->level)
247 _zfcp_hba_dbf_event_fsf_response(tag2, level, req, dbf); 248 _zfcp_dbf_hba_fsf_response(tag2, level, req, dbf);
248} 249}
249 250
250/** 251/**
251 * zfcp_hba_dbf_event_fsf_response - trace event for request completion 252 * zfcp_dbf_hba_fsf_response - trace event for request completion
252 * @fsf_req: request that has been completed 253 * @fsf_req: request that has been completed
253 */ 254 */
254static inline void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *req) 255static inline void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req)
255{ 256{
256 struct zfcp_dbf *dbf = req->adapter->dbf; 257 struct zfcp_dbf *dbf = req->adapter->dbf;
257 struct fsf_qtcb *qtcb = req->qtcb; 258 struct fsf_qtcb *qtcb = req->qtcb;
258 259
259 if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) && 260 if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) &&
260 (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) { 261 (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) {
261 zfcp_hba_dbf_event_fsf_resp("perr", 1, req, dbf); 262 zfcp_dbf_hba_fsf_resp("perr", 1, req, dbf);
262 263
263 } else if (qtcb->header.fsf_status != FSF_GOOD) { 264 } else if (qtcb->header.fsf_status != FSF_GOOD) {
264 zfcp_hba_dbf_event_fsf_resp("ferr", 1, req, dbf); 265 zfcp_dbf_hba_fsf_resp("ferr", 1, req, dbf);
265 266
266 } else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) || 267 } else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) ||
267 (req->fsf_command == FSF_QTCB_OPEN_LUN)) { 268 (req->fsf_command == FSF_QTCB_OPEN_LUN)) {
268 zfcp_hba_dbf_event_fsf_resp("open", 4, req, dbf); 269 zfcp_dbf_hba_fsf_resp("open", 4, req, dbf);
269 270
270 } else if (qtcb->header.log_length) { 271 } else if (qtcb->header.log_length) {
271 zfcp_hba_dbf_event_fsf_resp("qtcb", 5, req, dbf); 272 zfcp_dbf_hba_fsf_resp("qtcb", 5, req, dbf);
272 273
273 } else { 274 } else {
274 zfcp_hba_dbf_event_fsf_resp("norm", 6, req, dbf); 275 zfcp_dbf_hba_fsf_resp("norm", 6, req, dbf);
275 } 276 }
276 } 277 }
277 278
278/** 279/**
279 * zfcp_hba_dbf_event_fsf_unsol - trace event for an unsolicited status buffer 280 * zfcp_dbf_hba_fsf_unsol - trace event for an unsolicited status buffer
280 * @tag: tag indicating which kind of unsolicited status has been received 281 * @tag: tag indicating which kind of unsolicited status has been received
281 * @adapter: adapter that has issued the unsolicited status buffer 282 * @dbf: reference to dbf structure
282 * @status_buffer: buffer containing payload of unsolicited status 283 * @status_buffer: buffer containing payload of unsolicited status
283 */ 284 */
284static inline 285static inline
285void zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter, 286void zfcp_dbf_hba_fsf_unsol(const char *tag, struct zfcp_dbf *dbf,
286 struct fsf_status_read_buffer *buf) 287 struct fsf_status_read_buffer *buf)
287{ 288{
288 struct zfcp_dbf *dbf = adapter->dbf;
289 int level = 2; 289 int level = 2;
290 290
291 if (level <= dbf->hba_dbf->level) 291 if (level <= dbf->hba->level)
292 _zfcp_hba_dbf_event_fsf_unsol(tag, level, adapter, buf); 292 _zfcp_dbf_hba_fsf_unsol(tag, level, dbf, buf);
293} 293}
294 294
295static inline 295static inline
296void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level, 296void zfcp_dbf_scsi(const char *tag, const char *tag2, int level,
297 struct zfcp_adapter *adapter, struct scsi_cmnd *scmd, 297 struct zfcp_dbf *dbf, struct scsi_cmnd *scmd,
298 struct zfcp_fsf_req *req, unsigned long old_id) 298 struct zfcp_fsf_req *req, unsigned long old_id)
299{ 299{
300 struct zfcp_dbf *dbf = adapter->dbf; 300 if (level <= dbf->scsi->level)
301 301 _zfcp_dbf_scsi(tag, tag2, level, dbf, scmd, req, old_id);
302 if (level <= dbf->scsi_dbf->level)
303 _zfcp_scsi_dbf_event(tag, tag2, level, dbf, scmd, req, old_id);
304} 302}
305 303
306/** 304/**
307 * zfcp_scsi_dbf_event_result - trace event for SCSI command completion 305 * zfcp_dbf_scsi_result - trace event for SCSI command completion
308 * @tag: tag indicating success or failure of SCSI command 306 * @tag: tag indicating success or failure of SCSI command
309 * @level: trace level applicable for this event 307 * @level: trace level applicable for this event
310 * @adapter: adapter that has been used to issue the SCSI command 308 * @adapter: adapter that has been used to issue the SCSI command
@@ -312,16 +310,14 @@ void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level,
312 * @fsf_req: request used to issue SCSI command (might be NULL) 310 * @fsf_req: request used to issue SCSI command (might be NULL)
313 */ 311 */
314static inline 312static inline
315void zfcp_scsi_dbf_event_result(const char *tag, int level, 313void zfcp_dbf_scsi_result(const char *tag, int level, struct zfcp_dbf *dbf,
316 struct zfcp_adapter *adapter, 314 struct scsi_cmnd *scmd, struct zfcp_fsf_req *fsf_req)
317 struct scsi_cmnd *scmd,
318 struct zfcp_fsf_req *fsf_req)
319{ 315{
320 zfcp_scsi_dbf_event("rslt", tag, level, adapter, scmd, fsf_req, 0); 316 zfcp_dbf_scsi("rslt", tag, level, dbf, scmd, fsf_req, 0);
321} 317}
322 318
323/** 319/**
324 * zfcp_scsi_dbf_event_abort - trace event for SCSI command abort 320 * zfcp_dbf_scsi_abort - trace event for SCSI command abort
325 * @tag: tag indicating success or failure of abort operation 321 * @tag: tag indicating success or failure of abort operation
326 * @adapter: adapter thas has been used to issue SCSI command to be aborted 322 * @adapter: adapter thas has been used to issue SCSI command to be aborted
327 * @scmd: SCSI command to be aborted 323 * @scmd: SCSI command to be aborted
@@ -329,28 +325,26 @@ void zfcp_scsi_dbf_event_result(const char *tag, int level,
329 * @old_id: identifier of request containg SCSI command to be aborted 325 * @old_id: identifier of request containg SCSI command to be aborted
330 */ 326 */
331static inline 327static inline
332void zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter, 328void zfcp_dbf_scsi_abort(const char *tag, struct zfcp_dbf *dbf,
333 struct scsi_cmnd *scmd, 329 struct scsi_cmnd *scmd, struct zfcp_fsf_req *new_req,
334 struct zfcp_fsf_req *new_req, 330 unsigned long old_id)
335 unsigned long old_id)
336{ 331{
337 zfcp_scsi_dbf_event("abrt", tag, 1, adapter, scmd, new_req, old_id); 332 zfcp_dbf_scsi("abrt", tag, 1, dbf, scmd, new_req, old_id);
338} 333}
339 334
340/** 335/**
341 * zfcp_scsi_dbf_event_devreset - trace event for Logical Unit or Target Reset 336 * zfcp_dbf_scsi_devreset - trace event for Logical Unit or Target Reset
342 * @tag: tag indicating success or failure of reset operation 337 * @tag: tag indicating success or failure of reset operation
343 * @flag: indicates type of reset (Target Reset, Logical Unit Reset) 338 * @flag: indicates type of reset (Target Reset, Logical Unit Reset)
344 * @unit: unit that needs reset 339 * @unit: unit that needs reset
345 * @scsi_cmnd: SCSI command which caused this error recovery 340 * @scsi_cmnd: SCSI command which caused this error recovery
346 */ 341 */
347static inline 342static inline
348void zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag, 343void zfcp_dbf_scsi_devreset(const char *tag, u8 flag, struct zfcp_unit *unit,
349 struct zfcp_unit *unit, 344 struct scsi_cmnd *scsi_cmnd)
350 struct scsi_cmnd *scsi_cmnd)
351{ 345{
352 zfcp_scsi_dbf_event(flag == FCP_TARGET_RESET ? "trst" : "lrst", tag, 1, 346 zfcp_dbf_scsi(flag == FCP_TARGET_RESET ? "trst" : "lrst", tag, 1,
353 unit->port->adapter, scsi_cmnd, NULL, 0); 347 unit->port->adapter->dbf, scsi_cmnd, NULL, 0);
354} 348}
355 349
356#endif /* ZFCP_DBF_H */ 350#endif /* ZFCP_DBF_H */