Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Linux network driver for QLogic BR-series Converged Network Adapter.
0004  */
0005 /*
0006  * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
0007  * Copyright (c) 2014-2015 QLogic Corporation
0008  * All rights reserved
0009  * www.qlogic.com
0010  */
0011 #ifndef __BFI_CNA_H__
0012 #define __BFI_CNA_H__
0013 
0014 #include "bfi.h"
0015 #include "bfa_defs_cna.h"
0016 
0017 enum bfi_port_h2i {
0018     BFI_PORT_H2I_ENABLE_REQ     = (1),
0019     BFI_PORT_H2I_DISABLE_REQ    = (2),
0020     BFI_PORT_H2I_GET_STATS_REQ  = (3),
0021     BFI_PORT_H2I_CLEAR_STATS_REQ    = (4),
0022 };
0023 
0024 enum bfi_port_i2h {
0025     BFI_PORT_I2H_ENABLE_RSP     = BFA_I2HM(1),
0026     BFI_PORT_I2H_DISABLE_RSP    = BFA_I2HM(2),
0027     BFI_PORT_I2H_GET_STATS_RSP  = BFA_I2HM(3),
0028     BFI_PORT_I2H_CLEAR_STATS_RSP    = BFA_I2HM(4),
0029 };
0030 
0031 /* Generic REQ type */
0032 struct bfi_port_generic_req {
0033     struct bfi_mhdr mh;     /*!< msg header             */
0034     u32 msgtag;     /*!< msgtag for reply           */
0035     u32 rsvd;
0036 } __packed;
0037 
0038 /* Generic RSP type */
0039 struct bfi_port_generic_rsp {
0040     struct bfi_mhdr mh;     /*!< common msg header          */
0041     u8      status;     /*!< port enable status         */
0042     u8      rsvd[3];
0043     u32 msgtag;     /*!< msgtag for reply           */
0044 } __packed;
0045 
0046 /* BFI_PORT_H2I_GET_STATS_REQ */
0047 struct bfi_port_get_stats_req {
0048     struct bfi_mhdr mh;     /*!< common msg header          */
0049     union bfi_addr_u   dma_addr;
0050 } __packed;
0051 
0052 union bfi_port_h2i_msg_u {
0053     struct bfi_mhdr mh;
0054     struct bfi_port_generic_req enable_req;
0055     struct bfi_port_generic_req disable_req;
0056     struct bfi_port_get_stats_req getstats_req;
0057     struct bfi_port_generic_req clearstats_req;
0058 } __packed;
0059 
0060 union bfi_port_i2h_msg_u {
0061     struct bfi_mhdr mh;
0062     struct bfi_port_generic_rsp enable_rsp;
0063     struct bfi_port_generic_rsp disable_rsp;
0064     struct bfi_port_generic_rsp getstats_rsp;
0065     struct bfi_port_generic_rsp clearstats_rsp;
0066 } __packed;
0067 
0068 /* @brief Mailbox commands from host to (DCBX/LLDP) firmware */
0069 enum bfi_cee_h2i_msgs {
0070     BFI_CEE_H2I_GET_CFG_REQ = 1,
0071     BFI_CEE_H2I_RESET_STATS = 2,
0072     BFI_CEE_H2I_GET_STATS_REQ = 3,
0073 };
0074 
0075 /* @brief Mailbox reply and AEN messages from DCBX/LLDP firmware to host */
0076 enum bfi_cee_i2h_msgs {
0077     BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1),
0078     BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2),
0079     BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3),
0080 };
0081 
0082 /* Data structures */
0083 
0084 /*
0085  * @brief H2I command structure for resetting the stats.
0086  * BFI_CEE_H2I_RESET_STATS
0087  */
0088 struct bfi_lldp_reset_stats {
0089     struct bfi_mhdr mh;
0090 } __packed;
0091 
0092 /*
0093  * @brief H2I command structure for resetting the stats.
0094  * BFI_CEE_H2I_RESET_STATS
0095  */
0096 struct bfi_cee_reset_stats {
0097     struct bfi_mhdr mh;
0098 } __packed;
0099 
0100 /*
0101  * @brief  get configuration  command from host
0102  * BFI_CEE_H2I_GET_CFG_REQ
0103  */
0104 struct bfi_cee_get_req {
0105     struct bfi_mhdr mh;
0106     union bfi_addr_u   dma_addr;
0107 } __packed;
0108 
0109 /*
0110  * @brief reply message from firmware
0111  * BFI_CEE_I2H_GET_CFG_RSP
0112  */
0113 struct bfi_cee_get_rsp {
0114     struct bfi_mhdr mh;
0115     u8          cmd_status;
0116     u8          rsvd[3];
0117 } __packed;
0118 
0119 /*
0120  * @brief  get configuration  command from host
0121  * BFI_CEE_H2I_GET_STATS_REQ
0122  */
0123 struct bfi_cee_stats_req {
0124     struct bfi_mhdr mh;
0125     union bfi_addr_u   dma_addr;
0126 } __packed;
0127 
0128 /*
0129  * @brief reply message from firmware
0130  * BFI_CEE_I2H_GET_STATS_RSP
0131  */
0132 struct bfi_cee_stats_rsp {
0133     struct bfi_mhdr mh;
0134     u8          cmd_status;
0135     u8          rsvd[3];
0136 } __packed;
0137 
0138 /* @brief mailbox command structures from host to firmware */
0139 union bfi_cee_h2i_msg_u {
0140     struct bfi_mhdr mh;
0141     struct bfi_cee_get_req get_req;
0142     struct bfi_cee_stats_req stats_req;
0143 } __packed;
0144 
0145 /* @brief mailbox message structures from firmware to host  */
0146 union bfi_cee_i2h_msg_u {
0147     struct bfi_mhdr mh;
0148     struct bfi_cee_get_rsp get_rsp;
0149     struct bfi_cee_stats_rsp stats_rsp;
0150 } __packed;
0151 
0152 #endif /* __BFI_CNA_H__ */