spi-topcliff-pch: add recovery processing in case wait-event timeout
[zen-stable.git] / drivers / net / ethernet / brocade / bna / bfi_cna.h
blob4eecabea397b74b6add61ba68064c18c91003e33
1 /*
2 * Linux network driver for Brocade 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-2010 Brocade Communications Systems, Inc.
15 * All rights reserved
16 * www.brocade.com
18 #ifndef __BFI_CNA_H__
19 #define __BFI_CNA_H__
21 #include "bfi.h"
22 #include "bfa_defs_cna.h"
24 #pragma pack(1)
26 enum bfi_port_h2i {
27 BFI_PORT_H2I_ENABLE_REQ = (1),
28 BFI_PORT_H2I_DISABLE_REQ = (2),
29 BFI_PORT_H2I_GET_STATS_REQ = (3),
30 BFI_PORT_H2I_CLEAR_STATS_REQ = (4),
33 enum bfi_port_i2h {
34 BFI_PORT_I2H_ENABLE_RSP = BFA_I2HM(1),
35 BFI_PORT_I2H_DISABLE_RSP = BFA_I2HM(2),
36 BFI_PORT_I2H_GET_STATS_RSP = BFA_I2HM(3),
37 BFI_PORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
40 /**
41 * Generic REQ type
43 struct bfi_port_generic_req {
44 struct bfi_mhdr mh; /*!< msg header */
45 u32 msgtag; /*!< msgtag for reply */
46 u32 rsvd;
49 /**
50 * Generic RSP type
52 struct bfi_port_generic_rsp {
53 struct bfi_mhdr mh; /*!< common msg header */
54 u8 status; /*!< port enable status */
55 u8 rsvd[3];
56 u32 msgtag; /*!< msgtag for reply */
59 /**
60 * @todo
61 * BFI_PORT_H2I_ENABLE_REQ
64 /**
65 * @todo
66 * BFI_PORT_I2H_ENABLE_RSP
69 /**
70 * BFI_PORT_H2I_DISABLE_REQ
73 /**
74 * BFI_PORT_I2H_DISABLE_RSP
77 /**
78 * BFI_PORT_H2I_GET_STATS_REQ
80 struct bfi_port_get_stats_req {
81 struct bfi_mhdr mh; /*!< common msg header */
82 union bfi_addr_u dma_addr;
85 /**
86 * BFI_PORT_I2H_GET_STATS_RSP
89 /**
90 * BFI_PORT_H2I_CLEAR_STATS_REQ
93 /**
94 * BFI_PORT_I2H_CLEAR_STATS_RSP
97 union bfi_port_h2i_msg_u {
98 struct bfi_mhdr mh;
99 struct bfi_port_generic_req enable_req;
100 struct bfi_port_generic_req disable_req;
101 struct bfi_port_get_stats_req getstats_req;
102 struct bfi_port_generic_req clearstats_req;
105 union bfi_port_i2h_msg_u {
106 struct bfi_mhdr mh;
107 struct bfi_port_generic_rsp enable_rsp;
108 struct bfi_port_generic_rsp disable_rsp;
109 struct bfi_port_generic_rsp getstats_rsp;
110 struct bfi_port_generic_rsp clearstats_rsp;
113 /* @brief Mailbox commands from host to (DCBX/LLDP) firmware */
114 enum bfi_cee_h2i_msgs {
115 BFI_CEE_H2I_GET_CFG_REQ = 1,
116 BFI_CEE_H2I_RESET_STATS = 2,
117 BFI_CEE_H2I_GET_STATS_REQ = 3,
120 /* @brief Mailbox reply and AEN messages from DCBX/LLDP firmware to host */
121 enum bfi_cee_i2h_msgs {
122 BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1),
123 BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2),
124 BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3),
127 /* Data structures */
130 * @brief H2I command structure for resetting the stats.
131 * BFI_CEE_H2I_RESET_STATS
133 struct bfi_lldp_reset_stats {
134 struct bfi_mhdr mh;
138 * @brief H2I command structure for resetting the stats.
139 * BFI_CEE_H2I_RESET_STATS
141 struct bfi_cee_reset_stats {
142 struct bfi_mhdr mh;
146 * @brief get configuration command from host
147 * BFI_CEE_H2I_GET_CFG_REQ
149 struct bfi_cee_get_req {
150 struct bfi_mhdr mh;
151 union bfi_addr_u dma_addr;
155 * @brief reply message from firmware
156 * BFI_CEE_I2H_GET_CFG_RSP
158 struct bfi_cee_get_rsp {
159 struct bfi_mhdr mh;
160 u8 cmd_status;
161 u8 rsvd[3];
165 * @brief get configuration command from host
166 * BFI_CEE_H2I_GET_STATS_REQ
168 struct bfi_cee_stats_req {
169 struct bfi_mhdr mh;
170 union bfi_addr_u dma_addr;
174 * @brief reply message from firmware
175 * BFI_CEE_I2H_GET_STATS_RSP
177 struct bfi_cee_stats_rsp {
178 struct bfi_mhdr mh;
179 u8 cmd_status;
180 u8 rsvd[3];
183 /* @brief mailbox command structures from host to firmware */
184 union bfi_cee_h2i_msg_u {
185 struct bfi_mhdr mh;
186 struct bfi_cee_get_req get_req;
187 struct bfi_cee_stats_req stats_req;
190 /* @brief mailbox message structures from firmware to host */
191 union bfi_cee_i2h_msg_u {
192 struct bfi_mhdr mh;
193 struct bfi_cee_get_rsp get_rsp;
194 struct bfi_cee_stats_rsp stats_rsp;
197 #pragma pack()
199 #endif /* __BFI_CNA_H__ */