FreeBSD/sys/dev/tws/tws.c
/*
 * In the cdevsw routines, we find our softc by using the si_drv1 member
 * of struct cdev.  We set this variable to point to our softc in our
 * attach routine when we create the /dev entry.
 */
In the cdevsw routines, we find our softc by using the si_drv1 member
of struct cdev.  We set this variable to point to our softc in our
attach routine when we create the /dev entry.
In the cdevsw routines we find our softc by using the si_drv1 member of struct cdev . We set this variable to point to our softc in our attach routine when we create the / dev entry .
int
tws_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
    struct tws_softc *sc = dev->si_drv1;
    if ( sc ) 
        TWS_TRACE_DEBUG(sc, "entry", dev, oflags);
    return (0);
}
int tws_open ( struct cdev * dev , int oflags , int devtype , struct thread * td ) { struct tws_softc * sc = dev -> si_drv1 ; if ( sc ) TWS_TRACE_DEBUG ( sc , " " , dev , oflags ) ; return ( 0 ) ; }
In the cdevsw routines, we find our softc by using the si_drv1 member
 of struct cdev.
In the cdevsw routines we find our softc by using the si_drv1 member of struct cdev .