summaryrefslogtreecommitdiffstats
path: root/sys/dev/hea/hea_freebsd.c
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2002-06-14 16:59:38 +0000
committerarr <arr@FreeBSD.org>2002-06-14 16:59:38 +0000
commitddf3317becaf1f927336e43f96f900868c8d0a80 (patch)
treef5a02eaff404955298bf324f2af9ffc25b5473bc /sys/dev/hea/hea_freebsd.c
parent1fa61e7038c01fdffbb282d50c1dd03ea22c4622 (diff)
downloadFreeBSD-src-ddf3317becaf1f927336e43f96f900868c8d0a80.zip
FreeBSD-src-ddf3317becaf1f927336e43f96f900868c8d0a80.tar.gz
- Turn the hea and hfa HARP storage pools into UMA zones and insert
the necesary uma_zcreate() and uma_zdestroy calls into module loading handler and the device attach handling. - Change the related HARP netatm code to use UMA zone functions when dealing with the zones that were formerly the ATM interface (hea, hfa) storage pools. - Have atm_physif_freenifs() now get passed an uma_zone_t so that we can properly free the allocated NIF's back to their zone. This should be the last commit to remove any code that makes use of the netatm storage pool api. I will be removing the api code within the near future. Reviewed by: mdodd
Diffstat (limited to 'sys/dev/hea/hea_freebsd.c')
-rw-r--r--sys/dev/hea/hea_freebsd.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/hea/hea_freebsd.c b/sys/dev/hea/hea_freebsd.c
index 7499401..08b9e75 100644
--- a/sys/dev/hea/hea_freebsd.c
+++ b/sys/dev/hea/hea_freebsd.c
@@ -158,13 +158,25 @@ hea_attach (device_t dev)
eup = &sc->eup;
error = 0;
+ eni_vcc_zone = uma_zcreate("eni vcc", sizeof(Eni_vcc), NULL,
+ NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
+ if (eni_vcc_zone == NULL)
+ panic("hea_attach: uma_zcreate vcc");
+ uma_zone_set_max(eni_vcc_zone, 100);
+
+ eni_nif_zone = uma_zcreate("eni nif", sizeof(struct atm_nif), NULL,
+ NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
+ if (eni_nif_zone == NULL)
+ panic("hea_attach: uma_zcreate nif");
+ uma_zone_set_max(eni_nif_zone, 52);
+
/*
* Start initializing it
*/
eup->eu_unit = device_get_unit(dev);
eup->eu_mtu = ENI_IFF_MTU;
- eup->eu_vcc_pool = &eni_vcc_pool;
- eup->eu_nif_pool = &eni_nif_pool;
+ eup->eu_vcc_zone = eni_vcc_zone;
+ eup->eu_nif_zone = eni_nif_zone;
eup->eu_ioctl = eni_atm_ioctl;
eup->eu_instvcc = eni_instvcc;
eup->eu_openvcc = eni_openvcc;
@@ -329,6 +341,9 @@ hea_detach (device_t dev)
hea_free(dev);
+ uma_zdestroy(eni_vcc_zone);
+ uma_zdestroy(eni_nif_zone);
+
return (error);
}
OpenPOWER on IntegriCloud