2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
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
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.
19 * bfa_fcs_fcpim.h BFA FCS FCP Initiator Mode interfaces/defines.
22 #ifndef __BFA_FCS_FCPIM_H__
23 #define __BFA_FCS_FCPIM_H__
25 #include <defs/bfa_defs_status.h>
26 #include <defs/bfa_defs_itnim.h>
27 #include <fcs/bfa_fcs.h>
28 #include <fcs/bfa_fcs_rport.h>
29 #include <fcs/bfa_fcs_lport.h>
30 #include <bfa_fcpim.h>
33 * forward declarations
37 struct bfa_fcs_itnim_s {
38 bfa_sm_t sm; /* state machine */
39 struct bfa_fcs_rport_s *rport; /* parent remote rport */
40 struct bfad_itnim_s *itnim_drv; /* driver peer instance */
41 struct bfa_fcs_s *fcs; /* fcs instance */
42 struct bfa_timer_s timer; /* timer functions */
43 struct bfa_itnim_s *bfa_itnim; /* BFA itnim struct */
44 u32 prli_retries; /* max prli retry attempts */
45 bfa_boolean_t seq_rec; /* seq recovery support */
46 bfa_boolean_t rec_support; /* REC supported */
47 bfa_boolean_t conf_comp; /* FCP_CONF support */
48 bfa_boolean_t task_retry_id; /* task retry id supp */
49 struct bfa_fcxp_wqe_s fcxp_wqe; /* wait qelem for fcxp */
50 struct bfa_fcxp_s *fcxp; /* FCXP in use */
51 struct bfa_itnim_stats_s stats; /* itn statistics */
55 static inline struct bfad_port_s *
56 bfa_fcs_itnim_get_drvport(struct bfa_fcs_itnim_s *itnim)
58 return itnim->rport->port->bfad_port;
62 static inline struct bfa_fcs_port_s *
63 bfa_fcs_itnim_get_port(struct bfa_fcs_itnim_s *itnim)
65 return itnim->rport->port;
70 bfa_fcs_itnim_get_nwwn(struct bfa_fcs_itnim_s *itnim)
72 return itnim->rport->nwwn;
77 bfa_fcs_itnim_get_pwwn(struct bfa_fcs_itnim_s *itnim)
79 return itnim->rport->pwwn;
84 bfa_fcs_itnim_get_fcid(struct bfa_fcs_itnim_s *itnim)
86 return itnim->rport->pid;
91 bfa_fcs_itnim_get_maxfrsize(struct bfa_fcs_itnim_s *itnim)
93 return itnim->rport->maxfrsize;
97 static inline enum fc_cos
98 bfa_fcs_itnim_get_cos(struct bfa_fcs_itnim_s *itnim)
100 return itnim->rport->fc_cos;
104 static inline struct bfad_itnim_s *
105 bfa_fcs_itnim_get_drvitn(struct bfa_fcs_itnim_s *itnim)
107 return itnim->itnim_drv;
111 static inline struct bfa_itnim_s *
112 bfa_fcs_itnim_get_halitn(struct bfa_fcs_itnim_s *itnim)
114 return itnim->bfa_itnim;
118 * bfa fcs FCP Initiator mode API functions
120 void bfa_fcs_itnim_get_attr(struct bfa_fcs_itnim_s *itnim,
121 struct bfa_itnim_attr_s *attr);
122 void bfa_fcs_itnim_get_stats(struct bfa_fcs_itnim_s *itnim,
123 struct bfa_itnim_stats_s *stats);
124 struct bfa_fcs_itnim_s *bfa_fcs_itnim_lookup(struct bfa_fcs_port_s *port,
126 bfa_status_t bfa_fcs_itnim_attr_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
127 struct bfa_itnim_attr_s *attr);
128 bfa_status_t bfa_fcs_itnim_stats_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
129 struct bfa_itnim_stats_s *stats);
130 bfa_status_t bfa_fcs_itnim_stats_clear(struct bfa_fcs_port_s *port,
132 #endif /* __BFA_FCS_FCPIM_H__ */