/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2013, Nexenta Systems, Inc. All rights reserved.
*/
#include <sys/sysmacros.h>
#include <sys/stmf_ioctl.h>
#include "pppt.h"
void
{
switch (msg->icm_msg_type) {
break;
break;
case STMF_ICM_SESSION_CREATE:
break;
case STMF_ICM_SESSION_DESTROY:
break;
case STMF_ICM_SCSI_CMD:
break;
break;
case STMF_ICM_SCSI_DATA:
/* Ignore, all proxy data will be immediate for now */
break;
case STMF_ICM_STATUS:
break;
default:
/* Other message types are not allowed */
ASSERT(0);
break;
}
}
void
{
/*
* If TX of status fails it should be treated the same as a loss of
* connection. We expect the remote node to handle it.
*/
(void) stmf_ic_tx_msg(msg);
}
}
static void
{
goto pppt_register_tgt_done;
}
/*
* For now we assume that the marshall/unmarshall code is responsible
* for validating the message length and ensuring the resulting
* request structure is self consistent. Make sure this
* target doesn't already exist.
*/
goto pppt_register_tgt_done;
}
goto pppt_register_tgt_done;
}
}
static void
{
goto pppt_deregister_tgt_done;
}
/* Lookup target */
goto pppt_deregister_tgt_done;
}
/* Wait for delete to complete */
while ((tgt->target_refcount > 0) ||
}
}
static void
{
/*
* Look for existing session for this ID
*/
return;
}
/* Release the reference from the lookup */
/* Make sure another thread is not already closing the session */
/* Found matching open session, quiesce... */
}
}
static void
{
/*
* Get a task context
*/
ptask = pppt_task_alloc();
/*
* We must be very low on memory. Just free the message
* and let the command timeout.
*/
return;
}
/*
* Session are created implicitly on the first use of an
* IT nexus
*/
return;
}
/*
* Add task to our internal task set.
*/
if (pppt_status != 0) {
/* Release hold from pppt_sess_lookup_create() */
return;
}
/*
* Allocate STMF task context
*/
scmd->icsc_task_cdb_length, 0);
/* NOTE: pppt_task_done() will free ptask. */
(void) pppt_task_done(ptask);
return;
}
/* task_port_private reference is a real reference. */
(void) pppt_task_hold(ptask);
task->task_additional_flags = 0;
task->task_priority = 0;
/*
* Set task->task_mgmt_function to TM_NONE for a normal SCSI task
* or one of these values for a task management command:
*
* TM_ABORT_TASK ***
* TM_ABORT_TASK_SET
* TM_CLEAR_ACA
* TM_CLEAR_TASK_SET
* TM_LUN_RESET
* TM_TARGET_WARM_RESET
* TM_TARGET_COLD_RESET
*
* *** Note that STMF does not currently support TM_ABORT_TASK so
* port providers must implement this command on their own
* (e.g. lookup the desired task and call stmf_abort).
*/
if (scmd->icsc_task_cdb_length) {
}
if (scmd->icsc_immed_data_len) {
} else {
}
}
static void
{
/*
* Find task
*/
/* If we found one, complete the transfer */
}
}
static void
{
/* Don't care for now */
}