shutdown node VS disconnect all hooks
Gleb Smirnoff
glebius at cell.sick.ru
Fri May 28 14:56:49 GMT 2004
On Fri, May 28, 2004 at 06:31:18PM +0400, Roman Kurakin wrote:
R> >On Fri, May 28, 2004 at 05:50:21PM +0400, Roman Kurakin wrote:
R> >R> >Here is the first one - convert all ng_type initializers to C99 sparse
R> >R> >type.
R> >R> >
R> >R> Hey guys, it seems all of you forgot about device nodes :-)
R> >
R> >Which ones? Just point me and I'll send diffs. My fingers can already
R> >convert
R> >ng_type initializers to c99 without interaction with brain :)
R> >
R> /cronyx/CVSUP/FreeBSD-5x/src/sys > grep -R "\bng_type\b" * | grep -v
R> "^netgraph"
R> | grep -v "ctau" | grep -v "cp" | grep -v "cx"
Thanks. Why did you skip your own nodes?
R> dev/ar/if_ar.c:static struct ng_type typestruct = {
R> dev/musycc/musycc.c:static struct ng_type ngtypestruct = {
R> dev/sr/if_sr.c:static struct ng_type typestruct = {
R> dev/usb/udbp.c:Static struct ng_type ng_udbp_typestruct = {
R> i4b/driver/i4b_ing.c:static struct ng_type typestruct = {
R> pci/if_mn.c:static struct ng_type mntypestruct = {
here are the patches
--
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE
-------------- next part --------------
Index: if_ar.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ar/if_ar.c,v
retrieving revision 1.62
diff -u -r1.62 if_ar.c
--- if_ar.c 17 Mar 2004 17:50:26 -0000 1.62
+++ if_ar.c 28 May 2004 14:37:35 -0000
@@ -227,18 +227,15 @@
static ng_disconnect_t ngar_disconnect;
static struct ng_type typestruct = {
- NG_ABI_VERSION,
- NG_AR_NODE_TYPE,
- NULL,
- ngar_constructor,
- ngar_rcvmsg,
- ngar_shutdown,
- ngar_newhook,
- NULL,
- ngar_connect,
- ngar_rcvdata,
- ngar_disconnect,
- NULL
+ .version = NG_ABI_VERSION,
+ .name = NG_AR_NODE_TYPE,
+ .constructor = ngar_constructor,
+ .rcvmsg = ngar_rcvmsg,
+ .shutdown = ngar_shutdown,
+ .newhook = ngar_newhook,
+ .connect = ngar_connect,
+ .rcvdata = ngar_rcvdata,
+ .disconnect = ngar_disconnect,
};
static int ngar_done_init = 0;
-------------- next part --------------
Index: musycc.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/musycc/musycc.c,v
retrieving revision 1.31
diff -u -r1.31 musycc.c
--- musycc.c 17 Mar 2004 17:50:37 -0000 1.31
+++ musycc.c 28 May 2004 14:40:27 -0000
@@ -274,18 +274,15 @@
static ng_disconnect_t musycc_disconnect;
static struct ng_type ngtypestruct = {
- NG_ABI_VERSION,
- NG_NODETYPE,
- NULL,
- musycc_constructor,
- musycc_rcvmsg,
- musycc_shutdown,
- musycc_newhook,
- NULL,
- musycc_connect,
- musycc_rcvdata,
- musycc_disconnect,
- NULL
+ .version = NG_ABI_VERSION,
+ .name = NG_NODETYPE,
+ .constructor = musycc_constructor,
+ .rcvmsg = musycc_rcvmsg,
+ .shutdown = musycc_shutdown,
+ .newhook = musycc_newhook,
+ .connect = musycc_connect,
+ .rcvdata = musycc_rcvdata,
+ .disconnect = musycc_disconnect,
};
/*
-------------- next part --------------
Index: if_sr.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/sr/if_sr.c,v
retrieving revision 1.59
diff -u -r1.59 if_sr.c
--- if_sr.c 17 Mar 2004 17:50:44 -0000 1.59
+++ if_sr.c 28 May 2004 14:43:05 -0000
@@ -273,18 +273,15 @@
static ng_disconnect_t ngsr_disconnect;
static struct ng_type typestruct = {
- NG_ABI_VERSION,
- NG_SR_NODE_TYPE,
- NULL,
- ngsr_constructor,
- ngsr_rcvmsg,
- ngsr_shutdown,
- ngsr_newhook,
- NULL,
- ngsr_connect,
- ngsr_rcvdata,
- ngsr_disconnect,
- NULL
+ .version = NG_ABI_VERSION,
+ .name = NG_SR_NODE_TYPE,
+ .constructor = ngsr_constructor,
+ .rcvmsg = ngsr_rcvmsg,
+ .shutdown = ngsr_shutdown,
+ .newhook = ngsr_newhook,
+ .connect = ngsr_connect,
+ .rcvdata = ngsr_rcvdata,
+ .disconnect = ngsr_disconnect,
};
static int ngsr_done_init = 0;
-------------- next part --------------
Index: udbp.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/udbp.c,v
retrieving revision 1.24
diff -u -r1.24 udbp.c
--- udbp.c 24 Aug 2003 17:55:55 -0000 1.24
+++ udbp.c 28 May 2004 14:46:40 -0000
@@ -196,18 +196,16 @@
/* Netgraph node type descriptor */
Static struct ng_type ng_udbp_typestruct = {
- NG_ABI_VERSION,
- NG_UDBP_NODE_TYPE,
- NULL,
- ng_udbp_constructor,
- ng_udbp_rcvmsg,
- ng_udbp_rmnode,
- ng_udbp_newhook,
- NULL,
- ng_udbp_connect,
- ng_udbp_rcvdata,
- ng_udbp_disconnect,
- ng_udbp_cmdlist
+ .version = NG_ABI_VERSION,
+ .name = NG_UDBP_NODE_TYPE,
+ .constructor = ng_udbp_constructor,
+ .rcvmsg = ng_udbp_rcvmsg,
+ .shutdown = ng_udbp_rmnode,
+ .newhook = ng_udbp_newhook,
+ .connect = ng_udbp_connect,
+ .rcvdata = ng_udbp_rcvdata,
+ .disconnect = ng_udbp_disconnect,
+ .cmdlist = ng_udbp_cmdlist,
};
Static int udbp_setup_in_transfer (udbp_p sc);
-------------- next part --------------
Index: i4b_ing.c
===================================================================
RCS file: /home/ncvs/src/sys/i4b/driver/i4b_ing.c,v
retrieving revision 1.17
diff -u -r1.17 i4b_ing.c
--- i4b_ing.c 10 Jun 2003 23:14:55 -0000 1.17
+++ i4b_ing.c 28 May 2004 14:52:14 -0000
@@ -198,18 +198,16 @@
/* Netgraph node type descriptor */
static struct ng_type typestruct = {
- NG_ABI_VERSION,
- NG_ING_NODE_TYPE,
- NULL,
- ng_ing_constructor,
- ng_ing_rcvmsg,
- ng_ing_shutdown,
- ng_ing_newhook,
- NULL,
- ng_ing_connect,
- ng_ing_rcvdata,
- ng_ing_disconnect,
- ng_ing_cmdlist
+ .version = NG_ABI_VERSION,
+ .name = NG_ING_NODE_TYPE,
+ .constructor = ng_ing_constructor,
+ .rcvmsg = ng_ing_rcvmsg,
+ .shutdown = ng_ing_shutdown,
+ .newhook = ng_ing_newhook,
+ .connect = ng_ing_connect,
+ .rcvdata = ng_ing_rcvdata,
+ .disconnect = ng_ing_disconnect,
+ .cmdlist = ng_ing_cmdlist,
};
NETGRAPH_INIT_ORDERED(ing, &typestruct, SI_SUB_DRIVERS, SI_ORDER_ANY);
-------------- next part --------------
Index: if_mn.c
===================================================================
RCS file: /home/ncvs/src/sys/pci/if_mn.c,v
retrieving revision 1.41
diff -u -r1.41 if_mn.c
--- if_mn.c 17 Mar 2004 17:50:53 -0000 1.41
+++ if_mn.c 28 May 2004 14:55:35 -0000
@@ -189,18 +189,15 @@
static ng_disconnect_t ngmn_disconnect;
static struct ng_type mntypestruct = {
- NG_ABI_VERSION,
- NG_MN_NODE_TYPE,
- NULL,
- ngmn_constructor,
- ngmn_rcvmsg,
- ngmn_shutdown,
- ngmn_newhook,
- NULL,
- ngmn_connect,
- ngmn_rcvdata,
- ngmn_disconnect,
- NULL
+ .version = NG_ABI_VERSION,
+ .name = NG_MN_NODE_TYPE,
+ .constructor = ngmn_constructor,
+ .rcvmsg = ngmn_rcvmsg,
+ .shutdown = ngmn_shutdown,
+ .newhook = ngmn_newhook,
+ .connect = ngmn_connect,
+ .rcvdata = ngmn_rcvdata,
+ .disconnect = ngmn_disconnect,
};
static MALLOC_DEFINE(M_MN, "mn", "Mx driver related");
More information about the freebsd-net
mailing list