FreeBSD/sys/dev/ipmi/ipmi.c
/*
 * Helper routine for polled system interfaces that use
 * ipmi_polled_enqueue_request() to queue requests.  This request
 * waits until there is a pending request and then returns the first
 * request.  If the driver is shutting down, it returns NULL.
 */
Helper routine for polled system interfaces that use
ipmi_polled_enqueue_request() to queue requests.  This request
waits until there is a pending request and then returns the first
request.  If the driver is shutting down, it returns NULL.
Helper routine for polled system interfaces that use ipmi_polled_enqueue_request () to queue requests . This request waits until there is a pending request and then returns the first request . If the driver is shutting down it returns NULL .
struct ipmi_request *
ipmi_dequeue_request(struct ipmi_softc *sc)
{
	struct ipmi_request *req;
	IPMI_LOCK_ASSERT(sc);
	while (!sc->ipmi_detaching && TAILQ_EMPTY(&sc->ipmi_pending_requests))
		cv_wait(&sc->ipmi_request_added, &sc->ipmi_requests_lock);
	if (sc->ipmi_detaching)
		return (NULL);
	req = TAILQ_FIRST(&sc->ipmi_pending_requests);
	TAILQ_REMOVE(&sc->ipmi_pending_requests, req, ir_link);
	return (req);
}
struct ipmi_request * ipmi_dequeue_request ( struct ipmi_softc * sc ) { struct ipmi_request * req ; IPMI_LOCK_ASSERT ( sc ) ; while ( ! sc -> ipmi_detaching && TAILQ_EMPTY ( & sc -> ipmi_pending_requests ) ) cv_wait ( & sc -> ipmi_request_added , & sc -> ipmi_requests_lock ) ; if ( sc -> ipmi_detaching ) return ( NULL ) ; req = TAILQ_FIRST ( & sc -> ipmi_pending_requests ) ; TAILQ_REMOVE ( & sc -> ipmi_pending_requests , req , ir_link ) ; return ( req ) ; }
Helper routine for polled system interfaces that use
 ipmi_polled_enqueue_request() to queue requests.
Helper routine for polled system interfaces that use ipmi_polled_enqueue_request () to queue requests .