^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * QLogic iSCSI HBA Driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (c) 2003-2013 QLogic Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #ifndef __QLA4x_GBL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define __QLA4x_GBL_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) struct iscsi_cls_conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) int qla4xxx_hw_reset(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) int ql4xxx_lock_drvr_wait(struct scsi_qla_host *a);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb *srb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) int qla4xxx_initialize_adapter(struct scsi_qla_host *ha, int is_reset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) int qla4xxx_soft_reset(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) irqreturn_t qla4xxx_intr_handler(int irq, void *dev_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) void qla4xxx_free_ddb(struct scsi_qla_host *ha, struct ddb_entry *ddb_entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) void qla4xxx_process_aen(struct scsi_qla_host *ha, uint8_t process_aen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) int qla4xxx_get_dhcp_ip_address(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) int qla4xxx_abort_task(struct scsi_qla_host *ha, struct srb *srb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) int qla4xxx_reset_lun(struct scsi_qla_host *ha, struct ddb_entry *ddb_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) uint64_t lun);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) int qla4xxx_reset_target(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct ddb_entry *ddb_entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) int qla4xxx_get_flash(struct scsi_qla_host *ha, dma_addr_t dma_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) uint32_t offset, uint32_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) int qla4xxx_get_firmware_status(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) int qla4xxx_get_firmware_state(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) int qla4xxx_initialize_fw_cb(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) /* FIXME: Goodness! this really wants a small struct to hold the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * parameters. On x86 the args will get passed on the stack! */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) int qla4xxx_get_fwddb_entry(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) uint16_t fw_ddb_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct dev_db_entry *fw_ddb_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) dma_addr_t fw_ddb_entry_dma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) uint32_t *num_valid_ddb_entries,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) uint32_t *next_ddb_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) uint32_t *fw_ddb_device_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) uint32_t *conn_err_detail,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) uint16_t *tcp_source_port_num,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) uint16_t *connection_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) int qla4xxx_set_ddb_entry(struct scsi_qla_host * ha, uint16_t fw_ddb_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) dma_addr_t fw_ddb_entry_dma, uint32_t *mbx_sts);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) uint8_t qla4xxx_get_ifcb(struct scsi_qla_host *ha, uint32_t *mbox_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) uint32_t *mbox_sts, dma_addr_t init_fw_cb_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) int qla4xxx_conn_close_sess_logout(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) uint16_t fw_ddb_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) uint16_t connection_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) uint16_t option);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) int qla4xxx_disable_acb(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) int qla4xxx_set_acb(struct scsi_qla_host *ha, uint32_t *mbox_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) uint32_t *mbox_sts, dma_addr_t acb_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) int qla4xxx_get_acb(struct scsi_qla_host *ha, dma_addr_t acb_dma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) uint32_t acb_type, uint32_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) int qla4xxx_get_ip_state(struct scsi_qla_host *ha, uint32_t acb_idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) uint32_t ip_idx, uint32_t *sts);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) void qla4xxx_mark_device_missing(struct iscsi_cls_session *cls_session);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) u16 rd_nvram_word(struct scsi_qla_host *ha, int offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) u8 rd_nvram_byte(struct scsi_qla_host *ha, int offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) void qla4xxx_get_crash_record(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) int qla4xxx_is_nvram_configuration_valid(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) int qla4xxx_about_firmware(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) void qla4xxx_interrupt_service_routine(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) uint32_t intr_status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) int qla4xxx_init_rings(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) void qla4xxx_srb_compl(struct kref *ref);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) struct srb *qla4xxx_del_from_active_array(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) uint32_t index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) uint32_t state, uint32_t conn_error);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) void qla4xxx_dump_buffer(void *b, uint32_t size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) struct ddb_entry *ddb_entry, uint64_t lun, uint16_t mrkr_mod);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) int qla4xxx_set_flash(struct scsi_qla_host *ha, dma_addr_t dma_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) uint32_t offset, uint32_t length, uint32_t options);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) uint8_t outCount, uint32_t *mbx_cmd, uint32_t *mbx_sts);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) int qla4xxx_get_chap_index(struct scsi_qla_host *ha, char *username,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) char *password, int bidi, uint16_t *chap_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) uint16_t idx, int bidi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) void qla4xxx_queue_iocb(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) void qla4xxx_complete_iocb(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) int qla4xxx_get_sys_info(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) int qla4xxx_iospace_config(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) void qla4xxx_pci_config(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) int qla4xxx_start_firmware(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) irqreturn_t qla4xxx_intr_handler(int irq, void *dev_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) uint16_t qla4xxx_rd_shdw_req_q_out(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) uint16_t qla4xxx_rd_shdw_rsp_q_in(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) int qla4xxx_request_irqs(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) void qla4xxx_free_irqs(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) void qla4xxx_process_response_queue(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) void qla4xxx_wake_dpc(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) void qla4xxx_get_conn_event_log(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) void qla4xxx_mailbox_premature_completion(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) void qla4xxx_dump_registers(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) uint8_t qla4xxx_update_local_ifcb(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) uint32_t *mbox_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) uint32_t *mbox_sts,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) struct addr_ctrl_blk *init_fw_cb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) dma_addr_t init_fw_cb_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) void qla4_8xxx_pci_config(struct scsi_qla_host *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) int qla4_8xxx_iospace_config(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) int qla4_8xxx_load_risc(struct scsi_qla_host *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) irqreturn_t qla4_82xx_intr_handler(int irq, void *dev_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) void qla4_82xx_queue_iocb(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) void qla4_82xx_complete_iocb(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) int qla4_82xx_crb_win_lock(struct scsi_qla_host *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) void qla4_82xx_crb_win_unlock(struct scsi_qla_host *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) int qla4_82xx_pci_get_crb_addr_2M(struct scsi_qla_host *, ulong *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) void qla4_82xx_wr_32(struct scsi_qla_host *, ulong, u32);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) uint32_t qla4_82xx_rd_32(struct scsi_qla_host *, ulong);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) int qla4_82xx_pci_mem_read_2M(struct scsi_qla_host *, u64, void *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) int qla4_82xx_pci_mem_write_2M(struct scsi_qla_host *ha, u64, void *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) int qla4_82xx_isp_reset(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) void qla4_82xx_interrupt_service_routine(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) uint32_t intr_status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) uint16_t qla4_82xx_rd_shdw_req_q_out(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) uint16_t qla4_82xx_rd_shdw_rsp_q_in(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) int qla4_8xxx_get_sys_info(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) void qla4_8xxx_watchdog(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) int qla4_8xxx_stop_firmware(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) int qla4_8xxx_get_flash_info(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) void qla4_82xx_enable_intrs(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) void qla4_82xx_disable_intrs(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) int qla4_8xxx_enable_msix(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) irqreturn_t qla4_8xxx_msi_handler(int irq, void *dev_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) irqreturn_t qla4_8xxx_default_intr_handler(int irq, void *dev_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) irqreturn_t qla4_8xxx_msix_rsp_q(int irq, void *dev_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) void qla4xxx_mark_all_devices_missing(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) void qla4xxx_dead_adapter_cleanup(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) int qla4_82xx_idc_lock(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) void qla4_82xx_idc_unlock(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) int qla4_8xxx_device_state_handler(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) void qla4_8xxx_need_qsnt_handler(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) void qla4_8xxx_clear_drv_active(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) void qla4_8xxx_set_drv_active(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) int qla4xxx_conn_open(struct scsi_qla_host *ha, uint16_t fw_ddb_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) int qla4xxx_set_param_ddbentry(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) struct ddb_entry *ddb_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) struct iscsi_cls_conn *cls_conn,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) uint32_t *mbx_sts);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) int qla4xxx_session_logout_ddb(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) struct ddb_entry *ddb_entry, int options);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) int qla4xxx_req_ddb_entry(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) uint32_t *mbx_sts);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) int qla4xxx_clear_ddb_entry(struct scsi_qla_host *ha, uint32_t fw_ddb_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) int qla4xxx_send_passthru0(struct iscsi_task *task);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) void qla4xxx_free_ddb_index(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) int qla4xxx_get_mgmt_data(struct scsi_qla_host *ha, uint16_t fw_ddb_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) uint16_t stats_size, dma_addr_t stats_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) struct ddb_entry *ddb_entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) void qla4xxx_update_session_conn_fwddb_param(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) struct ddb_entry *ddb_entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) int qla4xxx_bootdb_by_index(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) struct dev_db_entry *fw_ddb_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) dma_addr_t fw_ddb_entry_dma, uint16_t ddb_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) char *password, uint16_t idx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) int qla4xxx_get_nvram(struct scsi_qla_host *ha, dma_addr_t nvram_dma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) uint32_t offset, uint32_t size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) int qla4xxx_set_nvram(struct scsi_qla_host *ha, dma_addr_t nvram_dma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) uint32_t offset, uint32_t size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) int qla4xxx_restore_factory_defaults(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) uint32_t region, uint32_t field0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) uint32_t field1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) int qla4xxx_get_ddb_index(struct scsi_qla_host *ha, uint16_t *ddb_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) void qla4xxx_login_flash_ddb(struct iscsi_cls_session *cls_session);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) int qla4xxx_unblock_ddb(struct iscsi_cls_session *cls_session);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) int qla4xxx_unblock_flash_ddb(struct iscsi_cls_session *cls_session);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) int qla4xxx_flash_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) struct ddb_entry *ddb_entry, uint32_t state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) int qla4xxx_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) struct ddb_entry *ddb_entry, uint32_t state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) void qla4xxx_build_ddb_list(struct scsi_qla_host *ha, int is_reset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) int qla4xxx_post_aen_work(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) enum iscsi_host_event_code aen_code,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) uint32_t data_size, uint8_t *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) int qla4xxx_ping_iocb(struct scsi_qla_host *ha, uint32_t options,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) uint32_t payload_size, uint32_t pid, uint8_t *ipaddr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) int qla4xxx_post_ping_evt_work(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) uint32_t status, uint32_t pid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) uint32_t data_size, uint8_t *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) int qla4xxx_flashdb_by_index(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) struct dev_db_entry *fw_ddb_entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) dma_addr_t fw_ddb_entry_dma, uint16_t ddb_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) /* BSG Functions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) int qla4xxx_bsg_request(struct bsg_job *bsg_job);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) int qla4xxx_process_vendor_specific(struct bsg_job *bsg_job);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) void qla4xxx_arm_relogin_timer(struct ddb_entry *ddb_entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) int qla4xxx_get_minidump_template(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) dma_addr_t phys_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) int qla4xxx_req_template_size(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) void qla4_8xxx_alloc_sysfs_attr(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) void qla4_8xxx_free_sysfs_attr(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) void qla4xxx_alloc_fw_dump(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) int qla4_82xx_try_start_fw(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) int qla4_8xxx_need_reset(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) int qla4_82xx_md_rd_32(struct scsi_qla_host *ha, uint32_t off, uint32_t *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) int qla4_82xx_md_wr_32(struct scsi_qla_host *ha, uint32_t off, uint32_t data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) void qla4_82xx_rom_lock_recovery(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) void qla4_82xx_queue_mbox_cmd(struct scsi_qla_host *ha, uint32_t *mbx_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) int incount);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) void qla4_82xx_process_mbox_intr(struct scsi_qla_host *ha, int outcount);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) void qla4xxx_queue_mbox_cmd(struct scsi_qla_host *ha, uint32_t *mbx_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) int incount);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) void qla4xxx_process_mbox_intr(struct scsi_qla_host *ha, int outcount);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) void qla4_8xxx_dump_peg_reg(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) void qla4_83xx_disable_intrs(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) void qla4_83xx_enable_intrs(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) int qla4_83xx_start_firmware(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) irqreturn_t qla4_83xx_intr_handler(int irq, void *dev_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) void qla4_83xx_interrupt_service_routine(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) uint32_t intr_status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) int qla4_83xx_isp_reset(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) void qla4_83xx_queue_iocb(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) void qla4_83xx_complete_iocb(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) uint32_t qla4_83xx_rd_reg(struct scsi_qla_host *ha, ulong addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) void qla4_83xx_wr_reg(struct scsi_qla_host *ha, ulong addr, uint32_t val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) int qla4_83xx_rd_reg_indirect(struct scsi_qla_host *ha, uint32_t addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) uint32_t *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) int qla4_83xx_wr_reg_indirect(struct scsi_qla_host *ha, uint32_t addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) uint32_t data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) int qla4_83xx_drv_lock(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) void qla4_83xx_drv_unlock(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) void qla4_83xx_rom_lock_recovery(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) void qla4_83xx_queue_mbox_cmd(struct scsi_qla_host *ha, uint32_t *mbx_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) int incount);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) void qla4_83xx_process_mbox_intr(struct scsi_qla_host *ha, int outcount);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) void qla4_83xx_read_reset_template(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) void qla4_83xx_set_idc_dontreset(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) int qla4_83xx_idc_dontreset(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) int qla4_83xx_lockless_flash_read_u32(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) uint32_t flash_addr, uint8_t *p_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) int u32_word_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) void qla4_83xx_clear_idc_dontreset(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) void qla4_83xx_need_reset_handler(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) int qla4_83xx_flash_read_u32(struct scsi_qla_host *ha, uint32_t flash_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) uint8_t *p_data, int u32_word_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) void qla4_83xx_get_idc_param(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) void qla4_8xxx_set_rst_ready(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) void qla4_8xxx_clear_rst_ready(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) int qla4_8xxx_device_bootstrap(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) void qla4_8xxx_get_minidump(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) int qla4_8xxx_intr_disable(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) int qla4_8xxx_intr_enable(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) int qla4_8xxx_update_idc_reg(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) int qla4_83xx_post_idc_ack(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) void qla4_83xx_disable_pause(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) void qla4_83xx_enable_mbox_intrs(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) int qla4_83xx_can_perform_reset(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) int qla4xxx_get_default_ddb(struct scsi_qla_host *ha, uint32_t options,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) dma_addr_t dma_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) int qla4xxx_get_uni_chap_at_index(struct scsi_qla_host *ha, char *username,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) char *password, uint16_t chap_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) int qla4xxx_disable_acb(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) int qla4xxx_set_acb(struct scsi_qla_host *ha, uint32_t *mbox_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) uint32_t *mbox_sts, dma_addr_t acb_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) int qla4xxx_get_acb(struct scsi_qla_host *ha, dma_addr_t acb_dma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) uint32_t acb_type, uint32_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) int qla4_84xx_config_acb(struct scsi_qla_host *ha, int acb_config);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) int qla4_8xxx_ms_mem_write_128b(struct scsi_qla_host *ha,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) uint64_t addr, uint32_t *data, uint32_t count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) uint8_t qla4xxx_set_ipaddr_state(uint8_t fw_ipaddr_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) int qla4_83xx_get_port_config(struct scsi_qla_host *ha, uint32_t *config);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) int qla4_83xx_set_port_config(struct scsi_qla_host *ha, uint32_t *config);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) int qla4_8xxx_check_init_adapter_retry(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) int qla4_83xx_is_detached(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) int qla4xxx_sysfs_ddb_export(struct scsi_qla_host *ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) extern int ql4xextended_error_logging;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) extern int ql4xdontresethba;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) extern int ql4xenablemsix;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) extern int ql4xmdcapmask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) extern int ql4xenablemd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) extern struct device_attribute *qla4xxx_host_attrs[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) #endif /* _QLA4x_GBL_H */