Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. |
| 3 | * All rights reserved |
| 4 | * www.brocade.com |
| 5 | * |
| 6 | * Linux driver for Brocade Fibre Channel Host Bus Adapter. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License (GPL) Version 2 as |
| 10 | * published by the Free Software Foundation |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | */ |
| 17 | |
| 18 | #ifndef __BFI_MS_H__ |
| 19 | #define __BFI_MS_H__ |
| 20 | |
| 21 | #include "bfi.h" |
| 22 | #include "bfa_fc.h" |
| 23 | #include "bfa_defs_svc.h" |
| 24 | |
| 25 | #pragma pack(1) |
| 26 | |
| 27 | enum bfi_iocfc_h2i_msgs { |
| 28 | BFI_IOCFC_H2I_CFG_REQ = 1, |
| 29 | BFI_IOCFC_H2I_SET_INTR_REQ = 2, |
| 30 | BFI_IOCFC_H2I_UPDATEQ_REQ = 3, |
Krishna Gudipati | a714134 | 2011-06-24 20:23:19 -0700 | [diff] [blame] | 31 | BFI_IOCFC_H2I_FAA_ENABLE_REQ = 4, |
| 32 | BFI_IOCFC_H2I_FAA_DISABLE_REQ = 5, |
| 33 | BFI_IOCFC_H2I_FAA_QUERY_REQ = 6, |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | enum bfi_iocfc_i2h_msgs { |
| 37 | BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1), |
| 38 | BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(3), |
Krishna Gudipati | a714134 | 2011-06-24 20:23:19 -0700 | [diff] [blame] | 39 | BFI_IOCFC_I2H_FAA_ENABLE_RSP = BFA_I2HM(4), |
| 40 | BFI_IOCFC_I2H_FAA_DISABLE_RSP = BFA_I2HM(5), |
| 41 | BFI_IOCFC_I2H_FAA_QUERY_RSP = BFA_I2HM(6), |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | struct bfi_iocfc_cfg_s { |
| 45 | u8 num_cqs; /* Number of CQs to be used */ |
| 46 | u8 sense_buf_len; /* SCSI sense length */ |
| 47 | u16 rsvd_1; |
| 48 | u32 endian_sig; /* endian signature of host */ |
Krishna Gudipati | e2187d7 | 2011-06-13 15:53:58 -0700 | [diff] [blame] | 49 | __be16 num_ioim_reqs; |
| 50 | __be16 num_fwtio_reqs; |
Krishna Gudipati | 10a0737 | 2011-06-24 20:23:38 -0700 | [diff] [blame] | 51 | u8 single_msix_vec; |
| 52 | u8 rsvd[3]; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 53 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 54 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 55 | * Request and response circular queue base addresses, size and |
| 56 | * shadow index pointers. |
| 57 | */ |
| 58 | union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS]; |
| 59 | union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS]; |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 60 | __be16 req_cq_elems[BFI_IOC_MAX_CQS]; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 61 | union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS]; |
| 62 | union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS]; |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 63 | __be16 rsp_cq_elems[BFI_IOC_MAX_CQS]; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 64 | |
| 65 | union bfi_addr_u stats_addr; /* DMA-able address for stats */ |
| 66 | union bfi_addr_u cfgrsp_addr; /* config response dma address */ |
| 67 | union bfi_addr_u ioim_snsbase; /* IO sense buffer base address */ |
| 68 | struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */ |
| 69 | }; |
| 70 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 71 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 72 | * Boot target wwn information for this port. This contains either the stored |
| 73 | * or discovered boot target port wwns for the port. |
| 74 | */ |
| 75 | struct bfi_iocfc_bootwwns { |
| 76 | wwn_t wwn[BFA_BOOT_BOOTLUN_MAX]; |
| 77 | u8 nwwns; |
| 78 | u8 rsvd[7]; |
| 79 | }; |
| 80 | |
Krishna Gudipati | 1118920 | 2011-06-13 15:50:35 -0700 | [diff] [blame] | 81 | /** |
| 82 | * Queue configuration response from firmware |
| 83 | */ |
| 84 | struct bfi_iocfc_qreg_s { |
| 85 | u32 cpe_q_ci_off[BFI_IOC_MAX_CQS]; |
| 86 | u32 cpe_q_pi_off[BFI_IOC_MAX_CQS]; |
| 87 | u32 cpe_qctl_off[BFI_IOC_MAX_CQS]; |
| 88 | u32 rme_q_ci_off[BFI_IOC_MAX_CQS]; |
| 89 | u32 rme_q_pi_off[BFI_IOC_MAX_CQS]; |
| 90 | u32 rme_qctl_off[BFI_IOC_MAX_CQS]; |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 91 | u8 hw_qid[BFI_IOC_MAX_CQS]; |
Krishna Gudipati | 1118920 | 2011-06-13 15:50:35 -0700 | [diff] [blame] | 92 | }; |
| 93 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 94 | struct bfi_iocfc_cfgrsp_s { |
| 95 | struct bfa_iocfc_fwcfg_s fwcfg; |
| 96 | struct bfa_iocfc_intr_attr_s intr_attr; |
| 97 | struct bfi_iocfc_bootwwns bootwwns; |
| 98 | struct bfi_pbc_s pbc_cfg; |
Krishna Gudipati | 1118920 | 2011-06-13 15:50:35 -0700 | [diff] [blame] | 99 | struct bfi_iocfc_qreg_s qreg; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 100 | }; |
| 101 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 102 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 103 | * BFI_IOCFC_H2I_CFG_REQ message |
| 104 | */ |
| 105 | struct bfi_iocfc_cfg_req_s { |
| 106 | struct bfi_mhdr_s mh; |
| 107 | union bfi_addr_u ioc_cfg_dma_addr; |
| 108 | }; |
| 109 | |
| 110 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 111 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 112 | * BFI_IOCFC_I2H_CFG_REPLY message |
| 113 | */ |
| 114 | struct bfi_iocfc_cfg_reply_s { |
| 115 | struct bfi_mhdr_s mh; /* Common msg header */ |
| 116 | u8 cfg_success; /* cfg reply status */ |
| 117 | u8 lpu_bm; /* LPUs assigned for this IOC */ |
| 118 | u8 rsvd[2]; |
| 119 | }; |
| 120 | |
| 121 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 122 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 123 | * BFI_IOCFC_H2I_SET_INTR_REQ message |
| 124 | */ |
| 125 | struct bfi_iocfc_set_intr_req_s { |
| 126 | struct bfi_mhdr_s mh; /* common msg header */ |
| 127 | u8 coalesce; /* enable intr coalescing */ |
| 128 | u8 rsvd[3]; |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 129 | __be16 delay; /* delay timer 0..1125us */ |
| 130 | __be16 latency; /* latency timer 0..225us */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 131 | }; |
| 132 | |
| 133 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 134 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 135 | * BFI_IOCFC_H2I_UPDATEQ_REQ message |
| 136 | */ |
| 137 | struct bfi_iocfc_updateq_req_s { |
| 138 | struct bfi_mhdr_s mh; /* common msg header */ |
| 139 | u32 reqq_ba; /* reqq base addr */ |
| 140 | u32 rspq_ba; /* rspq base addr */ |
| 141 | u32 reqq_sci; /* reqq shadow ci */ |
| 142 | u32 rspq_spi; /* rspq shadow pi */ |
| 143 | }; |
| 144 | |
| 145 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 146 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 147 | * BFI_IOCFC_I2H_UPDATEQ_RSP message |
| 148 | */ |
| 149 | struct bfi_iocfc_updateq_rsp_s { |
| 150 | struct bfi_mhdr_s mh; /* common msg header */ |
| 151 | u8 status; /* updateq status */ |
| 152 | u8 rsvd[3]; |
| 153 | }; |
| 154 | |
| 155 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 156 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 157 | * H2I Messages |
| 158 | */ |
| 159 | union bfi_iocfc_h2i_msg_u { |
| 160 | struct bfi_mhdr_s mh; |
| 161 | struct bfi_iocfc_cfg_req_s cfg_req; |
| 162 | struct bfi_iocfc_updateq_req_s updateq_req; |
| 163 | u32 mboxmsg[BFI_IOC_MSGSZ]; |
| 164 | }; |
| 165 | |
| 166 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 167 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 168 | * I2H Messages |
| 169 | */ |
| 170 | union bfi_iocfc_i2h_msg_u { |
| 171 | struct bfi_mhdr_s mh; |
| 172 | struct bfi_iocfc_cfg_reply_s cfg_reply; |
| 173 | struct bfi_iocfc_updateq_rsp_s updateq_rsp; |
| 174 | u32 mboxmsg[BFI_IOC_MSGSZ]; |
| 175 | }; |
| 176 | |
Krishna Gudipati | a714134 | 2011-06-24 20:23:19 -0700 | [diff] [blame] | 177 | /* |
| 178 | * BFI_IOCFC_H2I_FAA_ENABLE_REQ BFI_IOCFC_H2I_FAA_DISABLE_REQ message |
| 179 | */ |
| 180 | struct bfi_faa_en_dis_s { |
| 181 | struct bfi_mhdr_s mh; /* common msg header */ |
| 182 | }; |
| 183 | |
| 184 | /* |
| 185 | * BFI_IOCFC_H2I_FAA_QUERY_REQ message |
| 186 | */ |
| 187 | struct bfi_faa_query_s { |
| 188 | struct bfi_mhdr_s mh; /* common msg header */ |
| 189 | u8 faa_status; /* FAA status */ |
| 190 | u8 addr_source; /* PWWN source */ |
| 191 | u8 rsvd[2]; |
| 192 | wwn_t faa; /* Fabric acquired PWWN */ |
| 193 | }; |
| 194 | |
| 195 | /* |
| 196 | * BFI_IOCFC_I2H_FAA_ENABLE_RSP, BFI_IOCFC_I2H_FAA_DISABLE_RSP message |
| 197 | */ |
| 198 | struct bfi_faa_en_dis_rsp_s { |
| 199 | struct bfi_mhdr_s mh; /* common msg header */ |
| 200 | u8 status; /* updateq status */ |
| 201 | u8 rsvd[3]; |
| 202 | }; |
| 203 | |
| 204 | /* |
| 205 | * BFI_IOCFC_I2H_FAA_QUERY_RSP message |
| 206 | */ |
| 207 | #define bfi_faa_query_rsp_t struct bfi_faa_query_s |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 208 | |
| 209 | enum bfi_fcport_h2i { |
| 210 | BFI_FCPORT_H2I_ENABLE_REQ = (1), |
| 211 | BFI_FCPORT_H2I_DISABLE_REQ = (2), |
| 212 | BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ = (3), |
| 213 | BFI_FCPORT_H2I_STATS_GET_REQ = (4), |
| 214 | BFI_FCPORT_H2I_STATS_CLEAR_REQ = (5), |
| 215 | }; |
| 216 | |
| 217 | |
| 218 | enum bfi_fcport_i2h { |
| 219 | BFI_FCPORT_I2H_ENABLE_RSP = BFA_I2HM(1), |
| 220 | BFI_FCPORT_I2H_DISABLE_RSP = BFA_I2HM(2), |
| 221 | BFI_FCPORT_I2H_SET_SVC_PARAMS_RSP = BFA_I2HM(3), |
| 222 | BFI_FCPORT_I2H_STATS_GET_RSP = BFA_I2HM(4), |
| 223 | BFI_FCPORT_I2H_STATS_CLEAR_RSP = BFA_I2HM(5), |
| 224 | BFI_FCPORT_I2H_EVENT = BFA_I2HM(6), |
| 225 | BFI_FCPORT_I2H_TRUNK_SCN = BFA_I2HM(7), |
| 226 | BFI_FCPORT_I2H_ENABLE_AEN = BFA_I2HM(8), |
| 227 | BFI_FCPORT_I2H_DISABLE_AEN = BFA_I2HM(9), |
| 228 | }; |
| 229 | |
| 230 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 231 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 232 | * Generic REQ type |
| 233 | */ |
| 234 | struct bfi_fcport_req_s { |
| 235 | struct bfi_mhdr_s mh; /* msg header */ |
| 236 | u32 msgtag; /* msgtag for reply */ |
| 237 | }; |
| 238 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 239 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 240 | * Generic RSP type |
| 241 | */ |
| 242 | struct bfi_fcport_rsp_s { |
| 243 | struct bfi_mhdr_s mh; /* common msg header */ |
| 244 | u8 status; /* port enable status */ |
| 245 | u8 rsvd[3]; |
Krishna Gudipati | f3a060c | 2010-12-13 16:16:50 -0800 | [diff] [blame] | 246 | struct bfa_port_cfg_s port_cfg;/* port configuration */ |
| 247 | u32 msgtag; /* msgtag for reply */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 248 | }; |
| 249 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 250 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 251 | * BFI_FCPORT_H2I_ENABLE_REQ |
| 252 | */ |
| 253 | struct bfi_fcport_enable_req_s { |
| 254 | struct bfi_mhdr_s mh; /* msg header */ |
| 255 | u32 rsvd1; |
| 256 | wwn_t nwwn; /* node wwn of physical port */ |
| 257 | wwn_t pwwn; /* port wwn of physical port */ |
| 258 | struct bfa_port_cfg_s port_cfg; /* port configuration */ |
| 259 | union bfi_addr_u stats_dma_addr; /* DMA address for stats */ |
| 260 | u32 msgtag; /* msgtag for reply */ |
Krishna Gudipati | f3a060c | 2010-12-13 16:16:50 -0800 | [diff] [blame] | 261 | u8 use_flash_cfg; /* get prot cfg from flash */ |
| 262 | u8 rsvd2[3]; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 263 | }; |
| 264 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 265 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 266 | * BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ |
| 267 | */ |
| 268 | struct bfi_fcport_set_svc_params_req_s { |
| 269 | struct bfi_mhdr_s mh; /* msg header */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 270 | __be16 tx_bbcredit; /* Tx credits */ |
Krishna Gudipati | be540a9 | 2011-06-13 15:53:04 -0700 | [diff] [blame] | 271 | u8 bb_scn; /* BB_SC FC credit recovery */ |
| 272 | u8 rsvd; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 273 | }; |
| 274 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 275 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 276 | * BFI_FCPORT_I2H_EVENT |
| 277 | */ |
| 278 | struct bfi_fcport_event_s { |
| 279 | struct bfi_mhdr_s mh; /* common msg header */ |
| 280 | struct bfa_port_link_s link_state; |
| 281 | }; |
| 282 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 283 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 284 | * BFI_FCPORT_I2H_TRUNK_SCN |
| 285 | */ |
| 286 | struct bfi_fcport_trunk_link_s { |
| 287 | wwn_t trunk_wwn; |
| 288 | u8 fctl; /* bfa_trunk_link_fctl_t */ |
| 289 | u8 state; /* bfa_trunk_link_state_t */ |
| 290 | u8 speed; /* bfa_port_speed_t */ |
| 291 | u8 rsvd; |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 292 | __be32 deskew; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 293 | }; |
| 294 | |
| 295 | #define BFI_FCPORT_MAX_LINKS 2 |
| 296 | struct bfi_fcport_trunk_scn_s { |
| 297 | struct bfi_mhdr_s mh; |
| 298 | u8 trunk_state; /* bfa_trunk_state_t */ |
| 299 | u8 trunk_speed; /* bfa_port_speed_t */ |
| 300 | u8 rsvd_a[2]; |
| 301 | struct bfi_fcport_trunk_link_s tlink[BFI_FCPORT_MAX_LINKS]; |
| 302 | }; |
| 303 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 304 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 305 | * fcport H2I message |
| 306 | */ |
| 307 | union bfi_fcport_h2i_msg_u { |
| 308 | struct bfi_mhdr_s *mhdr; |
| 309 | struct bfi_fcport_enable_req_s *penable; |
| 310 | struct bfi_fcport_req_s *pdisable; |
| 311 | struct bfi_fcport_set_svc_params_req_s *psetsvcparams; |
| 312 | struct bfi_fcport_req_s *pstatsget; |
| 313 | struct bfi_fcport_req_s *pstatsclear; |
| 314 | }; |
| 315 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 316 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 317 | * fcport I2H message |
| 318 | */ |
| 319 | union bfi_fcport_i2h_msg_u { |
| 320 | struct bfi_msg_s *msg; |
| 321 | struct bfi_fcport_rsp_s *penable_rsp; |
| 322 | struct bfi_fcport_rsp_s *pdisable_rsp; |
| 323 | struct bfi_fcport_rsp_s *psetsvcparams_rsp; |
| 324 | struct bfi_fcport_rsp_s *pstatsget_rsp; |
| 325 | struct bfi_fcport_rsp_s *pstatsclear_rsp; |
| 326 | struct bfi_fcport_event_s *event; |
| 327 | struct bfi_fcport_trunk_scn_s *trunk_scn; |
| 328 | }; |
| 329 | |
| 330 | enum bfi_fcxp_h2i { |
| 331 | BFI_FCXP_H2I_SEND_REQ = 1, |
| 332 | }; |
| 333 | |
| 334 | enum bfi_fcxp_i2h { |
| 335 | BFI_FCXP_I2H_SEND_RSP = BFA_I2HM(1), |
| 336 | }; |
| 337 | |
| 338 | #define BFA_FCXP_MAX_SGES 2 |
| 339 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 340 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 341 | * FCXP send request structure |
| 342 | */ |
| 343 | struct bfi_fcxp_send_req_s { |
| 344 | struct bfi_mhdr_s mh; /* Common msg header */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 345 | __be16 fcxp_tag; /* driver request tag */ |
| 346 | __be16 max_frmsz; /* max send frame size */ |
| 347 | __be16 vf_id; /* vsan tag if applicable */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 348 | u16 rport_fw_hndl; /* FW Handle for the remote port */ |
| 349 | u8 class; /* FC class used for req/rsp */ |
| 350 | u8 rsp_timeout; /* timeout in secs, 0-no response */ |
| 351 | u8 cts; /* continue sequence */ |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 352 | u8 lp_fwtag; /* lport tag */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 353 | struct fchs_s fchs; /* request FC header structure */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 354 | __be32 req_len; /* request payload length */ |
| 355 | __be32 rsp_maxlen; /* max response length expected */ |
Krishna Gudipati | 85ce928 | 2011-06-13 15:39:36 -0700 | [diff] [blame] | 356 | struct bfi_alen_s req_alen; /* request buffer */ |
| 357 | struct bfi_alen_s rsp_alen; /* response buffer */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 358 | }; |
| 359 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 360 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 361 | * FCXP send response structure |
| 362 | */ |
| 363 | struct bfi_fcxp_send_rsp_s { |
| 364 | struct bfi_mhdr_s mh; /* Common msg header */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 365 | __be16 fcxp_tag; /* send request tag */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 366 | u8 req_status; /* request status */ |
| 367 | u8 rsvd; |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 368 | __be32 rsp_len; /* actual response length */ |
| 369 | __be32 residue_len; /* residual response length */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 370 | struct fchs_s fchs; /* response FC header structure */ |
| 371 | }; |
| 372 | |
| 373 | enum bfi_uf_h2i { |
| 374 | BFI_UF_H2I_BUF_POST = 1, |
| 375 | }; |
| 376 | |
| 377 | enum bfi_uf_i2h { |
| 378 | BFI_UF_I2H_FRM_RCVD = BFA_I2HM(1), |
| 379 | }; |
| 380 | |
| 381 | #define BFA_UF_MAX_SGES 2 |
| 382 | |
| 383 | struct bfi_uf_buf_post_s { |
| 384 | struct bfi_mhdr_s mh; /* Common msg header */ |
| 385 | u16 buf_tag; /* buffer tag */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 386 | __be16 buf_len; /* total buffer length */ |
Krishna Gudipati | 85ce928 | 2011-06-13 15:39:36 -0700 | [diff] [blame] | 387 | struct bfi_alen_s alen; /* buffer address/len pair */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 388 | }; |
| 389 | |
| 390 | struct bfi_uf_frm_rcvd_s { |
| 391 | struct bfi_mhdr_s mh; /* Common msg header */ |
| 392 | u16 buf_tag; /* buffer tag */ |
| 393 | u16 rsvd; |
| 394 | u16 frm_len; /* received frame length */ |
| 395 | u16 xfr_len; /* tranferred length */ |
| 396 | }; |
| 397 | |
| 398 | enum bfi_lps_h2i_msgs { |
| 399 | BFI_LPS_H2I_LOGIN_REQ = 1, |
| 400 | BFI_LPS_H2I_LOGOUT_REQ = 2, |
Krishna Gudipati | b704495 | 2010-12-13 16:17:42 -0800 | [diff] [blame] | 401 | BFI_LPS_H2I_N2N_PID_REQ = 3, |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 402 | }; |
| 403 | |
| 404 | enum bfi_lps_i2h_msgs { |
Krishna Gudipati | 43ffdf4 | 2011-06-13 15:46:21 -0700 | [diff] [blame] | 405 | BFI_LPS_I2H_LOGIN_RSP = BFA_I2HM(1), |
| 406 | BFI_LPS_I2H_LOGOUT_RSP = BFA_I2HM(2), |
| 407 | BFI_LPS_I2H_CVL_EVENT = BFA_I2HM(3), |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 408 | }; |
| 409 | |
| 410 | struct bfi_lps_login_req_s { |
| 411 | struct bfi_mhdr_s mh; /* common msg header */ |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 412 | u8 bfa_tag; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 413 | u8 alpa; |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 414 | __be16 pdu_size; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 415 | wwn_t pwwn; |
| 416 | wwn_t nwwn; |
| 417 | u8 fdisc; |
| 418 | u8 auth_en; |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 419 | u8 lps_role; |
Krishna Gudipati | be540a9 | 2011-06-13 15:53:04 -0700 | [diff] [blame] | 420 | u8 bb_scn; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 421 | }; |
| 422 | |
| 423 | struct bfi_lps_login_rsp_s { |
| 424 | struct bfi_mhdr_s mh; /* common msg header */ |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 425 | u8 fw_tag; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 426 | u8 status; |
| 427 | u8 lsrjt_rsn; |
| 428 | u8 lsrjt_expl; |
| 429 | wwn_t port_name; |
| 430 | wwn_t node_name; |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 431 | __be16 bb_credit; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 432 | u8 f_port; |
| 433 | u8 npiv_en; |
| 434 | u32 lp_pid:24; |
| 435 | u32 auth_req:8; |
| 436 | mac_t lp_mac; |
| 437 | mac_t fcf_mac; |
| 438 | u8 ext_status; |
| 439 | u8 brcd_switch; /* attached peer is brcd switch */ |
Krishna Gudipati | be540a9 | 2011-06-13 15:53:04 -0700 | [diff] [blame] | 440 | u8 bb_scn; /* atatched port's bb_scn */ |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 441 | u8 bfa_tag; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 442 | }; |
| 443 | |
| 444 | struct bfi_lps_logout_req_s { |
| 445 | struct bfi_mhdr_s mh; /* common msg header */ |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 446 | u8 fw_tag; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 447 | u8 rsvd[3]; |
| 448 | wwn_t port_name; |
| 449 | }; |
| 450 | |
| 451 | struct bfi_lps_logout_rsp_s { |
| 452 | struct bfi_mhdr_s mh; /* common msg header */ |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 453 | u8 bfa_tag; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 454 | u8 status; |
| 455 | u8 rsvd[2]; |
| 456 | }; |
| 457 | |
| 458 | struct bfi_lps_cvl_event_s { |
| 459 | struct bfi_mhdr_s mh; /* common msg header */ |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 460 | u8 bfa_tag; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 461 | u8 rsvd[3]; |
| 462 | }; |
| 463 | |
Krishna Gudipati | b704495 | 2010-12-13 16:17:42 -0800 | [diff] [blame] | 464 | struct bfi_lps_n2n_pid_req_s { |
| 465 | struct bfi_mhdr_s mh; /* common msg header */ |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 466 | u8 fw_tag; |
Krishna Gudipati | b704495 | 2010-12-13 16:17:42 -0800 | [diff] [blame] | 467 | u32 lp_pid:24; |
| 468 | }; |
| 469 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 470 | union bfi_lps_h2i_msg_u { |
| 471 | struct bfi_mhdr_s *msg; |
| 472 | struct bfi_lps_login_req_s *login_req; |
| 473 | struct bfi_lps_logout_req_s *logout_req; |
Krishna Gudipati | b704495 | 2010-12-13 16:17:42 -0800 | [diff] [blame] | 474 | struct bfi_lps_n2n_pid_req_s *n2n_pid_req; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 475 | }; |
| 476 | |
| 477 | union bfi_lps_i2h_msg_u { |
| 478 | struct bfi_msg_s *msg; |
| 479 | struct bfi_lps_login_rsp_s *login_rsp; |
| 480 | struct bfi_lps_logout_rsp_s *logout_rsp; |
| 481 | struct bfi_lps_cvl_event_s *cvl_event; |
| 482 | }; |
| 483 | |
| 484 | enum bfi_rport_h2i_msgs { |
| 485 | BFI_RPORT_H2I_CREATE_REQ = 1, |
| 486 | BFI_RPORT_H2I_DELETE_REQ = 2, |
| 487 | BFI_RPORT_H2I_SET_SPEED_REQ = 3, |
| 488 | }; |
| 489 | |
| 490 | enum bfi_rport_i2h_msgs { |
| 491 | BFI_RPORT_I2H_CREATE_RSP = BFA_I2HM(1), |
| 492 | BFI_RPORT_I2H_DELETE_RSP = BFA_I2HM(2), |
| 493 | BFI_RPORT_I2H_QOS_SCN = BFA_I2HM(3), |
| 494 | }; |
| 495 | |
| 496 | struct bfi_rport_create_req_s { |
| 497 | struct bfi_mhdr_s mh; /* common msg header */ |
| 498 | u16 bfa_handle; /* host rport handle */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 499 | __be16 max_frmsz; /* max rcv pdu size */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 500 | u32 pid:24, /* remote port ID */ |
Krishna Gudipati | 3fd4598 | 2011-06-24 20:24:08 -0700 | [diff] [blame^] | 501 | lp_fwtag:8; /* local port tag */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 502 | u32 local_pid:24, /* local port ID */ |
| 503 | cisc:8; |
| 504 | u8 fc_class; /* supported FC classes */ |
| 505 | u8 vf_en; /* virtual fabric enable */ |
| 506 | u16 vf_id; /* virtual fabric ID */ |
| 507 | }; |
| 508 | |
| 509 | struct bfi_rport_create_rsp_s { |
| 510 | struct bfi_mhdr_s mh; /* common msg header */ |
| 511 | u8 status; /* rport creation status */ |
| 512 | u8 rsvd[3]; |
| 513 | u16 bfa_handle; /* host rport handle */ |
| 514 | u16 fw_handle; /* firmware rport handle */ |
| 515 | struct bfa_rport_qos_attr_s qos_attr; /* QoS Attributes */ |
| 516 | }; |
| 517 | |
| 518 | struct bfa_rport_speed_req_s { |
| 519 | struct bfi_mhdr_s mh; /* common msg header */ |
| 520 | u16 fw_handle; /* firmware rport handle */ |
| 521 | u8 speed; /* rport's speed via RPSC */ |
| 522 | u8 rsvd; |
| 523 | }; |
| 524 | |
| 525 | struct bfi_rport_delete_req_s { |
| 526 | struct bfi_mhdr_s mh; /* common msg header */ |
| 527 | u16 fw_handle; /* firmware rport handle */ |
| 528 | u16 rsvd; |
| 529 | }; |
| 530 | |
| 531 | struct bfi_rport_delete_rsp_s { |
| 532 | struct bfi_mhdr_s mh; /* common msg header */ |
| 533 | u16 bfa_handle; /* host rport handle */ |
| 534 | u8 status; /* rport deletion status */ |
| 535 | u8 rsvd; |
| 536 | }; |
| 537 | |
| 538 | struct bfi_rport_qos_scn_s { |
| 539 | struct bfi_mhdr_s mh; /* common msg header */ |
| 540 | u16 bfa_handle; /* host rport handle */ |
| 541 | u16 rsvd; |
| 542 | struct bfa_rport_qos_attr_s old_qos_attr; /* Old QoS Attributes */ |
| 543 | struct bfa_rport_qos_attr_s new_qos_attr; /* New QoS Attributes */ |
| 544 | }; |
| 545 | |
| 546 | union bfi_rport_h2i_msg_u { |
| 547 | struct bfi_msg_s *msg; |
| 548 | struct bfi_rport_create_req_s *create_req; |
| 549 | struct bfi_rport_delete_req_s *delete_req; |
| 550 | struct bfi_rport_speed_req_s *speed_req; |
| 551 | }; |
| 552 | |
| 553 | union bfi_rport_i2h_msg_u { |
| 554 | struct bfi_msg_s *msg; |
| 555 | struct bfi_rport_create_rsp_s *create_rsp; |
| 556 | struct bfi_rport_delete_rsp_s *delete_rsp; |
| 557 | struct bfi_rport_qos_scn_s *qos_scn_evt; |
| 558 | }; |
| 559 | |
| 560 | /* |
| 561 | * Initiator mode I-T nexus interface defines. |
| 562 | */ |
| 563 | |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 564 | enum bfi_itn_h2i { |
| 565 | BFI_ITN_H2I_CREATE_REQ = 1, /* i-t nexus creation */ |
| 566 | BFI_ITN_H2I_DELETE_REQ = 2, /* i-t nexus deletion */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 567 | }; |
| 568 | |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 569 | enum bfi_itn_i2h { |
| 570 | BFI_ITN_I2H_CREATE_RSP = BFA_I2HM(1), |
| 571 | BFI_ITN_I2H_DELETE_RSP = BFA_I2HM(2), |
| 572 | BFI_ITN_I2H_SLER_EVENT = BFA_I2HM(3), |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 573 | }; |
| 574 | |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 575 | struct bfi_itn_create_req_s { |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 576 | struct bfi_mhdr_s mh; /* common msg header */ |
| 577 | u16 fw_handle; /* f/w handle for itnim */ |
| 578 | u8 class; /* FC class for IO */ |
| 579 | u8 seq_rec; /* sequence recovery support */ |
| 580 | u8 msg_no; /* seq id of the msg */ |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 581 | u8 role; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 582 | }; |
| 583 | |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 584 | struct bfi_itn_create_rsp_s { |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 585 | struct bfi_mhdr_s mh; /* common msg header */ |
| 586 | u16 bfa_handle; /* bfa handle for itnim */ |
| 587 | u8 status; /* fcp request status */ |
| 588 | u8 seq_id; /* seq id of the msg */ |
| 589 | }; |
| 590 | |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 591 | struct bfi_itn_delete_req_s { |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 592 | struct bfi_mhdr_s mh; /* common msg header */ |
| 593 | u16 fw_handle; /* f/w itnim handle */ |
| 594 | u8 seq_id; /* seq id of the msg */ |
| 595 | u8 rsvd; |
| 596 | }; |
| 597 | |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 598 | struct bfi_itn_delete_rsp_s { |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 599 | struct bfi_mhdr_s mh; /* common msg header */ |
| 600 | u16 bfa_handle; /* bfa handle for itnim */ |
| 601 | u8 status; /* fcp request status */ |
| 602 | u8 seq_id; /* seq id of the msg */ |
| 603 | }; |
| 604 | |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 605 | struct bfi_itn_sler_event_s { |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 606 | struct bfi_mhdr_s mh; /* common msg header */ |
| 607 | u16 bfa_handle; /* bfa handle for itnim */ |
| 608 | u16 rsvd; |
| 609 | }; |
| 610 | |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 611 | union bfi_itn_h2i_msg_u { |
| 612 | struct bfi_itn_create_req_s *create_req; |
| 613 | struct bfi_itn_delete_req_s *delete_req; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 614 | struct bfi_msg_s *msg; |
| 615 | }; |
| 616 | |
Krishna Gudipati | dd5aaf4 | 2011-06-13 15:51:24 -0700 | [diff] [blame] | 617 | union bfi_itn_i2h_msg_u { |
| 618 | struct bfi_itn_create_rsp_s *create_rsp; |
| 619 | struct bfi_itn_delete_rsp_s *delete_rsp; |
| 620 | struct bfi_itn_sler_event_s *sler_event; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 621 | struct bfi_msg_s *msg; |
| 622 | }; |
| 623 | |
| 624 | /* |
| 625 | * Initiator mode IO interface defines. |
| 626 | */ |
| 627 | |
| 628 | enum bfi_ioim_h2i { |
| 629 | BFI_IOIM_H2I_IOABORT_REQ = 1, /* IO abort request */ |
| 630 | BFI_IOIM_H2I_IOCLEANUP_REQ = 2, /* IO cleanup request */ |
| 631 | }; |
| 632 | |
| 633 | enum bfi_ioim_i2h { |
| 634 | BFI_IOIM_I2H_IO_RSP = BFA_I2HM(1), /* non-fp IO response */ |
| 635 | BFI_IOIM_I2H_IOABORT_RSP = BFA_I2HM(2), /* ABORT rsp */ |
| 636 | }; |
| 637 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 638 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 639 | * IO command DIF info |
| 640 | */ |
| 641 | struct bfi_ioim_dif_s { |
| 642 | u32 dif_info[4]; |
| 643 | }; |
| 644 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 645 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 646 | * FCP IO messages overview |
| 647 | * |
| 648 | * @note |
| 649 | * - Max CDB length supported is 64 bytes. |
| 650 | * - SCSI Linked commands and SCSI bi-directional Commands not |
| 651 | * supported. |
| 652 | * |
| 653 | */ |
| 654 | struct bfi_ioim_req_s { |
| 655 | struct bfi_mhdr_s mh; /* Common msg header */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 656 | __be16 io_tag; /* I/O tag */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 657 | u16 rport_hdl; /* itnim/rport firmware handle */ |
| 658 | struct fcp_cmnd_s cmnd; /* IO request info */ |
| 659 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 660 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 661 | * SG elements array within the IO request must be double word |
| 662 | * aligned. This aligment is required to optimize SGM setup for the IO. |
| 663 | */ |
| 664 | struct bfi_sge_s sges[BFI_SGE_INLINE_MAX]; |
| 665 | u8 io_timeout; |
| 666 | u8 dif_en; |
| 667 | u8 rsvd_a[2]; |
| 668 | struct bfi_ioim_dif_s dif; |
| 669 | }; |
| 670 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 671 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 672 | * This table shows various IO status codes from firmware and their |
| 673 | * meaning. Host driver can use these status codes to further process |
| 674 | * IO completions. |
| 675 | * |
| 676 | * BFI_IOIM_STS_OK : IO completed with error free SCSI & |
| 677 | * transport status. |
| 678 | * io-tag can be reused. |
| 679 | * |
| 680 | * BFA_IOIM_STS_SCSI_ERR : IO completed with scsi error. |
| 681 | * - io-tag can be reused. |
| 682 | * |
| 683 | * BFI_IOIM_STS_HOST_ABORTED : IO was aborted successfully due to |
| 684 | * host request. |
| 685 | * - io-tag cannot be reused yet. |
| 686 | * |
| 687 | * BFI_IOIM_STS_ABORTED : IO was aborted successfully |
| 688 | * internally by f/w. |
| 689 | * - io-tag cannot be reused yet. |
| 690 | * |
| 691 | * BFI_IOIM_STS_TIMEDOUT : IO timedout and ABTS/RRQ is happening |
| 692 | * in the firmware and |
| 693 | * - io-tag cannot be reused yet. |
| 694 | * |
| 695 | * BFI_IOIM_STS_SQER_NEEDED : Firmware could not recover the IO |
| 696 | * with sequence level error |
| 697 | * logic and hence host needs to retry |
| 698 | * this IO with a different IO tag |
| 699 | * - io-tag cannot be used yet. |
| 700 | * |
| 701 | * BFI_IOIM_STS_NEXUS_ABORT : Second Level Error Recovery from host |
| 702 | * is required because 2 consecutive ABTS |
| 703 | * timedout and host needs logout and |
| 704 | * re-login with the target |
| 705 | * - io-tag cannot be used yet. |
| 706 | * |
| 707 | * BFI_IOIM_STS_UNDERRUN : IO completed with SCSI status good, |
| 708 | * but the data tranferred is less than |
| 709 | * the fcp data length in the command. |
| 710 | * ex. SCSI INQUIRY where transferred |
| 711 | * data length and residue count in FCP |
| 712 | * response accounts for total fcp-dl |
| 713 | * - io-tag can be reused. |
| 714 | * |
| 715 | * BFI_IOIM_STS_OVERRUN : IO completed with SCSI status good, |
| 716 | * but the data transerred is more than |
| 717 | * fcp data length in the command. ex. |
| 718 | * TAPE IOs where blocks can of unequal |
| 719 | * lengths. |
| 720 | * - io-tag can be reused. |
| 721 | * |
| 722 | * BFI_IOIM_STS_RES_FREE : Firmware has completed using io-tag |
| 723 | * during abort process |
| 724 | * - io-tag can be reused. |
| 725 | * |
| 726 | * BFI_IOIM_STS_PROTO_ERR : Firmware detected a protocol error. |
| 727 | * ex target sent more data than |
| 728 | * requested, or there was data frame |
| 729 | * loss and other reasons |
| 730 | * - io-tag cannot be used yet. |
| 731 | * |
| 732 | * BFI_IOIM_STS_DIF_ERR : Firwmare detected DIF error. ex: DIF |
| 733 | * CRC err or Ref Tag err or App tag err. |
| 734 | * - io-tag can be reused. |
| 735 | * |
| 736 | * BFA_IOIM_STS_TSK_MGT_ABORT : IO was aborted because of Task |
| 737 | * Management command from the host |
| 738 | * - io-tag can be reused. |
| 739 | * |
| 740 | * BFI_IOIM_STS_UTAG : Firmware does not know about this |
| 741 | * io_tag. |
| 742 | * - io-tag can be reused. |
| 743 | */ |
| 744 | enum bfi_ioim_status { |
| 745 | BFI_IOIM_STS_OK = 0, |
| 746 | BFI_IOIM_STS_HOST_ABORTED = 1, |
| 747 | BFI_IOIM_STS_ABORTED = 2, |
| 748 | BFI_IOIM_STS_TIMEDOUT = 3, |
| 749 | BFI_IOIM_STS_RES_FREE = 4, |
| 750 | BFI_IOIM_STS_SQER_NEEDED = 5, |
| 751 | BFI_IOIM_STS_PROTO_ERR = 6, |
| 752 | BFI_IOIM_STS_UTAG = 7, |
| 753 | BFI_IOIM_STS_PATHTOV = 8, |
| 754 | }; |
| 755 | |
| 756 | #define BFI_IOIM_SNSLEN (256) |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 757 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 758 | * I/O response message |
| 759 | */ |
| 760 | struct bfi_ioim_rsp_s { |
| 761 | struct bfi_mhdr_s mh; /* common msg header */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 762 | __be16 io_tag; /* completed IO tag */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 763 | u16 bfa_rport_hndl; /* releated rport handle */ |
| 764 | u8 io_status; /* IO completion status */ |
| 765 | u8 reuse_io_tag; /* IO tag can be reused */ |
| 766 | u16 abort_tag; /* host abort request tag */ |
| 767 | u8 scsi_status; /* scsi status from target */ |
| 768 | u8 sns_len; /* scsi sense length */ |
| 769 | u8 resid_flags; /* IO residue flags */ |
| 770 | u8 rsvd_a; |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 771 | __be32 residue; /* IO residual length in bytes */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 772 | u32 rsvd_b[3]; |
| 773 | }; |
| 774 | |
| 775 | struct bfi_ioim_abort_req_s { |
| 776 | struct bfi_mhdr_s mh; /* Common msg header */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 777 | __be16 io_tag; /* I/O tag */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 778 | u16 abort_tag; /* unique request tag */ |
| 779 | }; |
| 780 | |
| 781 | /* |
| 782 | * Initiator mode task management command interface defines. |
| 783 | */ |
| 784 | |
| 785 | enum bfi_tskim_h2i { |
| 786 | BFI_TSKIM_H2I_TM_REQ = 1, /* task-mgmt command */ |
| 787 | BFI_TSKIM_H2I_ABORT_REQ = 2, /* task-mgmt command */ |
| 788 | }; |
| 789 | |
| 790 | enum bfi_tskim_i2h { |
| 791 | BFI_TSKIM_I2H_TM_RSP = BFA_I2HM(1), |
| 792 | }; |
| 793 | |
| 794 | struct bfi_tskim_req_s { |
| 795 | struct bfi_mhdr_s mh; /* Common msg header */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 796 | __be16 tsk_tag; /* task management tag */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 797 | u16 itn_fhdl; /* itn firmware handle */ |
Maggie Zhang | f314878 | 2010-12-09 19:11:39 -0800 | [diff] [blame] | 798 | struct scsi_lun lun; /* LU number */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 799 | u8 tm_flags; /* see enum fcp_tm_cmnd */ |
| 800 | u8 t_secs; /* Timeout value in seconds */ |
| 801 | u8 rsvd[2]; |
| 802 | }; |
| 803 | |
| 804 | struct bfi_tskim_abortreq_s { |
| 805 | struct bfi_mhdr_s mh; /* Common msg header */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 806 | __be16 tsk_tag; /* task management tag */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 807 | u16 rsvd; |
| 808 | }; |
| 809 | |
| 810 | enum bfi_tskim_status { |
| 811 | /* |
| 812 | * Following are FCP-4 spec defined status codes, |
| 813 | * **DO NOT CHANGE THEM ** |
| 814 | */ |
| 815 | BFI_TSKIM_STS_OK = 0, |
| 816 | BFI_TSKIM_STS_NOT_SUPP = 4, |
| 817 | BFI_TSKIM_STS_FAILED = 5, |
| 818 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 819 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 820 | * Defined by BFA |
| 821 | */ |
| 822 | BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */ |
| 823 | BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */ |
| 824 | }; |
| 825 | |
| 826 | struct bfi_tskim_rsp_s { |
| 827 | struct bfi_mhdr_s mh; /* Common msg header */ |
Maggie | 50444a3 | 2010-11-29 18:26:32 -0800 | [diff] [blame] | 828 | __be16 tsk_tag; /* task mgmt cmnd tag */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 829 | u8 tsk_status; /* @ref bfi_tskim_status */ |
| 830 | u8 rsvd; |
| 831 | }; |
| 832 | |
| 833 | #pragma pack() |
| 834 | |
Krishna Gudipati | 1118920 | 2011-06-13 15:50:35 -0700 | [diff] [blame] | 835 | /* |
| 836 | * Crossbow PCI MSI-X vector defines |
| 837 | */ |
| 838 | enum { |
| 839 | BFI_MSIX_CPE_QMIN_CB = 0, |
| 840 | BFI_MSIX_CPE_QMAX_CB = 7, |
| 841 | BFI_MSIX_RME_QMIN_CB = 8, |
| 842 | BFI_MSIX_RME_QMAX_CB = 15, |
| 843 | BFI_MSIX_CB_MAX = 22, |
| 844 | }; |
| 845 | |
| 846 | /* |
| 847 | * Catapult FC PCI MSI-X vector defines |
| 848 | */ |
| 849 | enum { |
| 850 | BFI_MSIX_LPU_ERR_CT = 0, |
| 851 | BFI_MSIX_CPE_QMIN_CT = 1, |
| 852 | BFI_MSIX_CPE_QMAX_CT = 4, |
| 853 | BFI_MSIX_RME_QMIN_CT = 5, |
| 854 | BFI_MSIX_RME_QMAX_CT = 8, |
| 855 | BFI_MSIX_CT_MAX = 9, |
| 856 | }; |
| 857 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 858 | #endif /* __BFI_MS_H__ */ |