/*
* 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 2000 by Cisco Systems, Inc. All rights reserved.
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* iSCSI Software Initiator
*/
#include "iscsi.h" /* main header */
iscsi_cmd_t *icmdp);
/*
* +--------------------------------------------------------------------+
* | public queue functions |
* +--------------------------------------------------------------------+
*
* Public queue locking rules. When acquiring multiple queue locks
* they MUST always be acquired in a forward order. If a lock is
* aquire in a reverese order it could lead to a deadlock panic.
* The forward order of locking is described as shown below.
*
* pending -> cmdsn -> active -> completion
*
* If a cmd_mutex is held, it is either held after the pending queue
* mutex or after the active queue mutex.
*/
/*
* iscsi_init_queue - used to initialize iscsi queue
*/
void
{
}
/*
* iscsi_destroy_queue - used to terminate iscsi queue
*/
void
{
}
/*
* iscsi_enqueue_pending_cmd - used to add a command in a pending queue
*/
void
{
} else {
}
}
/*
* iscsi_dequeue_pending_cmd - used to remove a command from a pending queue
*/
void
{
if (ISCSI_SUCCESS(rval)) {
} else {
"kstat wcnt == 0 when exiting waitq,"
" please check\n");
}
} else {
}
}
/*
* iscsi_enqueue_active_cmd - used to add a command in a active queue
*
* This interface attempts to keep newer items are on the tail,
* older items are on the head. But, Do not assume that the list
* is completely sorted. If someone attempts to enqueue an item
* that already has cmd_lbolt_active assigned and is older than
* the current head, otherwise add to the tail.
*/
void
{
/*
* When receiving data associated to a command it
* is temporarily removed from the active queue.
* Then once the data receive is completed it may
* be returned to the active queue. If this was
* an aborting command we need to preserve its
* state.
*/
}
/*
* It's possible that this is not a newly issued icmdp - we may
* have tried to abort it but the abort failed or was rejected
* and we are putting it back on the active list. So if it is older
* than the head of the active queue, put it at the head to keep
* the CommandTimeout valid.
*/
if (icmdp->cmd_lbolt_active == 0) {
} else {
}
}
}
/*
* iscsi_dequeue_active_cmd - used to remove a command from a active queue
*/
void
{
if (ISCSI_SUCCESS(rval)) {
} else {
"kstat rcnt == 0 when exiting runq,"
" please check\n");
}
}
} else {
}
}
/*
* iscsi_enqueue_idm_aborting_cmd - used to add a command to the queue
* representing command waiting for a callback from IDM for aborting
*
* Not sorted
*/
void
{
}
/*
* iscsi_dequeue_idm_aborting_cmd - used to remove a command from the queue
* representing commands waiting for a callback from IDM for aborting.
*/
void
{
}
/*
* iscsi_enqueue_completed_cmd - used to add a command in completion queue
*/
void
{
} else {
/*
* This command has already been completed, probably
* through the abort code path. It should be in
* the process of being returned to to the upper
* layers, so do nothing.
*/
return;
}
}
/*
* iscsi_move_queue - used to move the whole contents of a queue
*
* The source queue has to be initialized. Its mutex is entered before
* doing the actual move. The destination queue should be initialized.
* This function is intended to move a queue located in a shared location
* into local space. No mutex is needed for the destination queue.
*/
void
)
{
}
/*
* +--------------------------------------------------------------------+
* | private functions |
* +--------------------------------------------------------------------+
*/
/*
* iscsi_dequeue_cmd - used to remove a command from a queue
*/
{
#ifdef DEBUG
#endif
/* empty queue, error */
return (ISCSI_STATUS_INTERNAL_ERROR);
/* one element queue */
} else {
return (ISCSI_STATUS_INTERNAL_ERROR);
}
} else {
/* multi-element queue */
/* at the head */
} else {
#ifdef DEBUG
/* in the middle? */
;
/* not found */
return (ISCSI_STATUS_INTERNAL_ERROR);
}
#endif
return (ISCSI_STATUS_INTERNAL_ERROR);
}
return (ISCSI_STATUS_INTERNAL_ERROR);
}
}
}
/* icmdp no longer in the queue */
return (ISCSI_STATUS_SUCCESS);
}
/*
* iscsi_enqueue_cmd_head - used to add a command to the head of a queue
*/
void
{
/* empty queue */
} else {
/* non-empty queue */
}
}
/*
* iscsi_enqueue_cmd_tail - used to add a command to the tail of a queue
*/
static void
{
/* empty queue */
} else {
/* non-empty queue */
}
}