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