usr/src/uts/common/io/scsi/adapters/iscsi/iscsi_queue.c
changeset 9162 b011b0287065
parent 7836 4e95154b5b7a
child 10185 d6b39f6b95b5
equal deleted inserted replaced
9161:7dca69f75d8e 9162:b011b0287065
    18  *
    18  *
    19  * CDDL HEADER END
    19  * CDDL HEADER END
    20  */
    20  */
    21 /*
    21 /*
    22  * Copyright 2000 by Cisco Systems, Inc.  All rights reserved.
    22  * Copyright 2000 by Cisco Systems, Inc.  All rights reserved.
    23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
    23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
    24  * Use is subject to license terms.
    24  * Use is subject to license terms.
    25  *
    25  *
    26  * iSCSI Software Initiator
    26  * iSCSI Software Initiator
    27  */
    27  */
    28 
    28 
   217 			}
   217 			}
   218 		}
   218 		}
   219 	} else {
   219 	} else {
   220 		ASSERT(FALSE);
   220 		ASSERT(FALSE);
   221 	}
   221 	}
       
   222 }
       
   223 
       
   224 /*
       
   225  * iscsi_enqueue_idm_aborting_cmd - used to add a command to the queue
       
   226  * representing command waiting for a callback from IDM for aborting
       
   227  *
       
   228  * Not sorted
       
   229  */
       
   230 void
       
   231 iscsi_enqueue_idm_aborting_cmd(iscsi_conn_t *icp, iscsi_cmd_t *icmdp)
       
   232 {
       
   233 	iscsi_sess_t		*isp    = NULL;
       
   234 
       
   235 	ASSERT(icp != NULL);
       
   236 	ASSERT(icmdp != NULL);
       
   237 	isp = icp->conn_sess;
       
   238 	ASSERT(isp != NULL);
       
   239 	ASSERT(icmdp->cmd_type == ISCSI_CMD_TYPE_SCSI);
       
   240 	ASSERT(mutex_owned(&icp->conn_queue_idm_aborting.mutex));
       
   241 
       
   242 	icmdp->cmd_state = ISCSI_CMD_STATE_IDM_ABORTING;
       
   243 	icmdp->cmd_lbolt_idm_aborting = ddi_get_lbolt();
       
   244 	iscsi_enqueue_cmd_tail(&icp->conn_queue_idm_aborting.head,
       
   245 	    &icp->conn_queue_idm_aborting.tail, icmdp);
       
   246 	icp->conn_queue_idm_aborting.count++;
       
   247 }
       
   248 
       
   249 /*
       
   250  * iscsi_dequeue_idm_aborting_cmd - used to remove a command from the queue
       
   251  * representing commands waiting for a callback from IDM for aborting.
       
   252  */
       
   253 void
       
   254 iscsi_dequeue_idm_aborting_cmd(iscsi_conn_t *icp, iscsi_cmd_t *icmdp)
       
   255 {
       
   256 	iscsi_sess_t	*isp	= NULL;
       
   257 
       
   258 	ASSERT(icp != NULL);
       
   259 	ASSERT(icmdp != NULL);
       
   260 	isp = icp->conn_sess;
       
   261 	ASSERT(isp != NULL);
       
   262 	ASSERT(mutex_owned(&icp->conn_queue_idm_aborting.mutex));
       
   263 
       
   264 	(void) iscsi_dequeue_cmd(&icp->conn_queue_idm_aborting.head,
       
   265 	    &icp->conn_queue_idm_aborting.tail, icmdp);
       
   266 	icp->conn_queue_idm_aborting.count--;
   222 }
   267 }
   223 
   268 
   224 /*
   269 /*
   225  * iscsi_enqueue_completed_cmd - used to add a command in completion queue
   270  * iscsi_enqueue_completed_cmd - used to add a command in completion queue
   226  */
   271  */