summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_device.h
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2004-10-18 20:13:57 +0000
committerglebius <glebius@FreeBSD.org>2004-10-18 20:13:57 +0000
commit3c69856ec59055937844e49a3b20699d15b2bdfc (patch)
tree8c0ce186ab50c929b13a350edcdc8adfa4becefd /sys/netgraph/ng_device.h
parent7b853afb002723c73c5121562d0e6da52a480cc5 (diff)
downloadFreeBSD-src-3c69856ec59055937844e49a3b20699d15b2bdfc.zip
FreeBSD-src-3c69856ec59055937844e49a3b20699d15b2bdfc.tar.gz
Major overhaul.
List of functional changes: - Make a single device per single node with a single hook. This gives us parrallelizm, which can't be achieved on a single node with many devices/hooks. This also gives us flexibility - we can play with a particular device node, not affecting others. - Remove read queue as it is. Use struct ifqueue instead. This change removes a lot of extra memcpy()ing, m_devget()ting and m_copymem()ming. In ng_device_receivedata() we enqueue an mbuf and wake readers. In ngdread() we take one mbuf from qeueue and uiomove() it to userspace. If no mbuf is present we optionally block. [1] - In ngdwrite() we create an mbuf from uio using m_uiotombuf(). This is faster then uiomove() into buffer, and then m_copydata(), and this is much better than huge m_pullup(). - Perform locking of device - Perform locking of connection list. - Clear out _rcvmsg method, since it does nothing good yet. - Implement NGM_DEVICE_GET_DEVNAME message. - #if 0 ioctl method, while nothing is done here yet. - Return immediately from ngdwrite() if uio_resid == 0. List of tidyness changes: - Introduce device2priv(), to remove cut'n'paste. - Use MALLOC/FREE, instead of malloc/free. - Use unit2minor(). - Use UID_ROOT/GID_WHEEL instead of 0/0. - Define NGD_DEVICE_DEVNAME, use it. - Use more nice macros for debugging. [2] - Return Exxx, not -1. style(9) changes: - No "#endif" after short block. - Break long lines. - Remove extra spaces, add needed spaces. [1] Obtained from: if_tun.c [2] Obtained from: ng_pppoe.c Reviewed by: marks Approved by: julian (mentor) MFC after: 1 month
Diffstat (limited to 'sys/netgraph/ng_device.h')
-rw-r--r--sys/netgraph/ng_device.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/netgraph/ng_device.h b/sys/netgraph/ng_device.h
index 5596134..9f33369 100644
--- a/sys/netgraph/ng_device.h
+++ b/sys/netgraph/ng_device.h
@@ -31,12 +31,19 @@
/* Node type name and magic cookie */
#define NG_DEVICE_NODE_TYPE "device"
-#define NGM_DEVICE_COOKIE 1009920473
+#define NGM_DEVICE_COOKIE 1091129178
+#define NG_DEVICE_DEVNAME "ngd"
+/* Netgraph control messages */
+enum {
+ NGM_DEVICE_GET_DEVNAME,
+};
+
+#if 0
/* passing ioctl params */
struct ngd_param_s {
void * p;
};
-
+#endif
#endif /* _NETGRAPH_NG_DEVICE_H_ */
OpenPOWER on IntegriCloud