Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux/fpc-iii.git] / drivers / net / ethernet / brocade / bna / bfi_cna.h
blobfad651101c48beb6b0472bb1141259f59b959fbc
1 /*
2 * Linux network driver for QLogic BR-series Converged Network Adapter.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License (GPL) Version 2 as
6 * published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
14 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
15 * Copyright (c) 2014-2015 QLogic Corporation
16 * All rights reserved
17 * www.qlogic.com
19 #ifndef __BFI_CNA_H__
20 #define __BFI_CNA_H__
22 #include "bfi.h"
23 #include "bfa_defs_cna.h"
25 enum bfi_port_h2i {
26 BFI_PORT_H2I_ENABLE_REQ = (1),
27 BFI_PORT_H2I_DISABLE_REQ = (2),
28 BFI_PORT_H2I_GET_STATS_REQ = (3),
29 BFI_PORT_H2I_CLEAR_STATS_REQ = (4),
32 enum bfi_port_i2h {
33 BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1),
34 BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2),
35 BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3),
36 BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
39 /* Generic REQ type */
40 struct bfi_port_generic_req {
41 struct bfi_mhdr mh; /*!< msg header */
42 u32 msgtag; /*!< msgtag for reply */
43 u32 rsvd;
44 } __packed;
46 /* Generic RSP type */
47 struct bfi_port_generic_rsp {
48 struct bfi_mhdr mh; /*!< common msg header */
49 u8 status; /*!< port enable status */
50 u8 rsvd[3];
51 u32 msgtag; /*!< msgtag for reply */
52 } __packed;
54 /* BFI_PORT_H2I_GET_STATS_REQ */
55 struct bfi_port_get_stats_req {
56 struct bfi_mhdr mh; /*!< common msg header */
57 union bfi_addr_u dma_addr;
58 } __packed;
60 union bfi_port_h2i_msg_u {
61 struct bfi_mhdr mh;
62 struct bfi_port_generic_req enable_req;
63 struct bfi_port_generic_req disable_req;
64 struct bfi_port_get_stats_req getstats_req;
65 struct bfi_port_generic_req clearstats_req;
66 } __packed;
68 union bfi_port_i2h_msg_u {
69 struct bfi_mhdr mh;
70 struct bfi_port_generic_rsp enable_rsp;
71 struct bfi_port_generic_rsp disable_rsp;
72 struct bfi_port_generic_rsp getstats_rsp;
73 struct bfi_port_generic_rsp clearstats_rsp;
74 } __packed;
76 /* @brief Mailbox commands from host to (DCBX/LLDP) firmware */
77 enum bfi_cee_h2i_msgs {
78 BFI_CEE_H2I_GET_CFG_REQ = 1,
79 BFI_CEE_H2I_RESET_STATS = 2,
80 BFI_CEE_H2I_GET_STATS_REQ = 3,
83 /* @brief Mailbox reply and AEN messages from DCBX/LLDP firmware to host */
84 enum bfi_cee_i2h_msgs {
85 BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1),
86 BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2),
87 BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3),
90 /* Data structures */
93 * @brief H2I command structure for resetting the stats.
94 * BFI_CEE_H2I_RESET_STATS
96 struct bfi_lldp_reset_stats {
97 struct bfi_mhdr mh;
98 } __packed;
101 * @brief H2I command structure for resetting the stats.
102 * BFI_CEE_H2I_RESET_STATS
104 struct bfi_cee_reset_stats {
105 struct bfi_mhdr mh;
106 } __packed;
109 * @brief get configuration command from host
110 * BFI_CEE_H2I_GET_CFG_REQ
112 struct bfi_cee_get_req {
113 struct bfi_mhdr mh;
114 union bfi_addr_u dma_addr;
115 } __packed;
118 * @brief reply message from firmware
119 * BFI_CEE_I2H_GET_CFG_RSP
121 struct bfi_cee_get_rsp {
122 struct bfi_mhdr mh;
123 u8 cmd_status;
124 u8 rsvd[3];
125 } __packed;
128 * @brief get configuration command from host
129 * BFI_CEE_H2I_GET_STATS_REQ
131 struct bfi_cee_stats_req {
132 struct bfi_mhdr mh;
133 union bfi_addr_u dma_addr;
134 } __packed;
137 * @brief reply message from firmware
138 * BFI_CEE_I2H_GET_STATS_RSP
140 struct bfi_cee_stats_rsp {
141 struct bfi_mhdr mh;
142 u8 cmd_status;
143 u8 rsvd[3];
144 } __packed;
146 /* @brief mailbox command structures from host to firmware */
147 union bfi_cee_h2i_msg_u {
148 struct bfi_mhdr mh;
149 struct bfi_cee_get_req get_req;
150 struct bfi_cee_stats_req stats_req;
151 } __packed;
153 /* @brief mailbox message structures from firmware to host */
154 union bfi_cee_i2h_msg_u {
155 struct bfi_mhdr mh;
156 struct bfi_cee_get_rsp get_rsp;
157 struct bfi_cee_stats_rsp stats_rsp;
158 } __packed;
160 #endif /* __BFI_CNA_H__ */