1*52fa7bf9SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2a36c61f9SKrishna Gudipati /* 3889d0d42SAnil Gurumurthy * Copyright (c) 2005-2014 Brocade Communications Systems, Inc. 4889d0d42SAnil Gurumurthy * Copyright (c) 2014- QLogic Corporation. 5a36c61f9SKrishna Gudipati * All rights reserved 6889d0d42SAnil Gurumurthy * www.qlogic.com 7a36c61f9SKrishna Gudipati * 831e1d569SAnil Gurumurthy * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter. 9a36c61f9SKrishna Gudipati */ 10a36c61f9SKrishna Gudipati 11a36c61f9SKrishna Gudipati #ifndef __BFI_H__ 12a36c61f9SKrishna Gudipati #define __BFI_H__ 13a36c61f9SKrishna Gudipati 14a36c61f9SKrishna Gudipati #include "bfa_defs.h" 15a36c61f9SKrishna Gudipati #include "bfa_defs_svc.h" 16a36c61f9SKrishna Gudipati 17a36c61f9SKrishna Gudipati #pragma pack(1) 18a36c61f9SKrishna Gudipati 194507025dSKrishna Gudipati /* Per dma segment max size */ 204507025dSKrishna Gudipati #define BFI_MEM_DMA_SEG_SZ (131072) 214507025dSKrishna Gudipati 224507025dSKrishna Gudipati /* Get number of dma segments required */ 234507025dSKrishna Gudipati #define BFI_MEM_DMA_NSEGS(_num_reqs, _req_sz) \ 244507025dSKrishna Gudipati ((u16)(((((_num_reqs) * (_req_sz)) + BFI_MEM_DMA_SEG_SZ - 1) & \ 254507025dSKrishna Gudipati ~(BFI_MEM_DMA_SEG_SZ - 1)) / BFI_MEM_DMA_SEG_SZ)) 264507025dSKrishna Gudipati 274507025dSKrishna Gudipati /* Get num dma reqs - that fit in a segment */ 284507025dSKrishna Gudipati #define BFI_MEM_NREQS_SEG(_rqsz) (BFI_MEM_DMA_SEG_SZ / (_rqsz)) 294507025dSKrishna Gudipati 304507025dSKrishna Gudipati /* Get segment num from tag */ 314507025dSKrishna Gudipati #define BFI_MEM_SEG_FROM_TAG(_tag, _rqsz) ((_tag) / BFI_MEM_NREQS_SEG(_rqsz)) 324507025dSKrishna Gudipati 334507025dSKrishna Gudipati /* Get dma req offset in a segment */ 344507025dSKrishna Gudipati #define BFI_MEM_SEG_REQ_OFFSET(_tag, _sz) \ 354507025dSKrishna Gudipati ((_tag) - (BFI_MEM_SEG_FROM_TAG(_tag, _sz) * BFI_MEM_NREQS_SEG(_sz))) 364507025dSKrishna Gudipati 37acdc79a6SJing Huang /* 38a36c61f9SKrishna Gudipati * BFI FW image type 39a36c61f9SKrishna Gudipati */ 40a36c61f9SKrishna Gudipati #define BFI_FLASH_CHUNK_SZ 256 /* Flash chunk size */ 41a36c61f9SKrishna Gudipati #define BFI_FLASH_CHUNK_SZ_WORDS (BFI_FLASH_CHUNK_SZ/sizeof(u32)) 4228d358d0SVijaya Mohan Guvva #define BFI_FLASH_IMAGE_SZ 0x100000 43a36c61f9SKrishna Gudipati 44acdc79a6SJing Huang /* 45a36c61f9SKrishna Gudipati * Msg header common to all msgs 46a36c61f9SKrishna Gudipati */ 47a36c61f9SKrishna Gudipati struct bfi_mhdr_s { 48a36c61f9SKrishna Gudipati u8 msg_class; /* @ref bfi_mclass_t */ 49a36c61f9SKrishna Gudipati u8 msg_id; /* msg opcode with in the class */ 50a36c61f9SKrishna Gudipati union { 51a36c61f9SKrishna Gudipati struct { 52d37779f8SKrishna Gudipati u8 qid; 533fd45980SKrishna Gudipati u8 fn_lpu; /* msg destination */ 54a36c61f9SKrishna Gudipati } h2i; 55a36c61f9SKrishna Gudipati u16 i2htok; /* token in msgs to host */ 56a36c61f9SKrishna Gudipati } mtag; 57a36c61f9SKrishna Gudipati }; 58a36c61f9SKrishna Gudipati 593fd45980SKrishna Gudipati #define bfi_fn_lpu(__fn, __lpu) ((__fn) << 1 | (__lpu)) 603fd45980SKrishna Gudipati #define bfi_mhdr_2_fn(_mh) ((_mh)->mtag.h2i.fn_lpu >> 1) 61d37779f8SKrishna Gudipati 623fd45980SKrishna Gudipati #define bfi_h2i_set(_mh, _mc, _op, _fn_lpu) do { \ 63a36c61f9SKrishna Gudipati (_mh).msg_class = (_mc); \ 64a36c61f9SKrishna Gudipati (_mh).msg_id = (_op); \ 653fd45980SKrishna Gudipati (_mh).mtag.h2i.fn_lpu = (_fn_lpu); \ 66a36c61f9SKrishna Gudipati } while (0) 67a36c61f9SKrishna Gudipati 68a36c61f9SKrishna Gudipati #define bfi_i2h_set(_mh, _mc, _op, _i2htok) do { \ 69a36c61f9SKrishna Gudipati (_mh).msg_class = (_mc); \ 70a36c61f9SKrishna Gudipati (_mh).msg_id = (_op); \ 71a36c61f9SKrishna Gudipati (_mh).mtag.i2htok = (_i2htok); \ 72a36c61f9SKrishna Gudipati } while (0) 73a36c61f9SKrishna Gudipati 74a36c61f9SKrishna Gudipati /* 75a36c61f9SKrishna Gudipati * Message opcodes: 0-127 to firmware, 128-255 to host 76a36c61f9SKrishna Gudipati */ 77a36c61f9SKrishna Gudipati #define BFI_I2H_OPCODE_BASE 128 78a36c61f9SKrishna Gudipati #define BFA_I2HM(_x) ((_x) + BFI_I2H_OPCODE_BASE) 79a36c61f9SKrishna Gudipati 80acdc79a6SJing Huang /* 81a36c61f9SKrishna Gudipati **************************************************************************** 82a36c61f9SKrishna Gudipati * 83a36c61f9SKrishna Gudipati * Scatter Gather Element and Page definition 84a36c61f9SKrishna Gudipati * 85a36c61f9SKrishna Gudipati **************************************************************************** 86a36c61f9SKrishna Gudipati */ 87a36c61f9SKrishna Gudipati 88a36c61f9SKrishna Gudipati #define BFI_SGE_INLINE 1 89a36c61f9SKrishna Gudipati #define BFI_SGE_INLINE_MAX (BFI_SGE_INLINE + 1) 90a36c61f9SKrishna Gudipati 91acdc79a6SJing Huang /* 92a36c61f9SKrishna Gudipati * SG Flags 93a36c61f9SKrishna Gudipati */ 94a36c61f9SKrishna Gudipati enum { 95a36c61f9SKrishna Gudipati BFI_SGE_DATA = 0, /* data address, not last */ 96a36c61f9SKrishna Gudipati BFI_SGE_DATA_CPL = 1, /* data addr, last in current page */ 97a36c61f9SKrishna Gudipati BFI_SGE_DATA_LAST = 3, /* data address, last */ 98a36c61f9SKrishna Gudipati BFI_SGE_LINK = 2, /* link address */ 99a36c61f9SKrishna Gudipati BFI_SGE_PGDLEN = 2, /* cumulative data length for page */ 100a36c61f9SKrishna Gudipati }; 101a36c61f9SKrishna Gudipati 102acdc79a6SJing Huang /* 103a36c61f9SKrishna Gudipati * DMA addresses 104a36c61f9SKrishna Gudipati */ 105a36c61f9SKrishna Gudipati union bfi_addr_u { 106a36c61f9SKrishna Gudipati struct { 10750444a34SMaggie __be32 addr_lo; 10850444a34SMaggie __be32 addr_hi; 109a36c61f9SKrishna Gudipati } a32; 110a36c61f9SKrishna Gudipati }; 111a36c61f9SKrishna Gudipati 112acdc79a6SJing Huang /* 11385ce928dSKrishna Gudipati * Scatter Gather Element used for fast-path IO requests 114a36c61f9SKrishna Gudipati */ 115a36c61f9SKrishna Gudipati struct bfi_sge_s { 116f16a1750SMaggie Zhang #ifdef __BIG_ENDIAN 117a36c61f9SKrishna Gudipati u32 flags:2, 118a36c61f9SKrishna Gudipati rsvd:2, 119a36c61f9SKrishna Gudipati sg_len:28; 120a36c61f9SKrishna Gudipati #else 121a36c61f9SKrishna Gudipati u32 sg_len:28, 122a36c61f9SKrishna Gudipati rsvd:2, 123a36c61f9SKrishna Gudipati flags:2; 124a36c61f9SKrishna Gudipati #endif 125a36c61f9SKrishna Gudipati union bfi_addr_u sga; 126a36c61f9SKrishna Gudipati }; 127a36c61f9SKrishna Gudipati 12885ce928dSKrishna Gudipati /** 12985ce928dSKrishna Gudipati * Generic DMA addr-len pair. 13085ce928dSKrishna Gudipati */ 13185ce928dSKrishna Gudipati struct bfi_alen_s { 13285ce928dSKrishna Gudipati union bfi_addr_u al_addr; /* DMA addr of buffer */ 13385ce928dSKrishna Gudipati u32 al_len; /* length of buffer */ 13485ce928dSKrishna Gudipati }; 13585ce928dSKrishna Gudipati 136acdc79a6SJing Huang /* 137a36c61f9SKrishna Gudipati * Scatter Gather Page 138a36c61f9SKrishna Gudipati */ 139a36c61f9SKrishna Gudipati #define BFI_SGPG_DATA_SGES 7 140a36c61f9SKrishna Gudipati #define BFI_SGPG_SGES_MAX (BFI_SGPG_DATA_SGES + 1) 141a36c61f9SKrishna Gudipati #define BFI_SGPG_RSVD_WD_LEN 8 142a36c61f9SKrishna Gudipati struct bfi_sgpg_s { 143a36c61f9SKrishna Gudipati struct bfi_sge_s sges[BFI_SGPG_SGES_MAX]; 144a36c61f9SKrishna Gudipati u32 rsvd[BFI_SGPG_RSVD_WD_LEN]; 145a36c61f9SKrishna Gudipati }; 146a36c61f9SKrishna Gudipati 1474507025dSKrishna Gudipati /* FCP module definitions */ 1484507025dSKrishna Gudipati #define BFI_IO_MAX (2000) 1494507025dSKrishna Gudipati #define BFI_IOIM_SNSLEN (256) 1504507025dSKrishna Gudipati #define BFI_IOIM_SNSBUF_SEGS \ 1514507025dSKrishna Gudipati BFI_MEM_DMA_NSEGS(BFI_IO_MAX, BFI_IOIM_SNSLEN) 1524507025dSKrishna Gudipati 153a36c61f9SKrishna Gudipati /* 154a36c61f9SKrishna Gudipati * Large Message structure - 128 Bytes size Msgs 155a36c61f9SKrishna Gudipati */ 156a36c61f9SKrishna Gudipati #define BFI_LMSG_SZ 128 157a36c61f9SKrishna Gudipati #define BFI_LMSG_PL_WSZ \ 158a36c61f9SKrishna Gudipati ((BFI_LMSG_SZ - sizeof(struct bfi_mhdr_s)) / 4) 159a36c61f9SKrishna Gudipati 160a36c61f9SKrishna Gudipati struct bfi_msg_s { 161a36c61f9SKrishna Gudipati struct bfi_mhdr_s mhdr; 162a36c61f9SKrishna Gudipati u32 pl[BFI_LMSG_PL_WSZ]; 163a36c61f9SKrishna Gudipati }; 164a36c61f9SKrishna Gudipati 165acdc79a6SJing Huang /* 166a36c61f9SKrishna Gudipati * Mailbox message structure 167a36c61f9SKrishna Gudipati */ 168a36c61f9SKrishna Gudipati #define BFI_MBMSG_SZ 7 169a36c61f9SKrishna Gudipati struct bfi_mbmsg_s { 170a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 171a36c61f9SKrishna Gudipati u32 pl[BFI_MBMSG_SZ]; 172a36c61f9SKrishna Gudipati }; 173a36c61f9SKrishna Gudipati 174acdc79a6SJing Huang /* 175d37779f8SKrishna Gudipati * Supported PCI function class codes (personality) 176d37779f8SKrishna Gudipati */ 177d37779f8SKrishna Gudipati enum bfi_pcifn_class { 178d37779f8SKrishna Gudipati BFI_PCIFN_CLASS_FC = 0x0c04, 179d37779f8SKrishna Gudipati BFI_PCIFN_CLASS_ETH = 0x0200, 180d37779f8SKrishna Gudipati }; 181d37779f8SKrishna Gudipati 182d37779f8SKrishna Gudipati /* 183a36c61f9SKrishna Gudipati * Message Classes 184a36c61f9SKrishna Gudipati */ 185a36c61f9SKrishna Gudipati enum bfi_mclass { 186a36c61f9SKrishna Gudipati BFI_MC_IOC = 1, /* IO Controller (IOC) */ 1873d7fc66dSKrishna Gudipati BFI_MC_DIAG = 2, /* Diagnostic Msgs */ 1885a54b1d5SKrishna Gudipati BFI_MC_FLASH = 3, /* Flash message class */ 189148d6103SKrishna Gudipati BFI_MC_CEE = 4, /* CEE */ 190a36c61f9SKrishna Gudipati BFI_MC_FCPORT = 5, /* FC port */ 191a36c61f9SKrishna Gudipati BFI_MC_IOCFC = 6, /* FC - IO Controller (IOC) */ 1921a4d8e1bSKrishna Gudipati BFI_MC_ABLK = 7, /* ASIC block configuration */ 193a36c61f9SKrishna Gudipati BFI_MC_UF = 8, /* Unsolicited frame receive */ 194a36c61f9SKrishna Gudipati BFI_MC_FCXP = 9, /* FC Transport */ 195a36c61f9SKrishna Gudipati BFI_MC_LPS = 10, /* lport fc login services */ 196a36c61f9SKrishna Gudipati BFI_MC_RPORT = 11, /* Remote port */ 197dd5aaf45SKrishna Gudipati BFI_MC_ITN = 12, /* I-T nexus (Initiator mode) */ 198a36c61f9SKrishna Gudipati BFI_MC_IOIM_READ = 13, /* read IO (Initiator mode) */ 199a36c61f9SKrishna Gudipati BFI_MC_IOIM_WRITE = 14, /* write IO (Initiator mode) */ 200a36c61f9SKrishna Gudipati BFI_MC_IOIM_IO = 15, /* IO (Initiator mode) */ 201a36c61f9SKrishna Gudipati BFI_MC_IOIM = 16, /* IO (Initiator mode) */ 202a36c61f9SKrishna Gudipati BFI_MC_IOIM_IOCOM = 17, /* good IO completion */ 203a36c61f9SKrishna Gudipati BFI_MC_TSKIM = 18, /* Initiator Task management */ 204a36c61f9SKrishna Gudipati BFI_MC_PORT = 21, /* Physical port */ 20551e569aaSKrishna Gudipati BFI_MC_SFP = 22, /* SFP module */ 2063350d98dSKrishna Gudipati BFI_MC_PHY = 25, /* External PHY message class */ 207e6826c96SKrishna Gudipati BFI_MC_FRU = 34, 208e6826c96SKrishna Gudipati BFI_MC_MAX = 35 209a36c61f9SKrishna Gudipati }; 210a36c61f9SKrishna Gudipati 211a36c61f9SKrishna Gudipati #define BFI_IOC_MAX_CQS 4 212a36c61f9SKrishna Gudipati #define BFI_IOC_MAX_CQS_ASIC 8 213a36c61f9SKrishna Gudipati #define BFI_IOC_MSGLEN_MAX 32 /* 32 bytes */ 214a36c61f9SKrishna Gudipati 215acdc79a6SJing Huang /* 216a36c61f9SKrishna Gudipati *---------------------------------------------------------------------- 217a36c61f9SKrishna Gudipati * IOC 218a36c61f9SKrishna Gudipati *---------------------------------------------------------------------- 219a36c61f9SKrishna Gudipati */ 220a36c61f9SKrishna Gudipati 22111189208SKrishna Gudipati /* 22211189208SKrishna Gudipati * Different asic generations 22311189208SKrishna Gudipati */ 22411189208SKrishna Gudipati enum bfi_asic_gen { 22511189208SKrishna Gudipati BFI_ASIC_GEN_CB = 1, /* crossbow 8G FC */ 22611189208SKrishna Gudipati BFI_ASIC_GEN_CT = 2, /* catapult 8G FC or 10G CNA */ 22711189208SKrishna Gudipati BFI_ASIC_GEN_CT2 = 3, /* catapult-2 16G FC or 10G CNA */ 22811189208SKrishna Gudipati }; 22911189208SKrishna Gudipati 23011189208SKrishna Gudipati enum bfi_asic_mode { 23111189208SKrishna Gudipati BFI_ASIC_MODE_FC = 1, /* FC upto 8G speed */ 23211189208SKrishna Gudipati BFI_ASIC_MODE_FC16 = 2, /* FC upto 16G speed */ 23311189208SKrishna Gudipati BFI_ASIC_MODE_ETH = 3, /* Ethernet ports */ 23411189208SKrishna Gudipati BFI_ASIC_MODE_COMBO = 4, /* FC 16G and Ethernet 10G port */ 23511189208SKrishna Gudipati }; 23611189208SKrishna Gudipati 237a36c61f9SKrishna Gudipati enum bfi_ioc_h2i_msgs { 238a36c61f9SKrishna Gudipati BFI_IOC_H2I_ENABLE_REQ = 1, 239a36c61f9SKrishna Gudipati BFI_IOC_H2I_DISABLE_REQ = 2, 240a36c61f9SKrishna Gudipati BFI_IOC_H2I_GETATTR_REQ = 3, 241a36c61f9SKrishna Gudipati BFI_IOC_H2I_DBG_SYNC = 4, 242a36c61f9SKrishna Gudipati BFI_IOC_H2I_DBG_DUMP = 5, 243a36c61f9SKrishna Gudipati }; 244a36c61f9SKrishna Gudipati 245a36c61f9SKrishna Gudipati enum bfi_ioc_i2h_msgs { 246a36c61f9SKrishna Gudipati BFI_IOC_I2H_ENABLE_REPLY = BFA_I2HM(1), 247a36c61f9SKrishna Gudipati BFI_IOC_I2H_DISABLE_REPLY = BFA_I2HM(2), 248a36c61f9SKrishna Gudipati BFI_IOC_I2H_GETATTR_REPLY = BFA_I2HM(3), 249775c7742SKrishna Gudipati BFI_IOC_I2H_HBEAT = BFA_I2HM(4), 250a714134aSKrishna Gudipati BFI_IOC_I2H_ACQ_ADDR_REPLY = BFA_I2HM(5), 251a36c61f9SKrishna Gudipati }; 252a36c61f9SKrishna Gudipati 253acdc79a6SJing Huang /* 254a36c61f9SKrishna Gudipati * BFI_IOC_H2I_GETATTR_REQ message 255a36c61f9SKrishna Gudipati */ 256a36c61f9SKrishna Gudipati struct bfi_ioc_getattr_req_s { 257a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 258a36c61f9SKrishna Gudipati union bfi_addr_u attr_addr; 259a36c61f9SKrishna Gudipati }; 260a36c61f9SKrishna Gudipati 261079bcbc3SVijaya Mohan Guvva #define BFI_IOC_ATTR_UUID_SZ 16 262a36c61f9SKrishna Gudipati struct bfi_ioc_attr_s { 263a36c61f9SKrishna Gudipati wwn_t mfg_pwwn; /* Mfg port wwn */ 264a36c61f9SKrishna Gudipati wwn_t mfg_nwwn; /* Mfg node wwn */ 265a36c61f9SKrishna Gudipati mac_t mfg_mac; /* Mfg mac */ 2665a0adaedSKrishna Gudipati u8 port_mode; /* bfi_port_mode */ 2675a0adaedSKrishna Gudipati u8 rsvd_a; 268a36c61f9SKrishna Gudipati wwn_t pwwn; 269a36c61f9SKrishna Gudipati wwn_t nwwn; 270a36c61f9SKrishna Gudipati mac_t mac; /* PBC or Mfg mac */ 271a36c61f9SKrishna Gudipati u16 rsvd_b; 272a36c61f9SKrishna Gudipati mac_t fcoe_mac; 273a36c61f9SKrishna Gudipati u16 rsvd_c; 274a36c61f9SKrishna Gudipati char brcd_serialnum[STRSZ(BFA_MFG_SERIALNUM_SIZE)]; 275a36c61f9SKrishna Gudipati u8 pcie_gen; 276a36c61f9SKrishna Gudipati u8 pcie_lanes_orig; 277a36c61f9SKrishna Gudipati u8 pcie_lanes; 278a36c61f9SKrishna Gudipati u8 rx_bbcredit; /* receive buffer credits */ 279a36c61f9SKrishna Gudipati u32 adapter_prop; /* adapter properties */ 280a36c61f9SKrishna Gudipati u16 maxfrsize; /* max receive frame size */ 281a36c61f9SKrishna Gudipati char asic_rev; 28210a07379SKrishna Gudipati u8 rsvd_d; 283a36c61f9SKrishna Gudipati char fw_version[BFA_VERSION_LEN]; 284a36c61f9SKrishna Gudipati char optrom_version[BFA_VERSION_LEN]; 285a36c61f9SKrishna Gudipati struct bfa_mfg_vpd_s vpd; 286a36c61f9SKrishna Gudipati u32 card_type; /* card type */ 287ea5d7c9eSKrishna Gudipati u8 mfg_day; /* manufacturing day */ 288ea5d7c9eSKrishna Gudipati u8 mfg_month; /* manufacturing month */ 289ea5d7c9eSKrishna Gudipati u16 mfg_year; /* manufacturing year */ 290079bcbc3SVijaya Mohan Guvva u8 uuid[BFI_IOC_ATTR_UUID_SZ]; /*!< chinook uuid */ 291a36c61f9SKrishna Gudipati }; 292a36c61f9SKrishna Gudipati 293acdc79a6SJing Huang /* 294a36c61f9SKrishna Gudipati * BFI_IOC_I2H_GETATTR_REPLY message 295a36c61f9SKrishna Gudipati */ 296a36c61f9SKrishna Gudipati struct bfi_ioc_getattr_reply_s { 297a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 298a36c61f9SKrishna Gudipati u8 status; /* cfg reply status */ 299a36c61f9SKrishna Gudipati u8 rsvd[3]; 300a36c61f9SKrishna Gudipati }; 301a36c61f9SKrishna Gudipati 302acdc79a6SJing Huang /* 303a36c61f9SKrishna Gudipati * Firmware memory page offsets 304a36c61f9SKrishna Gudipati */ 305a36c61f9SKrishna Gudipati #define BFI_IOC_SMEM_PG0_CB (0x40) 306a36c61f9SKrishna Gudipati #define BFI_IOC_SMEM_PG0_CT (0x180) 307a36c61f9SKrishna Gudipati 308acdc79a6SJing Huang /* 309a36c61f9SKrishna Gudipati * Firmware statistic offset 310a36c61f9SKrishna Gudipati */ 311a36c61f9SKrishna Gudipati #define BFI_IOC_FWSTATS_OFF (0x6B40) 312a36c61f9SKrishna Gudipati #define BFI_IOC_FWSTATS_SZ (4096) 313a36c61f9SKrishna Gudipati 314acdc79a6SJing Huang /* 315a36c61f9SKrishna Gudipati * Firmware trace offset 316a36c61f9SKrishna Gudipati */ 317a36c61f9SKrishna Gudipati #define BFI_IOC_TRC_OFF (0x4b00) 318a36c61f9SKrishna Gudipati #define BFI_IOC_TRC_ENTS 256 319a36c61f9SKrishna Gudipati 320a36c61f9SKrishna Gudipati #define BFI_IOC_FW_SIGNATURE (0xbfadbfad) 32128d358d0SVijaya Mohan Guvva #define BFA_IOC_FW_INV_SIGN (0xdeaddead) 322a36c61f9SKrishna Gudipati #define BFI_IOC_MD5SUM_SZ 4 32328d358d0SVijaya Mohan Guvva 32428d358d0SVijaya Mohan Guvva struct bfi_ioc_fwver_s { 32528d358d0SVijaya Mohan Guvva #ifdef __BIG_ENDIAN 32628d358d0SVijaya Mohan Guvva uint8_t patch; 32728d358d0SVijaya Mohan Guvva uint8_t maint; 32828d358d0SVijaya Mohan Guvva uint8_t minor; 32928d358d0SVijaya Mohan Guvva uint8_t major; 33028d358d0SVijaya Mohan Guvva uint8_t rsvd[2]; 33128d358d0SVijaya Mohan Guvva uint8_t build; 33228d358d0SVijaya Mohan Guvva uint8_t phase; 33328d358d0SVijaya Mohan Guvva #else 33428d358d0SVijaya Mohan Guvva uint8_t major; 33528d358d0SVijaya Mohan Guvva uint8_t minor; 33628d358d0SVijaya Mohan Guvva uint8_t maint; 33728d358d0SVijaya Mohan Guvva uint8_t patch; 33828d358d0SVijaya Mohan Guvva uint8_t phase; 33928d358d0SVijaya Mohan Guvva uint8_t build; 34028d358d0SVijaya Mohan Guvva uint8_t rsvd[2]; 34128d358d0SVijaya Mohan Guvva #endif 34228d358d0SVijaya Mohan Guvva }; 34328d358d0SVijaya Mohan Guvva 344a36c61f9SKrishna Gudipati struct bfi_ioc_image_hdr_s { 345a36c61f9SKrishna Gudipati u32 signature; /* constant signature */ 34611189208SKrishna Gudipati u8 asic_gen; /* asic generation */ 34711189208SKrishna Gudipati u8 asic_mode; 34811189208SKrishna Gudipati u8 port0_mode; /* device mode for port 0 */ 34911189208SKrishna Gudipati u8 port1_mode; /* device mode for port 1 */ 350a36c61f9SKrishna Gudipati u32 exec; /* exec vector */ 351bad7de74SKees Cook u32 bootenv; /* firmware boot env */ 35228d358d0SVijaya Mohan Guvva u32 rsvd_b[2]; 35328d358d0SVijaya Mohan Guvva struct bfi_ioc_fwver_s fwver; 354a36c61f9SKrishna Gudipati u32 md5sum[BFI_IOC_MD5SUM_SZ]; 355a36c61f9SKrishna Gudipati }; 356a36c61f9SKrishna Gudipati 35728d358d0SVijaya Mohan Guvva enum bfi_ioc_img_ver_cmp_e { 35828d358d0SVijaya Mohan Guvva BFI_IOC_IMG_VER_INCOMP, 35928d358d0SVijaya Mohan Guvva BFI_IOC_IMG_VER_OLD, 36028d358d0SVijaya Mohan Guvva BFI_IOC_IMG_VER_SAME, 36128d358d0SVijaya Mohan Guvva BFI_IOC_IMG_VER_BETTER 36228d358d0SVijaya Mohan Guvva }; 36328d358d0SVijaya Mohan Guvva 36411189208SKrishna Gudipati #define BFI_FWBOOT_DEVMODE_OFF 4 36511189208SKrishna Gudipati #define BFI_FWBOOT_TYPE_OFF 8 36611189208SKrishna Gudipati #define BFI_FWBOOT_ENV_OFF 12 36711189208SKrishna Gudipati #define BFI_FWBOOT_DEVMODE(__asic_gen, __asic_mode, __p0_mode, __p1_mode) \ 36811189208SKrishna Gudipati (((u32)(__asic_gen)) << 24 | \ 36911189208SKrishna Gudipati ((u32)(__asic_mode)) << 16 | \ 37011189208SKrishna Gudipati ((u32)(__p0_mode)) << 8 | \ 37111189208SKrishna Gudipati ((u32)(__p1_mode))) 37211189208SKrishna Gudipati 37328d358d0SVijaya Mohan Guvva enum bfi_fwboot_type { 37428d358d0SVijaya Mohan Guvva BFI_FWBOOT_TYPE_NORMAL = 0, 37528d358d0SVijaya Mohan Guvva BFI_FWBOOT_TYPE_FLASH = 1, 37628d358d0SVijaya Mohan Guvva BFI_FWBOOT_TYPE_MEMTEST = 2, 37728d358d0SVijaya Mohan Guvva }; 37828d358d0SVijaya Mohan Guvva 37911189208SKrishna Gudipati #define BFI_FWBOOT_TYPE_NORMAL 0 3803d7fc66dSKrishna Gudipati #define BFI_FWBOOT_TYPE_MEMTEST 2 38111189208SKrishna Gudipati #define BFI_FWBOOT_ENV_OS 0 38211189208SKrishna Gudipati 38311189208SKrishna Gudipati enum bfi_port_mode { 38411189208SKrishna Gudipati BFI_PORT_MODE_FC = 1, 38511189208SKrishna Gudipati BFI_PORT_MODE_ETH = 2, 38611189208SKrishna Gudipati }; 38711189208SKrishna Gudipati 388a36c61f9SKrishna Gudipati struct bfi_ioc_hbeat_s { 389a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; /* common msg header */ 390a36c61f9SKrishna Gudipati u32 hb_count; /* current heart beat count */ 391a36c61f9SKrishna Gudipati }; 392a36c61f9SKrishna Gudipati 393acdc79a6SJing Huang /* 394a36c61f9SKrishna Gudipati * IOC hardware/firmware state 395a36c61f9SKrishna Gudipati */ 396a36c61f9SKrishna Gudipati enum bfi_ioc_state { 397a36c61f9SKrishna Gudipati BFI_IOC_UNINIT = 0, /* not initialized */ 398a36c61f9SKrishna Gudipati BFI_IOC_INITING = 1, /* h/w is being initialized */ 399a36c61f9SKrishna Gudipati BFI_IOC_HWINIT = 2, /* h/w is initialized */ 400a36c61f9SKrishna Gudipati BFI_IOC_CFG = 3, /* IOC configuration in progress */ 401a36c61f9SKrishna Gudipati BFI_IOC_OP = 4, /* IOC is operational */ 402a36c61f9SKrishna Gudipati BFI_IOC_DISABLING = 5, /* IOC is being disabled */ 403a36c61f9SKrishna Gudipati BFI_IOC_DISABLED = 6, /* IOC is disabled */ 404a36c61f9SKrishna Gudipati BFI_IOC_CFG_DISABLED = 7, /* IOC is being disabled;transient */ 405a36c61f9SKrishna Gudipati BFI_IOC_FAIL = 8, /* IOC heart-beat failure */ 406a36c61f9SKrishna Gudipati BFI_IOC_MEMTEST = 9, /* IOC is doing memtest */ 407a36c61f9SKrishna Gudipati }; 408a36c61f9SKrishna Gudipati 409c679b599SVijaya Mohan Guvva #define BFA_IOC_CB_JOIN_SH 16 410c679b599SVijaya Mohan Guvva #define BFA_IOC_CB_FWSTATE_MASK 0x0000ffff 411c679b599SVijaya Mohan Guvva #define BFA_IOC_CB_JOIN_MASK 0xffff0000 412c679b599SVijaya Mohan Guvva 413a36c61f9SKrishna Gudipati #define BFI_IOC_ENDIAN_SIG 0x12345678 414a36c61f9SKrishna Gudipati 415a36c61f9SKrishna Gudipati enum { 416a36c61f9SKrishna Gudipati BFI_ADAPTER_TYPE_FC = 0x01, /* FC adapters */ 417a36c61f9SKrishna Gudipati BFI_ADAPTER_TYPE_MK = 0x0f0000, /* adapter type mask */ 418a36c61f9SKrishna Gudipati BFI_ADAPTER_TYPE_SH = 16, /* adapter type shift */ 419a36c61f9SKrishna Gudipati BFI_ADAPTER_NPORTS_MK = 0xff00, /* number of ports mask */ 420a36c61f9SKrishna Gudipati BFI_ADAPTER_NPORTS_SH = 8, /* number of ports shift */ 421a36c61f9SKrishna Gudipati BFI_ADAPTER_SPEED_MK = 0xff, /* adapter speed mask */ 422a36c61f9SKrishna Gudipati BFI_ADAPTER_SPEED_SH = 0, /* adapter speed shift */ 423a36c61f9SKrishna Gudipati BFI_ADAPTER_PROTO = 0x100000, /* prototype adapaters */ 424a36c61f9SKrishna Gudipati BFI_ADAPTER_TTV = 0x200000, /* TTV debug capable */ 425a36c61f9SKrishna Gudipati BFI_ADAPTER_UNSUPP = 0x400000, /* unknown adapter type */ 426a36c61f9SKrishna Gudipati }; 427a36c61f9SKrishna Gudipati 428a36c61f9SKrishna Gudipati #define BFI_ADAPTER_GETP(__prop, __adap_prop) \ 429a36c61f9SKrishna Gudipati (((__adap_prop) & BFI_ADAPTER_ ## __prop ## _MK) >> \ 430a36c61f9SKrishna Gudipati BFI_ADAPTER_ ## __prop ## _SH) 431a36c61f9SKrishna Gudipati #define BFI_ADAPTER_SETP(__prop, __val) \ 432a36c61f9SKrishna Gudipati ((__val) << BFI_ADAPTER_ ## __prop ## _SH) 433a36c61f9SKrishna Gudipati #define BFI_ADAPTER_IS_PROTO(__adap_type) \ 434a36c61f9SKrishna Gudipati ((__adap_type) & BFI_ADAPTER_PROTO) 435a36c61f9SKrishna Gudipati #define BFI_ADAPTER_IS_TTV(__adap_type) \ 436a36c61f9SKrishna Gudipati ((__adap_type) & BFI_ADAPTER_TTV) 437a36c61f9SKrishna Gudipati #define BFI_ADAPTER_IS_UNSUPP(__adap_type) \ 438a36c61f9SKrishna Gudipati ((__adap_type) & BFI_ADAPTER_UNSUPP) 439a36c61f9SKrishna Gudipati #define BFI_ADAPTER_IS_SPECIAL(__adap_type) \ 440a36c61f9SKrishna Gudipati ((__adap_type) & (BFI_ADAPTER_TTV | BFI_ADAPTER_PROTO | \ 441a36c61f9SKrishna Gudipati BFI_ADAPTER_UNSUPP)) 442a36c61f9SKrishna Gudipati 443acdc79a6SJing Huang /* 444a36c61f9SKrishna Gudipati * BFI_IOC_H2I_ENABLE_REQ & BFI_IOC_H2I_DISABLE_REQ messages 445a36c61f9SKrishna Gudipati */ 446a36c61f9SKrishna Gudipati struct bfi_ioc_ctrl_req_s { 447a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 448d37779f8SKrishna Gudipati u16 clscode; 449d37779f8SKrishna Gudipati u16 rsvd; 450a36c61f9SKrishna Gudipati u32 tv_sec; 451a36c61f9SKrishna Gudipati }; 452a36c61f9SKrishna Gudipati #define bfi_ioc_enable_req_t struct bfi_ioc_ctrl_req_s; 453a36c61f9SKrishna Gudipati #define bfi_ioc_disable_req_t struct bfi_ioc_ctrl_req_s; 454a36c61f9SKrishna Gudipati 455acdc79a6SJing Huang /* 456a36c61f9SKrishna Gudipati * BFI_IOC_I2H_ENABLE_REPLY & BFI_IOC_I2H_DISABLE_REPLY messages 457a36c61f9SKrishna Gudipati */ 458a36c61f9SKrishna Gudipati struct bfi_ioc_ctrl_reply_s { 459a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 460a36c61f9SKrishna Gudipati u8 status; /* enable/disable status */ 4611a4d8e1bSKrishna Gudipati u8 port_mode; /* bfa_mode_s */ 4621a4d8e1bSKrishna Gudipati u8 cap_bm; /* capability bit mask */ 4631a4d8e1bSKrishna Gudipati u8 rsvd; 464a36c61f9SKrishna Gudipati }; 465a36c61f9SKrishna Gudipati #define bfi_ioc_enable_reply_t struct bfi_ioc_ctrl_reply_s; 466a36c61f9SKrishna Gudipati #define bfi_ioc_disable_reply_t struct bfi_ioc_ctrl_reply_s; 467a36c61f9SKrishna Gudipati 468a36c61f9SKrishna Gudipati #define BFI_IOC_MSGSZ 8 469acdc79a6SJing Huang /* 470a36c61f9SKrishna Gudipati * H2I Messages 471a36c61f9SKrishna Gudipati */ 472a36c61f9SKrishna Gudipati union bfi_ioc_h2i_msg_u { 473a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 474a36c61f9SKrishna Gudipati struct bfi_ioc_ctrl_req_s enable_req; 475a36c61f9SKrishna Gudipati struct bfi_ioc_ctrl_req_s disable_req; 476a36c61f9SKrishna Gudipati struct bfi_ioc_getattr_req_s getattr_req; 477a36c61f9SKrishna Gudipati u32 mboxmsg[BFI_IOC_MSGSZ]; 478a36c61f9SKrishna Gudipati }; 479a36c61f9SKrishna Gudipati 480acdc79a6SJing Huang /* 481a36c61f9SKrishna Gudipati * I2H Messages 482a36c61f9SKrishna Gudipati */ 483a36c61f9SKrishna Gudipati union bfi_ioc_i2h_msg_u { 484a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 4851a4d8e1bSKrishna Gudipati struct bfi_ioc_ctrl_reply_s fw_event; 486a36c61f9SKrishna Gudipati u32 mboxmsg[BFI_IOC_MSGSZ]; 487a36c61f9SKrishna Gudipati }; 488a36c61f9SKrishna Gudipati 489a36c61f9SKrishna Gudipati 490acdc79a6SJing Huang /* 491a36c61f9SKrishna Gudipati *---------------------------------------------------------------------- 492a36c61f9SKrishna Gudipati * PBC 493a36c61f9SKrishna Gudipati *---------------------------------------------------------------------- 494a36c61f9SKrishna Gudipati */ 495a36c61f9SKrishna Gudipati 496a36c61f9SKrishna Gudipati #define BFI_PBC_MAX_BLUNS 8 497a36c61f9SKrishna Gudipati #define BFI_PBC_MAX_VPORTS 16 49843ffdf4dSKrishna Gudipati #define BFI_PBC_PORT_DISABLED 2 499a36c61f9SKrishna Gudipati 500acdc79a6SJing Huang /* 501a36c61f9SKrishna Gudipati * PBC boot lun configuration 502a36c61f9SKrishna Gudipati */ 503a36c61f9SKrishna Gudipati struct bfi_pbc_blun_s { 504a36c61f9SKrishna Gudipati wwn_t tgt_pwwn; 505f314878aSMaggie Zhang struct scsi_lun tgt_lun; 506a36c61f9SKrishna Gudipati }; 507a36c61f9SKrishna Gudipati 508acdc79a6SJing Huang /* 509a36c61f9SKrishna Gudipati * PBC virtual port configuration 510a36c61f9SKrishna Gudipati */ 511a36c61f9SKrishna Gudipati struct bfi_pbc_vport_s { 512a36c61f9SKrishna Gudipati wwn_t vp_pwwn; 513a36c61f9SKrishna Gudipati wwn_t vp_nwwn; 514a36c61f9SKrishna Gudipati }; 515a36c61f9SKrishna Gudipati 516acdc79a6SJing Huang /* 517a36c61f9SKrishna Gudipati * BFI pre-boot configuration information 518a36c61f9SKrishna Gudipati */ 519a36c61f9SKrishna Gudipati struct bfi_pbc_s { 520a36c61f9SKrishna Gudipati u8 port_enabled; 521a36c61f9SKrishna Gudipati u8 boot_enabled; 522a36c61f9SKrishna Gudipati u8 nbluns; 523a36c61f9SKrishna Gudipati u8 nvports; 524a36c61f9SKrishna Gudipati u8 port_speed; 525a36c61f9SKrishna Gudipati u8 rsvd_a; 526a36c61f9SKrishna Gudipati u16 hss; 527a36c61f9SKrishna Gudipati wwn_t pbc_pwwn; 528a36c61f9SKrishna Gudipati wwn_t pbc_nwwn; 529a36c61f9SKrishna Gudipati struct bfi_pbc_blun_s blun[BFI_PBC_MAX_BLUNS]; 530a36c61f9SKrishna Gudipati struct bfi_pbc_vport_s vport[BFI_PBC_MAX_VPORTS]; 531a36c61f9SKrishna Gudipati }; 532a36c61f9SKrishna Gudipati 533acdc79a6SJing Huang /* 534a36c61f9SKrishna Gudipati *---------------------------------------------------------------------- 535a36c61f9SKrishna Gudipati * MSGQ 536a36c61f9SKrishna Gudipati *---------------------------------------------------------------------- 537a36c61f9SKrishna Gudipati */ 538a36c61f9SKrishna Gudipati #define BFI_MSGQ_FULL(_q) (((_q->pi + 1) % _q->q_depth) == _q->ci) 539a36c61f9SKrishna Gudipati #define BFI_MSGQ_EMPTY(_q) (_q->pi == _q->ci) 540a36c61f9SKrishna Gudipati #define BFI_MSGQ_UPDATE_CI(_q) (_q->ci = (_q->ci + 1) % _q->q_depth) 541a36c61f9SKrishna Gudipati #define BFI_MSGQ_UPDATE_PI(_q) (_q->pi = (_q->pi + 1) % _q->q_depth) 542a36c61f9SKrishna Gudipati 543a36c61f9SKrishna Gudipati /* q_depth must be power of 2 */ 544a36c61f9SKrishna Gudipati #define BFI_MSGQ_FREE_CNT(_q) ((_q->ci - _q->pi - 1) & (_q->q_depth - 1)) 545a36c61f9SKrishna Gudipati 546a36c61f9SKrishna Gudipati enum bfi_msgq_h2i_msgs_e { 547a36c61f9SKrishna Gudipati BFI_MSGQ_H2I_INIT_REQ = 1, 548a36c61f9SKrishna Gudipati BFI_MSGQ_H2I_DOORBELL = 2, 549a36c61f9SKrishna Gudipati BFI_MSGQ_H2I_SHUTDOWN = 3, 550a36c61f9SKrishna Gudipati }; 551a36c61f9SKrishna Gudipati 552a36c61f9SKrishna Gudipati enum bfi_msgq_i2h_msgs_e { 553a36c61f9SKrishna Gudipati BFI_MSGQ_I2H_INIT_RSP = 1, 554a36c61f9SKrishna Gudipati BFI_MSGQ_I2H_DOORBELL = 2, 555a36c61f9SKrishna Gudipati }; 556a36c61f9SKrishna Gudipati 557a36c61f9SKrishna Gudipati 558a36c61f9SKrishna Gudipati /* Messages(commands/responsed/AENS will have the following header */ 559a36c61f9SKrishna Gudipati struct bfi_msgq_mhdr_s { 560a36c61f9SKrishna Gudipati u8 msg_class; 561a36c61f9SKrishna Gudipati u8 msg_id; 562a36c61f9SKrishna Gudipati u16 msg_token; 563a36c61f9SKrishna Gudipati u16 num_entries; 564a36c61f9SKrishna Gudipati u8 enet_id; 565a36c61f9SKrishna Gudipati u8 rsvd[1]; 566a36c61f9SKrishna Gudipati }; 567a36c61f9SKrishna Gudipati 568a36c61f9SKrishna Gudipati #define bfi_msgq_mhdr_set(_mh, _mc, _mid, _tok, _enet_id) do { \ 569a36c61f9SKrishna Gudipati (_mh).msg_class = (_mc); \ 570a36c61f9SKrishna Gudipati (_mh).msg_id = (_mid); \ 571a36c61f9SKrishna Gudipati (_mh).msg_token = (_tok); \ 572a36c61f9SKrishna Gudipati (_mh).enet_id = (_enet_id); \ 573a36c61f9SKrishna Gudipati } while (0) 574a36c61f9SKrishna Gudipati 575a36c61f9SKrishna Gudipati /* 576a36c61f9SKrishna Gudipati * Mailbox for messaging interface 577a36c61f9SKrishna Gudipati * 578a36c61f9SKrishna Gudipati */ 579a36c61f9SKrishna Gudipati #define BFI_MSGQ_CMD_ENTRY_SIZE (64) /* TBD */ 580a36c61f9SKrishna Gudipati #define BFI_MSGQ_RSP_ENTRY_SIZE (64) /* TBD */ 581a36c61f9SKrishna Gudipati #define BFI_MSGQ_MSG_SIZE_MAX (2048) /* TBD */ 582a36c61f9SKrishna Gudipati 583a36c61f9SKrishna Gudipati struct bfi_msgq_s { 584a36c61f9SKrishna Gudipati union bfi_addr_u addr; 585a36c61f9SKrishna Gudipati u16 q_depth; /* Total num of entries in the queue */ 586a36c61f9SKrishna Gudipati u8 rsvd[2]; 587a36c61f9SKrishna Gudipati }; 588a36c61f9SKrishna Gudipati 589a36c61f9SKrishna Gudipati /* BFI_ENET_MSGQ_CFG_REQ TBD init or cfg? */ 590a36c61f9SKrishna Gudipati struct bfi_msgq_cfg_req_s { 591a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 592a36c61f9SKrishna Gudipati struct bfi_msgq_s cmdq; 593a36c61f9SKrishna Gudipati struct bfi_msgq_s rspq; 594a36c61f9SKrishna Gudipati }; 595a36c61f9SKrishna Gudipati 596a36c61f9SKrishna Gudipati /* BFI_ENET_MSGQ_CFG_RSP */ 597a36c61f9SKrishna Gudipati struct bfi_msgq_cfg_rsp_s { 598a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 599a36c61f9SKrishna Gudipati u8 cmd_status; 600a36c61f9SKrishna Gudipati u8 rsvd[3]; 601a36c61f9SKrishna Gudipati }; 602a36c61f9SKrishna Gudipati 603a36c61f9SKrishna Gudipati 604a36c61f9SKrishna Gudipati /* BFI_MSGQ_H2I_DOORBELL */ 605a36c61f9SKrishna Gudipati struct bfi_msgq_h2i_db_s { 606a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 607a36c61f9SKrishna Gudipati u16 cmdq_pi; 608a36c61f9SKrishna Gudipati u16 rspq_ci; 609a36c61f9SKrishna Gudipati }; 610a36c61f9SKrishna Gudipati 611a36c61f9SKrishna Gudipati /* BFI_MSGQ_I2H_DOORBELL */ 612a36c61f9SKrishna Gudipati struct bfi_msgq_i2h_db_s { 613a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 614a36c61f9SKrishna Gudipati u16 rspq_pi; 615a36c61f9SKrishna Gudipati u16 cmdq_ci; 616a36c61f9SKrishna Gudipati }; 617a36c61f9SKrishna Gudipati 618a36c61f9SKrishna Gudipati #pragma pack() 619a36c61f9SKrishna Gudipati 620a36c61f9SKrishna Gudipati /* BFI port specific */ 621a36c61f9SKrishna Gudipati #pragma pack(1) 622a36c61f9SKrishna Gudipati 623a36c61f9SKrishna Gudipati enum bfi_port_h2i { 624a36c61f9SKrishna Gudipati BFI_PORT_H2I_ENABLE_REQ = (1), 625a36c61f9SKrishna Gudipati BFI_PORT_H2I_DISABLE_REQ = (2), 626a36c61f9SKrishna Gudipati BFI_PORT_H2I_GET_STATS_REQ = (3), 627a36c61f9SKrishna Gudipati BFI_PORT_H2I_CLEAR_STATS_REQ = (4), 628a36c61f9SKrishna Gudipati }; 629a36c61f9SKrishna Gudipati 630a36c61f9SKrishna Gudipati enum bfi_port_i2h { 631a36c61f9SKrishna Gudipati BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1), 632a36c61f9SKrishna Gudipati BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2), 633a36c61f9SKrishna Gudipati BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3), 634a36c61f9SKrishna Gudipati BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4), 635a36c61f9SKrishna Gudipati }; 636a36c61f9SKrishna Gudipati 637acdc79a6SJing Huang /* 638a36c61f9SKrishna Gudipati * Generic REQ type 639a36c61f9SKrishna Gudipati */ 640a36c61f9SKrishna Gudipati struct bfi_port_generic_req_s { 641a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; /* msg header */ 642a36c61f9SKrishna Gudipati u32 msgtag; /* msgtag for reply */ 643a36c61f9SKrishna Gudipati u32 rsvd; 644a36c61f9SKrishna Gudipati }; 645a36c61f9SKrishna Gudipati 646acdc79a6SJing Huang /* 647a36c61f9SKrishna Gudipati * Generic RSP type 648a36c61f9SKrishna Gudipati */ 649a36c61f9SKrishna Gudipati struct bfi_port_generic_rsp_s { 650a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; /* common msg header */ 651a36c61f9SKrishna Gudipati u8 status; /* port enable status */ 652a36c61f9SKrishna Gudipati u8 rsvd[3]; 653a36c61f9SKrishna Gudipati u32 msgtag; /* msgtag for reply */ 654a36c61f9SKrishna Gudipati }; 655a36c61f9SKrishna Gudipati 656acdc79a6SJing Huang /* 657a36c61f9SKrishna Gudipati * BFI_PORT_H2I_GET_STATS_REQ 658a36c61f9SKrishna Gudipati */ 659a36c61f9SKrishna Gudipati struct bfi_port_get_stats_req_s { 660a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; /* common msg header */ 661a36c61f9SKrishna Gudipati union bfi_addr_u dma_addr; 662a36c61f9SKrishna Gudipati }; 663a36c61f9SKrishna Gudipati 664a36c61f9SKrishna Gudipati union bfi_port_h2i_msg_u { 665a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 666a36c61f9SKrishna Gudipati struct bfi_port_generic_req_s enable_req; 667a36c61f9SKrishna Gudipati struct bfi_port_generic_req_s disable_req; 668a36c61f9SKrishna Gudipati struct bfi_port_get_stats_req_s getstats_req; 669a36c61f9SKrishna Gudipati struct bfi_port_generic_req_s clearstats_req; 670a36c61f9SKrishna Gudipati }; 671a36c61f9SKrishna Gudipati 672a36c61f9SKrishna Gudipati union bfi_port_i2h_msg_u { 673a36c61f9SKrishna Gudipati struct bfi_mhdr_s mh; 674a36c61f9SKrishna Gudipati struct bfi_port_generic_rsp_s enable_rsp; 675a36c61f9SKrishna Gudipati struct bfi_port_generic_rsp_s disable_rsp; 676a36c61f9SKrishna Gudipati struct bfi_port_generic_rsp_s getstats_rsp; 677a36c61f9SKrishna Gudipati struct bfi_port_generic_rsp_s clearstats_rsp; 678a36c61f9SKrishna Gudipati }; 679a36c61f9SKrishna Gudipati 6801a4d8e1bSKrishna Gudipati /* 6811a4d8e1bSKrishna Gudipati *---------------------------------------------------------------------- 6821a4d8e1bSKrishna Gudipati * ABLK 6831a4d8e1bSKrishna Gudipati *---------------------------------------------------------------------- 6841a4d8e1bSKrishna Gudipati */ 6851a4d8e1bSKrishna Gudipati enum bfi_ablk_h2i_msgs_e { 6861a4d8e1bSKrishna Gudipati BFI_ABLK_H2I_QUERY = 1, 6871a4d8e1bSKrishna Gudipati BFI_ABLK_H2I_ADPT_CONFIG = 2, 6881a4d8e1bSKrishna Gudipati BFI_ABLK_H2I_PORT_CONFIG = 3, 6891a4d8e1bSKrishna Gudipati BFI_ABLK_H2I_PF_CREATE = 4, 6901a4d8e1bSKrishna Gudipati BFI_ABLK_H2I_PF_DELETE = 5, 6911a4d8e1bSKrishna Gudipati BFI_ABLK_H2I_PF_UPDATE = 6, 6921a4d8e1bSKrishna Gudipati BFI_ABLK_H2I_OPTROM_ENABLE = 7, 6931a4d8e1bSKrishna Gudipati BFI_ABLK_H2I_OPTROM_DISABLE = 8, 6941a4d8e1bSKrishna Gudipati }; 6951a4d8e1bSKrishna Gudipati 6961a4d8e1bSKrishna Gudipati enum bfi_ablk_i2h_msgs_e { 6971a4d8e1bSKrishna Gudipati BFI_ABLK_I2H_QUERY = BFA_I2HM(BFI_ABLK_H2I_QUERY), 6981a4d8e1bSKrishna Gudipati BFI_ABLK_I2H_ADPT_CONFIG = BFA_I2HM(BFI_ABLK_H2I_ADPT_CONFIG), 6991a4d8e1bSKrishna Gudipati BFI_ABLK_I2H_PORT_CONFIG = BFA_I2HM(BFI_ABLK_H2I_PORT_CONFIG), 7001a4d8e1bSKrishna Gudipati BFI_ABLK_I2H_PF_CREATE = BFA_I2HM(BFI_ABLK_H2I_PF_CREATE), 7011a4d8e1bSKrishna Gudipati BFI_ABLK_I2H_PF_DELETE = BFA_I2HM(BFI_ABLK_H2I_PF_DELETE), 7021a4d8e1bSKrishna Gudipati BFI_ABLK_I2H_PF_UPDATE = BFA_I2HM(BFI_ABLK_H2I_PF_UPDATE), 7031a4d8e1bSKrishna Gudipati BFI_ABLK_I2H_OPTROM_ENABLE = BFA_I2HM(BFI_ABLK_H2I_OPTROM_ENABLE), 7041a4d8e1bSKrishna Gudipati BFI_ABLK_I2H_OPTROM_DISABLE = BFA_I2HM(BFI_ABLK_H2I_OPTROM_DISABLE), 7051a4d8e1bSKrishna Gudipati }; 7061a4d8e1bSKrishna Gudipati 7071a4d8e1bSKrishna Gudipati /* BFI_ABLK_H2I_QUERY */ 7081a4d8e1bSKrishna Gudipati struct bfi_ablk_h2i_query_s { 7091a4d8e1bSKrishna Gudipati struct bfi_mhdr_s mh; 7101a4d8e1bSKrishna Gudipati union bfi_addr_u addr; 7111a4d8e1bSKrishna Gudipati }; 7121a4d8e1bSKrishna Gudipati 7131a4d8e1bSKrishna Gudipati /* BFI_ABL_H2I_ADPT_CONFIG, BFI_ABLK_H2I_PORT_CONFIG */ 7141a4d8e1bSKrishna Gudipati struct bfi_ablk_h2i_cfg_req_s { 7151a4d8e1bSKrishna Gudipati struct bfi_mhdr_s mh; 7161a4d8e1bSKrishna Gudipati u8 mode; 7171a4d8e1bSKrishna Gudipati u8 port; 7181a4d8e1bSKrishna Gudipati u8 max_pf; 7191a4d8e1bSKrishna Gudipati u8 max_vf; 7201a4d8e1bSKrishna Gudipati }; 7211a4d8e1bSKrishna Gudipati 7221a4d8e1bSKrishna Gudipati /* 7231a4d8e1bSKrishna Gudipati * BFI_ABLK_H2I_PF_CREATE, BFI_ABLK_H2I_PF_DELETE, 7241a4d8e1bSKrishna Gudipati */ 7251a4d8e1bSKrishna Gudipati struct bfi_ablk_h2i_pf_req_s { 7261a4d8e1bSKrishna Gudipati struct bfi_mhdr_s mh; 7271a4d8e1bSKrishna Gudipati u8 pcifn; 7281a4d8e1bSKrishna Gudipati u8 port; 7291a4d8e1bSKrishna Gudipati u16 pers; 7301a1297c6SKrishna Gudipati u16 bw_min; /* percent BW @ max speed */ 7311a1297c6SKrishna Gudipati u16 bw_max; /* percent BW @ max speed */ 7321a4d8e1bSKrishna Gudipati }; 7331a4d8e1bSKrishna Gudipati 7341a4d8e1bSKrishna Gudipati /* BFI_ABLK_H2I_OPTROM_ENABLE, BFI_ABLK_H2I_OPTROM_DISABLE */ 7351a4d8e1bSKrishna Gudipati struct bfi_ablk_h2i_optrom_s { 7361a4d8e1bSKrishna Gudipati struct bfi_mhdr_s mh; 7371a4d8e1bSKrishna Gudipati }; 7381a4d8e1bSKrishna Gudipati 7391a4d8e1bSKrishna Gudipati /* 7401a4d8e1bSKrishna Gudipati * BFI_ABLK_I2H_QUERY 7411a4d8e1bSKrishna Gudipati * BFI_ABLK_I2H_PORT_CONFIG 7421a4d8e1bSKrishna Gudipati * BFI_ABLK_I2H_PF_CREATE 7431a4d8e1bSKrishna Gudipati * BFI_ABLK_I2H_PF_DELETE 7441a4d8e1bSKrishna Gudipati * BFI_ABLK_I2H_PF_UPDATE 7451a4d8e1bSKrishna Gudipati * BFI_ABLK_I2H_OPTROM_ENABLE 7461a4d8e1bSKrishna Gudipati * BFI_ABLK_I2H_OPTROM_DISABLE 7471a4d8e1bSKrishna Gudipati */ 7481a4d8e1bSKrishna Gudipati struct bfi_ablk_i2h_rsp_s { 7491a4d8e1bSKrishna Gudipati struct bfi_mhdr_s mh; 7501a4d8e1bSKrishna Gudipati u8 status; 7511a4d8e1bSKrishna Gudipati u8 pcifn; 7521a4d8e1bSKrishna Gudipati u8 port_mode; 7531a4d8e1bSKrishna Gudipati }; 7541a4d8e1bSKrishna Gudipati 755148d6103SKrishna Gudipati 756148d6103SKrishna Gudipati /* 757148d6103SKrishna Gudipati * CEE module specific messages 758148d6103SKrishna Gudipati */ 759148d6103SKrishna Gudipati 760148d6103SKrishna Gudipati /* Mailbox commands from host to firmware */ 761148d6103SKrishna Gudipati enum bfi_cee_h2i_msgs_e { 762148d6103SKrishna Gudipati BFI_CEE_H2I_GET_CFG_REQ = 1, 763148d6103SKrishna Gudipati BFI_CEE_H2I_RESET_STATS = 2, 764148d6103SKrishna Gudipati BFI_CEE_H2I_GET_STATS_REQ = 3, 765148d6103SKrishna Gudipati }; 766148d6103SKrishna Gudipati 767148d6103SKrishna Gudipati enum bfi_cee_i2h_msgs_e { 768148d6103SKrishna Gudipati BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1), 769148d6103SKrishna Gudipati BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2), 770148d6103SKrishna Gudipati BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3), 771148d6103SKrishna Gudipati }; 772148d6103SKrishna Gudipati 773148d6103SKrishna Gudipati /* 774148d6103SKrishna Gudipati * H2I command structure for resetting the stats 775148d6103SKrishna Gudipati */ 776148d6103SKrishna Gudipati struct bfi_cee_reset_stats_s { 777148d6103SKrishna Gudipati struct bfi_mhdr_s mh; 778148d6103SKrishna Gudipati }; 779148d6103SKrishna Gudipati 780148d6103SKrishna Gudipati /* 781148d6103SKrishna Gudipati * Get configuration command from host 782148d6103SKrishna Gudipati */ 783148d6103SKrishna Gudipati struct bfi_cee_get_req_s { 784148d6103SKrishna Gudipati struct bfi_mhdr_s mh; 785148d6103SKrishna Gudipati union bfi_addr_u dma_addr; 786148d6103SKrishna Gudipati }; 787148d6103SKrishna Gudipati 788148d6103SKrishna Gudipati /* 789148d6103SKrishna Gudipati * Reply message from firmware 790148d6103SKrishna Gudipati */ 791148d6103SKrishna Gudipati struct bfi_cee_get_rsp_s { 792148d6103SKrishna Gudipati struct bfi_mhdr_s mh; 793148d6103SKrishna Gudipati u8 cmd_status; 794148d6103SKrishna Gudipati u8 rsvd[3]; 795148d6103SKrishna Gudipati }; 796148d6103SKrishna Gudipati 797148d6103SKrishna Gudipati /* 798148d6103SKrishna Gudipati * Reply message from firmware 799148d6103SKrishna Gudipati */ 800148d6103SKrishna Gudipati struct bfi_cee_stats_rsp_s { 801148d6103SKrishna Gudipati struct bfi_mhdr_s mh; 802148d6103SKrishna Gudipati u8 cmd_status; 803148d6103SKrishna Gudipati u8 rsvd[3]; 804148d6103SKrishna Gudipati }; 805148d6103SKrishna Gudipati 806148d6103SKrishna Gudipati /* Mailbox message structures from firmware to host */ 807148d6103SKrishna Gudipati union bfi_cee_i2h_msg_u { 808148d6103SKrishna Gudipati struct bfi_mhdr_s mh; 809148d6103SKrishna Gudipati struct bfi_cee_get_rsp_s get_rsp; 810148d6103SKrishna Gudipati struct bfi_cee_stats_rsp_s stats_rsp; 811148d6103SKrishna Gudipati }; 812148d6103SKrishna Gudipati 81351e569aaSKrishna Gudipati /* 81451e569aaSKrishna Gudipati * SFP related 81551e569aaSKrishna Gudipati */ 81651e569aaSKrishna Gudipati 81751e569aaSKrishna Gudipati enum bfi_sfp_h2i_e { 81851e569aaSKrishna Gudipati BFI_SFP_H2I_SHOW = 1, 81951e569aaSKrishna Gudipati BFI_SFP_H2I_SCN = 2, 82051e569aaSKrishna Gudipati }; 82151e569aaSKrishna Gudipati 82251e569aaSKrishna Gudipati enum bfi_sfp_i2h_e { 82351e569aaSKrishna Gudipati BFI_SFP_I2H_SHOW = BFA_I2HM(BFI_SFP_H2I_SHOW), 82451e569aaSKrishna Gudipati BFI_SFP_I2H_SCN = BFA_I2HM(BFI_SFP_H2I_SCN), 82551e569aaSKrishna Gudipati }; 82651e569aaSKrishna Gudipati 82751e569aaSKrishna Gudipati /* 8287826f304SKrishna Gudipati * SFP state change notification 8297826f304SKrishna Gudipati */ 8307826f304SKrishna Gudipati struct bfi_sfp_scn_s { 8317826f304SKrishna Gudipati struct bfi_mhdr_s mhr; /* host msg header */ 8327826f304SKrishna Gudipati u8 event; 8337826f304SKrishna Gudipati u8 sfpid; 8347826f304SKrishna Gudipati u8 pomlvl; /* pom level: normal/warning/alarm */ 8357826f304SKrishna Gudipati u8 is_elb; /* e-loopback */ 8367826f304SKrishna Gudipati }; 8377826f304SKrishna Gudipati 8387826f304SKrishna Gudipati /* 83951e569aaSKrishna Gudipati * SFP state 84051e569aaSKrishna Gudipati */ 84151e569aaSKrishna Gudipati enum bfa_sfp_stat_e { 84251e569aaSKrishna Gudipati BFA_SFP_STATE_INIT = 0, /* SFP state is uninit */ 84351e569aaSKrishna Gudipati BFA_SFP_STATE_REMOVED = 1, /* SFP is removed */ 84451e569aaSKrishna Gudipati BFA_SFP_STATE_INSERTED = 2, /* SFP is inserted */ 84551e569aaSKrishna Gudipati BFA_SFP_STATE_VALID = 3, /* SFP is valid */ 84651e569aaSKrishna Gudipati BFA_SFP_STATE_UNSUPPORT = 4, /* SFP is unsupport */ 84751e569aaSKrishna Gudipati BFA_SFP_STATE_FAILED = 5, /* SFP i2c read fail */ 84851e569aaSKrishna Gudipati }; 84951e569aaSKrishna Gudipati 85051e569aaSKrishna Gudipati /* 85151e569aaSKrishna Gudipati * SFP memory access type 85251e569aaSKrishna Gudipati */ 85351e569aaSKrishna Gudipati enum bfi_sfp_mem_e { 85451e569aaSKrishna Gudipati BFI_SFP_MEM_ALL = 0x1, /* access all data field */ 85551e569aaSKrishna Gudipati BFI_SFP_MEM_DIAGEXT = 0x2, /* access diag ext data field only */ 85651e569aaSKrishna Gudipati }; 85751e569aaSKrishna Gudipati 85851e569aaSKrishna Gudipati struct bfi_sfp_req_s { 85951e569aaSKrishna Gudipati struct bfi_mhdr_s mh; 86051e569aaSKrishna Gudipati u8 memtype; 86151e569aaSKrishna Gudipati u8 rsvd[3]; 86251e569aaSKrishna Gudipati struct bfi_alen_s alen; 86351e569aaSKrishna Gudipati }; 86451e569aaSKrishna Gudipati 86551e569aaSKrishna Gudipati struct bfi_sfp_rsp_s { 86651e569aaSKrishna Gudipati struct bfi_mhdr_s mh; 86751e569aaSKrishna Gudipati u8 status; 86851e569aaSKrishna Gudipati u8 state; 86951e569aaSKrishna Gudipati u8 rsvd[2]; 87051e569aaSKrishna Gudipati }; 87151e569aaSKrishna Gudipati 8725a54b1d5SKrishna Gudipati /* 8735a54b1d5SKrishna Gudipati * FLASH module specific 8745a54b1d5SKrishna Gudipati */ 8755a54b1d5SKrishna Gudipati enum bfi_flash_h2i_msgs { 8765a54b1d5SKrishna Gudipati BFI_FLASH_H2I_QUERY_REQ = 1, 8775a54b1d5SKrishna Gudipati BFI_FLASH_H2I_ERASE_REQ = 2, 8785a54b1d5SKrishna Gudipati BFI_FLASH_H2I_WRITE_REQ = 3, 8795a54b1d5SKrishna Gudipati BFI_FLASH_H2I_READ_REQ = 4, 8805a54b1d5SKrishna Gudipati BFI_FLASH_H2I_BOOT_VER_REQ = 5, 8815a54b1d5SKrishna Gudipati }; 8825a54b1d5SKrishna Gudipati 8835a54b1d5SKrishna Gudipati enum bfi_flash_i2h_msgs { 8845a54b1d5SKrishna Gudipati BFI_FLASH_I2H_QUERY_RSP = BFA_I2HM(1), 8855a54b1d5SKrishna Gudipati BFI_FLASH_I2H_ERASE_RSP = BFA_I2HM(2), 8865a54b1d5SKrishna Gudipati BFI_FLASH_I2H_WRITE_RSP = BFA_I2HM(3), 8875a54b1d5SKrishna Gudipati BFI_FLASH_I2H_READ_RSP = BFA_I2HM(4), 8885a54b1d5SKrishna Gudipati BFI_FLASH_I2H_BOOT_VER_RSP = BFA_I2HM(5), 8895a54b1d5SKrishna Gudipati BFI_FLASH_I2H_EVENT = BFA_I2HM(127), 8905a54b1d5SKrishna Gudipati }; 8915a54b1d5SKrishna Gudipati 8925a54b1d5SKrishna Gudipati /* 8935a54b1d5SKrishna Gudipati * Flash query request 8945a54b1d5SKrishna Gudipati */ 8955a54b1d5SKrishna Gudipati struct bfi_flash_query_req_s { 8965a54b1d5SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 8975a54b1d5SKrishna Gudipati struct bfi_alen_s alen; 8985a54b1d5SKrishna Gudipati }; 8995a54b1d5SKrishna Gudipati 9005a54b1d5SKrishna Gudipati /* 9015a54b1d5SKrishna Gudipati * Flash erase request 9025a54b1d5SKrishna Gudipati */ 9035a54b1d5SKrishna Gudipati struct bfi_flash_erase_req_s { 9045a54b1d5SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 9055a54b1d5SKrishna Gudipati u32 type; /* partition type */ 9065a54b1d5SKrishna Gudipati u8 instance; /* partition instance */ 9075a54b1d5SKrishna Gudipati u8 rsv[3]; 9085a54b1d5SKrishna Gudipati }; 9095a54b1d5SKrishna Gudipati 9105a54b1d5SKrishna Gudipati /* 9115a54b1d5SKrishna Gudipati * Flash write request 9125a54b1d5SKrishna Gudipati */ 9135a54b1d5SKrishna Gudipati struct bfi_flash_write_req_s { 9145a54b1d5SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 9155a54b1d5SKrishna Gudipati struct bfi_alen_s alen; 9165a54b1d5SKrishna Gudipati u32 type; /* partition type */ 9175a54b1d5SKrishna Gudipati u8 instance; /* partition instance */ 9185a54b1d5SKrishna Gudipati u8 last; 9195a54b1d5SKrishna Gudipati u8 rsv[2]; 9205a54b1d5SKrishna Gudipati u32 offset; 9215a54b1d5SKrishna Gudipati u32 length; 9225a54b1d5SKrishna Gudipati }; 9235a54b1d5SKrishna Gudipati 9245a54b1d5SKrishna Gudipati /* 9255a54b1d5SKrishna Gudipati * Flash read request 9265a54b1d5SKrishna Gudipati */ 9275a54b1d5SKrishna Gudipati struct bfi_flash_read_req_s { 9285a54b1d5SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 9295a54b1d5SKrishna Gudipati u32 type; /* partition type */ 9305a54b1d5SKrishna Gudipati u8 instance; /* partition instance */ 9315a54b1d5SKrishna Gudipati u8 rsv[3]; 9325a54b1d5SKrishna Gudipati u32 offset; 9335a54b1d5SKrishna Gudipati u32 length; 9345a54b1d5SKrishna Gudipati struct bfi_alen_s alen; 9355a54b1d5SKrishna Gudipati }; 9365a54b1d5SKrishna Gudipati 9375a54b1d5SKrishna Gudipati /* 9385a54b1d5SKrishna Gudipati * Flash query response 9395a54b1d5SKrishna Gudipati */ 9405a54b1d5SKrishna Gudipati struct bfi_flash_query_rsp_s { 9415a54b1d5SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 9425a54b1d5SKrishna Gudipati u32 status; 9435a54b1d5SKrishna Gudipati }; 9445a54b1d5SKrishna Gudipati 9455a54b1d5SKrishna Gudipati /* 9465a54b1d5SKrishna Gudipati * Flash read response 9475a54b1d5SKrishna Gudipati */ 9485a54b1d5SKrishna Gudipati struct bfi_flash_read_rsp_s { 9495a54b1d5SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 9505a54b1d5SKrishna Gudipati u32 type; /* partition type */ 9515a54b1d5SKrishna Gudipati u8 instance; /* partition instance */ 9525a54b1d5SKrishna Gudipati u8 rsv[3]; 9535a54b1d5SKrishna Gudipati u32 status; 9545a54b1d5SKrishna Gudipati u32 length; 9555a54b1d5SKrishna Gudipati }; 9565a54b1d5SKrishna Gudipati 9575a54b1d5SKrishna Gudipati /* 9585a54b1d5SKrishna Gudipati * Flash write response 9595a54b1d5SKrishna Gudipati */ 9605a54b1d5SKrishna Gudipati struct bfi_flash_write_rsp_s { 9615a54b1d5SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 9625a54b1d5SKrishna Gudipati u32 type; /* partition type */ 9635a54b1d5SKrishna Gudipati u8 instance; /* partition instance */ 9645a54b1d5SKrishna Gudipati u8 rsv[3]; 9655a54b1d5SKrishna Gudipati u32 status; 9665a54b1d5SKrishna Gudipati u32 length; 9675a54b1d5SKrishna Gudipati }; 9685a54b1d5SKrishna Gudipati 9695a54b1d5SKrishna Gudipati /* 9705a54b1d5SKrishna Gudipati * Flash erase response 9715a54b1d5SKrishna Gudipati */ 9725a54b1d5SKrishna Gudipati struct bfi_flash_erase_rsp_s { 9735a54b1d5SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 9745a54b1d5SKrishna Gudipati u32 type; /* partition type */ 9755a54b1d5SKrishna Gudipati u8 instance; /* partition instance */ 9765a54b1d5SKrishna Gudipati u8 rsv[3]; 9775a54b1d5SKrishna Gudipati u32 status; 9785a54b1d5SKrishna Gudipati }; 9795a54b1d5SKrishna Gudipati 9803d7fc66dSKrishna Gudipati /* 9817826f304SKrishna Gudipati * Flash event notification 9827826f304SKrishna Gudipati */ 9837826f304SKrishna Gudipati struct bfi_flash_event_s { 9847826f304SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 9857826f304SKrishna Gudipati bfa_status_t status; 9867826f304SKrishna Gudipati u32 param; 9877826f304SKrishna Gudipati }; 9887826f304SKrishna Gudipati 9897826f304SKrishna Gudipati /* 9903d7fc66dSKrishna Gudipati *---------------------------------------------------------------------- 9913d7fc66dSKrishna Gudipati * DIAG 9923d7fc66dSKrishna Gudipati *---------------------------------------------------------------------- 9933d7fc66dSKrishna Gudipati */ 9943d7fc66dSKrishna Gudipati enum bfi_diag_h2i { 9953d7fc66dSKrishna Gudipati BFI_DIAG_H2I_PORTBEACON = 1, 9963d7fc66dSKrishna Gudipati BFI_DIAG_H2I_LOOPBACK = 2, 9973d7fc66dSKrishna Gudipati BFI_DIAG_H2I_FWPING = 3, 9983d7fc66dSKrishna Gudipati BFI_DIAG_H2I_TEMPSENSOR = 4, 9993d7fc66dSKrishna Gudipati BFI_DIAG_H2I_LEDTEST = 5, 10003d7fc66dSKrishna Gudipati BFI_DIAG_H2I_QTEST = 6, 1001e353546eSKrishna Gudipati BFI_DIAG_H2I_DPORT = 7, 10023d7fc66dSKrishna Gudipati }; 10033d7fc66dSKrishna Gudipati 10043d7fc66dSKrishna Gudipati enum bfi_diag_i2h { 10053d7fc66dSKrishna Gudipati BFI_DIAG_I2H_PORTBEACON = BFA_I2HM(BFI_DIAG_H2I_PORTBEACON), 10063d7fc66dSKrishna Gudipati BFI_DIAG_I2H_LOOPBACK = BFA_I2HM(BFI_DIAG_H2I_LOOPBACK), 10073d7fc66dSKrishna Gudipati BFI_DIAG_I2H_FWPING = BFA_I2HM(BFI_DIAG_H2I_FWPING), 10083d7fc66dSKrishna Gudipati BFI_DIAG_I2H_TEMPSENSOR = BFA_I2HM(BFI_DIAG_H2I_TEMPSENSOR), 10093d7fc66dSKrishna Gudipati BFI_DIAG_I2H_LEDTEST = BFA_I2HM(BFI_DIAG_H2I_LEDTEST), 10103d7fc66dSKrishna Gudipati BFI_DIAG_I2H_QTEST = BFA_I2HM(BFI_DIAG_H2I_QTEST), 1011e353546eSKrishna Gudipati BFI_DIAG_I2H_DPORT = BFA_I2HM(BFI_DIAG_H2I_DPORT), 10121a898a79SVijaya Mohan Guvva BFI_DIAG_I2H_DPORT_SCN = BFA_I2HM(8), 10133d7fc66dSKrishna Gudipati }; 10143d7fc66dSKrishna Gudipati 10153d7fc66dSKrishna Gudipati #define BFI_DIAG_MAX_SGES 2 10163d7fc66dSKrishna Gudipati #define BFI_DIAG_DMA_BUF_SZ (2 * 1024) 10173d7fc66dSKrishna Gudipati #define BFI_BOOT_MEMTEST_RES_ADDR 0x900 10183d7fc66dSKrishna Gudipati #define BFI_BOOT_MEMTEST_RES_SIG 0xA0A1A2A3 10193d7fc66dSKrishna Gudipati 10203d7fc66dSKrishna Gudipati struct bfi_diag_lb_req_s { 10213d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; 10223d7fc66dSKrishna Gudipati u32 loopcnt; 10233d7fc66dSKrishna Gudipati u32 pattern; 10243d7fc66dSKrishna Gudipati u8 lb_mode; /*!< bfa_port_opmode_t */ 10253d7fc66dSKrishna Gudipati u8 speed; /*!< bfa_port_speed_t */ 10263d7fc66dSKrishna Gudipati u8 rsvd[2]; 10273d7fc66dSKrishna Gudipati }; 10283d7fc66dSKrishna Gudipati 10293d7fc66dSKrishna Gudipati struct bfi_diag_lb_rsp_s { 10303d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 10313d7fc66dSKrishna Gudipati struct bfa_diag_loopback_result_s res; /* 16 bytes */ 10323d7fc66dSKrishna Gudipati }; 10333d7fc66dSKrishna Gudipati 10343d7fc66dSKrishna Gudipati struct bfi_diag_fwping_req_s { 10353d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 10363d7fc66dSKrishna Gudipati struct bfi_alen_s alen; /* 12 bytes */ 10373d7fc66dSKrishna Gudipati u32 data; /* user input data pattern */ 10383d7fc66dSKrishna Gudipati u32 count; /* user input dma count */ 10393d7fc66dSKrishna Gudipati u8 qtag; /* track CPE vc */ 10403d7fc66dSKrishna Gudipati u8 rsv[3]; 10413d7fc66dSKrishna Gudipati }; 10423d7fc66dSKrishna Gudipati 10433d7fc66dSKrishna Gudipati struct bfi_diag_fwping_rsp_s { 10443d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 10453d7fc66dSKrishna Gudipati u32 data; /* user input data pattern */ 10463d7fc66dSKrishna Gudipati u8 qtag; /* track CPE vc */ 10473d7fc66dSKrishna Gudipati u8 dma_status; /* dma status */ 10483d7fc66dSKrishna Gudipati u8 rsv[2]; 10493d7fc66dSKrishna Gudipati }; 10503d7fc66dSKrishna Gudipati 10513d7fc66dSKrishna Gudipati /* 10523d7fc66dSKrishna Gudipati * Temperature Sensor 10533d7fc66dSKrishna Gudipati */ 10543d7fc66dSKrishna Gudipati struct bfi_diag_ts_req_s { 10553d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 10563d7fc66dSKrishna Gudipati u16 temp; /* 10-bit A/D value */ 10573d7fc66dSKrishna Gudipati u16 brd_temp; /* 9-bit board temp */ 10583d7fc66dSKrishna Gudipati u8 status; 10593d7fc66dSKrishna Gudipati u8 ts_junc; /* show junction tempsensor */ 10603d7fc66dSKrishna Gudipati u8 ts_brd; /* show board tempsensor */ 10613d7fc66dSKrishna Gudipati u8 rsv; 10623d7fc66dSKrishna Gudipati }; 10633d7fc66dSKrishna Gudipati #define bfi_diag_ts_rsp_t struct bfi_diag_ts_req_s 10643d7fc66dSKrishna Gudipati 10653d7fc66dSKrishna Gudipati struct bfi_diag_ledtest_req_s { 10663d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 10673d7fc66dSKrishna Gudipati u8 cmd; 10683d7fc66dSKrishna Gudipati u8 color; 10693d7fc66dSKrishna Gudipati u8 portid; 10703d7fc66dSKrishna Gudipati u8 led; /* bitmap of LEDs to be tested */ 10713d7fc66dSKrishna Gudipati u16 freq; /* no. of blinks every 10 secs */ 10723d7fc66dSKrishna Gudipati u8 rsv[2]; 10733d7fc66dSKrishna Gudipati }; 10743d7fc66dSKrishna Gudipati 10753d7fc66dSKrishna Gudipati /* notify host led operation is done */ 10763d7fc66dSKrishna Gudipati struct bfi_diag_ledtest_rsp_s { 10773d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 10783d7fc66dSKrishna Gudipati }; 10793d7fc66dSKrishna Gudipati 10803d7fc66dSKrishna Gudipati struct bfi_diag_portbeacon_req_s { 10813d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 10823d7fc66dSKrishna Gudipati u32 period; /* beaconing period */ 10833d7fc66dSKrishna Gudipati u8 beacon; /* 1: beacon on */ 10843d7fc66dSKrishna Gudipati u8 rsvd[3]; 10853d7fc66dSKrishna Gudipati }; 10863d7fc66dSKrishna Gudipati 10873d7fc66dSKrishna Gudipati /* notify host the beacon is off */ 10883d7fc66dSKrishna Gudipati struct bfi_diag_portbeacon_rsp_s { 10893d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 10903d7fc66dSKrishna Gudipati }; 10913d7fc66dSKrishna Gudipati 10923d7fc66dSKrishna Gudipati struct bfi_diag_qtest_req_s { 10933d7fc66dSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 10943d7fc66dSKrishna Gudipati u32 data[BFI_LMSG_PL_WSZ]; /* fill up tcm prefetch area */ 10953d7fc66dSKrishna Gudipati }; 10963d7fc66dSKrishna Gudipati #define bfi_diag_qtest_rsp_t struct bfi_diag_qtest_req_s 10973d7fc66dSKrishna Gudipati 10983350d98dSKrishna Gudipati /* 1099e353546eSKrishna Gudipati * D-port test 1100e353546eSKrishna Gudipati */ 1101e353546eSKrishna Gudipati enum bfi_dport_req { 1102e353546eSKrishna Gudipati BFI_DPORT_DISABLE = 0, /* disable dport request */ 1103e353546eSKrishna Gudipati BFI_DPORT_ENABLE = 1, /* enable dport request */ 11041a898a79SVijaya Mohan Guvva BFI_DPORT_START = 2, /* start dport request */ 11051a898a79SVijaya Mohan Guvva BFI_DPORT_SHOW = 3, /* show dport request */ 11061a898a79SVijaya Mohan Guvva BFI_DPORT_DYN_DISABLE = 4, /* disable dynamic dport request */ 11071a898a79SVijaya Mohan Guvva }; 11081a898a79SVijaya Mohan Guvva 11091a898a79SVijaya Mohan Guvva enum bfi_dport_scn { 11101a898a79SVijaya Mohan Guvva BFI_DPORT_SCN_TESTSTART = 1, 11111a898a79SVijaya Mohan Guvva BFI_DPORT_SCN_TESTCOMP = 2, 11121a898a79SVijaya Mohan Guvva BFI_DPORT_SCN_SFP_REMOVED = 3, 11131a898a79SVijaya Mohan Guvva BFI_DPORT_SCN_DDPORT_ENABLE = 4, 11141a898a79SVijaya Mohan Guvva BFI_DPORT_SCN_DDPORT_DISABLE = 5, 11151a898a79SVijaya Mohan Guvva BFI_DPORT_SCN_FCPORT_DISABLE = 6, 11161a898a79SVijaya Mohan Guvva BFI_DPORT_SCN_SUBTESTSTART = 7, 11171a898a79SVijaya Mohan Guvva BFI_DPORT_SCN_TESTSKIP = 8, 11181a898a79SVijaya Mohan Guvva BFI_DPORT_SCN_DDPORT_DISABLED = 9, 1119e353546eSKrishna Gudipati }; 1120e353546eSKrishna Gudipati 1121e353546eSKrishna Gudipati struct bfi_diag_dport_req_s { 1122e353546eSKrishna Gudipati struct bfi_mhdr_s mh; /* 4 bytes */ 1123e353546eSKrishna Gudipati u8 req; /* request 1: enable 0: disable */ 11241a898a79SVijaya Mohan Guvva u8 rsvd[3]; 11251a898a79SVijaya Mohan Guvva u32 lpcnt; 11261a898a79SVijaya Mohan Guvva u32 payload; 1127e353546eSKrishna Gudipati }; 11281a898a79SVijaya Mohan Guvva 11291a898a79SVijaya Mohan Guvva struct bfi_diag_dport_rsp_s { 11301a898a79SVijaya Mohan Guvva struct bfi_mhdr_s mh; /* header 4 bytes */ 11311a898a79SVijaya Mohan Guvva bfa_status_t status; /* reply status */ 11321a898a79SVijaya Mohan Guvva wwn_t pwwn; /* switch port wwn. 8 bytes */ 11331a898a79SVijaya Mohan Guvva wwn_t nwwn; /* switch node wwn. 8 bytes */ 11341a898a79SVijaya Mohan Guvva }; 11351a898a79SVijaya Mohan Guvva 11361a898a79SVijaya Mohan Guvva struct bfi_diag_dport_scn_teststart_s { 11371a898a79SVijaya Mohan Guvva wwn_t pwwn; /* switch port wwn. 8 bytes */ 11381a898a79SVijaya Mohan Guvva wwn_t nwwn; /* switch node wwn. 8 bytes */ 11391a898a79SVijaya Mohan Guvva u8 type; /* bfa_diag_dport_test_type_e */ 11402ec331aaSVijaya Mohan Guvva u8 mode; /* bfa_diag_dport_test_opmode */ 11412ec331aaSVijaya Mohan Guvva u8 rsvd[2]; 11421a898a79SVijaya Mohan Guvva u32 numfrm; /* from switch uint in 1M */ 11431a898a79SVijaya Mohan Guvva }; 11441a898a79SVijaya Mohan Guvva 11451a898a79SVijaya Mohan Guvva struct bfi_diag_dport_scn_testcomp_s { 11461a898a79SVijaya Mohan Guvva u8 status; /* bfa_diag_dport_test_status_e */ 11471a898a79SVijaya Mohan Guvva u8 speed; /* bfa_port_speed_t */ 11481a898a79SVijaya Mohan Guvva u16 numbuffer; /* from switch */ 11491a898a79SVijaya Mohan Guvva u8 subtest_status[DPORT_TEST_MAX]; /* 4 bytes */ 11501a898a79SVijaya Mohan Guvva u32 latency; /* from switch */ 11511a898a79SVijaya Mohan Guvva u32 distance; /* from swtich unit in meters */ 11521a898a79SVijaya Mohan Guvva /* Buffers required to saturate the link */ 11531a898a79SVijaya Mohan Guvva u16 frm_sz; /* from switch for buf_reqd */ 11541a898a79SVijaya Mohan Guvva u8 rsvd[2]; 11551a898a79SVijaya Mohan Guvva }; 11561a898a79SVijaya Mohan Guvva 11571a898a79SVijaya Mohan Guvva struct bfi_diag_dport_scn_s { /* max size == RDS_RMESZ */ 11581a898a79SVijaya Mohan Guvva struct bfi_mhdr_s mh; /* header 4 bytes */ 11591a898a79SVijaya Mohan Guvva u8 state; /* new state */ 11601a898a79SVijaya Mohan Guvva u8 rsvd[3]; 11611a898a79SVijaya Mohan Guvva union { 11621a898a79SVijaya Mohan Guvva struct bfi_diag_dport_scn_teststart_s teststart; 11631a898a79SVijaya Mohan Guvva struct bfi_diag_dport_scn_testcomp_s testcomp; 11641a898a79SVijaya Mohan Guvva } info; 11651a898a79SVijaya Mohan Guvva }; 11661a898a79SVijaya Mohan Guvva 11671a898a79SVijaya Mohan Guvva union bfi_diag_dport_msg_u { 11681a898a79SVijaya Mohan Guvva struct bfi_diag_dport_req_s req; 11691a898a79SVijaya Mohan Guvva struct bfi_diag_dport_rsp_s rsp; 11701a898a79SVijaya Mohan Guvva struct bfi_diag_dport_scn_s scn; 11711a898a79SVijaya Mohan Guvva }; 1172e353546eSKrishna Gudipati 1173e353546eSKrishna Gudipati /* 11743350d98dSKrishna Gudipati * PHY module specific 11753350d98dSKrishna Gudipati */ 11763350d98dSKrishna Gudipati enum bfi_phy_h2i_msgs_e { 11773350d98dSKrishna Gudipati BFI_PHY_H2I_QUERY_REQ = 1, 11783350d98dSKrishna Gudipati BFI_PHY_H2I_STATS_REQ = 2, 11793350d98dSKrishna Gudipati BFI_PHY_H2I_WRITE_REQ = 3, 11803350d98dSKrishna Gudipati BFI_PHY_H2I_READ_REQ = 4, 11813350d98dSKrishna Gudipati }; 11823350d98dSKrishna Gudipati 11833350d98dSKrishna Gudipati enum bfi_phy_i2h_msgs_e { 11843350d98dSKrishna Gudipati BFI_PHY_I2H_QUERY_RSP = BFA_I2HM(1), 11853350d98dSKrishna Gudipati BFI_PHY_I2H_STATS_RSP = BFA_I2HM(2), 11863350d98dSKrishna Gudipati BFI_PHY_I2H_WRITE_RSP = BFA_I2HM(3), 11873350d98dSKrishna Gudipati BFI_PHY_I2H_READ_RSP = BFA_I2HM(4), 11883350d98dSKrishna Gudipati }; 11893350d98dSKrishna Gudipati 11903350d98dSKrishna Gudipati /* 11913350d98dSKrishna Gudipati * External PHY query request 11923350d98dSKrishna Gudipati */ 11933350d98dSKrishna Gudipati struct bfi_phy_query_req_s { 11943350d98dSKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 11953350d98dSKrishna Gudipati u8 instance; 11963350d98dSKrishna Gudipati u8 rsv[3]; 11973350d98dSKrishna Gudipati struct bfi_alen_s alen; 11983350d98dSKrishna Gudipati }; 11993350d98dSKrishna Gudipati 12003350d98dSKrishna Gudipati /* 12013350d98dSKrishna Gudipati * External PHY stats request 12023350d98dSKrishna Gudipati */ 12033350d98dSKrishna Gudipati struct bfi_phy_stats_req_s { 12043350d98dSKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 12053350d98dSKrishna Gudipati u8 instance; 12063350d98dSKrishna Gudipati u8 rsv[3]; 12073350d98dSKrishna Gudipati struct bfi_alen_s alen; 12083350d98dSKrishna Gudipati }; 12093350d98dSKrishna Gudipati 12103350d98dSKrishna Gudipati /* 12113350d98dSKrishna Gudipati * External PHY write request 12123350d98dSKrishna Gudipati */ 12133350d98dSKrishna Gudipati struct bfi_phy_write_req_s { 12143350d98dSKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 12153350d98dSKrishna Gudipati u8 instance; 12163350d98dSKrishna Gudipati u8 last; 12173350d98dSKrishna Gudipati u8 rsv[2]; 12183350d98dSKrishna Gudipati u32 offset; 12193350d98dSKrishna Gudipati u32 length; 12203350d98dSKrishna Gudipati struct bfi_alen_s alen; 12213350d98dSKrishna Gudipati }; 12223350d98dSKrishna Gudipati 12233350d98dSKrishna Gudipati /* 12243350d98dSKrishna Gudipati * External PHY read request 12253350d98dSKrishna Gudipati */ 12263350d98dSKrishna Gudipati struct bfi_phy_read_req_s { 12273350d98dSKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 12283350d98dSKrishna Gudipati u8 instance; 12293350d98dSKrishna Gudipati u8 rsv[3]; 12303350d98dSKrishna Gudipati u32 offset; 12313350d98dSKrishna Gudipati u32 length; 12323350d98dSKrishna Gudipati struct bfi_alen_s alen; 12333350d98dSKrishna Gudipati }; 12343350d98dSKrishna Gudipati 12353350d98dSKrishna Gudipati /* 12363350d98dSKrishna Gudipati * External PHY query response 12373350d98dSKrishna Gudipati */ 12383350d98dSKrishna Gudipati struct bfi_phy_query_rsp_s { 12393350d98dSKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 12403350d98dSKrishna Gudipati u32 status; 12413350d98dSKrishna Gudipati }; 12423350d98dSKrishna Gudipati 12433350d98dSKrishna Gudipati /* 12443350d98dSKrishna Gudipati * External PHY stats response 12453350d98dSKrishna Gudipati */ 12463350d98dSKrishna Gudipati struct bfi_phy_stats_rsp_s { 12473350d98dSKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 12483350d98dSKrishna Gudipati u32 status; 12493350d98dSKrishna Gudipati }; 12503350d98dSKrishna Gudipati 12513350d98dSKrishna Gudipati /* 12523350d98dSKrishna Gudipati * External PHY read response 12533350d98dSKrishna Gudipati */ 12543350d98dSKrishna Gudipati struct bfi_phy_read_rsp_s { 12553350d98dSKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 12563350d98dSKrishna Gudipati u32 status; 12573350d98dSKrishna Gudipati u32 length; 12583350d98dSKrishna Gudipati }; 12593350d98dSKrishna Gudipati 12603350d98dSKrishna Gudipati /* 12613350d98dSKrishna Gudipati * External PHY write response 12623350d98dSKrishna Gudipati */ 12633350d98dSKrishna Gudipati struct bfi_phy_write_rsp_s { 12643350d98dSKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 12653350d98dSKrishna Gudipati u32 status; 12663350d98dSKrishna Gudipati u32 length; 12673350d98dSKrishna Gudipati }; 12683350d98dSKrishna Gudipati 1269e6826c96SKrishna Gudipati enum bfi_fru_h2i_msgs { 1270e6826c96SKrishna Gudipati BFI_FRUVPD_H2I_WRITE_REQ = 1, 1271e6826c96SKrishna Gudipati BFI_FRUVPD_H2I_READ_REQ = 2, 1272e6826c96SKrishna Gudipati BFI_TFRU_H2I_WRITE_REQ = 3, 1273e6826c96SKrishna Gudipati BFI_TFRU_H2I_READ_REQ = 4, 1274e6826c96SKrishna Gudipati }; 1275e6826c96SKrishna Gudipati 1276e6826c96SKrishna Gudipati enum bfi_fru_i2h_msgs { 1277e6826c96SKrishna Gudipati BFI_FRUVPD_I2H_WRITE_RSP = BFA_I2HM(1), 1278e6826c96SKrishna Gudipati BFI_FRUVPD_I2H_READ_RSP = BFA_I2HM(2), 1279e6826c96SKrishna Gudipati BFI_TFRU_I2H_WRITE_RSP = BFA_I2HM(3), 1280e6826c96SKrishna Gudipati BFI_TFRU_I2H_READ_RSP = BFA_I2HM(4), 1281e6826c96SKrishna Gudipati }; 1282e6826c96SKrishna Gudipati 1283e6826c96SKrishna Gudipati /* 1284e6826c96SKrishna Gudipati * FRU write request 1285e6826c96SKrishna Gudipati */ 1286e6826c96SKrishna Gudipati struct bfi_fru_write_req_s { 1287e6826c96SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 1288e6826c96SKrishna Gudipati u8 last; 1289079bcbc3SVijaya Mohan Guvva u8 rsv_1[3]; 1290079bcbc3SVijaya Mohan Guvva u8 trfr_cmpl; 1291079bcbc3SVijaya Mohan Guvva u8 rsv_2[3]; 1292e6826c96SKrishna Gudipati u32 offset; 1293e6826c96SKrishna Gudipati u32 length; 1294e6826c96SKrishna Gudipati struct bfi_alen_s alen; 1295e6826c96SKrishna Gudipati }; 1296e6826c96SKrishna Gudipati 1297e6826c96SKrishna Gudipati /* 1298e6826c96SKrishna Gudipati * FRU read request 1299e6826c96SKrishna Gudipati */ 1300e6826c96SKrishna Gudipati struct bfi_fru_read_req_s { 1301e6826c96SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 1302e6826c96SKrishna Gudipati u32 offset; 1303e6826c96SKrishna Gudipati u32 length; 1304e6826c96SKrishna Gudipati struct bfi_alen_s alen; 1305e6826c96SKrishna Gudipati }; 1306e6826c96SKrishna Gudipati 1307e6826c96SKrishna Gudipati /* 1308e6826c96SKrishna Gudipati * FRU response 1309e6826c96SKrishna Gudipati */ 1310e6826c96SKrishna Gudipati struct bfi_fru_rsp_s { 1311e6826c96SKrishna Gudipati struct bfi_mhdr_s mh; /* Common msg header */ 1312e6826c96SKrishna Gudipati u32 status; 1313e6826c96SKrishna Gudipati u32 length; 1314e6826c96SKrishna Gudipati }; 1315a36c61f9SKrishna Gudipati #pragma pack() 1316a36c61f9SKrishna Gudipati 1317a36c61f9SKrishna Gudipati #endif /* __BFI_H__ */ 1318