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