Linux Audio

Check our new training course

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