net: move procfs code to net/core/net-procfs.c
Subsystems (2)
PATCH 1/1 net: move procfs code to net/core/net-procfs.c
From: Cong Wang <[email protected]>
Similar to net/core/net-sysfs.c, group procfs code to a single unit.
Cc "David S. Miller" <[email protected]>
Signed-off-by Cong Wang <[email protected]>
--- include/linux/netdevice.h | 36 ++++- net/core/Makefile | 1 + net/core/dev.c | 384 +----------------------------------------- net/core/dev_addr_lists.c | 74 -------- net/core/net-procfs.c | 414 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 450 insertions(+), 459 deletions(-) create mode 100644 net/core/net-procfs.c
include/linux/netdevice.h +33 -3
@@ -2692,9 +2692,9 @@ extern void net_enable_timestamp(void);extern void net_disable_timestamp (void );#ifdef CONFIG_PROC_FS -extern void *dev_seq_start (struct seq_file *seq,loff_t *pos); -extern void *dev_seq_next (struct seq_file *seq,void *v,loff_t *pos); -extern void dev_seq_stop (struct seq_file *seq,void *v); +extern int __init dev_proc_init (void ); +#else +#define dev_proc_init () 0#endif extern int netdev_class_create_file (struct class_attribute *class_attr);
@@ -2896,4 +2896,34 @@ do { \ })#endif +/* +* The list of packet types we will receive (as opposed to discard) +* and the routines to invoke. +* +* Why 16. Because with 16 the only overlap we get on a hash of the +* low nibble of the protocol value is RARP/SNAP/X.25. +* +* NOTE: That is no longer true with the addition of VLAN tags. Not +* sure which should go first, but I bet it won't make much +* difference if we are running VLANs. The good news is that +* this protocol won't be in the list unless compiled in, so +* the average user (w/out VLANs) will not be adversely affected. +* --BLG +* +* 0800 IP +* 8100 802.1Q VLAN +* 0001 802.3 +* 0002 AX.25 +* 0004 802.2 +* 8035 RARP +* 0005 SNAP +* 0805 X.25 +* 0806 ARP +* 8137 IPX +* 0009 Localtalk +* 86DD IPv6 +*/ +#define PTYPE_HASH_SIZE (16) +#define PTYPE_HASH_MASK (PTYPE_HASH_SIZE - 1) +#endif /* _LINUX_NETDEVICE_H */
net/core/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \ obj-$(CONFIG_XFRM) += flow.o obj-y += net-sysfs.o +obj-$(CONFIG_PROC_FS) += net-procfs.o obj-$(CONFIG_NET_PKTGEN) += pktgen.o obj-$(CONFIG_NETPOLL) += netpoll.o obj-$(CONFIG_NET_DMA) += user_dma.o
net/core/dev.c +2 -382
410 lines not on this page · raw message
net/core/dev_addr_lists.c +0 -74
83 lines not on this page · raw message
net/core/net-procfs.c new file +414 -0
414 lines not on this page · raw message
Signature · 1 line
1.7.7.6
Quoted 7 lines · Cong Wang
From: Cong Wang <[email protected]>
Similar to
net/core/net-sysfs.c, group procfs code to a single unit.Cc "David S. Miller" <[email protected]>Signed-off-by Cong Wang <[email protected]>
This is for net-next, sorry for missing it in $subject.
From: Cong Wang <[email protected]>
Date: Tue, 19 Feb 2013 13:20:33 +0800
Quoted 7 lines
From: Cong Wang <[email protected]>
Similar to
net/core/net-sysfs.c, group procfs code to a single unit.Cc "David S. Miller" <[email protected]>Signed-off-by Cong Wang <[email protected]>
Applied.