mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 11:11:27 +00:00
Checkpatch warnings fixed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@582 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -63,9 +63,9 @@ static void q2t_async_event(uint16_t code, scsi_qla_host_t *ha,
|
||||
uint16_t *mailbox);
|
||||
static void q2t_ctio_completion(scsi_qla_host_t *ha, uint32_t handle);
|
||||
static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
qla2x_tgt_host_action_t action);
|
||||
enum qla2x_tgt_host_action action);
|
||||
static void q2t_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd,
|
||||
atio_entry_t *atio, int ha_locked);
|
||||
struct atio_entry *atio, int ha_locked);
|
||||
|
||||
/*
|
||||
* Global Variables
|
||||
@@ -77,25 +77,25 @@ unsigned long q2t_trace_flag = Q2T_DEFAULT_LOG_FLAGS;
|
||||
#endif
|
||||
|
||||
struct scst_tgt_template tgt_template = {
|
||||
name: "qla2x00tgt",
|
||||
sg_tablesize: 0,
|
||||
use_clustering: 1,
|
||||
.name = "qla2x00tgt",
|
||||
.sg_tablesize = 0,
|
||||
.use_clustering = 1,
|
||||
#ifdef CONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD
|
||||
xmit_response_atomic: 0,
|
||||
rdy_to_xfer_atomic: 0,
|
||||
.xmit_response_atomic = 0,
|
||||
.rdy_to_xfer_atomic = 0,
|
||||
#else
|
||||
xmit_response_atomic: 1,
|
||||
rdy_to_xfer_atomic: 1,
|
||||
.xmit_response_atomic = 1,
|
||||
.rdy_to_xfer_atomic = 1,
|
||||
#endif
|
||||
detect: q2t_target_detect,
|
||||
release: q2t_target_release,
|
||||
xmit_response: q2t_xmit_response,
|
||||
rdy_to_xfer: q2t_rdy_to_xfer,
|
||||
on_free_cmd: q2t_on_free_cmd,
|
||||
task_mgmt_fn_done: q2t_task_mgmt_fn_done,
|
||||
.detect = q2t_target_detect,
|
||||
.release = q2t_target_release,
|
||||
.xmit_response = q2t_xmit_response,
|
||||
.rdy_to_xfer = q2t_rdy_to_xfer,
|
||||
.on_free_cmd = q2t_on_free_cmd,
|
||||
.task_mgmt_fn_done = q2t_task_mgmt_fn_done,
|
||||
};
|
||||
|
||||
struct kmem_cache *q2t_cmd_cachep = NULL;
|
||||
struct kmem_cache *q2t_cmd_cachep;
|
||||
static struct qla2x_tgt_target tgt_data;
|
||||
|
||||
/*
|
||||
@@ -130,23 +130,25 @@ static inline void q2t_exec_queue(scsi_qla_host_t *ha)
|
||||
static void q2t_modify_command_count(scsi_qla_host_t *ha, int cmd_count,
|
||||
int imm_count)
|
||||
{
|
||||
modify_lun_entry_t *pkt;
|
||||
struct modify_lun_entry *pkt;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
TRACE_DBG("Sending MODIFY_LUN ha %p, cmd %d, imm %d",
|
||||
ha, cmd_count, imm_count);
|
||||
|
||||
pkt = (modify_lun_entry_t *)tgt_data.req_pkt(ha);
|
||||
pkt = (struct modify_lun_entry *)tgt_data.req_pkt(ha);
|
||||
ha->tgt->modify_lun_expected++;
|
||||
|
||||
pkt->entry_type = MODIFY_LUN_TYPE;
|
||||
pkt->entry_count = 1;
|
||||
if (cmd_count < 0) {
|
||||
pkt->operators = MODIFY_LUN_CMD_SUB; /* Subtract from command count */
|
||||
/* Subtract from command count */
|
||||
pkt->operators = MODIFY_LUN_CMD_SUB;
|
||||
pkt->command_count = -cmd_count;
|
||||
} else if (cmd_count > 0){
|
||||
pkt->operators = MODIFY_LUN_CMD_ADD; /* Add to command count */
|
||||
} else if (cmd_count > 0) {
|
||||
/* Add to command count */
|
||||
pkt->operators = MODIFY_LUN_CMD_ADD;
|
||||
pkt->command_count = cmd_count;
|
||||
}
|
||||
|
||||
@@ -171,7 +173,7 @@ static void __q2t_send_notify_ack(scsi_qla_host_t *ha,
|
||||
uint16_t seq_id, uint32_t add_flags, uint16_t resp_code,
|
||||
int resp_code_valid, uint16_t ox_id)
|
||||
{
|
||||
nack_entry_t *ntfy;
|
||||
struct nack_entry *ntfy;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -182,7 +184,7 @@ static void __q2t_send_notify_ack(scsi_qla_host_t *ha,
|
||||
goto out;
|
||||
}
|
||||
|
||||
ntfy = (nack_entry_t *)tgt_data.req_pkt(ha);
|
||||
ntfy = (struct nack_entry *)tgt_data.req_pkt(ha);
|
||||
|
||||
if (ha->tgt != NULL)
|
||||
ha->tgt->notify_ack_expected++;
|
||||
@@ -217,7 +219,7 @@ out:
|
||||
}
|
||||
/* ha->hardware_lock supposed to be held on entry */
|
||||
static inline void q2t_send_notify_ack(scsi_qla_host_t *ha,
|
||||
notify_entry_t *iocb, uint32_t add_flags, uint16_t resp_code,
|
||||
struct notify_entry *iocb, uint32_t add_flags, uint16_t resp_code,
|
||||
int resp_code_valid)
|
||||
{
|
||||
__q2t_send_notify_ack(ha, GET_TARGET_ID(ha, iocb), iocb->status,
|
||||
@@ -233,11 +235,11 @@ static int q2t_target_detect(struct scst_tgt_template *templ)
|
||||
{
|
||||
int res;
|
||||
struct qla2x_tgt_initiator itd = {
|
||||
magic:QLA2X_TARGET_MAGIC,
|
||||
tgt_response_pkt:q2t_response_pkt,
|
||||
tgt_ctio_completion:q2t_ctio_completion,
|
||||
tgt_async_event:q2t_async_event,
|
||||
tgt_host_action:q2t_host_action,
|
||||
.magic = QLA2X_TARGET_MAGIC,
|
||||
.tgt_response_pkt = q2t_response_pkt,
|
||||
.tgt_ctio_completion = q2t_ctio_completion,
|
||||
.tgt_async_event = q2t_async_event,
|
||||
.tgt_host_action = q2t_host_action,
|
||||
};
|
||||
|
||||
TRACE_ENTRY();
|
||||
@@ -248,11 +250,11 @@ static int q2t_target_detect(struct scst_tgt_template *templ)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (tgt_data.magic != QLA2X_INITIATOR_MAGIC) {
|
||||
PRINT_ERROR("Wrong version of the initiator driver: %d",
|
||||
tgt_data.magic);
|
||||
res = -EINVAL;
|
||||
}
|
||||
if (tgt_data.magic != QLA2X_INITIATOR_MAGIC) {
|
||||
PRINT_ERROR("Wrong version of the initiator driver: %d",
|
||||
tgt_data.magic);
|
||||
res = -EINVAL;
|
||||
}
|
||||
|
||||
out:
|
||||
TRACE_EXIT();
|
||||
@@ -376,7 +378,7 @@ static int q2t_target_release(struct scst_tgt *scst_tgt)
|
||||
wait_event(tgt->waitQ, test_tgt_sess_count(tgt, ha));
|
||||
|
||||
/* big hammer */
|
||||
if(!ha->flags.host_shutting_down)
|
||||
if (!ha->flags.host_shutting_down)
|
||||
tgt_data.disable_lun(ha);
|
||||
|
||||
/* wait for sessions to clear out (just in case) */
|
||||
@@ -418,8 +420,7 @@ static int q2t_pci_map_calc_cnt(struct q2t_prm *prm)
|
||||
prm->tgt->datasegs_per_cmd) /
|
||||
prm->tgt->datasegs_per_cont;
|
||||
if (((uint16_t)(prm->seg_cnt - prm->tgt->datasegs_per_cmd)) %
|
||||
prm->tgt->datasegs_per_cont)
|
||||
{
|
||||
prm->tgt->datasegs_per_cont) {
|
||||
prm->req_cnt++;
|
||||
}
|
||||
}
|
||||
@@ -445,9 +446,9 @@ static inline uint32_t q2t_make_handle(scsi_qla_host_t *ha)
|
||||
/* always increment cmd handle */
|
||||
do {
|
||||
++h;
|
||||
if (h > MAX_OUTSTANDING_COMMANDS) {
|
||||
if (h > MAX_OUTSTANDING_COMMANDS)
|
||||
h = 0;
|
||||
}
|
||||
|
||||
if (h == ha->current_cmd) {
|
||||
TRACE(TRACE_OUT_OF_MEM, "Ran out of empty cmd slots "
|
||||
"in ha %p", ha);
|
||||
@@ -477,7 +478,7 @@ static void q2t_build_ctio_pkt(struct q2t_prm *prm)
|
||||
uint16_t timeout;
|
||||
uint32_t h;
|
||||
|
||||
prm->pkt = (ctio_common_entry_t *)tgt_data.req_pkt(prm->tgt->ha);
|
||||
prm->pkt = (struct ctio_common_entry *)tgt_data.req_pkt(prm->tgt->ha);
|
||||
|
||||
if (prm->tgt->tgt_enable_64bit_addr)
|
||||
prm->pkt->entry_type = CTIO_A64_TYPE;
|
||||
@@ -487,9 +488,8 @@ static void q2t_build_ctio_pkt(struct q2t_prm *prm)
|
||||
prm->pkt->entry_count = (uint8_t) prm->req_cnt;
|
||||
|
||||
h = q2t_make_handle(prm->tgt->ha);
|
||||
if (h != Q2T_NULL_HANDLE) {
|
||||
if (h != Q2T_NULL_HANDLE)
|
||||
prm->tgt->ha->cmds[h] = prm->cmd;
|
||||
}
|
||||
prm->pkt->handle = h | CTIO_COMPLETION_HANDLE_MARK;
|
||||
|
||||
timeout = Q2T_TIMEOUT;
|
||||
@@ -541,8 +541,7 @@ static void q2t_load_data_segments(struct q2t_prm *prm)
|
||||
/* Load command entry data segments */
|
||||
for (cnt = 0;
|
||||
(cnt < prm->tgt->datasegs_per_cmd) && prm->seg_cnt;
|
||||
cnt++, prm->seg_cnt--)
|
||||
{
|
||||
cnt++, prm->seg_cnt--) {
|
||||
*dword_ptr++ =
|
||||
cpu_to_le32(pci_dma_lo32(sg_dma_address(prm->sg)));
|
||||
if (enable_64bit_addressing) {
|
||||
@@ -553,9 +552,11 @@ static void q2t_load_data_segments(struct q2t_prm *prm)
|
||||
*dword_ptr++ = cpu_to_le32(sg_dma_len(prm->sg));
|
||||
|
||||
TRACE_SG("S/G Segment phys_addr=%llx:%llx, len=%d",
|
||||
(long long unsigned int)pci_dma_hi32(sg_dma_address(prm->sg)),
|
||||
(long long unsigned int)pci_dma_lo32(sg_dma_address(prm->sg)),
|
||||
(int)sg_dma_len(prm->sg));
|
||||
(long long unsigned int)pci_dma_hi32(
|
||||
sg_dma_address(prm->sg)),
|
||||
(long long unsigned int)pci_dma_lo32(
|
||||
sg_dma_address(prm->sg)),
|
||||
(int)sg_dma_len(prm->sg));
|
||||
|
||||
prm->sg++;
|
||||
}
|
||||
@@ -571,7 +572,7 @@ static void q2t_load_data_segments(struct q2t_prm *prm)
|
||||
/*
|
||||
* Make sure that from cont_pkt64 none of
|
||||
* 64-bit specific fields used for 32-bit
|
||||
* addressing. Cast to (cont_entry_t*) for
|
||||
* addressing. Cast to (cont_entry_t *) for
|
||||
* that.
|
||||
*/
|
||||
|
||||
@@ -583,19 +584,18 @@ static void q2t_load_data_segments(struct q2t_prm *prm)
|
||||
if (enable_64bit_addressing) {
|
||||
cont_pkt64->entry_type = CONTINUE_A64_TYPE;
|
||||
dword_ptr =
|
||||
(uint32_t*)&cont_pkt64->dseg_0_address;
|
||||
(uint32_t *)&cont_pkt64->dseg_0_address;
|
||||
} else {
|
||||
cont_pkt64->entry_type = CONTINUE_TYPE;
|
||||
dword_ptr =
|
||||
(uint32_t*)&((cont_entry_t *)
|
||||
(uint32_t *)&((cont_entry_t *)
|
||||
cont_pkt64)->dseg_0_address;
|
||||
}
|
||||
|
||||
/* Load continuation entry data segments */
|
||||
for (cnt = 0;
|
||||
cnt < prm->tgt->datasegs_per_cont && prm->seg_cnt;
|
||||
cnt++, prm->seg_cnt--)
|
||||
{
|
||||
cnt++, prm->seg_cnt--) {
|
||||
*dword_ptr++ =
|
||||
cpu_to_le32(pci_dma_lo32
|
||||
(sg_dma_address(prm->sg)));
|
||||
@@ -607,10 +607,12 @@ static void q2t_load_data_segments(struct q2t_prm *prm)
|
||||
}
|
||||
*dword_ptr++ = cpu_to_le32(sg_dma_len(prm->sg));
|
||||
|
||||
TRACE_SG("S/G Segment Cont. phys_addr=%llx:%llx, len=%d",
|
||||
(long long unsigned int)pci_dma_hi32(sg_dma_address(prm->sg)),
|
||||
(long long unsigned int)pci_dma_lo32(sg_dma_address(prm->sg)),
|
||||
(int)sg_dma_len(prm->sg));
|
||||
TRACE_SG("S/G Cont. phys_addr=%llx:%llx, len=%d",
|
||||
(long long unsigned int)pci_dma_hi32(
|
||||
sg_dma_address(prm->sg)),
|
||||
(long long unsigned int)pci_dma_lo32(
|
||||
sg_dma_address(prm->sg)),
|
||||
(int)sg_dma_len(prm->sg));
|
||||
|
||||
prm->sg++;
|
||||
}
|
||||
@@ -623,7 +625,7 @@ out:
|
||||
return;
|
||||
}
|
||||
|
||||
static void q2t_init_ctio_ret_entry(ctio_ret_entry_t *ctio_m1,
|
||||
static void q2t_init_ctio_ret_entry(struct ctio_ret_entry *ctio_m1,
|
||||
struct q2t_prm *prm)
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
@@ -779,8 +781,8 @@ static int q2t_xmit_response(struct scst_cmd *scst_cmd)
|
||||
prm.pkt->flags |=
|
||||
__constant_cpu_to_le16(OF_SSTS);
|
||||
} else {
|
||||
ctio_ret_entry_t *ctio_m1 =
|
||||
(ctio_ret_entry_t *)
|
||||
struct ctio_ret_entry *ctio_m1 =
|
||||
(struct ctio_ret_entry *)
|
||||
tgt_data.req_cont_pkt(prm.tgt->ha);
|
||||
|
||||
TRACE_DBG("%s", "Building additional status "
|
||||
@@ -800,12 +802,14 @@ static int q2t_xmit_response(struct scst_cmd *scst_cmd)
|
||||
REQUEST_ENTRY_SIZE);
|
||||
}
|
||||
} else
|
||||
q2t_init_ctio_ret_entry((ctio_ret_entry_t *)prm.pkt, &prm);
|
||||
} else {
|
||||
q2t_init_ctio_ret_entry((ctio_ret_entry_t *)prm.pkt, &prm);
|
||||
}
|
||||
q2t_init_ctio_ret_entry(
|
||||
(struct ctio_ret_entry *)prm.pkt, &prm);
|
||||
} else
|
||||
q2t_init_ctio_ret_entry((struct ctio_ret_entry *)prm.pkt,
|
||||
&prm);
|
||||
|
||||
prm.cmd->state = Q2T_STATE_PROCESSED; /* Mid-level is done processing */
|
||||
/* Mid-level is done processing */
|
||||
prm.cmd->state = Q2T_STATE_PROCESSED;
|
||||
|
||||
TRACE_BUFFER("Xmitting", prm.pkt, REQUEST_ENTRY_SIZE);
|
||||
|
||||
@@ -890,9 +894,9 @@ out_unlock:
|
||||
}
|
||||
|
||||
static void q2t_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd,
|
||||
atio_entry_t *atio, int ha_locked)
|
||||
struct atio_entry *atio, int ha_locked)
|
||||
{
|
||||
ctio_ret_entry_t *ctio;
|
||||
struct ctio_ret_entry *ctio;
|
||||
unsigned long flags = 0;
|
||||
int do_tgt_cmd_done = 0;
|
||||
|
||||
@@ -910,7 +914,7 @@ static void q2t_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd,
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
ctio = (ctio_ret_entry_t *)tgt_data.req_pkt(ha);
|
||||
ctio = (struct ctio_ret_entry *)tgt_data.req_pkt(ha);
|
||||
if (ctio == NULL) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): %s failed: unable to allocate "
|
||||
"request packet", ha->host_no, __func__);
|
||||
@@ -1001,7 +1005,7 @@ static inline struct scst_cmd *q2t_get_cmd(scsi_qla_host_t *ha, uint32_t handle)
|
||||
static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
|
||||
uint32_t handle,
|
||||
uint16_t status,
|
||||
ctio_common_entry_t *ctio)
|
||||
struct ctio_common_entry *ctio)
|
||||
{
|
||||
struct scst_cmd *scst_cmd;
|
||||
struct q2t_cmd *cmd;
|
||||
@@ -1057,12 +1061,10 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
|
||||
}
|
||||
|
||||
if (handle != Q2T_NULL_HANDLE) {
|
||||
if (unlikely(handle == Q2T_SKIP_HANDLE)) {
|
||||
if (unlikely(handle == Q2T_SKIP_HANDLE))
|
||||
goto out;
|
||||
}
|
||||
if (unlikely(handle == Q2T_BUSY_HANDLE)) {
|
||||
if (unlikely(handle == Q2T_BUSY_HANDLE))
|
||||
goto out;
|
||||
}
|
||||
scst_cmd = q2t_get_cmd(ha, handle);
|
||||
if (unlikely(scst_cmd == NULL)) {
|
||||
PRINT_INFO("qla2x00tgt(%ld): Suspicious: unable to "
|
||||
@@ -1070,10 +1072,9 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
|
||||
ha->host_no, handle);
|
||||
goto out;
|
||||
}
|
||||
if (unlikely(err)) {
|
||||
if (unlikely(err))
|
||||
TRACE_MGMT_DBG("Found by handle failed CTIO scst_cmd "
|
||||
"%p (op %x)", scst_cmd, scst_cmd->cdb[0]);
|
||||
}
|
||||
} else if (ctio != NULL) {
|
||||
uint32_t tag = le16_to_cpu(ctio->exchange_id);
|
||||
struct q2t_sess *sess = q2t_find_sess_by_lid(ha->tgt, loop_id);
|
||||
@@ -1093,20 +1094,18 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha,
|
||||
ha->host_no, tag, loop_id);
|
||||
goto out;
|
||||
}
|
||||
if (unlikely(err)) {
|
||||
if (unlikely(err))
|
||||
TRACE_MGMT_DBG("Found by ctio failed CTIO scst_cmd %p "
|
||||
"(op %x)", scst_cmd, scst_cmd->cdb[0]);
|
||||
}
|
||||
|
||||
TRACE_DBG("Found scst_cmd %p", scst_cmd);
|
||||
} else
|
||||
goto out;
|
||||
|
||||
cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd);
|
||||
if (unlikely(err)) {
|
||||
if (unlikely(err))
|
||||
TRACE(TRACE_MGMT_MINOR, "Failed CTIO state %d (err %x)",
|
||||
cmd->state, status);
|
||||
}
|
||||
|
||||
if (cmd->state == Q2T_STATE_PROCESSED) {
|
||||
TRACE_DBG("Command %p finished", cmd);
|
||||
@@ -1175,13 +1174,13 @@ static void q2t_ctio_completion(scsi_qla_host_t *ha, uint32_t handle)
|
||||
}
|
||||
|
||||
/* ha->hardware_lock supposed to be held on entry */
|
||||
static void q2t_send_busy(scsi_qla_host_t *ha, atio_entry_t *atio)
|
||||
static void q2t_send_busy(scsi_qla_host_t *ha, struct atio_entry *atio)
|
||||
{
|
||||
ctio_ret_entry_t *ctio;
|
||||
struct ctio_ret_entry *ctio;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
ctio = (ctio_ret_entry_t *)tgt_data.req_pkt(ha);
|
||||
ctio = (struct ctio_ret_entry *)tgt_data.req_pkt(ha);
|
||||
ctio->entry_type = CTIO_RET_TYPE;
|
||||
ctio->entry_count = 1;
|
||||
ctio->handle = Q2T_BUSY_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
|
||||
@@ -1270,7 +1269,8 @@ static int q2t_do_send_cmd_to_scst(scsi_qla_host_t *ha, struct q2t_cmd *cmd)
|
||||
#endif
|
||||
|
||||
TRACE_DBG("Context %x", context);
|
||||
TRACE(TRACE_SCSI, "START Command (tag %lld)", scst_cmd_get_tag(cmd->scst_cmd));
|
||||
TRACE(TRACE_SCSI, "START Command (tag %lld)",
|
||||
scst_cmd_get_tag(cmd->scst_cmd));
|
||||
scst_cmd_init_done(cmd->scst_cmd, context);
|
||||
|
||||
out:
|
||||
@@ -1357,7 +1357,7 @@ out:
|
||||
}
|
||||
|
||||
/* ha->hardware_lock supposed to be held on entry */
|
||||
static int q2t_send_cmd_to_scst(scsi_qla_host_t *ha, atio_entry_t *atio)
|
||||
static int q2t_send_cmd_to_scst(scsi_qla_host_t *ha, struct atio_entry *atio)
|
||||
{
|
||||
int res = 0;
|
||||
struct q2t_tgt *tgt;
|
||||
@@ -1441,8 +1441,9 @@ static int q2t_send_cmd_to_scst(scsi_qla_host_t *ha, atio_entry_t *atio)
|
||||
}
|
||||
|
||||
if (sess->scst_sess == NULL) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): scst_register_session() failed "
|
||||
"for host %ld(%p)", ha->host_no, ha->host_no, ha);
|
||||
PRINT_ERROR("qla2x00tgt(%ld): scst_register_session() "
|
||||
"failed for host %ld(%p)", ha->host_no,
|
||||
ha->host_no, ha);
|
||||
res = -EFAULT;
|
||||
goto out_free_sess;
|
||||
}
|
||||
@@ -1472,7 +1473,7 @@ out_free_cmd:
|
||||
}
|
||||
|
||||
/* ha->hardware_lock supposed to be held on entry */
|
||||
static int q2t_handle_task_mgmt(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
static int q2t_handle_task_mgmt(scsi_qla_host_t *ha, struct notify_entry *iocb)
|
||||
{
|
||||
int res = 0, rc = -1;
|
||||
struct q2t_mgmt_cmd *mcmd;
|
||||
@@ -1566,7 +1567,7 @@ out_free:
|
||||
}
|
||||
|
||||
/* ha->hardware_lock supposed to be held on entry */
|
||||
static int q2t_abort_task(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
static int q2t_abort_task(scsi_qla_host_t *ha, struct notify_entry *iocb)
|
||||
{
|
||||
int res = 0, rc;
|
||||
struct q2t_mgmt_cmd *mcmd;
|
||||
@@ -1648,7 +1649,8 @@ out:
|
||||
}
|
||||
|
||||
/* ha->hardware_lock supposed to be held on entry */
|
||||
static void q2t_handle_imm_notify(scsi_qla_host_t *ha, notify_entry_t *iocb)
|
||||
static void q2t_handle_imm_notify(scsi_qla_host_t *ha,
|
||||
struct notify_entry *iocb)
|
||||
{
|
||||
uint16_t status;
|
||||
int loop_id;
|
||||
@@ -1749,7 +1751,7 @@ out:
|
||||
/* called via callback from qla2xxx */
|
||||
static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
{
|
||||
atio_entry_t *atio;
|
||||
struct atio_entry *atio;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -1774,7 +1776,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
case ACCEPT_TGT_IO_TYPE:
|
||||
if (ha->flags.enable_target_mode && ha->tgt != NULL) {
|
||||
int rc;
|
||||
atio = (atio_entry_t *)pkt;
|
||||
atio = (struct atio_entry *)pkt;
|
||||
TRACE_DBG("ACCEPT_TGT_IO host_no %ld status %04x "
|
||||
"lun %04x read/write %d data_length %08x "
|
||||
"target_id %02x exchange_id %04x ",
|
||||
@@ -1799,14 +1801,16 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
#if 1 /* With TERM EXCHANGE some FC cards refuse to boot */
|
||||
q2t_send_busy(ha, atio);
|
||||
#else
|
||||
q2t_send_term_exchange(ha, NULL, atio, 1);
|
||||
q2t_send_term_exchange(ha, NULL,
|
||||
atio, 1);
|
||||
#endif
|
||||
} else {
|
||||
if (!ha->tgt->tgt_shutdown) {
|
||||
PRINT_INFO("qla2x00tgt(%ld): Unable to "
|
||||
"send the command to SCSI target "
|
||||
"mid-level, sending BUSY status",
|
||||
ha->host_no);
|
||||
PRINT_INFO("qla2x00tgt(%ld): "
|
||||
"Unable to send the "
|
||||
"command to SCSI target "
|
||||
"mid-level, sending BUSY "
|
||||
"status", ha->host_no);
|
||||
}
|
||||
q2t_send_busy(ha, atio);
|
||||
}
|
||||
@@ -1819,7 +1823,8 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
|
||||
case CONTINUE_TGT_IO_TYPE:
|
||||
if (ha->flags.enable_target_mode && ha->tgt != NULL) {
|
||||
ctio_common_entry_t *entry = (ctio_common_entry_t *)pkt;
|
||||
struct ctio_common_entry *entry =
|
||||
(struct ctio_common_entry *)pkt;
|
||||
TRACE_DBG("CONTINUE_TGT_IO: host_no %ld",
|
||||
ha->host_no);
|
||||
q2t_do_ctio_completion(ha, entry->handle,
|
||||
@@ -1833,7 +1838,8 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
|
||||
case CTIO_A64_TYPE:
|
||||
if (ha->flags.enable_target_mode && ha->tgt != NULL) {
|
||||
ctio_common_entry_t *entry = (ctio_common_entry_t *)pkt;
|
||||
struct ctio_common_entry *entry =
|
||||
(struct ctio_common_entry *)pkt;
|
||||
TRACE_DBG("CTIO_A64: host_no %ld", ha->host_no);
|
||||
q2t_do_ctio_completion(ha, entry->handle,
|
||||
le16_to_cpu(entry->status),
|
||||
@@ -1846,7 +1852,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
|
||||
case IMMED_NOTIFY_TYPE:
|
||||
TRACE_DBG("%s", "IMMED_NOTIFY");
|
||||
q2t_handle_imm_notify(ha, (notify_entry_t *)pkt);
|
||||
q2t_handle_imm_notify(ha, (struct notify_entry *)pkt);
|
||||
break;
|
||||
|
||||
case NOTIFY_ACK_TYPE:
|
||||
@@ -1854,7 +1860,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
PRINT_ERROR("qla2x00tgt(%ld): NOTIFY_ACK recieved "
|
||||
"with NULL tgt", ha->host_no);
|
||||
} else if (ha->tgt->notify_ack_expected > 0) {
|
||||
nack_entry_t *entry = (nack_entry_t *)pkt;
|
||||
struct nack_entry *entry = (struct nack_entry *)pkt;
|
||||
TRACE_DBG("NOTIFY_ACK seq %04x status %x",
|
||||
le16_to_cpu(entry->seq_id),
|
||||
le16_to_cpu(entry->status));
|
||||
@@ -1874,24 +1880,24 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
case MODIFY_LUN_TYPE:
|
||||
if ((ha->tgt != NULL) && (ha->tgt->modify_lun_expected > 0)) {
|
||||
struct q2t_tgt *tgt = ha->tgt;
|
||||
modify_lun_entry_t *entry = (modify_lun_entry_t *)pkt;
|
||||
struct modify_lun_entry *entry =
|
||||
(struct modify_lun_entry *)pkt;
|
||||
TRACE_DBG("MODIFY_LUN %x, imm %c%d, cmd %c%d",
|
||||
entry->status,
|
||||
(entry->operators & MODIFY_LUN_IMM_ADD) ?'+'
|
||||
:(entry->operators & MODIFY_LUN_IMM_SUB) ?'-'
|
||||
:' ',
|
||||
entry->immed_notify_count,
|
||||
(entry->operators & MODIFY_LUN_CMD_ADD) ?'+'
|
||||
:(entry->operators & MODIFY_LUN_CMD_SUB) ?'-'
|
||||
:' ',
|
||||
entry->command_count);
|
||||
entry->status,
|
||||
(entry->operators & MODIFY_LUN_IMM_ADD) ? '+'
|
||||
: (entry->operators & MODIFY_LUN_IMM_SUB) ?
|
||||
'-' : ' ',
|
||||
entry->immed_notify_count,
|
||||
(entry->operators & MODIFY_LUN_CMD_ADD) ? '+'
|
||||
: (entry->operators & MODIFY_LUN_CMD_SUB) ?
|
||||
'-' : ' ',
|
||||
entry->command_count);
|
||||
tgt->modify_lun_expected--;
|
||||
if (entry->status != MODIFY_LUN_SUCCESS) {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): MODIFY_LUN "
|
||||
"failed %x", ha->host_no,
|
||||
entry->status);
|
||||
}
|
||||
tgt->disable_lun_status = entry->status;
|
||||
} else {
|
||||
PRINT_ERROR("qla2x00tgt(%ld): Unexpected MODIFY_LUN "
|
||||
"received", (ha != NULL) ? ha->host_no : -1);
|
||||
@@ -1900,8 +1906,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
|
||||
case ENABLE_LUN_TYPE:
|
||||
if (ha->tgt != NULL) {
|
||||
struct q2t_tgt *tgt = ha->tgt;
|
||||
elun_entry_t *entry = (elun_entry_t *)pkt;
|
||||
struct elun_entry *entry = (struct elun_entry *)pkt;
|
||||
TRACE_DBG("ENABLE_LUN %x imm %u cmd %u ",
|
||||
entry->status, entry->immed_notify_count,
|
||||
entry->command_count);
|
||||
@@ -1921,7 +1926,6 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, sts_entry_t *pkt)
|
||||
ha->flags.enable_target_mode =
|
||||
~ha->flags.enable_target_mode;
|
||||
} /* else success */
|
||||
tgt->disable_lun_status = entry->status;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1938,7 +1942,8 @@ out:
|
||||
|
||||
/* ha->hardware_lock supposed to be held on entry */
|
||||
/* called via callback from qla2xxx */
|
||||
static void q2t_async_event(uint16_t code, scsi_qla_host_t *ha, uint16_t *mailbox)
|
||||
static void q2t_async_event(uint16_t code, scsi_qla_host_t *ha,
|
||||
uint16_t *mailbox)
|
||||
{
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -2021,7 +2026,7 @@ out:
|
||||
/* no lock held on entry */
|
||||
/* called via callback from qla2xxx */
|
||||
static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
qla2x_tgt_host_action_t action)
|
||||
enum qla2x_tgt_host_action action)
|
||||
{
|
||||
struct q2t_tgt *tgt = NULL;
|
||||
unsigned long flags = 0;
|
||||
@@ -2045,7 +2050,6 @@ static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
}
|
||||
|
||||
tgt->ha = ha;
|
||||
tgt->disable_lun_status = Q2T_DISABLE_LUN_STATUS_NOT_SET;
|
||||
INIT_LIST_HEAD(&tgt->sess_list);
|
||||
init_waitqueue_head(&tgt->waitQ);
|
||||
|
||||
@@ -2102,7 +2106,7 @@ static void q2t_host_action(scsi_qla_host_t *ha,
|
||||
ha->flags.enable_target_mode = 0;
|
||||
spin_unlock_irqrestore(&ha->hardware_lock, flags);
|
||||
|
||||
if(!ha->flags.host_shutting_down)
|
||||
if (!ha->flags.host_shutting_down)
|
||||
tgt_data.disable_lun(ha);
|
||||
|
||||
goto out;
|
||||
@@ -2208,9 +2212,8 @@ static void q2t_proc_log_entry_clean(struct scst_tgt_template *templ)
|
||||
TRACE_ENTRY();
|
||||
|
||||
root = scst_proc_get_tgt_root(templ);
|
||||
if (root) {
|
||||
if (root)
|
||||
remove_proc_entry(Q2T_PROC_LOG_ENTRY_NAME, root);
|
||||
}
|
||||
|
||||
TRACE_EXIT();
|
||||
#endif
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#include <scst_debug.h>
|
||||
|
||||
/* Version numbers, the same as for the kernel */
|
||||
#define Q2T_VERSION(a,b,c,d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d))
|
||||
#define Q2T_VERSION_CODE Q2T_VERSION(1,0,0,0)
|
||||
#define Q2T_VERSION(a, b, c, d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d))
|
||||
#define Q2T_VERSION_CODE Q2T_VERSION(1, 0, 0, 0)
|
||||
#define Q2T_VERSION_STRING "1.0.1"
|
||||
|
||||
#define Q2T_MAX_CDB_LEN 16
|
||||
@@ -63,14 +63,14 @@
|
||||
#define Q2T_STATE_NEW 0 /* New command and SCST processing it */
|
||||
#define Q2T_STATE_PROCESSED 1 /* SCST done processing */
|
||||
#define Q2T_STATE_NEED_DATA 2 /* SCST needs data to continue */
|
||||
#define Q2T_STATE_DATA_IN 3 /* Data arrived and SCST processing them */
|
||||
#define Q2T_STATE_DATA_IN 3 /* Data arrived and SCST processing */
|
||||
/* them */
|
||||
#define Q2T_STATE_ABORTED 4 /* Command aborted */
|
||||
|
||||
/* Misc */
|
||||
#define Q2T_NULL_HANDLE 0
|
||||
#define Q2T_SKIP_HANDLE (0xFFFFFFFE & ~CTIO_COMPLETION_HANDLE_MARK)
|
||||
#define Q2T_BUSY_HANDLE (0xFFFFFFFF & ~CTIO_COMPLETION_HANDLE_MARK)
|
||||
#define Q2T_DISABLE_LUN_STATUS_NOT_SET -1
|
||||
|
||||
/* ATIO task_codes fields */
|
||||
#define ATIO_SIMPLE_QUEUE 0
|
||||
@@ -93,49 +93,43 @@
|
||||
/*
|
||||
* Equivilant to IT Nexus (Initiator-Target)
|
||||
*/
|
||||
struct q2t_sess
|
||||
{
|
||||
struct q2t_sess {
|
||||
struct list_head list;
|
||||
struct scst_session *scst_sess;
|
||||
struct q2t_tgt *tgt;
|
||||
int loop_id;
|
||||
};
|
||||
|
||||
struct q2t_cmd
|
||||
{
|
||||
struct q2t_cmd {
|
||||
struct q2t_sess *sess;
|
||||
struct scst_cmd *scst_cmd;
|
||||
int state;
|
||||
atio_entry_t atio;
|
||||
struct atio_entry atio;
|
||||
dma_addr_t dma_handle;
|
||||
uint32_t iocb_cnt;
|
||||
};
|
||||
|
||||
struct q2t_tgt
|
||||
{
|
||||
struct q2t_tgt {
|
||||
struct scst_tgt *scst_tgt;
|
||||
scsi_qla_host_t *ha;
|
||||
int datasegs_per_cmd, datasegs_per_cont;
|
||||
/* Target's flags, serialized by ha->hardware_lock */
|
||||
unsigned int tgt_shutdown:1; /* The driver is being released */
|
||||
unsigned int tgt_enable_64bit_addr:1; /* 64-bits PCI addressing enabled */
|
||||
unsigned int tgt_enable_64bit_addr:1; /* 64bit PCI addressing enabled */
|
||||
wait_queue_head_t waitQ;
|
||||
int notify_ack_expected;
|
||||
volatile int modify_lun_expected;
|
||||
volatile int disable_lun_status;
|
||||
int modify_lun_expected;
|
||||
/* Count of sessions refering q2t_tgt, protected by hardware_lock */
|
||||
int sess_count;
|
||||
struct list_head sess_list;
|
||||
};
|
||||
|
||||
struct q2t_mgmt_cmd
|
||||
{
|
||||
struct q2t_mgmt_cmd {
|
||||
struct q2t_sess *sess;
|
||||
notify_entry_t notify_entry;
|
||||
struct notify_entry notify_entry;
|
||||
};
|
||||
|
||||
struct q2t_prm
|
||||
{
|
||||
struct q2t_prm {
|
||||
struct q2t_tgt *tgt;
|
||||
uint16_t req_cnt;
|
||||
uint16_t seg_cnt;
|
||||
@@ -149,7 +143,7 @@ struct q2t_prm
|
||||
unsigned int sense_buffer_len;
|
||||
int residual;
|
||||
struct q2t_cmd *cmd;
|
||||
ctio_common_entry_t *pkt;
|
||||
struct ctio_common_entry *pkt;
|
||||
};
|
||||
|
||||
/* ha->hardware_lock supposed to be held on entry (to protect tgt->sess_list) */
|
||||
|
||||
@@ -50,9 +50,9 @@ extern request_t *qla2x00_req_pkt(scsi_qla_host_t *ha);
|
||||
static inline void
|
||||
__qla2x00_en_dis_lun(scsi_qla_host_t *ha, int enable)
|
||||
{
|
||||
elun_entry_t *pkt;
|
||||
struct elun_entry *pkt;
|
||||
|
||||
if ((pkt = (elun_entry_t *)qla2x00_req_pkt(ha)) != NULL) {
|
||||
if ((pkt = (struct elun_entry *)qla2x00_req_pkt(ha)) != NULL) {
|
||||
pkt->entry_type = ENABLE_LUN_TYPE;
|
||||
if (enable) {
|
||||
pkt->command_count = QLA2X00_COMMAND_COUNT_INIT;
|
||||
|
||||
@@ -53,7 +53,8 @@
|
||||
*/
|
||||
#define CTIO_COMPLETION_HANDLE_MARK BIT_15
|
||||
#if (CTIO_COMPLETION_HANDLE_MARK <= MAX_OUTSTANDING_COMMANDS)
|
||||
#error "Hackish CTIO_COMPLETION_HANDLE_MARK no longer larger than MAX_OUTSTANDING_COMMANDS"
|
||||
#error "Hackish CTIO_COMPLETION_HANDLE_MARK no longer larger than \
|
||||
MAX_OUTSTANDING_COMMANDS"
|
||||
#endif
|
||||
#define HANDLE_IS_CTIO_COMP(h) (h & CTIO_COMPLETION_HANDLE_MARK)
|
||||
|
||||
@@ -61,31 +62,31 @@
|
||||
/*
|
||||
* ISP target entries - Flags bit definitions.
|
||||
*/
|
||||
#define OF_SS_MODE_0 0
|
||||
#define OF_SS_MODE_1 1
|
||||
#define OF_SS_MODE_2 2
|
||||
#define OF_SS_MODE_3 3
|
||||
#define OF_SS_MODE_0 0
|
||||
#define OF_SS_MODE_1 1
|
||||
#define OF_SS_MODE_2 2
|
||||
#define OF_SS_MODE_3 3
|
||||
|
||||
#define OF_RESET BIT_5 /* Reset LIP flag */
|
||||
#define OF_DATA_IN BIT_6 /* Data in to initiator */
|
||||
/* (data from target to initiator) */
|
||||
#define OF_DATA_OUT BIT_7 /* Data out from initiator */
|
||||
/* (data from initiator to target) */
|
||||
#define OF_NO_DATA (BIT_7 | BIT_6)
|
||||
#define OF_INC_RC BIT_8 /* Increment command resource count */
|
||||
#define OF_FAST_POST BIT_9 /* Enable mailbox fast posting. */
|
||||
#define OF_TERM_EXCH BIT_14 /* Terminate exchange */
|
||||
#define OF_SSTS BIT_15 /* Send SCSI status */
|
||||
#define OF_RESET BIT_5 /* Reset LIP flag */
|
||||
#define OF_DATA_IN BIT_6 /* Data in to initiator */
|
||||
/* (data from target to initiator) */
|
||||
#define OF_DATA_OUT BIT_7 /* Data out from initiator */
|
||||
/* (data from initiator to target) */
|
||||
#define OF_NO_DATA (BIT_7 | BIT_6)
|
||||
#define OF_INC_RC BIT_8 /* Increment command resource count */
|
||||
#define OF_FAST_POST BIT_9 /* Enable mailbox fast posting. */
|
||||
#define OF_TERM_EXCH BIT_14 /* Terminate exchange */
|
||||
#define OF_SSTS BIT_15 /* Send SCSI status */
|
||||
#endif
|
||||
|
||||
#ifndef DATASEGS_PER_COMMAND32
|
||||
#define DATASEGS_PER_COMMAND32 3
|
||||
#define DATASEGS_PER_CONT32 7
|
||||
#define DATASEGS_PER_COMMAND32 3
|
||||
#define DATASEGS_PER_CONT32 7
|
||||
#define QLA_MAX_SG32(ql) \
|
||||
(DATASEGS_PER_COMMAND32 + (((ql) > 0) ? DATASEGS_PER_CONT32*((ql) - 1) : 0))
|
||||
|
||||
#define DATASEGS_PER_COMMAND64 2
|
||||
#define DATASEGS_PER_CONT64 5
|
||||
#define DATASEGS_PER_COMMAND64 2
|
||||
#define DATASEGS_PER_CONT64 5
|
||||
#define QLA_MAX_SG64(ql) \
|
||||
(DATASEGS_PER_COMMAND64 + (((ql) > 0) ? DATASEGS_PER_CONT64*((ql) - 1) : 0))
|
||||
#endif
|
||||
@@ -96,11 +97,10 @@
|
||||
|
||||
#ifndef ENABLE_LUN_TYPE
|
||||
#define ENABLE_LUN_TYPE 0x0B /* Enable LUN entry. */
|
||||
/*!
|
||||
/*
|
||||
* ISP queue - enable LUN entry structure definition.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
struct elun_entry {
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
@@ -113,29 +113,29 @@ typedef struct
|
||||
uint8_t status;
|
||||
uint8_t reserved_4;
|
||||
uint8_t command_count; /* Number of ATIOs allocated. */
|
||||
uint8_t immed_notify_count; /* Number of Immediate Notify entries allocated. */
|
||||
uint8_t immed_notify_count; /* Number of Immediate Notify entries */
|
||||
/* allocated. */
|
||||
uint16_t reserved_5;
|
||||
uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */
|
||||
uint16_t reserved_6[20];
|
||||
} elun_entry_t;
|
||||
#define ENABLE_LUN_SUCCESS 0x01
|
||||
#define ENABLE_LUN_RC_NONZERO 0x04
|
||||
#define ENABLE_LUN_INVALID_REQUEST 0x06
|
||||
#define ENABLE_LUN_ALREADY_ENABLED 0x3E
|
||||
};
|
||||
#define ENABLE_LUN_SUCCESS 0x01
|
||||
#define ENABLE_LUN_RC_NONZERO 0x04
|
||||
#define ENABLE_LUN_INVALID_REQUEST 0x06
|
||||
#define ENABLE_LUN_ALREADY_ENABLED 0x3E
|
||||
#endif
|
||||
|
||||
#ifndef MODIFY_LUN_TYPE
|
||||
#define MODIFY_LUN_TYPE 0x0C //!< Modify LUN entry.
|
||||
#define MODIFY_LUN_TYPE 0x0C
|
||||
/*
|
||||
* ISP queue - modify LUN entry structure definition.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t sys_define_2; /* System defined. */
|
||||
struct modify_lun_entry {
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t sys_define_2; /* System defined. */
|
||||
uint8_t reserved_8;
|
||||
uint8_t reserved_1;
|
||||
uint8_t operators;
|
||||
@@ -143,18 +143,18 @@ typedef struct
|
||||
uint32_t reserved_3;
|
||||
uint8_t status;
|
||||
uint8_t reserved_4;
|
||||
uint8_t command_count; /* Number of ATIOs allocated. */
|
||||
uint8_t immed_notify_count; /* Number of Immediate Notify */
|
||||
uint8_t command_count; /* Number of ATIOs allocated. */
|
||||
uint8_t immed_notify_count; /* Number of Immediate Notify */
|
||||
/* entries allocated. */
|
||||
uint16_t reserved_5;
|
||||
uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */
|
||||
uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */
|
||||
uint16_t reserved_7[20];
|
||||
}modify_lun_entry_t;
|
||||
};
|
||||
#define MODIFY_LUN_SUCCESS 0x01
|
||||
#define MODIFY_LUN_CMD_ADD BIT_0
|
||||
#define MODIFY_LUN_CMD_SUB BIT_1
|
||||
#define MODIFY_LUN_IMM_ADD BIT_2
|
||||
#define MODIFY_LUN_IMM_SUB BIT_3
|
||||
#define MODIFY_LUN_CMD_ADD BIT_0
|
||||
#define MODIFY_LUN_CMD_SUB BIT_1
|
||||
#define MODIFY_LUN_IMM_ADD BIT_2
|
||||
#define MODIFY_LUN_IMM_SUB BIT_3
|
||||
#endif
|
||||
|
||||
|
||||
@@ -163,17 +163,16 @@ typedef struct
|
||||
: (uint16_t)(iocb)->target.id.standard)
|
||||
|
||||
#ifndef IMMED_NOTIFY_TYPE
|
||||
#define IMMED_NOTIFY_TYPE 0x0D/* Immediate notify entry. */
|
||||
#define IMMED_NOTIFY_TYPE 0x0D /* Immediate notify entry. */
|
||||
/*
|
||||
* ISP queue - immediate notify entry structure definition.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t sys_define_2; /* System defined. */
|
||||
struct notify_entry {
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t sys_define_2; /* System defined. */
|
||||
target_id_t target;
|
||||
uint16_t lun;
|
||||
uint32_t reserved_2;
|
||||
@@ -184,21 +183,20 @@ typedef struct
|
||||
uint16_t scsi_status;
|
||||
uint8_t sense_data[16];
|
||||
uint16_t ox_id;
|
||||
}notify_entry_t;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NOTIFY_ACK_TYPE
|
||||
#define NOTIFY_ACK_TYPE 0x0E /* Notify acknowledge entry. */
|
||||
#define NOTIFY_ACK_TYPE 0x0E /* Notify acknowledge entry. */
|
||||
/*
|
||||
* ISP queue - notify acknowledge entry structure definition.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t sys_define_2; /* System defined. */
|
||||
struct nack_entry {
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t sys_define_2; /* System defined. */
|
||||
target_id_t target;
|
||||
uint8_t reserved_1;
|
||||
uint8_t target_id;
|
||||
@@ -209,22 +207,21 @@ typedef struct
|
||||
uint16_t seq_id;
|
||||
uint16_t reserved_3[20];
|
||||
uint16_t ox_id;
|
||||
}nack_entry_t;
|
||||
#define NOTIFY_ACK_SUCCESS 0x01
|
||||
};
|
||||
#define NOTIFY_ACK_SUCCESS 0x01
|
||||
#endif
|
||||
|
||||
#ifndef ACCEPT_TGT_IO_TYPE
|
||||
#define ACCEPT_TGT_IO_TYPE 0x16 /* Accept target I/O entry. */
|
||||
#define ACCEPT_TGT_IO_TYPE 0x16 /* Accept target I/O entry. */
|
||||
/*
|
||||
* ISP queue - Accept Target I/O (ATIO) entry structure definition.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t sys_define_2; /* System defined. */
|
||||
struct atio_entry {
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t sys_define_2; /* System defined. */
|
||||
target_id_t target;
|
||||
uint16_t exchange_id;
|
||||
uint16_t flags;
|
||||
@@ -239,83 +236,80 @@ typedef struct
|
||||
uint8_t initiator_port_name[WWN_SIZE]; /* on qla23xx */
|
||||
uint8_t reserved2[12];
|
||||
uint16_t ox_id;
|
||||
}atio_entry_t;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef CONTINUE_TGT_IO_TYPE
|
||||
#define CONTINUE_TGT_IO_TYPE 0x17
|
||||
#define CONTINUE_TGT_IO_TYPE 0x17
|
||||
/*
|
||||
* ISP queue - Continue Target I/O (CTIO) entry for status mode 0
|
||||
* structure definition.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t handle; /* System defined handle */
|
||||
struct ctio_common_entry {
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t handle; /* System defined handle */
|
||||
target_id_t target;
|
||||
uint16_t exchange_id;
|
||||
uint16_t flags;
|
||||
uint16_t status;
|
||||
uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */
|
||||
uint16_t dseg_count; /* Data segment count. */
|
||||
uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */
|
||||
uint16_t dseg_count; /* Data segment count. */
|
||||
uint32_t relative_offset;
|
||||
uint32_t residual;
|
||||
uint16_t reserved_1[3];
|
||||
uint16_t scsi_status;
|
||||
uint32_t transfer_length;
|
||||
uint32_t dseg_0_address[0];
|
||||
}ctio_common_entry_t;
|
||||
#define ATIO_PATH_INVALID 0x07
|
||||
#define ATIO_CANT_PROV_CAP 0x16
|
||||
#define ATIO_CDB_VALID 0x3D
|
||||
};
|
||||
#define ATIO_PATH_INVALID 0x07
|
||||
#define ATIO_CANT_PROV_CAP 0x16
|
||||
#define ATIO_CDB_VALID 0x3D
|
||||
|
||||
#define ATIO_EXEC_READ BIT_1
|
||||
#define ATIO_EXEC_WRITE BIT_0
|
||||
#define ATIO_EXEC_READ BIT_1
|
||||
#define ATIO_EXEC_WRITE BIT_0
|
||||
#endif
|
||||
|
||||
#ifndef CTIO_A64_TYPE
|
||||
#define CTIO_A64_TYPE 0x1F
|
||||
typedef struct
|
||||
{
|
||||
ctio_common_entry_t common;
|
||||
uint32_t dseg_0_address; /* Data segment 0 address. */
|
||||
uint32_t dseg_0_length; /* Data segment 0 length. */
|
||||
uint32_t dseg_1_address; /* Data segment 1 address. */
|
||||
uint32_t dseg_1_length; /* Data segment 1 length. */
|
||||
uint32_t dseg_2_address; /* Data segment 2 address. */
|
||||
uint32_t dseg_2_length; /* Data segment 2 length. */
|
||||
}ctio_entry_t;
|
||||
#define CTIO_SUCCESS 0x01
|
||||
#define CTIO_ABORTED 0x02
|
||||
#define CTIO_INVALID_RX_ID 0x08
|
||||
#define CTIO_TIMEOUT 0x0B
|
||||
#define CTIO_LIP_RESET 0x0E
|
||||
#define CTIO_TARGET_RESET 0x17
|
||||
#define CTIO_PORT_UNAVAILABLE 0x28
|
||||
#define CTIO_PORT_LOGGED_OUT 0x29
|
||||
#define CTIO_A64_TYPE 0x1F
|
||||
struct ctio_entry {
|
||||
struct ctio_common_entry common;
|
||||
uint32_t dseg_0_address; /* Data segment 0 address. */
|
||||
uint32_t dseg_0_length; /* Data segment 0 length. */
|
||||
uint32_t dseg_1_address; /* Data segment 1 address. */
|
||||
uint32_t dseg_1_length; /* Data segment 1 length. */
|
||||
uint32_t dseg_2_address; /* Data segment 2 address. */
|
||||
uint32_t dseg_2_length; /* Data segment 2 length. */
|
||||
};
|
||||
#define CTIO_SUCCESS 0x01
|
||||
#define CTIO_ABORTED 0x02
|
||||
#define CTIO_INVALID_RX_ID 0x08
|
||||
#define CTIO_TIMEOUT 0x0B
|
||||
#define CTIO_LIP_RESET 0x0E
|
||||
#define CTIO_TARGET_RESET 0x17
|
||||
#define CTIO_PORT_UNAVAILABLE 0x28
|
||||
#define CTIO_PORT_LOGGED_OUT 0x29
|
||||
#endif
|
||||
|
||||
#ifndef CTIO_RET_TYPE
|
||||
#define CTIO_RET_TYPE 0x17 /* CTIO return entry */
|
||||
#define CTIO_RET_TYPE 0x17 /* CTIO return entry */
|
||||
/*
|
||||
* ISP queue - CTIO returned entry structure definition.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t handle; /* System defined handle. */
|
||||
struct ctio_ret_entry {
|
||||
uint8_t entry_type; /* Entry type. */
|
||||
uint8_t entry_count; /* Entry count. */
|
||||
uint8_t sys_define; /* System defined. */
|
||||
uint8_t entry_status; /* Entry Status. */
|
||||
uint32_t handle; /* System defined handle. */
|
||||
target_id_t target;
|
||||
uint16_t exchange_id;
|
||||
uint16_t flags;
|
||||
uint16_t status;
|
||||
uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */
|
||||
uint16_t dseg_count; /* Data segment count. */
|
||||
uint16_t timeout; /* 0 = 30 seconds, 0xFFFF = disable */
|
||||
uint16_t dseg_count; /* Data segment count. */
|
||||
uint32_t relative_offset;
|
||||
uint32_t residual;
|
||||
uint16_t reserved_1[2];
|
||||
@@ -323,31 +317,31 @@ typedef struct
|
||||
uint16_t scsi_status;
|
||||
uint16_t response_length;
|
||||
uint8_t sense_data[26];
|
||||
}ctio_ret_entry_t;
|
||||
};
|
||||
#endif
|
||||
|
||||
/********************************************************************\
|
||||
* Type Definitions used by initiator & target halves
|
||||
\********************************************************************/
|
||||
|
||||
typedef enum {
|
||||
enum qla2x_tgt_host_action {
|
||||
DISABLE_TARGET_MODE = 0,
|
||||
ENABLE_TARGET_MODE = 1
|
||||
} qla2x_tgt_host_action_t;
|
||||
};
|
||||
|
||||
struct qla2x_tgt_initiator
|
||||
{
|
||||
struct qla2x_tgt_initiator {
|
||||
int magic;
|
||||
|
||||
/* Callbacks */
|
||||
void (*tgt_response_pkt)(scsi_qla_host_t *ha, sts_entry_t *pkt);
|
||||
void (*tgt_ctio_completion)(scsi_qla_host_t *ha, uint32_t handle);
|
||||
void (*tgt_async_event)(uint16_t code, scsi_qla_host_t *ha, uint16_t *mailbox);
|
||||
void (*tgt_host_action)(scsi_qla_host_t *ha, qla2x_tgt_host_action_t action);
|
||||
void (*tgt_async_event)(uint16_t code, scsi_qla_host_t *ha,
|
||||
uint16_t *mailbox);
|
||||
void (*tgt_host_action)(scsi_qla_host_t *ha,
|
||||
enum qla2x_tgt_host_action action);
|
||||
};
|
||||
|
||||
struct qla2x_tgt_target
|
||||
{
|
||||
struct qla2x_tgt_target {
|
||||
int magic;
|
||||
|
||||
/* Callbacks - H/W lock MUST be held while calling any */
|
||||
|
||||
@@ -680,7 +680,7 @@ static struct scsi_host_template scst_lcl_ini_driver_template = {
|
||||
.eh_target_reset_handler = scst_local_target_reset,
|
||||
#endif
|
||||
.can_queue = 256,
|
||||
.this_id = SCST_LOCAL_MAX_TARGETS,
|
||||
.this_id = SCST_LOCAL_MAX_TARGETS,
|
||||
/* SCST doesn't support sg chaining */
|
||||
.sg_tablesize = SCSI_MAX_SG_SEGMENTS,
|
||||
.cmd_per_lun = 32,
|
||||
|
||||
Reference in New Issue
Block a user