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 | * |
| 5 | * Copyright IBM Corp. 2008, 2008 |
| 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 | |
| 25 | #include "zfcp_fsf.h" |
| 26 | |
| 27 | #define ZFCP_DBF_TAG_SIZE 4 |
Swen Schillig | 5ffd51a | 2009-03-02 13:09:04 +0100 | [diff] [blame] | 28 | #define ZFCP_DBF_ID_SIZE 7 |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 29 | |
| 30 | struct zfcp_dbf_dump { |
| 31 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
| 32 | u32 total_size; /* size of total dump data */ |
| 33 | u32 offset; /* how much data has being already dumped */ |
| 34 | u32 size; /* how much data comes with this record */ |
| 35 | u8 data[]; /* dump data */ |
| 36 | } __attribute__ ((packed)); |
| 37 | |
| 38 | struct zfcp_rec_dbf_record_thread { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 39 | u32 total; |
| 40 | u32 ready; |
| 41 | u32 running; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 42 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 43 | |
| 44 | struct zfcp_rec_dbf_record_target { |
| 45 | u64 ref; |
| 46 | u32 status; |
| 47 | u32 d_id; |
| 48 | u64 wwpn; |
| 49 | u64 fcp_lun; |
| 50 | u32 erp_count; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 51 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 52 | |
| 53 | struct zfcp_rec_dbf_record_trigger { |
| 54 | u8 want; |
| 55 | u8 need; |
| 56 | u32 as; |
| 57 | u32 ps; |
| 58 | u32 us; |
| 59 | u64 ref; |
| 60 | u64 action; |
| 61 | u64 wwpn; |
| 62 | u64 fcp_lun; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 63 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 64 | |
| 65 | struct zfcp_rec_dbf_record_action { |
| 66 | u32 status; |
| 67 | u32 step; |
| 68 | u64 action; |
| 69 | u64 fsf_req; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 70 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 71 | |
| 72 | struct zfcp_rec_dbf_record { |
| 73 | u8 id; |
Swen Schillig | 5ffd51a | 2009-03-02 13:09:04 +0100 | [diff] [blame] | 74 | char id2[7]; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 75 | union { |
| 76 | struct zfcp_rec_dbf_record_action action; |
| 77 | struct zfcp_rec_dbf_record_thread thread; |
| 78 | struct zfcp_rec_dbf_record_target target; |
| 79 | struct zfcp_rec_dbf_record_trigger trigger; |
| 80 | } u; |
Martin Peschke | 7337891 | 2008-05-19 12:17:46 +0200 | [diff] [blame] | 81 | }; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 82 | |
| 83 | enum { |
| 84 | ZFCP_REC_DBF_ID_ACTION, |
| 85 | ZFCP_REC_DBF_ID_THREAD, |
| 86 | ZFCP_REC_DBF_ID_TARGET, |
| 87 | ZFCP_REC_DBF_ID_TRIGGER, |
| 88 | }; |
| 89 | |
| 90 | struct zfcp_hba_dbf_record_response { |
| 91 | u32 fsf_command; |
| 92 | u64 fsf_reqid; |
| 93 | u32 fsf_seqno; |
| 94 | u64 fsf_issued; |
| 95 | u32 fsf_prot_status; |
| 96 | u32 fsf_status; |
| 97 | u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE]; |
| 98 | u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE]; |
| 99 | u32 fsf_req_status; |
| 100 | u8 sbal_first; |
Martin Peschke | e891bff | 2008-05-19 12:17:43 +0200 | [diff] [blame] | 101 | u8 sbal_last; |
Martin Peschke | c3baa9a2 | 2008-05-19 12:17:44 +0200 | [diff] [blame] | 102 | u8 sbal_response; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 103 | u8 pool; |
| 104 | u64 erp_action; |
| 105 | union { |
| 106 | struct { |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 107 | u64 cmnd; |
| 108 | u64 serial; |
| 109 | } fcp; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 110 | struct { |
| 111 | u64 wwpn; |
| 112 | u32 d_id; |
| 113 | u32 port_handle; |
| 114 | } port; |
| 115 | struct { |
| 116 | u64 wwpn; |
| 117 | u64 fcp_lun; |
| 118 | u32 port_handle; |
| 119 | u32 lun_handle; |
| 120 | } unit; |
| 121 | struct { |
| 122 | u32 d_id; |
| 123 | u8 ls_code; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 124 | } els; |
| 125 | } u; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 126 | } __attribute__ ((packed)); |
| 127 | |
| 128 | struct zfcp_hba_dbf_record_status { |
| 129 | u8 failed; |
| 130 | u32 status_type; |
| 131 | u32 status_subtype; |
| 132 | struct fsf_queue_designator |
| 133 | queue_designator; |
| 134 | u32 payload_size; |
| 135 | #define ZFCP_DBF_UNSOL_PAYLOAD 80 |
| 136 | #define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32 |
| 137 | #define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56 |
| 138 | #define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32) |
| 139 | u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; |
| 140 | } __attribute__ ((packed)); |
| 141 | |
| 142 | struct zfcp_hba_dbf_record_qdio { |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 143 | u32 qdio_error; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 144 | u8 sbal_index; |
| 145 | u8 sbal_count; |
| 146 | } __attribute__ ((packed)); |
| 147 | |
| 148 | struct zfcp_hba_dbf_record { |
| 149 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
| 150 | u8 tag2[ZFCP_DBF_TAG_SIZE]; |
| 151 | union { |
| 152 | struct zfcp_hba_dbf_record_response response; |
| 153 | struct zfcp_hba_dbf_record_status status; |
| 154 | struct zfcp_hba_dbf_record_qdio qdio; |
Swen Schillig | 5706938 | 2008-10-01 12:42:21 +0200 | [diff] [blame] | 155 | struct fsf_bit_error_payload berr; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 156 | } u; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 157 | } __attribute__ ((packed)); |
| 158 | |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 159 | struct zfcp_san_dbf_record_ct_request { |
| 160 | u16 cmd_req_code; |
| 161 | u8 revision; |
| 162 | u8 gs_type; |
| 163 | u8 gs_subtype; |
| 164 | u8 options; |
| 165 | u16 max_res_size; |
| 166 | u32 len; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 167 | } __attribute__ ((packed)); |
| 168 | |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 169 | struct zfcp_san_dbf_record_ct_response { |
| 170 | u16 cmd_rsp_code; |
| 171 | u8 revision; |
| 172 | u8 reason_code; |
| 173 | u8 expl; |
| 174 | u8 vendor_unique; |
Christof Schmitt | 39eb7e9 | 2008-12-19 16:57:01 +0100 | [diff] [blame] | 175 | u16 max_res_size; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 176 | u32 len; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 177 | } __attribute__ ((packed)); |
| 178 | |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 179 | struct zfcp_san_dbf_record_els { |
| 180 | u8 ls_code; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 181 | u32 len; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 182 | } __attribute__ ((packed)); |
| 183 | |
| 184 | struct zfcp_san_dbf_record { |
| 185 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
| 186 | u64 fsf_reqid; |
| 187 | u32 fsf_seqno; |
| 188 | u32 s_id; |
| 189 | u32 d_id; |
| 190 | union { |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 191 | struct zfcp_san_dbf_record_ct_request ct_req; |
| 192 | struct zfcp_san_dbf_record_ct_response ct_resp; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 193 | struct zfcp_san_dbf_record_els els; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 194 | } u; |
Christof Schmitt | d94ce6c | 2008-11-04 16:35:12 +0100 | [diff] [blame] | 195 | #define ZFCP_DBF_SAN_MAX_PAYLOAD 1024 |
| 196 | u8 payload[32]; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 197 | } __attribute__ ((packed)); |
| 198 | |
| 199 | struct zfcp_scsi_dbf_record { |
| 200 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
| 201 | u8 tag2[ZFCP_DBF_TAG_SIZE]; |
| 202 | u32 scsi_id; |
| 203 | u32 scsi_lun; |
| 204 | u32 scsi_result; |
| 205 | u64 scsi_cmnd; |
| 206 | u64 scsi_serial; |
| 207 | #define ZFCP_DBF_SCSI_OPCODE 16 |
| 208 | u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE]; |
| 209 | u8 scsi_retries; |
| 210 | u8 scsi_allowed; |
| 211 | u64 fsf_reqid; |
| 212 | u32 fsf_seqno; |
| 213 | u64 fsf_issued; |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 214 | u64 old_fsf_reqid; |
| 215 | u8 rsp_validity; |
| 216 | u8 rsp_scsi_status; |
| 217 | u32 rsp_resid; |
| 218 | u8 rsp_code; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 219 | #define ZFCP_DBF_SCSI_FCP_SNS_INFO 16 |
| 220 | #define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256 |
Martin Peschke | 6bc473d | 2008-03-31 11:15:29 +0200 | [diff] [blame] | 221 | u32 sns_info_len; |
| 222 | u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO]; |
Christof Schmitt | 2b604c9 | 2008-03-31 11:15:28 +0200 | [diff] [blame] | 223 | } __attribute__ ((packed)); |
| 224 | |
| 225 | #endif /* ZFCP_DBF_H */ |