qla2x00t: Convert __constant_cpu_to_*() into cpu_to_*()

This change does not affect the generated code but improves source
code readability.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6510 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2015-09-16 22:03:06 +00:00
parent 4a858144ec
commit f4a57df52b
9 changed files with 259 additions and 287 deletions
+52 -55
View File
@@ -886,7 +886,7 @@ static int q2t_reset(scsi_qla_host_t *vha, void *iocb, int mcmd)
((n->status_subcode == ELS_TPRLO) ||
(n->status_subcode == ELS_LOGO))) {
if ((n->status_subcode == ELS_TPRLO) &&
(n->flags & __constant_cpu_to_le16(BIT_1))) {
(n->flags & cpu_to_le16(BIT_1))) {
/* Global flag set */
loop_id = 0xFFFF;
} else
@@ -1870,7 +1870,7 @@ static void q2x_send_notify_ack(scsi_qla_host_t *vha, notify_entry_t *iocb,
ntfy->task_flags = iocb->task_flags;
ntfy->seq_id = iocb->seq_id;
/* Do not increment here, the chip isn't decrementing */
/* ntfy->flags = __constant_cpu_to_le16(NOTIFY_ACK_RES_COUNT); */
/* ntfy->flags = cpu_to_le16(NOTIFY_ACK_RES_COUNT); */
ntfy->flags |= cpu_to_le16(add_flags);
ntfy->srr_rx_id = iocb->srr_rx_id;
ntfy->srr_rel_offs = iocb->srr_rel_offs;
@@ -1882,7 +1882,7 @@ static void q2x_send_notify_ack(scsi_qla_host_t *vha, notify_entry_t *iocb,
if (resp_code_valid) {
ntfy->resp_code = cpu_to_le16(resp_code);
ntfy->flags |= __constant_cpu_to_le16(NOTIFY_ACK_TM_RESP_CODE_VALID);
ntfy->flags |= cpu_to_le16(NOTIFY_ACK_TM_RESP_CODE_VALID);
}
TRACE(TRACE_SCSI, "qla2x00t(%ld): Sending Notify Ack Seq %#x -> I %#x "
@@ -1931,7 +1931,7 @@ static void q24_send_abts_resp(scsi_qla_host_t *vha,
resp->sof_type = abts->sof_type;
resp->exchange_address = abts->exchange_address;
resp->fcp_hdr_le = abts->fcp_hdr_le;
f_ctl = __constant_cpu_to_le32(F_CTL_EXCH_CONTEXT_RESP |
f_ctl = cpu_to_le32(F_CTL_EXCH_CONTEXT_RESP |
F_CTL_LAST_SEQ | F_CTL_END_SEQ |
F_CTL_SEQ_INITIATIVE);
p = (uint8_t *)&f_ctl;
@@ -2011,13 +2011,13 @@ static void q24_retry_term_exchange(scsi_qla_host_t *vha,
ctio->common.entry_count = 1;
ctio->common.nport_handle = entry->nport_handle;
ctio->common.handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
ctio->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
ctio->common.vp_index = vha->vp_idx;
ctio->common.initiator_id[0] = entry->fcp_hdr_le.d_id[0];
ctio->common.initiator_id[1] = entry->fcp_hdr_le.d_id[1];
ctio->common.initiator_id[2] = entry->fcp_hdr_le.d_id[2];
ctio->common.exchange_addr = entry->exchange_addr_to_abort;
ctio->flags = __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_TERMINATE);
ctio->flags = cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_TERMINATE);
ctio->ox_id = entry->fcp_hdr_le.ox_id;
TRACE_BUFFER("CTIO7 retry TERM EXCH packet data", ctio, REQUEST_ENTRY_SIZE);
@@ -2177,17 +2177,17 @@ static void q24_send_task_mgmt_ctio(scsi_qla_host_t *vha,
ctio->common.entry_count = 1;
ctio->common.handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->common.nport_handle = mcmd->sess->loop_id;
ctio->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
ctio->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
ctio->common.vp_index = vha->vp_idx;
ctio->common.initiator_id[0] = atio->fcp_hdr.s_id[2];
ctio->common.initiator_id[1] = atio->fcp_hdr.s_id[1];
ctio->common.initiator_id[2] = atio->fcp_hdr.s_id[0];
ctio->common.exchange_addr = atio->exchange_addr;
ctio->flags = (atio->attr << 9) | __constant_cpu_to_le16(
ctio->flags = (atio->attr << 9) | cpu_to_le16(
CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_SEND_STATUS);
ctio->ox_id = swab16(atio->fcp_hdr.ox_id);
ctio->scsi_status = __constant_cpu_to_le16(SS_RESPONSE_INFO_LEN_VALID);
ctio->response_len = __constant_cpu_to_le16(8);
ctio->scsi_status = cpu_to_le16(SS_RESPONSE_INFO_LEN_VALID);
ctio->response_len = cpu_to_le16(8);
((uint32_t *)ctio->sense_data)[0] = cpu_to_le32(resp_code);
TRACE_BUFFER("CTIO7 TASK MGMT packet data", ctio, REQUEST_ENTRY_SIZE);
@@ -2231,7 +2231,7 @@ static void q24_send_notify_ack(scsi_qla_host_t *vha,
nack->nport_handle = iocb->nport_handle;
if (le16_to_cpu(iocb->status) == IMM_NTFY_ELS) {
nack->flags = iocb->flags &
__constant_cpu_to_le32(NOTIFY24XX_FLAGS_PUREX_IOCB);
cpu_to_le32(NOTIFY24XX_FLAGS_PUREX_IOCB);
}
nack->srr_rx_id = iocb->srr_rx_id;
nack->status = iocb->status;
@@ -2490,7 +2490,7 @@ static void q2x_build_ctio_pkt(struct q2t_prm *prm)
vha->cmds[h-1] = prm->cmd;
pkt->common.handle = h | CTIO_COMPLETION_HANDLE_MARK;
pkt->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
pkt->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
/* Set initiator ID */
h = GET_TARGET_ID(ha, &prm->cmd->atio.atio2x);
@@ -2539,7 +2539,7 @@ static int q24_build_ctio_pkt(struct q2t_prm *prm)
pkt->common.handle = h | CTIO_COMPLETION_HANDLE_MARK;
pkt->common.nport_handle = cpu_to_le16(prm->cmd->loop_id);
pkt->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
pkt->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
pkt->common.initiator_id[0] = atio->fcp_hdr.s_id[2];
pkt->common.initiator_id[1] = atio->fcp_hdr.s_id[1];
pkt->common.initiator_id[2] = atio->fcp_hdr.s_id[0];
@@ -2924,18 +2924,18 @@ static void q2x_init_ctio_ret_entry(ctio_ret_entry_t *ctio_m1,
prm->sense_buffer_len = min_t(uint32_t, prm->sense_buffer_len,
sizeof(ctio_m1->sense_data));
ctio_m1->flags = __constant_cpu_to_le16(OF_SSTS | OF_FAST_POST |
ctio_m1->flags = cpu_to_le16(OF_SSTS | OF_FAST_POST |
OF_NO_DATA | OF_SS_MODE_1);
ctio_m1->flags |= __constant_cpu_to_le16(OF_INC_RC);
ctio_m1->flags |= cpu_to_le16(OF_INC_RC);
if (q2t_need_explicit_conf(prm->tgt->vha, prm->cmd, 0))
ctio_m1->flags |= __constant_cpu_to_le16(OF_EXPL_CONF | OF_CONF_REQ);
ctio_m1->flags |= cpu_to_le16(OF_EXPL_CONF | OF_CONF_REQ);
ctio_m1->scsi_status = cpu_to_le16(prm->rq_result);
ctio_m1->residual = cpu_to_le32(prm->residual);
if (scst_sense_valid(prm->sense_buffer)) {
if (q2t_need_explicit_conf(prm->tgt->vha, prm->cmd, 1))
ctio_m1->flags |= __constant_cpu_to_le16(OF_EXPL_CONF | OF_CONF_REQ);
ctio_m1->scsi_status |= __constant_cpu_to_le16(SS_SENSE_LEN_VALID);
ctio_m1->flags |= cpu_to_le16(OF_EXPL_CONF | OF_CONF_REQ);
ctio_m1->scsi_status |= cpu_to_le16(SS_SENSE_LEN_VALID);
ctio_m1->sense_length = cpu_to_le16(prm->sense_buffer_len);
memcpy(ctio_m1->sense_data, prm->sense_buffer,
prm->sense_buffer_len);
@@ -2979,8 +2979,8 @@ static int __q2x_xmit_response(struct q2t_cmd *cmd, int xmit_type)
pkt = (ctio_common_entry_t *)prm.pkt;
if (q2t_has_data(cmd) && (xmit_type & Q2T_XMIT_DATA)) {
pkt->flags |= __constant_cpu_to_le16(OF_FAST_POST | OF_DATA_IN);
pkt->flags |= __constant_cpu_to_le16(OF_INC_RC);
pkt->flags |= cpu_to_le16(OF_FAST_POST | OF_DATA_IN);
pkt->flags |= cpu_to_le16(OF_INC_RC);
q2x_load_data_segments(&prm);
@@ -2988,9 +2988,9 @@ static int __q2x_xmit_response(struct q2t_cmd *cmd, int xmit_type)
if (xmit_type & Q2T_XMIT_STATUS) {
pkt->scsi_status = cpu_to_le16(prm.rq_result);
pkt->residual = cpu_to_le32(prm.residual);
pkt->flags |= __constant_cpu_to_le16(OF_SSTS);
pkt->flags |= cpu_to_le16(OF_SSTS);
if (q2t_need_explicit_conf(vha, cmd, 0)) {
pkt->flags |= __constant_cpu_to_le16(
pkt->flags |= cpu_to_le16(
OF_EXPL_CONF |
OF_CONF_REQ);
}
@@ -3012,7 +3012,7 @@ static int __q2x_xmit_response(struct q2t_cmd *cmd, int xmit_type)
/* Real finish is ctio_m1's finish */
pkt->handle |= CTIO_INTERMEDIATE_HANDLE_MARK;
pkt->flags &= ~__constant_cpu_to_le16(OF_INC_RC);
pkt->flags &= ~cpu_to_le16(OF_INC_RC);
q2x_init_ctio_ret_entry(ctio_m1, &prm);
TRACE_BUFFER("Status CTIO packet data", ctio_m1,
@@ -3131,31 +3131,30 @@ static void q24_init_ctio_ret_entry(ctio7_status0_entry_t *ctio,
prm->sense_buffer_len = min_t(uint32_t, prm->sense_buffer_len,
sizeof(ctio1->sense_data));
ctio->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_SEND_STATUS);
ctio->flags |= cpu_to_le16(CTIO7_FLAGS_SEND_STATUS);
if (q2t_need_explicit_conf(prm->tgt->vha, prm->cmd, 0)) {
ctio->flags |= __constant_cpu_to_le16(
CTIO7_FLAGS_EXPLICIT_CONFORM |
CTIO7_FLAGS_CONFORM_REQ);
ctio->flags |= cpu_to_le16(CTIO7_FLAGS_EXPLICIT_CONFORM |
CTIO7_FLAGS_CONFORM_REQ);
}
ctio->residual = cpu_to_le32(prm->residual);
ctio->scsi_status = cpu_to_le16(prm->rq_result);
if (scst_sense_valid(prm->sense_buffer)) {
ctio1 = (ctio7_status1_entry_t *)ctio;
if (q2t_need_explicit_conf(prm->tgt->vha, prm->cmd, 1)) {
ctio1->flags |= __constant_cpu_to_le16(
ctio1->flags |= cpu_to_le16(
CTIO7_FLAGS_EXPLICIT_CONFORM |
CTIO7_FLAGS_CONFORM_REQ);
}
ctio1->flags &= ~__constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_0);
ctio1->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1);
ctio1->scsi_status |= __constant_cpu_to_le16(SS_SENSE_LEN_VALID);
ctio1->flags &= ~cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_0);
ctio1->flags |= cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1);
ctio1->scsi_status |= cpu_to_le16(SS_SENSE_LEN_VALID);
ctio1->sense_length = cpu_to_le16(prm->sense_buffer_len);
q24_copy_sense_buffer_to_ctio(ctio1, prm->sense_buffer,
prm->sense_buffer_len);
} else {
ctio1 = (ctio7_status1_entry_t *)ctio;
ctio1->flags &= ~__constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_0);
ctio1->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1);
ctio1->flags &= ~cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_0);
ctio1->flags |= cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1);
ctio1->sense_length = 0;
memset(ctio1->sense_data, 0, sizeof(ctio1->sense_data));
}
@@ -3198,7 +3197,7 @@ static int __q24_xmit_response(struct q2t_cmd *cmd, int xmit_type)
pkt = (ctio7_status0_entry_t *)prm.pkt;
if (q2t_has_data(cmd) && (xmit_type & Q2T_XMIT_DATA)) {
pkt->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_DATA_IN |
pkt->flags |= cpu_to_le16(CTIO7_FLAGS_DATA_IN |
CTIO7_FLAGS_STATUS_MODE_0);
q24_load_data_segments(&prm);
@@ -3207,10 +3206,10 @@ static int __q24_xmit_response(struct q2t_cmd *cmd, int xmit_type)
if (xmit_type & Q2T_XMIT_STATUS) {
pkt->scsi_status = cpu_to_le16(prm.rq_result);
pkt->residual = cpu_to_le32(prm.residual);
pkt->flags |= __constant_cpu_to_le16(
pkt->flags |= cpu_to_le16(
CTIO7_FLAGS_SEND_STATUS);
if (q2t_need_explicit_conf(vha, cmd, 0)) {
pkt->flags |= __constant_cpu_to_le16(
pkt->flags |= cpu_to_le16(
CTIO7_FLAGS_EXPLICIT_CONFORM |
CTIO7_FLAGS_CONFORM_REQ);
}
@@ -3229,13 +3228,11 @@ static int __q24_xmit_response(struct q2t_cmd *cmd, int xmit_type)
memcpy(ctio, pkt, sizeof(*ctio));
ctio->common.entry_count = 1;
ctio->common.dseg_count = 0;
ctio->flags &= ~__constant_cpu_to_le16(
CTIO7_FLAGS_DATA_IN);
ctio->flags &= ~cpu_to_le16(CTIO7_FLAGS_DATA_IN);
/* Real finish is ctio_m1's finish */
pkt->common.handle |= CTIO_INTERMEDIATE_HANDLE_MARK;
pkt->flags |= __constant_cpu_to_le16(
CTIO7_FLAGS_DONT_RET_CTIO);
pkt->flags |= cpu_to_le16(CTIO7_FLAGS_DONT_RET_CTIO);
q24_init_ctio_ret_entry((ctio7_status0_entry_t *)ctio,
&prm);
TRACE_BUFFER("Status CTIO7", ctio, REQUEST_ENTRY_SIZE);
@@ -3311,7 +3308,7 @@ static int __q2t_rdy_to_xfer(struct q2t_cmd *cmd)
if (unlikely(res != SCST_TGT_RES_SUCCESS))
goto out_unlock_free_unmap;
pkt = (ctio7_status0_entry_t *)prm.pkt;
pkt->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_DATA_OUT |
pkt->flags |= cpu_to_le16(CTIO7_FLAGS_DATA_OUT |
CTIO7_FLAGS_STATUS_MODE_0);
q24_load_data_segments(&prm);
p = pkt;
@@ -3319,7 +3316,7 @@ static int __q2t_rdy_to_xfer(struct q2t_cmd *cmd)
ctio_common_entry_t *pkt;
q2x_build_ctio_pkt(&prm);
pkt = (ctio_common_entry_t *)prm.pkt;
pkt->flags = __constant_cpu_to_le16(OF_FAST_POST | OF_DATA_OUT);
pkt->flags = cpu_to_le16(OF_FAST_POST | OF_DATA_OUT);
q2x_load_data_segments(&prm);
p = pkt;
}
@@ -3413,9 +3410,9 @@ static void q2x_send_term_exchange(scsi_qla_host_t *vha, struct q2t_cmd *cmd,
if (ctio->residual != 0)
ctio->scsi_status |= SS_RESIDUAL_UNDER;
ctio->flags = __constant_cpu_to_le16(OF_FAST_POST | OF_TERM_EXCH |
ctio->flags = cpu_to_le16(OF_FAST_POST | OF_TERM_EXCH |
OF_NO_DATA | OF_SS_MODE_1);
ctio->flags |= __constant_cpu_to_le16(OF_INC_RC);
ctio->flags |= cpu_to_le16(OF_INC_RC);
TRACE_BUFFER("CTIO TERM EXCH packet data", ctio, REQUEST_ENTRY_SIZE);
@@ -3478,13 +3475,13 @@ static void q24_send_term_exchange(scsi_qla_host_t *vha, struct q2t_cmd *cmd,
} else
ctio->common.nport_handle = CTIO7_NHANDLE_UNRECOGNIZED;
ctio->common.handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
ctio->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
ctio->common.vp_index = vha->vp_idx;
ctio->common.initiator_id[0] = atio->fcp_hdr.s_id[2];
ctio->common.initiator_id[1] = atio->fcp_hdr.s_id[1];
ctio->common.initiator_id[2] = atio->fcp_hdr.s_id[0];
ctio->common.exchange_addr = atio->exchange_addr;
ctio->flags = (atio->attr << 9) | __constant_cpu_to_le16(
ctio->flags = (atio->attr << 9) | cpu_to_le16(
CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_TERMINATE);
ctio->ox_id = swab16(atio->fcp_hdr.ox_id);
@@ -3646,7 +3643,7 @@ static bool q2t_term_ctio_exchange(scsi_qla_host_t *vha, void *ctio,
}
if (ctio != NULL) {
ctio7_fw_entry_t *c = (ctio7_fw_entry_t *)ctio;
term = !(c->flags & __constant_cpu_to_le16(OF_TERM_EXCH));
term = !(c->flags & cpu_to_le16(OF_TERM_EXCH));
} else
term = true;
if (term)
@@ -3657,7 +3654,7 @@ static bool q2t_term_ctio_exchange(scsi_qla_host_t *vha, void *ctio,
#if 0 /* Seems, it isn't needed. If enable it, add support for NULL cmd! */
if (ctio != NULL) {
ctio_common_entry_t *c = (ctio_common_entry_t *)ctio;
term = !(c->flags & __constant_cpu_to_le16(CTIO7_FLAGS_TERMINATE));
term = !(c->flags & cpu_to_le16(CTIO7_FLAGS_TERMINATE));
} else
term = true;
if (term)
@@ -5200,7 +5197,7 @@ static void q2x_send_busy(scsi_qla_host_t *vha, atio_entry_t *atio)
ctio->entry_type = CTIO_RET_TYPE;
ctio->entry_count = 1;
ctio->handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->scsi_status = __constant_cpu_to_le16(SAM_STAT_BUSY);
ctio->scsi_status = cpu_to_le16(SAM_STAT_BUSY);
ctio->residual = atio->data_length;
if (ctio->residual != 0)
ctio->scsi_status |= SS_RESIDUAL_UNDER;
@@ -5209,9 +5206,9 @@ static void q2x_send_busy(scsi_qla_host_t *vha, atio_entry_t *atio)
SET_TARGET_ID(ha, ctio->target, GET_TARGET_ID(ha, atio));
ctio->rx_id = atio->rx_id;
ctio->flags = __constant_cpu_to_le16(OF_SSTS | OF_FAST_POST |
ctio->flags = cpu_to_le16(OF_SSTS | OF_FAST_POST |
OF_NO_DATA | OF_SS_MODE_1);
ctio->flags |= __constant_cpu_to_le16(OF_INC_RC);
ctio->flags |= cpu_to_le16(OF_INC_RC);
/*
* CTIO from fw w/o scst_cmd doesn't provide enough info to retry it,
* if the explicit confirmation is used.
@@ -5264,13 +5261,13 @@ static void q24_send_busy(scsi_qla_host_t *vha, atio7_entry_t *atio,
ctio->common.entry_count = 1;
ctio->common.handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->common.nport_handle = loop_id;
ctio->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
ctio->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
ctio->common.vp_index = vha->vp_idx;
ctio->common.initiator_id[0] = atio->fcp_hdr.s_id[2];
ctio->common.initiator_id[1] = atio->fcp_hdr.s_id[1];
ctio->common.initiator_id[2] = atio->fcp_hdr.s_id[0];
ctio->common.exchange_addr = atio->exchange_addr;
ctio->flags = (atio->attr << 9) | __constant_cpu_to_le16(
ctio->flags = (atio->attr << 9) | cpu_to_le16(
CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_SEND_STATUS |
CTIO7_FLAGS_DONT_RET_CTIO);
/*
@@ -5454,7 +5451,7 @@ static void q2t_response_pkt(scsi_qla_host_t *vha, response_t *pkt)
GET_TARGET_ID(vha->hw, atio), atio->rx_id);
TRACE_BUFFER("Incoming ATIO packet data", atio,
REQUEST_ENTRY_SIZE);
if (atio->status != __constant_cpu_to_le16(ATIO_CDB_VALID)) {
if (atio->status != cpu_to_le16(ATIO_CDB_VALID)) {
PRINT_ERROR("qla2x00t(%ld): ATIO with error "
"status %x received", vha->host_no,
le16_to_cpu(atio->status));
@@ -5519,7 +5516,7 @@ static void q2t_response_pkt(scsi_qla_host_t *vha, response_t *pkt)
TRACE_BUFFER("Incoming NOTIFY_ACK packet data", pkt,
RESPONSE_ENTRY_SIZE);
tgt->notify_ack_expected--;
if (entry->status != __constant_cpu_to_le16(NOTIFY_ACK_SUCCESS)) {
if (entry->status != cpu_to_le16(NOTIFY_ACK_SUCCESS)) {
PRINT_ERROR("qla2x00t(%ld): NOTIFY_ACK "
"failed %x", vha->host_no,
le16_to_cpu(entry->status));
+1 -1
View File
@@ -66,7 +66,7 @@ qla2x00_store_class2_enabled(struct device *dev,
break;
case '1':
if (!ha->enable_class_2) {
if (ha->fw_attributes & __constant_cpu_to_le32(BIT_0)) {
if (ha->fw_attributes & cpu_to_le32(BIT_0)) {
printk(KERN_INFO "(%ld): Enabling class 2 "
"operations.\n", vha->host_no);
ha->enable_class_2 = 1;
+50 -62
View File
@@ -34,10 +34,10 @@ qla2x00_prep_ms_iocb(scsi_qla_host_t *vha, uint32_t req_size, uint32_t rsp_size)
ms_pkt->entry_type = MS_IOCB_TYPE;
ms_pkt->entry_count = 1;
SET_TARGET_ID(ha, ms_pkt->loop_id, SIMPLE_NAME_SERVER);
ms_pkt->control_flags = __constant_cpu_to_le16(CF_READ | CF_HEAD_TAG);
ms_pkt->control_flags = cpu_to_le16(CF_READ | CF_HEAD_TAG);
ms_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
ms_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
ms_pkt->total_dsd_count = __constant_cpu_to_le16(2);
ms_pkt->cmd_dsd_count = cpu_to_le16(1);
ms_pkt->total_dsd_count = cpu_to_le16(2);
ms_pkt->rsp_bytecount = cpu_to_le32(rsp_size);
ms_pkt->req_bytecount = cpu_to_le32(req_size);
@@ -71,10 +71,10 @@ qla24xx_prep_ms_iocb(scsi_qla_host_t *vha, uint32_t req_size, uint32_t rsp_size)
ct_pkt->entry_type = CT_IOCB_TYPE;
ct_pkt->entry_count = 1;
ct_pkt->nport_handle = __constant_cpu_to_le16(NPH_SNS);
ct_pkt->nport_handle = cpu_to_le16(NPH_SNS);
ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
ct_pkt->cmd_dsd_count = cpu_to_le16(1);
ct_pkt->rsp_dsd_count = cpu_to_le16(1);
ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
ct_pkt->cmd_byte_count = cpu_to_le32(req_size);
@@ -139,7 +139,7 @@ qla2x00_chk_ms_status(scsi_qla_host_t *vha, ms_iocb_entry_t *ms_pkt,
case CS_DATA_UNDERRUN:
case CS_DATA_OVERRUN: /* Overrun? */
if (ct_rsp->header.response !=
__constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) {
cpu_to_be16(CT_ACCEPT_RESPONSE)) {
ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0x2077,
"%s failed rejected request on port_id: "
"%02x%02x%02x.\n", routine,
@@ -1176,10 +1176,10 @@ qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *vha, uint32_t req_size,
ms_pkt->entry_type = MS_IOCB_TYPE;
ms_pkt->entry_count = 1;
SET_TARGET_ID(ha, ms_pkt->loop_id, vha->mgmt_svr_loop_id);
ms_pkt->control_flags = __constant_cpu_to_le16(CF_READ | CF_HEAD_TAG);
ms_pkt->control_flags = cpu_to_le16(CF_READ | CF_HEAD_TAG);
ms_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
ms_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
ms_pkt->total_dsd_count = __constant_cpu_to_le16(2);
ms_pkt->cmd_dsd_count = cpu_to_le16(1);
ms_pkt->total_dsd_count = cpu_to_le16(2);
ms_pkt->rsp_bytecount = cpu_to_le32(rsp_size);
ms_pkt->req_bytecount = cpu_to_le32(req_size);
@@ -1216,8 +1216,8 @@ qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *vha, uint32_t req_size,
ct_pkt->entry_count = 1;
ct_pkt->nport_handle = cpu_to_le16(vha->mgmt_svr_loop_id);
ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
ct_pkt->cmd_dsd_count = cpu_to_le16(1);
ct_pkt->rsp_dsd_count = cpu_to_le16(1);
ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
ct_pkt->cmd_byte_count = cpu_to_le32(req_size);
@@ -1304,19 +1304,18 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
/* Prepare FDMI command arguments -- attribute block, attributes. */
memcpy(ct_req->req.rhba.hba_identifier, vha->port_name, WWN_SIZE);
ct_req->req.rhba.entry_count = __constant_cpu_to_be32(1);
ct_req->req.rhba.entry_count = cpu_to_be32(1);
memcpy(ct_req->req.rhba.port_name, vha->port_name, WWN_SIZE);
size = 2 * WWN_SIZE + 4 + 4;
/* Attributes */
ct_req->req.rhba.attrs.count =
__constant_cpu_to_be32(FDMI_HBA_ATTR_COUNT);
ct_req->req.rhba.attrs.count = cpu_to_be32(FDMI_HBA_ATTR_COUNT);
entries = ct_req->req.rhba.hba_identifier;
/* Nodename. */
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_HBA_NODE_NAME);
eiter->len = __constant_cpu_to_be16(4 + WWN_SIZE);
eiter->type = cpu_to_be16(FDMI_HBA_NODE_NAME);
eiter->len = cpu_to_be16(4 + WWN_SIZE);
memcpy(eiter->a.node_name, vha->node_name, WWN_SIZE);
size += 4 + WWN_SIZE;
@@ -1329,7 +1328,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
/* Manufacturer. */
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_HBA_MANUFACTURER);
eiter->type = cpu_to_be16(FDMI_HBA_MANUFACTURER);
strcpy(eiter->a.manufacturer, "FUSIONIO");
alen = strlen(eiter->a.manufacturer);
alen += (alen & 3) ? (4 - (alen & 3)) : 4;
@@ -1341,7 +1340,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
/* Serial number. */
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_HBA_SERIAL_NUMBER);
eiter->type = cpu_to_be16(FDMI_HBA_SERIAL_NUMBER);
sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1;
sprintf(eiter->a.serial_num, "%c%05d", 'A' + sn / 100000, sn % 100000);
alen = strlen(eiter->a.serial_num);
@@ -1354,7 +1353,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
/* Model name. */
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_HBA_MODEL);
eiter->type = cpu_to_be16(FDMI_HBA_MODEL);
strlcpy(eiter->a.model, ha->model_number, sizeof(eiter->a.model));
alen = strlen(eiter->a.model);
alen += (alen & 3) ? (4 - (alen & 3)) : 4;
@@ -1366,7 +1365,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
/* Model description. */
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_HBA_MODEL_DESCRIPTION);
eiter->type = cpu_to_be16(FDMI_HBA_MODEL_DESCRIPTION);
strncpy(eiter->a.model_desc, ha->model_desc, 80);
alen = strlen(eiter->a.model_desc);
alen += (alen & 3) ? (4 - (alen & 3)) : 4;
@@ -1378,7 +1377,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
/* Hardware version. */
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_HBA_HARDWARE_VERSION);
eiter->type = cpu_to_be16(FDMI_HBA_HARDWARE_VERSION);
strcpy(eiter->a.hw_version, ha->adapter_id);
alen = strlen(eiter->a.hw_version);
alen += (alen & 3) ? (4 - (alen & 3)) : 4;
@@ -1390,7 +1389,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
/* Driver version. */
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_HBA_DRIVER_VERSION);
eiter->type = cpu_to_be16(FDMI_HBA_DRIVER_VERSION);
snprintf(eiter->a.driver_version, sizeof(eiter->a.driver_version),
"%s", qla2x00_version_str);
alen = strlen(eiter->a.driver_version);
@@ -1403,7 +1402,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
/* Option ROM version. */
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_HBA_OPTION_ROM_VERSION);
eiter->type = cpu_to_be16(FDMI_HBA_OPTION_ROM_VERSION);
strcpy(eiter->a.orom_version, "0.00");
alen = strlen(eiter->a.orom_version);
alen += (alen & 3) ? (4 - (alen & 3)) : 4;
@@ -1415,7 +1414,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
/* Firmware version */
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_HBA_FIRMWARE_VERSION);
eiter->type = cpu_to_be16(FDMI_HBA_FIRMWARE_VERSION);
ha->isp_ops->fw_version_str(vha, eiter->a.fw_version,
sizeof(eiter->a.fw_version));
alen = strlen(eiter->a.fw_version);
@@ -1553,14 +1552,13 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
size = WWN_SIZE + 4;
/* Attributes */
ct_req->req.rpa.attrs.count =
__constant_cpu_to_be32(FDMI_PORT_ATTR_COUNT - 1);
ct_req->req.rpa.attrs.count = cpu_to_be32(FDMI_PORT_ATTR_COUNT - 1);
entries = ct_req->req.rpa.port_name;
/* FC4 types. */
eiter = (struct ct_fdmi_port_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_PORT_FC4_TYPES);
eiter->len = __constant_cpu_to_be16(4 + 32);
eiter->type = cpu_to_be16(FDMI_PORT_FC4_TYPES);
eiter->len = cpu_to_be16(4 + 32);
eiter->a.fc4_types[2] = 0x01;
size += 4 + 32;
@@ -1571,25 +1569,23 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
/* Supported speed. */
eiter = (struct ct_fdmi_port_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_PORT_SUPPORT_SPEED);
eiter->len = __constant_cpu_to_be16(4 + 4);
eiter->type = cpu_to_be16(FDMI_PORT_SUPPORT_SPEED);
eiter->len = cpu_to_be16(4 + 4);
if (IS_CNA_CAPABLE(ha))
eiter->a.sup_speed = __constant_cpu_to_be32(
FDMI_PORT_SPEED_10GB);
eiter->a.sup_speed = cpu_to_be32(FDMI_PORT_SPEED_10GB);
else if (IS_QLA25XX(ha))
eiter->a.sup_speed = __constant_cpu_to_be32(
eiter->a.sup_speed = cpu_to_be32(
FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB|
FDMI_PORT_SPEED_4GB|FDMI_PORT_SPEED_8GB);
else if (IS_QLA24XX_TYPE(ha))
eiter->a.sup_speed = __constant_cpu_to_be32(
eiter->a.sup_speed = cpu_to_be32(
FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB|
FDMI_PORT_SPEED_4GB);
else if (IS_QLA23XX(ha))
eiter->a.sup_speed =__constant_cpu_to_be32(
eiter->a.sup_speed =cpu_to_be32(
FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB);
else
eiter->a.sup_speed = __constant_cpu_to_be32(
FDMI_PORT_SPEED_1GB);
eiter->a.sup_speed = cpu_to_be32(FDMI_PORT_SPEED_1GB);
size += 4 + 4;
ql_dbg(ql_dbg_disc, vha, 0x203a,
@@ -1597,36 +1593,29 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
/* Current speed. */
eiter = (struct ct_fdmi_port_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_PORT_CURRENT_SPEED);
eiter->len = __constant_cpu_to_be16(4 + 4);
eiter->type = cpu_to_be16(FDMI_PORT_CURRENT_SPEED);
eiter->len = cpu_to_be16(4 + 4);
switch (ha->link_data_rate) {
case PORT_SPEED_1GB:
eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_1GB);
eiter->a.cur_speed = cpu_to_be32(FDMI_PORT_SPEED_1GB);
break;
case PORT_SPEED_2GB:
eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_2GB);
eiter->a.cur_speed = cpu_to_be32(FDMI_PORT_SPEED_2GB);
break;
case PORT_SPEED_4GB:
eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_4GB);
eiter->a.cur_speed = cpu_to_be32(FDMI_PORT_SPEED_4GB);
break;
case PORT_SPEED_8GB:
eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_8GB);
eiter->a.cur_speed = cpu_to_be32(FDMI_PORT_SPEED_8GB);
break;
case PORT_SPEED_10GB:
eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_10GB);
eiter->a.cur_speed = cpu_to_be32(FDMI_PORT_SPEED_10GB);
break;
case PORT_SPEED_16GB:
eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_16GB);
eiter->a.cur_speed = cpu_to_be32(FDMI_PORT_SPEED_16GB);
break;
default:
eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_UNKNOWN);
eiter->a.cur_speed = cpu_to_be32(FDMI_PORT_SPEED_UNKNOWN);
break;
}
size += 4 + 4;
@@ -1636,8 +1625,8 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
/* Max frame size. */
eiter = (struct ct_fdmi_port_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_PORT_MAX_FRAME_SIZE);
eiter->len = __constant_cpu_to_be16(4 + 4);
eiter->type = cpu_to_be16(FDMI_PORT_MAX_FRAME_SIZE);
eiter->len = cpu_to_be16(4 + 4);
max_frame_size = IS_FWI2_CAPABLE(ha) ?
le16_to_cpu(icb24->frame_payload_size):
le16_to_cpu(ha->init_cb->frame_payload_size);
@@ -1649,7 +1638,7 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
/* OS device name. */
eiter = (struct ct_fdmi_port_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_PORT_OS_DEVICE_NAME);
eiter->type = cpu_to_be16(FDMI_PORT_OS_DEVICE_NAME);
strcpy(eiter->a.os_dev_name, QLA2XXX_DRIVER_NAME);
alen = strlen(eiter->a.os_dev_name);
alen += (alen & 3) ? (4 - (alen & 3)) : 4;
@@ -1661,10 +1650,9 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
/* Hostname. */
if (strlen(fc_host_system_hostname(vha->host))) {
ct_req->req.rpa.attrs.count =
__constant_cpu_to_be32(FDMI_PORT_ATTR_COUNT);
ct_req->req.rpa.attrs.count = cpu_to_be32(FDMI_PORT_ATTR_COUNT);
eiter = (struct ct_fdmi_port_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_PORT_HOST_NAME);
eiter->type = cpu_to_be16(FDMI_PORT_HOST_NAME);
snprintf(eiter->a.host_name, sizeof(eiter->a.host_name),
"%s", fc_host_system_hostname(vha->host));
alen = strlen(eiter->a.host_name);
@@ -1819,8 +1807,8 @@ qla24xx_prep_ms_fm_iocb(scsi_qla_host_t *vha, uint32_t req_size,
ct_pkt->entry_count = 1;
ct_pkt->nport_handle = cpu_to_le16(vha->mgmt_svr_loop_id);
ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
ct_pkt->cmd_dsd_count = cpu_to_le16(1);
ct_pkt->rsp_dsd_count = cpu_to_le16(1);
ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
ct_pkt->cmd_byte_count = cpu_to_le32(req_size);
+96 -101
View File
@@ -1715,8 +1715,8 @@ qla2x00_config_rings(struct scsi_qla_host *vha)
struct rsp_que *rsp = ha->rsp_q_map[0];
/* Setup ring parameters in initialization control block. */
ha->init_cb->request_q_outpointer = __constant_cpu_to_le16(0);
ha->init_cb->response_q_inpointer = __constant_cpu_to_le16(0);
ha->init_cb->request_q_outpointer = cpu_to_le16(0);
ha->init_cb->response_q_inpointer = cpu_to_le16(0);
ha->init_cb->request_q_length = cpu_to_le16(req->length);
ha->init_cb->response_q_length = cpu_to_le16(rsp->length);
ha->init_cb->request_q_address[0] = cpu_to_le32(LSD(req->dma));
@@ -1745,8 +1745,8 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
/* Setup ring parameters in initialization control block. */
icb = (struct init_cb_24xx *)ha->init_cb;
icb->request_q_outpointer = __constant_cpu_to_le16(0);
icb->response_q_inpointer = __constant_cpu_to_le16(0);
icb->request_q_outpointer = cpu_to_le16(0);
icb->response_q_inpointer = cpu_to_le16(0);
icb->request_q_length = cpu_to_le16(req->length);
icb->response_q_length = cpu_to_le16(rsp->length);
icb->request_q_address[0] = cpu_to_le32(LSD(req->dma));
@@ -1755,15 +1755,15 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
icb->response_q_address[1] = cpu_to_le32(MSD(rsp->dma));
#ifdef CONFIG_SCSI_QLA2XXX_TARGET
icb->atio_q_inpointer = __constant_cpu_to_le16(0);
icb->atio_q_inpointer = cpu_to_le16(0);
icb->atio_q_length = cpu_to_le16(vha->hw->atio_q_length);
icb->atio_q_address[0] = cpu_to_le32(LSD(vha->hw->atio_dma));
icb->atio_q_address[1] = cpu_to_le32(MSD(vha->hw->atio_dma));
#endif
if (ha->mqenable || IS_QLA83XX(ha)) {
icb->qos = __constant_cpu_to_le16(QLA_DEFAULT_QUE_QOS);
icb->rid = __constant_cpu_to_le16(rid);
icb->qos = cpu_to_le16(QLA_DEFAULT_QUE_QOS);
icb->rid = cpu_to_le16(rid);
if (ha->flags.msix_enabled) {
msix = &ha->msix_entries[1];
ql_dbg(ql_dbg_init, vha, 0x00fd,
@@ -1773,12 +1773,10 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
}
/* Use alternate PCI bus number */
if (MSB(rid))
icb->firmware_options_2 |=
__constant_cpu_to_le32(BIT_19);
icb->firmware_options_2 |= cpu_to_le32(BIT_19);
/* Use alternate PCI devfn */
if (LSB(rid))
icb->firmware_options_2 |=
__constant_cpu_to_le32(BIT_18);
icb->firmware_options_2 |= cpu_to_le32(BIT_18);
#ifdef CONFIG_SCSI_QLA2XXX_TARGET
if (IS_ATIO_MSIX_CAPABLE(ha)) {
@@ -1792,16 +1790,14 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
/* Use Disable MSIX Handshake mode for capable adapters */
if ((ha->fw_attributes & BIT_6) && (IS_MSIX_NACK_CAPABLE(ha)) &&
(ha->flags.msix_enabled)) {
icb->firmware_options_2 &=
__constant_cpu_to_le32(~BIT_22);
icb->firmware_options_2 &= cpu_to_le32(~BIT_22);
ha->disable_msix_handshake = 1;
ql_dbg(ql_dbg_init, vha, 0x00fe,
"MSIX Handshake Disable Mode turned on.\n");
} else {
icb->firmware_options_2 |=
__constant_cpu_to_le32(BIT_22);
icb->firmware_options_2 |= cpu_to_le32(BIT_22);
}
icb->firmware_options_2 |= __constant_cpu_to_le32(BIT_23);
icb->firmware_options_2 |= cpu_to_le32(BIT_23);
WRT_REG_DWORD(&reg->isp25mq.req_q_in, 0);
WRT_REG_DWORD(&reg->isp25mq.req_q_out, 0);
@@ -1896,7 +1892,7 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
}
if (IS_FWI2_CAPABLE(ha)) {
mid_init_cb->options = __constant_cpu_to_le16(BIT_1);
mid_init_cb->options = cpu_to_le16(BIT_1);
mid_init_cb->init_cb.execution_throttle =
cpu_to_le16(ha->fw_xcb_count);
}
@@ -2292,22 +2288,22 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
nv->firmware_options[1] = BIT_7 | BIT_5;
nv->add_firmware_options[0] = BIT_5;
nv->add_firmware_options[1] = BIT_5 | BIT_4;
nv->frame_payload_size = __constant_cpu_to_le16(2048);
nv->frame_payload_size = cpu_to_le16(2048);
nv->special_options[1] = BIT_7;
} else if (IS_QLA2200(ha)) {
nv->firmware_options[0] = BIT_2 | BIT_1;
nv->firmware_options[1] = BIT_7 | BIT_5;
nv->add_firmware_options[0] = BIT_5;
nv->add_firmware_options[1] = BIT_5 | BIT_4;
nv->frame_payload_size = __constant_cpu_to_le16(1024);
nv->frame_payload_size = cpu_to_le16(1024);
} else if (IS_QLA2100(ha)) {
nv->firmware_options[0] = BIT_3 | BIT_1;
nv->firmware_options[1] = BIT_5;
nv->frame_payload_size = __constant_cpu_to_le16(1024);
nv->frame_payload_size = cpu_to_le16(1024);
}
nv->max_iocb_allocation = __constant_cpu_to_le16(256);
nv->execution_throttle = __constant_cpu_to_le16(16);
nv->max_iocb_allocation = cpu_to_le16(256);
nv->execution_throttle = cpu_to_le16(16);
nv->retry_count = 8;
nv->retry_delay = 1;
@@ -2325,7 +2321,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
nv->host_p[1] = BIT_2;
nv->reset_delay = 5;
nv->port_down_retry_count = 8;
nv->max_luns_per_target = __constant_cpu_to_le16(8);
nv->max_luns_per_target = cpu_to_le16(8);
nv->link_down_timeout = 60;
rval = 1;
@@ -2339,7 +2335,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
* are valid.
*/
if (ia64_platform_is("sn2")) {
nv->frame_payload_size = __constant_cpu_to_le16(2048);
nv->frame_payload_size = cpu_to_le16(2048);
if (IS_QLA23XX(ha))
nv->special_options[1] = BIT_7;
}
@@ -2548,7 +2544,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
memcpy(vha->node_name, icb->node_name, WWN_SIZE);
memcpy(vha->port_name, icb->port_name, WWN_SIZE);
icb->execution_throttle = __constant_cpu_to_le16(0xFFFF);
icb->execution_throttle = cpu_to_le16(0xFFFF);
ha->retry_count = nv->retry_count;
@@ -2600,10 +2596,10 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
if (ql2xloginretrycount)
ha->login_retry_count = ql2xloginretrycount;
icb->lun_enables = __constant_cpu_to_le16(0);
icb->lun_enables = cpu_to_le16(0);
icb->command_resource_count = 0;
icb->immediate_notify_resource_count = 0;
icb->timeout = __constant_cpu_to_le16(0);
icb->timeout = cpu_to_le16(0);
if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
/* Enable RIO */
@@ -4449,7 +4445,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
/* Bad NVRAM data, set defaults parameters. */
if (chksum || nv->id[0] != 'I' || nv->id[1] != 'S' || nv->id[2] != 'P'
|| nv->id[3] != ' ' ||
nv->nvram_version < __constant_cpu_to_le16(ICB_VERSION)) {
nv->nvram_version < cpu_to_le16(ICB_VERSION)) {
/* Reset NVRAM data. */
ql_log(ql_log_warn, vha, 0x006b,
"Inconsistent NVRAM detected: checksum=0x%x id=%c "
@@ -4462,12 +4458,12 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
* Set default initialization control block.
*/
memset(nv, 0, ha->nvram_size);
nv->nvram_version = __constant_cpu_to_le16(ICB_VERSION);
nv->version = __constant_cpu_to_le16(ICB_VERSION);
nv->frame_payload_size = __constant_cpu_to_le16(2048);
nv->execution_throttle = __constant_cpu_to_le16(0xFFFF);
nv->exchange_count = __constant_cpu_to_le16(0);
nv->hard_address = __constant_cpu_to_le16(124);
nv->nvram_version = cpu_to_le16(ICB_VERSION);
nv->version = cpu_to_le16(ICB_VERSION);
nv->frame_payload_size = cpu_to_le16(2048);
nv->execution_throttle = cpu_to_le16(0xFFFF);
nv->exchange_count = cpu_to_le16(0);
nv->hard_address = cpu_to_le16(124);
nv->port_name[0] = 0x21;
nv->port_name[1] = 0x00 + ha->port_no;
nv->port_name[2] = 0x00;
@@ -4485,20 +4481,19 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
nv->node_name[6] = 0x55;
nv->node_name[7] = 0x86;
qla24xx_nvram_wwn_from_ofw(vha, nv);
nv->login_retry_count = __constant_cpu_to_le16(8);
nv->interrupt_delay_timer = __constant_cpu_to_le16(0);
nv->login_timeout = __constant_cpu_to_le16(0);
nv->firmware_options_1 =
__constant_cpu_to_le32(BIT_14|BIT_13|BIT_2|BIT_1);
nv->firmware_options_2 = __constant_cpu_to_le32(2 << 4);
nv->firmware_options_2 |= __constant_cpu_to_le32(BIT_12);
nv->firmware_options_3 = __constant_cpu_to_le32(2 << 13);
nv->host_p = __constant_cpu_to_le32(BIT_11|BIT_10);
nv->efi_parameters = __constant_cpu_to_le32(0);
nv->login_retry_count = cpu_to_le16(8);
nv->interrupt_delay_timer = cpu_to_le16(0);
nv->login_timeout = cpu_to_le16(0);
nv->firmware_options_1 = cpu_to_le32(BIT_14|BIT_13|BIT_2|BIT_1);
nv->firmware_options_2 = cpu_to_le32(2 << 4);
nv->firmware_options_2 |= cpu_to_le32(BIT_12);
nv->firmware_options_3 = cpu_to_le32(2 << 13);
nv->host_p = cpu_to_le32(BIT_11|BIT_10);
nv->efi_parameters = cpu_to_le32(0);
nv->reset_delay = 5;
nv->max_luns_per_target = __constant_cpu_to_le16(128);
nv->port_down_retry_count = __constant_cpu_to_le16(30);
nv->link_down_timeout = __constant_cpu_to_le16(30);
nv->max_luns_per_target = cpu_to_le16(128);
nv->port_down_retry_count = cpu_to_le16(30);
nv->link_down_timeout = cpu_to_le16(30);
rval = 1;
}
@@ -4515,30 +4510,30 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
ha->saved_set = 1;
}
nv->exchange_count = __constant_cpu_to_le16(0xFFFF);
nv->exchange_count = cpu_to_le16(0xFFFF);
/* Enable target mode */
nv->firmware_options_1 |= __constant_cpu_to_le32(BIT_4);
nv->firmware_options_1 |= cpu_to_le32(BIT_4);
/* Disable ini mode, if requested */
if (!qla_ini_mode_enabled(vha))
nv->firmware_options_1 |= __constant_cpu_to_le32(BIT_5);
nv->firmware_options_1 |= cpu_to_le32(BIT_5);
if (ha->enable_explicit_conf) {
ql_log(ql_log_info, vha, 0x1073, "Enabling FC tape support\n");
/* Disable Full Login after LIP */
nv->firmware_options_1 &= __constant_cpu_to_le32(~BIT_13);
nv->firmware_options_1 &= cpu_to_le32(~BIT_13);
/* Enable FC tapes support */
nv->firmware_options_2 |= __constant_cpu_to_le32(BIT_12);
nv->firmware_options_2 |= cpu_to_le32(BIT_12);
} else {
ql_log(ql_log_info, vha, 0x1073, "Disabling FC tape support\n");
/* Enable Full Login after LIP */
nv->firmware_options_1 |= __constant_cpu_to_le32(BIT_13);
nv->firmware_options_1 |= cpu_to_le32(BIT_13);
/* Disable FC tapes support */
nv->firmware_options_2 &= __constant_cpu_to_le32(~BIT_12);
nv->firmware_options_2 &= cpu_to_le32(~BIT_12);
}
/* Enable initial LIP */
nv->firmware_options_1 &= __constant_cpu_to_le32(~BIT_9);
nv->firmware_options_1 &= cpu_to_le32(~BIT_9);
} else {
if (ha->saved_set) {
nv->exchange_count = ha->saved_exchange_count;
@@ -4548,7 +4543,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
}
}
/* out-of-order frames reassembly */
nv->firmware_options_3 |= __constant_cpu_to_le32(BIT_6|BIT_9);
nv->firmware_options_3 |= cpu_to_le32(BIT_6|BIT_9);
#endif /* CONFIG_SCSI_QLA2XXX_TARGET */
@@ -4557,11 +4552,11 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
fc_host_supported_classes(vha->host) =
FC_COS_CLASS2 | FC_COS_CLASS3;
}
nv->firmware_options_2 |= __constant_cpu_to_le32(BIT_8);
nv->firmware_options_2 |= cpu_to_le32(BIT_8);
} else {
if (vha->flags.init_done)
fc_host_supported_classes(vha->host) = FC_COS_CLASS3;
nv->firmware_options_2 &= ~__constant_cpu_to_le32(BIT_8);
nv->firmware_options_2 &= ~cpu_to_le32(BIT_8);
}
#if 0
@@ -4569,7 +4564,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
* firmware_options_3 bits 3-2 are reserved, but for some reason
* sometimes set by BIOS. Let's explicitly reset them.
*/
nv->firmware_options_3 &= ~__constant_cpu_to_le32(BIT_3|BIT_2);
nv->firmware_options_3 &= ~cpu_to_le32(BIT_3|BIT_2);
#endif
/* Reset Initialization control block */
@@ -4605,17 +4600,17 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
memcpy(icb->node_name, vha->node_name, WWN_SIZE);
if (vha->port_name_set)
memcpy(icb->port_name, vha->port_name, WWN_SIZE);
icb->firmware_options_1 |= __constant_cpu_to_le32(BIT_14);
icb->firmware_options_1 |= cpu_to_le32(BIT_14);
} else
#endif
if (nv->host_p & __constant_cpu_to_le32(BIT_15)) {
if (nv->host_p & cpu_to_le32(BIT_15)) {
/* Use alternate WWN? */
memcpy(icb->node_name, nv->alternate_node_name, WWN_SIZE);
memcpy(icb->port_name, nv->alternate_port_name, WWN_SIZE);
}
/* Prepare nodename */
if ((icb->firmware_options_1 & __constant_cpu_to_le32(BIT_14)) == 0) {
if ((icb->firmware_options_1 & cpu_to_le32(BIT_14)) == 0) {
/*
* Firmware will apply the following mask if the nodename was
* not provided.
@@ -4647,7 +4642,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
memcpy(vha->node_name, icb->node_name, WWN_SIZE);
memcpy(vha->port_name, icb->port_name, WWN_SIZE);
icb->execution_throttle = __constant_cpu_to_le16(0xFFFF);
icb->execution_throttle = cpu_to_le16(0xFFFF);
ha->retry_count = le16_to_cpu(nv->login_retry_count);
@@ -4655,7 +4650,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
if (le16_to_cpu(nv->login_timeout) < ql2xlogintimeout)
nv->login_timeout = cpu_to_le16(ql2xlogintimeout);
if (le16_to_cpu(nv->login_timeout) < 4)
nv->login_timeout = __constant_cpu_to_le16(4);
nv->login_timeout = cpu_to_le16(4);
ha->login_timeout = le16_to_cpu(nv->login_timeout);
icb->login_timeout = nv->login_timeout;
@@ -4710,7 +4705,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)
le16_to_cpu(icb->interrupt_delay_timer): 2;
#endif /* CONFIG_SCSI_QLA2XXX_TARGET */
}
icb->firmware_options_2 &= __constant_cpu_to_le32(
icb->firmware_options_2 &= cpu_to_le32(
~(BIT_3 | BIT_2 | BIT_1 | BIT_0));
vha->flags.process_response_queue = 0;
if (ha->zio_mode != QLA_ZIO_DISABLED) {
@@ -5401,7 +5396,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
/* Bad NVRAM data, set defaults parameters. */
if (chksum || nv->id[0] != 'I' || nv->id[1] != 'S' || nv->id[2] != 'P'
|| nv->id[3] != ' ' ||
nv->nvram_version < __constant_cpu_to_le16(ICB_VERSION)) {
nv->nvram_version < cpu_to_le16(ICB_VERSION)) {
/* Reset NVRAM data. */
ql_log(ql_log_info, vha, 0x0073,
"Inconsistent NVRAM detected: checksum=0x%x id=%c "
@@ -5415,11 +5410,11 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
* Set default initialization control block.
*/
memset(nv, 0, ha->nvram_size);
nv->nvram_version = __constant_cpu_to_le16(ICB_VERSION);
nv->version = __constant_cpu_to_le16(ICB_VERSION);
nv->frame_payload_size = __constant_cpu_to_le16(2048);
nv->execution_throttle = __constant_cpu_to_le16(0xFFFF);
nv->exchange_count = __constant_cpu_to_le16(0);
nv->nvram_version = cpu_to_le16(ICB_VERSION);
nv->version = cpu_to_le16(ICB_VERSION);
nv->frame_payload_size = cpu_to_le16(2048);
nv->execution_throttle = cpu_to_le16(0xFFFF);
nv->exchange_count = cpu_to_le16(0);
nv->port_name[0] = 0x21;
nv->port_name[1] = 0x00 + ha->port_no;
nv->port_name[2] = 0x00;
@@ -5436,20 +5431,20 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
nv->node_name[5] = 0x1c;
nv->node_name[6] = 0x55;
nv->node_name[7] = 0x86;
nv->login_retry_count = __constant_cpu_to_le16(8);
nv->interrupt_delay_timer = __constant_cpu_to_le16(0);
nv->login_timeout = __constant_cpu_to_le16(0);
nv->login_retry_count = cpu_to_le16(8);
nv->interrupt_delay_timer = cpu_to_le16(0);
nv->login_timeout = cpu_to_le16(0);
nv->firmware_options_1 =
__constant_cpu_to_le32(BIT_14|BIT_13|BIT_2|BIT_1);
nv->firmware_options_2 = __constant_cpu_to_le32(2 << 4);
nv->firmware_options_2 |= __constant_cpu_to_le32(BIT_12);
nv->firmware_options_3 = __constant_cpu_to_le32(2 << 13);
nv->host_p = __constant_cpu_to_le32(BIT_11|BIT_10);
nv->efi_parameters = __constant_cpu_to_le32(0);
cpu_to_le32(BIT_14|BIT_13|BIT_2|BIT_1);
nv->firmware_options_2 = cpu_to_le32(2 << 4);
nv->firmware_options_2 |= cpu_to_le32(BIT_12);
nv->firmware_options_3 = cpu_to_le32(2 << 13);
nv->host_p = cpu_to_le32(BIT_11|BIT_10);
nv->efi_parameters = cpu_to_le32(0);
nv->reset_delay = 5;
nv->max_luns_per_target = __constant_cpu_to_le16(128);
nv->port_down_retry_count = __constant_cpu_to_le16(30);
nv->link_down_timeout = __constant_cpu_to_le16(180);
nv->max_luns_per_target = cpu_to_le16(128);
nv->port_down_retry_count = cpu_to_le16(30);
nv->link_down_timeout = cpu_to_le16(180);
nv->enode_mac[0] = 0x00;
nv->enode_mac[1] = 0xC0;
nv->enode_mac[2] = 0xDD;
@@ -5472,30 +5467,30 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
ha->saved_set = 1;
}
nv->exchange_count = __constant_cpu_to_le16(0xFFFF);
nv->exchange_count = cpu_to_le16(0xFFFF);
/* Enable target mode */
nv->firmware_options_1 |= __constant_cpu_to_le32(BIT_4);
nv->firmware_options_1 |= cpu_to_le32(BIT_4);
/* Disable ini mode, if requested */
if (!qla_ini_mode_enabled(vha))
nv->firmware_options_1 |= __constant_cpu_to_le32(BIT_5);
nv->firmware_options_1 |= cpu_to_le32(BIT_5);
if (ha->enable_explicit_conf) {
ql_log(ql_log_info, vha, 0x1073, "Enabling FC tape support\n");
/* Disable Full Login after LIP */
nv->firmware_options_1 &= __constant_cpu_to_le32(~BIT_13);
nv->firmware_options_1 &= cpu_to_le32(~BIT_13);
/* Enable FC tapes support */
nv->firmware_options_2 |= __constant_cpu_to_le32(BIT_12);
nv->firmware_options_2 |= cpu_to_le32(BIT_12);
} else {
ql_log(ql_log_info, vha, 0x1073, "Disabling FC tape support\n");
/* Enable Full Login after LIP */
nv->firmware_options_1 |= __constant_cpu_to_le32(BIT_13);
nv->firmware_options_1 |= cpu_to_le32(BIT_13);
/* Disable FC tapes support */
nv->firmware_options_2 &= __constant_cpu_to_le32(~BIT_12);
nv->firmware_options_2 &= cpu_to_le32(~BIT_12);
}
/* Enable initial LIP */
nv->firmware_options_1 &= __constant_cpu_to_le32(~BIT_9);
nv->firmware_options_1 &= cpu_to_le32(~BIT_9);
} else {
if (ha->saved_set) {
nv->exchange_count = ha->saved_exchange_count;
@@ -5505,7 +5500,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
}
}
/* out-of-order frames reassembly */
nv->firmware_options_3 |= __constant_cpu_to_le32(BIT_6|BIT_9);
nv->firmware_options_3 |= cpu_to_le32(BIT_6|BIT_9);
#endif /* CONFIG_SCSI_QLA2XXX_TARGET */
@@ -5514,11 +5509,11 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
fc_host_supported_classes(vha->host) =
FC_COS_CLASS2 | FC_COS_CLASS3;
}
nv->firmware_options_2 |= __constant_cpu_to_le32(BIT_8);
nv->firmware_options_2 |= cpu_to_le32(BIT_8);
} else {
if (vha->flags.init_done)
fc_host_supported_classes(vha->host) = FC_COS_CLASS3;
nv->firmware_options_2 &= ~__constant_cpu_to_le32(BIT_8);
nv->firmware_options_2 &= ~cpu_to_le32(BIT_8);
}
/* Reset Initialization control block */
@@ -5567,17 +5562,17 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
memcpy(icb->node_name, vha->node_name, WWN_SIZE);
if (vha->port_name_set)
memcpy(icb->port_name, vha->port_name, WWN_SIZE);
icb->firmware_options_1 |= __constant_cpu_to_le32(BIT_14);
icb->firmware_options_1 |= cpu_to_le32(BIT_14);
} else
#endif
if (nv->host_p & __constant_cpu_to_le32(BIT_15)) {
if (nv->host_p & cpu_to_le32(BIT_15)) {
/* Use alternate WWN? */
memcpy(icb->node_name, nv->alternate_node_name, WWN_SIZE);
memcpy(icb->port_name, nv->alternate_port_name, WWN_SIZE);
}
/* Prepare nodename */
if ((icb->firmware_options_1 & __constant_cpu_to_le32(BIT_14)) == 0) {
if ((icb->firmware_options_1 & cpu_to_le32(BIT_14)) == 0) {
/*
* Firmware will apply the following mask if the nodename was
* not provided.
@@ -5606,7 +5601,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
memcpy(vha->node_name, icb->node_name, WWN_SIZE);
memcpy(vha->port_name, icb->port_name, WWN_SIZE);
icb->execution_throttle = __constant_cpu_to_le16(0xFFFF);
icb->execution_throttle = cpu_to_le16(0xFFFF);
ha->retry_count = le16_to_cpu(nv->login_retry_count);
@@ -5614,7 +5609,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
if (le16_to_cpu(nv->login_timeout) < ql2xlogintimeout)
nv->login_timeout = cpu_to_le16(ql2xlogintimeout);
if (le16_to_cpu(nv->login_timeout) < 4)
nv->login_timeout = __constant_cpu_to_le16(4);
nv->login_timeout = cpu_to_le16(4);
ha->login_timeout = le16_to_cpu(nv->login_timeout);
icb->login_timeout = nv->login_timeout;
@@ -5660,7 +5655,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
/* if not running MSI-X we need handshaking on interrupts */
if (!vha->hw->flags.msix_enabled && IS_QLA83XX(ha))
icb->firmware_options_2 |= __constant_cpu_to_le32(BIT_22);
icb->firmware_options_2 |= cpu_to_le32(BIT_22);
/* Enable ZIO. */
if (!vha->flags.init_done) {
@@ -5673,7 +5668,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
le16_to_cpu(icb->interrupt_delay_timer): 2;
#endif /* CONFIG_SCSI_QLA2XXX_TARGET */
}
icb->firmware_options_2 &= __constant_cpu_to_le32(
icb->firmware_options_2 &= cpu_to_le32(
~(BIT_3 | BIT_2 | BIT_1 | BIT_0));
vha->flags.process_response_queue = 0;
if (ha->zio_mode != QLA_ZIO_DISABLED) {
+37 -45
View File
@@ -106,8 +106,7 @@ qla2x00_prep_cont_type0_iocb(struct scsi_qla_host *vha)
cont_pkt = (cont_entry_t *)req->ring_ptr;
/* Load packet defaults. */
*((uint32_t *)(&cont_pkt->entry_type)) =
__constant_cpu_to_le32(CONTINUE_TYPE);
*((uint32_t *)(&cont_pkt->entry_type)) = cpu_to_le32(CONTINUE_TYPE);
return (cont_pkt);
}
@@ -135,8 +134,7 @@ qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *vha, struct req_que *req)
cont_pkt = (cont_a64_entry_t *)req->ring_ptr;
/* Load packet defaults. */
*((uint32_t *)(&cont_pkt->entry_type)) =
__constant_cpu_to_le32(CONTINUE_A64_TYPE);
*((uint32_t *)(&cont_pkt->entry_type)) = cpu_to_le32(CONTINUE_A64_TYPE);
return (cont_pkt);
}
@@ -206,12 +204,11 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,
cmd = GET_CMD_SP(sp);
/* Update entry type to indicate Command Type 2 IOCB */
*((uint32_t *)(&cmd_pkt->entry_type)) =
__constant_cpu_to_le32(COMMAND_TYPE);
*((uint32_t *)(&cmd_pkt->entry_type)) = cpu_to_le32(COMMAND_TYPE);
/* No data transfer */
if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) {
cmd_pkt->byte_count = __constant_cpu_to_le32(0);
cmd_pkt->byte_count = cpu_to_le32(0);
return;
}
@@ -265,11 +262,11 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
/* Update entry type to indicate Command Type 3 IOCB */
*((uint32_t *)(&cmd_pkt->entry_type)) =
__constant_cpu_to_le32(COMMAND_A64_TYPE);
cpu_to_le32(COMMAND_A64_TYPE);
/* No data transfer */
if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) {
cmd_pkt->byte_count = __constant_cpu_to_le32(0);
cmd_pkt->byte_count = cpu_to_le32(0);
return;
}
@@ -414,16 +411,13 @@ qla2x00_start_scsi(srb_t *sp)
if (scsi_populate_tag_msg(cmd, tag)) {
switch (tag[0]) {
case HEAD_OF_QUEUE_TAG:
cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_HEAD_TAG);
cmd_pkt->control_flags = cpu_to_le16(CF_HEAD_TAG);
break;
case ORDERED_QUEUE_TAG:
cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_ORDERED_TAG);
cmd_pkt->control_flags = cpu_to_le16(CF_ORDERED_TAG);
break;
default:
cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_SIMPLE_TAG);
cmd_pkt->control_flags = cpu_to_le16(CF_SIMPLE_TAG);
break;
}
}
@@ -699,11 +693,11 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt,
/* Update entry type to indicate Command Type 3 IOCB */
*((uint32_t *)(&cmd_pkt->entry_type)) =
__constant_cpu_to_le32(COMMAND_TYPE_6);
cpu_to_le32(COMMAND_TYPE_6);
/* No data transfer */
if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) {
cmd_pkt->byte_count = __constant_cpu_to_le32(0);
cmd_pkt->byte_count = cpu_to_le32(0);
return 0;
}
@@ -713,11 +707,11 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt,
/* Set transfer direction */
if (cmd->sc_data_direction == DMA_TO_DEVICE) {
cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_WRITE_DATA);
cpu_to_le16(CF_WRITE_DATA);
vha->qla_stats.output_bytes += scsi_bufflen(cmd);
} else if (cmd->sc_data_direction == DMA_FROM_DEVICE) {
cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_READ_DATA);
cpu_to_le16(CF_READ_DATA);
vha->qla_stats.input_bytes += scsi_bufflen(cmd);
}
@@ -814,11 +808,11 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
/* Update entry type to indicate Command Type 3 IOCB */
*((uint32_t *)(&cmd_pkt->entry_type)) =
__constant_cpu_to_le32(COMMAND_TYPE_7);
cpu_to_le32(COMMAND_TYPE_7);
/* No data transfer */
if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) {
cmd_pkt->byte_count = __constant_cpu_to_le32(0);
cmd_pkt->byte_count = cpu_to_le32(0);
return;
}
@@ -828,11 +822,11 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
/* Set transfer direction */
if (cmd->sc_data_direction == DMA_TO_DEVICE) {
cmd_pkt->task_mgmt_flags =
__constant_cpu_to_le16(TMF_WRITE_DATA);
cpu_to_le16(TMF_WRITE_DATA);
vha->qla_stats.output_bytes += scsi_bufflen(cmd);
} else if (cmd->sc_data_direction == DMA_FROM_DEVICE) {
cmd_pkt->task_mgmt_flags =
__constant_cpu_to_le16(TMF_READ_DATA);
cpu_to_le16(TMF_READ_DATA);
vha->qla_stats.input_bytes += scsi_bufflen(cmd);
}
@@ -906,7 +900,7 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,
* match LBA in CDB + N
*/
case SCSI_PROT_DIF_TYPE2:
pkt->app_tag = __constant_cpu_to_le16(0);
pkt->app_tag = cpu_to_le16(0);
pkt->app_tag_mask[0] = 0x0;
pkt->app_tag_mask[1] = 0x0;
@@ -937,7 +931,7 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,
case SCSI_PROT_DIF_TYPE1:
pkt->ref_tag = cpu_to_le32((uint32_t)
(0xffffffff & scsi_get_lba(cmd)));
pkt->app_tag = __constant_cpu_to_le16(0);
pkt->app_tag = cpu_to_le16(0);
pkt->app_tag_mask[0] = 0x0;
pkt->app_tag_mask[1] = 0x0;
@@ -1316,7 +1310,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
sgc = 0;
/* Update entry type to indicate Command Type CRC_2 IOCB */
*((uint32_t *)(&cmd_pkt->entry_type)) =
__constant_cpu_to_le32(COMMAND_TYPE_CRC_2);
cpu_to_le32(COMMAND_TYPE_CRC_2);
vha = sp->fcport->vha;
ha = vha->hw;
@@ -1324,7 +1318,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
/* No data transfer */
data_bytes = scsi_bufflen(cmd);
if (!data_bytes || cmd->sc_data_direction == DMA_NONE) {
cmd_pkt->byte_count = __constant_cpu_to_le32(0);
cmd_pkt->byte_count = cpu_to_le32(0);
return QLA_SUCCESS;
}
@@ -1332,11 +1326,9 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
/* Set transfer direction */
if (cmd->sc_data_direction == DMA_TO_DEVICE) {
cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_WRITE_DATA);
cmd_pkt->control_flags = cpu_to_le16(CF_WRITE_DATA);
} else if (cmd->sc_data_direction == DMA_FROM_DEVICE) {
cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_READ_DATA);
cmd_pkt->control_flags = cpu_to_le16(CF_READ_DATA);
}
if ((scsi_get_prot_op(cmd) == SCSI_PROT_READ_INSERT) ||
@@ -1469,7 +1461,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
crc_ctx_pkt->blk_size = cpu_to_le16(blk_size);
crc_ctx_pkt->prot_opts = cpu_to_le16(fw_prot_opts);
crc_ctx_pkt->byte_count = cpu_to_le32(data_bytes);
crc_ctx_pkt->guard_seed = __constant_cpu_to_le16(0);
crc_ctx_pkt->guard_seed = cpu_to_le16(0);
/* Fibre channel byte count */
cmd_pkt->byte_count = cpu_to_le32(total_bytes);
fcp_dl = (uint32_t *)(crc_ctx_pkt->fcp_cmnd.cdb + 16 +
@@ -1477,13 +1469,13 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
*fcp_dl = htonl(total_bytes);
if (!data_bytes || cmd->sc_data_direction == DMA_NONE) {
cmd_pkt->byte_count = __constant_cpu_to_le32(0);
cmd_pkt->byte_count = cpu_to_le32(0);
return QLA_SUCCESS;
}
/* Walks data segments */
cmd_pkt->control_flags |=
__constant_cpu_to_le16(CF_DATA_SEG_DESCR_ENABLE);
cpu_to_le16(CF_DATA_SEG_DESCR_ENABLE);
if (!bundling && tot_prot_dsds) {
if (qla24xx_walk_and_build_sglist_no_difb(ha, sp,
@@ -1496,7 +1488,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
if (bundling && tot_prot_dsds) {
/* Walks dif segments */
cmd_pkt->control_flags |=
__constant_cpu_to_le16(CF_DIF_SEG_DESCR_ENABLE);
cpu_to_le16(CF_DIF_SEG_DESCR_ENABLE);
cur_dsd = (uint32_t *) &crc_ctx_pkt->u.bundling.dif_address;
if (qla24xx_walk_and_build_prot_sglist(ha, sp, cur_dsd,
tot_prot_dsds))
@@ -1849,7 +1841,7 @@ qla24xx_dif_start_scsi(srb_t *sp)
cmd_pkt->entry_count = (uint8_t)req_cnt;
/* Specify response queue number where completion should happen */
cmd_pkt->entry_status = (uint8_t) rsp->id;
cmd_pkt->timeout = __constant_cpu_to_le16(0);
cmd_pkt->timeout = cpu_to_le16(0);
wmb();
/* Adjust ring index. */
@@ -2121,10 +2113,10 @@ qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
els_iocb->entry_status = 0;
els_iocb->handle = sp->handle;
els_iocb->nport_handle = cpu_to_le16(sp->fcport->loop_id);
els_iocb->tx_dsd_count = __constant_cpu_to_le16(bsg_job->request_payload.sg_cnt);
els_iocb->tx_dsd_count = cpu_to_le16(bsg_job->request_payload.sg_cnt);
els_iocb->vp_index = sp->fcport->vha->vp_idx;
els_iocb->sof_type = EST_SOFI3;
els_iocb->rx_dsd_count = __constant_cpu_to_le16(bsg_job->reply_payload.sg_cnt);
els_iocb->rx_dsd_count = cpu_to_le16(bsg_job->reply_payload.sg_cnt);
els_iocb->opcode =
sp->type == SRB_ELS_CMD_RPT ?
@@ -2174,13 +2166,13 @@ qla2x00_ct_iocb(srb_t *sp, ms_iocb_entry_t *ct_iocb)
ct_iocb->entry_status = 0;
ct_iocb->handle1 = sp->handle;
SET_TARGET_ID(ha, ct_iocb->loop_id, sp->fcport->loop_id);
ct_iocb->status = __constant_cpu_to_le16(0);
ct_iocb->control_flags = __constant_cpu_to_le16(0);
ct_iocb->status = cpu_to_le16(0);
ct_iocb->control_flags = cpu_to_le16(0);
ct_iocb->timeout = 0;
ct_iocb->cmd_dsd_count =
__constant_cpu_to_le16(bsg_job->request_payload.sg_cnt);
cpu_to_le16(bsg_job->request_payload.sg_cnt);
ct_iocb->total_dsd_count =
__constant_cpu_to_le16(bsg_job->request_payload.sg_cnt + 1);
cpu_to_le16(bsg_job->request_payload.sg_cnt + 1);
ct_iocb->req_bytecount =
cpu_to_le32(bsg_job->request_payload.payload_len);
ct_iocb->rsp_bytecount =
@@ -2253,13 +2245,13 @@ qla24xx_ct_iocb(srb_t *sp, struct ct_entry_24xx *ct_iocb)
ct_iocb->nport_handle = cpu_to_le16(sp->fcport->loop_id);
ct_iocb->vp_index = sp->fcport->vha->vp_idx;
ct_iocb->comp_status = __constant_cpu_to_le16(0);
ct_iocb->comp_status = cpu_to_le16(0);
ct_iocb->cmd_dsd_count =
__constant_cpu_to_le16(bsg_job->request_payload.sg_cnt);
cpu_to_le16(bsg_job->request_payload.sg_cnt);
ct_iocb->timeout = 0;
ct_iocb->rsp_dsd_count =
__constant_cpu_to_le16(bsg_job->reply_payload.sg_cnt);
cpu_to_le16(bsg_job->reply_payload.sg_cnt);
ct_iocb->rsp_byte_count =
cpu_to_le32(bsg_job->reply_payload.payload_len);
ct_iocb->cmd_byte_count =
+1 -1
View File
@@ -1332,7 +1332,7 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
ql_log(ql_log_warn, fcport->vha, 0x5038,
"Async-%s error - hdl=%x entry-status(%x).\n",
type, sp->handle, sts->entry_status);
} else if (sts->comp_status != __constant_cpu_to_le16(CS_COMPLETE)) {
} else if (sts->comp_status != cpu_to_le16(CS_COMPLETE)) {
ql_log(ql_log_warn, fcport->vha, 0x5039,
"Async-%s error - hdl=%x completion status(%x).\n",
type, sp->handle, sts->comp_status);
+12 -12
View File
@@ -1887,11 +1887,11 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
lg->entry_count = 1;
lg->handle = MAKE_HANDLE(req->id, lg->handle);
lg->nport_handle = cpu_to_le16(loop_id);
lg->control_flags = __constant_cpu_to_le16(LCF_COMMAND_PLOGI);
lg->control_flags = cpu_to_le16(LCF_COMMAND_PLOGI);
if (opt & BIT_0)
lg->control_flags |= __constant_cpu_to_le16(LCF_COND_PLOGI);
lg->control_flags |= cpu_to_le16(LCF_COND_PLOGI);
if (opt & BIT_1)
lg->control_flags |= __constant_cpu_to_le16(LCF_SKIP_PRLI);
lg->control_flags |= cpu_to_le16(LCF_SKIP_PRLI);
lg->port_id[0] = al_pa;
lg->port_id[1] = area;
lg->port_id[2] = domain;
@@ -1906,7 +1906,7 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
"Failed to complete IOCB -- error status (%x).\n",
lg->entry_status);
rval = QLA_FUNCTION_FAILED;
} else if (lg->comp_status != __constant_cpu_to_le16(CS_COMPLETE)) {
} else if (lg->comp_status != cpu_to_le16(CS_COMPLETE)) {
iop[0] = le32_to_cpu(lg->io_parameter[0]);
iop[1] = le32_to_cpu(lg->io_parameter[1]);
@@ -1960,7 +1960,7 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
mb[10] |= BIT_0; /* Class 2. */
if (lg->io_parameter[9] || lg->io_parameter[10])
mb[10] |= BIT_1; /* Class 3. */
if (lg->io_parameter[0] & __constant_cpu_to_le32(BIT_7))
if (lg->io_parameter[0] & cpu_to_le32(BIT_7))
mb[10] |= BIT_7; /* Confirmed Completion Allowed */
}
@@ -2162,7 +2162,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
lg->handle = MAKE_HANDLE(req->id, lg->handle);
lg->nport_handle = cpu_to_le16(loop_id);
lg->control_flags =
__constant_cpu_to_le16(LCF_COMMAND_LOGO|LCF_IMPL_LOGO|
cpu_to_le16(LCF_COMMAND_LOGO|LCF_IMPL_LOGO|
LCF_FREE_NPORT);
lg->port_id[0] = al_pa;
lg->port_id[1] = area;
@@ -2178,7 +2178,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
"Failed to complete IOCB -- error status (%x).\n",
lg->entry_status);
rval = QLA_FUNCTION_FAILED;
} else if (lg->comp_status != __constant_cpu_to_le16(CS_COMPLETE)) {
} else if (lg->comp_status != cpu_to_le16(CS_COMPLETE)) {
ql_dbg(ql_dbg_mbx, vha, 0x1071,
"Failed to complete IOCB -- completion status (%x) "
"ioparam=%x/%x.\n", le16_to_cpu(lg->comp_status),
@@ -2679,7 +2679,7 @@ qla24xx_abort_command(srb_t *sp)
"Failed to complete IOCB -- error status (%x).\n",
abt->entry_status);
rval = QLA_FUNCTION_FAILED;
} else if (abt->nport_handle != __constant_cpu_to_le16(0)) {
} else if (abt->nport_handle != cpu_to_le16(0)) {
ql_dbg(ql_dbg_mbx, vha, 0x1090,
"Failed to complete IOCB -- completion status (%x).\n",
le16_to_cpu(abt->nport_handle));
@@ -2760,7 +2760,7 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport,
sts->entry_status);
rval = QLA_FUNCTION_FAILED;
} else if (sts->comp_status !=
__constant_cpu_to_le16(CS_COMPLETE)) {
cpu_to_le16(CS_COMPLETE)) {
ql_dbg(ql_dbg_mbx, vha, 0x1096,
"Failed to complete IOCB -- completion status (%x).\n",
le16_to_cpu(sts->comp_status));
@@ -3335,7 +3335,7 @@ qla24xx_modify_vp_config(scsi_qla_host_t *vha)
"Failed to complete IOCB -- error status (%x).\n",
vpmod->comp_status);
rval = QLA_FUNCTION_FAILED;
} else if (vpmod->comp_status != __constant_cpu_to_le16(CS_COMPLETE)) {
} else if (vpmod->comp_status != cpu_to_le16(CS_COMPLETE)) {
ql_dbg(ql_dbg_mbx, vha, 0x10bf,
"Failed to complete IOCB -- completion status (%x).\n",
le16_to_cpu(vpmod->comp_status));
@@ -3400,7 +3400,7 @@ qla24xx_control_vp(scsi_qla_host_t *vha, int cmd)
vce->entry_type = VP_CTRL_IOCB_TYPE;
vce->entry_count = 1;
vce->command = cpu_to_le16(cmd);
vce->vp_count = __constant_cpu_to_le16(1);
vce->vp_count = cpu_to_le16(1);
/* index map in firmware starts with 1; decrement index
* this is ok as we never use index 0
@@ -3420,7 +3420,7 @@ qla24xx_control_vp(scsi_qla_host_t *vha, int cmd)
"Failed to complete IOCB -- error status (%x).\n",
vce->entry_status);
rval = QLA_FUNCTION_FAILED;
} else if (vce->comp_status != __constant_cpu_to_le16(CS_COMPLETE)) {
} else if (vce->comp_status != cpu_to_le16(CS_COMPLETE)) {
/*
* It can fail, because this function can be called 2 times on
* VPs delete: one from q2t_target_stop() and another - from
+3 -3
View File
@@ -1768,8 +1768,8 @@ qla82xx_config_rings(struct scsi_qla_host *vha)
/* Setup ring parameters in initialization control block. */
icb = (struct init_cb_81xx *)ha->init_cb;
icb->request_q_outpointer = __constant_cpu_to_le16(0);
icb->response_q_inpointer = __constant_cpu_to_le16(0);
icb->request_q_outpointer = cpu_to_le16(0);
icb->response_q_inpointer = cpu_to_le16(0);
icb->request_q_length = cpu_to_le16(req->length);
icb->response_q_length = cpu_to_le16(rsp->length);
icb->request_q_address[0] = cpu_to_le32(LSD(req->dma));
@@ -2527,7 +2527,7 @@ qla82xx_read_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
"Do ROM fast read failed.\n");
goto done_read;
}
dwptr[i] = __constant_cpu_to_le32(val);
dwptr[i] = cpu_to_le32(val);
}
done_read:
return dwptr;
+7 -7
View File
@@ -315,7 +315,7 @@ qla2x00_clear_nvram_protection(struct qla_hw_data *ha)
wprot_old = cpu_to_le16(qla2x00_get_nvram_word(ha, ha->nvram_base));
stat = qla2x00_write_nvram_word_tmo(ha, ha->nvram_base,
__constant_cpu_to_le16(0x1234), 100000);
cpu_to_le16(0x1234), 100000);
wprot = cpu_to_le16(qla2x00_get_nvram_word(ha, ha->nvram_base));
if (stat != QLA_SUCCESS || wprot != 0x1234) {
/* Write enable. */
@@ -690,9 +690,9 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
region = (struct qla_flt_region *)&flt[1];
ha->isp_ops->read_optrom(vha, (uint8_t *)req->ring,
flt_addr << 2, OPTROM_BURST_SIZE);
if (*wptr == __constant_cpu_to_le16(0xffff))
if (*wptr == cpu_to_le16(0xffff))
goto no_flash_data;
if (flt->version != __constant_cpu_to_le16(1)) {
if (flt->version != cpu_to_le16(1)) {
ql_log(ql_log_warn, vha, 0x0047,
"Unsupported FLT detected: version=0x%x length=0x%x checksum=0x%x.\n",
le16_to_cpu(flt->version), le16_to_cpu(flt->length),
@@ -871,7 +871,7 @@ qla2xxx_get_fdt_info(scsi_qla_host_t *vha)
fdt = (struct qla_fdt_layout *)req->ring;
ha->isp_ops->read_optrom(vha, (uint8_t *)req->ring,
ha->flt_region_fdt << 2, OPTROM_BURST_SIZE);
if (*wptr == __constant_cpu_to_le16(0xffff))
if (*wptr == cpu_to_le16(0xffff))
goto no_flash_data;
if (fdt->sig[0] != 'Q' || fdt->sig[1] != 'L' || fdt->sig[2] != 'I' ||
fdt->sig[3] != 'D')
@@ -964,7 +964,7 @@ qla2xxx_get_idc_param(scsi_qla_host_t *vha)
ha->isp_ops->read_optrom(vha, (uint8_t *)req->ring,
QLA82XX_IDC_PARAM_ADDR , 8);
if (*wptr == __constant_cpu_to_le32(0xffffffff)) {
if (*wptr == cpu_to_le32(0xffffffff)) {
ha->nx_dev_init_timeout = QLA82XX_ROM_DEV_INIT_TIMEOUT;
ha->nx_reset_timeout = QLA82XX_ROM_DRV_RESET_ACK_TIMEOUT;
} else {
@@ -1021,9 +1021,9 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha)
ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr,
ha->flt_region_npiv_conf << 2, sizeof(struct qla_npiv_header));
if (hdr.version == __constant_cpu_to_le16(0xffff))
if (hdr.version == cpu_to_le16(0xffff))
return;
if (hdr.version != __constant_cpu_to_le16(1)) {
if (hdr.version != cpu_to_le16(1)) {
ql_dbg(ql_dbg_user, vha, 0x7090,
"Unsupported NPIV-Config "
"detected: version=0x%x entries=0x%x checksum=0x%x.\n",