diff options
Diffstat (limited to 'sys/netatm')
-rw-r--r-- | sys/netatm/atm_device.c | 9 | ||||
-rw-r--r-- | sys/netatm/atm_if.c | 23 | ||||
-rw-r--r-- | sys/netatm/atm_if.h | 7 | ||||
-rw-r--r-- | sys/netatm/atm_var.h | 2 |
4 files changed, 22 insertions, 19 deletions
diff --git a/sys/netatm/atm_device.c b/sys/netatm/atm_device.c index 31c9e6a..4834afc 100644 --- a/sys/netatm/atm_device.c +++ b/sys/netatm/atm_device.c @@ -170,8 +170,9 @@ atm_dev_inst(ssp, cvcp) /* * Allocate a VCC control block */ - if ( ( cvp = (Cmn_vcc *)atm_allocate(cup->cu_vcc_pool) ) == NULL ) - return ( ENOMEM ); + cvp = uma_zalloc(cup->cu_vcc_zone, M_WAITOK); + if (cvp == NULL) + return (ENOMEM); cvp->cv_state = CVS_INST; cvp->cv_toku = (*ssp)->sd_toku; @@ -183,7 +184,7 @@ atm_dev_inst(ssp, cvcp) */ err = (*cup->cu_instvcc)(cup, cvp); if (err) { - atm_free((caddr_t)cvp); + uma_zfree(cup->cu_vcc_zone, cvp); return (err); } @@ -351,7 +352,7 @@ atm_dev_lower(cmd, tok, arg1, arg2) /* * Free VCC resources */ - (void) atm_free((caddr_t)cvp); + uma_zfree(cup->cu_vcc_zone, cvp); break; } diff --git a/sys/netatm/atm_if.c b/sys/netatm/atm_if.c index 4f1b6a9..7b8a116 100644 --- a/sys/netatm/atm_if.c +++ b/sys/netatm/atm_if.c @@ -214,14 +214,14 @@ atm_physif_deregister(cup) /* * Free all of our network interfaces */ - atm_physif_freenifs(pip); + atm_physif_freenifs(pip, cup->cu_nif_zone); /* * Free unit's vcc information */ cvp = cup->cu_vcc; while (cvp) { - atm_free(cvp); + uma_zfree(cup->cu_vcc_zone, cvp); cvp = cvp->cv_next; } cup->cu_vcc = (Cmn_vcc *)NULL; @@ -243,8 +243,9 @@ atm_physif_deregister(cup) * */ void -atm_physif_freenifs(pip) +atm_physif_freenifs(pip, zone) struct atm_pif *pip; + uma_zone_t zone; { struct atm_nif *nip = pip->pif_nif; int s = splnet(); @@ -260,8 +261,8 @@ atm_physif_freenifs(pip) /* * Clean up network i/f trails */ - atm_nif_detach ( nip ); - atm_free ((caddr_t)nip); + atm_nif_detach(nip); + uma_zfree(zone, nip); nip = nipp; } pip->pif_nif = (struct atm_nif *)NULL; @@ -271,7 +272,6 @@ atm_physif_freenifs(pip) return; } - /* * Handle physical interface ioctl's * @@ -488,20 +488,20 @@ atm_physif_ioctl(code, data, arg) /* * Free any previously allocated NIFs */ - atm_physif_freenifs(pip); + atm_physif_freenifs(pip, cup->cu_nif_zone); /* * Add list of interfaces */ for ( count = 0; count < asr->asr_nif_cnt; count++ ) { - nip = (struct atm_nif *)atm_allocate(cup->cu_nif_pool); + nip = uma_zalloc(cup->cu_nif_zone, M_WAITOK | M_ZERO); if ( nip == NULL ) { /* * Destroy any successful nifs */ - atm_physif_freenifs(pip); + atm_physif_freenifs(pip, cup->cu_nif_zone); err = ENOMEM; break; } @@ -540,12 +540,11 @@ atm_physif_ioctl(code, data, arg) break; } if ((err = atm_nif_attach(nip)) != 0) { - atm_free ( (caddr_t)nip ); - + uma_zfree(cup->cu_nif_zone, nip); /* * Destroy any successful nifs */ - atm_physif_freenifs(pip); + atm_physif_freenifs(pip, cup->cu_nif_zone); break; } /* diff --git a/sys/netatm/atm_if.h b/sys/netatm/atm_if.h index 90b3bde..2976162 100644 --- a/sys/netatm/atm_if.h +++ b/sys/netatm/atm_if.h @@ -148,6 +148,9 @@ typedef struct atm_config Atm_config; #ifdef _KERNEL + +#include <vm/uma.h> + /* * Common structure used to define each physical ATM device interface. * This structure will (normally) be embedded at the top of each driver's @@ -261,8 +264,8 @@ struct cmn_unit { u_int cu_intrpri; /* Highest unit interrupt priority */ int cu_savepri; /* Saved priority for locking device */ - struct sp_info *cu_vcc_pool; /* Device VCC pool */ - struct sp_info *cu_nif_pool; /* Device NIF pool */ + uma_zone_t cu_vcc_zone; /* Device VCC zone */ + uma_zone_t cu_nif_zone; /* Device NIF zone */ int (*cu_ioctl) /* Interface ioctl handler */ (int, caddr_t, caddr_t); diff --git a/sys/netatm/atm_var.h b/sys/netatm/atm_var.h index 5bbfabc..721b164 100644 --- a/sys/netatm/atm_var.h +++ b/sys/netatm/atm_var.h @@ -117,7 +117,7 @@ void atm_dev_pdu_print(Cmn_unit *, Cmn_vcc *, KBuffer *, char *); int atm_physif_register(Cmn_unit *, char *, struct stack_defn *); int atm_physif_deregister(Cmn_unit *); -void atm_physif_freenifs(struct atm_pif *); +void atm_physif_freenifs(struct atm_pif *, uma_zone_t); int atm_netconv_register(struct atm_ncm *); int atm_netconv_deregister(struct atm_ncm *); int atm_nif_attach(struct atm_nif *); |