#include "qla_def.h"
#include "qla_target.h"
#include <linux/delay.h>
#include <linux/gfp.h>
#ifdef CONFIG_PPC
#define IS_PPCARCH …
#else
#define IS_PPCARCH …
#endif
static struct mb_cmd_name { … } mb_str[] = …;
static const char *mb_to_str(uint16_t cmd)
{ … }
static struct rom_cmd { … } rom_cmds[] = …;
static int is_rom_cmd(uint16_t cmd)
{ … }
static int
qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
{ … }
int
qla2x00_load_ram(scsi_qla_host_t *vha, dma_addr_t req_dma, uint32_t risc_addr,
uint32_t risc_code_size)
{ … }
#define NVME_ENABLE_FLAG …
#define EDIF_HW_SUPPORT …
int
qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr)
{ … }
#define FETCH_XLOGINS_STAT …
int
qla_get_exlogin_status(scsi_qla_host_t *vha, uint16_t *buf_sz,
uint16_t *ex_logins_cnt)
{ … }
#define CONFIG_XLOGINS_MEM …
int
qla_set_exlogin_mem_cfg(scsi_qla_host_t *vha, dma_addr_t phys_addr)
{ … }
#define FETCH_XCHOFFLD_STAT …
int
qla_get_exchoffld_status(scsi_qla_host_t *vha, uint16_t *buf_sz,
uint16_t *ex_logins_cnt)
{ … }
#define CONFIG_XCHOFFLD_MEM …
int
qla_set_exchoffld_mem_cfg(scsi_qla_host_t *vha)
{ … }
int
qla2x00_get_fw_version(scsi_qla_host_t *vha)
{ … }
int
qla2x00_get_fw_options(scsi_qla_host_t *vha, uint16_t *fwopts)
{ … }
int
qla2x00_set_fw_options(scsi_qla_host_t *vha, uint16_t *fwopts)
{ … }
int
qla2x00_mbx_reg_test(scsi_qla_host_t *vha)
{ … }
int
qla2x00_verify_checksum(scsi_qla_host_t *vha, uint32_t risc_addr)
{ … }
int
qla2x00_issue_iocb_timeout(scsi_qla_host_t *vha, void *buffer,
dma_addr_t phys_addr, size_t size, uint32_t tov)
{ … }
int
qla2x00_issue_iocb(scsi_qla_host_t *vha, void *buffer, dma_addr_t phys_addr,
size_t size)
{ … }
int
qla2x00_abort_command(srb_t *sp)
{ … }
int
qla2x00_abort_target(struct fc_port *fcport, uint64_t l, int tag)
{ … }
int
qla2x00_lun_reset(struct fc_port *fcport, uint64_t l, int tag)
{ … }
int
qla2x00_get_adapter_id(scsi_qla_host_t *vha, uint16_t *id, uint8_t *al_pa,
uint8_t *area, uint8_t *domain, uint16_t *top, uint16_t *sw_cap)
{ … }
int
qla2x00_get_retry_cnt(scsi_qla_host_t *vha, uint8_t *retry_cnt, uint8_t *tov,
uint16_t *r_a_tov)
{ … }
int
qla2x00_init_firmware(scsi_qla_host_t *vha, uint16_t size)
{ … }
int
qla2x00_get_port_database(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t opt)
{ … }
int
qla24xx_get_port_database(scsi_qla_host_t *vha, u16 nport_handle,
struct port_database_24xx *pdb)
{ … }
int
qla2x00_get_firmware_state(scsi_qla_host_t *vha, uint16_t *states)
{ … }
int
qla2x00_get_port_name(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t *name,
uint8_t opt)
{ … }
int
qla24xx_link_initialize(scsi_qla_host_t *vha)
{ … }
int
qla2x00_lip_reset(scsi_qla_host_t *vha)
{ … }
int
qla2x00_send_sns(scsi_qla_host_t *vha, dma_addr_t sns_phys_address,
uint16_t cmd_size, size_t buf_size)
{ … }
int
qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
uint8_t area, uint8_t al_pa, uint16_t *mb, uint8_t opt)
{ … }
int
qla2x00_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
uint8_t area, uint8_t al_pa, uint16_t *mb, uint8_t opt)
{ … }
int
qla2x00_login_local_device(scsi_qla_host_t *vha, fc_port_t *fcport,
uint16_t *mb_ret, uint8_t opt)
{ … }
int
qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
uint8_t area, uint8_t al_pa)
{ … }
int
qla2x00_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
uint8_t area, uint8_t al_pa)
{ … }
int
qla2x00_full_login_lip(scsi_qla_host_t *vha)
{ … }
int
qla2x00_get_id_list(scsi_qla_host_t *vha, void *id_list, dma_addr_t id_list_dma,
uint16_t *entries)
{ … }
int
qla2x00_get_resource_cnts(scsi_qla_host_t *vha)
{ … }
int
qla2x00_get_fcal_position_map(scsi_qla_host_t *vha, char *pos_map,
u8 *num_entries)
{ … }
int
qla2x00_get_link_status(scsi_qla_host_t *vha, uint16_t loop_id,
struct link_statistics *stats, dma_addr_t stats_dma)
{ … }
int
qla24xx_get_isp_stats(scsi_qla_host_t *vha, struct link_statistics *stats,
dma_addr_t stats_dma, uint16_t options)
{ … }
int
qla24xx_abort_command(srb_t *sp)
{ … }
struct tsk_mgmt_cmd { … };
static int
__qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport,
uint64_t l, int tag)
{ … }
int
qla24xx_abort_target(struct fc_port *fcport, uint64_t l, int tag)
{ … }
int
qla24xx_lun_reset(struct fc_port *fcport, uint64_t l, int tag)
{ … }
int
qla2x00_system_error(scsi_qla_host_t *vha)
{ … }
int
qla2x00_write_serdes_word(scsi_qla_host_t *vha, uint16_t addr, uint16_t data)
{ … }
int
qla2x00_read_serdes_word(scsi_qla_host_t *vha, uint16_t addr, uint16_t *data)
{ … }
int
qla8044_write_serdes_word(scsi_qla_host_t *vha, uint32_t addr, uint32_t data)
{ … }
int
qla8044_read_serdes_word(scsi_qla_host_t *vha, uint32_t addr, uint32_t *data)
{ … }
int
qla2x00_set_serdes_params(scsi_qla_host_t *vha, uint16_t sw_em_1g,
uint16_t sw_em_2g, uint16_t sw_em_4g)
{ … }
int
qla2x00_stop_firmware(scsi_qla_host_t *vha)
{ … }
int
qla2x00_enable_eft_trace(scsi_qla_host_t *vha, dma_addr_t eft_dma,
uint16_t buffers)
{ … }
int
qla2x00_disable_eft_trace(scsi_qla_host_t *vha)
{ … }
int
qla2x00_enable_fce_trace(scsi_qla_host_t *vha, dma_addr_t fce_dma,
uint16_t buffers, uint16_t *mb, uint32_t *dwords)
{ … }
int
qla2x00_disable_fce_trace(scsi_qla_host_t *vha, uint64_t *wr, uint64_t *rd)
{ … }
int
qla2x00_get_idma_speed(scsi_qla_host_t *vha, uint16_t loop_id,
uint16_t *port_speed, uint16_t *mb)
{ … }
int
qla2x00_set_idma_speed(scsi_qla_host_t *vha, uint16_t loop_id,
uint16_t port_speed, uint16_t *mb)
{ … }
void
qla24xx_report_id_acquisition(scsi_qla_host_t *vha,
struct vp_rpt_id_entry_24xx *rptid_entry)
{ … }
int
qla24xx_modify_vp_config(scsi_qla_host_t *vha)
{ … }
int
qla2x00_send_change_request(scsi_qla_host_t *vha, uint16_t format,
uint16_t vp_idx)
{ … }
int
qla2x00_dump_ram(scsi_qla_host_t *vha, dma_addr_t req_dma, uint32_t addr,
uint32_t size)
{ … }
struct cs84xx_mgmt_cmd { … };
int
qla84xx_verify_chip(struct scsi_qla_host *vha, uint16_t *status)
{ … }
int
qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req)
{ … }
int
qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp)
{ … }
int
qla81xx_idc_ack(scsi_qla_host_t *vha, uint16_t *mb)
{ … }
int
qla81xx_fac_get_sector_size(scsi_qla_host_t *vha, uint32_t *sector_size)
{ … }
int
qla81xx_fac_do_write_enable(scsi_qla_host_t *vha, int enable)
{ … }
int
qla81xx_fac_erase_sector(scsi_qla_host_t *vha, uint32_t start, uint32_t finish)
{ … }
int
qla81xx_fac_semaphore_access(scsi_qla_host_t *vha, int lock)
{ … }
int
qla81xx_restart_mpi_firmware(scsi_qla_host_t *vha)
{ … }
int
qla82xx_set_driver_version(scsi_qla_host_t *vha, char *version)
{ … }
int
qla25xx_set_driver_version(scsi_qla_host_t *vha, char *version)
{ … }
int
qla24xx_get_port_login_templ(scsi_qla_host_t *vha, dma_addr_t buf_dma,
void *buf, uint16_t bufsiz)
{ … }
#define PUREX_CMD_COUNT …
int
qla25xx_set_els_cmds_supported(scsi_qla_host_t *vha)
{ … }
static int
qla2x00_read_asic_temperature(scsi_qla_host_t *vha, uint16_t *temp)
{ … }
int
qla2x00_read_sfp(scsi_qla_host_t *vha, dma_addr_t sfp_dma, uint8_t *sfp,
uint16_t dev, uint16_t off, uint16_t len, uint16_t opt)
{ … }
int
qla2x00_write_sfp(scsi_qla_host_t *vha, dma_addr_t sfp_dma, uint8_t *sfp,
uint16_t dev, uint16_t off, uint16_t len, uint16_t opt)
{ … }
int
qla2x00_get_xgmac_stats(scsi_qla_host_t *vha, dma_addr_t stats_dma,
uint16_t size_in_bytes, uint16_t *actual_size)
{ … }
int
qla2x00_get_dcbx_params(scsi_qla_host_t *vha, dma_addr_t tlv_dma,
uint16_t size)
{ … }
int
qla2x00_read_ram_word(scsi_qla_host_t *vha, uint32_t risc_addr, uint32_t *data)
{ … }
int
qla2x00_loopback_test(scsi_qla_host_t *vha, struct msg_echo_lb *mreq,
uint16_t *mresp)
{ … }
int
qla2x00_echo_test(scsi_qla_host_t *vha, struct msg_echo_lb *mreq,
uint16_t *mresp)
{ … }
int
qla84xx_reset_chip(scsi_qla_host_t *vha, uint16_t enable_diagnostic)
{ … }
int
qla2x00_write_ram_word(scsi_qla_host_t *vha, uint32_t risc_addr, uint32_t data)
{ … }
int
qla81xx_write_mpi_register(scsi_qla_host_t *vha, uint16_t *mb)
{ … }
int
qla2x00_set_data_rate(scsi_qla_host_t *vha, uint16_t mode)
{ … }
int
qla2x00_get_data_rate(scsi_qla_host_t *vha)
{ … }
int
qla81xx_get_port_config(scsi_qla_host_t *vha, uint16_t *mb)
{ … }
int
qla81xx_set_port_config(scsi_qla_host_t *vha, uint16_t *mb)
{ … }
int
qla24xx_set_fcp_prio(scsi_qla_host_t *vha, uint16_t loop_id, uint16_t priority,
uint16_t *mb)
{ … }
int
qla2x00_get_thermal_temp(scsi_qla_host_t *vha, uint16_t *temp)
{ … }
int
qla82xx_mbx_intr_enable(scsi_qla_host_t *vha)
{ … }
int
qla82xx_mbx_intr_disable(scsi_qla_host_t *vha)
{ … }
int
qla82xx_md_get_template_size(scsi_qla_host_t *vha)
{ … }
int
qla82xx_md_get_template(scsi_qla_host_t *vha)
{ … }
int
qla8044_md_get_template(scsi_qla_host_t *vha)
{ … }
int
qla81xx_set_led_config(scsi_qla_host_t *vha, uint16_t *led_cfg)
{ … }
int
qla81xx_get_led_config(scsi_qla_host_t *vha, uint16_t *led_cfg)
{ … }
int
qla82xx_mbx_beacon_ctl(scsi_qla_host_t *vha, int enable)
{ … }
int
qla83xx_wr_reg(scsi_qla_host_t *vha, uint32_t reg, uint32_t data)
{ … }
int
qla2x00_port_logout(scsi_qla_host_t *vha, struct fc_port *fcport)
{ … }
int
qla83xx_rd_reg(scsi_qla_host_t *vha, uint32_t reg, uint32_t *data)
{ … }
int
qla83xx_restart_nic_firmware(scsi_qla_host_t *vha)
{ … }
int
qla83xx_access_control(scsi_qla_host_t *vha, uint16_t options,
uint32_t start_addr, uint32_t end_addr, uint16_t *sector_size)
{ … }
int
qla2x00_dump_mctp_data(scsi_qla_host_t *vha, dma_addr_t req_dma, uint32_t addr,
uint32_t size)
{ … }
int
qla26xx_dport_diagnostics(scsi_qla_host_t *vha,
void *dd_buf, uint size, uint options)
{ … }
int
qla26xx_dport_diagnostics_v2(scsi_qla_host_t *vha,
struct qla_dport_diag_v2 *dd, mbx_cmd_t *mcp)
{ … }
static void qla2x00_async_mb_sp_done(srb_t *sp, int res)
{ … }
int qla24xx_send_mb_cmd(struct scsi_qla_host *vha, mbx_cmd_t *mcp)
{ … }
int qla24xx_gpdb_wait(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)
{ … }
int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport,
struct port_database_24xx *pd)
{ … }
int qla24xx_gidlist_wait(struct scsi_qla_host *vha,
void *id_list, dma_addr_t id_list_dma, uint16_t *entries)
{ … }
int qla27xx_set_zio_threshold(scsi_qla_host_t *vha, uint16_t value)
{ … }
int qla27xx_get_zio_threshold(scsi_qla_host_t *vha, uint16_t *value)
{ … }
int
qla2x00_read_sfp_dev(struct scsi_qla_host *vha, char *buf, int count)
{ … }
int qla24xx_res_count_wait(struct scsi_qla_host *vha,
uint16_t *out_mb, int out_mb_sz)
{ … }
int qla28xx_secure_flash_update(scsi_qla_host_t *vha, uint16_t opts,
uint16_t region, uint32_t len, dma_addr_t sfub_dma_addr,
uint32_t sfub_len)
{ … }
int qla2xxx_write_remote_register(scsi_qla_host_t *vha, uint32_t addr,
uint32_t data)
{ … }
int qla2xxx_read_remote_register(scsi_qla_host_t *vha, uint32_t addr,
uint32_t *data)
{ … }
int
ql26xx_led_config(scsi_qla_host_t *vha, uint16_t options, uint16_t *led)
{ … }
void qla_no_op_mb(struct scsi_qla_host *vha)
{ … }
int qla_mailbox_passthru(scsi_qla_host_t *vha,
uint16_t *mbx_in, uint16_t *mbx_out)
{ … }