FreeBSD/sys/dev/mrsas/mrsas.c
/*
 * mrsas_poll:	poll entry point for mrsas driver fd
 *
 * This function is the entry point for poll from the OS.  It waits for some AEN
 * events to be triggered from the controller and notifies back.
 */
poll entry point for mrsas driver fd
This function is the entry point for poll from the OS.  It waits for some AEN
events to be triggered from the controller and notifies back.
poll entry point for mrsas driver fd This function is the entry point for poll from the OS . It waits for some AEN events to be triggered from the controller and notifies back .
static int
mrsas_poll(struct cdev *dev, int poll_events, struct thread *td)
{
	struct mrsas_softc *sc;
	int revents = 0;
	sc = dev->si_drv1;
	if (poll_events & (POLLIN | POLLRDNORM)) {
		if (sc->mrsas_aen_triggered) {
			revents |= poll_events & (POLLIN | POLLRDNORM);
		}
	}
	if (revents == 0) {
		if (poll_events & (POLLIN | POLLRDNORM)) {
			mtx_lock(&sc->aen_lock);
			sc->mrsas_poll_waiting = 1;
			selrecord(td, &sc->mrsas_select);
			mtx_unlock(&sc->aen_lock);
		}
	}
	return revents;
}
static int mrsas_poll ( struct cdev * dev , int poll_events , struct thread * td ) { struct mrsas_softc * sc ; int revents = 0 ; sc = dev -> si_drv1 ; if ( poll_events & ( POLLIN | POLLRDNORM ) ) { if ( sc -> mrsas_aen_triggered ) { revents |= poll_events & ( POLLIN | POLLRDNORM ) ; } } if ( revents == 0 ) { if ( poll_events & ( POLLIN | POLLRDNORM ) ) { mtx_lock ( & sc -> aen_lock ) ; sc -> mrsas_poll_waiting = 1 ; selrecord ( td , & sc -> mrsas_select ) ; mtx_unlock ( & sc -> aen_lock ) ; } } return revents ; }
mrsas_poll:  poll entry point for mrsas driver fd
 This function is the entry point for poll from the OS.
mrsas_poll : poll entry point for mrsas driver fd This function is the entry point for poll from the OS .