xref: /openbmc/linux/drivers/scsi/bfa/bfa_defs_fcs.h (revision a36c61f9025b8924f99f54d518763bee7aa84085)
1*a36c61f9SKrishna Gudipati /*
2*a36c61f9SKrishna Gudipati  * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
3*a36c61f9SKrishna Gudipati  * All rights reserved
4*a36c61f9SKrishna Gudipati  * www.brocade.com
5*a36c61f9SKrishna Gudipati  *
6*a36c61f9SKrishna Gudipati  * Linux driver for Brocade Fibre Channel Host Bus Adapter.
7*a36c61f9SKrishna Gudipati  *
8*a36c61f9SKrishna Gudipati  * This program is free software; you can redistribute it and/or modify it
9*a36c61f9SKrishna Gudipati  * under the terms of the GNU General Public License (GPL) Version 2 as
10*a36c61f9SKrishna Gudipati  * published by the Free Software Foundation
11*a36c61f9SKrishna Gudipati  *
12*a36c61f9SKrishna Gudipati  * This program is distributed in the hope that it will be useful, but
13*a36c61f9SKrishna Gudipati  * WITHOUT ANY WARRANTY; without even the implied warranty of
14*a36c61f9SKrishna Gudipati  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15*a36c61f9SKrishna Gudipati  * General Public License for more details.
16*a36c61f9SKrishna Gudipati  */
17*a36c61f9SKrishna Gudipati 
18*a36c61f9SKrishna Gudipati #ifndef __BFA_DEFS_FCS_H__
19*a36c61f9SKrishna Gudipati #define __BFA_DEFS_FCS_H__
20*a36c61f9SKrishna Gudipati 
21*a36c61f9SKrishna Gudipati #include "bfa_fc.h"
22*a36c61f9SKrishna Gudipati #include "bfa_defs_svc.h"
23*a36c61f9SKrishna Gudipati 
24*a36c61f9SKrishna Gudipati /**
25*a36c61f9SKrishna Gudipati  * VF states
26*a36c61f9SKrishna Gudipati  */
27*a36c61f9SKrishna Gudipati enum bfa_vf_state {
28*a36c61f9SKrishna Gudipati 	BFA_VF_UNINIT    = 0,	/*  fabric is not yet initialized */
29*a36c61f9SKrishna Gudipati 	BFA_VF_LINK_DOWN = 1,	/*  link is down */
30*a36c61f9SKrishna Gudipati 	BFA_VF_FLOGI     = 2,	/*  flogi is in progress */
31*a36c61f9SKrishna Gudipati 	BFA_VF_AUTH      = 3,	/*  authentication in progress */
32*a36c61f9SKrishna Gudipati 	BFA_VF_NOFABRIC  = 4,	/*  fabric is not present */
33*a36c61f9SKrishna Gudipati 	BFA_VF_ONLINE    = 5,	/*  login to fabric is complete */
34*a36c61f9SKrishna Gudipati 	BFA_VF_EVFP      = 6,	/*  EVFP is in progress */
35*a36c61f9SKrishna Gudipati 	BFA_VF_ISOLATED  = 7,	/*  port isolated due to vf_id mismatch */
36*a36c61f9SKrishna Gudipati };
37*a36c61f9SKrishna Gudipati 
38*a36c61f9SKrishna Gudipati /**
39*a36c61f9SKrishna Gudipati  * VF statistics
40*a36c61f9SKrishna Gudipati  */
41*a36c61f9SKrishna Gudipati struct bfa_vf_stats_s {
42*a36c61f9SKrishna Gudipati 	u32	flogi_sent;	/*  Num FLOGIs sent */
43*a36c61f9SKrishna Gudipati 	u32	flogi_rsp_err;	/*  FLOGI response errors */
44*a36c61f9SKrishna Gudipati 	u32	flogi_acc_err;	/*  FLOGI accept errors */
45*a36c61f9SKrishna Gudipati 	u32	flogi_accepts;	/*  FLOGI accepts received */
46*a36c61f9SKrishna Gudipati 	u32	flogi_rejects;	/*  FLOGI rejects received */
47*a36c61f9SKrishna Gudipati 	u32	flogi_unknown_rsp; /*  Unknown responses for FLOGI */
48*a36c61f9SKrishna Gudipati 	u32	flogi_alloc_wait; /*  Allocation waits prior to sending FLOGI */
49*a36c61f9SKrishna Gudipati 	u32	flogi_rcvd;	/*  FLOGIs received */
50*a36c61f9SKrishna Gudipati 	u32	flogi_rejected;	/*  Incoming FLOGIs rejected */
51*a36c61f9SKrishna Gudipati 	u32	fabric_onlines;	/*  Internal fabric online notification sent
52*a36c61f9SKrishna Gudipati 				 *  to other modules */
53*a36c61f9SKrishna Gudipati 	u32	fabric_offlines; /* Internal fabric offline notification sent
54*a36c61f9SKrishna Gudipati 				  * to other modules */
55*a36c61f9SKrishna Gudipati 	u32	resvd; /*  padding for 64 bit alignment */
56*a36c61f9SKrishna Gudipati };
57*a36c61f9SKrishna Gudipati 
58*a36c61f9SKrishna Gudipati /**
59*a36c61f9SKrishna Gudipati  * VF attributes returned in queries
60*a36c61f9SKrishna Gudipati  */
61*a36c61f9SKrishna Gudipati struct bfa_vf_attr_s {
62*a36c61f9SKrishna Gudipati 	enum bfa_vf_state  state;		/*  VF state */
63*a36c61f9SKrishna Gudipati 	u32        rsvd;
64*a36c61f9SKrishna Gudipati 	wwn_t           fabric_name;	/*  fabric name */
65*a36c61f9SKrishna Gudipati };
66*a36c61f9SKrishna Gudipati 
67*a36c61f9SKrishna Gudipati #define BFA_FCS_MAX_LPORTS 256
68*a36c61f9SKrishna Gudipati #define BFA_FCS_FABRIC_IPADDR_SZ  16
69*a36c61f9SKrishna Gudipati 
70*a36c61f9SKrishna Gudipati /**
71*a36c61f9SKrishna Gudipati  * symbolic names for base port/virtual port
72*a36c61f9SKrishna Gudipati  */
73*a36c61f9SKrishna Gudipati #define BFA_SYMNAME_MAXLEN	128	/* 128 bytes */
74*a36c61f9SKrishna Gudipati struct bfa_lport_symname_s {
75*a36c61f9SKrishna Gudipati 	char	    symname[BFA_SYMNAME_MAXLEN];
76*a36c61f9SKrishna Gudipati };
77*a36c61f9SKrishna Gudipati 
78*a36c61f9SKrishna Gudipati /**
79*a36c61f9SKrishna Gudipati * Roles of FCS port:
80*a36c61f9SKrishna Gudipati  *     - FCP IM and FCP TM roles cannot be enabled together for a FCS port
81*a36c61f9SKrishna Gudipati  *     - Create multiple ports if both IM and TM functions required.
82*a36c61f9SKrishna Gudipati  *     - Atleast one role must be specified.
83*a36c61f9SKrishna Gudipati  */
84*a36c61f9SKrishna Gudipati enum bfa_lport_role {
85*a36c61f9SKrishna Gudipati 	BFA_LPORT_ROLE_FCP_IM	= 0x01,	/*  FCP initiator role */
86*a36c61f9SKrishna Gudipati 	BFA_LPORT_ROLE_FCP_MAX	= BFA_LPORT_ROLE_FCP_IM,
87*a36c61f9SKrishna Gudipati };
88*a36c61f9SKrishna Gudipati 
89*a36c61f9SKrishna Gudipati /**
90*a36c61f9SKrishna Gudipati  * FCS port configuration.
91*a36c61f9SKrishna Gudipati  */
92*a36c61f9SKrishna Gudipati struct bfa_lport_cfg_s {
93*a36c61f9SKrishna Gudipati     wwn_t	       pwwn;       /*  port wwn */
94*a36c61f9SKrishna Gudipati     wwn_t	       nwwn;       /*  node wwn */
95*a36c61f9SKrishna Gudipati     struct bfa_lport_symname_s  sym_name;   /*  vm port symbolic name */
96*a36c61f9SKrishna Gudipati 	bfa_boolean_t       preboot_vp;  /*  vport created from PBC */
97*a36c61f9SKrishna Gudipati     enum bfa_lport_role     roles;      /*  FCS port roles */
98*a36c61f9SKrishna Gudipati     u8	     tag[16];	/*  opaque tag from application */
99*a36c61f9SKrishna Gudipati };
100*a36c61f9SKrishna Gudipati 
101*a36c61f9SKrishna Gudipati /**
102*a36c61f9SKrishna Gudipati  * FCS port states
103*a36c61f9SKrishna Gudipati  */
104*a36c61f9SKrishna Gudipati enum bfa_lport_state {
105*a36c61f9SKrishna Gudipati 	BFA_LPORT_UNINIT  = 0,	/*  PORT is not yet initialized */
106*a36c61f9SKrishna Gudipati 	BFA_LPORT_FDISC   = 1,	/*  FDISC is in progress */
107*a36c61f9SKrishna Gudipati 	BFA_LPORT_ONLINE  = 2,	/*  login to fabric is complete */
108*a36c61f9SKrishna Gudipati 	BFA_LPORT_OFFLINE = 3,	/*  No login to fabric */
109*a36c61f9SKrishna Gudipati };
110*a36c61f9SKrishna Gudipati 
111*a36c61f9SKrishna Gudipati /**
112*a36c61f9SKrishna Gudipati  * FCS port type.
113*a36c61f9SKrishna Gudipati  */
114*a36c61f9SKrishna Gudipati enum bfa_lport_type {
115*a36c61f9SKrishna Gudipati 	BFA_LPORT_TYPE_PHYSICAL = 0,
116*a36c61f9SKrishna Gudipati 	BFA_LPORT_TYPE_VIRTUAL,
117*a36c61f9SKrishna Gudipati };
118*a36c61f9SKrishna Gudipati 
119*a36c61f9SKrishna Gudipati /**
120*a36c61f9SKrishna Gudipati  * FCS port offline reason.
121*a36c61f9SKrishna Gudipati  */
122*a36c61f9SKrishna Gudipati enum bfa_lport_offline_reason {
123*a36c61f9SKrishna Gudipati 	BFA_LPORT_OFFLINE_UNKNOWN = 0,
124*a36c61f9SKrishna Gudipati 	BFA_LPORT_OFFLINE_LINKDOWN,
125*a36c61f9SKrishna Gudipati 	BFA_LPORT_OFFLINE_FAB_UNSUPPORTED,	/*  NPIV not supported by the
126*a36c61f9SKrishna Gudipati 	 *    fabric */
127*a36c61f9SKrishna Gudipati 	BFA_LPORT_OFFLINE_FAB_NORESOURCES,
128*a36c61f9SKrishna Gudipati 	BFA_LPORT_OFFLINE_FAB_LOGOUT,
129*a36c61f9SKrishna Gudipati };
130*a36c61f9SKrishna Gudipati 
131*a36c61f9SKrishna Gudipati /**
132*a36c61f9SKrishna Gudipati  * FCS lport info.
133*a36c61f9SKrishna Gudipati  */
134*a36c61f9SKrishna Gudipati struct bfa_lport_info_s {
135*a36c61f9SKrishna Gudipati 	u8	 port_type;	/* bfa_lport_type_t : physical or
136*a36c61f9SKrishna Gudipati 	 * virtual */
137*a36c61f9SKrishna Gudipati 	u8	 port_state;	/* one of bfa_lport_state values */
138*a36c61f9SKrishna Gudipati 	u8	 offline_reason;	/* one of bfa_lport_offline_reason_t
139*a36c61f9SKrishna Gudipati 	 * values */
140*a36c61f9SKrishna Gudipati 	wwn_t	   port_wwn;
141*a36c61f9SKrishna Gudipati 	wwn_t	   node_wwn;
142*a36c61f9SKrishna Gudipati 
143*a36c61f9SKrishna Gudipati 	/*
144*a36c61f9SKrishna Gudipati 	 * following 4 feilds are valid for Physical Ports only
145*a36c61f9SKrishna Gudipati 	 */
146*a36c61f9SKrishna Gudipati 	u32	max_vports_supp;	/* Max supported vports */
147*a36c61f9SKrishna Gudipati 	u32	num_vports_inuse;	/* Num of in use vports */
148*a36c61f9SKrishna Gudipati 	u32	max_rports_supp;	/* Max supported rports */
149*a36c61f9SKrishna Gudipati 	u32	num_rports_inuse;	/* Num of doscovered rports */
150*a36c61f9SKrishna Gudipati 
151*a36c61f9SKrishna Gudipati };
152*a36c61f9SKrishna Gudipati 
153*a36c61f9SKrishna Gudipati /**
154*a36c61f9SKrishna Gudipati  * FCS port statistics
155*a36c61f9SKrishna Gudipati  */
156*a36c61f9SKrishna Gudipati struct bfa_lport_stats_s {
157*a36c61f9SKrishna Gudipati 	u32	ns_plogi_sent;
158*a36c61f9SKrishna Gudipati 	u32	ns_plogi_rsp_err;
159*a36c61f9SKrishna Gudipati 	u32	ns_plogi_acc_err;
160*a36c61f9SKrishna Gudipati 	u32	ns_plogi_accepts;
161*a36c61f9SKrishna Gudipati 	u32	ns_rejects;	/* NS command rejects */
162*a36c61f9SKrishna Gudipati 	u32	ns_plogi_unknown_rsp;
163*a36c61f9SKrishna Gudipati 	u32	ns_plogi_alloc_wait;
164*a36c61f9SKrishna Gudipati 
165*a36c61f9SKrishna Gudipati 	u32	ns_retries;	/* NS command retries */
166*a36c61f9SKrishna Gudipati 	u32	ns_timeouts;	/* NS command timeouts */
167*a36c61f9SKrishna Gudipati 
168*a36c61f9SKrishna Gudipati 	u32	ns_rspnid_sent;
169*a36c61f9SKrishna Gudipati 	u32	ns_rspnid_accepts;
170*a36c61f9SKrishna Gudipati 	u32	ns_rspnid_rsp_err;
171*a36c61f9SKrishna Gudipati 	u32	ns_rspnid_rejects;
172*a36c61f9SKrishna Gudipati 	u32	ns_rspnid_alloc_wait;
173*a36c61f9SKrishna Gudipati 
174*a36c61f9SKrishna Gudipati 	u32	ns_rftid_sent;
175*a36c61f9SKrishna Gudipati 	u32	ns_rftid_accepts;
176*a36c61f9SKrishna Gudipati 	u32	ns_rftid_rsp_err;
177*a36c61f9SKrishna Gudipati 	u32	ns_rftid_rejects;
178*a36c61f9SKrishna Gudipati 	u32	ns_rftid_alloc_wait;
179*a36c61f9SKrishna Gudipati 
180*a36c61f9SKrishna Gudipati 	u32	ns_rffid_sent;
181*a36c61f9SKrishna Gudipati 	u32	ns_rffid_accepts;
182*a36c61f9SKrishna Gudipati 	u32	ns_rffid_rsp_err;
183*a36c61f9SKrishna Gudipati 	u32	ns_rffid_rejects;
184*a36c61f9SKrishna Gudipati 	u32	ns_rffid_alloc_wait;
185*a36c61f9SKrishna Gudipati 
186*a36c61f9SKrishna Gudipati 	u32	ns_gidft_sent;
187*a36c61f9SKrishna Gudipati 	u32	ns_gidft_accepts;
188*a36c61f9SKrishna Gudipati 	u32	ns_gidft_rsp_err;
189*a36c61f9SKrishna Gudipati 	u32	ns_gidft_rejects;
190*a36c61f9SKrishna Gudipati 	u32	ns_gidft_unknown_rsp;
191*a36c61f9SKrishna Gudipati 	u32	ns_gidft_alloc_wait;
192*a36c61f9SKrishna Gudipati 
193*a36c61f9SKrishna Gudipati 	/*
194*a36c61f9SKrishna Gudipati 	 * Mgmt Server stats
195*a36c61f9SKrishna Gudipati 	 */
196*a36c61f9SKrishna Gudipati 	u32	ms_retries;	/* MS command retries */
197*a36c61f9SKrishna Gudipati 	u32	ms_timeouts;	/* MS command timeouts */
198*a36c61f9SKrishna Gudipati 	u32	ms_plogi_sent;
199*a36c61f9SKrishna Gudipati 	u32	ms_plogi_rsp_err;
200*a36c61f9SKrishna Gudipati 	u32	ms_plogi_acc_err;
201*a36c61f9SKrishna Gudipati 	u32	ms_plogi_accepts;
202*a36c61f9SKrishna Gudipati 	u32	ms_rejects;	/* MS command rejects */
203*a36c61f9SKrishna Gudipati 	u32	ms_plogi_unknown_rsp;
204*a36c61f9SKrishna Gudipati 	u32	ms_plogi_alloc_wait;
205*a36c61f9SKrishna Gudipati 
206*a36c61f9SKrishna Gudipati 	u32	num_rscn;	/* Num of RSCN received */
207*a36c61f9SKrishna Gudipati 	u32	num_portid_rscn;/* Num portid format RSCN
208*a36c61f9SKrishna Gudipati 	* received */
209*a36c61f9SKrishna Gudipati 
210*a36c61f9SKrishna Gudipati 	u32	uf_recvs;	/* Unsolicited recv frames	*/
211*a36c61f9SKrishna Gudipati 	u32	uf_recv_drops;	/* Dropped received frames	*/
212*a36c61f9SKrishna Gudipati 
213*a36c61f9SKrishna Gudipati 	u32	plogi_rcvd;	/* Received plogi	*/
214*a36c61f9SKrishna Gudipati 	u32	prli_rcvd;	/* Received prli	*/
215*a36c61f9SKrishna Gudipati 	u32	adisc_rcvd;	/* Received adisc	*/
216*a36c61f9SKrishna Gudipati 	u32	prlo_rcvd;	/* Received prlo	*/
217*a36c61f9SKrishna Gudipati 	u32	logo_rcvd;	/* Received logo	*/
218*a36c61f9SKrishna Gudipati 	u32	rpsc_rcvd;	/* Received rpsc	*/
219*a36c61f9SKrishna Gudipati 	u32	un_handled_els_rcvd;	/* Received unhandled ELS	*/
220*a36c61f9SKrishna Gudipati 	u32	rport_plogi_timeouts; /* Rport plogi retry timeout count */
221*a36c61f9SKrishna Gudipati 	u32	rport_del_max_plogi_retry; /* Deleted rport
222*a36c61f9SKrishna Gudipati 					    * (max retry of plogi) */
223*a36c61f9SKrishna Gudipati };
224*a36c61f9SKrishna Gudipati 
225*a36c61f9SKrishna Gudipati /**
226*a36c61f9SKrishna Gudipati  * BFA port attribute returned in queries
227*a36c61f9SKrishna Gudipati  */
228*a36c61f9SKrishna Gudipati struct bfa_lport_attr_s {
229*a36c61f9SKrishna Gudipati 	enum bfa_lport_state state;	/*  port state */
230*a36c61f9SKrishna Gudipati 	u32	 pid;	/*  port ID */
231*a36c61f9SKrishna Gudipati 	struct bfa_lport_cfg_s   port_cfg;	/*  port configuration */
232*a36c61f9SKrishna Gudipati 	enum bfa_port_type port_type;	/*  current topology */
233*a36c61f9SKrishna Gudipati 	u32	 loopback;	/*  cable is externally looped back */
234*a36c61f9SKrishna Gudipati 	wwn_t	fabric_name; /*  attached switch's nwwn */
235*a36c61f9SKrishna Gudipati 	u8	fabric_ip_addr[BFA_FCS_FABRIC_IPADDR_SZ]; /*  attached
236*a36c61f9SKrishna Gudipati 	* fabric's ip addr */
237*a36c61f9SKrishna Gudipati 	mac_t	   fpma_mac;	/*  Lport's FPMA Mac address */
238*a36c61f9SKrishna Gudipati 	u16	authfail;	/*  auth failed state */
239*a36c61f9SKrishna Gudipati };
240*a36c61f9SKrishna Gudipati 
241*a36c61f9SKrishna Gudipati 
242*a36c61f9SKrishna Gudipati /**
243*a36c61f9SKrishna Gudipati  * VPORT states
244*a36c61f9SKrishna Gudipati  */
245*a36c61f9SKrishna Gudipati enum bfa_vport_state {
246*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_UNINIT		= 0,
247*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_CREATED		= 1,
248*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_OFFLINE		= 1,
249*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_FDISC_SEND	= 2,
250*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_FDISC		= 3,
251*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_FDISC_RETRY	= 4,
252*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_ONLINE		= 5,
253*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_DELETING		= 6,
254*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_CLEANUP		= 6,
255*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_LOGO_SEND		= 7,
256*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_LOGO		= 8,
257*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_ERROR		= 9,
258*a36c61f9SKrishna Gudipati 	BFA_FCS_VPORT_MAX_STATE,
259*a36c61f9SKrishna Gudipati };
260*a36c61f9SKrishna Gudipati 
261*a36c61f9SKrishna Gudipati /**
262*a36c61f9SKrishna Gudipati  * vport statistics
263*a36c61f9SKrishna Gudipati  */
264*a36c61f9SKrishna Gudipati struct bfa_vport_stats_s {
265*a36c61f9SKrishna Gudipati 	struct bfa_lport_stats_s port_stats;	/*  base class (port) stats */
266*a36c61f9SKrishna Gudipati 	/*
267*a36c61f9SKrishna Gudipati 	 * TODO - remove
268*a36c61f9SKrishna Gudipati 	 */
269*a36c61f9SKrishna Gudipati 
270*a36c61f9SKrishna Gudipati 	u32        fdisc_sent;	/*  num fdisc sent */
271*a36c61f9SKrishna Gudipati 	u32        fdisc_accepts;	/*  fdisc accepts */
272*a36c61f9SKrishna Gudipati 	u32        fdisc_retries;	/*  fdisc retries */
273*a36c61f9SKrishna Gudipati 	u32        fdisc_timeouts;	/*  fdisc timeouts */
274*a36c61f9SKrishna Gudipati 	u32        fdisc_rsp_err;	/*  fdisc response error */
275*a36c61f9SKrishna Gudipati 	u32        fdisc_acc_bad;	/*  bad fdisc accepts */
276*a36c61f9SKrishna Gudipati 	u32        fdisc_rejects;	/*  fdisc rejects */
277*a36c61f9SKrishna Gudipati 	u32        fdisc_unknown_rsp;
278*a36c61f9SKrishna Gudipati 	/*
279*a36c61f9SKrishna Gudipati 	 *!< fdisc rsp unknown error
280*a36c61f9SKrishna Gudipati 	 */
281*a36c61f9SKrishna Gudipati 	u32        fdisc_alloc_wait;/*  fdisc req (fcxp)alloc wait */
282*a36c61f9SKrishna Gudipati 
283*a36c61f9SKrishna Gudipati 	u32        logo_alloc_wait;/*  logo req (fcxp) alloc wait */
284*a36c61f9SKrishna Gudipati 	u32        logo_sent;	/*  logo sent */
285*a36c61f9SKrishna Gudipati 	u32        logo_accepts;	/*  logo accepts */
286*a36c61f9SKrishna Gudipati 	u32        logo_rejects;	/*  logo rejects */
287*a36c61f9SKrishna Gudipati 	u32        logo_rsp_err;	/*  logo rsp errors */
288*a36c61f9SKrishna Gudipati 	u32        logo_unknown_rsp;
289*a36c61f9SKrishna Gudipati 			/*  logo rsp unknown errors */
290*a36c61f9SKrishna Gudipati 
291*a36c61f9SKrishna Gudipati 	u32        fab_no_npiv;	/*  fabric does not support npiv */
292*a36c61f9SKrishna Gudipati 
293*a36c61f9SKrishna Gudipati 	u32        fab_offline;	/*  offline events from fab SM */
294*a36c61f9SKrishna Gudipati 	u32        fab_online;	/*  online events from fab SM */
295*a36c61f9SKrishna Gudipati 	u32        fab_cleanup;	/*  cleanup request from fab SM */
296*a36c61f9SKrishna Gudipati 	u32        rsvd;
297*a36c61f9SKrishna Gudipati };
298*a36c61f9SKrishna Gudipati 
299*a36c61f9SKrishna Gudipati /**
300*a36c61f9SKrishna Gudipati  * BFA vport attribute returned in queries
301*a36c61f9SKrishna Gudipati  */
302*a36c61f9SKrishna Gudipati struct bfa_vport_attr_s {
303*a36c61f9SKrishna Gudipati 	struct bfa_lport_attr_s   port_attr; /*  base class (port) attributes */
304*a36c61f9SKrishna Gudipati 	enum bfa_vport_state vport_state; /*  vport state */
305*a36c61f9SKrishna Gudipati 	u32          rsvd;
306*a36c61f9SKrishna Gudipati };
307*a36c61f9SKrishna Gudipati 
308*a36c61f9SKrishna Gudipati /**
309*a36c61f9SKrishna Gudipati  * FCS remote port states
310*a36c61f9SKrishna Gudipati  */
311*a36c61f9SKrishna Gudipati enum bfa_rport_state {
312*a36c61f9SKrishna Gudipati 	BFA_RPORT_UNINIT	= 0,	/*  PORT is not yet initialized */
313*a36c61f9SKrishna Gudipati 	BFA_RPORT_OFFLINE	= 1,	/*  rport is offline */
314*a36c61f9SKrishna Gudipati 	BFA_RPORT_PLOGI		= 2,	/*  PLOGI to rport is in progress */
315*a36c61f9SKrishna Gudipati 	BFA_RPORT_ONLINE	= 3,	/*  login to rport is complete */
316*a36c61f9SKrishna Gudipati 	BFA_RPORT_PLOGI_RETRY	= 4,	/*  retrying login to rport */
317*a36c61f9SKrishna Gudipati 	BFA_RPORT_NSQUERY	= 5,	/*  nameserver query */
318*a36c61f9SKrishna Gudipati 	BFA_RPORT_ADISC		= 6,	/*  ADISC authentication */
319*a36c61f9SKrishna Gudipati 	BFA_RPORT_LOGO		= 7,	/*  logging out with rport */
320*a36c61f9SKrishna Gudipati 	BFA_RPORT_LOGORCV	= 8,	/*  handling LOGO from rport */
321*a36c61f9SKrishna Gudipati 	BFA_RPORT_NSDISC	= 9,	/*  re-discover rport */
322*a36c61f9SKrishna Gudipati };
323*a36c61f9SKrishna Gudipati 
324*a36c61f9SKrishna Gudipati /**
325*a36c61f9SKrishna Gudipati  *  Rport Scsi Function : Initiator/Target.
326*a36c61f9SKrishna Gudipati  */
327*a36c61f9SKrishna Gudipati enum bfa_rport_function {
328*a36c61f9SKrishna Gudipati 	BFA_RPORT_INITIATOR	= 0x01,	/*  SCSI Initiator	*/
329*a36c61f9SKrishna Gudipati 	BFA_RPORT_TARGET	= 0x02,	/*  SCSI Target	*/
330*a36c61f9SKrishna Gudipati };
331*a36c61f9SKrishna Gudipati 
332*a36c61f9SKrishna Gudipati /**
333*a36c61f9SKrishna Gudipati  * port/node symbolic names for rport
334*a36c61f9SKrishna Gudipati  */
335*a36c61f9SKrishna Gudipati #define BFA_RPORT_SYMNAME_MAXLEN	255
336*a36c61f9SKrishna Gudipati struct bfa_rport_symname_s {
337*a36c61f9SKrishna Gudipati 	char            symname[BFA_RPORT_SYMNAME_MAXLEN];
338*a36c61f9SKrishna Gudipati };
339*a36c61f9SKrishna Gudipati 
340*a36c61f9SKrishna Gudipati /**
341*a36c61f9SKrishna Gudipati  * FCS remote port statistics
342*a36c61f9SKrishna Gudipati  */
343*a36c61f9SKrishna Gudipati struct bfa_rport_stats_s {
344*a36c61f9SKrishna Gudipati 	u32        offlines;           /*  remote port offline count  */
345*a36c61f9SKrishna Gudipati 	u32        onlines;            /*  remote port online count   */
346*a36c61f9SKrishna Gudipati 	u32        rscns;              /*  RSCN affecting rport       */
347*a36c61f9SKrishna Gudipati 	u32        plogis;		    /*  plogis sent                */
348*a36c61f9SKrishna Gudipati 	u32        plogi_accs;	    /*  plogi accepts              */
349*a36c61f9SKrishna Gudipati 	u32        plogi_timeouts;	    /*  plogi timeouts             */
350*a36c61f9SKrishna Gudipati 	u32        plogi_rejects;	    /*  rcvd plogi rejects         */
351*a36c61f9SKrishna Gudipati 	u32        plogi_failed;	    /*  local failure              */
352*a36c61f9SKrishna Gudipati 	u32        plogi_rcvd;	    /*  plogis rcvd                */
353*a36c61f9SKrishna Gudipati 	u32        prli_rcvd;          /*  inbound PRLIs              */
354*a36c61f9SKrishna Gudipati 	u32        adisc_rcvd;         /*  ADISCs received            */
355*a36c61f9SKrishna Gudipati 	u32        adisc_rejects;      /*  recvd  ADISC rejects       */
356*a36c61f9SKrishna Gudipati 	u32        adisc_sent;         /*  ADISC requests sent        */
357*a36c61f9SKrishna Gudipati 	u32        adisc_accs;         /*  ADISC accepted by rport    */
358*a36c61f9SKrishna Gudipati 	u32        adisc_failed;       /*  ADISC failed (no response) */
359*a36c61f9SKrishna Gudipati 	u32        adisc_rejected;     /*  ADISC rejected by us    */
360*a36c61f9SKrishna Gudipati 	u32        logos;              /*  logos sent                 */
361*a36c61f9SKrishna Gudipati 	u32        logo_accs;          /*  LOGO accepts from rport    */
362*a36c61f9SKrishna Gudipati 	u32        logo_failed;        /*  LOGO failures              */
363*a36c61f9SKrishna Gudipati 	u32        logo_rejected;      /*  LOGO rejects from rport    */
364*a36c61f9SKrishna Gudipati 	u32        logo_rcvd;          /*  LOGO from remote port      */
365*a36c61f9SKrishna Gudipati 
366*a36c61f9SKrishna Gudipati 	u32        rpsc_rcvd;         /*  RPSC received            */
367*a36c61f9SKrishna Gudipati 	u32        rpsc_rejects;      /*  recvd  RPSC rejects       */
368*a36c61f9SKrishna Gudipati 	u32        rpsc_sent;         /*  RPSC requests sent        */
369*a36c61f9SKrishna Gudipati 	u32        rpsc_accs;         /*  RPSC accepted by rport    */
370*a36c61f9SKrishna Gudipati 	u32        rpsc_failed;       /*  RPSC failed (no response) */
371*a36c61f9SKrishna Gudipati 	u32        rpsc_rejected;     /*  RPSC rejected by us    */
372*a36c61f9SKrishna Gudipati 
373*a36c61f9SKrishna Gudipati 	u32	rjt_insuff_res;	/*  LS RJT with insuff resources */
374*a36c61f9SKrishna Gudipati 	struct bfa_rport_hal_stats_s	hal_stats;  /*  BFA rport stats    */
375*a36c61f9SKrishna Gudipati };
376*a36c61f9SKrishna Gudipati 
377*a36c61f9SKrishna Gudipati /**
378*a36c61f9SKrishna Gudipati  * FCS remote port attributes returned in queries
379*a36c61f9SKrishna Gudipati  */
380*a36c61f9SKrishna Gudipati struct bfa_rport_attr_s {
381*a36c61f9SKrishna Gudipati 	wwn_t		nwwn;	/*  node wwn */
382*a36c61f9SKrishna Gudipati 	wwn_t		pwwn;	/*  port wwn */
383*a36c61f9SKrishna Gudipati 	enum fc_cos cos_supported;	/*  supported class of services */
384*a36c61f9SKrishna Gudipati 	u32		pid;	/*  port ID */
385*a36c61f9SKrishna Gudipati 	u32		df_sz;	/*  Max payload size */
386*a36c61f9SKrishna Gudipati 	enum bfa_rport_state	state;	/*  Rport State machine state */
387*a36c61f9SKrishna Gudipati 	enum fc_cos	fc_cos;	/*  FC classes of services */
388*a36c61f9SKrishna Gudipati 	bfa_boolean_t	cisc;	/*  CISC capable device */
389*a36c61f9SKrishna Gudipati 	struct bfa_rport_symname_s symname; /*  Symbolic Name */
390*a36c61f9SKrishna Gudipati 	enum bfa_rport_function	scsi_function; /*  Initiator/Target */
391*a36c61f9SKrishna Gudipati 	struct bfa_rport_qos_attr_s qos_attr; /*  qos attributes  */
392*a36c61f9SKrishna Gudipati 	enum bfa_port_speed curr_speed;   /*  operating speed got from
393*a36c61f9SKrishna Gudipati 					    * RPSC ELS. UNKNOWN, if RPSC
394*a36c61f9SKrishna Gudipati 					    * is not supported */
395*a36c61f9SKrishna Gudipati 	bfa_boolean_t	trl_enforced;	/*  TRL enforced ? TRUE/FALSE */
396*a36c61f9SKrishna Gudipati 	enum bfa_port_speed	assigned_speed;	/* Speed assigned by the user.
397*a36c61f9SKrishna Gudipati 						 * will be used if RPSC is not
398*a36c61f9SKrishna Gudipati 						 * supported by the rport */
399*a36c61f9SKrishna Gudipati };
400*a36c61f9SKrishna Gudipati 
401*a36c61f9SKrishna Gudipati struct bfa_rport_remote_link_stats_s {
402*a36c61f9SKrishna Gudipati 	u32 lfc; /*  Link Failure Count */
403*a36c61f9SKrishna Gudipati 	u32 lsyc; /*  Loss of Synchronization Count */
404*a36c61f9SKrishna Gudipati 	u32 lsic; /*  Loss of Signal Count */
405*a36c61f9SKrishna Gudipati 	u32 pspec; /*  Primitive Sequence Protocol Error Count */
406*a36c61f9SKrishna Gudipati 	u32 itwc; /*  Invalid Transmission Word Count */
407*a36c61f9SKrishna Gudipati 	u32 icc; /*  Invalid CRC Count */
408*a36c61f9SKrishna Gudipati };
409*a36c61f9SKrishna Gudipati 
410*a36c61f9SKrishna Gudipati 
411*a36c61f9SKrishna Gudipati #define BFA_MAX_IO_INDEX 7
412*a36c61f9SKrishna Gudipati #define BFA_NO_IO_INDEX 9
413*a36c61f9SKrishna Gudipati 
414*a36c61f9SKrishna Gudipati /**
415*a36c61f9SKrishna Gudipati  * FCS itnim states
416*a36c61f9SKrishna Gudipati  */
417*a36c61f9SKrishna Gudipati enum bfa_itnim_state {
418*a36c61f9SKrishna Gudipati 	BFA_ITNIM_OFFLINE	= 0,	/*  offline */
419*a36c61f9SKrishna Gudipati 	BFA_ITNIM_PRLI_SEND	= 1,	/*  prli send */
420*a36c61f9SKrishna Gudipati 	BFA_ITNIM_PRLI_SENT	= 2,	/*  prli sent */
421*a36c61f9SKrishna Gudipati 	BFA_ITNIM_PRLI_RETRY	= 3,	/*  prli retry */
422*a36c61f9SKrishna Gudipati 	BFA_ITNIM_HCB_ONLINE	= 4,	/*  online callback */
423*a36c61f9SKrishna Gudipati 	BFA_ITNIM_ONLINE	= 5,	/*  online */
424*a36c61f9SKrishna Gudipati 	BFA_ITNIM_HCB_OFFLINE	= 6,	/*  offline callback */
425*a36c61f9SKrishna Gudipati 	BFA_ITNIM_INITIATIOR	= 7,	/*  initiator */
426*a36c61f9SKrishna Gudipati };
427*a36c61f9SKrishna Gudipati 
428*a36c61f9SKrishna Gudipati /**
429*a36c61f9SKrishna Gudipati  * FCS remote port statistics
430*a36c61f9SKrishna Gudipati  */
431*a36c61f9SKrishna Gudipati struct bfa_itnim_stats_s {
432*a36c61f9SKrishna Gudipati 	u32        onlines;	/*  num rport online */
433*a36c61f9SKrishna Gudipati 	u32        offlines;	/*  num rport offline */
434*a36c61f9SKrishna Gudipati 	u32        prli_sent;	/*  num prli sent out */
435*a36c61f9SKrishna Gudipati 	u32        fcxp_alloc_wait;/*  num fcxp alloc waits */
436*a36c61f9SKrishna Gudipati 	u32        prli_rsp_err;	/*  num prli rsp errors */
437*a36c61f9SKrishna Gudipati 	u32        prli_rsp_acc;	/*  num prli rsp accepts */
438*a36c61f9SKrishna Gudipati 	u32        initiator;	/*  rport is an initiator */
439*a36c61f9SKrishna Gudipati 	u32        prli_rsp_parse_err;	/*  prli rsp parsing errors */
440*a36c61f9SKrishna Gudipati 	u32        prli_rsp_rjt;	/*  num prli rsp rejects */
441*a36c61f9SKrishna Gudipati 	u32        timeout;	/*  num timeouts detected */
442*a36c61f9SKrishna Gudipati 	u32        sler;		/*  num sler notification from BFA */
443*a36c61f9SKrishna Gudipati 	u32	rsvd;		/* padding for 64 bit alignment */
444*a36c61f9SKrishna Gudipati };
445*a36c61f9SKrishna Gudipati 
446*a36c61f9SKrishna Gudipati /**
447*a36c61f9SKrishna Gudipati  * FCS itnim attributes returned in queries
448*a36c61f9SKrishna Gudipati  */
449*a36c61f9SKrishna Gudipati struct bfa_itnim_attr_s {
450*a36c61f9SKrishna Gudipati 	enum bfa_itnim_state state; /*  FCS itnim state        */
451*a36c61f9SKrishna Gudipati 	u8 retry;		/*  data retransmision support */
452*a36c61f9SKrishna Gudipati 	u8	task_retry_id;  /*  task retry ident support   */
453*a36c61f9SKrishna Gudipati 	u8 rec_support;    /*  REC supported              */
454*a36c61f9SKrishna Gudipati 	u8 conf_comp;      /*  confirmed completion supp  */
455*a36c61f9SKrishna Gudipati };
456*a36c61f9SKrishna Gudipati 
457*a36c61f9SKrishna Gudipati #endif /* __BFA_DEFS_FCS_H__ */
458