blob: 0c1ec14f307221f23d14dd4131c12958c025dd94 [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 *);
andrew.vasquez@qlogic.comd97994d2006-01-20 14:53:13 -080050extern void qla2x00_update_fcports(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Linus Torvalds1da177e2005-04-16 15:20:36 -070052extern int qla2x00_abort_isp(scsi_qla_host_t *);
53
8482e1182005-04-17 15:04:54 -050054extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
55
Linus Torvalds1da177e2005-04-16 15:20:36 -070056/*
57 * Global Data in qla_os.c source file.
58 */
59extern char qla2x00_version_str[];
60
Linus Torvalds1da177e2005-04-16 15:20:36 -070061extern int ql2xlogintimeout;
62extern int qlport_down_retry;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063extern int ql2xplogiabsentdevice;
Linus Torvalds1da177e2005-04-16 15:20:36 -070064extern int ql2xloginretrycount;
Andrew Vasquezcca53352005-08-26 19:08:30 -070065extern int ql2xfdmienable;
andrew.vasquez@qlogic.com79f89a42006-01-13 17:05:58 -080066extern int ql2xprocessrscn;
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
f4f051e2005-04-17 15:02:26 -050068extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070069
70extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
71
72extern void qla2x00_cmd_timeout(srb_t *);
73
andrew.vasquez@qlogic.comd97994d2006-01-20 14:53:13 -080074extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int);
75extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -070076
Linus Torvalds1da177e2005-04-16 15:20:36 -070077extern void qla2x00_blink_led(scsi_qla_host_t *);
78
79extern int qla2x00_down_timeout(struct semaphore *, unsigned long);
80
Andrew Vasquez54333832005-11-09 15:49:04 -080081extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *);
82
Linus Torvalds1da177e2005-04-16 15:20:36 -070083/*
84 * Global Function Prototypes in qla_iocb.c source file.
85 */
86extern void qla2x00_isp_cmd(scsi_qla_host_t *);
87
88extern uint16_t qla2x00_calc_iocbs_32(uint16_t);
89extern uint16_t qla2x00_calc_iocbs_64(uint16_t);
90extern void qla2x00_build_scsi_iocbs_32(srb_t *, cmd_entry_t *, uint16_t);
91extern void qla2x00_build_scsi_iocbs_64(srb_t *, cmd_entry_t *, uint16_t);
92extern int qla2x00_start_scsi(srb_t *sp);
Andrew Vasquez2b6c0ce2005-07-06 10:31:17 -070093extern int qla24xx_start_scsi(srb_t *sp);
Linus Torvalds1da177e2005-04-16 15:20:36 -070094int qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
95int __qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
96
97/*
98 * Global Function Prototypes in qla_mbx.c source file.
99 */
100extern int
andrew.vasquez@qlogic.com590f98e2006-01-13 17:05:37 -0800101qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102
103extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700104qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105
106extern void
107qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *,
108 uint16_t *, uint16_t *, uint16_t *, uint32_t *);
109
110extern int
111qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *);
112
113extern int
114qla2x00_set_fw_options(scsi_qla_host_t *, uint16_t *);
115
116extern int
117qla2x00_mbx_reg_test(scsi_qla_host_t *);
118
119extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700120qla2x00_verify_checksum(scsi_qla_host_t *, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121
122extern int
123qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);
124
125extern int
126qla2x00_abort_command(scsi_qla_host_t *, srb_t *);
127
128#if USE_ABORT_TGT
129extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700130qla2x00_abort_target(fc_port_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131#endif
132
133extern int
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
135 uint8_t *, uint16_t *);
136
137extern int
138qla2x00_get_retry_cnt(scsi_qla_host_t *, uint8_t *, uint8_t *, uint16_t *);
139
140extern int
141qla2x00_init_firmware(scsi_qla_host_t *, uint16_t);
142
143extern int
144qla2x00_get_port_database(scsi_qla_host_t *, fc_port_t *, uint8_t);
145
146extern int
147qla2x00_get_firmware_state(scsi_qla_host_t *, uint16_t *);
148
149extern int
150qla2x00_get_port_name(scsi_qla_host_t *, uint16_t, uint8_t *, uint8_t);
151
152extern int
153qla2x00_lip_reset(scsi_qla_host_t *);
154
155extern int
156qla2x00_send_sns(scsi_qla_host_t *, dma_addr_t, uint16_t, size_t);
157
158extern int
159qla2x00_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
160 uint16_t *, uint8_t);
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700161extern int
162qla24xx_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
163 uint16_t *, uint8_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
165extern int
166qla2x00_login_local_device(scsi_qla_host_t *, uint16_t, uint16_t *, uint8_t);
167
168extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700169qla2x00_fabric_logout(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t);
170
171extern int
172qla24xx_fabric_logout(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173
174extern int
175qla2x00_full_login_lip(scsi_qla_host_t *ha);
176
177extern int
178qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *);
179
180extern int
181qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *,
182 uint16_t *);
183
184extern int
185qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map);
186
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700187extern int qla24xx_abort_command(scsi_qla_host_t *, srb_t *);
188extern int qla24xx_abort_target(fc_port_t *);
189
190extern int qla2x00_system_error(scsi_qla_host_t *);
191
192extern int
193qla2x00_get_serdes_params(scsi_qla_host_t *, uint16_t *, uint16_t *,
194 uint16_t *);
195
196extern int
197qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t);
198
Andrew Vasquezf6ef3b12005-08-26 19:10:20 -0700199extern int
200qla2x00_stop_firmware(scsi_qla_host_t *);
201
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202/*
203 * Global Function Prototypes in qla_isr.c source file.
204 */
205extern irqreturn_t qla2100_intr_handler(int, void *, struct pt_regs *);
206extern irqreturn_t qla2300_intr_handler(int, void *, struct pt_regs *);
Andrew Vasquez9a853f72005-07-06 10:31:27 -0700207extern irqreturn_t qla24xx_intr_handler(int, void *, struct pt_regs *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208extern void qla2x00_process_response_queue(struct scsi_qla_host *);
Andrew Vasquez4fdfefe2005-10-27 11:09:48 -0700209extern void qla24xx_process_response_queue(struct scsi_qla_host *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210
211/*
212 * Global Function Prototypes in qla_sup.c source file.
213 */
214extern void qla2x00_lock_nvram_access(scsi_qla_host_t *);
215extern void qla2x00_unlock_nvram_access(scsi_qla_host_t *);
216extern void qla2x00_release_nvram_protection(scsi_qla_host_t *);
217extern uint16_t qla2x00_get_nvram_word(scsi_qla_host_t *, uint32_t);
218extern void qla2x00_write_nvram_word(scsi_qla_host_t *, uint32_t, uint16_t);
Andrew Vasquez459c5372005-07-06 10:31:07 -0700219extern uint32_t *qla24xx_read_flash_data(scsi_qla_host_t *, uint32_t *,
220 uint32_t, uint32_t);
221extern uint8_t *qla2x00_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
222 uint32_t);
223extern uint8_t *qla24xx_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
224 uint32_t);
225extern int qla2x00_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
226 uint32_t);
227extern int qla24xx_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
228 uint32_t);
229
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230/*
231 * Global Function Prototypes in qla_dbg.c source file.
232 */
233extern void qla2100_fw_dump(scsi_qla_host_t *, int);
234extern void qla2300_fw_dump(scsi_qla_host_t *, int);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700235extern void qla24xx_fw_dump(scsi_qla_host_t *, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236extern void qla2100_ascii_fw_dump(scsi_qla_host_t *);
237extern void qla2300_ascii_fw_dump(scsi_qla_host_t *);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700238extern void qla24xx_ascii_fw_dump(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239extern void qla2x00_dump_regs(scsi_qla_host_t *);
240extern void qla2x00_dump_buffer(uint8_t *, uint32_t);
241extern void qla2x00_print_scsi_cmd(struct scsi_cmnd *);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700242extern void qla2x00_dump_pkt(void *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243
244/*
245 * Global Function Prototypes in qla_gs.c source file.
246 */
Andrew Vasquez8c958a92005-07-06 10:30:47 -0700247extern void *qla2x00_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
248extern void *qla24xx_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249extern int qla2x00_ga_nxt(scsi_qla_host_t *, fc_port_t *);
250extern int qla2x00_gid_pt(scsi_qla_host_t *, sw_info_t *);
251extern int qla2x00_gpn_id(scsi_qla_host_t *, sw_info_t *);
252extern int qla2x00_gnn_id(scsi_qla_host_t *, sw_info_t *);
253extern int qla2x00_rft_id(scsi_qla_host_t *);
254extern int qla2x00_rff_id(scsi_qla_host_t *);
255extern int qla2x00_rnn_id(scsi_qla_host_t *);
256extern int qla2x00_rsnn_nn(scsi_qla_host_t *);
Andrew Vasquezcca53352005-08-26 19:08:30 -0700257extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
258extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
259extern int qla2x00_fdmi_register(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
261/*
262 * Global Function Prototypes in qla_rscn.c source file.
263 */
Al Viroc53033f2005-10-21 03:22:08 -0400264extern fc_port_t *qla2x00_alloc_rscn_fcport(scsi_qla_host_t *, gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265extern int qla2x00_handle_port_rscn(scsi_qla_host_t *, uint32_t, fc_port_t *,
266 int);
267extern void qla2x00_process_iodesc(scsi_qla_host_t *, struct mbx_entry *);
268extern void qla2x00_cancel_io_descriptors(scsi_qla_host_t *);
269
270/*
271 * Global Function Prototypes in qla_xioctl.c source file.
272 */
273#define qla2x00_enqueue_aen(ha, cmd, mode) do { } while (0)
274#define qla2x00_alloc_ioctl_mem(ha) (0)
275#define qla2x00_free_ioctl_mem(ha) do { } while (0)
276
8482e1182005-04-17 15:04:54 -0500277/*
278 * Global Function Prototypes in qla_attr.c source file.
279 */
Andrew Vasquezafb046e2005-08-26 19:09:40 -0700280struct class_device_attribute;
281extern struct class_device_attribute *qla2x00_host_attrs[];
Andrew Vasquez1c97a122005-04-21 16:13:36 -0400282struct fc_function_template;
283extern struct fc_function_template qla2xxx_transport_functions;
8482e1182005-04-17 15:04:54 -0500284extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
285extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
8482e1182005-04-17 15:04:54 -0500286extern void qla2x00_init_host_attr(scsi_qla_host_t *);
287extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
288extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289#endif /* _QLA_GBL_H */