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.
18 #ifndef __BFA_FCPIM_H__
19 #define __BFA_FCPIM_H__
23 #include <bfi/bfi_fcpim.h>
24 #include <defs/bfa_defs_fcpim.h>
27 * forward declarations
36 * bfa fcpim module API functions
38 void bfa_fcpim_path_tov_set(struct bfa_s
*bfa
, u16 path_tov
);
39 u16
bfa_fcpim_path_tov_get(struct bfa_s
*bfa
);
40 void bfa_fcpim_qdepth_set(struct bfa_s
*bfa
, u16 q_depth
);
41 u16
bfa_fcpim_qdepth_get(struct bfa_s
*bfa
);
42 bfa_status_t
bfa_fcpim_get_modstats(struct bfa_s
*bfa
,
43 struct bfa_fcpim_stats_s
*modstats
);
44 bfa_status_t
bfa_fcpim_clr_modstats(struct bfa_s
*bfa
);
47 * bfa itnim API functions
49 struct bfa_itnim_s
*bfa_itnim_create(struct bfa_s
*bfa
,
50 struct bfa_rport_s
*rport
, void *itnim
);
51 void bfa_itnim_delete(struct bfa_itnim_s
*itnim
);
52 void bfa_itnim_online(struct bfa_itnim_s
*itnim
,
53 bfa_boolean_t seq_rec
);
54 void bfa_itnim_offline(struct bfa_itnim_s
*itnim
);
55 void bfa_itnim_get_stats(struct bfa_itnim_s
*itnim
,
56 struct bfa_itnim_hal_stats_s
*stats
);
57 void bfa_itnim_clear_stats(struct bfa_itnim_s
*itnim
);
61 * BFA completion callback for bfa_itnim_online().
63 * @param[in] itnim FCS or driver itnim instance
67 void bfa_cb_itnim_online(void *itnim
);
70 * BFA completion callback for bfa_itnim_offline().
72 * @param[in] itnim FCS or driver itnim instance
76 void bfa_cb_itnim_offline(void *itnim
);
77 void bfa_cb_itnim_tov_begin(void *itnim
);
78 void bfa_cb_itnim_tov(void *itnim
);
81 * BFA notification to FCS/driver for second level error recovery.
83 * Atleast one I/O request has timedout and target is unresponsive to
84 * repeated abort requests. Second level error recovery should be initiated
85 * by starting implicit logout and recovery procedures.
87 * @param[in] itnim FCS or driver itnim instance
91 void bfa_cb_itnim_sler(void *itnim
);
94 * bfa ioim API functions
96 struct bfa_ioim_s
*bfa_ioim_alloc(struct bfa_s
*bfa
,
97 struct bfad_ioim_s
*dio
,
98 struct bfa_itnim_s
*itnim
,
101 void bfa_ioim_free(struct bfa_ioim_s
*ioim
);
102 void bfa_ioim_start(struct bfa_ioim_s
*ioim
);
103 void bfa_ioim_abort(struct bfa_ioim_s
*ioim
);
104 void bfa_ioim_delayed_comp(struct bfa_ioim_s
*ioim
,
105 bfa_boolean_t iotov
);
109 * I/O completion notification.
111 * @param[in] dio driver IO structure
112 * @param[in] io_status IO completion status
113 * @param[in] scsi_status SCSI status returned by target
114 * @param[in] sns_len SCSI sense length, 0 if none
115 * @param[in] sns_info SCSI sense data, if any
116 * @param[in] residue Residual length
120 void bfa_cb_ioim_done(void *bfad
, struct bfad_ioim_s
*dio
,
121 enum bfi_ioim_status io_status
,
122 u8 scsi_status
, int sns_len
,
123 u8
*sns_info
, s32 residue
);
126 * I/O good completion notification.
128 * @param[in] dio driver IO structure
132 void bfa_cb_ioim_good_comp(void *bfad
, struct bfad_ioim_s
*dio
);
135 * I/O abort completion notification
137 * @param[in] dio driver IO that was aborted
141 void bfa_cb_ioim_abort(void *bfad
, struct bfad_ioim_s
*dio
);
142 void bfa_cb_ioim_resfree(void *hcb_bfad
);
144 void bfa_cb_ioim_resfree(void *hcb_bfad
);
147 * bfa tskim API functions
149 struct bfa_tskim_s
*bfa_tskim_alloc(struct bfa_s
*bfa
,
150 struct bfad_tskim_s
*dtsk
);
151 void bfa_tskim_free(struct bfa_tskim_s
*tskim
);
152 void bfa_tskim_start(struct bfa_tskim_s
*tskim
,
153 struct bfa_itnim_s
*itnim
, lun_t lun
,
154 enum fcp_tm_cmnd tm
, u8 t_secs
);
155 void bfa_cb_tskim_done(void *bfad
, struct bfad_tskim_s
*dtsk
,
156 enum bfi_tskim_status tsk_status
);
158 #endif /* __BFA_FCPIM_H__ */