summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h
blob: e719f2c3eb35eee07c9469dc932503e477165942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
 * All rights reserved
 * www.brocade.com
 *
 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License (GPL) Version 2 as
 * published by the Free Software Foundation
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */

/**
 *  bfa_fcs_fcpim.h BFA FCS FCP Initiator Mode interfaces/defines.
 */

#ifndef __BFA_FCS_FCPIM_H__
#define __BFA_FCS_FCPIM_H__

#include <defs/bfa_defs_status.h>
#include <defs/bfa_defs_itnim.h>
#include <fcs/bfa_fcs.h>
#include <fcs/bfa_fcs_rport.h>
#include <fcs/bfa_fcs_lport.h>
#include <bfa_fcpim.h>

/*
 * forward declarations
 */
struct bfad_itnim_s;

struct bfa_fcs_itnim_s {
	bfa_sm_t		sm;		/*  state machine */
	struct bfa_fcs_rport_s 	*rport;		/*  parent remote rport  */
	struct bfad_itnim_s   	*itnim_drv;	/*  driver peer instance */
	struct bfa_fcs_s      	*fcs;		/*  fcs instance         */
	struct bfa_timer_s 	timer;		/*  timer functions      */
	struct bfa_itnim_s 	*bfa_itnim;	/*  BFA itnim struct     */
	bfa_boolean_t	 	seq_rec;	/*  seq recovery support */
	bfa_boolean_t	 	rec_support;	/*  REC supported        */
	bfa_boolean_t	 	conf_comp;	/*  FCP_CONF     support */
	bfa_boolean_t	 	task_retry_id;	/*  task retry id supp   */
	struct bfa_fcxp_wqe_s 	fcxp_wqe;	/*  wait qelem for fcxp  */
	struct bfa_fcxp_s *fcxp;		/*  FCXP in use          */
	struct bfa_itnim_stats_s 	stats;	/*  itn statistics       */
};


static inline struct bfad_port_s *
bfa_fcs_itnim_get_drvport(struct bfa_fcs_itnim_s *itnim)
{
	return itnim->rport->port->bfad_port;
}


static inline struct bfa_fcs_port_s *
bfa_fcs_itnim_get_port(struct bfa_fcs_itnim_s *itnim)
{
	return itnim->rport->port;
}


static inline wwn_t
bfa_fcs_itnim_get_nwwn(struct bfa_fcs_itnim_s *itnim)
{
	return itnim->rport->nwwn;
}


static inline wwn_t
bfa_fcs_itnim_get_pwwn(struct bfa_fcs_itnim_s *itnim)
{
	return itnim->rport->pwwn;
}


static inline u32
bfa_fcs_itnim_get_fcid(struct bfa_fcs_itnim_s *itnim)
{
	return itnim->rport->pid;
}


static inline   u32
bfa_fcs_itnim_get_maxfrsize(struct bfa_fcs_itnim_s *itnim)
{
	return itnim->rport->maxfrsize;
}


static inline   enum fc_cos
bfa_fcs_itnim_get_cos(struct bfa_fcs_itnim_s *itnim)
{
	return itnim->rport->fc_cos;
}


static inline struct bfad_itnim_s *
bfa_fcs_itnim_get_drvitn(struct bfa_fcs_itnim_s *itnim)
{
	return itnim->itnim_drv;
}


static inline struct bfa_itnim_s *
bfa_fcs_itnim_get_halitn(struct bfa_fcs_itnim_s *itnim)
{
	return itnim->bfa_itnim;
}

/**
 * bfa fcs FCP Initiator mode API functions
 */
void bfa_fcs_itnim_get_attr(struct bfa_fcs_itnim_s *itnim,
			struct bfa_itnim_attr_s *attr);
void bfa_fcs_itnim_get_stats(struct bfa_fcs_itnim_s *itnim,
			struct bfa_itnim_stats_s *stats);
struct bfa_fcs_itnim_s *bfa_fcs_itnim_lookup(struct bfa_fcs_port_s *port,
			wwn_t rpwwn);
bfa_status_t bfa_fcs_itnim_attr_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
			struct bfa_itnim_attr_s *attr);
bfa_status_t bfa_fcs_itnim_stats_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
			struct bfa_itnim_stats_s *stats);
bfa_status_t bfa_fcs_itnim_stats_clear(struct bfa_fcs_port_s *port,
			wwn_t rpwwn);
#endif /* __BFA_FCS_FCPIM_H__ */