summaryrefslogtreecommitdiffstats
path: root/sys/net/if_enc.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-10-16 13:37:54 +0000
committerglebius <glebius@FreeBSD.org>2012-10-16 13:37:54 +0000
commit05f24a6b77a43334f14f31cd33a4f3e34a418ea2 (patch)
tree0f54a9446bfe2083d3c0a3f744318b2be8a0db05 /sys/net/if_enc.c
parent745884b065065ffc8847d3ea463bf751ffcaf863 (diff)
downloadFreeBSD-src-05f24a6b77a43334f14f31cd33a4f3e34a418ea2.zip
FreeBSD-src-05f24a6b77a43334f14f31cd33a4f3e34a418ea2.tar.gz
Make the "struct if_clone" opaque to users of the cloning API. Users
now use function calls: if_clone_simple() if_clone_advanced() to initialize a cloner, instead of macros that initialize if_clone structure. Discussed with: brooks, bz, 1 year ago
Diffstat (limited to 'sys/net/if_enc.c')
-rw-r--r--sys/net/if_enc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c
index efd3fc7..ecc2415 100644
--- a/sys/net/if_enc.c
+++ b/sys/net/if_enc.c
@@ -91,8 +91,8 @@ static int enc_output(struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, struct route *ro);
static int enc_clone_create(struct if_clone *, int, caddr_t);
static void enc_clone_destroy(struct ifnet *);
-
-IFC_SIMPLE_DECLARE(enc, 1);
+static struct if_clone *enc_cloner;
+static const char encname[] = "enc";
/*
* Sysctls.
@@ -143,7 +143,7 @@ enc_clone_create(struct if_clone *ifc, int unit, caddr_t params)
return (ENOSPC);
}
- if_initname(ifp, ifc->ifc_name, unit);
+ if_initname(ifp, encname, unit);
ifp->if_mtu = ENCMTU;
ifp->if_ioctl = enc_ioctl;
ifp->if_output = enc_output;
@@ -167,7 +167,8 @@ enc_modevent(module_t mod, int type, void *data)
switch (type) {
case MOD_LOAD:
mtx_init(&enc_mtx, "enc mtx", NULL, MTX_DEF);
- if_clone_attach(&enc_cloner);
+ enc_cloner = if_clone_simple(encname, enc_clone_create,
+ enc_clone_destroy, 0);
break;
case MOD_UNLOAD:
printf("enc module unload - not possible for this module\n");
OpenPOWER on IntegriCloud