blob: 6704a4392973b2721adcc771c004de46826c12c5 [file] [log] [blame]
Rasesh Mody8b230ed2010-08-23 20:24:12 -07001/*
2 * Linux network driver for Brocade Converged Network Adapter.
3 *
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
7 *
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.
12 */
13/*
14 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
15 * All rights reserved
16 * www.brocade.com
17 */
18#ifndef __BFI_CNA_H__
19#define __BFI_CNA_H__
20
21#include "bfi.h"
22#include "bfa_defs_cna.h"
23
24#pragma pack(1)
25
26enum 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),
31};
32
33enum 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),
38};
39
Ben Hutchings1aa8b472012-07-10 10:56:59 +000040/* Generic REQ type */
Rasesh Mody8b230ed2010-08-23 20:24:12 -070041struct bfi_port_generic_req {
42 struct bfi_mhdr mh; /*!< msg header */
43 u32 msgtag; /*!< msgtag for reply */
44 u32 rsvd;
45};
46
Ben Hutchings1aa8b472012-07-10 10:56:59 +000047/* Generic RSP type */
Rasesh Mody8b230ed2010-08-23 20:24:12 -070048struct bfi_port_generic_rsp {
49 struct bfi_mhdr mh; /*!< common msg header */
50 u8 status; /*!< port enable status */
51 u8 rsvd[3];
52 u32 msgtag; /*!< msgtag for reply */
53};
54
Ben Hutchings1aa8b472012-07-10 10:56:59 +000055/* BFI_PORT_H2I_GET_STATS_REQ */
Rasesh Mody8b230ed2010-08-23 20:24:12 -070056struct bfi_port_get_stats_req {
57 struct bfi_mhdr mh; /*!< common msg header */
58 union bfi_addr_u dma_addr;
59};
60
Rasesh Mody8b230ed2010-08-23 20:24:12 -070061union bfi_port_h2i_msg_u {
62 struct bfi_mhdr mh;
63 struct bfi_port_generic_req enable_req;
64 struct bfi_port_generic_req disable_req;
65 struct bfi_port_get_stats_req getstats_req;
66 struct bfi_port_generic_req clearstats_req;
67};
68
69union bfi_port_i2h_msg_u {
70 struct bfi_mhdr mh;
71 struct bfi_port_generic_rsp enable_rsp;
72 struct bfi_port_generic_rsp disable_rsp;
73 struct bfi_port_generic_rsp getstats_rsp;
74 struct bfi_port_generic_rsp clearstats_rsp;
75};
76
77/* @brief Mailbox commands from host to (DCBX/LLDP) firmware */
78enum bfi_cee_h2i_msgs {
79 BFI_CEE_H2I_GET_CFG_REQ = 1,
80 BFI_CEE_H2I_RESET_STATS = 2,
81 BFI_CEE_H2I_GET_STATS_REQ = 3,
82};
83
84/* @brief Mailbox reply and AEN messages from DCBX/LLDP firmware to host */
85enum bfi_cee_i2h_msgs {
86 BFI_CEE_I2H_GET_CFG_RSP = BFA_I2HM(1),
87 BFI_CEE_I2H_RESET_STATS_RSP = BFA_I2HM(2),
88 BFI_CEE_I2H_GET_STATS_RSP = BFA_I2HM(3),
89};
90
91/* Data structures */
92
93/*
94 * @brief H2I command structure for resetting the stats.
95 * BFI_CEE_H2I_RESET_STATS
96 */
97struct bfi_lldp_reset_stats {
98 struct bfi_mhdr mh;
99};
100
101/*
102 * @brief H2I command structure for resetting the stats.
103 * BFI_CEE_H2I_RESET_STATS
104 */
105struct bfi_cee_reset_stats {
106 struct bfi_mhdr mh;
107};
108
109/*
110 * @brief get configuration command from host
111 * BFI_CEE_H2I_GET_CFG_REQ
112 */
113struct bfi_cee_get_req {
114 struct bfi_mhdr mh;
115 union bfi_addr_u dma_addr;
116};
117
118/*
119 * @brief reply message from firmware
120 * BFI_CEE_I2H_GET_CFG_RSP
121 */
122struct bfi_cee_get_rsp {
123 struct bfi_mhdr mh;
124 u8 cmd_status;
125 u8 rsvd[3];
126};
127
128/*
129 * @brief get configuration command from host
130 * BFI_CEE_H2I_GET_STATS_REQ
131 */
132struct bfi_cee_stats_req {
133 struct bfi_mhdr mh;
134 union bfi_addr_u dma_addr;
135};
136
137/*
138 * @brief reply message from firmware
139 * BFI_CEE_I2H_GET_STATS_RSP
140 */
141struct bfi_cee_stats_rsp {
142 struct bfi_mhdr mh;
143 u8 cmd_status;
144 u8 rsvd[3];
145};
146
147/* @brief mailbox command structures from host to firmware */
148union bfi_cee_h2i_msg_u {
149 struct bfi_mhdr mh;
150 struct bfi_cee_get_req get_req;
151 struct bfi_cee_stats_req stats_req;
152};
153
154/* @brief mailbox message structures from firmware to host */
155union bfi_cee_i2h_msg_u {
156 struct bfi_mhdr mh;
157 struct bfi_cee_get_rsp get_rsp;
158 struct bfi_cee_stats_rsp stats_rsp;
159};
160
161#pragma pack()
162
163#endif /* __BFI_CNA_H__ */