aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_fcpim.h
diff options
context:
space:
mode:
authorMaggie Zhang <xmzhang@brocade.com>2010-12-09 22:13:20 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-12-21 13:32:58 -0500
commitda99dcc98dd66a2de4864645bcafffd93cf5a62f (patch)
treeda6286a7f91f2087f916f6949dbd67d46570fe58 /drivers/scsi/bfa/bfa_fcpim.h
parentf16a17507b09e10e0cccc4d675ccbfe030d51ef1 (diff)
[SCSI] bfa: remove unused functions and misc cleanups
Remove unused functions and fix checkpatch errors. Misc cleanups in comment and formatting. Signed-off-by: Maggie Zhang <xmzhang@brocade.com> Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcpim.h')
-rw-r--r--drivers/scsi/bfa/bfa_fcpim.h158
1 files changed, 57 insertions, 101 deletions
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
index 7d0eababa5df..f9334587e02a 100644
--- a/drivers/scsi/bfa/bfa_fcpim.h
+++ b/drivers/scsi/bfa/bfa_fcpim.h
@@ -94,12 +94,12 @@ struct bfa_fcpim_mod_s {
94 struct list_head ioim_resfree_q; /* IOs waiting for f/w */ 94 struct list_head ioim_resfree_q; /* IOs waiting for f/w */
95 struct list_head ioim_comp_q; /* IO global comp Q */ 95 struct list_head ioim_comp_q; /* IO global comp Q */
96 struct list_head tskim_free_q; 96 struct list_head tskim_free_q;
97 u32 ios_active; /* current active IOs */ 97 u32 ios_active; /* current active IOs */
98 u32 delay_comp; 98 u32 delay_comp;
99 struct bfa_fcpim_del_itn_stats_s del_itn_stats; 99 struct bfa_fcpim_del_itn_stats_s del_itn_stats;
100 bfa_boolean_t ioredirect; 100 bfa_boolean_t ioredirect;
101 bfa_boolean_t io_profile; 101 bfa_boolean_t io_profile;
102 u32 io_profile_start_time; 102 u32 io_profile_start_time;
103 bfa_fcpim_profile_t profile_comp; 103 bfa_fcpim_profile_t profile_comp;
104 bfa_fcpim_profile_t profile_start; 104 bfa_fcpim_profile_t profile_start;
105}; 105};
@@ -114,25 +114,24 @@ struct bfa_ioim_s {
114 struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */ 114 struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */
115 struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */ 115 struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */
116 struct bfad_ioim_s *dio; /* driver IO handle */ 116 struct bfad_ioim_s *dio; /* driver IO handle */
117 u16 iotag; /* FWI IO tag */ 117 u16 iotag; /* FWI IO tag */
118 u16 abort_tag; /* unqiue abort request tag */ 118 u16 abort_tag; /* unqiue abort request tag */
119 u16 nsges; /* number of SG elements */ 119 u16 nsges; /* number of SG elements */
120 u16 nsgpgs; /* number of SG pages */ 120 u16 nsgpgs; /* number of SG pages */
121 struct bfa_sgpg_s *sgpg; /* first SG page */ 121 struct bfa_sgpg_s *sgpg; /* first SG page */
122 struct list_head sgpg_q; /* allocated SG pages */ 122 struct list_head sgpg_q; /* allocated SG pages */
123 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */ 123 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */
124 bfa_cb_cbfn_t io_cbfn; /* IO completion handler */ 124 bfa_cb_cbfn_t io_cbfn; /* IO completion handler */
125 struct bfa_ioim_sp_s *iosp; /* slow-path IO handling */ 125 struct bfa_ioim_sp_s *iosp; /* slow-path IO handling */
126 u8 reqq; /* Request queue for I/O */ 126 u8 reqq; /* Request queue for I/O */
127 u64 start_time; /* IO's Profile start val */ 127 u64 start_time; /* IO's Profile start val */
128}; 128};
129 129
130
131struct bfa_ioim_sp_s { 130struct bfa_ioim_sp_s {
132 struct bfi_msg_s comp_rspmsg; /* IO comp f/w response */ 131 struct bfi_msg_s comp_rspmsg; /* IO comp f/w response */
133 u8 *snsinfo; /* sense info for this IO */ 132 u8 *snsinfo; /* sense info for this IO */
134 struct bfa_sgpg_wqe_s sgpg_wqe; /* waitq elem for sgpg */ 133 struct bfa_sgpg_wqe_s sgpg_wqe; /* waitq elem for sgpg */
135 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */ 134 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */
136 bfa_boolean_t abort_explicit; /* aborted by OS */ 135 bfa_boolean_t abort_explicit; /* aborted by OS */
137 struct bfa_tskim_s *tskim; /* Relevant TM cmd */ 136 struct bfa_tskim_s *tskim; /* Relevant TM cmd */
138}; 137};
@@ -143,35 +142,34 @@ struct bfa_ioim_sp_s {
143struct bfa_tskim_s { 142struct bfa_tskim_s {
144 struct list_head qe; 143 struct list_head qe;
145 bfa_sm_t sm; 144 bfa_sm_t sm;
146 struct bfa_s *bfa; /* BFA module */ 145 struct bfa_s *bfa; /* BFA module */
147 struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */ 146 struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */
148 struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */ 147 struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */
149 struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */ 148 struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */
150 bfa_boolean_t notify; /* notify itnim on TM comp */ 149 bfa_boolean_t notify; /* notify itnim on TM comp */
151 struct scsi_lun lun; /* lun if applicable */ 150 struct scsi_lun lun; /* lun if applicable */
152 enum fcp_tm_cmnd tm_cmnd; /* task management command */ 151 enum fcp_tm_cmnd tm_cmnd; /* task management command */
153 u16 tsk_tag; /* FWI IO tag */ 152 u16 tsk_tag; /* FWI IO tag */
154 u8 tsecs; /* timeout in seconds */ 153 u8 tsecs; /* timeout in seconds */
155 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */ 154 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */
156 struct list_head io_q; /* queue of affected IOs */ 155 struct list_head io_q; /* queue of affected IOs */
157 struct bfa_wc_s wc; /* waiting counter */ 156 struct bfa_wc_s wc; /* waiting counter */
158 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */ 157 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */
159 enum bfi_tskim_status tsk_status; /* TM status */ 158 enum bfi_tskim_status tsk_status; /* TM status */
160}; 159};
161 160
162
163/* 161/*
164 * BFA i-t-n (initiator mode) 162 * BFA i-t-n (initiator mode)
165 */ 163 */
166struct bfa_itnim_s { 164struct bfa_itnim_s {
167 struct list_head qe; /* queue element */ 165 struct list_head qe; /* queue element */
168 bfa_sm_t sm; /* i-t-n im BFA state machine */ 166 bfa_sm_t sm; /* i-t-n im BFA state machine */
169 struct bfa_s *bfa; /* bfa instance */ 167 struct bfa_s *bfa; /* bfa instance */
170 struct bfa_rport_s *rport; /* bfa rport */ 168 struct bfa_rport_s *rport; /* bfa rport */
171 void *ditn; /* driver i-t-n structure */ 169 void *ditn; /* driver i-t-n structure */
172 struct bfi_mhdr_s mhdr; /* pre-built mhdr */ 170 struct bfi_mhdr_s mhdr; /* pre-built mhdr */
173 u8 msg_no; /* itnim/rport firmware handle */ 171 u8 msg_no; /* itnim/rport firmware handle */
174 u8 reqq; /* CQ for requests */ 172 u8 reqq; /* CQ for requests */
175 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */ 173 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */
176 struct list_head pending_q; /* queue of pending IO requests */ 174 struct list_head pending_q; /* queue of pending IO requests */
177 struct list_head io_q; /* queue of active IO requests */ 175 struct list_head io_q; /* queue of active IO requests */
@@ -181,15 +179,14 @@ struct bfa_itnim_s {
181 bfa_boolean_t seq_rec; /* SQER supported */ 179 bfa_boolean_t seq_rec; /* SQER supported */
182 bfa_boolean_t is_online; /* itnim is ONLINE for IO */ 180 bfa_boolean_t is_online; /* itnim is ONLINE for IO */
183 bfa_boolean_t iotov_active; /* IO TOV timer is active */ 181 bfa_boolean_t iotov_active; /* IO TOV timer is active */
184 struct bfa_wc_s wc; /* waiting counter */ 182 struct bfa_wc_s wc; /* waiting counter */
185 struct bfa_timer_s timer; /* pending IO TOV */ 183 struct bfa_timer_s timer; /* pending IO TOV */
186 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */ 184 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */
187 struct bfa_fcpim_mod_s *fcpim; /* fcpim module */ 185 struct bfa_fcpim_mod_s *fcpim; /* fcpim module */
188 struct bfa_itnim_iostats_s stats; 186 struct bfa_itnim_iostats_s stats;
189 struct bfa_itnim_ioprofile_s ioprofile; 187 struct bfa_itnim_ioprofile_s ioprofile;
190}; 188};
191 189
192
193#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online) 190#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online)
194#define BFA_FCPIM_MOD(_hal) (&(_hal)->modules.fcpim_mod) 191#define BFA_FCPIM_MOD(_hal) (&(_hal)->modules.fcpim_mod)
195#define BFA_IOIM_FROM_TAG(_fcpim, _iotag) \ 192#define BFA_IOIM_FROM_TAG(_fcpim, _iotag) \
@@ -246,32 +243,14 @@ void bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
246void bfa_itnim_iodone(struct bfa_itnim_s *itnim); 243void bfa_itnim_iodone(struct bfa_itnim_s *itnim);
247void bfa_itnim_tskdone(struct bfa_itnim_s *itnim); 244void bfa_itnim_tskdone(struct bfa_itnim_s *itnim);
248bfa_boolean_t bfa_itnim_hold_io(struct bfa_itnim_s *itnim); 245bfa_boolean_t bfa_itnim_hold_io(struct bfa_itnim_s *itnim);
249void bfa_ioim_profile_comp(struct bfa_ioim_s *ioim);
250void bfa_ioim_profile_start(struct bfa_ioim_s *ioim);
251
252 246
253/* 247/*
254 * bfa fcpim module API functions 248 * bfa fcpim module API functions
255 */ 249 */
256void bfa_fcpim_path_tov_set(struct bfa_s *bfa, u16 path_tov); 250void bfa_fcpim_path_tov_set(struct bfa_s *bfa, u16 path_tov);
257u16 bfa_fcpim_path_tov_get(struct bfa_s *bfa); 251u16 bfa_fcpim_path_tov_get(struct bfa_s *bfa);
258void bfa_fcpim_qdepth_set(struct bfa_s *bfa, u16 q_depth);
259u16 bfa_fcpim_qdepth_get(struct bfa_s *bfa); 252u16 bfa_fcpim_qdepth_get(struct bfa_s *bfa);
260bfa_status_t bfa_fcpim_get_modstats(struct bfa_s *bfa, 253
261 struct bfa_itnim_iostats_s *modstats);
262bfa_status_t bfa_fcpim_port_iostats(struct bfa_s *bfa,
263 struct bfa_itnim_iostats_s *stats, u8 lp_tag);
264bfa_status_t bfa_fcpim_get_del_itn_stats(struct bfa_s *bfa,
265 struct bfa_fcpim_del_itn_stats_s *modstats);
266bfa_status_t bfa_fcpim_port_clear_iostats(struct bfa_s *bfa, u8 lp_tag);
267void bfa_fcpim_add_stats(struct bfa_itnim_iostats_s *fcpim_stats,
268 struct bfa_itnim_iostats_s *itnim_stats);
269bfa_status_t bfa_fcpim_clr_modstats(struct bfa_s *bfa);
270void bfa_fcpim_set_ioredirect(struct bfa_s *bfa,
271 bfa_boolean_t state);
272void bfa_fcpim_update_ioredirect(struct bfa_s *bfa);
273bfa_status_t bfa_fcpim_profile_on(struct bfa_s *bfa, u32 time);
274bfa_status_t bfa_fcpim_profile_off(struct bfa_s *bfa);
275#define bfa_fcpim_ioredirect_enabled(__bfa) \ 254#define bfa_fcpim_ioredirect_enabled(__bfa) \
276 (((struct bfa_fcpim_mod_s *)(BFA_FCPIM_MOD(__bfa)))->ioredirect) 255 (((struct bfa_fcpim_mod_s *)(BFA_FCPIM_MOD(__bfa)))->ioredirect)
277 256
@@ -289,46 +268,33 @@ bfa_status_t bfa_fcpim_profile_off(struct bfa_s *bfa);
289 * bfa itnim API functions 268 * bfa itnim API functions
290 */ 269 */
291struct bfa_itnim_s *bfa_itnim_create(struct bfa_s *bfa, 270struct bfa_itnim_s *bfa_itnim_create(struct bfa_s *bfa,
292 struct bfa_rport_s *rport, void *itnim); 271 struct bfa_rport_s *rport, void *itnim);
293void bfa_itnim_delete(struct bfa_itnim_s *itnim); 272void bfa_itnim_delete(struct bfa_itnim_s *itnim);
294void bfa_itnim_online(struct bfa_itnim_s *itnim, 273void bfa_itnim_online(struct bfa_itnim_s *itnim, bfa_boolean_t seq_rec);
295 bfa_boolean_t seq_rec); 274void bfa_itnim_offline(struct bfa_itnim_s *itnim);
296void bfa_itnim_offline(struct bfa_itnim_s *itnim); 275void bfa_itnim_clear_stats(struct bfa_itnim_s *itnim);
297void bfa_itnim_clear_stats(struct bfa_itnim_s *itnim); 276bfa_status_t bfa_itnim_get_ioprofile(struct bfa_itnim_s *itnim,
298bfa_status_t bfa_itnim_get_ioprofile(struct bfa_itnim_s *itnim, 277 struct bfa_itnim_ioprofile_s *ioprofile);
299 struct bfa_itnim_ioprofile_s *ioprofile); 278
300#define bfa_itnim_get_reqq(__ioim) (((struct bfa_ioim_s *)__ioim)->itnim->reqq) 279#define bfa_itnim_get_reqq(__ioim) (((struct bfa_ioim_s *)__ioim)->itnim->reqq)
301 280
302/* 281/*
303 * BFA completion callback for bfa_itnim_online(). 282 * BFA completion callback for bfa_itnim_online().
304 *
305 * @param[in] itnim FCS or driver itnim instance
306 *
307 * return None
308 */ 283 */
309void bfa_cb_itnim_online(void *itnim); 284void bfa_cb_itnim_online(void *itnim);
310 285
311/* 286/*
312 * BFA completion callback for bfa_itnim_offline(). 287 * BFA completion callback for bfa_itnim_offline().
313 *
314 * @param[in] itnim FCS or driver itnim instance
315 *
316 * return None
317 */ 288 */
318void bfa_cb_itnim_offline(void *itnim); 289void bfa_cb_itnim_offline(void *itnim);
319void bfa_cb_itnim_tov_begin(void *itnim); 290void bfa_cb_itnim_tov_begin(void *itnim);
320void bfa_cb_itnim_tov(void *itnim); 291void bfa_cb_itnim_tov(void *itnim);
321 292
322/* 293/*
323 * BFA notification to FCS/driver for second level error recovery. 294 * BFA notification to FCS/driver for second level error recovery.
324 *
325 * Atleast one I/O request has timedout and target is unresponsive to 295 * Atleast one I/O request has timedout and target is unresponsive to
326 * repeated abort requests. Second level error recovery should be initiated 296 * repeated abort requests. Second level error recovery should be initiated
327 * by starting implicit logout and recovery procedures. 297 * by starting implicit logout and recovery procedures.
328 *
329 * @param[in] itnim FCS or driver itnim instance
330 *
331 * return None
332 */ 298 */
333void bfa_cb_itnim_sler(void *itnim); 299void bfa_cb_itnim_sler(void *itnim);
334 300
@@ -345,10 +311,8 @@ void bfa_ioim_start(struct bfa_ioim_s *ioim);
345bfa_status_t bfa_ioim_abort(struct bfa_ioim_s *ioim); 311bfa_status_t bfa_ioim_abort(struct bfa_ioim_s *ioim);
346void bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, 312void bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
347 bfa_boolean_t iotov); 313 bfa_boolean_t iotov);
348
349
350/* 314/*
351 * I/O completion notification. 315 * I/O completion notification.
352 * 316 *
353 * @param[in] dio driver IO structure 317 * @param[in] dio driver IO structure
354 * @param[in] io_status IO completion status 318 * @param[in] io_status IO completion status
@@ -359,39 +323,31 @@ void bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
359 * 323 *
360 * @return None 324 * @return None
361 */ 325 */
362void bfa_cb_ioim_done(void *bfad, struct bfad_ioim_s *dio, 326void bfa_cb_ioim_done(void *bfad, struct bfad_ioim_s *dio,
363 enum bfi_ioim_status io_status, 327 enum bfi_ioim_status io_status,
364 u8 scsi_status, int sns_len, 328 u8 scsi_status, int sns_len,
365 u8 *sns_info, s32 residue); 329 u8 *sns_info, s32 residue);
366 330
367/* 331/*
368 * I/O good completion notification. 332 * I/O good completion notification.
369 *
370 * @param[in] dio driver IO structure
371 *
372 * @return None
373 */ 333 */
374void bfa_cb_ioim_good_comp(void *bfad, struct bfad_ioim_s *dio); 334void bfa_cb_ioim_good_comp(void *bfad, struct bfad_ioim_s *dio);
375 335
376/* 336/*
377 * I/O abort completion notification 337 * I/O abort completion notification
378 *
379 * @param[in] dio driver IO that was aborted
380 *
381 * @return None
382 */ 338 */
383void bfa_cb_ioim_abort(void *bfad, struct bfad_ioim_s *dio); 339void bfa_cb_ioim_abort(void *bfad, struct bfad_ioim_s *dio);
384 340
385/* 341/*
386 * bfa tskim API functions 342 * bfa tskim API functions
387 */ 343 */
388struct bfa_tskim_s *bfa_tskim_alloc(struct bfa_s *bfa, 344struct bfa_tskim_s *bfa_tskim_alloc(struct bfa_s *bfa,
389 struct bfad_tskim_s *dtsk); 345 struct bfad_tskim_s *dtsk);
390void bfa_tskim_free(struct bfa_tskim_s *tskim); 346void bfa_tskim_free(struct bfa_tskim_s *tskim);
391void bfa_tskim_start(struct bfa_tskim_s *tskim, 347void bfa_tskim_start(struct bfa_tskim_s *tskim,
392 struct bfa_itnim_s *itnim, struct scsi_lun lun, 348 struct bfa_itnim_s *itnim, struct scsi_lun lun,
393 enum fcp_tm_cmnd tm, u8 t_secs); 349 enum fcp_tm_cmnd tm, u8 t_secs);
394void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk, 350void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk,
395 enum bfi_tskim_status tsk_status); 351 enum bfi_tskim_status tsk_status);
396 352
397#endif /* __BFA_FCPIM_H__ */ 353#endif /* __BFA_FCPIM_H__ */