qla2x00t: Change return (x) into return x

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7458 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2018-08-03 03:09:58 +00:00
parent 1b18174c12
commit d07888d5f9
10 changed files with 216 additions and 216 deletions

View File

@@ -611,7 +611,7 @@ qla2x00_sysfs_write_fw_dump(struct file *file,
int reading;
if (off != 0)
return (0);
return 0;
reading = simple_strtol(buf, NULL, 10);
switch (reading) {
@@ -2313,7 +2313,7 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable)
if (ret) {
ql_log(ql_log_warn, vha, 0x707e,
"Vport sanity check failed, status %x\n", ret);
return (ret);
return ret;
}
vha = qla24xx_create_vhost(fc_vport);

View File

@@ -49,7 +49,7 @@ qla2x00_prep_ms_iocb(scsi_qla_host_t *vha, uint32_t req_size, uint32_t rsp_size)
ms_pkt->dseg_rsp_address[1] = cpu_to_le32(MSD(ha->ct_sns_dma));
ms_pkt->dseg_rsp_length = ms_pkt->rsp_bytecount;
return (ms_pkt);
return ms_pkt;
}
/**
@@ -87,7 +87,7 @@ qla24xx_prep_ms_iocb(scsi_qla_host_t *vha, uint32_t req_size, uint32_t rsp_size)
ct_pkt->dseg_1_len = ct_pkt->rsp_byte_count;
ct_pkt->vp_index = vha->vp_idx;
return (ct_pkt);
return ct_pkt;
}
/**
@@ -111,7 +111,7 @@ qla2x00_prep_ct_req(struct ct_sns_pkt *ct_pkt, uint16_t cmd, uint16_t rsp_size)
ct_req->command = cpu_to_be16(cmd);
ct_req->max_rsp_size = cpu_to_be16((rsp_size - 16) / 4);
return (ct_req);
return ct_req;
}
static int
@@ -239,7 +239,7 @@ qla2x00_ga_nxt(scsi_qla_host_t *vha, fc_port_t *fcport)
fcport->d_id.b.al_pa);
}
return (rval);
return rval;
}
static inline int
@@ -325,7 +325,7 @@ qla2x00_gid_pt(scsi_qla_host_t *vha, sw_info_t *list)
rval = QLA_FUNCTION_FAILED;
}
return (rval);
return rval;
}
/**
@@ -388,7 +388,7 @@ qla2x00_gpn_id(scsi_qla_host_t *vha, sw_info_t *list)
break;
}
return (rval);
return rval;
}
/**
@@ -465,7 +465,7 @@ qla2x00_gnn_id(scsi_qla_host_t *vha, sw_info_t *list)
break;
}
return (rval);
return rval;
}
/**
@@ -517,7 +517,7 @@ qla2x00_rft_id(scsi_qla_host_t *vha)
"RFT_ID exiting normally.\n");
}
return (rval);
return rval;
}
/**
@@ -538,7 +538,7 @@ qla2x00_rff_id(scsi_qla_host_t *vha)
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
ql_dbg(ql_dbg_disc, vha, 0x2046,
"RFF_ID call not supported on ISP2100/ISP2200.\n");
return (QLA_SUCCESS);
return QLA_SUCCESS;
}
/* Issue RFF_ID */
@@ -584,7 +584,7 @@ qla2x00_rff_id(scsi_qla_host_t *vha)
"RFF_ID exiting normally.\n");
}
return (rval);
return rval;
}
/**
@@ -636,7 +636,7 @@ qla2x00_rnn_id(scsi_qla_host_t *vha)
"RNN_ID exiting normally.\n");
}
return (rval);
return rval;
}
void
@@ -666,7 +666,7 @@ qla2x00_rsnn_nn(scsi_qla_host_t *vha)
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
ql_dbg(ql_dbg_disc, vha, 0x2050,
"RSNN_ID call unsupported on ISP2100/ISP2200.\n");
return (QLA_SUCCESS);
return QLA_SUCCESS;
}
/* Issue RSNN_NN */
@@ -708,7 +708,7 @@ qla2x00_rsnn_nn(scsi_qla_host_t *vha)
"RSNN_NN exiting normally.\n");
}
return (rval);
return rval;
}
/**
@@ -739,7 +739,7 @@ qla2x00_prep_sns_cmd(scsi_qla_host_t *vha, uint16_t cmd, uint16_t scmd_len,
wc = (data_size - 16) / 4; /* Size in 32bit words. */
sns_cmd->p.cmd.size = cpu_to_le16(wc);
return (sns_cmd);
return sns_cmd;
}
/**
@@ -811,7 +811,7 @@ qla2x00_sns_ga_nxt(scsi_qla_host_t *vha, fc_port_t *fcport)
fcport->d_id.b.al_pa);
}
return (rval);
return rval;
}
/**
@@ -884,7 +884,7 @@ qla2x00_sns_gid_pt(scsi_qla_host_t *vha, sw_info_t *list)
rval = QLA_FUNCTION_FAILED;
}
return (rval);
return rval;
}
/**
@@ -940,7 +940,7 @@ qla2x00_sns_gpn_id(scsi_qla_host_t *vha, sw_info_t *list)
break;
}
return (rval);
return rval;
}
/**
@@ -1011,7 +1011,7 @@ qla2x00_sns_gnn_id(scsi_qla_host_t *vha, sw_info_t *list)
break;
}
return (rval);
return rval;
}
/**
@@ -1060,7 +1060,7 @@ qla2x00_sns_rft_id(scsi_qla_host_t *vha)
"RFT_ID exiting normally.\n");
}
return (rval);
return rval;
}
/**
@@ -1116,7 +1116,7 @@ qla2x00_sns_rnn_id(scsi_qla_host_t *vha)
"RNN_ID exiting normally.\n");
}
return (rval);
return rval;
}
/**
@@ -1792,7 +1792,7 @@ qla2x00_gfpn_id(scsi_qla_host_t *vha, sw_info_t *list)
break;
}
return (rval);
return rval;
}
static inline void *
@@ -1945,7 +1945,7 @@ qla2x00_gpsc(scsi_qla_host_t *vha, sw_info_t *list)
break;
}
return (rval);
return rval;
}
/**

View File

@@ -470,7 +470,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
if (rval) {
ql_log(ql_log_warn, vha, 0x0044,
"Unable to configure PCI space.\n");
return (rval);
return rval;
}
ha->isp_ops->reset_chip(vha);
@@ -479,7 +479,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
if (rval) {
ql_log(ql_log_fatal, vha, 0x004f,
"Unable to validate FLASH data.\n");
return (rval);
return rval;
}
ha->isp_ops->get_flash_version(vha, req->ring);
@@ -506,10 +506,10 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
if (qla2x00_isp_firmware(vha) != QLA_SUCCESS) {
rval = ha->isp_ops->chip_diag(vha);
if (rval)
return (rval);
return rval;
rval = qla2x00_setup_chip(vha);
if (rval)
return (rval);
return rval;
}
if (IS_QLA84XX(ha)) {
@@ -546,7 +546,7 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
}
#endif
return (rval);
return rval;
}
/**
@@ -770,7 +770,7 @@ qla2x00_isp_firmware(scsi_qla_host_t *vha)
ql_dbg(ql_dbg_init, vha, 0x007a,
"**** Load RISC code ****.\n");
return (rval);
return rval;
}
/**
@@ -1176,7 +1176,7 @@ chip_diag_failed:
spin_unlock_irqrestore(&ha->hardware_lock, flags);
return (rval);
return rval;
}
/**
@@ -1546,7 +1546,7 @@ failed:
"Setup chip ****FAILED****.\n");
}
return (rval);
return rval;
}
/**
@@ -1905,7 +1905,7 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
"Init Firmware -- success.\n");
}
return (rval);
return rval;
}
/**
@@ -2034,7 +2034,7 @@ out_not_ready:
if ((rval != QLA_SUCCESS) && !(vha->device_flags & DFLG_NO_CABLE))
ql_dbg(ql_log_warn, vha, 0x803b, "Firmware not ready\n");
return (rval);
return rval;
}
/*
@@ -2077,13 +2077,13 @@ qla2x00_configure_hba(scsi_qla_host_t *vha)
"Unable to get host loop ID.\n");
set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
}
return (rval);
return rval;
}
if (topo == 4) {
ql_log(ql_log_info, vha, 0x200a,
"Cannot get topology - retrying.\n");
return (QLA_FUNCTION_FAILED);
return QLA_FUNCTION_FAILED;
}
vha->loop_id = loop_id;
@@ -2641,7 +2641,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
ql_log(ql_log_warn, vha, 0x0069,
"NVRAM configuration failed.\n");
}
return (rval);
return rval;
}
static void
@@ -2717,7 +2717,7 @@ qla2x00_configure_loop(scsi_qla_host_t *vha)
if (rval != QLA_SUCCESS) {
ql_dbg(ql_dbg_disc, vha, 0x2013,
"Unable to configure HBA.\n");
return (rval);
return rval;
}
}
@@ -2803,7 +2803,7 @@ qla2x00_configure_loop(scsi_qla_host_t *vha)
}
}
return (rval);
return rval;
}
/*
@@ -2980,7 +2980,7 @@ cleanup_allocation:
}
out:
return (rval);
return rval;
}
static void
@@ -3124,7 +3124,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
"MBX_GET_PORT_NAME failed, No FL Port.\n");
vha->device_flags &= ~SWITCH_FOUND;
return (QLA_SUCCESS);
return QLA_SUCCESS;
}
vha->device_flags |= SWITCH_FOUND;
@@ -3150,7 +3150,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
"Failed SNS login: loop_id=%x mb[0]=%x mb[1]=%x mb[2]=%x "
"mb[6]=%x mb[7]=%x.\n", loop_id, mb[0], mb[1],
mb[2], mb[6], mb[7]);
return (QLA_SUCCESS);
return QLA_SUCCESS;
}
if (test_and_clear_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags)) {
@@ -3236,7 +3236,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
"Configure fabric error exit rval=%d.\n", rval);
}
return (rval);
return rval;
}
/*
@@ -3309,7 +3309,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
if (new_fcport == NULL) {
ql_log(ql_log_warn, vha, 0x205e,
"Failed to allocate memory for fcport.\n");
return (QLA_MEMORY_ALLOC_FAILED);
return QLA_MEMORY_ALLOC_FAILED;
}
new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED);
/* Set start port ID scan at adapter ID. */
@@ -3486,7 +3486,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
if (new_fcport == NULL) {
ql_log(ql_log_warn, vha, 0x2066,
"Memory allocation failed for fcport.\n");
return (QLA_MEMORY_ALLOC_FAILED);
return QLA_MEMORY_ALLOC_FAILED;
}
new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED);
new_fcport->d_id.b24 = nxt_d_id.b24;
@@ -3495,7 +3495,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
kfree(new_fcport);
out:
return (rval);
return rval;
}
/*
@@ -3582,7 +3582,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev)
}
}
return (rval);
return rval;
}
/*
@@ -3640,7 +3640,7 @@ qla2x00_fabric_dev_login(scsi_qla_host_t *vha, fc_port_t *fcport,
qla2x00_mark_device_lost(vha, fcport, 1, 0);
}
return (rval);
return rval;
}
/*
@@ -3788,7 +3788,7 @@ qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport,
}
}
return (rval);
return rval;
}
/*
@@ -3821,7 +3821,7 @@ qla2x00_local_device_login(scsi_qla_host_t *vha, fc_port_t *fcport)
rval = 3;
}
return (rval);
return rval;
}
/*
@@ -3872,13 +3872,13 @@ qla2x00_loop_resync(scsi_qla_host_t *vha)
}
if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
return (QLA_FUNCTION_FAILED);
return QLA_FUNCTION_FAILED;
if (rval)
ql_dbg(ql_dbg_disc, vha, 0x206c,
"%s *** FAILED ***.\n", __func__);
return (rval);
return rval;
}
/*
@@ -4277,7 +4277,7 @@ qla2x00_restart_isp(scsi_qla_host_t *vha)
ql_dbg(ql_dbg_taskm, vha, 0x8032,
"Configure loop done, status = 0x%x.\n", status);
}
return (status);
return status;
}
static int
@@ -4726,7 +4726,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
ql_log(ql_log_warn, vha, 0x0070,
"NVRAM configuration failed.\n");
}
return (rval);
return rval;
}
static int
@@ -5270,7 +5270,7 @@ qla24xx_configure_vhba(scsi_qla_host_t *vha)
"Failed SNS login: loop_id=%x mb[0]=%x mb[1]=%x "
"mb[2]=%x mb[6]=%x mb[7]=%x.\n",
NPH_SNS, mb[0], mb[1], mb[2], mb[6], mb[7]);
return (QLA_FUNCTION_FAILED);
return QLA_FUNCTION_FAILED;
}
atomic_set(&vha->loop_down_timer, 0);
@@ -5692,7 +5692,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
ql_log(ql_log_warn, vha, 0x0076,
"NVRAM configuration failed.\n");
}
return (rval);
return rval;
}
int

View File

@@ -34,7 +34,7 @@ qla2x00_debounce_register(volatile uint16_t __iomem *addr)
second = RD_REG_WORD(addr);
} while (first != second);
return (first);
return first;
}
static inline void
@@ -78,10 +78,10 @@ qla2x00_is_reserved_id(scsi_qla_host_t *vha, uint16_t loop_id)
{
struct qla_hw_data *ha = vha->hw;
if (IS_FWI2_CAPABLE(ha))
return (loop_id > NPH_LAST_HANDLE);
return loop_id > NPH_LAST_HANDLE;
return ((loop_id > ha->max_loop_id && loop_id < SNS_FIRST_LOOP_ID) ||
loop_id == MANAGEMENT_SERVER || loop_id == BROADCAST);
return (loop_id > ha->max_loop_id && loop_id < SNS_FIRST_LOOP_ID) ||
loop_id == MANAGEMENT_SERVER || loop_id == BROADCAST;
}
static inline void
@@ -199,5 +199,5 @@ qla2x00_reset_active(scsi_qla_host_t *vha)
static inline int
qla2x00_gid_list_size(struct qla_hw_data *ha)
{
return (sizeof(struct gid_list_info) * ha->max_fibre_devices);
return sizeof(struct gid_list_info) * ha->max_fibre_devices;
}

View File

@@ -36,7 +36,7 @@ qla2x00_get_cmd_direction(srb_t *sp)
cflags = CF_READ;
vha->qla_stats.input_bytes += scsi_bufflen(cmd);
}
return (cflags);
return cflags;
}
/**
@@ -58,7 +58,7 @@ qla2x00_calc_iocbs_32(uint16_t dsds)
if ((dsds - 3) % 7)
iocbs++;
}
return (iocbs);
return iocbs;
}
/**
@@ -80,7 +80,7 @@ qla2x00_calc_iocbs_64(uint16_t dsds)
if ((dsds - 2) % 5)
iocbs++;
}
return (iocbs);
return iocbs;
}
/**
@@ -108,7 +108,7 @@ qla2x00_prep_cont_type0_iocb(struct scsi_qla_host *vha)
/* Load packet defaults. */
*((uint32_t *)(&cont_pkt->entry_type)) = cpu_to_le32(CONTINUE_TYPE);
return (cont_pkt);
return cont_pkt;
}
/**
@@ -137,7 +137,7 @@ qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *vha, struct req_que *req)
/* Load packet defaults. */
*((uint32_t *)(&cont_pkt->entry_type)) = cpu_to_le32(CONTINUE_A64_TYPE);
return (cont_pkt);
return cont_pkt;
}
static inline int
@@ -344,7 +344,7 @@ qla2x00_start_scsi(srb_t *sp)
if (vha->marker_needed != 0) {
if (qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL) !=
QLA_SUCCESS) {
return (QLA_FUNCTION_FAILED);
return QLA_FUNCTION_FAILED;
}
vha->marker_needed = 0;
}
@@ -456,7 +456,7 @@ qla2x00_start_scsi(srb_t *sp)
qla2x00_process_response_queue(rsp);
spin_unlock_irqrestore(&ha->hardware_lock, flags);
return (QLA_SUCCESS);
return QLA_SUCCESS;
queuing_error:
if (tot_dsds)
@@ -464,7 +464,7 @@ queuing_error:
spin_unlock_irqrestore(&ha->hardware_lock, flags);
return (QLA_FUNCTION_FAILED);
return QLA_FUNCTION_FAILED;
}
/*
@@ -535,7 +535,7 @@ __qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req,
ql_log(ql_log_warn, base_vha, 0x3026,
"Failed to allocate Marker IOCB.\n");
return (QLA_FUNCTION_FAILED);
return QLA_FUNCTION_FAILED;
}
mrk->entry_type = MARKER_TYPE;
@@ -558,7 +558,7 @@ __qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req,
qla2x00_start_iocbs(vha, req);
return (QLA_SUCCESS);
return QLA_SUCCESS;
}
int
@@ -573,7 +573,7 @@ qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req,
ret = __qla2x00_marker(vha, req, rsp, loop_id, lun, type);
spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);
return (ret);
return ret;
}
/**

View File

@@ -49,7 +49,7 @@ qla2100_intr_handler(int irq, void *dev_id)
if (!rsp) {
ql_log(ql_log_info, NULL, 0x505d,
"%s: NULL response queue pointer.\n", __func__);
return (IRQ_NONE);
return IRQ_NONE;
}
ha = rsp->hw;
@@ -116,7 +116,7 @@ qla2100_intr_handler(int irq, void *dev_id)
complete(&ha->mbx_intr_comp);
}
return (IRQ_HANDLED);
return IRQ_HANDLED;
}
/**
@@ -146,7 +146,7 @@ qla2300_intr_handler(int irq, void *dev_id)
if (!rsp) {
ql_log(ql_log_info, NULL, 0x5058,
"%s: NULL response queue pointer.\n", __func__);
return (IRQ_NONE);
return IRQ_NONE;
}
ha = rsp->hw;
@@ -241,7 +241,7 @@ qla2300_intr_handler(int irq, void *dev_id)
complete(&ha->mbx_intr_comp);
}
return (IRQ_HANDLED);
return IRQ_HANDLED;
}
/**

View File

@@ -2125,7 +2125,7 @@ qla2x00_login_local_device(scsi_qla_host_t *vha, fc_port_t *fcport,
"Done %s.\n", __func__);
}
return (rval);
return rval;
}
int
@@ -2416,7 +2416,7 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *vha, uint16_t *cur_xchg_cnt,
*max_fcfs = mcp->mb[12];
}
return (rval);
return rval;
}
/*

View File

@@ -518,7 +518,7 @@ qla2x00_pci_info_str(struct scsi_qla_host *vha, char *str, int str_len)
}
strncat(str, " MHz)", str_len - (strlen(str)+1));
return (str);
return str;
}
static char *
@@ -584,7 +584,7 @@ qla2x00_fw_version_str(struct scsi_qla_host *vha, char *str, int str_len)
if (ha->fw_attributes & BIT_9) {
strncat(str, "FLX", str_len - (strlen(str)+1));
return (str);
return str;
}
switch (ha->fw_attributes & 0xFF) {
@@ -608,7 +608,7 @@ qla2x00_fw_version_str(struct scsi_qla_host *vha, char *str, int str_len)
if (ha->fw_attributes & 0x100)
strncat(str, "X", str_len - (strlen(str)+1));
return (str);
return str;
}
static char *
@@ -881,7 +881,7 @@ qla2x00_wait_for_hba_online(scsi_qla_host_t *vha)
else
return_status = QLA_FUNCTION_FAILED;
return (return_status);
return return_status;
}
EXPORT_SYMBOL(qla2x00_wait_for_hba_online);
@@ -1753,10 +1753,10 @@ mqiobase_exit:
ha->msix_count = ha->max_rsp_queues + 1;
ql_dbg_pci(ql_dbg_init, ha->pdev, 0x001c,
"MSIX Count:%d.\n", ha->msix_count);
return (0);
return 0;
iospace_error_exit:
return (-ENOMEM);
return -ENOMEM;
}
@@ -1845,10 +1845,10 @@ mqiobase_exit:
#endif /* CONFIG_SCSI_QLA2XXX_TARGET */
ql_dbg_pci(ql_dbg_init, ha->pdev, 0x011f,
"MSIX Count:%d.\n", ha->msix_count);
return (0);
return 0;
iospace_error_exit:
return (-ENOMEM);
return -ENOMEM;
}
static struct isp_operations qla2100_isp_ops = {

View File

@@ -158,7 +158,7 @@ qla2x00_get_nvram_word(struct qla_hw_data *ha, uint32_t addr)
nv_cmd |= NV_READ_OP;
data = qla2x00_nvram_request(ha, nv_cmd);
return (data);
return data;
}
/**

View File

@@ -2128,11 +2128,11 @@ isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, int flags
if (!IS_24XX(isp)) {
int action = flags & PLOGX_FLG_CMD_MASK;
if (action == PLOGX_FLG_CMD_PLOGI) {
return (isp_port_login(isp, handle, portid));
return isp_port_login(isp, handle, portid);
} else if (action == PLOGX_FLG_CMD_LOGO) {
return (isp_port_logout(isp, handle, portid));
return isp_port_logout(isp, handle, portid);
} else {
return (MBOX_INVALID_COMMAND);
return MBOX_INVALID_COMMAND;
}
}
@@ -2154,7 +2154,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, int flags
if (gs == 0) {
if (FC_SCRATCH_ACQUIRE(isp, chan)) {
isp_prt(isp, ISP_LOGERR, sacq);
return (-1);
return -1;
}
}
fcp = FCPARAM(isp, chan);
@@ -2273,7 +2273,7 @@ out:
if (gs == 0) {
FC_SCRATCH_RELEASE(isp, chan);
}
return (rval);
return rval;
}
static int
@@ -2299,33 +2299,33 @@ isp_port_login(ispsoftc_t *isp, uint16_t handle, uint32_t portid)
isp_prt(isp, ISP_LOGDEBUG0,
"isp_port_login: portid 0x%06x already logged in as %u",
portid, mbs.param[1]);
return (MBOX_PORT_ID_USED | (mbs.param[1] << 16));
return MBOX_PORT_ID_USED | (mbs.param[1] << 16);
case MBOX_LOOP_ID_USED:
isp_prt(isp, ISP_LOGDEBUG0,
"isp_port_login: handle 0x%04x in use for port id 0x%02xXXXX",
handle, mbs.param[1] & 0xff);
return (MBOX_LOOP_ID_USED);
return MBOX_LOOP_ID_USED;
case MBOX_COMMAND_COMPLETE:
return (0);
return 0;
case MBOX_COMMAND_ERROR:
isp_prt(isp, ISP_LOGINFO,
"isp_port_login: error 0x%x in PLOGI to port 0x%06x",
mbs.param[1], portid);
return (MBOX_COMMAND_ERROR);
return MBOX_COMMAND_ERROR;
case MBOX_ALL_IDS_USED:
isp_prt(isp, ISP_LOGINFO,
"isp_port_login: all IDs used for fabric login");
return (MBOX_ALL_IDS_USED);
return MBOX_ALL_IDS_USED;
default:
isp_prt(isp, ISP_LOGINFO,
"isp_port_login: error 0x%x on port login of 0x%06x@0x%0x",
mbs.param[0], portid, handle);
return (mbs.param[0]);
return mbs.param[0];
}
}
@@ -2342,7 +2342,7 @@ isp_port_logout(ispsoftc_t *isp, uint16_t handle, uint32_t portid)
mbs.param[1] = handle << 8;
}
isp_mboxcmd(isp, &mbs);
return (mbs.param[0] == MBOX_COMMAND_COMPLETE? 0 : mbs.param[0]);
return mbs.param[0] == MBOX_COMMAND_COMPLETE? 0 : mbs.param[0];
}
static int
@@ -2372,7 +2372,7 @@ isp_getpdb(ispsoftc_t *isp, int chan, uint16_t id, isp_pdb_t *pdb, int dolock)
if (dolock) {
if (FC_SCRATCH_ACQUIRE(isp, chan)) {
isp_prt(isp, ISP_LOGERR, sacq);
return (-1);
return -1;
}
}
MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un));
@@ -2381,7 +2381,7 @@ isp_getpdb(ispsoftc_t *isp, int chan, uint16_t id, isp_pdb_t *pdb, int dolock)
if (dolock) {
FC_SCRATCH_RELEASE(isp, chan);
}
return (mbs.param[0]);
return mbs.param[0];
}
if (IS_24XX(isp)) {
isp_get_pdb_24xx(isp, fcp->isp_scratch, &un.bill);
@@ -2400,7 +2400,7 @@ isp_getpdb(ispsoftc_t *isp, int chan, uint16_t id, isp_pdb_t *pdb, int dolock)
if (dolock) {
FC_SCRATCH_RELEASE(isp, chan);
}
return (mbs.param[0]);
return mbs.param[0];
}
} else {
isp_get_pdb_21xx(isp, fcp->isp_scratch, &un.fred);
@@ -2413,7 +2413,7 @@ isp_getpdb(ispsoftc_t *isp, int chan, uint16_t id, isp_pdb_t *pdb, int dolock)
if (dolock) {
FC_SCRATCH_RELEASE(isp, chan);
}
return (0);
return 0;
}
static void
@@ -2448,7 +2448,7 @@ isp_get_wwn(ispsoftc_t *isp, int chan, int loopid, int nodename)
if (fcp->isp_fwstate < FW_READY ||
fcp->isp_loopstate < LOOP_PDB_RCVD) {
return (wwn);
return wwn;
}
MBSINIT(&mbs, MBOX_GET_PORT_NAME, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR, 500000);
if (ISP_CAP_2KLOGIN(isp)) {
@@ -2469,7 +2469,7 @@ isp_get_wwn(ispsoftc_t *isp, int chan, int loopid, int nodename)
}
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
return (wwn);
return wwn;
}
if (IS_24XX(isp)) {
wwn =
@@ -2492,7 +2492,7 @@ isp_get_wwn(ispsoftc_t *isp, int chan, int loopid, int nodename)
(((uint64_t)(mbs.param[7] & 0xff)) << 8) |
(((uint64_t)(mbs.param[7] >> 8)));
}
return (wwn);
return wwn;
}
/*
@@ -2588,7 +2588,7 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
*/
if (fcp->isp_fwstate != FW_READY) {
isp_prt(isp, ISP_LOGSANCFG, "%s: chan %d not at FW_READY state", __func__, chan);
return (-1);
return -1;
}
/*
@@ -2602,7 +2602,7 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
}
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
return (-1);
return -1;
}
if (ISP_CAP_2KLOGIN(isp)) {
@@ -2714,7 +2714,7 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
r = isp_plogx(isp, chan, fcp->isp_sns_hdl, SNS_PORT_ID, PLOGX_FLG_CMD_PLOGI | PLOGX_FLG_COND_PLOGI | PLOGX_FLG_SKIP_PRLI, 0);
if (r) {
isp_prt(isp, ISP_LOGWARN, "%s: Chan %d cannot log into SNS", __func__, chan);
return (-1);
return -1;
}
} else {
fcp->isp_sns_hdl = NPH_SNS_ID;
@@ -2726,7 +2726,7 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
}
if (r) {
isp_prt(isp, ISP_LOGWARN|ISP_LOGSANCFG, "%s: register fc4 type failed", __func__);
return (-1);
return -1;
}
} else {
not_on_fabric:
@@ -2761,7 +2761,7 @@ not_on_fabric:
*/
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGCONFIG, topology, chan, (uint32_t) (fcp->isp_wwpn >> 32), (uint32_t) fcp->isp_wwpn, fcp->isp_portid, fcp->isp_loopid, isp_fc_toponame(fcp));
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d FC Link Test Complete", chan);
return (0);
return 0;
}
/*
@@ -2792,7 +2792,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan)
uint16_t dbidx;
if (fcp->isp_loopstate == LOOP_READY) {
return (0);
return 0;
}
/*
@@ -2803,7 +2803,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan)
fcp->isp_loopstate != LOOP_LSCAN_DONE) {
isp_prt(isp, ISP_LOGWARN, "isp_pdb_sync: bad loopstate %d",
fcp->isp_loopstate);
return (-1);
return -1;
}
if (fcp->isp_topo == TOPO_FL_PORT ||
@@ -2813,7 +2813,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan)
if (isp_scan_loop(isp, chan) != 0) {
isp_prt(isp, ISP_LOGWARN,
"isp_pdb_sync: isp_scan_loop failed");
return (-1);
return -1;
}
}
}
@@ -2823,7 +2823,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan)
if (isp_scan_fabric(isp, chan) != 0) {
isp_prt(isp, ISP_LOGWARN,
"isp_pdb_sync: isp_scan_fabric failed");
return (-1);
return -1;
}
}
}
@@ -2931,7 +2931,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan)
*/
fcp->loop_seen_once = 1;
fcp->isp_loopstate = LOOP_READY;
return (0);
return 0;
}
/*
@@ -2948,11 +2948,11 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
if (fcp->isp_fwstate < FW_READY ||
fcp->isp_loopstate < LOOP_PDB_RCVD) {
return (-1);
return -1;
}
if (fcp->isp_loopstate > LOOP_SCANNING_LOOP) {
return (0);
return 0;
}
/*
@@ -2973,7 +2973,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d Skipping Local Loop Scan", chan);
fcp->isp_loopstate = LOOP_LSCAN_DONE;
return (0);
return 0;
}
lim = LOCAL_LOOP_LIM;
break;
@@ -2984,7 +2984,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d no loop topology to scan", chan);
fcp->isp_loopstate = LOOP_LSCAN_DONE;
return (0);
return 0;
}
fcp->isp_loopstate = LOOP_SCANNING_LOOP;
@@ -3018,7 +3018,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) {
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d FC scan loop DONE (bad)", chan);
return (-1);
return -1;
}
if (node_wwn == INI_NONE) {
continue;
@@ -3037,7 +3037,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
ISP_MARK_PORTDB(isp, chan, 1);
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d FC scan loop DONE (bad)", chan);
return (-1);
return -1;
}
continue;
}
@@ -3046,7 +3046,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
ISP_MARK_PORTDB(isp, chan, 1);
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d FC scan loop DONE (bad)", chan);
return (-1);
return -1;
}
/*
@@ -3061,7 +3061,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
ISP_MARK_PORTDB(isp, chan, 1);
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d FC scan loop DONE (bad)", chan);
return (-1);
return -1;
}
/*
@@ -3132,7 +3132,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
ISP_MARK_PORTDB(isp, chan, 1);
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d FC scan loop DONE (bad)", chan);
return (-1);
return -1;
}
/*
@@ -3217,7 +3217,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
fcp->isp_loopstate = LOOP_LSCAN_DONE;
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d FC scan loop DONE", chan);
return (0);
return 0;
}
/*
@@ -3286,12 +3286,12 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan)
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
if (mbs.param[0] == MBOX_INVALID_COMMAND) {
return (1);
return 1;
} else {
return (-1);
return -1;
}
}
return (0);
return 0;
}
static int
@@ -3313,7 +3313,7 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan)
"Chan %d scanning fabric (GID_FT) via CT", chan);
if (!IS_24XX(isp)) {
return (1);
return 1;
}
/*
@@ -3372,7 +3372,7 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan)
MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN);
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
return (-1);
return -1;
}
MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN);
pt = &un.plocal;
@@ -3385,13 +3385,13 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan)
isp_prt(isp, ISP_LOGWARN,
"Chan %d ISP GID FT CT Passthrough returned 0x%x",
chan, pt->ctp_status);
return (-1);
return -1;
}
MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN + 16);
if (isp->isp_dblev & ISP_LOGDEBUG1) {
isp_print_bytes(isp, "CT response", GIDLEN+16, &scp[IGPOFF]);
}
return (0);
return 0;
}
static int
@@ -3408,28 +3408,28 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
"Chan %d FC Scan Fabric", chan);
if (fcp->isp_fwstate != FW_READY ||
fcp->isp_loopstate < LOOP_LSCAN_DONE) {
return (-1);
return -1;
}
if (fcp->isp_loopstate > LOOP_SCANNING_FABRIC) {
return (0);
return 0;
}
if (fcp->isp_topo != TOPO_FL_PORT && fcp->isp_topo != TOPO_F_PORT) {
fcp->isp_loopstate = LOOP_FSCAN_DONE;
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d FC Scan Fabric Done (no fabric)", chan);
return (0);
return 0;
}
fcp->isp_loopstate = LOOP_SCANNING_FABRIC;
if (FC_SCRATCH_ACQUIRE(isp, chan)) {
isp_prt(isp, ISP_LOGERR, sacq);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
if (fcp->isp_loopstate < LOOP_SCANNING_FABRIC) {
FC_SCRATCH_RELEASE(isp, chan);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
/*
@@ -3448,7 +3448,7 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
fcp->isp_loopstate = LOOP_PDB_RCVD;
FC_SCRATCH_RELEASE(isp, chan);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
if (IS_24XX(isp)) {
@@ -3460,17 +3460,17 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
if (fcp->isp_loopstate < LOOP_SCANNING_FABRIC) {
FC_SCRATCH_RELEASE(isp, chan);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
if (r > 0) {
fcp->isp_loopstate = LOOP_FSCAN_DONE;
FC_SCRATCH_RELEASE(isp, chan);
return (0);
return 0;
} else if (r < 0) {
fcp->isp_loopstate = LOOP_PDB_RCVD; /* try again */
FC_SCRATCH_RELEASE(isp, chan);
return (0);
return 0;
}
MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN);
@@ -3480,7 +3480,7 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
if (fcp->isp_loopstate < LOOP_SCANNING_FABRIC) {
FC_SCRATCH_RELEASE(isp, chan);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
if (rs1->snscb_cthdr.ct_cmd_resp != LS_ACC) {
int level;
@@ -3496,7 +3496,7 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
rs1->snscb_cthdr.ct_explanation);
FC_SCRATCH_RELEASE(isp, chan);
fcp->isp_loopstate = LOOP_FSCAN_DONE;
return (0);
return 0;
}
@@ -3665,7 +3665,7 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) {
FC_SCRATCH_RELEASE(isp, chan);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
if (r != 0) {
lp->new_portid = portid;
@@ -3714,7 +3714,7 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
LOOP_SCANNING_FABRIC) {
FC_SCRATCH_RELEASE(isp, chan);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
continue;
}
@@ -3722,7 +3722,7 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
LOOP_SCANNING_FABRIC) {
FC_SCRATCH_RELEASE(isp, chan);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
FCPARAM(isp, 0)->isp_lasthdl = oldhandle;
MAKE_WWN_FROM_NODE_NAME(wwnn, pdb.nodename);
@@ -3837,14 +3837,14 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) {
FC_SCRATCH_RELEASE(isp, chan);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
continue;
}
if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) {
FC_SCRATCH_RELEASE(isp, chan);
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
FCPARAM(isp, 0)->isp_lasthdl = oldhandle;
@@ -3924,12 +3924,12 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
FC_SCRATCH_RELEASE(isp, chan);
if (fcp->isp_loopstate != LOOP_SCANNING_FABRIC) {
ISP_MARK_PORTDB(isp, chan, 1);
return (-1);
return -1;
}
fcp->isp_loopstate = LOOP_FSCAN_DONE;
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d FC Scan Fabric Done", chan);
return (0);
return 0;
}
/*
@@ -3963,7 +3963,7 @@ isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p,
break;
}
if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) {
return (-1);
return -1;
}
/*
* Now try and log into the device
@@ -3971,7 +3971,7 @@ isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p,
r = isp_plogx(isp, chan, handle, portid,
PLOGX_FLG_CMD_PLOGI, 1);
if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) {
return (-1);
return -1;
}
if (r == 0) {
*ohp = handle;
@@ -3983,7 +3983,7 @@ isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p,
i = lim;
break;
} else if (r == MBOX_TIMEOUT) {
return (-1);
return -1;
} else {
*ohp = handle;
handle = isp_nxt_handle(isp, chan, *ohp);
@@ -3993,7 +3993,7 @@ isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p,
if (i == lim) {
isp_prt(isp, ISP_LOGWARN, "Chan %d PLOGI 0x%06x failed",
chan, portid);
return (-1);
return -1;
}
/*
@@ -4003,22 +4003,22 @@ isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p,
*/
r = isp_getpdb(isp, chan, handle, p, 0);
if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) {
return (-1);
return -1;
}
if (r != 0) {
isp_prt(isp, ISP_LOGERR,
"Chan %d new device 0x%06x@0x%x disappeared",
chan, portid, handle);
return (-1);
return -1;
}
if (p->handle != handle || p->portid != portid) {
isp_prt(isp, ISP_LOGERR,
"Chan %d new device 0x%06x@0x%x changed (0x%06x@0x%0x)",
chan, portid, handle, p->portid, p->handle);
return (-1);
return -1;
}
return (0);
return 0;
}
static int
@@ -4042,7 +4042,7 @@ isp_register_fc4_type(ispsoftc_t *isp, int chan)
reqp->snscb_data[6] = (1 << FC4_SCSI);
if (FC_SCRATCH_ACQUIRE(isp, chan)) {
isp_prt(isp, ISP_LOGERR, sacq);
return (-1);
return -1;
}
isp_put_sns_request(isp, reqp, (sns_screq_t *) fcp->isp_scratch);
MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 1000000);
@@ -4055,9 +4055,9 @@ isp_register_fc4_type(ispsoftc_t *isp, int chan)
isp_mboxcmd(isp, &mbs);
FC_SCRATCH_RELEASE(isp, chan);
if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
return (0);
return 0;
} else {
return (-1);
return -1;
}
}
@@ -4078,7 +4078,7 @@ isp_register_fc4_type_24xx(ispsoftc_t *isp, int chan)
if (FC_SCRATCH_ACQUIRE(isp, chan)) {
isp_prt(isp, ISP_LOGERR, sacq);
return (-1);
return -1;
}
/*
@@ -4141,7 +4141,7 @@ isp_register_fc4_type_24xx(ispsoftc_t *isp, int chan)
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
FC_SCRATCH_RELEASE(isp, chan);
return (-1);
return -1;
}
MEMORYBARRIER(isp, SYNC_SFORCPU, ZTXOFF, QENTRY_LEN);
pt = &un.plocal;
@@ -4154,7 +4154,7 @@ isp_register_fc4_type_24xx(ispsoftc_t *isp, int chan)
isp_prt(isp, ISP_LOGWARN,
"Chan %d Register FC4 Type CT Passthrough returned 0x%x",
chan, pt->ctp_status);
return (1);
return 1;
}
isp_get_ct_hdr(isp, (ct_hdr_t *) &scp[IGPOFF], ct);
@@ -4163,16 +4163,16 @@ isp_register_fc4_type_24xx(ispsoftc_t *isp, int chan)
if (ct->ct_cmd_resp == LS_RJT) {
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d Register FC4 Type rejected", chan);
return (-1);
return -1;
} else if (ct->ct_cmd_resp == LS_ACC) {
isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0,
"Chan %d Register FC4 Type accepted", chan);
return (0);
return 0;
} else {
isp_prt(isp, ISP_LOGWARN,
"Chan %d Register FC4 Type: 0x%x",
chan, ct->ct_cmd_resp);
return (-1);
return -1;
}
}
@@ -4205,7 +4205,7 @@ isp_nxt_handle(ispsoftc_t *isp, int chan, uint16_t handle)
}
}
if (handle == FCPARAM(isp, chan)->isp_loopid) {
return (isp_nxt_handle(isp, chan, handle));
return isp_nxt_handle(isp, chan, handle);
}
for (i = 0; i < MAX_FC_TARG; i++) {
if (FCPARAM(isp, chan)->portdb[i].state ==
@@ -4213,10 +4213,10 @@ isp_nxt_handle(ispsoftc_t *isp, int chan, uint16_t handle)
continue;
}
if (FCPARAM(isp, chan)->portdb[i].handle == handle) {
return (isp_nxt_handle(isp, chan, handle));
return isp_nxt_handle(isp, chan, handle);
}
}
return (handle);
return handle;
}
/*
@@ -4244,7 +4244,7 @@ isp_start(XS_T *xs)
if (isp->isp_state != ISP_RUNSTATE) {
isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE");
XS_SETERR(xs, HBA_BOTCH);
return (CMD_COMPLETE);
return CMD_COMPLETE;
}
/*
@@ -4257,7 +4257,7 @@ isp_start(XS_T *xs)
if (XS_CDBLEN(xs) > (IS_FC(isp)? 16 : 44) || XS_CDBLEN(xs) == 0) {
isp_prt(isp, ISP_LOGERR, "unsupported cdb length (%d, CDB[0]=0x%x)", XS_CDBLEN(xs), XS_CDBP(xs)[0] & 0xff);
XS_SETERR(xs, HBA_BOTCH);
return (CMD_COMPLETE);
return CMD_COMPLETE;
}
/*
@@ -4270,33 +4270,33 @@ isp_start(XS_T *xs)
if ((fcp->role & ISP_ROLE_INITIATOR) == 0) {
XS_SETERR(xs, HBA_SELTIMEOUT);
return (CMD_COMPLETE);
return CMD_COMPLETE;
}
/*
* Try again later.
*/
if (fcp->isp_fwstate != FW_READY || fcp->isp_loopstate != LOOP_READY) {
return (CMD_RQLATER);
return CMD_RQLATER;
}
if (XS_TGT(xs) >= MAX_FC_TARG) {
XS_SETERR(xs, HBA_SELTIMEOUT);
return (CMD_COMPLETE);
return CMD_COMPLETE;
}
hdlidx = fcp->isp_dev_map[XS_TGT(xs)] - 1;
isp_prt(isp, ISP_LOGDEBUG2, "XS_TGT(xs)=%d- hdlidx value %d", XS_TGT(xs), hdlidx);
if (hdlidx < 0 || hdlidx >= MAX_FC_TARG) {
XS_SETERR(xs, HBA_SELTIMEOUT);
return (CMD_COMPLETE);
return CMD_COMPLETE;
}
if (fcp->portdb[hdlidx].state == FC_PORTDB_STATE_ZOMBIE) {
return (CMD_RQLATER);
return CMD_RQLATER;
}
if (fcp->portdb[hdlidx].state != FC_PORTDB_STATE_VALID) {
XS_SETERR(xs, HBA_SELTIMEOUT);
return (CMD_COMPLETE);
return CMD_COMPLETE;
}
target = fcp->portdb[hdlidx].handle;
fcp->portdb[hdlidx].dirty = 1;
@@ -4304,7 +4304,7 @@ isp_start(XS_T *xs)
sdparam *sdp = SDPARAM(isp, XS_CHANNEL(xs));
if ((sdp->role & ISP_ROLE_INITIATOR) == 0) {
XS_SETERR(xs, HBA_SELTIMEOUT);
return (CMD_COMPLETE);
return CMD_COMPLETE;
}
if (sdp->update) {
isp_spi_update(isp, XS_CHANNEL(xs));
@@ -4317,7 +4317,7 @@ isp_start(XS_T *xs)
if (qep == NULL) {
isp_prt(isp, ISP_LOGDEBUG0, "Request Queue Overflow");
XS_SETERR(xs, HBA_BOTCH);
return (CMD_EAGAIN);
return CMD_EAGAIN;
}
XS_SETERR(xs, HBA_NOERROR);
@@ -4455,7 +4455,7 @@ isp_start(XS_T *xs)
if (isp_save_xs(isp, xs, &handle)) {
isp_prt(isp, ISP_LOGDEBUG0, "out of xflist pointers");
XS_SETERR(xs, HBA_BOTCH);
return (CMD_EAGAIN);
return CMD_EAGAIN;
}
/* Whew. Thankfully the same for type 7 requests */
reqp->req_handle = handle;
@@ -4473,11 +4473,11 @@ isp_start(XS_T *xs)
* dmasetup sets actual error in packet, and
* return what we were given to return.
*/
return (dmaresult);
return dmaresult;
}
isp_prt(isp, ISP_LOGDEBUG0, "START cmd for %d.%d.%d cmd 0x%x datalen %ld", XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), XS_CDBP(xs)[0], (long) XS_XFRLEN(xs));
isp->isp_nactive++;
return (CMD_QUEUED);
return CMD_QUEUED;
}
/*
@@ -4523,7 +4523,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
}
isp_prt(isp, ISP_LOGINFO,
"driver initiated bus reset of bus %d", chan);
return (0);
return 0;
case ISPCTL_RESET_DEV:
va_start(ap, ctl);
@@ -4592,7 +4592,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
&((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp);
FC_SCRATCH_RELEASE(isp, chan);
if (sp->req_completion_status == 0) {
return (0);
return 0;
}
isp_prt(isp, ISP_LOGWARN,
"Chan %d reset of target %d returned 0x%x",
@@ -4617,7 +4617,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
isp_prt(isp, ISP_LOGINFO,
"Target %d on Bus %d Reset Succeeded", tgt, chan);
ISP_SET_SENDMARKER(isp, chan, 1);
return (0);
return 0;
case ISPCTL_ABORT_CMD:
va_start(ap, ctl);
@@ -4693,7 +4693,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
isp_get_24xx_abrt(isp, ab2, ab);
FC_SCRATCH_RELEASE(isp, chan);
if (ab->abrt_nphdl == ISP24XX_ABRT_OKAY) {
return (0);
return 0;
}
isp_prt(isp, ISP_LOGWARN,
"Chan %d handle %d abort returned 0x%x", chan,
@@ -4719,7 +4719,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
break;
}
return (0);
return 0;
case ISPCTL_UPDATE_PARAMS:
@@ -4727,7 +4727,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
chan = va_arg(ap, int);
va_end(ap);
isp_spi_update(isp, chan);
return (0);
return 0;
case ISPCTL_FCLINK_TEST:
@@ -4740,7 +4740,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
if (usdelay == 0) {
usdelay = 250000;
}
return (isp_fclink_test(isp, chan, usdelay));
return isp_fclink_test(isp, chan, usdelay);
}
break;
@@ -4750,7 +4750,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
va_start(ap, ctl);
chan = va_arg(ap, int);
va_end(ap);
return (isp_scan_fabric(isp, chan));
return isp_scan_fabric(isp, chan);
}
break;
@@ -4760,7 +4760,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
va_start(ap, ctl);
chan = va_arg(ap, int);
va_end(ap);
return (isp_scan_loop(isp, chan));
return isp_scan_loop(isp, chan);
}
break;
@@ -4770,7 +4770,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
va_start(ap, ctl);
chan = va_arg(ap, int);
va_end(ap);
return (isp_pdb_sync(isp, chan));
return isp_pdb_sync(isp, chan);
}
break;
@@ -4783,7 +4783,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
}
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
return (0);
return 0;
}
}
break;
@@ -4796,7 +4796,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
tgt = va_arg(ap, int);
pdb = va_arg(ap, isp_pdb_t *);
va_end(ap);
return (isp_getpdb(isp, chan, tgt, pdb, 1));
return isp_getpdb(isp, chan, tgt, pdb, 1);
}
break;
@@ -4824,7 +4824,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
break;
}
}
return (0);
return 0;
}
case ISPCTL_RUN_MBOXCMD:
{
@@ -4832,7 +4832,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
mbr = va_arg(ap, mbreg_t *);
va_end(ap);
isp_mboxcmd(isp, mbr);
return (0);
return 0;
}
case ISPCTL_PLOGX:
{
@@ -4844,7 +4844,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
va_end(ap);
if ((p->flags & PLOGX_FLG_CMD_MASK) != PLOGX_FLG_CMD_PLOGI || (p->handle != NIL_HANDLE)) {
return (isp_plogx(isp, p->channel, p->handle, p->portid, p->flags, 0));
return isp_plogx(isp, p->channel, p->handle, p->portid, p->flags, 0);
}
do {
p->handle = isp_nxt_handle(isp, p->channel, p->handle);
@@ -4855,14 +4855,14 @@ isp_control(ispsoftc_t *isp, ispctl_t ctl, ...)
break;
}
} while ((r & 0xffff) == MBOX_LOOP_ID_USED);
return (r);
return r;
}
default:
isp_prt(isp, ISP_LOGERR, "Unknown Control Opcode 0x%x", ctl);
break;
}
return (-1);
return -1;
}
/*
@@ -5647,7 +5647,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_t mbox)
break;
case ASYNC_RIO_RESP:
return (rval);
return rval;
case ASYNC_CTIO_DONE:
{
@@ -5931,7 +5931,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_t mbox)
isp->isp_state = ISP_CRASHED;
isp_prt(isp, ISP_LOGERR, "FATAL CONNECTION ERROR");
isp_async(isp, ISPASYNC_FW_CRASH);
return (-1);
return -1;
case ISP_CONN_LOOPBACK:
isp_prt(isp, ISP_LOGWARN,
"Looped Back in Point-to-Point mode");
@@ -5991,7 +5991,7 @@ isp_parse_async(ispsoftc_t *isp, uint16_t mbox)
} else {
isp->isp_intoasync++;
}
return (rval);
return rval;
}
/*
@@ -6007,10 +6007,10 @@ isp_handle_other_response(ispsoftc_t *isp, int type,
switch (type) {
case RQSTYPE_STATUS_CONT:
isp_prt(isp, ISP_LOGDEBUG0, "Ignored Continuation Response");
return (1);
return 1;
case RQSTYPE_MARKER:
isp_prt(isp, ISP_LOGDEBUG0, "Marker Response");
return (1);
return 1;
case RQSTYPE_ATIO:
case RQSTYPE_CTIO:
case RQSTYPE_ENABLE_LUN:
@@ -6027,7 +6027,7 @@ isp_handle_other_response(ispsoftc_t *isp, int type,
isp->isp_rsltccmplt++; /* count as a response completion */
#ifdef ISP_TARGET_MODE
if (isp_target_notify(isp, (ispstatusreq_t *) hp, optrp)) {
return (1);
return 1;
}
#endif
/* FALLTHROUGH */
@@ -6037,7 +6037,7 @@ isp_handle_other_response(ispsoftc_t *isp, int type,
isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid);
if (rid.ridacq_format == 0) {
}
return (1);
return 1;
}
/* FALLTHROUGH */
case RQSTYPE_REQUEST:
@@ -6054,11 +6054,11 @@ isp_handle_other_response(ispsoftc_t *isp, int type,
*/
isp_prt(isp, ISP_LOGINFO,
"unstable type in response queue");
return (-1);
return -1;
}
isp_prt(isp, ISP_LOGWARN, "Unhandled Response Type 0x%x",
isp_get_response_type(isp, hp));
return (0);
return 0;
}
}
@@ -6669,11 +6669,11 @@ isp_mbox_continue(ispsoftc_t *isp)
case MBOX_READ_RAM_WORD_EXTENDED:
break;
default:
return (1);
return 1;
}
if (isp->isp_mboxtmp[0] != MBOX_COMMAND_COMPLETE) {
isp->isp_mbxwrk0 = 0;
return (-1);
return -1;
}
/*
@@ -6726,7 +6726,7 @@ isp_mbox_continue(ispsoftc_t *isp)
mbs.param[0] = isp->isp_lastmbxcmd;
mbs.logval = MBLOGALL;
isp_mboxcmd_qnw(isp, &mbs, 0);
return (0);
return 0;
}
#define HIWRD(x) ((x) >> 16)
@@ -7823,7 +7823,7 @@ isp_read_nvram(ispsoftc_t *isp, int bus)
#define nvram_words _n._s
if (IS_24XX(isp)) {
return (isp_read_nvram_2400(isp, nvram_data));
return isp_read_nvram_2400(isp, nvram_data);
} else if (IS_FC(isp)) {
amt = ISP2100_NVRAM_SIZE;
minversion = 1;
@@ -7879,7 +7879,7 @@ isp_read_nvram(ispsoftc_t *isp, int bus)
}
retval = 0;
out:
return (retval);
return retval;
#undef nvram_data
#undef nvram_words
}
@@ -7920,7 +7920,7 @@ isp_read_nvram_2400(ispsoftc_t *isp, uint8_t *nvram_data)
}
isp_parse_nvram_2400(isp, nvram_data);
out:
return (retval);
return retval;
}
static void