WIP FPC-III support
[linux/fpc-iii.git] / drivers / net / ethernet / brocade / bna / bfi_cna.h
blobfb78bfd0bcf27dc81a833c1d9e5d570a55a9426a
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Linux network driver for QLogic BR-series Converged Network Adapter.
4 */
5 /*
6 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
7 * Copyright (c) 2014-2015 QLogic Corporation
8 * All rights reserved
9 * www.qlogic.com
11 #ifndef __BFI_CNA_H__
12 #define __BFI_CNA_H__
14 #include "bfi.h"
15 #include "bfa_defs_cna.h"
17 enum bfi_port_h2i {
18 BFI_PORT_H2I_ENABLE_REQ = (1),
19 BFI_PORT_H2I_DISABLE_REQ = (2),
20 BFI_PORT_H2I_GET_STATS_REQ = (3),
21 BFI_PORT_H2I_CLEAR_STATS_REQ = (4),
24 enum bfi_port_i2h {
25 BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1),
26 BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2),
27 BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3),
28 BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
31 /* Generic REQ type */
32 struct bfi_port_generic_req {
33 struct bfi_mhdr mh; /*!< msg header */
34 u32 msgtag; /*!< msgtag for reply */
35 u32 rsvd;
36 } __packed;
38 /* Generic RSP type */
39 struct bfi_port_generic_rsp {
40 struct bfi_mhdr mh; /*!< common msg header */
41 u8 status; /*!< port enable status */
42 u8 rsvd[3];
43 u32 msgtag; /*!< msgtag for reply */
44 } __packed;
46 /* BFI_PORT_H2I_GET_STATS_REQ */
47 struct bfi_port_get_stats_req {
48 struct bfi_mhdr mh; /*!< common msg header */
49 union bfi_addr_u dma_addr;
50 } __packed;
52 union bfi_port_h2i_msg_u {
53 struct bfi_mhdr mh;
54 struct bfi_port_generic_req enable_req;
55 struct bfi_port_generic_req disable_req;
56 struct bfi_port_get_stats_req getstats_req;
57 struct bfi_port_generic_req clearstats_req;
58 } __packed;
60 union bfi_port_i2h_msg_u {
61 struct bfi_mhdr mh;
62 struct bfi_port_generic_rsp enable_rsp;
63 struct bfi_port_generic_rsp disable_rsp;
64 struct bfi_port_generic_rsp getstats_rsp;
65 struct bfi_port_generic_rsp clearstats_rsp;
66 } __packed;
68 /* @brief Mailbox commands from host to (DCBX/LLDP) firmware */
69 enum bfi_cee_h2i_msgs {
70 BFI_CEE_H2I_GET_CFG_REQ = 1,
71 BFI_CEE_H2I_RESET_STATS = 2,
72 BFI_CEE_H2I_GET_STATS_REQ = 3,
75 /* @brief Mailbox reply and AEN messages from DCBX/LLDP firmware to host */
76 enum bfi_cee_i2h_msgs {
77 BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1),
78 BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2),
79 BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3),
82 /* Data structures */
85 * @brief H2I command structure for resetting the stats.
86 * BFI_CEE_H2I_RESET_STATS
88 struct bfi_lldp_reset_stats {
89 struct bfi_mhdr mh;
90 } __packed;
93 * @brief H2I command structure for resetting the stats.
94 * BFI_CEE_H2I_RESET_STATS
96 struct bfi_cee_reset_stats {
97 struct bfi_mhdr mh;
98 } __packed;
101 * @brief get configuration command from host
102 * BFI_CEE_H2I_GET_CFG_REQ
104 struct bfi_cee_get_req {
105 struct bfi_mhdr mh;
106 union bfi_addr_u dma_addr;
107 } __packed;
110 * @brief reply message from firmware
111 * BFI_CEE_I2H_GET_CFG_RSP
113 struct bfi_cee_get_rsp {
114 struct bfi_mhdr mh;
115 u8 cmd_status;
116 u8 rsvd[3];
117 } __packed;
120 * @brief get configuration command from host
121 * BFI_CEE_H2I_GET_STATS_REQ
123 struct bfi_cee_stats_req {
124 struct bfi_mhdr mh;
125 union bfi_addr_u dma_addr;
126 } __packed;
129 * @brief reply message from firmware
130 * BFI_CEE_I2H_GET_STATS_RSP
132 struct bfi_cee_stats_rsp {
133 struct bfi_mhdr mh;
134 u8 cmd_status;
135 u8 rsvd[3];
136 } __packed;
138 /* @brief mailbox command structures from host to firmware */
139 union bfi_cee_h2i_msg_u {
140 struct bfi_mhdr mh;
141 struct bfi_cee_get_req get_req;
142 struct bfi_cee_stats_req stats_req;
143 } __packed;
145 /* @brief mailbox message structures from firmware to host */
146 union bfi_cee_i2h_msg_u {
147 struct bfi_mhdr mh;
148 struct bfi_cee_get_rsp get_rsp;
149 struct bfi_cee_stats_rsp stats_rsp;
150 } __packed;
152 #endif /* __BFI_CNA_H__ */