/* This routine removes and returns the srb at the specified index  */
struct srb* qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t index)
/* This routine removes and returns the srb at the specified index  */
struct srb* qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t index)
{
	struct srb *srb = NULL;
	struct scsi_cmnd *cmd;
	if (!(cmd = scsi_host_find_tag(ha->host, index)))
		return srb;
	if (!(srb = (struct srb *)cmd->host_scribble))
		return srb;
	if (srb->flags & SRB_DMA_VALID) {
		ha->req_q_count += srb->iocb_cnt;
		ha->iocb_cnt -= srb->iocb_cnt;
		if (srb->cmd)
			srb->cmd->host_scribble = NULL;
	}
	return srb;
}