ath9k: remove unneeded calculation of minimal calibration power
[linux-2.6/next.git] / drivers / scsi / bfa / include / bfa_fcpim.h
blob04789795fa5335ed95d8b6f7da4c159b9e9fb09c
1 /*
2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
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__
21 #include <bfa.h>
22 #include <bfa_svc.h>
23 #include <bfi/bfi_fcpim.h>
24 #include <defs/bfa_defs_fcpim.h>
27 * forward declarations
29 struct bfa_itnim_s;
30 struct bfa_ioim_s;
31 struct bfa_tskim_s;
32 struct bfad_ioim_s;
33 struct bfad_tskim_s;
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);
60 /**
61 * BFA completion callback for bfa_itnim_online().
63 * @param[in] itnim FCS or driver itnim instance
65 * return None
67 void bfa_cb_itnim_online(void *itnim);
69 /**
70 * BFA completion callback for bfa_itnim_offline().
72 * @param[in] itnim FCS or driver itnim instance
74 * return None
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);
80 /**
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
89 * return None
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,
99 u16 nsgles);
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
118 * @return None
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
130 * @return None
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
139 * @return None
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__ */