summaryrefslogtreecommitdiffstats
path: root/sys/dev/hea
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/hea')
-rw-r--r--sys/dev/hea/eni.c4
-rw-r--r--sys/dev/hea/eni.h4
-rw-r--r--sys/dev/hea/eni_globals.c18
-rw-r--r--sys/dev/hea/eni_var.h4
-rw-r--r--sys/dev/hea/hea_freebsd.c19
5 files changed, 27 insertions, 22 deletions
diff --git a/sys/dev/hea/eni.c b/sys/dev/hea/eni.c
index 269f376..ae3ae89 100644
--- a/sys/dev/hea/eni.c
+++ b/sys/dev/hea/eni.c
@@ -415,8 +415,8 @@ eni_pci_attach ( pcici_t config_id, int unit )
eup->eu_openvcc = eni_openvcc;
eup->eu_closevcc = eni_closevcc;
eup->eu_output = eni_output;
- 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;
/*
* Enable Memory Mapping / Bus Mastering
diff --git a/sys/dev/hea/eni.h b/sys/dev/hea/eni.h
index 3d4b485..dde8788 100644
--- a/sys/dev/hea/eni.h
+++ b/sys/dev/hea/eni.h
@@ -491,8 +491,8 @@ typedef struct eni_unit Eni_unit;
#define eu_mtu eu_cmn.cu_mtu
#define eu_open_vcc eu_cmn.cu_open_vcc
#define eu_vcc eu_cmn.cu_vcc
-#define eu_vcc_pool eu_cmn.cu_vcc_pool
-#define eu_nif_pool eu_cmn.cu_nif_pool
+#define eu_vcc_zone eu_cmn.cu_vcc_zone
+#define eu_nif_zone eu_cmn.cu_nif_zone
#define eu_ioctl eu_cmn.cu_ioctl
#define eu_instvcc eu_cmn.cu_instvcc
#define eu_openvcc eu_cmn.cu_openvcc
diff --git a/sys/dev/hea/eni_globals.c b/sys/dev/hea/eni_globals.c
index d558bb5..4586ff5 100644
--- a/sys/dev/hea/eni_globals.c
+++ b/sys/dev/hea/eni_globals.c
@@ -53,6 +53,8 @@
#include <dev/hea/eni_stats.h>
#include <dev/hea/eni.h>
+#include <vm/uma.h>
+
#ifndef lint
__RCSID("@(#) $FreeBSD$");
#endif
@@ -98,17 +100,5 @@ struct stack_defn *eni_services = &eni_svaal0;
/*
* Storage pools
*/
-struct sp_info eni_nif_pool = {
- "eni nif pool", /* si_name */
- sizeof(struct atm_nif), /* si_blksiz */
- 5, /* si_blkcnt */
- 52 /* si_maxallow */
-};
-
-struct sp_info eni_vcc_pool = {
- "eni vcc pool", /* si_name */
- sizeof(Eni_vcc), /* si_blksiz */
- 10, /* si_blkcnt */
- 100 /* si_maxallow */
-};
-
+uma_zone_t eni_nif_zone;
+uma_zone_t eni_vcc_zone;
diff --git a/sys/dev/hea/eni_var.h b/sys/dev/hea/eni_var.h
index 248807a..cac3ca7 100644
--- a/sys/dev/hea/eni_var.h
+++ b/sys/dev/hea/eni_var.h
@@ -79,7 +79,7 @@ int eni_closevcc(Cmn_unit *, Cmn_vcc *);
*/
extern Eni_unit *eni_units[];
extern struct stack_defn *eni_services;
-extern struct sp_info eni_nif_pool;
-extern struct sp_info eni_vcc_pool;
+extern uma_zone_t eni_nif_zone;
+extern uma_zone_t eni_vcc_zone;
#endif /* _ENI_ENI_VAR_H */
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