aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_dbf.h
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/s390/scsi/zfcp_dbf.h
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.h')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.h44
1 files changed, 29 insertions, 15 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h
index 6b1461e8f847..457e046f2d28 100644
--- a/drivers/s390/scsi/zfcp_dbf.h
+++ b/drivers/s390/scsi/zfcp_dbf.h
@@ -22,6 +22,7 @@
22#ifndef ZFCP_DBF_H 22#ifndef ZFCP_DBF_H
23#define ZFCP_DBF_H 23#define ZFCP_DBF_H
24 24
25#include <scsi/fc/fc_fcp.h>
25#include "zfcp_ext.h" 26#include "zfcp_ext.h"
26#include "zfcp_fsf.h" 27#include "zfcp_fsf.h"
27#include "zfcp_def.h" 28#include "zfcp_def.h"
@@ -29,6 +30,8 @@
29#define ZFCP_DBF_TAG_SIZE 4 30#define ZFCP_DBF_TAG_SIZE 4
30#define ZFCP_DBF_ID_SIZE 7 31#define ZFCP_DBF_ID_SIZE 7
31 32
33#define ZFCP_DBF_INVALID_LUN 0xFFFFFFFFFFFFFFFFull
34
32struct zfcp_dbf_dump { 35struct zfcp_dbf_dump {
33 u8 tag[ZFCP_DBF_TAG_SIZE]; 36 u8 tag[ZFCP_DBF_TAG_SIZE];
34 u32 total_size; /* size of total dump data */ 37 u32 total_size; /* size of total dump data */
@@ -122,7 +125,6 @@ struct zfcp_dbf_hba_record_response {
122 } unit; 125 } unit;
123 struct { 126 struct {
124 u32 d_id; 127 u32 d_id;
125 u8 ls_code;
126 } els; 128 } els;
127 } u; 129 } u;
128} __attribute__ ((packed)); 130} __attribute__ ((packed));
@@ -166,6 +168,7 @@ struct zfcp_dbf_san_record_ct_request {
166 u8 options; 168 u8 options;
167 u16 max_res_size; 169 u16 max_res_size;
168 u32 len; 170 u32 len;
171 u32 d_id;
169} __attribute__ ((packed)); 172} __attribute__ ((packed));
170 173
171struct zfcp_dbf_san_record_ct_response { 174struct zfcp_dbf_san_record_ct_response {
@@ -179,25 +182,22 @@ struct zfcp_dbf_san_record_ct_response {
179} __attribute__ ((packed)); 182} __attribute__ ((packed));
180 183
181struct zfcp_dbf_san_record_els { 184struct zfcp_dbf_san_record_els {
182 u8 ls_code; 185 u32 d_id;
183 u32 len;
184} __attribute__ ((packed)); 186} __attribute__ ((packed));
185 187
186struct zfcp_dbf_san_record { 188struct zfcp_dbf_san_record {
187 u8 tag[ZFCP_DBF_TAG_SIZE]; 189 u8 tag[ZFCP_DBF_TAG_SIZE];
188 u64 fsf_reqid; 190 u64 fsf_reqid;
189 u32 fsf_seqno; 191 u32 fsf_seqno;
190 u32 s_id;
191 u32 d_id;
192 union { 192 union {
193 struct zfcp_dbf_san_record_ct_request ct_req; 193 struct zfcp_dbf_san_record_ct_request ct_req;
194 struct zfcp_dbf_san_record_ct_response ct_resp; 194 struct zfcp_dbf_san_record_ct_response ct_resp;
195 struct zfcp_dbf_san_record_els els; 195 struct zfcp_dbf_san_record_els els;
196 } u; 196 } u;
197#define ZFCP_DBF_SAN_MAX_PAYLOAD 1024
198 u8 payload[32];
199} __attribute__ ((packed)); 197} __attribute__ ((packed));
200 198
199#define ZFCP_DBF_SAN_MAX_PAYLOAD 1024
200
201struct zfcp_dbf_scsi_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];
@@ -303,17 +303,31 @@ void zfcp_dbf_scsi(const char *tag, const char *tag2, int level,
303 303
304/** 304/**
305 * zfcp_dbf_scsi_result - trace event for SCSI command completion 305 * zfcp_dbf_scsi_result - trace event for SCSI command completion
306 * @tag: tag indicating success or failure of SCSI command 306 * @dbf: adapter dbf trace
307 * @level: trace level applicable for this event 307 * @scmd: SCSI command pointer
308 * @adapter: adapter that has been used to issue the SCSI command 308 * @req: FSF request used to issue SCSI command
309 */
310static inline
311void zfcp_dbf_scsi_result(struct zfcp_dbf *dbf, struct scsi_cmnd *scmd,
312 struct zfcp_fsf_req *req)
313{
314 if (scmd->result != 0)
315 zfcp_dbf_scsi("rslt", "erro", 3, dbf, scmd, req, 0);
316 else if (scmd->retries > 0)
317 zfcp_dbf_scsi("rslt", "retr", 4, dbf, scmd, req, 0);
318 else
319 zfcp_dbf_scsi("rslt", "norm", 6, dbf, scmd, req, 0);
320}
321
322/**
323 * zfcp_dbf_scsi_fail_send - trace event for failure to send SCSI command
324 * @dbf: adapter dbf trace
309 * @scmd: SCSI command pointer 325 * @scmd: SCSI command pointer
310 * @fsf_req: request used to issue SCSI command (might be NULL)
311 */ 326 */
312static inline 327static inline
313void zfcp_dbf_scsi_result(const char *tag, int level, struct zfcp_dbf *dbf, 328void zfcp_dbf_scsi_fail_send(struct zfcp_dbf *dbf, struct scsi_cmnd *scmd)
314 struct scsi_cmnd *scmd, struct zfcp_fsf_req *fsf_req)
315{ 329{
316 zfcp_dbf_scsi("rslt", tag, level, dbf, scmd, fsf_req, 0); 330 zfcp_dbf_scsi("rslt", "fail", 4, dbf, scmd, NULL, 0);
317} 331}
318 332
319/** 333/**
@@ -343,7 +357,7 @@ static inline
343void zfcp_dbf_scsi_devreset(const char *tag, u8 flag, struct zfcp_unit *unit, 357void zfcp_dbf_scsi_devreset(const char *tag, u8 flag, struct zfcp_unit *unit,
344 struct scsi_cmnd *scsi_cmnd) 358 struct scsi_cmnd *scsi_cmnd)
345{ 359{
346 zfcp_dbf_scsi(flag == FCP_TARGET_RESET ? "trst" : "lrst", tag, 1, 360 zfcp_dbf_scsi(flag == FCP_TMF_TGT_RESET ? "trst" : "lrst", tag, 1,
347 unit->port->adapter->dbf, scsi_cmnd, NULL, 0); 361 unit->port->adapter->dbf, scsi_cmnd, NULL, 0);
348} 362}
349 363