FreeBSD/sys/dev/twe/twe_freebsd.c
/********************************************************************************
 * Accept an open operation on the control device.
 */
Accept an open operation on the control device.
Accept an open operation on the control device .
static int
twe_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
    struct twe_softc		*sc = (struct twe_softc *)dev->si_drv1;
    TWE_IO_LOCK(sc);
    if (sc->twe_state & TWE_STATE_DETACHING) {
	TWE_IO_UNLOCK(sc);
	return (ENXIO);
    }
    sc->twe_state |= TWE_STATE_OPEN;
    TWE_IO_UNLOCK(sc);
    return(0);
}
static int twe_open ( struct cdev * dev , int flags , int fmt , struct thread * td ) { struct twe_softc * sc = ( struct twe_softc * ) dev -> si_drv1 ; TWE_IO_LOCK ( sc ) ; if ( sc -> twe_state & TWE_STATE_DETACHING ) { TWE_IO_UNLOCK ( sc ) ; return ( ENXIO ) ; } sc -> twe_state |= TWE_STATE_OPEN ; TWE_IO_UNLOCK ( sc ) ; return ( 0 ) ; }
Accept an open operation on the control device.
Accept an open operation on the control device .