Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 1 | /* |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 2 | * zfcp device driver |
| 3 | * debug feature declarations |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 4 | * |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 5 | * Copyright IBM Corp. 2008, 2010 |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef ZFCP_DBF_H |
| 9 | #define ZFCP_DBF_H |
| 10 | |
Christof Schmitt | 4318e08 | 2009-11-24 16:54:08 +0100 | [diff] [blame] | 11 | #include <scsi/fc/fc_fcp.h> |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 12 | #include "zfcp_ext.h" |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 13 | #include "zfcp_fsf.h" |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 14 | #include "zfcp_def.h" |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 15 | |
Swen Schillig | ae0904f | 2010-12-02 15:16:12 +0100 | [diff] [blame] | 16 | #define ZFCP_DBF_TAG_LEN 7 |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 17 | #define ZFCP_DBF_TAG_SIZE 4 |
Swen Schillig | 5ffd51a | 2009-03-02 13:09:04 +0100 | [diff] [blame] | 18 | #define ZFCP_DBF_ID_SIZE 7 |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 19 | |
Christof Schmitt | d21e9da | 2010-02-17 11:18:54 +0100 | [diff] [blame] | 20 | #define ZFCP_DBF_INVALID_LUN 0xFFFFFFFFFFFFFFFFull |
| 21 | |
Swen Schillig | ae0904f | 2010-12-02 15:16:12 +0100 | [diff] [blame] | 22 | /** |
| 23 | * struct zfcp_dbf_rec_trigger - trace record for triggered recovery action |
| 24 | * @ready: number of ready recovery actions |
| 25 | * @running: number of running recovery actions |
| 26 | * @want: wanted recovery action |
| 27 | * @need: needed recovery action |
| 28 | */ |
| 29 | struct zfcp_dbf_rec_trigger { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 30 | u32 ready; |
| 31 | u32 running; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 32 | u8 want; |
| 33 | u8 need; |
Swen Schillig | ae0904f | 2010-12-02 15:16:12 +0100 | [diff] [blame] | 34 | } __packed; |
| 35 | |
| 36 | /** |
| 37 | * struct zfcp_dbf_rec_running - trace record for running recovery |
| 38 | * @fsf_req_id: request id for fsf requests |
| 39 | * @rec_status: status of the fsf request |
| 40 | * @rec_step: current step of the recovery action |
| 41 | * rec_count: recovery counter |
| 42 | */ |
| 43 | struct zfcp_dbf_rec_running { |
| 44 | u64 fsf_req_id; |
| 45 | u32 rec_status; |
| 46 | u16 rec_step; |
| 47 | u8 rec_action; |
| 48 | u8 rec_count; |
| 49 | } __packed; |
| 50 | |
| 51 | /** |
| 52 | * enum zfcp_dbf_rec_id - recovery trace record id |
| 53 | * @ZFCP_DBF_REC_TRIG: triggered recovery identifier |
| 54 | * @ZFCP_DBF_REC_RUN: running recovery identifier |
| 55 | */ |
| 56 | enum zfcp_dbf_rec_id { |
| 57 | ZFCP_DBF_REC_TRIG = 1, |
| 58 | ZFCP_DBF_REC_RUN = 2, |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 59 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 60 | |
Swen Schillig | ae0904f | 2010-12-02 15:16:12 +0100 | [diff] [blame] | 61 | /** |
| 62 | * struct zfcp_dbf_rec - trace record for error recovery actions |
| 63 | * @id: unique number of recovery record type |
| 64 | * @tag: identifier string specifying the location of initiation |
| 65 | * @lun: logical unit number |
| 66 | * @wwpn: word wide port number |
| 67 | * @d_id: destination ID |
| 68 | * @adapter_status: current status of the adapter |
| 69 | * @port_status: current status of the port |
| 70 | * @lun_status: current status of the lun |
| 71 | * @u.trig: structure zfcp_dbf_rec_trigger |
| 72 | * @u.run: structure zfcp_dbf_rec_running |
| 73 | */ |
| 74 | struct zfcp_dbf_rec { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 75 | u8 id; |
Swen Schillig | ae0904f | 2010-12-02 15:16:12 +0100 | [diff] [blame] | 76 | char tag[ZFCP_DBF_TAG_LEN]; |
| 77 | u64 lun; |
| 78 | u64 wwpn; |
| 79 | u32 d_id; |
| 80 | u32 adapter_status; |
| 81 | u32 port_status; |
| 82 | u32 lun_status; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 83 | union { |
Swen Schillig | ae0904f | 2010-12-02 15:16:12 +0100 | [diff] [blame] | 84 | struct zfcp_dbf_rec_trigger trig; |
| 85 | struct zfcp_dbf_rec_running run; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 86 | } u; |
Swen Schillig | ae0904f | 2010-12-02 15:16:12 +0100 | [diff] [blame] | 87 | } __packed; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 88 | |
Swen Schillig | 2c55b75 | 2010-12-02 15:16:13 +0100 | [diff] [blame] | 89 | /** |
| 90 | * enum zfcp_dbf_san_id - SAN trace record identifier |
| 91 | * @ZFCP_DBF_SAN_REQ: request trace record id |
| 92 | * @ZFCP_DBF_SAN_RES: response trace record id |
| 93 | * @ZFCP_DBF_SAN_ELS: extended link service record id |
| 94 | */ |
| 95 | enum zfcp_dbf_san_id { |
| 96 | ZFCP_DBF_SAN_REQ = 1, |
| 97 | ZFCP_DBF_SAN_RES = 2, |
| 98 | ZFCP_DBF_SAN_ELS = 3, |
| 99 | }; |
| 100 | |
| 101 | /** struct zfcp_dbf_san - trace record for SAN requests and responses |
| 102 | * @id: unique number of recovery record type |
| 103 | * @tag: identifier string specifying the location of initiation |
| 104 | * @fsf_req_id: request id for fsf requests |
| 105 | * @payload: unformatted information related to request/response |
| 106 | * @d_id: destination id |
| 107 | */ |
| 108 | struct zfcp_dbf_san { |
| 109 | u8 id; |
| 110 | char tag[ZFCP_DBF_TAG_LEN]; |
| 111 | u64 fsf_req_id; |
| 112 | u32 d_id; |
| 113 | #define ZFCP_DBF_SAN_MAX_PAYLOAD (FC_CT_HDR_LEN + 32) |
| 114 | char payload[ZFCP_DBF_SAN_MAX_PAYLOAD]; |
| 115 | } __packed; |
| 116 | |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 117 | /** |
| 118 | * struct zfcp_dbf_hba_res - trace record for hba responses |
| 119 | * @req_issued: timestamp when request was issued |
| 120 | * @prot_status: protocol status |
| 121 | * @prot_status_qual: protocol status qualifier |
| 122 | * @fsf_status: fsf status |
| 123 | * @fsf_status_qual: fsf status qualifier |
| 124 | */ |
| 125 | struct zfcp_dbf_hba_res { |
| 126 | u64 req_issued; |
| 127 | u32 prot_status; |
| 128 | u8 prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE]; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 129 | u32 fsf_status; |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 130 | u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE]; |
| 131 | } __packed; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 132 | |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 133 | /** |
| 134 | * struct zfcp_dbf_hba_uss - trace record for unsolicited status |
| 135 | * @status_type: type of unsolicited status |
| 136 | * @status_subtype: subtype of unsolicited status |
| 137 | * @d_id: destination ID |
| 138 | * @lun: logical unit number |
| 139 | * @queue_designator: queue designator |
| 140 | */ |
| 141 | struct zfcp_dbf_hba_uss { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 142 | u32 status_type; |
| 143 | u32 status_subtype; |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 144 | u32 d_id; |
| 145 | u64 lun; |
| 146 | u64 queue_designator; |
| 147 | } __packed; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 148 | |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 149 | /** |
| 150 | * enum zfcp_dbf_hba_id - HBA trace record identifier |
| 151 | * @ZFCP_DBF_HBA_RES: response trace record |
| 152 | * @ZFCP_DBF_HBA_USS: unsolicited status trace record |
| 153 | * @ZFCP_DBF_HBA_BIT: bit error trace record |
| 154 | */ |
| 155 | enum zfcp_dbf_hba_id { |
| 156 | ZFCP_DBF_HBA_RES = 1, |
| 157 | ZFCP_DBF_HBA_USS = 2, |
| 158 | ZFCP_DBF_HBA_BIT = 3, |
| 159 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 160 | |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 161 | /** |
| 162 | * struct zfcp_dbf_hba - common trace record for HBA records |
| 163 | * @id: unique number of recovery record type |
| 164 | * @tag: identifier string specifying the location of initiation |
| 165 | * @fsf_req_id: request id for fsf requests |
| 166 | * @fsf_req_status: status of fsf request |
| 167 | * @fsf_cmd: fsf command |
| 168 | * @fsf_seq_no: fsf sequence number |
| 169 | * @pl_len: length of payload stored as zfcp_dbf_pay |
| 170 | * @u: record type specific data |
| 171 | */ |
| 172 | struct zfcp_dbf_hba { |
| 173 | u8 id; |
| 174 | char tag[ZFCP_DBF_TAG_LEN]; |
| 175 | u64 fsf_req_id; |
| 176 | u32 fsf_req_status; |
| 177 | u32 fsf_cmd; |
| 178 | u32 fsf_seq_no; |
| 179 | u16 pl_len; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 180 | union { |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 181 | struct zfcp_dbf_hba_res res; |
| 182 | struct zfcp_dbf_hba_uss uss; |
| 183 | struct fsf_bit_error_payload be; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 184 | } u; |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 185 | } __packed; |
| 186 | |
| 187 | /** |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 188 | * enum zfcp_dbf_scsi_id - scsi trace record identifier |
| 189 | * @ZFCP_DBF_SCSI_CMND: scsi command trace record |
| 190 | */ |
| 191 | enum zfcp_dbf_scsi_id { |
| 192 | ZFCP_DBF_SCSI_CMND = 1, |
| 193 | }; |
| 194 | |
| 195 | /** |
| 196 | * struct zfcp_dbf_scsi - common trace record for SCSI records |
| 197 | * @id: unique number of recovery record type |
| 198 | * @tag: identifier string specifying the location of initiation |
| 199 | * @scsi_id: scsi device id |
| 200 | * @scsi_lun: scsi device logical unit number |
| 201 | * @scsi_result: scsi result |
| 202 | * @scsi_retries: current retry number of scsi request |
| 203 | * @scsi_allowed: allowed retries |
| 204 | * @fcp_rsp_info: FCP response info |
| 205 | * @scsi_opcode: scsi opcode |
| 206 | * @fsf_req_id: request id of fsf request |
| 207 | * @host_scribble: LLD specific data attached to SCSI request |
| 208 | * @pl_len: length of paload stored as zfcp_dbf_pay |
| 209 | * @fsf_rsp: response for fsf request |
| 210 | */ |
| 211 | struct zfcp_dbf_scsi { |
| 212 | u8 id; |
| 213 | char tag[ZFCP_DBF_TAG_LEN]; |
| 214 | u32 scsi_id; |
| 215 | u32 scsi_lun; |
| 216 | u32 scsi_result; |
| 217 | u8 scsi_retries; |
| 218 | u8 scsi_allowed; |
| 219 | u8 fcp_rsp_info; |
| 220 | #define ZFCP_DBF_SCSI_OPCODE 16 |
| 221 | u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE]; |
| 222 | u64 fsf_req_id; |
| 223 | u64 host_scribble; |
| 224 | u16 pl_len; |
| 225 | struct fcp_resp_with_ext fcp_rsp; |
| 226 | } __packed; |
| 227 | |
| 228 | /** |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 229 | * struct zfcp_dbf_pay - trace record for unformatted payload information |
| 230 | * @area: area this record is originated from |
| 231 | * @counter: ascending record number |
| 232 | * @fsf_req_id: request id of fsf request |
| 233 | * @data: unformatted data |
| 234 | */ |
| 235 | struct zfcp_dbf_pay { |
| 236 | char area[ZFCP_DBF_TAG_LEN]; |
| 237 | char counter; |
| 238 | u64 fsf_req_id; |
| 239 | #define ZFCP_DBF_PAY_MAX_REC 0x100 |
| 240 | char data[ZFCP_DBF_PAY_MAX_REC]; |
| 241 | } __packed; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 242 | |
Christof Schmitt | d46f384 | 2009-08-18 15:43:07 +0200 | [diff] [blame] | 243 | struct zfcp_dbf { |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 244 | debug_info_t *pay; |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 245 | debug_info_t *rec; |
| 246 | debug_info_t *hba; |
| 247 | debug_info_t *san; |
| 248 | debug_info_t *scsi; |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 249 | spinlock_t pay_lock; |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 250 | spinlock_t rec_lock; |
| 251 | spinlock_t hba_lock; |
| 252 | spinlock_t san_lock; |
| 253 | spinlock_t scsi_lock; |
Swen Schillig | ae0904f | 2010-12-02 15:16:12 +0100 | [diff] [blame] | 254 | struct zfcp_dbf_rec rec_buf; |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 255 | struct zfcp_dbf_hba hba_buf; |
Swen Schillig | 2c55b75 | 2010-12-02 15:16:13 +0100 | [diff] [blame] | 256 | struct zfcp_dbf_san san_buf; |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 257 | struct zfcp_dbf_scsi scsi_buf; |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 258 | struct zfcp_dbf_pay pay_buf; |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 259 | struct zfcp_adapter *adapter; |
Christof Schmitt | d46f384 | 2009-08-18 15:43:07 +0200 | [diff] [blame] | 260 | }; |
| 261 | |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 262 | static inline |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 263 | void zfcp_dbf_hba_fsf_resp(char *tag, int level, struct zfcp_fsf_req *req) |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 264 | { |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 265 | if (level <= req->adapter->dbf->hba->level) |
| 266 | zfcp_dbf_hba_fsf_res(tag, req); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | /** |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 270 | * zfcp_dbf_hba_fsf_response - trace event for request completion |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 271 | * @req: request that has been completed |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 272 | */ |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 273 | static inline |
| 274 | void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req) |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 275 | { |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 276 | struct fsf_qtcb *qtcb = req->qtcb; |
| 277 | |
| 278 | if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) && |
| 279 | (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) { |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 280 | zfcp_dbf_hba_fsf_resp("fs_perr", 1, req); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 281 | |
| 282 | } else if (qtcb->header.fsf_status != FSF_GOOD) { |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 283 | zfcp_dbf_hba_fsf_resp("fs_ferr", 1, req); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 284 | |
| 285 | } else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) || |
| 286 | (req->fsf_command == FSF_QTCB_OPEN_LUN)) { |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 287 | zfcp_dbf_hba_fsf_resp("fs_open", 4, req); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 288 | |
| 289 | } else if (qtcb->header.log_length) { |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 290 | zfcp_dbf_hba_fsf_resp("fs_qtcb", 5, req); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 291 | |
| 292 | } else { |
Swen Schillig | a54ca0f | 2010-12-02 15:16:14 +0100 | [diff] [blame] | 293 | zfcp_dbf_hba_fsf_resp("fs_norm", 6, req); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 294 | } |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 295 | } |
| 296 | |
| 297 | static inline |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 298 | void _zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *scmd, |
| 299 | struct zfcp_fsf_req *req) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 300 | { |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 301 | struct zfcp_adapter *adapter = (struct zfcp_adapter *) |
| 302 | scmd->device->host->hostdata[0]; |
| 303 | |
| 304 | if (level <= adapter->dbf->scsi->level) |
| 305 | zfcp_dbf_scsi(tag, scmd, req); |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | /** |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 309 | * zfcp_dbf_scsi_result - trace event for SCSI command completion |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 310 | * @scmd: SCSI command pointer |
Christof Schmitt | ab72528 | 2010-02-17 11:18:57 +0100 | [diff] [blame] | 311 | * @req: FSF request used to issue SCSI command |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 312 | */ |
| 313 | static inline |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 314 | void zfcp_dbf_scsi_result(struct scsi_cmnd *scmd, struct zfcp_fsf_req *req) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 315 | { |
Christof Schmitt | ab72528 | 2010-02-17 11:18:57 +0100 | [diff] [blame] | 316 | if (scmd->result != 0) |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 317 | _zfcp_dbf_scsi("rsl_err", 3, scmd, req); |
Christof Schmitt | ab72528 | 2010-02-17 11:18:57 +0100 | [diff] [blame] | 318 | else if (scmd->retries > 0) |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 319 | _zfcp_dbf_scsi("rsl_ret", 4, scmd, req); |
Christof Schmitt | ab72528 | 2010-02-17 11:18:57 +0100 | [diff] [blame] | 320 | else |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 321 | _zfcp_dbf_scsi("rsl_nor", 6, scmd, req); |
Christof Schmitt | ab72528 | 2010-02-17 11:18:57 +0100 | [diff] [blame] | 322 | } |
| 323 | |
| 324 | /** |
| 325 | * zfcp_dbf_scsi_fail_send - trace event for failure to send SCSI command |
Christof Schmitt | ab72528 | 2010-02-17 11:18:57 +0100 | [diff] [blame] | 326 | * @scmd: SCSI command pointer |
| 327 | */ |
| 328 | static inline |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 329 | void zfcp_dbf_scsi_fail_send(struct scsi_cmnd *scmd) |
Christof Schmitt | ab72528 | 2010-02-17 11:18:57 +0100 | [diff] [blame] | 330 | { |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 331 | _zfcp_dbf_scsi("rsl_fai", 4, scmd, NULL); |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 332 | } |
| 333 | |
| 334 | /** |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 335 | * zfcp_dbf_scsi_abort - trace event for SCSI command abort |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 336 | * @tag: tag indicating success or failure of abort operation |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 337 | * @scmd: SCSI command to be aborted |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 338 | * @fsf_req: request containing abort (might be NULL) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 339 | */ |
| 340 | static inline |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 341 | void zfcp_dbf_scsi_abort(char *tag, struct scsi_cmnd *scmd, |
| 342 | struct zfcp_fsf_req *fsf_req) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 343 | { |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 344 | _zfcp_dbf_scsi(tag, 1, scmd, fsf_req); |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 345 | } |
| 346 | |
| 347 | /** |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 348 | * zfcp_dbf_scsi_devreset - trace event for Logical Unit or Target Reset |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 349 | * @tag: tag indicating success or failure of reset operation |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 350 | * @scmnd: SCSI command which caused this error recovery |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 351 | * @flag: indicates type of reset (Target Reset, Logical Unit Reset) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 352 | */ |
| 353 | static inline |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 354 | void zfcp_dbf_scsi_devreset(char *tag, struct scsi_cmnd *scmnd, u8 flag) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 355 | { |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 356 | char tmp_tag[ZFCP_DBF_TAG_LEN]; |
Christof Schmitt | b62a8d9 | 2010-09-08 14:39:55 +0200 | [diff] [blame] | 357 | |
Swen Schillig | 250a135 | 2010-12-02 15:16:15 +0100 | [diff] [blame^] | 358 | if (flag == FCP_TMF_TGT_RESET) |
| 359 | memcpy(tmp_tag, "tr_", 3); |
| 360 | else |
| 361 | memcpy(tmp_tag, "lr_", 3); |
| 362 | |
| 363 | memcpy(&tmp_tag[3], tag, 4); |
| 364 | _zfcp_dbf_scsi(tmp_tag, 1, scmnd, NULL); |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 365 | } |
| 366 | |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 367 | #endif /* ZFCP_DBF_H */ |