blob: 32be4c14cccb50044a77b1c53b5b9be1eb5cc81d [file] [log] [blame]
Andrew Vasquezfa90c542005-10-27 11:10:08 -07001/*
2 * QLogic Fibre Channel HBA Driver
3 * Copyright (c) 2003-2005 QLogic Corporation
4 *
5 * See LICENSE.qla2xxx for copyright and licensing details.
6 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#ifndef __QLA_GBL_H
8#define __QLA_GBL_H
9
10#include <linux/interrupt.h>
11
12extern void qla2x00_remove_one(struct pci_dev *);
13extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *);
14
15/*
16 * Global Function Prototypes in qla_init.c source file.
17 */
18extern int qla2x00_initialize_adapter(scsi_qla_host_t *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070019
20extern int qla2100_pci_config(struct scsi_qla_host *);
21extern int qla2300_pci_config(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070022extern int qla24xx_pci_config(scsi_qla_host_t *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070023extern void qla2x00_reset_chip(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070024extern void qla24xx_reset_chip(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070025extern int qla2x00_chip_diag(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070026extern int qla24xx_chip_diag(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070027extern void qla2x00_config_rings(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070028extern void qla24xx_config_rings(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070029extern void qla2x00_reset_adapter(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070030extern void qla24xx_reset_adapter(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070031extern int qla2x00_nvram_config(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070032extern int qla24xx_nvram_config(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070033extern void qla2x00_update_fw_options(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070034extern void qla24xx_update_fw_options(scsi_qla_host_t *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070035extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *);
Andrew Vasquez54333832005-11-09 15:49:04 -080036extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070037extern int qla24xx_load_risc_flash(scsi_qla_host_t *, uint32_t *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070038
Al Viroc53033f2005-10-21 03:22:08 -040039extern fc_port_t *qla2x00_alloc_fcport(scsi_qla_host_t *, gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
41extern int qla2x00_loop_resync(scsi_qla_host_t *);
42
43extern int qla2x00_find_new_loop_id(scsi_qla_host_t *, fc_port_t *);
44extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *);
45extern int qla2x00_local_device_login(scsi_qla_host_t *, uint16_t);
46
47extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t);
48
49extern void qla2x00_rescan_fcports(scsi_qla_host_t *);
50
Linus Torvalds1da177e2005-04-16 15:20:36 -070051extern int qla2x00_abort_isp(scsi_qla_host_t *);
52
8482e1182005-04-17 15:04:54 -050053extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
54
Linus Torvalds1da177e2005-04-16 15:20:36 -070055/*
56 * Global Data in qla_os.c source file.
57 */
58extern char qla2x00_version_str[];
59
Linus Torvalds1da177e2005-04-16 15:20:36 -070060extern int ql2xlogintimeout;
61extern int qlport_down_retry;
Linus Torvalds1da177e2005-04-16 15:20:36 -070062extern int ql2xplogiabsentdevice;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063extern int ql2xloginretrycount;
Andrew Vasquezcca53352005-08-26 19:08:30 -070064extern int ql2xfdmienable;
andrew.vasquez@qlogic.com79f89a42006-01-13 17:05:58 -080065extern int ql2xprocessrscn;
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
f4f051e2005-04-17 15:02:26 -050067extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
69extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
70
71extern void qla2x00_cmd_timeout(srb_t *);
72
Linus Torvalds1da177e2005-04-16 15:20:36 -070073extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int);
74extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *);
75
Linus Torvalds1da177e2005-04-16 15:20:36 -070076extern void qla2x00_blink_led(scsi_qla_host_t *);
77
78extern int qla2x00_down_timeout(struct semaphore *, unsigned long);
79
Andrew Vasquez54333832005-11-09 15:49:04 -080080extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *);
81
Linus Torvalds1da177e2005-04-16 15:20:36 -070082/*
83 * Global Function Prototypes in qla_iocb.c source file.
84 */
85extern void qla2x00_isp_cmd(scsi_qla_host_t *);
86
87extern uint16_t qla2x00_calc_iocbs_32(uint16_t);
88extern uint16_t qla2x00_calc_iocbs_64(uint16_t);
89extern void qla2x00_build_scsi_iocbs_32(srb_t *, cmd_entry_t *, uint16_t);
90extern void qla2x00_build_scsi_iocbs_64(srb_t *, cmd_entry_t *, uint16_t);
91extern int qla2x00_start_scsi(srb_t *sp);
Andrew Vasquez2b6c0ce2005-07-06 10:31:17 -070092extern int qla24xx_start_scsi(srb_t *sp);
Linus Torvalds1da177e2005-04-16 15:20:36 -070093int qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
94int __qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
95
96/*
97 * Global Function Prototypes in qla_mbx.c source file.
98 */
99extern int
andrew.vasquez@qlogic.com590f98e2006-01-13 17:05:37 -0800100qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
102extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700103qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104
105extern void
106qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *,
107 uint16_t *, uint16_t *, uint16_t *, uint32_t *);
108
109extern int
110qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *);
111
112extern int
113qla2x00_set_fw_options(scsi_qla_host_t *, uint16_t *);
114
115extern int
116qla2x00_mbx_reg_test(scsi_qla_host_t *);
117
118extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700119qla2x00_verify_checksum(scsi_qla_host_t *, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
121extern int
122qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);
123
124extern int
125qla2x00_abort_command(scsi_qla_host_t *, srb_t *);
126
127#if USE_ABORT_TGT
128extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700129qla2x00_abort_target(fc_port_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130#endif
131
132extern int
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
134 uint8_t *, uint16_t *);
135
136extern int
137qla2x00_get_retry_cnt(scsi_qla_host_t *, uint8_t *, uint8_t *, uint16_t *);
138
139extern int
140qla2x00_init_firmware(scsi_qla_host_t *, uint16_t);
141
142extern int
143qla2x00_get_port_database(scsi_qla_host_t *, fc_port_t *, uint8_t);
144
145extern int
146qla2x00_get_firmware_state(scsi_qla_host_t *, uint16_t *);
147
148extern int
149qla2x00_get_port_name(scsi_qla_host_t *, uint16_t, uint8_t *, uint8_t);
150
151extern int
152qla2x00_lip_reset(scsi_qla_host_t *);
153
154extern int
155qla2x00_send_sns(scsi_qla_host_t *, dma_addr_t, uint16_t, size_t);
156
157extern int
158qla2x00_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
159 uint16_t *, uint8_t);
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700160extern int
161qla24xx_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
162 uint16_t *, uint8_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163
164extern int
165qla2x00_login_local_device(scsi_qla_host_t *, uint16_t, uint16_t *, uint8_t);
166
167extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700168qla2x00_fabric_logout(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t);
169
170extern int
171qla24xx_fabric_logout(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172
173extern int
174qla2x00_full_login_lip(scsi_qla_host_t *ha);
175
176extern int
177qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *);
178
179extern int
180qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *,
181 uint16_t *);
182
183extern int
184qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map);
185
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700186extern int qla24xx_abort_command(scsi_qla_host_t *, srb_t *);
187extern int qla24xx_abort_target(fc_port_t *);
188
189extern int qla2x00_system_error(scsi_qla_host_t *);
190
191extern int
192qla2x00_get_serdes_params(scsi_qla_host_t *, uint16_t *, uint16_t *,
193 uint16_t *);
194
195extern int
196qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t);
197
Andrew Vasquezf6ef3b12005-08-26 19:10:20 -0700198extern int
199qla2x00_stop_firmware(scsi_qla_host_t *);
200
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201/*
202 * Global Function Prototypes in qla_isr.c source file.
203 */
204extern irqreturn_t qla2100_intr_handler(int, void *, struct pt_regs *);
205extern irqreturn_t qla2300_intr_handler(int, void *, struct pt_regs *);
Andrew Vasquez9a853f72005-07-06 10:31:27 -0700206extern irqreturn_t qla24xx_intr_handler(int, void *, struct pt_regs *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207extern void qla2x00_process_response_queue(struct scsi_qla_host *);
Andrew Vasquez4fdfefe2005-10-27 11:09:48 -0700208extern void qla24xx_process_response_queue(struct scsi_qla_host *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209
210/*
211 * Global Function Prototypes in qla_sup.c source file.
212 */
213extern void qla2x00_lock_nvram_access(scsi_qla_host_t *);
214extern void qla2x00_unlock_nvram_access(scsi_qla_host_t *);
215extern void qla2x00_release_nvram_protection(scsi_qla_host_t *);
216extern uint16_t qla2x00_get_nvram_word(scsi_qla_host_t *, uint32_t);
217extern void qla2x00_write_nvram_word(scsi_qla_host_t *, uint32_t, uint16_t);
Andrew Vasquez459c5372005-07-06 10:31:07 -0700218extern uint32_t *qla24xx_read_flash_data(scsi_qla_host_t *, uint32_t *,
219 uint32_t, uint32_t);
220extern uint8_t *qla2x00_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
221 uint32_t);
222extern uint8_t *qla24xx_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
223 uint32_t);
224extern int qla2x00_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
225 uint32_t);
226extern int qla24xx_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
227 uint32_t);
228
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229/*
230 * Global Function Prototypes in qla_dbg.c source file.
231 */
232extern void qla2100_fw_dump(scsi_qla_host_t *, int);
233extern void qla2300_fw_dump(scsi_qla_host_t *, int);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700234extern void qla24xx_fw_dump(scsi_qla_host_t *, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235extern void qla2100_ascii_fw_dump(scsi_qla_host_t *);
236extern void qla2300_ascii_fw_dump(scsi_qla_host_t *);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700237extern void qla24xx_ascii_fw_dump(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238extern void qla2x00_dump_regs(scsi_qla_host_t *);
239extern void qla2x00_dump_buffer(uint8_t *, uint32_t);
240extern void qla2x00_print_scsi_cmd(struct scsi_cmnd *);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700241extern void qla2x00_dump_pkt(void *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242
243/*
244 * Global Function Prototypes in qla_gs.c source file.
245 */
Andrew Vasquez8c958a92005-07-06 10:30:47 -0700246extern void *qla2x00_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
247extern void *qla24xx_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248extern int qla2x00_ga_nxt(scsi_qla_host_t *, fc_port_t *);
249extern int qla2x00_gid_pt(scsi_qla_host_t *, sw_info_t *);
250extern int qla2x00_gpn_id(scsi_qla_host_t *, sw_info_t *);
251extern int qla2x00_gnn_id(scsi_qla_host_t *, sw_info_t *);
252extern int qla2x00_rft_id(scsi_qla_host_t *);
253extern int qla2x00_rff_id(scsi_qla_host_t *);
254extern int qla2x00_rnn_id(scsi_qla_host_t *);
255extern int qla2x00_rsnn_nn(scsi_qla_host_t *);
Andrew Vasquezcca53352005-08-26 19:08:30 -0700256extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
257extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
258extern int qla2x00_fdmi_register(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259
260/*
261 * Global Function Prototypes in qla_rscn.c source file.
262 */
Al Viroc53033f2005-10-21 03:22:08 -0400263extern fc_port_t *qla2x00_alloc_rscn_fcport(scsi_qla_host_t *, gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264extern int qla2x00_handle_port_rscn(scsi_qla_host_t *, uint32_t, fc_port_t *,
265 int);
266extern void qla2x00_process_iodesc(scsi_qla_host_t *, struct mbx_entry *);
267extern void qla2x00_cancel_io_descriptors(scsi_qla_host_t *);
268
269/*
270 * Global Function Prototypes in qla_xioctl.c source file.
271 */
272#define qla2x00_enqueue_aen(ha, cmd, mode) do { } while (0)
273#define qla2x00_alloc_ioctl_mem(ha) (0)
274#define qla2x00_free_ioctl_mem(ha) do { } while (0)
275
8482e1182005-04-17 15:04:54 -0500276/*
277 * Global Function Prototypes in qla_attr.c source file.
278 */
Andrew Vasquezafb046e2005-08-26 19:09:40 -0700279struct class_device_attribute;
280extern struct class_device_attribute *qla2x00_host_attrs[];
Andrew Vasquez1c97a122005-04-21 16:13:36 -0400281struct fc_function_template;
282extern struct fc_function_template qla2xxx_transport_functions;
8482e1182005-04-17 15:04:54 -0500283extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
284extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
8482e1182005-04-17 15:04:54 -0500285extern void qla2x00_init_host_attr(scsi_qla_host_t *);
286extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
287extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288#endif /* _QLA_GBL_H */