Example #1
0
void
cam_devq_free(struct cam_devq *devq)
{
	camq_fini(&devq->alloc_queue);
	camq_fini(&devq->send_queue);
	free(devq, M_CAMDEVQ);
}
Example #2
0
/*
 * Free a camq structure.  This should only be called if a controller
 * driver failes somehow during its attach routine or is unloaded and has
 * obtained a camq structure.  The XPT should ensure that the queue
 * is empty before calling this routine.
 */
void
camq_free(struct camq *queue)
{
	if (queue != NULL) {
		camq_fini(queue);
		free(queue, M_CAMQ);
	}
}
Example #3
0
void
cam_devq_free(struct cam_devq *devq)
{

	camq_fini(&devq->send_queue);
	mtx_destroy(&devq->send_mtx);
	free(devq, M_CAMDEVQ);
}
Example #4
0
int
cam_devq_init(struct cam_devq *devq, int devices, int openings)
{
	bzero(devq, sizeof(*devq));
	if (camq_init(&devq->alloc_queue, devices) != 0) {
		return (1);
	}
	if (camq_init(&devq->send_queue, devices) != 0) {
		camq_fini(&devq->alloc_queue);
		return (1);
	}
	devq->alloc_openings = openings;
	devq->alloc_active = 0;
	devq->send_openings = openings;
	devq->send_active = 0;	
	return (0);	
}
Example #5
0
void
cam_ccbq_fini(struct cam_ccbq *ccbq)
{

	camq_fini(&ccbq->queue);
}