/* * Process module unloading notification * * Called whenever the uni module is about to be unloaded. All signalling * instances will have been previously detached. All uniarp resources * must be freed now. * * Arguments: * none * * Returns: * none * */ void uniarp_stop() { int i; /* * Make sure the arp table is empty */ for (i = 0; i < UNIARP_HASHSIZ; i++) { if (uniarp_arptab[i] != NULL) panic("uniarp_stop: arp table not empty"); } /* * Cancel timers */ (void) atm_untimeout(&uniarp_timer); /* * De-register ourselves */ (void) atm_endpoint_deregister(&uniarp_endpt); /* * Free our storage pools */ uma_zdestroy(uniarp_zone); }
/* * Process IP Network Interface Deactivation * * Called whenever an IP network interface becomes inactive. * * Called from a critical section. * * Arguments: * clp pointer to CLS interface * * Returns: * none * */ void spansarp_ipdact(struct spanscls *clp) { struct spanscls *clp2; struct spansarp *sap, *snext; int i; /* * Delete all interface entries */ for (i = 0; i < SPANSARP_HASHSIZ; i++) { for (sap = spansarp_arptab[i]; sap; sap = snext) { snext = sap->sa_next; /* * Clean up entries for this interface */ if (sap->sa_cls != clp) continue; /* * All VCCs better be gone by now */ if (sap->sa_ivp) panic("spansarp_ipdact: entry not empty"); /* * Remove entry from the retry chain */ UNLINK(sap, struct spansarp, spansarp_retry_head, sa_rnext); /* * Delete entry from arp table */ SPANSARP_DELETE(sap); atm_free((caddr_t)sap); } } /* * Stop aging timer if this is the last active interface */ for (clp2 = spanscls_head; clp2; clp2 = clp2->cls_next) { if ((clp != clp2) && (clp2->cls_ipnif)) break; } if (clp2 == NULL) atm_untimeout(&spansarp_timer); }
/* * Process module unloading notification * * Called whenever the spans module is about to be unloaded. All signalling * instances will have been previously detached. All spansarp resources * must be freed now. * * Arguments: * none * * Returns: * none * */ void spansarp_stop(void) { int i; /* * Make sure the arp table is empty */ for (i = 0; i < SPANSARP_HASHSIZ; i++) { if (spansarp_arptab[i] != NULL) panic("spansarp_stop: arp table not empty"); } /* * Cancel timers */ atm_untimeout(&spansarp_timer); atm_untimeout(&spansarp_rtimer); /* * Free our storage pools */ atm_release_pool(&spansarp_pool); }
/* * Halt driver processing * * This will be called just prior to unloading the module from memory. * Everything we've setup since we've been loaded must be undone here. * * Arguments: * none * * Returns: * 0 shutdown was successful * errno shutdown failed - reason indicated * */ static int fore_stop() { int err = 0; int s = splimp(); int i; /* * Stop the watchdog timer */ (void) atm_untimeout(&fore_timer); /* * Clean up each device (if any) */ for ( i = 0; i < fore_nunits; i++ ) { Fore_unit *fup = fore_units[i]; if (fup == NULL) continue; /* * Deregister device from kernel services */ if (err = atm_physif_deregister((Cmn_unit *)fup)) { (void) splx(s); return (err); } /* * Unattach the device from the system */ fore_unattach(fup); /* * Free any Fore-specific device resources */ fore_interface_free(fup); /* * Free the unit structure */ atm_dev_free(fup); fore_units[i] = NULL; } fore_nunits = 0; /* * Now free our global resources */ /* * Release our storage pools */ atm_release_pool(&fore_vcc_pool); atm_release_pool(&fore_nif_pool); /* * Release all DMA mappings */ DMA_RELEASE(); fore_inited = 0; (void) splx(s); return (0); }