sys/netproto/atm/ipatm/ipatm_load.c
static int
ipatm_stop(void)
{
	struct ip_nif	*inp;
	int	err = 0, i;

	/*
	 * Any VCCs still open??
	 */
	crit_enter();
	if (ipatm_vccnt) {
		/* Yes, can't stop now */
		err = EBUSY;
		goto done;
	}

	/*
	 * Kill VCC idle timer
	 */
	atm_untimeout(&ipatm_itimer);

	/*
	 * Stop listening for incoming calls
	 */
	for (i = 0;
	     i < (sizeof(ipatm_listeners) / sizeof(struct ipatm_listener));
	     i++) {
		if (ipatm_listeners[i].conn != NULL) {
			atm_cm_release(ipatm_listeners[i].conn, &ipatm_cause);
		}
	}

	/*
	 * Detach all our interfaces
	 */
	while ((inp = ipatm_nif_head) != NULL) {
		ipatm_nifstat(NCM_DETACH, inp->inf_nif, 0);
	}
	
	/*
	 * De-register from system
	 */
	atm_netconv_deregister(&ipatm_ncm);
	atm_endpoint_deregister(&ipatm_endpt);

	/*
	 * Free up our storage pools
	 */
	atm_release_pool(&ipatm_vcpool);
	atm_release_pool(&ipatm_nifpool);

done:
	crit_exit();
	return (err);
}
/*
 * Halt ipatm processing 
 * 
 * This will be called just prior to unloading the module from
 * memory.  All IP VCCs must be terminated before the protocol can 
 * be shutdown.
 *
 * Arguments:
 *	none
 *
 * Returns:
 *	0 	shutdown was successful 
 *	errno	shutdown failed - reason indicated
 *
 */
Halt ipatm processing

This will be called just prior to unloading the module from
memory.  All IP VCCs must be terminated before the protocol can
be shutdown.

none

0       shutdown was successful
errno   shutdown failed - reason indicated
Halt ipatm processing This will be called just prior to unloading the module from memory . All IP VCCs must be terminated before the protocol can be shutdown . none 0 shutdown was successful errno shutdown failed - reason indicated
static int
ipatm_stop(void)
{
	struct ip_nif	*inp;
	int	err = 0, i;
	crit_enter();
	if (ipatm_vccnt) {
		err = EBUSY;
		goto done;
	}
	atm_untimeout(&ipatm_itimer);
	for (i = 0;
	     i < (sizeof(ipatm_listeners) / sizeof(struct ipatm_listener));
	     i++) {
		if (ipatm_listeners[i].conn != NULL) {
			atm_cm_release(ipatm_listeners[i].conn, &ipatm_cause);
		}
	}
	while ((inp = ipatm_nif_head) != NULL) {
		ipatm_nifstat(NCM_DETACH, inp->inf_nif, 0);
	}
	atm_netconv_deregister(&ipatm_ncm);
	atm_endpoint_deregister(&ipatm_endpt);
	atm_release_pool(&ipatm_vcpool);
	atm_release_pool(&ipatm_nifpool);
done:
	crit_exit();
	return (err);
}
static int ipatm_stop ( void ) { struct ip_nif * inp ; int err = 0 , i ; crit_enter ( ) ; if ( ipatm_vccnt ) { err = EBUSY ; goto done ; } atm_untimeout ( & ipatm_itimer ) ; for ( i = 0 ; i < ( sizeof ( ipatm_listeners ) / sizeof ( struct ipatm_listener ) ) ; i ++ ) { if ( ipatm_listeners [ i ] . conn != NULL ) { atm_cm_release ( ipatm_listeners [ i ] . conn , & ipatm_cause ) ; } } while ( ( inp = ipatm_nif_head ) != NULL ) { ipatm_nifstat ( NCM_DETACH , inp -> inf_nif , 0 ) ; } atm_netconv_deregister ( & ipatm_ncm ) ; atm_endpoint_deregister ( & ipatm_endpt ) ; atm_release_pool ( & ipatm_vcpool ) ; atm_release_pool ( & ipatm_nifpool ) ; done : crit_exit ( ) ; return ( err ) ; }
Halt ipatm processing
Halt ipatm processing
/*
	 * Any VCCs still open??
	 */ /* Yes, can't stop now */ /*
	 * Kill VCC idle timer
	 */ /*
	 * Stop listening for incoming calls
	 */ /*
	 * Detach all our interfaces
	 */ /*
	 * De-register from system
	 */ /*
	 * Free up our storage pools
	 */