xref: /linux/drivers/net/ethernet/brocade/bna/bfi_cna.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
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
10  */
11 #ifndef __BFI_CNA_H__
12 #define __BFI_CNA_H__
13 
14 #include "bfi.h"
15 #include "bfa_defs_cna.h"
16 
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),
22 };
23 
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),
29 };
30 
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;
37 
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;
45 
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;
51 
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;
59 
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;
67 
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,
73 };
74 
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),
80 };
81 
82 /* Data structures */
83 
84 /*
85  * @brief H2I command structure for resetting the stats.
86  * BFI_CEE_H2I_RESET_STATS
87  */
88 struct bfi_lldp_reset_stats {
89 	struct bfi_mhdr mh;
90 } __packed;
91 
92 /*
93  * @brief H2I command structure for resetting the stats.
94  * BFI_CEE_H2I_RESET_STATS
95  */
96 struct bfi_cee_reset_stats {
97 	struct bfi_mhdr mh;
98 } __packed;
99 
100 /*
101  * @brief  get configuration  command from host
102  * BFI_CEE_H2I_GET_CFG_REQ
103  */
104 struct bfi_cee_get_req {
105 	struct bfi_mhdr mh;
106 	union bfi_addr_u   dma_addr;
107 } __packed;
108 
109 /*
110  * @brief reply message from firmware
111  * BFI_CEE_I2H_GET_CFG_RSP
112  */
113 struct bfi_cee_get_rsp {
114 	struct bfi_mhdr mh;
115 	u8			cmd_status;
116 	u8			rsvd[3];
117 } __packed;
118 
119 /*
120  * @brief  get configuration  command from host
121  * BFI_CEE_H2I_GET_STATS_REQ
122  */
123 struct bfi_cee_stats_req {
124 	struct bfi_mhdr mh;
125 	union bfi_addr_u   dma_addr;
126 } __packed;
127 
128 /*
129  * @brief reply message from firmware
130  * BFI_CEE_I2H_GET_STATS_RSP
131  */
132 struct bfi_cee_stats_rsp {
133 	struct bfi_mhdr mh;
134 	u8			cmd_status;
135 	u8			rsvd[3];
136 } __packed;
137 
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;
144 
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;
151 
152 #endif /* __BFI_CNA_H__ */
153