blob: e897eadf0362ec06af9f1aa22bd14ad3e2a0e235 [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
andrew.vasquez@qlogic.com052c40c2006-01-20 14:53:19 -080054extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *);
8482e1182005-04-17 15:04:54 -050055extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
56
Linus Torvalds1da177e2005-04-16 15:20:36 -070057/*
58 * Global Data in qla_os.c source file.
59 */
60extern char qla2x00_version_str[];
61
Linus Torvalds1da177e2005-04-16 15:20:36 -070062extern int ql2xlogintimeout;
63extern int qlport_down_retry;
Linus Torvalds1da177e2005-04-16 15:20:36 -070064extern int ql2xplogiabsentdevice;
Linus Torvalds1da177e2005-04-16 15:20:36 -070065extern int ql2xloginretrycount;
Andrew Vasquezcca53352005-08-26 19:08:30 -070066extern int ql2xfdmienable;
andrew.vasquez@qlogic.com79f89a42006-01-13 17:05:58 -080067extern int ql2xprocessrscn;
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
f4f051e2005-04-17 15:02:26 -050069extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
71extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
72
73extern void qla2x00_cmd_timeout(srb_t *);
74
andrew.vasquez@qlogic.comd97994d2006-01-20 14:53:13 -080075extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int);
76extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -070077
Linus Torvalds1da177e2005-04-16 15:20:36 -070078extern 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
andrew.vasquez@qlogic.com854165f2006-01-31 16:05:17 -080082extern int qla2x00_wait_for_hba_online(scsi_qla_host_t *);
83
Christoph Hellwig39a11242006-02-14 18:46:22 +010084extern void qla2xxx_wake_dpc(scsi_qla_host_t *);
85
Linus Torvalds1da177e2005-04-16 15:20:36 -070086/*
87 * Global Function Prototypes in qla_iocb.c source file.
88 */
89extern void qla2x00_isp_cmd(scsi_qla_host_t *);
90
91extern uint16_t qla2x00_calc_iocbs_32(uint16_t);
92extern uint16_t qla2x00_calc_iocbs_64(uint16_t);
93extern void qla2x00_build_scsi_iocbs_32(srb_t *, cmd_entry_t *, uint16_t);
94extern void qla2x00_build_scsi_iocbs_64(srb_t *, cmd_entry_t *, uint16_t);
95extern int qla2x00_start_scsi(srb_t *sp);
Andrew Vasquez2b6c0ce2005-07-06 10:31:17 -070096extern int qla24xx_start_scsi(srb_t *sp);
Linus Torvalds1da177e2005-04-16 15:20:36 -070097int qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
98int __qla2x00_marker(scsi_qla_host_t *, uint16_t, uint16_t, uint8_t);
99
100/*
101 * Global Function Prototypes in qla_mbx.c source file.
102 */
103extern int
andrew.vasquez@qlogic.com590f98e2006-01-13 17:05:37 -0800104qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105
106extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700107qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108
109extern void
110qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *,
111 uint16_t *, uint16_t *, uint16_t *, uint32_t *);
112
113extern int
114qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *);
115
116extern int
117qla2x00_set_fw_options(scsi_qla_host_t *, uint16_t *);
118
119extern int
120qla2x00_mbx_reg_test(scsi_qla_host_t *);
121
122extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700123qla2x00_verify_checksum(scsi_qla_host_t *, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124
125extern int
126qla2x00_issue_iocb(scsi_qla_host_t *, void *, dma_addr_t, size_t);
127
128extern int
129qla2x00_abort_command(scsi_qla_host_t *, srb_t *);
130
131#if USE_ABORT_TGT
132extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700133qla2x00_abort_target(fc_port_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134#endif
135
136extern int
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *,
138 uint8_t *, uint16_t *);
139
140extern int
141qla2x00_get_retry_cnt(scsi_qla_host_t *, uint8_t *, uint8_t *, uint16_t *);
142
143extern int
144qla2x00_init_firmware(scsi_qla_host_t *, uint16_t);
145
146extern int
147qla2x00_get_port_database(scsi_qla_host_t *, fc_port_t *, uint8_t);
148
149extern int
150qla2x00_get_firmware_state(scsi_qla_host_t *, uint16_t *);
151
152extern int
153qla2x00_get_port_name(scsi_qla_host_t *, uint16_t, uint8_t *, uint8_t);
154
155extern int
156qla2x00_lip_reset(scsi_qla_host_t *);
157
158extern int
159qla2x00_send_sns(scsi_qla_host_t *, dma_addr_t, uint16_t, size_t);
160
161extern int
162qla2x00_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
163 uint16_t *, uint8_t);
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700164extern int
165qla24xx_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
166 uint16_t *, uint8_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167
168extern int
169qla2x00_login_local_device(scsi_qla_host_t *, uint16_t, uint16_t *, uint8_t);
170
171extern int
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700172qla2x00_fabric_logout(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t);
173
174extern int
175qla24xx_fabric_logout(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176
177extern int
178qla2x00_full_login_lip(scsi_qla_host_t *ha);
179
180extern int
181qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *);
182
183extern int
184qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *,
185 uint16_t *);
186
187extern int
188qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map);
189
andrew.vasquez@qlogic.com392e2f62006-01-31 16:05:02 -0800190extern int
191qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, link_stat_t *,
192 uint16_t *);
193
194extern int
195qla24xx_get_isp_stats(scsi_qla_host_t *, uint32_t *, uint32_t, uint16_t *);
196
Andrew Vasquez1c7c6352005-07-06 10:30:57 -0700197extern int qla24xx_abort_command(scsi_qla_host_t *, srb_t *);
198extern int qla24xx_abort_target(fc_port_t *);
199
200extern int qla2x00_system_error(scsi_qla_host_t *);
201
202extern int
203qla2x00_get_serdes_params(scsi_qla_host_t *, uint16_t *, uint16_t *,
204 uint16_t *);
205
206extern int
207qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t);
208
Andrew Vasquezf6ef3b12005-08-26 19:10:20 -0700209extern int
210qla2x00_stop_firmware(scsi_qla_host_t *);
211
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212/*
213 * Global Function Prototypes in qla_isr.c source file.
214 */
215extern irqreturn_t qla2100_intr_handler(int, void *, struct pt_regs *);
216extern irqreturn_t qla2300_intr_handler(int, void *, struct pt_regs *);
Andrew Vasquez9a853f72005-07-06 10:31:27 -0700217extern irqreturn_t qla24xx_intr_handler(int, void *, struct pt_regs *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218extern void qla2x00_process_response_queue(struct scsi_qla_host *);
Andrew Vasquez4fdfefe2005-10-27 11:09:48 -0700219extern void qla24xx_process_response_queue(struct scsi_qla_host *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220
221/*
222 * Global Function Prototypes in qla_sup.c source file.
223 */
224extern void qla2x00_lock_nvram_access(scsi_qla_host_t *);
225extern void qla2x00_unlock_nvram_access(scsi_qla_host_t *);
226extern void qla2x00_release_nvram_protection(scsi_qla_host_t *);
227extern uint16_t qla2x00_get_nvram_word(scsi_qla_host_t *, uint32_t);
228extern void qla2x00_write_nvram_word(scsi_qla_host_t *, uint32_t, uint16_t);
Andrew Vasquez459c5372005-07-06 10:31:07 -0700229extern uint32_t *qla24xx_read_flash_data(scsi_qla_host_t *, uint32_t *,
230 uint32_t, uint32_t);
231extern uint8_t *qla2x00_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
232 uint32_t);
233extern uint8_t *qla24xx_read_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
234 uint32_t);
235extern int qla2x00_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
236 uint32_t);
237extern int qla24xx_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
238 uint32_t);
239
andrew.vasquez@qlogic.comf6df1442006-01-31 16:05:07 -0800240extern int qla2x00_beacon_on(struct scsi_qla_host *);
241extern int qla2x00_beacon_off(struct scsi_qla_host *);
242extern void qla2x00_beacon_blink(struct scsi_qla_host *);
243extern int qla24xx_beacon_on(struct scsi_qla_host *);
244extern int qla24xx_beacon_off(struct scsi_qla_host *);
245extern void qla24xx_beacon_blink(struct scsi_qla_host *);
246
andrew.vasquez@qlogic.com854165f2006-01-31 16:05:17 -0800247extern uint8_t *qla2x00_read_optrom_data(struct scsi_qla_host *, uint8_t *,
248 uint32_t, uint32_t);
249extern int qla2x00_write_optrom_data(struct scsi_qla_host *, uint8_t *,
250 uint32_t, uint32_t);
251extern uint8_t *qla24xx_read_optrom_data(struct scsi_qla_host *, uint8_t *,
252 uint32_t, uint32_t);
253extern int qla24xx_write_optrom_data(struct scsi_qla_host *, uint8_t *,
254 uint32_t, uint32_t);
255
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256/*
257 * Global Function Prototypes in qla_dbg.c source file.
258 */
259extern void qla2100_fw_dump(scsi_qla_host_t *, int);
260extern void qla2300_fw_dump(scsi_qla_host_t *, int);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700261extern void qla24xx_fw_dump(scsi_qla_host_t *, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262extern void qla2100_ascii_fw_dump(scsi_qla_host_t *);
263extern void qla2300_ascii_fw_dump(scsi_qla_host_t *);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700264extern void qla24xx_ascii_fw_dump(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265extern void qla2x00_dump_regs(scsi_qla_host_t *);
266extern void qla2x00_dump_buffer(uint8_t *, uint32_t);
267extern void qla2x00_print_scsi_cmd(struct scsi_cmnd *);
Andrew Vasquez6d9b61e2005-07-06 10:30:36 -0700268extern void qla2x00_dump_pkt(void *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269
270/*
271 * Global Function Prototypes in qla_gs.c source file.
272 */
Andrew Vasquez8c958a92005-07-06 10:30:47 -0700273extern void *qla2x00_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
274extern void *qla24xx_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275extern int qla2x00_ga_nxt(scsi_qla_host_t *, fc_port_t *);
276extern int qla2x00_gid_pt(scsi_qla_host_t *, sw_info_t *);
277extern int qla2x00_gpn_id(scsi_qla_host_t *, sw_info_t *);
278extern int qla2x00_gnn_id(scsi_qla_host_t *, sw_info_t *);
279extern int qla2x00_rft_id(scsi_qla_host_t *);
280extern int qla2x00_rff_id(scsi_qla_host_t *);
281extern int qla2x00_rnn_id(scsi_qla_host_t *);
282extern int qla2x00_rsnn_nn(scsi_qla_host_t *);
Andrew Vasquezcca53352005-08-26 19:08:30 -0700283extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
284extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t);
285extern int qla2x00_fdmi_register(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286
287/*
288 * Global Function Prototypes in qla_rscn.c source file.
289 */
Al Viroc53033f2005-10-21 03:22:08 -0400290extern fc_port_t *qla2x00_alloc_rscn_fcport(scsi_qla_host_t *, gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291extern int qla2x00_handle_port_rscn(scsi_qla_host_t *, uint32_t, fc_port_t *,
292 int);
293extern void qla2x00_process_iodesc(scsi_qla_host_t *, struct mbx_entry *);
294extern void qla2x00_cancel_io_descriptors(scsi_qla_host_t *);
295
296/*
297 * Global Function Prototypes in qla_xioctl.c source file.
298 */
299#define qla2x00_enqueue_aen(ha, cmd, mode) do { } while (0)
300#define qla2x00_alloc_ioctl_mem(ha) (0)
301#define qla2x00_free_ioctl_mem(ha) do { } while (0)
302
8482e1182005-04-17 15:04:54 -0500303/*
304 * Global Function Prototypes in qla_attr.c source file.
305 */
Andrew Vasquezafb046e2005-08-26 19:09:40 -0700306struct class_device_attribute;
307extern struct class_device_attribute *qla2x00_host_attrs[];
Andrew Vasquez1c97a122005-04-21 16:13:36 -0400308struct fc_function_template;
309extern struct fc_function_template qla2xxx_transport_functions;
8482e1182005-04-17 15:04:54 -0500310extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
311extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
8482e1182005-04-17 15:04:54 -0500312extern void qla2x00_init_host_attr(scsi_qla_host_t *);
313extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *);
314extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315#endif /* _QLA_GBL_H */