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