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