1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __BFA_DEFS_PORT_H__
19#define __BFA_DEFS_PORT_H__
20
21#include <bfa_os_inc.h>
22#include <protocol/types.h>
23#include <defs/bfa_defs_pport.h>
24#include <defs/bfa_defs_ioc.h>
25
26#define BFA_FCS_FABRIC_IPADDR_SZ 16
27
28
29
30
31#define BFA_SYMNAME_MAXLEN 128
32struct bfa_port_symname_s {
33 char symname[BFA_SYMNAME_MAXLEN];
34};
35
36
37
38
39
40
41
42enum bfa_port_role {
43 BFA_PORT_ROLE_FCP_IM = 0x01,
44 BFA_PORT_ROLE_FCP_TM = 0x02,
45 BFA_PORT_ROLE_FCP_IPFC = 0x04,
46 BFA_PORT_ROLE_FCP_MAX = BFA_PORT_ROLE_FCP_IPFC | BFA_PORT_ROLE_FCP_IM
47};
48
49
50
51
52struct bfa_port_cfg_s {
53 wwn_t pwwn;
54 wwn_t nwwn;
55 struct bfa_port_symname_s sym_name;
56 enum bfa_port_role roles;
57 u32 rsvd;
58 u8 tag[16];
59};
60
61
62
63
64enum bfa_port_state {
65 BFA_PORT_UNINIT = 0,
66 BFA_PORT_FDISC = 1,
67 BFA_PORT_ONLINE = 2,
68 BFA_PORT_OFFLINE = 3,
69};
70
71
72
73
74enum bfa_port_type {
75 BFA_PORT_TYPE_PHYSICAL = 0,
76 BFA_PORT_TYPE_VIRTUAL,
77};
78
79
80
81
82enum bfa_port_offline_reason {
83 BFA_PORT_OFFLINE_UNKNOWN = 0,
84 BFA_PORT_OFFLINE_LINKDOWN,
85 BFA_PORT_OFFLINE_FAB_UNSUPPORTED,
86
87 BFA_PORT_OFFLINE_FAB_NORESOURCES,
88 BFA_PORT_OFFLINE_FAB_LOGOUT,
89};
90
91
92
93
94struct bfa_port_info_s {
95 u8 port_type;
96
97 u8 port_state;
98 u8 offline_reason;
99
100 wwn_t port_wwn;
101 wwn_t node_wwn;
102
103
104
105
106 u32 max_vports_supp;
107 u32 num_vports_inuse;
108 u32 max_rports_supp;
109 u32 num_rports_inuse;
110
111};
112
113
114
115
116struct bfa_port_stats_s {
117 u32 ns_plogi_sent;
118 u32 ns_plogi_rsp_err;
119 u32 ns_plogi_acc_err;
120 u32 ns_plogi_accepts;
121 u32 ns_rejects;
122 u32 ns_plogi_unknown_rsp;
123 u32 ns_plogi_alloc_wait;
124
125 u32 ns_retries;
126 u32 ns_timeouts;
127
128 u32 ns_rspnid_sent;
129 u32 ns_rspnid_accepts;
130 u32 ns_rspnid_rsp_err;
131 u32 ns_rspnid_rejects;
132 u32 ns_rspnid_alloc_wait;
133
134 u32 ns_rftid_sent;
135 u32 ns_rftid_accepts;
136 u32 ns_rftid_rsp_err;
137 u32 ns_rftid_rejects;
138 u32 ns_rftid_alloc_wait;
139
140 u32 ns_rffid_sent;
141 u32 ns_rffid_accepts;
142 u32 ns_rffid_rsp_err;
143 u32 ns_rffid_rejects;
144 u32 ns_rffid_alloc_wait;
145
146 u32 ns_gidft_sent;
147 u32 ns_gidft_accepts;
148 u32 ns_gidft_rsp_err;
149 u32 ns_gidft_rejects;
150 u32 ns_gidft_unknown_rsp;
151 u32 ns_gidft_alloc_wait;
152
153
154
155
156 u32 ms_retries;
157 u32 ms_timeouts;
158 u32 ms_plogi_sent;
159 u32 ms_plogi_rsp_err;
160 u32 ms_plogi_acc_err;
161 u32 ms_plogi_accepts;
162 u32 ms_rejects;
163 u32 ms_plogi_unknown_rsp;
164 u32 ms_plogi_alloc_wait;
165
166 u32 num_rscn;
167 u32 num_portid_rscn;
168
169
170 u32 uf_recvs;
171 u32 uf_recv_drops;
172
173 u32 rsvd;
174};
175
176
177
178
179struct bfa_port_attr_s {
180 enum bfa_port_state state;
181 u32 pid;
182 struct bfa_port_cfg_s port_cfg;
183 enum bfa_pport_type port_type;
184 u32 loopback;
185 wwn_t fabric_name;
186 u8 fabric_ip_addr[BFA_FCS_FABRIC_IPADDR_SZ];
187
188};
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208enum bfa_port_aen_event {
209 BFA_PORT_AEN_ONLINE = 1,
210 BFA_PORT_AEN_OFFLINE = 2,
211 BFA_PORT_AEN_RLIR = 3,
212 BFA_PORT_AEN_SFP_INSERT = 4,
213 BFA_PORT_AEN_SFP_REMOVE = 5,
214 BFA_PORT_AEN_SFP_POM = 6,
215 BFA_PORT_AEN_ENABLE = 7,
216 BFA_PORT_AEN_DISABLE = 8,
217 BFA_PORT_AEN_AUTH_ON = 9,
218 BFA_PORT_AEN_AUTH_OFF = 10,
219 BFA_PORT_AEN_DISCONNECT = 11,
220 BFA_PORT_AEN_QOS_NEG = 12,
221 BFA_PORT_AEN_FABRIC_NAME_CHANGE = 13,
222
223 BFA_PORT_AEN_SFP_ACCESS_ERROR = 14,
224 BFA_PORT_AEN_SFP_UNSUPPORT = 15,
225};
226
227enum bfa_port_aen_sfp_pom {
228 BFA_PORT_AEN_SFP_POM_GREEN = 1,
229 BFA_PORT_AEN_SFP_POM_AMBER = 2,
230 BFA_PORT_AEN_SFP_POM_RED = 3,
231 BFA_PORT_AEN_SFP_POM_MAX = BFA_PORT_AEN_SFP_POM_RED
232};
233
234struct bfa_port_aen_data_s {
235 enum bfa_ioc_type_e ioc_type;
236 wwn_t pwwn;
237 wwn_t fwwn;
238 mac_t mac;
239
240 int phy_port_num;
241 enum bfa_port_aen_sfp_pom level;
242
243};
244
245#endif
246