FreeBSD/sys/dev/twe/twe_freebsd.c
/********************************************************************************
 * Bring the controller down to a dormant state and detach all child devices.
 *
 * Note that we can assume that the bioq on the controller is empty, as we won't
 * allow shutdown if any device is open.
 */
Bring the controller down to a dormant state and detach all child devices.
Note that we can assume that the bioq on the controller is empty, as we won't
allow shutdown if any device is open.
Bring the controller down to a dormant state and detach all child devices . Note that we can assume that the bioq on the controller is empty as we won ' t allow shutdown if any device is open .
static int
twe_shutdown(device_t dev)
{
    struct twe_softc	*sc = device_get_softc(dev);
    int			i, error = 0;
    debug_called(4);
    TWE_CONFIG_LOCK(sc);
    for (i = 0; i < TWE_MAX_UNITS; i++) {
	if (sc->twe_drive[i].td_disk != 0) {
	    if ((error = twe_detach_drive(sc, i)) != 0) {
		TWE_CONFIG_UNLOCK(sc);
		return (error);
	    }
	}
    }
    TWE_CONFIG_UNLOCK(sc);
    TWE_IO_LOCK(sc);
    twe_deinit(sc);
    TWE_IO_UNLOCK(sc);
    return(0);
}
static int twe_shutdown ( device_t dev ) { struct twe_softc * sc = device_get_softc ( dev ) ; int i , error = 0 ; debug_called ( 4 ) ; TWE_CONFIG_LOCK ( sc ) ; for ( i = 0 ; i < TWE_MAX_UNITS ; i ++ ) { if ( sc -> twe_drive [ i ] . td_disk != 0 ) { if ( ( error = twe_detach_drive ( sc , i ) ) != 0 ) { TWE_CONFIG_UNLOCK ( sc ) ; return ( error ) ; } } } TWE_CONFIG_UNLOCK ( sc ) ; TWE_IO_LOCK ( sc ) ; twe_deinit ( sc ) ; TWE_IO_UNLOCK ( sc ) ; return ( 0 ) ; }
Bring the controller down to a dormant state and detach all child devices.
Bring the controller down to a dormant state and detach all child devices .
/* 
     * Delete all our child devices.
     */ /*
     * Bring the controller down.
     */