VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / scsi / qla2xxx / qla_gbl.h
1 /********************************************************************************
2 *                  QLOGIC LINUX SOFTWARE
3 *
4 * QLogic ISP2x00 device driver for Linux 2.6.x
5 * Copyright (C) 2003-2004 QLogic Corporation
6 * (www.qlogic.com)
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 * General Public License for more details.
17 *
18 ******************************************************************************
19 * Global include file.
20 ******************************************************************************/
21
22
23 #ifndef __QLA_GBL_H
24 #define __QLA_GBL_H
25
26 #include <linux/interrupt.h>
27
28 extern void qla2x00_remove_one(struct pci_dev *);
29 extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *);
30
31 /*
32  * Global Function Prototypes in qla_init.c source file.
33  */
34 extern int qla2x00_initialize_adapter(scsi_qla_host_t *);
35 extern fc_port_t *qla2x00_alloc_fcport(scsi_qla_host_t *, int);
36
37 extern int qla2x00_loop_resync(scsi_qla_host_t *);
38
39 extern int qla2x00_find_new_loop_id(scsi_qla_host_t *, fc_port_t *);
40 extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *);
41 extern int qla2x00_local_device_login(scsi_qla_host_t *, uint16_t);
42
43 extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t);
44
45 extern void qla2x00_rescan_fcports(scsi_qla_host_t *);
46
47 extern void qla2x00_tgt_free(scsi_qla_host_t *ha, uint16_t t);
48 extern os_tgt_t *qla2x00_tgt_alloc(scsi_qla_host_t *, uint16_t);
49 extern os_lun_t * qla2x00_lun_alloc(scsi_qla_host_t *, uint16_t, uint16_t);
50
51 extern int qla2x00_abort_isp(scsi_qla_host_t *);
52
53
54 /*
55  * Global Data in qla_os.c source file.
56  */
57 extern char qla2x00_version_str[];
58
59 extern int num_hosts;
60 extern int apiHBAInstance;
61
62 extern struct _qla2x00stats qla2x00_stats;
63 extern int ql2xretrycount;
64 extern int ql2xlogintimeout;
65 extern int qlport_down_retry;
66 extern int ql2xmaxqdepth;
67 extern int displayConfig;
68 extern int ql2xplogiabsentdevice;
69 extern int ql2xenablezio;
70 extern int ql2xintrdelaytimer;
71 extern int ql2xloginretrycount;
72
73 extern int ConfigRequired;
74
75 extern int Bind;
76 extern int ql2xsuspendcount;
77 #if defined(MODULE)
78 extern char *ql2xopts;
79 #endif
80
81 extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
82
83 extern void qla2x00_cmd_timeout(srb_t *);
84
85 extern int qla2x00_queuecommand(struct scsi_cmnd *,
86     void (*)(struct scsi_cmnd *));
87
88 extern int __qla2x00_suspend_lun(scsi_qla_host_t *, os_lun_t *, int, int, int);
89
90 extern void qla2x00_done(scsi_qla_host_t *);
91 extern void qla2x00_next(scsi_qla_host_t *);
92 extern void qla2x00_flush_failover_q(scsi_qla_host_t *, os_lun_t *);
93 extern void qla2x00_reset_lun_fo_counts(scsi_qla_host_t *, os_lun_t *);
94
95 extern int qla2x00_check_tgt_status(scsi_qla_host_t *, struct scsi_cmnd *);
96 extern int qla2x00_check_port_status(scsi_qla_host_t *, fc_port_t *);
97
98 extern void qla2x00_extend_timeout(struct scsi_cmnd *, int);
99 extern srb_t * qla2x00_get_new_sp (scsi_qla_host_t *ha);
100
101 extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int);
102 extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *);
103
104 extern int qla2x00_get_prop_xstr(scsi_qla_host_t *, char *, uint8_t *, int);
105
106 extern void qla2x00_abort_queues(scsi_qla_host_t *, uint8_t);
107
108 extern void qla2x00_blink_led(scsi_qla_host_t *);
109
110 extern int qla2x00_down_timeout(struct semaphore *, unsigned long);
111
112 /*
113  * Global Function Prototypes in qla_iocb.c source file.
114  */
115 extern request_t *qla2x00_req_pkt(scsi_qla_host_t *);
116 extern request_t *qla2x00_ms_req_pkt(scsi_qla_host_t *, srb_t *);
117 extern void qla2x00_isp_cmd(scsi_qla_host_t *);
118
119 extern uint16_t qla2x00_calc_iocbs_32(uint16_t);
120 extern uint16_t qla2x00_calc_iocbs_64(uint16_t);
121 extern void qla2x00_build_scsi_iocbs_32(srb_t *, cmd_entry_t *, uint16_t);
122 extern void qla2x00_build_scsi_iocbs_64(srb_t *, cmd_entry_t *, uint16_t);
123 extern int qla2x00_start_scsi(srb_t *sp);
124 int qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
125 int __qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
126
127 /*
128  * Global Function Prototypes in qla_mbx.c source file.
129  */
130 extern int
131 qla2x00_mailbox_command(scsi_qla_host_t *, mbx_cmd_t *);
132
133 extern int
134 qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t);
135
136 extern int
137 qla2x00_load_ram_ext(scsi_qla_host_t *, dma_addr_t, uint32_t, uint16_t);
138
139 extern int
140 qla2x00_execute_fw(scsi_qla_host_t *);
141
142 extern void
143 qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *,
144     uint16_t *, uint16_t *, uint16_t *, uint32_t *);
145
146 extern int
147 qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *);
148
149 extern int
150 qla2x00_set_fw_options(scsi_qla_host_t *, uint16_t *);
151
152 extern int
153 qla2x00_read_ram_word(scsi_qla_host_t *, uint16_t, uint16_t *);
154 extern int
155 qla2x00_write_ram_word(scsi_qla_host_t *, uint16_t, uint16_t);
156 extern int
157 qla2x00_write_ram_word_ext(scsi_qla_host_t *, uint32_t, uint16_t);
158
159 extern int
160 qla2x00_mbx_reg_test(scsi_qla_host_t *);
161
162 extern int
163 qla2x00_verify_checksum(scsi_qla_host_t *);
164
165 extern int
166 qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);
167
168 extern int
169 qla2x00_abort_command(scsi_qla_host_t *, srb_t *);
170
171 extern int
172 qla2x00_abort_device(scsi_qla_host_t *, uint16_t, uint16_t);
173
174 #if USE_ABORT_TGT
175 extern int
176 qla2x00_abort_target(fc_port_t *fcport);
177 #endif
178
179 extern int
180 qla2x00_target_reset(scsi_qla_host_t *, uint16_t, uint16_t);
181
182 extern int
183 qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
184     uint8_t *, uint16_t *);
185
186 extern int
187 qla2x00_get_retry_cnt(scsi_qla_host_t *, uint8_t *, uint8_t *, uint16_t *);
188
189 extern int
190 qla2x00_init_firmware(scsi_qla_host_t *, uint16_t);
191
192 extern int
193 qla2x00_get_port_database(scsi_qla_host_t *, fc_port_t *, uint8_t);
194
195 extern int
196 qla2x00_get_firmware_state(scsi_qla_host_t *, uint16_t *);
197
198 extern int
199 qla2x00_get_port_name(scsi_qla_host_t *, uint16_t, uint8_t *, uint8_t);
200
201 extern uint8_t
202 qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, link_stat_t *, uint16_t *);
203
204 extern int
205 qla2x00_lip_reset(scsi_qla_host_t *);
206
207 extern int
208 qla2x00_send_sns(scsi_qla_host_t *, dma_addr_t, uint16_t, size_t);
209
210 extern int
211 qla2x00_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
212     uint16_t *, uint8_t);
213
214 extern int
215 qla2x00_login_local_device(scsi_qla_host_t *, uint16_t, uint16_t *, uint8_t);
216
217 extern int
218 qla2x00_fabric_logout(scsi_qla_host_t *ha, uint16_t loop_id);
219
220 extern int
221 qla2x00_full_login_lip(scsi_qla_host_t *ha);
222
223 extern int
224 qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *);
225
226 extern int
227 qla2x00_lun_reset(scsi_qla_host_t *, uint16_t, uint16_t);
228
229 extern int
230 qla2x00_send_rnid_mbx(scsi_qla_host_t *, uint16_t, uint8_t, dma_addr_t,
231     size_t, uint16_t *);
232
233 extern int
234 qla2x00_set_rnid_params_mbx(scsi_qla_host_t *, dma_addr_t, size_t, uint16_t *);
235
236 extern int
237 qla2x00_get_rnid_params_mbx(scsi_qla_host_t *, dma_addr_t, size_t, uint16_t *);
238
239 extern int
240 qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *,
241     uint16_t *);
242
243 extern int
244 qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map);
245
246 /*
247  * Global Function Prototypes in qla_isr.c source file.
248  */
249 extern irqreturn_t qla2x00_intr_handler(int, void *, struct pt_regs *);
250 extern void qla2x00_process_response_queue(struct scsi_qla_host *);
251
252 /*
253  * Global Function Prototypes in qla_sup.c source file.
254  */
255 extern void qla2x00_lock_nvram_access(scsi_qla_host_t *);
256 extern void qla2x00_unlock_nvram_access(scsi_qla_host_t *);
257 extern uint16_t qla2x00_get_nvram_word(scsi_qla_host_t *, uint32_t);
258 extern void qla2x00_write_nvram_word(scsi_qla_host_t *, uint32_t, uint16_t);
259 /*
260  * Global Function Prototypes in qla_dbg.c source file.
261  */
262 extern void qla2100_fw_dump(scsi_qla_host_t *, int);
263 extern void qla2300_fw_dump(scsi_qla_host_t *, int);
264 extern void qla2100_ascii_fw_dump(scsi_qla_host_t *);
265 extern void qla2300_ascii_fw_dump(scsi_qla_host_t *);
266 extern void qla2x00_dump_regs(scsi_qla_host_t *);
267 extern void qla2x00_dump_buffer(uint8_t *, uint32_t);
268 extern void qla2x00_print_scsi_cmd(struct scsi_cmnd *);
269
270 /*
271  * Global Function Prototypes in qla_gs.c source file.
272  */
273 extern int qla2x00_ga_nxt(scsi_qla_host_t *, fc_port_t *);
274 extern int qla2x00_gid_pt(scsi_qla_host_t *, sw_info_t *);
275 extern int qla2x00_gpn_id(scsi_qla_host_t *, sw_info_t *);
276 extern int qla2x00_gnn_id(scsi_qla_host_t *, sw_info_t *);
277 extern int qla2x00_rft_id(scsi_qla_host_t *);
278 extern int qla2x00_rff_id(scsi_qla_host_t *);
279 extern int qla2x00_rnn_id(scsi_qla_host_t *);
280 extern int qla2x00_rsnn_nn(scsi_qla_host_t *);
281
282 /*
283  * Global Function Prototypes in qla_rscn.c source file.
284  */
285 extern fc_port_t *qla2x00_alloc_rscn_fcport(scsi_qla_host_t *, int);
286 extern int qla2x00_handle_port_rscn(scsi_qla_host_t *, uint32_t, fc_port_t *,
287     int);
288 extern void qla2x00_process_iodesc(scsi_qla_host_t *, struct mbx_entry *);
289 extern void qla2x00_cancel_io_descriptors(scsi_qla_host_t *);
290
291 /*
292  * Global Function Prototypes in qla_xioctl.c source file.
293  */
294 #define qla2x00_enqueue_aen(ha, cmd, mode)      do { } while (0)
295 #define qla2x00_alloc_ioctl_mem(ha)             (0)
296 #define qla2x00_free_ioctl_mem(ha)              do { } while (0)
297
298 #endif /* _QLA_GBL_H */