sys/netgraph7/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c
static int
ubtbcmfw_poll(struct cdev *dev, int events, struct thread *p)
{
	ubtbcmfw_softc_p	sc = NULL;
	int			revents = 0;

	sc = devclass_get_softc(ubtbcmfw_devclass, UBTBCMFW_UNIT(dev));
	if (sc == NULL)
		return (ENXIO);

	switch (UBTBCMFW_ENDPOINT(dev)) {
	case UBTBCMFW_INTR_IN:
		if (sc->sc_intr_in_pipe != NULL)
			revents |= events & (POLLIN | POLLRDNORM);
		else
			revents = ENXIO;
		break;

	case UBTBCMFW_BULK_OUT:
		if (sc->sc_bulk_out_pipe != NULL)
			revents |= events & (POLLOUT | POLLWRNORM);
		else
			revents = ENXIO;
		break;

	default:
		revents = EOPNOTSUPP;
		break;
	}

	return (revents);
}
/*
 * Poll the endpoint device
 * XXX FIXME softc locking
 */
Poll the endpoint device
XXX FIXME softc locking
Poll the endpoint device XXX FIXME softc locking
static int
ubtbcmfw_poll(struct cdev *dev, int events, struct thread *p)
{
	ubtbcmfw_softc_p	sc = NULL;
	int			revents = 0;
	sc = devclass_get_softc(ubtbcmfw_devclass, UBTBCMFW_UNIT(dev));
	if (sc == NULL)
		return (ENXIO);
	switch (UBTBCMFW_ENDPOINT(dev)) {
	case UBTBCMFW_INTR_IN:
		if (sc->sc_intr_in_pipe != NULL)
			revents |= events & (POLLIN | POLLRDNORM);
		else
			revents = ENXIO;
		break;
	case UBTBCMFW_BULK_OUT:
		if (sc->sc_bulk_out_pipe != NULL)
			revents |= events & (POLLOUT | POLLWRNORM);
		else
			revents = ENXIO;
		break;
	default:
		revents = EOPNOTSUPP;
		break;
	}
	return (revents);
}
static int ubtbcmfw_poll ( struct cdev * dev , int events , struct thread * p ) { ubtbcmfw_softc_p sc = NULL ; int revents = 0 ; sc = devclass_get_softc ( ubtbcmfw_devclass , UBTBCMFW_UNIT ( dev ) ) ; if ( sc == NULL ) return ( ENXIO ) ; switch ( UBTBCMFW_ENDPOINT ( dev ) ) { case UBTBCMFW_INTR_IN : if ( sc -> sc_intr_in_pipe != NULL ) revents |= events & ( POLLIN | POLLRDNORM ) ; else revents = ENXIO ; break ; case UBTBCMFW_BULK_OUT : if ( sc -> sc_bulk_out_pipe != NULL ) revents |= events & ( POLLOUT | POLLWRNORM ) ; else revents = ENXIO ; break ; default : revents = EOPNOTSUPP ; break ; } return ( revents ) ; }
Poll the endpoint device
 XXX FIXME softc locking
Poll the endpoint device XXX FIXME softc locking