Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bfa_defs_fcs.h
Go to the documentation of this file.
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  */
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  */
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  */
61 struct bfa_vf_attr_s {
62  enum bfa_vf_state state; /* VF state */
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 */
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  */
85  BFA_LPORT_ROLE_FCP_IM = 0x01, /* FCP initiator role */
87 };
88 
89 /*
90  * FCS port configuration.
91  */
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  struct bfa_lport_symname_s node_sym_name; /* Node symbolic name */
97  enum bfa_lport_role roles; /* FCS port roles */
99  bfa_boolean_t preboot_vp; /* vport created from PBC */
100  u8 tag[16]; /* opaque tag from application */
102 };
103 
104 /*
105  * FCS port states
106  */
108  BFA_LPORT_UNINIT = 0, /* PORT is not yet initialized */
109  BFA_LPORT_FDISC = 1, /* FDISC is in progress */
110  BFA_LPORT_ONLINE = 2, /* login to fabric is complete */
111  BFA_LPORT_OFFLINE = 3, /* No login to fabric */
112 };
113 
114 /*
115  * FCS port type.
116  */
120 };
121 
122 /*
123  * FCS port offline reason.
124  */
128  BFA_LPORT_OFFLINE_FAB_UNSUPPORTED, /* NPIV not supported by the
129  * fabric */
132 };
133 
134 /*
135  * FCS lport info.
136  */
138  u8 port_type; /* bfa_lport_type_t : physical or
139  * virtual */
140  u8 port_state; /* one of bfa_lport_state values */
141  u8 offline_reason; /* one of bfa_lport_offline_reason_t
142  * values */
145 
146  /*
147  * following 4 feilds are valid for Physical Ports only
148  */
149  u32 max_vports_supp; /* Max supported vports */
150  u32 num_vports_inuse; /* Num of in use vports */
151  u32 max_rports_supp; /* Max supported rports */
152  u32 num_rports_inuse; /* Num of doscovered rports */
153 
154 };
155 
156 /*
157  * FCS port statistics
158  */
164  u32 ns_rejects; /* NS command rejects */
167 
168  u32 ns_retries; /* NS command retries */
169  u32 ns_timeouts; /* NS command timeouts */
170 
176 
182 
188 
195 
201 
207 
208  /*
209  * Mgmt Server stats
210  */
211  u32 ms_retries; /* MS command retries */
212  u32 ms_timeouts; /* MS command timeouts */
217  u32 ms_rejects; /* MS command rejects */
220 
221  u32 num_rscn; /* Num of RSCN received */
222  u32 num_portid_rscn;/* Num portid format RSCN
223  * received */
224 
225  u32 uf_recvs; /* Unsolicited recv frames */
226  u32 uf_recv_drops; /* Dropped received frames */
227 
228  u32 plogi_rcvd; /* Received plogi */
229  u32 prli_rcvd; /* Received prli */
230  u32 adisc_rcvd; /* Received adisc */
231  u32 prlo_rcvd; /* Received prlo */
232  u32 logo_rcvd; /* Received logo */
233  u32 rpsc_rcvd; /* Received rpsc */
234  u32 un_handled_els_rcvd; /* Received unhandled ELS */
235  u32 rport_plogi_timeouts; /* Rport plogi retry timeout count */
236  u32 rport_del_max_plogi_retry; /* Deleted rport
237  * (max retry of plogi) */
238 };
239 
240 /*
241  * BFA port attribute returned in queries
242  */
244  enum bfa_lport_state state; /* port state */
245  u32 pid; /* port ID */
246  struct bfa_lport_cfg_s port_cfg; /* port configuration */
247  enum bfa_port_type port_type; /* current topology */
248  u32 loopback; /* cable is externally looped back */
249  wwn_t fabric_name; /* attached switch's nwwn */
251  * fabric's ip addr */
252  mac_t fpma_mac; /* Lport's FPMA Mac address */
253  u16 authfail; /* auth failed state */
254 };
255 
256 
257 /*
258  * VPORT states
259  */
275 };
276 
277 /*
278  * vport statistics
279  */
281  struct bfa_lport_stats_s port_stats; /* base class (port) stats */
282  /*
283  * TODO - remove
284  */
285 
286  u32 fdisc_sent; /* num fdisc sent */
287  u32 fdisc_accepts; /* fdisc accepts */
288  u32 fdisc_retries; /* fdisc retries */
289  u32 fdisc_timeouts; /* fdisc timeouts */
290  u32 fdisc_rsp_err; /* fdisc response error */
291  u32 fdisc_acc_bad; /* bad fdisc accepts */
292  u32 fdisc_rejects; /* fdisc rejects */
294  /*
295  *!< fdisc rsp unknown error
296  */
297  u32 fdisc_alloc_wait;/* fdisc req (fcxp)alloc wait */
298 
299  u32 logo_alloc_wait;/* logo req (fcxp) alloc wait */
300  u32 logo_sent; /* logo sent */
301  u32 logo_accepts; /* logo accepts */
302  u32 logo_rejects; /* logo rejects */
303  u32 logo_rsp_err; /* logo rsp errors */
305  /* logo rsp unknown errors */
306 
307  u32 fab_no_npiv; /* fabric does not support npiv */
308 
309  u32 fab_offline; /* offline events from fab SM */
310  u32 fab_online; /* online events from fab SM */
311  u32 fab_cleanup; /* cleanup request from fab SM */
313 };
314 
315 /*
316  * BFA vport attribute returned in queries
317  */
319  struct bfa_lport_attr_s port_attr; /* base class (port) attributes */
320  enum bfa_vport_state vport_state; /* vport state */
322 };
323 
324 /*
325  * FCS remote port states
326  */
328  BFA_RPORT_UNINIT = 0, /* PORT is not yet initialized */
329  BFA_RPORT_OFFLINE = 1, /* rport is offline */
330  BFA_RPORT_PLOGI = 2, /* PLOGI to rport is in progress */
331  BFA_RPORT_ONLINE = 3, /* login to rport is complete */
332  BFA_RPORT_PLOGI_RETRY = 4, /* retrying login to rport */
333  BFA_RPORT_NSQUERY = 5, /* nameserver query */
334  BFA_RPORT_ADISC = 6, /* ADISC authentication */
335  BFA_RPORT_LOGO = 7, /* logging out with rport */
336  BFA_RPORT_LOGORCV = 8, /* handling LOGO from rport */
337  BFA_RPORT_NSDISC = 9, /* re-discover rport */
338 };
339 
340 /*
341  * Rport Scsi Function : Initiator/Target.
342  */
344  BFA_RPORT_INITIATOR = 0x01, /* SCSI Initiator */
345  BFA_RPORT_TARGET = 0x02, /* SCSI Target */
346 };
347 
348 /*
349  * port/node symbolic names for rport
350  */
351 #define BFA_RPORT_SYMNAME_MAXLEN 255
354 };
355 
356 /*
357  * FCS remote port statistics
358  */
360  u32 offlines; /* remote port offline count */
361  u32 onlines; /* remote port online count */
362  u32 rscns; /* RSCN affecting rport */
363  u32 plogis; /* plogis sent */
364  u32 plogi_accs; /* plogi accepts */
365  u32 plogi_timeouts; /* plogi timeouts */
366  u32 plogi_rejects; /* rcvd plogi rejects */
367  u32 plogi_failed; /* local failure */
368  u32 plogi_rcvd; /* plogis rcvd */
369  u32 prli_rcvd; /* inbound PRLIs */
370  u32 adisc_rcvd; /* ADISCs received */
371  u32 adisc_rejects; /* recvd ADISC rejects */
372  u32 adisc_sent; /* ADISC requests sent */
373  u32 adisc_accs; /* ADISC accepted by rport */
374  u32 adisc_failed; /* ADISC failed (no response) */
375  u32 adisc_rejected; /* ADISC rejected by us */
376  u32 logos; /* logos sent */
377  u32 logo_accs; /* LOGO accepts from rport */
378  u32 logo_failed; /* LOGO failures */
379  u32 logo_rejected; /* LOGO rejects from rport */
380  u32 logo_rcvd; /* LOGO from remote port */
381 
382  u32 rpsc_rcvd; /* RPSC received */
383  u32 rpsc_rejects; /* recvd RPSC rejects */
384  u32 rpsc_sent; /* RPSC requests sent */
385  u32 rpsc_accs; /* RPSC accepted by rport */
386  u32 rpsc_failed; /* RPSC failed (no response) */
387  u32 rpsc_rejected; /* RPSC rejected by us */
388 
389  u32 rjt_insuff_res; /* LS RJT with insuff resources */
390  struct bfa_rport_hal_stats_s hal_stats; /* BFA rport stats */
391 };
392 
393 /*
394  * FCS remote port attributes returned in queries
395  */
397  wwn_t nwwn; /* node wwn */
398  wwn_t pwwn; /* port wwn */
399  enum fc_cos cos_supported; /* supported class of services */
400  u32 pid; /* port ID */
401  u32 df_sz; /* Max payload size */
402  enum bfa_rport_state state; /* Rport State machine state */
403  enum fc_cos fc_cos; /* FC classes of services */
404  bfa_boolean_t cisc; /* CISC capable device */
405  struct bfa_rport_symname_s symname; /* Symbolic Name */
406  enum bfa_rport_function scsi_function; /* Initiator/Target */
407  struct bfa_rport_qos_attr_s qos_attr; /* qos attributes */
408  enum bfa_port_speed curr_speed; /* operating speed got from
409  * RPSC ELS. UNKNOWN, if RPSC
410  * is not supported */
411  bfa_boolean_t trl_enforced; /* TRL enforced ? TRUE/FALSE */
412  enum bfa_port_speed assigned_speed; /* Speed assigned by the user.
413  * will be used if RPSC is not
414  * supported by the rport */
415 };
416 
418  u32 lfc; /* Link Failure Count */
419  u32 lsyc; /* Loss of Synchronization Count */
420  u32 lsic; /* Loss of Signal Count */
421  u32 pspec; /* Primitive Sequence Protocol Error Count */
422  u32 itwc; /* Invalid Transmission Word Count */
423  u32 icc; /* Invalid CRC Count */
424 };
425 
427  wwn_t pwwn; /* Port WWN */
428  u32 pid; /* port ID */
430 };
431 
432 #define BFA_MAX_IO_INDEX 7
433 #define BFA_NO_IO_INDEX 9
434 
435 /*
436  * FCS itnim states
437  */
439  BFA_ITNIM_OFFLINE = 0, /* offline */
440  BFA_ITNIM_PRLI_SEND = 1, /* prli send */
441  BFA_ITNIM_PRLI_SENT = 2, /* prli sent */
442  BFA_ITNIM_PRLI_RETRY = 3, /* prli retry */
443  BFA_ITNIM_HCB_ONLINE = 4, /* online callback */
444  BFA_ITNIM_ONLINE = 5, /* online */
445  BFA_ITNIM_HCB_OFFLINE = 6, /* offline callback */
446  BFA_ITNIM_INITIATIOR = 7, /* initiator */
447 };
448 
449 /*
450  * FCS remote port statistics
451  */
453  u32 onlines; /* num rport online */
454  u32 offlines; /* num rport offline */
455  u32 prli_sent; /* num prli sent out */
456  u32 fcxp_alloc_wait;/* num fcxp alloc waits */
457  u32 prli_rsp_err; /* num prli rsp errors */
458  u32 prli_rsp_acc; /* num prli rsp accepts */
459  u32 initiator; /* rport is an initiator */
460  u32 prli_rsp_parse_err; /* prli rsp parsing errors */
461  u32 prli_rsp_rjt; /* num prli rsp rejects */
462  u32 timeout; /* num timeouts detected */
463  u32 sler; /* num sler notification from BFA */
464  u32 rsvd; /* padding for 64 bit alignment */
465 };
466 
467 /*
468  * FCS itnim attributes returned in queries
469  */
471  enum bfa_itnim_state state; /* FCS itnim state */
472  u8 retry; /* data retransmision support */
473  u8 task_retry_id; /* task retry ident support */
474  u8 rec_support; /* REC supported */
475  u8 conf_comp; /* confirmed completion supp */
476 };
477 
478 #endif /* __BFA_DEFS_FCS_H__ */