blob: e6ca2bc9a28ddc807f94e435df120996d810b22c [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
Linus Torvalds1da177e2005-04-16 15:20:36 -070012/*
13 * Global Function Prototypes in qla_init.c source file.
14 */
15extern int qla2x00_initialize_adapter(scsi_qla_host_t *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070016
17extern int qla2100_pci_config(struct scsi_qla_host *);
18extern int qla2300_pci_config(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070019extern int qla24xx_pci_config(scsi_qla_host_t *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070020extern void qla2x00_reset_chip(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070021extern void qla24xx_reset_chip(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070022extern int qla2x00_chip_diag(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070023extern int qla24xx_chip_diag(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070024extern void qla2x00_config_rings(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070025extern void qla24xx_config_rings(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070026extern void qla2x00_reset_adapter(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070027extern void qla24xx_reset_adapter(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070028extern int qla2x00_nvram_config(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070029extern int qla24xx_nvram_config(struct scsi_qla_host *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070030extern void qla2x00_update_fw_options(struct scsi_qla_host *);
Andrew Vasquez0107109e2005-07-06 10:31:37 -070031extern void qla24xx_update_fw_options(scsi_qla_host_t *);
Andrew Vasquezabbd8872005-07-06 10:30:05 -070032extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *);
Andrew Vasquez54333832005-11-09 15:49:04 -080033extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35extern int qla2x00_loop_resync(scsi_qla_host_t *);
36
Linus Torvalds1da177e2005-04-16 15:20:36 -070037extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *);
andrew.vasquez@qlogic.com9a52a57c2006-03-09 14:27:44 -080038extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
40extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t);
41
42extern void qla2x00_rescan_fcports(scsi_qla_host_t *);
andrew.vasquez@qlogic.comd97994d2006-01-20 14:53:13 -080043extern void qla2x00_update_fcports(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
Linus Torvalds1da177e2005-04-16 15:20:36 -070045extern int qla2x00_abort_isp(scsi_qla_host_t *);
46
andrew.vasquez@qlogic.com052c40c2006-01-20 14:53:19 -080047extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *);
8482e1182005-04-17 15:04:54 -050048extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
49
Andrew Vasqueza7a167b2006-06-23 16:10:29 -070050extern void qla2x00_alloc_fw_dump(scsi_qla_host_t *);
Andrew Vasquez18c6c122006-10-13 09:33:38 -070051extern void qla2x00_try_to_stop_firmware(scsi_qla_host_t *);
Andrew Vasqueza7a167b2006-06-23 16:10:29 -070052
Linus Torvalds1da177e2005-04-16 15:20:36 -070053/*
54 * Global Data in qla_os.c source file.
55 */
56extern char qla2x00_version_str[];
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058extern int ql2xlogintimeout;
59extern int qlport_down_retry;
Linus Torvalds1da177e2005-04-16 15:20:36 -070060extern int ql2xplogiabsentdevice;
Linus Torvalds1da177e2005-04-16 15:20:36 -070061extern int ql2xloginretrycount;
Andrew Vasquezcca53352005-08-26 19:08:30 -070062extern int ql2xfdmienable;
Andrew Vasqueza7a167b2006-06-23 16:10:29 -070063extern int ql2xallocfwdump;
Andrew Vasquez11010fe2006-10-06 09:54:59 -070064extern int ql2xextended_error_logging;
Andrew Vasquezdf7baa52006-10-13 09:33:39 -070065extern int ql2xqfullrampup;
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
andrew.vasquez@qlogic.comd97994d2006-01-20 14:53:13 -080071extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int);
72extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
Linus Torvalds1da177e2005-04-16 15:20:36 -070074extern int qla2x00_down_timeout(struct semaphore *, unsigned long);
75
Andrew Vasquez54333832005-11-09 15:49:04 -080076extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *);
77
andrew.vasquez@qlogic.com854165f2006-01-31 16:05:17 -080078extern int qla2x00_wait_for_hba_online(scsi_qla_host_t *);
79
Christoph Hellwig39a11242006-02-14 18:46:22 +010080extern void qla2xxx_wake_dpc(scsi_qla_host_t *);
81
Linus Torvalds1da177e2005-04-16 15:20:36 -070082/*
83 * Global Function Prototypes in qla_iocb.c source file.
84 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070085extern uint16_t qla2x00_calc_iocbs_32(uint16_t);
86extern uint16_t qla2x00_calc_iocbs_64(uint16_t);
87extern void qla2x00_build_scsi_iocbs_32(srb_t *, cmd_entry_t *, uint16_t);
88extern void qla2x00_build_scsi_iocbs_64(srb_t *, cmd_entry_t *, uint16_t);
89extern int qla2x00_start_scsi(srb_t *sp);
Andrew Vasquez2b6c0ce2005-07-06 10:31:17 -070090extern int qla24xx_start_scsi(srb_t *sp);
Linus Torvalds1da177e2005-04-16 15:20:36 -070091int qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
92int __qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
93
94/*
95 * Global Function Prototypes in qla_mbx.c source file.
96 */
97extern int
andrew.vasquez@qlogic.com590f98e2006-01-13 17:05:37 -080098qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070099
100extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700101qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102
103extern void
104qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *,
105 uint16_t *, uint16_t *, uint16_t *, uint32_t *);
106
107extern int
108qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *);
109
110extern int
111qla2x00_set_fw_options(scsi_qla_host_t *, uint16_t *);
112
113extern int
114qla2x00_mbx_reg_test(scsi_qla_host_t *);
115
116extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700117qla2x00_verify_checksum(scsi_qla_host_t *, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118
119extern int
120qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);
121
122extern int
123qla2x00_abort_command(scsi_qla_host_t *, srb_t *);
124
125#if USE_ABORT_TGT
126extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700127qla2x00_abort_target(fc_port_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128#endif
129
130extern int
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
132 uint8_t *, uint16_t *);
133
134extern int
135qla2x00_get_retry_cnt(scsi_qla_host_t *, uint8_t *, uint8_t *, uint16_t *);
136
137extern int
138qla2x00_init_firmware(scsi_qla_host_t *, uint16_t);
139
140extern int
141qla2x00_get_port_database(scsi_qla_host_t *, fc_port_t *, uint8_t);
142
143extern int
144qla2x00_get_firmware_state(scsi_qla_host_t *, uint16_t *);
145
146extern int
147qla2x00_get_port_name(scsi_qla_host_t *, uint16_t, uint8_t *, uint8_t);
148
149extern int
150qla2x00_lip_reset(scsi_qla_host_t *);
151
152extern int
153qla2x00_send_sns(scsi_qla_host_t *, dma_addr_t, uint16_t, size_t);
154
155extern int
156qla2x00_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
157 uint16_t *, uint8_t);
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700158extern int
159qla24xx_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
160 uint16_t *, uint8_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
162extern int
andrew.vasquez@qlogic.com9a52a57c2006-03-09 14:27:44 -0800163qla2x00_login_local_device(scsi_qla_host_t *, fc_port_t *, uint16_t *,
164 uint8_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165
166extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700167qla2x00_fabric_logout(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t);
168
169extern int
170qla24xx_fabric_logout(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171
172extern int
173qla2x00_full_login_lip(scsi_qla_host_t *ha);
174
175extern int
176qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *);
177
178extern int
179qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *,
180 uint16_t *);
181
182extern int
183qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map);
184
andrew.vasquez@qlogic.com392e2f62006-01-31 16:05:02 -0800185extern int
186qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, link_stat_t *,
187 uint16_t *);
188
189extern int
190qla24xx_get_isp_stats(scsi_qla_host_t *, uint32_t *, uint32_t, uint16_t *);
191
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700192extern int qla24xx_abort_command(scsi_qla_host_t *, srb_t *);
193extern int qla24xx_abort_target(fc_port_t *);
194
195extern int qla2x00_system_error(scsi_qla_host_t *);
196
197extern int
198qla2x00_get_serdes_params(scsi_qla_host_t *, uint16_t *, uint16_t *,
199 uint16_t *);
200
201extern int
202qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t);
203
Andrew Vasquezf6ef3b12005-08-26 19:10:20 -0700204extern int
205qla2x00_stop_firmware(scsi_qla_host_t *);
206
Andrew Vasqueza7a167b2006-06-23 16:10:29 -0700207extern int
208qla2x00_trace_control(scsi_qla_host_t *, uint16_t, dma_addr_t, uint16_t);
209
Andrew Vasquez88729e52006-06-23 16:10:50 -0700210extern int
211qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t);
212
Andrew Vasquezd8b45212006-10-02 12:00:43 -0700213extern int
214qla2x00_get_idma_speed(scsi_qla_host_t *, uint16_t, uint16_t *, uint16_t *);
215
216extern int
217qla2x00_set_idma_speed(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t *);
218
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219/*
220 * Global Function Prototypes in qla_isr.c source file.
221 */
David Howells7d12e782006-10-05 14:55:46 +0100222extern irqreturn_t qla2100_intr_handler(int, void *);
223extern irqreturn_t qla2300_intr_handler(int, void *);
224extern irqreturn_t qla24xx_intr_handler(int, void *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225extern void qla2x00_process_response_queue(struct scsi_qla_host *);
Andrew Vasquez4fdfefe2005-10-27 11:09:48 -0700226extern void qla24xx_process_response_queue(struct scsi_qla_host *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700227
Andrew Vasqueza8488ab2007-01-29 10:22:19 -0800228extern int qla2x00_request_irqs(scsi_qla_host_t *);
229extern void qla2x00_free_irqs(scsi_qla_host_t *);
230
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231/*
232 * Global Function Prototypes in qla_sup.c source file.
233 */
234extern void qla2x00_lock_nvram_access(scsi_qla_host_t *);
235extern void qla2x00_unlock_nvram_access(scsi_qla_host_t *);
236extern void qla2x00_release_nvram_protection(scsi_qla_host_t *);
237extern uint16_t qla2x00_get_nvram_word(scsi_qla_host_t *, uint32_t);
238extern void qla2x00_write_nvram_word(scsi_qla_host_t *, uint32_t, uint16_t);
Andrew Vasquez459c5372005-07-06 10:31:07 -0700239extern uint32_t *qla24xx_read_flash_data(scsi_qla_host_t *, uint32_t *,
240 uint32_t, uint32_t);
241extern uint8_t *qla2x00_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
242 uint32_t);
243extern uint8_t *qla24xx_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
244 uint32_t);
245extern int qla2x00_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
246 uint32_t);
247extern int qla24xx_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
248 uint32_t);
249
andrew.vasquez@qlogic.comf6df1442006-01-31 16:05:07 -0800250extern int qla2x00_beacon_on(struct scsi_qla_host *);
251extern int qla2x00_beacon_off(struct scsi_qla_host *);
252extern void qla2x00_beacon_blink(struct scsi_qla_host *);
253extern int qla24xx_beacon_on(struct scsi_qla_host *);
254extern int qla24xx_beacon_off(struct scsi_qla_host *);
255extern void qla24xx_beacon_blink(struct scsi_qla_host *);
256
andrew.vasquez@qlogic.com854165f2006-01-31 16:05:17 -0800257extern uint8_t *qla2x00_read_optrom_data(struct scsi_qla_host *, uint8_t *,
258 uint32_t, uint32_t);
259extern int qla2x00_write_optrom_data(struct scsi_qla_host *, uint8_t *,
260 uint32_t, uint32_t);
261extern uint8_t *qla24xx_read_optrom_data(struct scsi_qla_host *, uint8_t *,
262 uint32_t, uint32_t);
263extern int qla24xx_write_optrom_data(struct scsi_qla_host *, uint8_t *,
264 uint32_t, uint32_t);
265
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266/*
267 * Global Function Prototypes in qla_dbg.c source file.
268 */
269extern void qla2100_fw_dump(scsi_qla_host_t *, int);
270extern void qla2300_fw_dump(scsi_qla_host_t *, int);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700271extern void qla24xx_fw_dump(scsi_qla_host_t *, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272extern void qla2x00_dump_regs(scsi_qla_host_t *);
273extern void qla2x00_dump_buffer(uint8_t *, uint32_t);
274extern void qla2x00_print_scsi_cmd(struct scsi_cmnd *);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700275extern void qla2x00_dump_pkt(void *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276
277/*
278 * Global Function Prototypes in qla_gs.c source file.
279 */
Andrew Vasquez8c958a92005-07-06 10:30:47 -0700280extern void *qla2x00_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
281extern void *qla24xx_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700282extern int qla2x00_ga_nxt(scsi_qla_host_t *, fc_port_t *);
283extern int qla2x00_gid_pt(scsi_qla_host_t *, sw_info_t *);
284extern int qla2x00_gpn_id(scsi_qla_host_t *, sw_info_t *);
285extern int qla2x00_gnn_id(scsi_qla_host_t *, sw_info_t *);
286extern int qla2x00_rft_id(scsi_qla_host_t *);
287extern int qla2x00_rff_id(scsi_qla_host_t *);
288extern int qla2x00_rnn_id(scsi_qla_host_t *);
289extern int qla2x00_rsnn_nn(scsi_qla_host_t *);
Andrew Vasquezcca53352005-08-26 19:08:30 -0700290extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
291extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
292extern int qla2x00_fdmi_register(scsi_qla_host_t *);
Andrew Vasquezd8b45212006-10-02 12:00:43 -0700293extern int qla2x00_gfpn_id(scsi_qla_host_t *, sw_info_t *);
294extern int qla2x00_gpsc(scsi_qla_host_t *, sw_info_t *);
Andrew Vasquez1620f7c2006-10-02 12:00:44 -0700295extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700296
297/*
8482e1182005-04-17 15:04:54 -0500298 * Global Function Prototypes in qla_attr.c source file.
299 */
Andrew Vasquezafb046e2005-08-26 19:09:40 -0700300struct class_device_attribute;
301extern struct class_device_attribute *qla2x00_host_attrs[];
Andrew Vasquez1c97a122005-04-21 16:13:36 -0400302struct fc_function_template;
303extern struct fc_function_template qla2xxx_transport_functions;
8482e1182005-04-17 15:04:54 -0500304extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
305extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
8482e1182005-04-17 15:04:54 -0500306extern void qla2x00_init_host_attr(scsi_qla_host_t *);
307extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
308extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309#endif /* _QLA_GBL_H */