blob: 786274c48313d11021a89aa05c84582b22f5eed4 [file] [log] [blame]
David Somayajuluafaf5a22006-09-19 10:28:00 -07001/*
2 * QLogic iSCSI HBA Driver
Vikas Chaudhary7d01d062010-12-02 22:12:51 -08003 * Copyright (c) 2003-2010 QLogic Corporation
David Somayajuluafaf5a22006-09-19 10:28:00 -07004 *
5 * See LICENSE.qla4xxx for copyright and licensing details.
6 */
7
8#ifndef __QLA4x_GBL_H
9#define __QLA4x_GBL_H
10
David C Somayajulue08c1822007-05-23 18:14:34 -070011struct iscsi_cls_conn;
12
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053013int qla4xxx_hw_reset(struct scsi_qla_host *ha);
David C Somayajuluf26b9042006-11-15 16:41:09 -080014int ql4xxx_lock_drvr_wait(struct scsi_qla_host *a);
David Somayajuluafaf5a22006-09-19 10:28:00 -070015int qla4xxx_send_tgts(struct scsi_qla_host *ha, char *ip, uint16_t port);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053016int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb *srb);
17int qla4xxx_initialize_adapter(struct scsi_qla_host *ha,
David Somayajuluafaf5a22006-09-19 10:28:00 -070018 uint8_t renew_ddb_list);
19int qla4xxx_soft_reset(struct scsi_qla_host *ha);
David Howells7d12e782006-10-05 14:55:46 +010020irqreturn_t qla4xxx_intr_handler(int irq, void *dev_id);
David Somayajuluafaf5a22006-09-19 10:28:00 -070021
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053022void qla4xxx_free_ddb_list(struct scsi_qla_host *ha);
23void qla4xxx_free_ddb(struct scsi_qla_host *ha, struct ddb_entry *ddb_entry);
24void qla4xxx_process_aen(struct scsi_qla_host *ha, uint8_t process_aen);
David Somayajuluafaf5a22006-09-19 10:28:00 -070025
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053026int qla4xxx_get_dhcp_ip_address(struct scsi_qla_host *ha);
27int qla4xxx_relogin_device(struct scsi_qla_host *ha,
28 struct ddb_entry *ddb_entry);
Vikas Chaudhary09a0f712010-04-28 11:42:24 +053029int qla4xxx_abort_task(struct scsi_qla_host *ha, struct srb *srb);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053030int qla4xxx_reset_lun(struct scsi_qla_host *ha, struct ddb_entry *ddb_entry,
David Somayajuluafaf5a22006-09-19 10:28:00 -070031 int lun);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053032int qla4xxx_reset_target(struct scsi_qla_host *ha,
33 struct ddb_entry *ddb_entry);
34int qla4xxx_get_flash(struct scsi_qla_host *ha, dma_addr_t dma_addr,
David Somayajuluafaf5a22006-09-19 10:28:00 -070035 uint32_t offset, uint32_t len);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053036int qla4xxx_get_firmware_status(struct scsi_qla_host *ha);
37int qla4xxx_get_firmware_state(struct scsi_qla_host *ha);
38int qla4xxx_initialize_fw_cb(struct scsi_qla_host *ha);
David Somayajuluafaf5a22006-09-19 10:28:00 -070039
40/* FIXME: Goodness! this really wants a small struct to hold the
41 * parameters. On x86 the args will get passed on the stack! */
42int qla4xxx_get_fwddb_entry(struct scsi_qla_host *ha,
43 uint16_t fw_ddb_index,
44 struct dev_db_entry *fw_ddb_entry,
45 dma_addr_t fw_ddb_entry_dma,
46 uint32_t *num_valid_ddb_entries,
47 uint32_t *next_ddb_index,
48 uint32_t *fw_ddb_device_state,
49 uint32_t *conn_err_detail,
50 uint16_t *tcp_source_port_num,
51 uint16_t *connection_id);
52
David Somayajuluafaf5a22006-09-19 10:28:00 -070053int qla4xxx_set_ddb_entry(struct scsi_qla_host * ha, uint16_t fw_ddb_index,
54 dma_addr_t fw_ddb_entry_dma);
Mike Christied00efe32011-07-25 13:48:38 -050055uint8_t qla4xxx_get_ifcb(struct scsi_qla_host *ha, uint32_t *mbox_cmd,
56 uint32_t *mbox_sts, dma_addr_t init_fw_cb_dma);
57int qla4xxx_conn_close_sess_logout(struct scsi_qla_host *ha,
58 uint16_t fw_ddb_index,
59 uint16_t connection_id,
60 uint16_t option);
61int qla4xxx_disable_acb(struct scsi_qla_host *ha);
62int qla4xxx_set_acb(struct scsi_qla_host *ha, uint32_t *mbox_cmd,
63 uint32_t *mbox_sts, dma_addr_t acb_dma);
64int qla4xxx_get_acb(struct scsi_qla_host *ha, uint32_t *mbox_cmd,
65 uint32_t *mbox_sts, dma_addr_t acb_dma);
David Somayajuluafaf5a22006-09-19 10:28:00 -070066void qla4xxx_mark_device_missing(struct scsi_qla_host *ha,
67 struct ddb_entry *ddb_entry);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053068u16 rd_nvram_word(struct scsi_qla_host *ha, int offset);
69void qla4xxx_get_crash_record(struct scsi_qla_host *ha);
David Somayajuluafaf5a22006-09-19 10:28:00 -070070struct ddb_entry *qla4xxx_alloc_sess(struct scsi_qla_host *ha);
71int qla4xxx_add_sess(struct ddb_entry *);
72void qla4xxx_destroy_sess(struct ddb_entry *ddb_entry);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053073int qla4xxx_is_nvram_configuration_valid(struct scsi_qla_host *ha);
Harish Zunjarrao7ad633c2011-05-17 23:17:11 -070074int qla4xxx_about_firmware(struct scsi_qla_host *ha);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053075void qla4xxx_interrupt_service_routine(struct scsi_qla_host *ha,
David Somayajuluafaf5a22006-09-19 10:28:00 -070076 uint32_t intr_status);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053077int qla4xxx_init_rings(struct scsi_qla_host *ha);
Vikas Chaudhary09a0f712010-04-28 11:42:24 +053078void qla4xxx_srb_compl(struct kref *ref);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053079struct srb *qla4xxx_del_from_active_array(struct scsi_qla_host *ha,
80 uint32_t index);
81int qla4xxx_reinitialize_ddb_list(struct scsi_qla_host *ha);
Vikas Chaudhary821d6e52010-04-28 11:41:21 +053082int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
83 uint32_t state, uint32_t conn_error);
David C Somayajulue08c1822007-05-23 18:14:34 -070084void qla4xxx_dump_buffer(void *b, uint32_t size);
David C Somayajulu9d562912008-03-19 11:23:03 -070085int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha,
86 struct ddb_entry *ddb_entry, int lun, uint16_t mrkr_mod);
Vikas Chaudhary821d6e52010-04-28 11:41:21 +053087int qla4_is_relogin_allowed(struct scsi_qla_host *ha, uint32_t conn_err);
Mike Christied00efe32011-07-25 13:48:38 -050088int qla4xxx_set_flash(struct scsi_qla_host *ha, dma_addr_t dma_addr,
89 uint32_t offset, uint32_t length, uint32_t options);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +053090int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
91 uint8_t outCount, uint32_t *mbx_cmd, uint32_t *mbx_sts);
92
93void qla4xxx_queue_iocb(struct scsi_qla_host *ha);
94void qla4xxx_complete_iocb(struct scsi_qla_host *ha);
95int qla4xxx_get_sys_info(struct scsi_qla_host *ha);
96int qla4xxx_iospace_config(struct scsi_qla_host *ha);
97void qla4xxx_pci_config(struct scsi_qla_host *ha);
98int qla4xxx_start_firmware(struct scsi_qla_host *ha);
99irqreturn_t qla4xxx_intr_handler(int irq, void *dev_id);
100uint16_t qla4xxx_rd_shdw_req_q_out(struct scsi_qla_host *ha);
101uint16_t qla4xxx_rd_shdw_rsp_q_in(struct scsi_qla_host *ha);
102int qla4xxx_request_irqs(struct scsi_qla_host *ha);
103void qla4xxx_free_irqs(struct scsi_qla_host *ha);
104void qla4xxx_process_response_queue(struct scsi_qla_host *ha);
105void qla4xxx_wake_dpc(struct scsi_qla_host *ha);
106void qla4xxx_get_conn_event_log(struct scsi_qla_host *ha);
Nilesh Javali21033632010-07-30 14:28:07 +0530107void qla4xxx_mailbox_premature_completion(struct scsi_qla_host *ha);
Karen Higgins91a772a2010-10-06 22:50:21 -0700108void qla4xxx_dump_registers(struct scsi_qla_host *ha);
Mike Christied00efe32011-07-25 13:48:38 -0500109uint8_t qla4xxx_update_local_ifcb(struct scsi_qla_host *ha,
110 uint32_t *mbox_cmd,
111 uint32_t *mbox_sts,
112 struct addr_ctrl_blk *init_fw_cb,
113 dma_addr_t init_fw_cb_dma);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +0530114
115void qla4_8xxx_pci_config(struct scsi_qla_host *);
116int qla4_8xxx_iospace_config(struct scsi_qla_host *ha);
117int qla4_8xxx_load_risc(struct scsi_qla_host *);
118irqreturn_t qla4_8xxx_intr_handler(int irq, void *dev_id);
119void qla4_8xxx_queue_iocb(struct scsi_qla_host *ha);
120void qla4_8xxx_complete_iocb(struct scsi_qla_host *ha);
121
122int qla4_8xxx_crb_win_lock(struct scsi_qla_host *);
123void qla4_8xxx_crb_win_unlock(struct scsi_qla_host *);
124int qla4_8xxx_pci_get_crb_addr_2M(struct scsi_qla_host *, ulong *);
125void qla4_8xxx_wr_32(struct scsi_qla_host *, ulong, u32);
126int qla4_8xxx_rd_32(struct scsi_qla_host *, ulong);
127int qla4_8xxx_pci_mem_read_2M(struct scsi_qla_host *, u64, void *, int);
128int qla4_8xxx_pci_mem_write_2M(struct scsi_qla_host *ha, u64, void *, int);
129int qla4_8xxx_isp_reset(struct scsi_qla_host *ha);
130void qla4_8xxx_interrupt_service_routine(struct scsi_qla_host *ha,
131 uint32_t intr_status);
132uint16_t qla4_8xxx_rd_shdw_req_q_out(struct scsi_qla_host *ha);
133uint16_t qla4_8xxx_rd_shdw_rsp_q_in(struct scsi_qla_host *ha);
134int qla4_8xxx_get_sys_info(struct scsi_qla_host *ha);
135void qla4_8xxx_watchdog(struct scsi_qla_host *ha);
136int qla4_8xxx_stop_firmware(struct scsi_qla_host *ha);
137int qla4_8xxx_get_flash_info(struct scsi_qla_host *ha);
138void qla4_8xxx_enable_intrs(struct scsi_qla_host *ha);
139void qla4_8xxx_disable_intrs(struct scsi_qla_host *ha);
140int qla4_8xxx_enable_msix(struct scsi_qla_host *ha);
141void qla4_8xxx_disable_msix(struct scsi_qla_host *ha);
142irqreturn_t qla4_8xxx_msi_handler(int irq, void *dev_id);
143irqreturn_t qla4_8xxx_default_intr_handler(int irq, void *dev_id);
144irqreturn_t qla4_8xxx_msix_rsp_q(int irq, void *dev_id);
145void qla4xxx_mark_all_devices_missing(struct scsi_qla_host *ha);
146void qla4xxx_dead_adapter_cleanup(struct scsi_qla_host *ha);
147int qla4_8xxx_idc_lock(struct scsi_qla_host *ha);
148void qla4_8xxx_idc_unlock(struct scsi_qla_host *ha);
149int qla4_8xxx_device_state_handler(struct scsi_qla_host *ha);
150void qla4_8xxx_need_qsnt_handler(struct scsi_qla_host *ha);
151void qla4_8xxx_clear_drv_active(struct scsi_qla_host *ha);
Andrew Morton626115c2010-08-19 14:13:42 -0700152void qla4_8xxx_set_drv_active(struct scsi_qla_host *ha);
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +0530153
Andrew Vasquez11010fe2006-10-06 09:54:59 -0700154extern int ql4xextended_error_logging;
David Somayajuluafaf5a22006-09-19 10:28:00 -0700155extern int ql4xdontresethba;
Vikas Chaudharyf4f5df232010-07-28 15:53:44 +0530156extern int ql4xenablemsix;
157
Harish Zunjarrao7ad633c2011-05-17 23:17:11 -0700158extern struct device_attribute *qla4xxx_host_attrs[];
David C Somayajulud9150582006-11-15 17:38:40 -0800159#endif /* _QLA4x_GBL_H */