Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the zfcp device driver for |
| 3 | * FCP adapters for IBM System z9 and zSeries. |
| 4 | * |
Christof Schmitt | d46f384 | 2009-08-18 15:43:07 +0200 | [diff] [blame] | 5 | * Copyright IBM Corp. 2008, 2009 |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2, or (at your option) |
| 10 | * any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | */ |
| 21 | |
| 22 | #ifndef ZFCP_DBF_H |
| 23 | #define ZFCP_DBF_H |
| 24 | |
Christof Schmitt | 4318e08 | 2009-11-24 16:54:08 +0100 | [diff] [blame^] | 25 | #include <scsi/fc/fc_fcp.h> |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 26 | #include "zfcp_ext.h" |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 27 | #include "zfcp_fsf.h" |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 28 | #include "zfcp_def.h" |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 29 | |
| 30 | #define ZFCP_DBF_TAG_SIZE 4 |
Swen Schillig | 5ffd51a | 2009-03-02 13:09:04 +0100 | [diff] [blame] | 31 | #define ZFCP_DBF_ID_SIZE 7 |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 32 | |
| 33 | struct zfcp_dbf_dump { |
| 34 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
| 35 | u32 total_size; /* size of total dump data */ |
| 36 | u32 offset; /* how much data has being already dumped */ |
| 37 | u32 size; /* how much data comes with this record */ |
| 38 | u8 data[]; /* dump data */ |
| 39 | } __attribute__ ((packed)); |
| 40 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 41 | struct zfcp_dbf_rec_record_thread { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 42 | u32 total; |
| 43 | u32 ready; |
| 44 | u32 running; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 45 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 46 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 47 | struct zfcp_dbf_rec_record_target { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 48 | u64 ref; |
| 49 | u32 status; |
| 50 | u32 d_id; |
| 51 | u64 wwpn; |
| 52 | u64 fcp_lun; |
| 53 | u32 erp_count; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 54 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 55 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 56 | struct zfcp_dbf_rec_record_trigger { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 57 | u8 want; |
| 58 | u8 need; |
| 59 | u32 as; |
| 60 | u32 ps; |
| 61 | u32 us; |
| 62 | u64 ref; |
| 63 | u64 action; |
| 64 | u64 wwpn; |
| 65 | u64 fcp_lun; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 66 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 67 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 68 | struct zfcp_dbf_rec_record_action { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 69 | u32 status; |
| 70 | u32 step; |
| 71 | u64 action; |
| 72 | u64 fsf_req; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 73 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 74 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 75 | struct zfcp_dbf_rec_record { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 76 | u8 id; |
Swen Schillig | 5ffd51a | 2009-03-02 13:09:04 +0100 | [diff] [blame] | 77 | char id2[7]; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 78 | union { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 79 | struct zfcp_dbf_rec_record_action action; |
| 80 | struct zfcp_dbf_rec_record_thread thread; |
| 81 | struct zfcp_dbf_rec_record_target target; |
| 82 | struct zfcp_dbf_rec_record_trigger trigger; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 83 | } u; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 84 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 85 | |
| 86 | enum { |
| 87 | ZFCP_REC_DBF_ID_ACTION, |
| 88 | ZFCP_REC_DBF_ID_THREAD, |
| 89 | ZFCP_REC_DBF_ID_TARGET, |
| 90 | ZFCP_REC_DBF_ID_TRIGGER, |
| 91 | }; |
| 92 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 93 | struct zfcp_dbf_hba_record_response { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 94 | u32 fsf_command; |
| 95 | u64 fsf_reqid; |
| 96 | u32 fsf_seqno; |
| 97 | u64 fsf_issued; |
| 98 | u32 fsf_prot_status; |
| 99 | u32 fsf_status; |
| 100 | u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE]; |
| 101 | u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE]; |
| 102 | u32 fsf_req_status; |
| 103 | u8 sbal_first; |
Martin Peschke | e891bff | 2008-05-19 12:17:43 +0200 | [diff] [blame] | 104 | u8 sbal_last; |
Martin Peschke | c3baa9a2 | 2008-05-19 12:17:44 +0200 | [diff] [blame] | 105 | u8 sbal_response; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 106 | u8 pool; |
| 107 | u64 erp_action; |
| 108 | union { |
| 109 | struct { |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 110 | u64 cmnd; |
| 111 | u64 serial; |
| 112 | } fcp; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 113 | struct { |
| 114 | u64 wwpn; |
| 115 | u32 d_id; |
| 116 | u32 port_handle; |
| 117 | } port; |
| 118 | struct { |
| 119 | u64 wwpn; |
| 120 | u64 fcp_lun; |
| 121 | u32 port_handle; |
| 122 | u32 lun_handle; |
| 123 | } unit; |
| 124 | struct { |
| 125 | u32 d_id; |
| 126 | u8 ls_code; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 127 | } els; |
| 128 | } u; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 129 | } __attribute__ ((packed)); |
| 130 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 131 | struct zfcp_dbf_hba_record_status { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 132 | u8 failed; |
| 133 | u32 status_type; |
| 134 | u32 status_subtype; |
| 135 | struct fsf_queue_designator |
| 136 | queue_designator; |
| 137 | u32 payload_size; |
| 138 | #define ZFCP_DBF_UNSOL_PAYLOAD 80 |
| 139 | #define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32 |
| 140 | #define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56 |
| 141 | #define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32) |
| 142 | u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; |
| 143 | } __attribute__ ((packed)); |
| 144 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 145 | struct zfcp_dbf_hba_record_qdio { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 146 | u32 qdio_error; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 147 | u8 sbal_index; |
| 148 | u8 sbal_count; |
| 149 | } __attribute__ ((packed)); |
| 150 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 151 | struct zfcp_dbf_hba_record { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 152 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
| 153 | u8 tag2[ZFCP_DBF_TAG_SIZE]; |
| 154 | union { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 155 | struct zfcp_dbf_hba_record_response response; |
| 156 | struct zfcp_dbf_hba_record_status status; |
| 157 | struct zfcp_dbf_hba_record_qdio qdio; |
Swen Schillig | 5706938 | 2008-10-01 12:42:21 +0200 | [diff] [blame] | 158 | struct fsf_bit_error_payload berr; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 159 | } u; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 160 | } __attribute__ ((packed)); |
| 161 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 162 | struct zfcp_dbf_san_record_ct_request { |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 163 | u16 cmd_req_code; |
| 164 | u8 revision; |
| 165 | u8 gs_type; |
| 166 | u8 gs_subtype; |
| 167 | u8 options; |
| 168 | u16 max_res_size; |
| 169 | u32 len; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 170 | } __attribute__ ((packed)); |
| 171 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 172 | struct zfcp_dbf_san_record_ct_response { |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 173 | u16 cmd_rsp_code; |
| 174 | u8 revision; |
| 175 | u8 reason_code; |
| 176 | u8 expl; |
| 177 | u8 vendor_unique; |
Christof Schmitt | 39eb7e9a | 2008-12-19 16:57:01 +0100 | [diff] [blame] | 178 | u16 max_res_size; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 179 | u32 len; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 180 | } __attribute__ ((packed)); |
| 181 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 182 | struct zfcp_dbf_san_record_els { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 183 | u8 ls_code; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 184 | u32 len; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 185 | } __attribute__ ((packed)); |
| 186 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 187 | struct zfcp_dbf_san_record { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 188 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
| 189 | u64 fsf_reqid; |
| 190 | u32 fsf_seqno; |
| 191 | u32 s_id; |
| 192 | u32 d_id; |
| 193 | union { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 194 | struct zfcp_dbf_san_record_ct_request ct_req; |
| 195 | struct zfcp_dbf_san_record_ct_response ct_resp; |
| 196 | struct zfcp_dbf_san_record_els els; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 197 | } u; |
Christof Schmitt | d94ce6c | 2008-11-04 16:35:12 +0100 | [diff] [blame] | 198 | #define ZFCP_DBF_SAN_MAX_PAYLOAD 1024 |
| 199 | u8 payload[32]; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 200 | } __attribute__ ((packed)); |
| 201 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 202 | struct zfcp_dbf_scsi_record { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 203 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
| 204 | u8 tag2[ZFCP_DBF_TAG_SIZE]; |
| 205 | u32 scsi_id; |
| 206 | u32 scsi_lun; |
| 207 | u32 scsi_result; |
| 208 | u64 scsi_cmnd; |
| 209 | u64 scsi_serial; |
| 210 | #define ZFCP_DBF_SCSI_OPCODE 16 |
| 211 | u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE]; |
| 212 | u8 scsi_retries; |
| 213 | u8 scsi_allowed; |
| 214 | u64 fsf_reqid; |
| 215 | u32 fsf_seqno; |
| 216 | u64 fsf_issued; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 217 | u64 old_fsf_reqid; |
| 218 | u8 rsp_validity; |
| 219 | u8 rsp_scsi_status; |
| 220 | u32 rsp_resid; |
| 221 | u8 rsp_code; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 222 | #define ZFCP_DBF_SCSI_FCP_SNS_INFO 16 |
| 223 | #define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256 |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 224 | u32 sns_info_len; |
| 225 | u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO]; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 226 | } __attribute__ ((packed)); |
| 227 | |
Christof Schmitt | d46f384 | 2009-08-18 15:43:07 +0200 | [diff] [blame] | 228 | struct zfcp_dbf { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 229 | debug_info_t *rec; |
| 230 | debug_info_t *hba; |
| 231 | debug_info_t *san; |
| 232 | debug_info_t *scsi; |
| 233 | spinlock_t rec_lock; |
| 234 | spinlock_t hba_lock; |
| 235 | spinlock_t san_lock; |
| 236 | spinlock_t scsi_lock; |
| 237 | struct zfcp_dbf_rec_record rec_buf; |
| 238 | struct zfcp_dbf_hba_record hba_buf; |
| 239 | struct zfcp_dbf_san_record san_buf; |
| 240 | struct zfcp_dbf_scsi_record scsi_buf; |
| 241 | struct zfcp_adapter *adapter; |
Christof Schmitt | d46f384 | 2009-08-18 15:43:07 +0200 | [diff] [blame] | 242 | }; |
| 243 | |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 244 | static inline |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 245 | void zfcp_dbf_hba_fsf_resp(const char *tag2, int level, |
| 246 | struct zfcp_fsf_req *req, struct zfcp_dbf *dbf) |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 247 | { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 248 | if (level <= dbf->hba->level) |
| 249 | _zfcp_dbf_hba_fsf_response(tag2, level, req, dbf); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | /** |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 253 | * zfcp_dbf_hba_fsf_response - trace event for request completion |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 254 | * @fsf_req: request that has been completed |
| 255 | */ |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 256 | static inline void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req) |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 257 | { |
| 258 | struct zfcp_dbf *dbf = req->adapter->dbf; |
| 259 | struct fsf_qtcb *qtcb = req->qtcb; |
| 260 | |
| 261 | if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) && |
| 262 | (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 263 | zfcp_dbf_hba_fsf_resp("perr", 1, req, dbf); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 264 | |
| 265 | } else if (qtcb->header.fsf_status != FSF_GOOD) { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 266 | zfcp_dbf_hba_fsf_resp("ferr", 1, req, dbf); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 267 | |
| 268 | } else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) || |
| 269 | (req->fsf_command == FSF_QTCB_OPEN_LUN)) { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 270 | zfcp_dbf_hba_fsf_resp("open", 4, req, dbf); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 271 | |
| 272 | } else if (qtcb->header.log_length) { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 273 | zfcp_dbf_hba_fsf_resp("qtcb", 5, req, dbf); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 274 | |
| 275 | } else { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 276 | zfcp_dbf_hba_fsf_resp("norm", 6, req, dbf); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 277 | } |
| 278 | } |
| 279 | |
| 280 | /** |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 281 | * zfcp_dbf_hba_fsf_unsol - trace event for an unsolicited status buffer |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 282 | * @tag: tag indicating which kind of unsolicited status has been received |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 283 | * @dbf: reference to dbf structure |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 284 | * @status_buffer: buffer containing payload of unsolicited status |
| 285 | */ |
| 286 | static inline |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 287 | void zfcp_dbf_hba_fsf_unsol(const char *tag, struct zfcp_dbf *dbf, |
| 288 | struct fsf_status_read_buffer *buf) |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 289 | { |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 290 | int level = 2; |
| 291 | |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 292 | if (level <= dbf->hba->level) |
| 293 | _zfcp_dbf_hba_fsf_unsol(tag, level, dbf, buf); |
Christof Schmitt | 2e261af | 2009-08-18 15:43:09 +0200 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | static inline |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 297 | void zfcp_dbf_scsi(const char *tag, const char *tag2, int level, |
| 298 | struct zfcp_dbf *dbf, struct scsi_cmnd *scmd, |
| 299 | struct zfcp_fsf_req *req, unsigned long old_id) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 300 | { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 301 | if (level <= dbf->scsi->level) |
| 302 | _zfcp_dbf_scsi(tag, tag2, level, dbf, scmd, req, old_id); |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | /** |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 306 | * zfcp_dbf_scsi_result - trace event for SCSI command completion |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 307 | * @tag: tag indicating success or failure of SCSI command |
| 308 | * @level: trace level applicable for this event |
| 309 | * @adapter: adapter that has been used to issue the SCSI command |
| 310 | * @scmd: SCSI command pointer |
| 311 | * @fsf_req: request used to issue SCSI command (might be NULL) |
| 312 | */ |
| 313 | static inline |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 314 | void zfcp_dbf_scsi_result(const char *tag, int level, struct zfcp_dbf *dbf, |
| 315 | struct scsi_cmnd *scmd, struct zfcp_fsf_req *fsf_req) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 316 | { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 317 | zfcp_dbf_scsi("rslt", tag, level, dbf, scmd, fsf_req, 0); |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | /** |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 321 | * zfcp_dbf_scsi_abort - trace event for SCSI command abort |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 322 | * @tag: tag indicating success or failure of abort operation |
| 323 | * @adapter: adapter thas has been used to issue SCSI command to be aborted |
| 324 | * @scmd: SCSI command to be aborted |
| 325 | * @new_req: request containing abort (might be NULL) |
| 326 | * @old_id: identifier of request containg SCSI command to be aborted |
| 327 | */ |
| 328 | static inline |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 329 | void zfcp_dbf_scsi_abort(const char *tag, struct zfcp_dbf *dbf, |
| 330 | struct scsi_cmnd *scmd, struct zfcp_fsf_req *new_req, |
| 331 | unsigned long old_id) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 332 | { |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 333 | zfcp_dbf_scsi("abrt", tag, 1, dbf, scmd, new_req, old_id); |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 334 | } |
| 335 | |
| 336 | /** |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 337 | * zfcp_dbf_scsi_devreset - trace event for Logical Unit or Target Reset |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 338 | * @tag: tag indicating success or failure of reset operation |
| 339 | * @flag: indicates type of reset (Target Reset, Logical Unit Reset) |
| 340 | * @unit: unit that needs reset |
| 341 | * @scsi_cmnd: SCSI command which caused this error recovery |
| 342 | */ |
| 343 | static inline |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 344 | void zfcp_dbf_scsi_devreset(const char *tag, u8 flag, struct zfcp_unit *unit, |
| 345 | struct scsi_cmnd *scsi_cmnd) |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 346 | { |
Christof Schmitt | 4318e08 | 2009-11-24 16:54:08 +0100 | [diff] [blame^] | 347 | zfcp_dbf_scsi(flag == FCP_TMF_TGT_RESET ? "trst" : "lrst", tag, 1, |
Swen Schillig | 5771710 | 2009-08-18 15:43:21 +0200 | [diff] [blame] | 348 | unit->port->adapter->dbf, scsi_cmnd, NULL, 0); |
Christof Schmitt | dcd20e2 | 2009-08-18 15:43:08 +0200 | [diff] [blame] | 349 | } |
| 350 | |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 351 | #endif /* ZFCP_DBF_H */ |