aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-04 14:47:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-04 14:47:58 -0400
commit6ba74014c1ab0e37af7de6f64b4eccbbae3cb9e7 (patch)
tree8f3892fc44f1e403675a6d7e88fda5c70e56ee4c /include/linux
parent5abd9ccced7a726c817dd6b5b96bc933859138d1 (diff)
parent3ff1c25927e3af61c6bf0e4ed959504058ae4565 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1443 commits) phy/marvell: add 88ec048 support igb: Program MDICNFG register prior to PHY init e1000e: correct MAC-PHY interconnect register offset for 82579 hso: Add new product ID can: Add driver for esd CAN-USB/2 device l2tp: fix export of header file for userspace can-raw: Fix skb_orphan_try handling Revert "net: remove zap_completion_queue" net: cleanup inclusion phy/marvell: add 88e1121 interface mode support u32: negative offset fix net: Fix a typo from "dev" to "ndev" igb: Use irq_synchronize per vector when using MSI-X ixgbevf: fix null pointer dereference due to filter being set for VLAN 0 e1000e: Fix irq_synchronize in MSI-X case e1000e: register pm_qos request on hardware activation ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice net: Add getsockopt support for TCP thin-streams cxgb4: update driver version cxgb4: add new PCI IDs ... Manually fix up conflicts in: - drivers/net/e1000e/netdev.c: due to pm_qos registration infrastructure changes - drivers/net/phy/marvell.c: conflict between adding 88ec048 support and cleaning up the IDs - drivers/net/wireless/ipw2x00/ipw2100.c: trivial ipw2100_pm_qos_req conflict (registration change vs marking it static)
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/atmdev.h17
-rw-r--r--include/linux/brcmphy.h7
-rw-r--r--include/linux/caif/caif_socket.h34
-rw-r--r--include/linux/can/platform/flexcan.h20
-rw-r--r--include/linux/cgroup.h7
-rw-r--r--include/linux/device.h112
-rw-r--r--include/linux/eeprom_93cx6.h1
-rw-r--r--include/linux/etherdevice.h14
-rw-r--r--include/linux/ethtool.h57
-rw-r--r--include/linux/filter.h48
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_bonding.h1
-rw-r--r--include/linux/if_bridge.h2
-rw-r--r--include/linux/if_ether.h2
-rw-r--r--include/linux/if_fddi.h8
-rw-r--r--include/linux/if_frad.h2
-rw-r--r--include/linux/if_hippi.h8
-rw-r--r--include/linux/if_link.h3
-rw-r--r--include/linux/if_macvlan.h23
-rw-r--r--include/linux/if_packet.h1
-rw-r--r--include/linux/if_pppox.h8
-rw-r--r--include/linux/in.h1
-rw-r--r--include/linux/ip_vs.h2
-rw-r--r--include/linux/ipv6.h6
-rw-r--r--include/linux/isdnif.h2
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/ks8842.h4
-rw-r--r--include/linux/mISDNif.h2
-rw-r--r--include/linux/marvell_phy.h1
-rw-r--r--include/linux/nbd.h2
-rw-r--r--include/linux/ncp.h10
-rw-r--r--include/linux/ncp_fs_sb.h14
-rw-r--r--include/linux/netdevice.h165
-rw-r--r--include/linux/netfilter/Kbuild6
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h4
-rw-r--r--include/linux/netfilter/nfnetlink_log.h1
-rw-r--r--include/linux/netfilter/xt_CHECKSUM.h20
-rw-r--r--include/linux/netfilter/xt_IDLETIMER.h45
-rw-r--r--include/linux/netfilter/xt_cpu.h11
-rw-r--r--include/linux/netfilter/xt_ipvs.h27
-rw-r--r--include/linux/netfilter/xt_quota.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_LOG.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_LOG.h3
-rw-r--r--include/linux/netpoll.h24
-rw-r--r--include/linux/nl80211.h24
-rw-r--r--include/linux/notifier.h1
-rw-r--r--include/linux/pci_ids.h6
-rw-r--r--include/linux/phonet.h4
-rw-r--r--include/linux/phy.h24
-rw-r--r--include/linux/ptp_classify.h126
-rw-r--r--include/linux/rds.h12
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--include/linux/sctp.h80
-rw-r--r--include/linux/skbuff.h70
-rw-r--r--include/linux/snmp.h1
-rw-r--r--include/linux/socket.h5
-rw-r--r--include/linux/ssb/ssb.h159
-rw-r--r--include/linux/u64_stats_sync.h140
-rw-r--r--include/linux/user_namespace.h14
-rw-r--r--include/linux/wlp.h22
61 files changed, 1028 insertions, 399 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 2fc8e14cc24a..9aa9bcadf869 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -276,6 +276,7 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
276 $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) 276 $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
277unifdef-y += kvm_para.h 277unifdef-y += kvm_para.h
278endif 278endif
279unifdef-y += l2tp.h
279unifdef-y += llc.h 280unifdef-y += llc.h
280unifdef-y += loop.h 281unifdef-y += loop.h
281unifdef-y += lp.h 282unifdef-y += lp.h
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 817b23705c91..f6481daf6e52 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -431,6 +431,14 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops,
431 int number,unsigned long *flags); /* number == -1: pick first available */ 431 int number,unsigned long *flags); /* number == -1: pick first available */
432struct atm_dev *atm_dev_lookup(int number); 432struct atm_dev *atm_dev_lookup(int number);
433void atm_dev_deregister(struct atm_dev *dev); 433void atm_dev_deregister(struct atm_dev *dev);
434
435/* atm_dev_signal_change
436 *
437 * Propagate lower layer signal change in atm_dev->signal to netdevice.
438 * The event will be sent via a notifier call chain.
439 */
440void atm_dev_signal_change(struct atm_dev *dev, char signal);
441
434void vcc_insert_socket(struct sock *sk); 442void vcc_insert_socket(struct sock *sk);
435 443
436 444
@@ -510,6 +518,15 @@ void register_atm_ioctl(struct atm_ioctl *);
510 */ 518 */
511void deregister_atm_ioctl(struct atm_ioctl *); 519void deregister_atm_ioctl(struct atm_ioctl *);
512 520
521
522/* register_atmdevice_notifier - register atm_dev notify events
523 *
524 * Clients like br2684 will register notify events
525 * Currently we notify of signal found/lost
526 */
527int register_atmdevice_notifier(struct notifier_block *nb);
528void unregister_atmdevice_notifier(struct notifier_block *nb);
529
513#endif /* __KERNEL__ */ 530#endif /* __KERNEL__ */
514 531
515#endif 532#endif
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 7f437ca1ed44..b840a4960282 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -1,6 +1,13 @@
1#define PHY_ID_BCM50610 0x0143bd60 1#define PHY_ID_BCM50610 0x0143bd60
2#define PHY_ID_BCM50610M 0x0143bd70 2#define PHY_ID_BCM50610M 0x0143bd70
3#define PHY_ID_BCM5241 0x0143bc30
3#define PHY_ID_BCMAC131 0x0143bc70 4#define PHY_ID_BCMAC131 0x0143bc70
5#define PHY_ID_BCM5481 0x0143bca0
6#define PHY_ID_BCM5482 0x0143bcb0
7#define PHY_ID_BCM5411 0x00206070
8#define PHY_ID_BCM5421 0x002060e0
9#define PHY_ID_BCM5464 0x002060b0
10#define PHY_ID_BCM5461 0x002060c0
4#define PHY_ID_BCM57780 0x03625d90 11#define PHY_ID_BCM57780 0x03625d90
5 12
6#define PHY_BCM_OUI_MASK 0xfffffc00 13#define PHY_BCM_OUI_MASK 0xfffffc00
diff --git a/include/linux/caif/caif_socket.h b/include/linux/caif/caif_socket.h
index 2a61eb1beb85..d9cb19b7cff7 100644
--- a/include/linux/caif/caif_socket.h
+++ b/include/linux/caif/caif_socket.h
@@ -62,6 +62,7 @@ enum caif_channel_priority {
62 * @CAIFPROTO_DATAGRAM_LOOP: Datagram loopback channel, used for testing. 62 * @CAIFPROTO_DATAGRAM_LOOP: Datagram loopback channel, used for testing.
63 * @CAIFPROTO_UTIL: Utility (Psock) channel. 63 * @CAIFPROTO_UTIL: Utility (Psock) channel.
64 * @CAIFPROTO_RFM: Remote File Manager 64 * @CAIFPROTO_RFM: Remote File Manager
65 * @CAIFPROTO_DEBUG: Debug link
65 * 66 *
66 * This enum defines the CAIF Channel type to be used. This defines 67 * This enum defines the CAIF Channel type to be used. This defines
67 * the service to connect to on the modem. 68 * the service to connect to on the modem.
@@ -72,6 +73,7 @@ enum caif_protocol_type {
72 CAIFPROTO_DATAGRAM_LOOP, 73 CAIFPROTO_DATAGRAM_LOOP,
73 CAIFPROTO_UTIL, 74 CAIFPROTO_UTIL,
74 CAIFPROTO_RFM, 75 CAIFPROTO_RFM,
76 CAIFPROTO_DEBUG,
75 _CAIFPROTO_MAX 77 _CAIFPROTO_MAX
76}; 78};
77#define CAIFPROTO_MAX _CAIFPROTO_MAX 79#define CAIFPROTO_MAX _CAIFPROTO_MAX
@@ -83,6 +85,28 @@ enum caif_protocol_type {
83enum caif_at_type { 85enum caif_at_type {
84 CAIF_ATTYPE_PLAIN = 2 86 CAIF_ATTYPE_PLAIN = 2
85}; 87};
88 /**
89 * enum caif_debug_type - Content selection for debug connection
90 * @CAIF_DEBUG_TRACE_INTERACTIVE: Connection will contain
91 * both trace and interactive debug.
92 * @CAIF_DEBUG_TRACE: Connection contains trace only.
93 * @CAIF_DEBUG_INTERACTIVE: Connection to interactive debug.
94 */
95enum caif_debug_type {
96 CAIF_DEBUG_TRACE_INTERACTIVE = 0,
97 CAIF_DEBUG_TRACE,
98 CAIF_DEBUG_INTERACTIVE,
99};
100
101/**
102 * enum caif_debug_service - Debug Service Endpoint
103 * @CAIF_RADIO_DEBUG_SERVICE: Debug service on the Radio sub-system
104 * @CAIF_APP_DEBUG_SERVICE: Debug for the applications sub-system
105 */
106enum caif_debug_service {
107 CAIF_RADIO_DEBUG_SERVICE = 1,
108 CAIF_APP_DEBUG_SERVICE
109};
86 110
87/** 111/**
88 * struct sockaddr_caif - the sockaddr structure for CAIF sockets. 112 * struct sockaddr_caif - the sockaddr structure for CAIF sockets.
@@ -109,6 +133,12 @@ enum caif_at_type {
109 * 133 *
110 * @u.rfm.volume: Volume to mount. 134 * @u.rfm.volume: Volume to mount.
111 * 135 *
136 * @u.dbg: Applies when family = CAIFPROTO_DEBUG.
137 *
138 * @u.dbg.type: Type of debug connection to set up
139 * (caif_debug_type).
140 *
141 * @u.dbg.service: Service sub-system to connect (caif_debug_service
112 * Description: 142 * Description:
113 * This structure holds the connect parameters used for setting up a 143 * This structure holds the connect parameters used for setting up a
114 * CAIF Channel. It defines the service to connect to on the modem. 144 * CAIF Channel. It defines the service to connect to on the modem.
@@ -130,6 +160,10 @@ struct sockaddr_caif {
130 __u32 connection_id; 160 __u32 connection_id;
131 char volume[16]; 161 char volume[16];
132 } rfm; /* CAIFPROTO_RFM */ 162 } rfm; /* CAIFPROTO_RFM */
163 struct {
164 __u8 type; /* type:enum caif_debug_type */
165 __u8 service; /* service:caif_debug_service */
166 } dbg; /* CAIFPROTO_DEBUG */
133 } u; 167 } u;
134}; 168};
135 169
diff --git a/include/linux/can/platform/flexcan.h b/include/linux/can/platform/flexcan.h
new file mode 100644
index 000000000000..72b713ab57e9
--- /dev/null
+++ b/include/linux/can/platform/flexcan.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) 2010 Marc Kleine-Budde <kernel@pengutronix.de>
3 *
4 * This file is released under the GPLv2
5 *
6 */
7
8#ifndef __CAN_PLATFORM_FLEXCAN_H
9#define __CAN_PLATFORM_FLEXCAN_H
10
11/**
12 * struct flexcan_platform_data - flex CAN controller platform data
13 * @transceiver_enable: - called to power on/off the transceiver
14 *
15 */
16struct flexcan_platform_data {
17 void (*transceiver_switch)(int enable);
18};
19
20#endif /* __CAN_PLATFORM_FLEXCAN_H */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index e3d00fdb858d..ed3e92e41c6e 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -578,6 +578,7 @@ struct task_struct *cgroup_iter_next(struct cgroup *cgrp,
578void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); 578void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it);
579int cgroup_scan_tasks(struct cgroup_scanner *scan); 579int cgroup_scan_tasks(struct cgroup_scanner *scan);
580int cgroup_attach_task(struct cgroup *, struct task_struct *); 580int cgroup_attach_task(struct cgroup *, struct task_struct *);
581int cgroup_attach_task_current_cg(struct task_struct *);
581 582
582/* 583/*
583 * CSS ID is ID for cgroup_subsys_state structs under subsys. This only works 584 * CSS ID is ID for cgroup_subsys_state structs under subsys. This only works
@@ -634,6 +635,12 @@ static inline int cgroupstats_build(struct cgroupstats *stats,
634 return -EINVAL; 635 return -EINVAL;
635} 636}
636 637
638/* No cgroups - nothing to do */
639static inline int cgroup_attach_task_current_cg(struct task_struct *t)
640{
641 return 0;
642}
643
637#endif /* !CONFIG_CGROUPS */ 644#endif /* !CONFIG_CGROUPS */
638 645
639#endif /* _LINUX_CGROUP_H */ 646#endif /* _LINUX_CGROUP_H */
diff --git a/include/linux/device.h b/include/linux/device.h
index 0713e10571dd..6a8276f683b6 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -638,43 +638,103 @@ extern void sysdev_shutdown(void);
638 638
639/* debugging and troubleshooting/diagnostic helpers. */ 639/* debugging and troubleshooting/diagnostic helpers. */
640extern const char *dev_driver_string(const struct device *dev); 640extern const char *dev_driver_string(const struct device *dev);
641#define dev_printk(level, dev, format, arg...) \ 641
642 printk(level "%s %s: " format , dev_driver_string(dev) , \ 642
643 dev_name(dev) , ## arg) 643#ifdef CONFIG_PRINTK
644 644
645#define dev_emerg(dev, format, arg...) \ 645extern int dev_printk(const char *level, const struct device *dev,
646 dev_printk(KERN_EMERG , dev , format , ## arg) 646 const char *fmt, ...)
647#define dev_alert(dev, format, arg...) \ 647 __attribute__ ((format (printf, 3, 4)));
648 dev_printk(KERN_ALERT , dev , format , ## arg) 648extern int dev_emerg(const struct device *dev, const char *fmt, ...)
649#define dev_crit(dev, format, arg...) \ 649 __attribute__ ((format (printf, 2, 3)));
650 dev_printk(KERN_CRIT , dev , format , ## arg) 650extern int dev_alert(const struct device *dev, const char *fmt, ...)
651#define dev_err(dev, format, arg...) \ 651 __attribute__ ((format (printf, 2, 3)));
652 dev_printk(KERN_ERR , dev , format , ## arg) 652extern int dev_crit(const struct device *dev, const char *fmt, ...)
653#define dev_warn(dev, format, arg...) \ 653 __attribute__ ((format (printf, 2, 3)));
654 dev_printk(KERN_WARNING , dev , format , ## arg) 654extern int dev_err(const struct device *dev, const char *fmt, ...)
655#define dev_notice(dev, format, arg...) \ 655 __attribute__ ((format (printf, 2, 3)));
656 dev_printk(KERN_NOTICE , dev , format , ## arg) 656extern int dev_warn(const struct device *dev, const char *fmt, ...)
657#define dev_info(dev, format, arg...) \ 657 __attribute__ ((format (printf, 2, 3)));
658 dev_printk(KERN_INFO , dev , format , ## arg) 658extern int dev_notice(const struct device *dev, const char *fmt, ...)
659 __attribute__ ((format (printf, 2, 3)));
660extern int _dev_info(const struct device *dev, const char *fmt, ...)
661 __attribute__ ((format (printf, 2, 3)));
662
663#else
664
665static inline int dev_printk(const char *level, const struct device *dev,
666 const char *fmt, ...)
667 __attribute__ ((format (printf, 3, 4)));
668static inline int dev_printk(const char *level, const struct device *dev,
669 const char *fmt, ...)
670 { return 0; }
671
672static inline int dev_emerg(const struct device *dev, const char *fmt, ...)
673 __attribute__ ((format (printf, 2, 3)));
674static inline int dev_emerg(const struct device *dev, const char *fmt, ...)
675 { return 0; }
676static inline int dev_crit(const struct device *dev, const char *fmt, ...)
677 __attribute__ ((format (printf, 2, 3)));
678static inline int dev_crit(const struct device *dev, const char *fmt, ...)
679 { return 0; }
680static inline int dev_alert(const struct device *dev, const char *fmt, ...)
681 __attribute__ ((format (printf, 2, 3)));
682static inline int dev_alert(const struct device *dev, const char *fmt, ...)
683 { return 0; }
684static inline int dev_err(const struct device *dev, const char *fmt, ...)
685 __attribute__ ((format (printf, 2, 3)));
686static inline int dev_err(const struct device *dev, const char *fmt, ...)
687 { return 0; }
688static inline int dev_warn(const struct device *dev, const char *fmt, ...)
689 __attribute__ ((format (printf, 2, 3)));
690static inline int dev_warn(const struct device *dev, const char *fmt, ...)
691 { return 0; }
692static inline int dev_notice(const struct device *dev, const char *fmt, ...)
693 __attribute__ ((format (printf, 2, 3)));
694static inline int dev_notice(const struct device *dev, const char *fmt, ...)
695 { return 0; }
696static inline int _dev_info(const struct device *dev, const char *fmt, ...)
697 __attribute__ ((format (printf, 2, 3)));
698static inline int _dev_info(const struct device *dev, const char *fmt, ...)
699 { return 0; }
700
701#endif
702
703/*
704 * Stupid hackaround for existing uses of non-printk uses dev_info
705 *
706 * Note that the definition of dev_info below is actually _dev_info
707 * and a macro is used to avoid redefining dev_info
708 */
709
710#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
659 711
660#if defined(DEBUG) 712#if defined(DEBUG)
661#define dev_dbg(dev, format, arg...) \ 713#define dev_dbg(dev, format, arg...) \
662 dev_printk(KERN_DEBUG , dev , format , ## arg) 714 dev_printk(KERN_DEBUG, dev, format, ##arg)
663#elif defined(CONFIG_DYNAMIC_DEBUG) 715#elif defined(CONFIG_DYNAMIC_DEBUG)
664#define dev_dbg(dev, format, ...) do { \ 716#define dev_dbg(dev, format, ...) \
717do { \
665 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ 718 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
666 } while (0) 719} while (0)
667#else 720#else
668#define dev_dbg(dev, format, arg...) \ 721#define dev_dbg(dev, format, arg...) \
669 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) 722({ \
723 if (0) \
724 dev_printk(KERN_DEBUG, dev, format, ##arg); \
725 0; \
726})
670#endif 727#endif
671 728
672#ifdef VERBOSE_DEBUG 729#ifdef VERBOSE_DEBUG
673#define dev_vdbg dev_dbg 730#define dev_vdbg dev_dbg
674#else 731#else
675 732#define dev_vdbg(dev, format, arg...) \
676#define dev_vdbg(dev, format, arg...) \ 733({ \
677 ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) 734 if (0) \
735 dev_printk(KERN_DEBUG, dev, format, ##arg); \
736 0; \
737})
678#endif 738#endif
679 739
680/* 740/*
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h
index a55c873e8b66..c4627cbdb8e0 100644
--- a/include/linux/eeprom_93cx6.h
+++ b/include/linux/eeprom_93cx6.h
@@ -30,6 +30,7 @@
30#define PCI_EEPROM_WIDTH_93C46 6 30#define PCI_EEPROM_WIDTH_93C46 6
31#define PCI_EEPROM_WIDTH_93C56 8 31#define PCI_EEPROM_WIDTH_93C56 8
32#define PCI_EEPROM_WIDTH_93C66 8 32#define PCI_EEPROM_WIDTH_93C66 8
33#define PCI_EEPROM_WIDTH_93C86 8
33#define PCI_EEPROM_WIDTH_OPCODE 3 34#define PCI_EEPROM_WIDTH_OPCODE 3
34#define PCI_EEPROM_WRITE_OPCODE 0x05 35#define PCI_EEPROM_WRITE_OPCODE 0x05
35#define PCI_EEPROM_READ_OPCODE 0x06 36#define PCI_EEPROM_READ_OPCODE 0x06
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 3d7a6687d247..848480bc2bf9 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -127,6 +127,20 @@ static inline void random_ether_addr(u8 *addr)
127} 127}
128 128
129/** 129/**
130 * dev_hw_addr_random - Create random MAC and set device flag
131 * @dev: pointer to net_device structure
132 * @addr: Pointer to a six-byte array containing the Ethernet address
133 *
134 * Generate random MAC to be used by a device and set addr_assign_type
135 * so the state can be read by sysfs and be used by udev.
136 */
137static inline void dev_hw_addr_random(struct net_device *dev, u8 *hwaddr)
138{
139 dev->addr_assign_type |= NET_ADDR_RANDOM;
140 random_ether_addr(hwaddr);
141}
142
143/**
130 * compare_ether_addr - Compare two Ethernet addresses 144 * compare_ether_addr - Compare two Ethernet addresses
131 * @addr1: Pointer to a six-byte array containing the Ethernet address 145 * @addr1: Pointer to a six-byte array containing the Ethernet address
132 * @addr2: Pointer other six-byte array containing the Ethernet address 146 * @addr2: Pointer other six-byte array containing the Ethernet address
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index b4207ca3ad52..991269e5b152 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -386,6 +386,15 @@ struct ethtool_rxnfc {
386 __u32 rule_locs[0]; 386 __u32 rule_locs[0];
387}; 387};
388 388
389struct ethtool_rxfh_indir {
390 __u32 cmd;
391 /* On entry, this is the array size of the user buffer. On
392 * return from ETHTOOL_GRXFHINDIR, this is the array size of
393 * the hardware indirection table. */
394 __u32 size;
395 __u32 ring_index[0]; /* ring/queue index for each hash value */
396};
397
389struct ethtool_rx_ntuple_flow_spec { 398struct ethtool_rx_ntuple_flow_spec {
390 __u32 flow_type; 399 __u32 flow_type;
391 union { 400 union {
@@ -459,7 +468,7 @@ int ethtool_op_set_tso(struct net_device *dev, u32 data);
459u32 ethtool_op_get_ufo(struct net_device *dev); 468u32 ethtool_op_get_ufo(struct net_device *dev);
460int ethtool_op_set_ufo(struct net_device *dev, u32 data); 469int ethtool_op_set_ufo(struct net_device *dev, u32 data);
461u32 ethtool_op_get_flags(struct net_device *dev); 470u32 ethtool_op_get_flags(struct net_device *dev);
462int ethtool_op_set_flags(struct net_device *dev, u32 data); 471int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported);
463void ethtool_ntuple_flush(struct net_device *dev); 472void ethtool_ntuple_flush(struct net_device *dev);
464 473
465/** 474/**
@@ -578,6 +587,10 @@ struct ethtool_ops {
578 int (*set_rx_ntuple)(struct net_device *, 587 int (*set_rx_ntuple)(struct net_device *,
579 struct ethtool_rx_ntuple *); 588 struct ethtool_rx_ntuple *);
580 int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); 589 int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *);
590 int (*get_rxfh_indir)(struct net_device *,
591 struct ethtool_rxfh_indir *);
592 int (*set_rxfh_indir)(struct net_device *,
593 const struct ethtool_rxfh_indir *);
581}; 594};
582#endif /* __KERNEL__ */ 595#endif /* __KERNEL__ */
583 596
@@ -588,29 +601,29 @@ struct ethtool_ops {
588#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */ 601#define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
589#define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */ 602#define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
590#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */ 603#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */
591#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ 604#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
592#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ 605#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
593#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ 606#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
594#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ 607#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */
595#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ 608#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
596#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ 609#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
597#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ 610#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
598#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */ 611#define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */
599#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */ 612#define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */
600#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */ 613#define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */
601#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */ 614#define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */
602#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */ 615#define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */
603#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */ 616#define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */
604#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */ 617#define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */
605#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */ 618#define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */
606#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */ 619#define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */
607#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable 620#define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable
608 * (ethtool_value) */ 621 * (ethtool_value) */
609#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable 622#define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable
610 * (ethtool_value). */ 623 * (ethtool_value). */
611#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */ 624#define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */
612#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */ 625#define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */
613#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */ 626#define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */
614#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ 627#define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */
615#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ 628#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
616#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ 629#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
@@ -621,8 +634,8 @@ struct ethtool_ops {
621#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */ 634#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
622#define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */ 635#define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */
623#define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */ 636#define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */
624#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ 637#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
625#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ 638#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
626 639
627#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ 640#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
628#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ 641#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
@@ -639,6 +652,8 @@ struct ethtool_ops {
639#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ 652#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
640#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ 653#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */
641#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ 654#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
655#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
656#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
642 657
643/* compatibility with older code */ 658/* compatibility with older code */
644#define SPARC_ETH_GSET ETHTOOL_GSET 659#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -647,18 +662,18 @@ struct ethtool_ops {
647/* Indicates what features are supported by the interface. */ 662/* Indicates what features are supported by the interface. */
648#define SUPPORTED_10baseT_Half (1 << 0) 663#define SUPPORTED_10baseT_Half (1 << 0)
649#define SUPPORTED_10baseT_Full (1 << 1) 664#define SUPPORTED_10baseT_Full (1 << 1)
650#define SUPPORTED_100baseT_Half (1 << 2) 665#define SUPPORTED_100baseT_Half (1 << 2)
651#define SUPPORTED_100baseT_Full (1 << 3) 666#define SUPPORTED_100baseT_Full (1 << 3)
652#define SUPPORTED_1000baseT_Half (1 << 4) 667#define SUPPORTED_1000baseT_Half (1 << 4)
653#define SUPPORTED_1000baseT_Full (1 << 5) 668#define SUPPORTED_1000baseT_Full (1 << 5)
654#define SUPPORTED_Autoneg (1 << 6) 669#define SUPPORTED_Autoneg (1 << 6)
655#define SUPPORTED_TP (1 << 7) 670#define SUPPORTED_TP (1 << 7)
656#define SUPPORTED_AUI (1 << 8) 671#define SUPPORTED_AUI (1 << 8)
657#define SUPPORTED_MII (1 << 9) 672#define SUPPORTED_MII (1 << 9)
658#define SUPPORTED_FIBRE (1 << 10) 673#define SUPPORTED_FIBRE (1 << 10)
659#define SUPPORTED_BNC (1 << 11) 674#define SUPPORTED_BNC (1 << 11)
660#define SUPPORTED_10000baseT_Full (1 << 12) 675#define SUPPORTED_10000baseT_Full (1 << 12)
661#define SUPPORTED_Pause (1 << 13) 676#define SUPPORTED_Pause (1 << 13)
662#define SUPPORTED_Asym_Pause (1 << 14) 677#define SUPPORTED_Asym_Pause (1 << 14)
663#define SUPPORTED_2500baseX_Full (1 << 15) 678#define SUPPORTED_2500baseX_Full (1 << 15)
664#define SUPPORTED_Backplane (1 << 16) 679#define SUPPORTED_Backplane (1 << 16)
@@ -668,8 +683,8 @@ struct ethtool_ops {
668#define SUPPORTED_10000baseR_FEC (1 << 20) 683#define SUPPORTED_10000baseR_FEC (1 << 20)
669 684
670/* Indicates what features are advertised by the interface. */ 685/* Indicates what features are advertised by the interface. */
671#define ADVERTISED_10baseT_Half (1 << 0) 686#define ADVERTISED_10baseT_Half (1 << 0)
672#define ADVERTISED_10baseT_Full (1 << 1) 687#define ADVERTISED_10baseT_Full (1 << 1)
673#define ADVERTISED_100baseT_Half (1 << 2) 688#define ADVERTISED_100baseT_Half (1 << 2)
674#define ADVERTISED_100baseT_Full (1 << 3) 689#define ADVERTISED_100baseT_Full (1 << 3)
675#define ADVERTISED_1000baseT_Half (1 << 4) 690#define ADVERTISED_1000baseT_Half (1 << 4)
@@ -708,12 +723,12 @@ struct ethtool_ops {
708#define DUPLEX_FULL 0x01 723#define DUPLEX_FULL 0x01
709 724
710/* Which connector port. */ 725/* Which connector port. */
711#define PORT_TP 0x00 726#define PORT_TP 0x00
712#define PORT_AUI 0x01 727#define PORT_AUI 0x01
713#define PORT_MII 0x02 728#define PORT_MII 0x02
714#define PORT_FIBRE 0x03 729#define PORT_FIBRE 0x03
715#define PORT_BNC 0x04 730#define PORT_BNC 0x04
716#define PORT_DA 0x05 731#define PORT_DA 0x05
717#define PORT_NONE 0xef 732#define PORT_NONE 0xef
718#define PORT_OTHER 0xff 733#define PORT_OTHER 0xff
719 734
@@ -727,7 +742,7 @@ struct ethtool_ops {
727/* Enable or disable autonegotiation. If this is set to enable, 742/* Enable or disable autonegotiation. If this is set to enable,
728 * the forced link modes above are completely ignored. 743 * the forced link modes above are completely ignored.
729 */ 744 */
730#define AUTONEG_DISABLE 0x00 745#define AUTONEG_DISABLE 0x00
731#define AUTONEG_ENABLE 0x01 746#define AUTONEG_ENABLE 0x01
732 747
733/* Mode MDI or MDI-X */ 748/* Mode MDI or MDI-X */
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 151f5d703b7e..69b43dbea6c6 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -91,6 +91,54 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
91#define BPF_TAX 0x00 91#define BPF_TAX 0x00
92#define BPF_TXA 0x80 92#define BPF_TXA 0x80
93 93
94enum {
95 BPF_S_RET_K = 0,
96 BPF_S_RET_A,
97 BPF_S_ALU_ADD_K,
98 BPF_S_ALU_ADD_X,
99 BPF_S_ALU_SUB_K,
100 BPF_S_ALU_SUB_X,
101 BPF_S_ALU_MUL_K,
102 BPF_S_ALU_MUL_X,
103 BPF_S_ALU_DIV_X,
104 BPF_S_ALU_AND_K,
105 BPF_S_ALU_AND_X,
106 BPF_S_ALU_OR_K,
107 BPF_S_ALU_OR_X,
108 BPF_S_ALU_LSH_K,
109 BPF_S_ALU_LSH_X,
110 BPF_S_ALU_RSH_K,
111 BPF_S_ALU_RSH_X,
112 BPF_S_ALU_NEG,
113 BPF_S_LD_W_ABS,
114 BPF_S_LD_H_ABS,
115 BPF_S_LD_B_ABS,
116 BPF_S_LD_W_LEN,
117 BPF_S_LD_W_IND,
118 BPF_S_LD_H_IND,
119 BPF_S_LD_B_IND,
120 BPF_S_LD_IMM,
121 BPF_S_LDX_W_LEN,
122 BPF_S_LDX_B_MSH,
123 BPF_S_LDX_IMM,
124 BPF_S_MISC_TAX,
125 BPF_S_MISC_TXA,
126 BPF_S_ALU_DIV_K,
127 BPF_S_LD_MEM,
128 BPF_S_LDX_MEM,
129 BPF_S_ST,
130 BPF_S_STX,
131 BPF_S_JMP_JA,
132 BPF_S_JMP_JEQ_K,
133 BPF_S_JMP_JEQ_X,
134 BPF_S_JMP_JGE_K,
135 BPF_S_JMP_JGE_X,
136 BPF_S_JMP_JGT_K,
137 BPF_S_JMP_JGT_X,
138 BPF_S_JMP_JSET_K,
139 BPF_S_JMP_JSET_X,
140};
141
94#ifndef BPF_MAXINSNS 142#ifndef BPF_MAXINSNS
95#define BPF_MAXINSNS 4096 143#define BPF_MAXINSNS 4096
96#endif 144#endif
diff --git a/include/linux/if.h b/include/linux/if.h
index be350e62a905..53558ec59e1b 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -73,6 +73,8 @@
73#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */ 73#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
74#define IFF_IN_NETPOLL 0x1000 /* whether we are processing netpoll */ 74#define IFF_IN_NETPOLL 0x1000 /* whether we are processing netpoll */
75#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */ 75#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */
76#define IFF_MACVLAN_PORT 0x4000 /* device used as macvlan port */
77#define IFF_BRIDGE_PORT 0x8000 /* device used as bridge port */
76 78
77#define IF_GET_IFACE 0x0001 /* for querying only */ 79#define IF_GET_IFACE 0x0001 /* for querying only */
78#define IF_GET_PROTO 0x0002 80#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h
index cd525fae3c98..2c7994372bde 100644
--- a/include/linux/if_bonding.h
+++ b/include/linux/if_bonding.h
@@ -83,6 +83,7 @@
83 83
84#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ 84#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */
85 85
86#define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */
86/* hashing types */ 87/* hashing types */
87#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */ 88#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */
88#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */ 89#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 938b7e81df95..0d241a5c4909 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -102,8 +102,6 @@ struct __fdb_entry {
102#include <linux/netdevice.h> 102#include <linux/netdevice.h>
103 103
104extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); 104extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
105extern struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p,
106 struct sk_buff *skb);
107extern int (*br_should_route_hook)(struct sk_buff *skb); 105extern int (*br_should_route_hook)(struct sk_buff *skb);
108 106
109#endif 107#endif
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index bed7a4682b90..c831467774d0 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -119,7 +119,7 @@ struct ethhdr {
119 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ 119 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
120 unsigned char h_source[ETH_ALEN]; /* source ether addr */ 120 unsigned char h_source[ETH_ALEN]; /* source ether addr */
121 __be16 h_proto; /* packet type ID field */ 121 __be16 h_proto; /* packet type ID field */
122} __attribute__((packed)); 122} __packed;
123 123
124#ifdef __KERNEL__ 124#ifdef __KERNEL__
125#include <linux/skbuff.h> 125#include <linux/skbuff.h>
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index 5459c5c09930..9947c39e62f6 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -67,7 +67,7 @@ struct fddi_8022_1_hdr {
67 __u8 dsap; /* destination service access point */ 67 __u8 dsap; /* destination service access point */
68 __u8 ssap; /* source service access point */ 68 __u8 ssap; /* source service access point */
69 __u8 ctrl; /* control byte #1 */ 69 __u8 ctrl; /* control byte #1 */
70} __attribute__ ((packed)); 70} __packed;
71 71
72/* Define 802.2 Type 2 header */ 72/* Define 802.2 Type 2 header */
73struct fddi_8022_2_hdr { 73struct fddi_8022_2_hdr {
@@ -75,7 +75,7 @@ struct fddi_8022_2_hdr {
75 __u8 ssap; /* source service access point */ 75 __u8 ssap; /* source service access point */
76 __u8 ctrl_1; /* control byte #1 */ 76 __u8 ctrl_1; /* control byte #1 */
77 __u8 ctrl_2; /* control byte #2 */ 77 __u8 ctrl_2; /* control byte #2 */
78} __attribute__ ((packed)); 78} __packed;
79 79
80/* Define 802.2 SNAP header */ 80/* Define 802.2 SNAP header */
81#define FDDI_K_OUI_LEN 3 81#define FDDI_K_OUI_LEN 3
@@ -85,7 +85,7 @@ struct fddi_snap_hdr {
85 __u8 ctrl; /* always 0x03 */ 85 __u8 ctrl; /* always 0x03 */
86 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ 86 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
87 __be16 ethertype; /* packet type ID field */ 87 __be16 ethertype; /* packet type ID field */
88} __attribute__ ((packed)); 88} __packed;
89 89
90/* Define FDDI LLC frame header */ 90/* Define FDDI LLC frame header */
91struct fddihdr { 91struct fddihdr {
@@ -98,7 +98,7 @@ struct fddihdr {
98 struct fddi_8022_2_hdr llc_8022_2; 98 struct fddi_8022_2_hdr llc_8022_2;
99 struct fddi_snap_hdr llc_snap; 99 struct fddi_snap_hdr llc_snap;
100 } hdr; 100 } hdr;
101} __attribute__ ((packed)); 101} __packed;
102 102
103#ifdef __KERNEL__ 103#ifdef __KERNEL__
104#include <linux/netdevice.h> 104#include <linux/netdevice.h>
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h
index 80b3a1056a5f..191ee0869bc1 100644
--- a/include/linux/if_frad.h
+++ b/include/linux/if_frad.h
@@ -135,7 +135,7 @@ struct frhdr
135 __be16 PID; 135 __be16 PID;
136 136
137#define IP_NLPID pad 137#define IP_NLPID pad
138} __attribute__((packed)); 138} __packed;
139 139
140/* see RFC 1490 for the definition of the following */ 140/* see RFC 1490 for the definition of the following */
141#define FRAD_I_UI 0x03 141#define FRAD_I_UI 0x03
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h
index 8d038eb8db5c..5fe5f307c6f5 100644
--- a/include/linux/if_hippi.h
+++ b/include/linux/if_hippi.h
@@ -104,7 +104,7 @@ struct hippi_fp_hdr {
104 __be32 fixed; 104 __be32 fixed;
105#endif 105#endif
106 __be32 d2_size; 106 __be32 d2_size;
107} __attribute__ ((packed)); 107} __packed;
108 108
109struct hippi_le_hdr { 109struct hippi_le_hdr {
110#if defined (__BIG_ENDIAN_BITFIELD) 110#if defined (__BIG_ENDIAN_BITFIELD)
@@ -129,7 +129,7 @@ struct hippi_le_hdr {
129 __u8 daddr[HIPPI_ALEN]; 129 __u8 daddr[HIPPI_ALEN];
130 __u16 locally_administered; 130 __u16 locally_administered;
131 __u8 saddr[HIPPI_ALEN]; 131 __u8 saddr[HIPPI_ALEN];
132} __attribute__ ((packed)); 132} __packed;
133 133
134#define HIPPI_OUI_LEN 3 134#define HIPPI_OUI_LEN 3
135/* 135/*
@@ -142,12 +142,12 @@ struct hippi_snap_hdr {
142 __u8 ctrl; /* always 0x03 */ 142 __u8 ctrl; /* always 0x03 */
143 __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/ 143 __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/
144 __be16 ethertype; /* packet type ID field */ 144 __be16 ethertype; /* packet type ID field */
145} __attribute__ ((packed)); 145} __packed;
146 146
147struct hippi_hdr { 147struct hippi_hdr {
148 struct hippi_fp_hdr fp; 148 struct hippi_fp_hdr fp;
149 struct hippi_le_hdr le; 149 struct hippi_le_hdr le;
150 struct hippi_snap_hdr snap; 150 struct hippi_snap_hdr snap;
151} __attribute__ ((packed)); 151} __packed;
152 152
153#endif /* _LINUX_IF_HIPPI_H */ 153#endif /* _LINUX_IF_HIPPI_H */
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 85c812db5a3f..7fcad2e1be3d 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -4,7 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netlink.h> 5#include <linux/netlink.h>
6 6
7/* The struct should be in sync with struct net_device_stats */ 7/* This struct should be in sync with struct rtnl_link_stats64 */
8struct rtnl_link_stats { 8struct rtnl_link_stats {
9 __u32 rx_packets; /* total packets received */ 9 __u32 rx_packets; /* total packets received */
10 __u32 tx_packets; /* total packets transmitted */ 10 __u32 tx_packets; /* total packets transmitted */
@@ -37,6 +37,7 @@ struct rtnl_link_stats {
37 __u32 tx_compressed; 37 __u32 tx_compressed;
38}; 38};
39 39
40/* The main device statistics structure */
40struct rtnl_link_stats64 { 41struct rtnl_link_stats64 {
41 __u64 rx_packets; /* total packets received */ 42 __u64 rx_packets; /* total packets received */
42 __u64 tx_packets; /* total packets transmitted */ 43 __u64 tx_packets; /* total packets transmitted */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 1ffaeffeff74..35280b302290 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -6,6 +6,7 @@
6#include <linux/netdevice.h> 6#include <linux/netdevice.h>
7#include <linux/netlink.h> 7#include <linux/netlink.h>
8#include <net/netlink.h> 8#include <net/netlink.h>
9#include <linux/u64_stats_sync.h>
9 10
10#if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE) 11#if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE)
11struct socket *macvtap_get_socket(struct file *); 12struct socket *macvtap_get_socket(struct file *);
@@ -27,14 +28,16 @@ struct macvtap_queue;
27 * struct macvlan_rx_stats - MACVLAN percpu rx stats 28 * struct macvlan_rx_stats - MACVLAN percpu rx stats
28 * @rx_packets: number of received packets 29 * @rx_packets: number of received packets
29 * @rx_bytes: number of received bytes 30 * @rx_bytes: number of received bytes
30 * @multicast: number of received multicast packets 31 * @rx_multicast: number of received multicast packets
32 * @syncp: synchronization point for 64bit counters
31 * @rx_errors: number of errors 33 * @rx_errors: number of errors
32 */ 34 */
33struct macvlan_rx_stats { 35struct macvlan_rx_stats {
34 unsigned long rx_packets; 36 u64 rx_packets;
35 unsigned long rx_bytes; 37 u64 rx_bytes;
36 unsigned long multicast; 38 u64 rx_multicast;
37 unsigned long rx_errors; 39 struct u64_stats_sync syncp;
40 unsigned long rx_errors;
38}; 41};
39 42
40struct macvlan_dev { 43struct macvlan_dev {
@@ -56,12 +59,14 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
56{ 59{
57 struct macvlan_rx_stats *rx_stats; 60 struct macvlan_rx_stats *rx_stats;
58 61
59 rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id()); 62 rx_stats = this_cpu_ptr(vlan->rx_stats);
60 if (likely(success)) { 63 if (likely(success)) {
64 u64_stats_update_begin(&rx_stats->syncp);
61 rx_stats->rx_packets++;; 65 rx_stats->rx_packets++;;
62 rx_stats->rx_bytes += len; 66 rx_stats->rx_bytes += len;
63 if (multicast) 67 if (multicast)
64 rx_stats->multicast++; 68 rx_stats->rx_multicast++;
69 u64_stats_update_end(&rx_stats->syncp);
65 } else { 70 } else {
66 rx_stats->rx_errors++; 71 rx_stats->rx_errors++;
67 } 72 }
@@ -86,8 +91,4 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops);
86extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, 91extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
87 struct net_device *dev); 92 struct net_device *dev);
88 93
89
90extern struct sk_buff *(*macvlan_handle_frame_hook)(struct macvlan_port *,
91 struct sk_buff *);
92
93#endif /* _LINUX_IF_MACVLAN_H */ 94#endif /* _LINUX_IF_MACVLAN_H */
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 6ac23ef1801a..72bfa5a034dd 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -48,6 +48,7 @@ struct sockaddr_ll {
48#define PACKET_LOSS 14 48#define PACKET_LOSS 14
49#define PACKET_VNET_HDR 15 49#define PACKET_VNET_HDR 15
50#define PACKET_TX_TIMESTAMP 16 50#define PACKET_TX_TIMESTAMP 16
51#define PACKET_TIMESTAMP 17
51 52
52struct tpacket_stats { 53struct tpacket_stats {
53 unsigned int tp_packets; 54 unsigned int tp_packets;
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index a6577af0c4e6..1925e0c3f162 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -59,7 +59,7 @@ struct sockaddr_pppox {
59 union{ 59 union{
60 struct pppoe_addr pppoe; 60 struct pppoe_addr pppoe;
61 }sa_addr; 61 }sa_addr;
62}__attribute__ ((packed)); 62} __packed;
63 63
64/* The use of the above union isn't viable because the size of this 64/* The use of the above union isn't viable because the size of this
65 * struct must stay fixed over time -- applications use sizeof(struct 65 * struct must stay fixed over time -- applications use sizeof(struct
@@ -70,7 +70,7 @@ struct sockaddr_pppol2tp {
70 sa_family_t sa_family; /* address family, AF_PPPOX */ 70 sa_family_t sa_family; /* address family, AF_PPPOX */
71 unsigned int sa_protocol; /* protocol identifier */ 71 unsigned int sa_protocol; /* protocol identifier */
72 struct pppol2tp_addr pppol2tp; 72 struct pppol2tp_addr pppol2tp;
73}__attribute__ ((packed)); 73} __packed;
74 74
75/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 75/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
76 * bits. So we need a different sockaddr structure. 76 * bits. So we need a different sockaddr structure.
@@ -79,7 +79,7 @@ struct sockaddr_pppol2tpv3 {
79 sa_family_t sa_family; /* address family, AF_PPPOX */ 79 sa_family_t sa_family; /* address family, AF_PPPOX */
80 unsigned int sa_protocol; /* protocol identifier */ 80 unsigned int sa_protocol; /* protocol identifier */
81 struct pppol2tpv3_addr pppol2tp; 81 struct pppol2tpv3_addr pppol2tp;
82} __attribute__ ((packed)); 82} __packed;
83 83
84/********************************************************************* 84/*********************************************************************
85 * 85 *
@@ -129,7 +129,7 @@ struct pppoe_hdr {
129 __be16 sid; 129 __be16 sid;
130 __be16 length; 130 __be16 length;
131 struct pppoe_tag tag[0]; 131 struct pppoe_tag tag[0];
132} __attribute__ ((packed)); 132} __packed;
133 133
134/* Length of entire PPPoE + PPP header */ 134/* Length of entire PPPoE + PPP header */
135#define PPPOE_SES_HLEN 8 135#define PPPOE_SES_HLEN 8
diff --git a/include/linux/in.h b/include/linux/in.h
index 583c76f9c30f..41d88a4689af 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -85,6 +85,7 @@ struct in_addr {
85#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR 85#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
86 86
87#define IP_MINTTL 21 87#define IP_MINTTL 21
88#define IP_NODEFRAG 22
88 89
89/* IP_MTU_DISCOVER values */ 90/* IP_MTU_DISCOVER values */
90#define IP_PMTUDISC_DONT 0 /* Never send DF frames */ 91#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
index dfc170362842..9708de265bb1 100644
--- a/include/linux/ip_vs.h
+++ b/include/linux/ip_vs.h
@@ -19,6 +19,7 @@
19 */ 19 */
20#define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */ 20#define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */
21#define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */ 21#define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */
22#define IP_VS_SVC_F_ONEPACKET 0x0004 /* one-packet scheduling */
22 23
23/* 24/*
24 * Destination Server Flags 25 * Destination Server Flags
@@ -85,6 +86,7 @@
85#define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ 86#define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */
86#define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ 87#define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */
87#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ 88#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */
89#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */
88 90
89#define IP_VS_SCHEDNAME_MAXLEN 16 91#define IP_VS_SCHEDNAME_MAXLEN 16
90#define IP_VS_IFNAME_MAXLEN 16 92#define IP_VS_IFNAME_MAXLEN 16
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 99e1ab7e3eec..ab9e9e89e407 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -58,7 +58,7 @@ struct ipv6_opt_hdr {
58 /* 58 /*
59 * TLV encoded option data follows. 59 * TLV encoded option data follows.
60 */ 60 */
61} __attribute__ ((packed)); /* required for some archs */ 61} __packed; /* required for some archs */
62 62
63#define ipv6_destopt_hdr ipv6_opt_hdr 63#define ipv6_destopt_hdr ipv6_opt_hdr
64#define ipv6_hopopt_hdr ipv6_opt_hdr 64#define ipv6_hopopt_hdr ipv6_opt_hdr
@@ -99,7 +99,7 @@ struct ipv6_destopt_hao {
99 __u8 type; 99 __u8 type;
100 __u8 length; 100 __u8 length;
101 struct in6_addr addr; 101 struct in6_addr addr;
102} __attribute__ ((__packed__)); 102} __packed;
103 103
104/* 104/*
105 * IPv6 fixed header 105 * IPv6 fixed header
@@ -246,7 +246,7 @@ struct inet6_skb_parm {
246 __u16 srcrt; 246 __u16 srcrt;
247 __u16 dst1; 247 __u16 dst1;
248 __u16 lastopt; 248 __u16 lastopt;
249 __u32 nhoff; 249 __u16 nhoff;
250 __u16 flags; 250 __u16 flags;
251#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 251#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
252 __u16 dsthao; 252 __u16 dsthao;
diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h
index b9b5a684ed69..b8c23f88dd54 100644
--- a/include/linux/isdnif.h
+++ b/include/linux/isdnif.h
@@ -317,7 +317,7 @@ typedef struct T30_s {
317 __u8 r_scantime; 317 __u8 r_scantime;
318 __u8 r_id[FAXIDLEN]; 318 __u8 r_id[FAXIDLEN];
319 __u8 r_code; 319 __u8 r_code;
320} __attribute__((packed)) T30_s; 320} __packed T30_s;
321 321
322#define ISDN_TTY_FAX_CONN_IN 0 322#define ISDN_TTY_FAX_CONN_IN 0
323#define ISDN_TTY_FAX_CONN_OUT 1 323#define ISDN_TTY_FAX_CONN_OUT 1
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 8317ec4b9f3b..01dfc05ef4ac 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -171,6 +171,11 @@ static inline void might_fault(void)
171} 171}
172#endif 172#endif
173 173
174struct va_format {
175 const char *fmt;
176 va_list *va;
177};
178
174extern struct atomic_notifier_head panic_notifier_list; 179extern struct atomic_notifier_head panic_notifier_list;
175extern long (*panic_blink)(long time); 180extern long (*panic_blink)(long time);
176NORET_TYPE void panic(const char * fmt, ...) 181NORET_TYPE void panic(const char * fmt, ...)
diff --git a/include/linux/ks8842.h b/include/linux/ks8842.h
index da0341b8ca0a..14ba4452296e 100644
--- a/include/linux/ks8842.h
+++ b/include/linux/ks8842.h
@@ -25,10 +25,14 @@
25 * struct ks8842_platform_data - Platform data of the KS8842 network driver 25 * struct ks8842_platform_data - Platform data of the KS8842 network driver
26 * @macaddr: The MAC address of the device, set to all 0:s to use the on in 26 * @macaddr: The MAC address of the device, set to all 0:s to use the on in
27 * the chip. 27 * the chip.
28 * @rx_dma_channel: The DMA channel to use for RX, -1 for none.
29 * @tx_dma_channel: The DMA channel to use for TX, -1 for none.
28 * 30 *
29 */ 31 */
30struct ks8842_platform_data { 32struct ks8842_platform_data {
31 u8 macaddr[ETH_ALEN]; 33 u8 macaddr[ETH_ALEN];
34 int rx_dma_channel;
35 int tx_dma_channel;
32}; 36};
33 37
34#endif 38#endif
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h
index 78c3bed1c3f5..b5e7f2202484 100644
--- a/include/linux/mISDNif.h
+++ b/include/linux/mISDNif.h
@@ -251,7 +251,7 @@
251struct mISDNhead { 251struct mISDNhead {
252 unsigned int prim; 252 unsigned int prim;
253 unsigned int id; 253 unsigned int id;
254} __attribute__((packed)); 254} __packed;
255 255
256#define MISDN_HEADER_LEN sizeof(struct mISDNhead) 256#define MISDN_HEADER_LEN sizeof(struct mISDNhead)
257#define MAX_DATA_SIZE 2048 257#define MAX_DATA_SIZE 2048
diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h
index 2ed4fb8bbd51..d0f08018335d 100644
--- a/include/linux/marvell_phy.h
+++ b/include/linux/marvell_phy.h
@@ -12,6 +12,7 @@
12#define MARVELL_PHY_ID_88E1121R 0x01410cb0 12#define MARVELL_PHY_ID_88E1121R 0x01410cb0
13#define MARVELL_PHY_ID_88E1145 0x01410cd0 13#define MARVELL_PHY_ID_88E1145 0x01410cd0
14#define MARVELL_PHY_ID_88E1240 0x01410e30 14#define MARVELL_PHY_ID_88E1240 0x01410e30
15#define MARVELL_PHY_ID_88EC048 0x01410e90
15 16
16/* struct phy_device dev_flags definitions */ 17/* struct phy_device dev_flags definitions */
17#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 18#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index 155719dab813..bb58854a8061 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -88,7 +88,7 @@ struct nbd_request {
88 char handle[8]; 88 char handle[8];
89 __be64 from; 89 __be64 from;
90 __be32 len; 90 __be32 len;
91} __attribute__ ((packed)); 91} __packed;
92 92
93/* 93/*
94 * This is the reply packet that nbd-server sends back to the client after 94 * This is the reply packet that nbd-server sends back to the client after
diff --git a/include/linux/ncp.h b/include/linux/ncp.h
index 99f0adeeb3f3..3ace8370e61e 100644
--- a/include/linux/ncp.h
+++ b/include/linux/ncp.h
@@ -27,7 +27,7 @@ struct ncp_request_header {
27 __u8 conn_high; 27 __u8 conn_high;
28 __u8 function; 28 __u8 function;
29 __u8 data[0]; 29 __u8 data[0];
30} __attribute__((packed)); 30} __packed;
31 31
32#define NCP_REPLY (0x3333) 32#define NCP_REPLY (0x3333)
33#define NCP_WATCHDOG (0x3E3E) 33#define NCP_WATCHDOG (0x3E3E)
@@ -42,7 +42,7 @@ struct ncp_reply_header {
42 __u8 completion_code; 42 __u8 completion_code;
43 __u8 connection_state; 43 __u8 connection_state;
44 __u8 data[0]; 44 __u8 data[0];
45} __attribute__((packed)); 45} __packed;
46 46
47#define NCP_VOLNAME_LEN (16) 47#define NCP_VOLNAME_LEN (16)
48#define NCP_NUMBER_OF_VOLUMES (256) 48#define NCP_NUMBER_OF_VOLUMES (256)
@@ -158,7 +158,7 @@ struct nw_info_struct {
158#ifdef __KERNEL__ 158#ifdef __KERNEL__
159 struct nw_nfs_info nfs; 159 struct nw_nfs_info nfs;
160#endif 160#endif
161} __attribute__((packed)); 161} __packed;
162 162
163/* modify mask - use with MODIFY_DOS_INFO structure */ 163/* modify mask - use with MODIFY_DOS_INFO structure */
164#define DM_ATTRIBUTES (cpu_to_le32(0x02)) 164#define DM_ATTRIBUTES (cpu_to_le32(0x02))
@@ -190,12 +190,12 @@ struct nw_modify_dos_info {
190 __u16 inheritanceGrantMask; 190 __u16 inheritanceGrantMask;
191 __u16 inheritanceRevokeMask; 191 __u16 inheritanceRevokeMask;
192 __u32 maximumSpace; 192 __u32 maximumSpace;
193} __attribute__((packed)); 193} __packed;
194 194
195struct nw_search_sequence { 195struct nw_search_sequence {
196 __u8 volNumber; 196 __u8 volNumber;
197 __u32 dirBase; 197 __u32 dirBase;
198 __u32 sequence; 198 __u32 sequence;
199} __attribute__((packed)); 199} __packed;
200 200
201#endif /* _LINUX_NCP_H */ 201#endif /* _LINUX_NCP_H */
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
index 5ec9ca671687..8da05bc098ca 100644
--- a/include/linux/ncp_fs_sb.h
+++ b/include/linux/ncp_fs_sb.h
@@ -104,13 +104,13 @@ struct ncp_server {
104 104
105 unsigned int state; /* STREAM only: receiver state */ 105 unsigned int state; /* STREAM only: receiver state */
106 struct { 106 struct {
107 __u32 magic __attribute__((packed)); 107 __u32 magic __packed;
108 __u32 len __attribute__((packed)); 108 __u32 len __packed;
109 __u16 type __attribute__((packed)); 109 __u16 type __packed;
110 __u16 p1 __attribute__((packed)); 110 __u16 p1 __packed;
111 __u16 p2 __attribute__((packed)); 111 __u16 p2 __packed;
112 __u16 p3 __attribute__((packed)); 112 __u16 p3 __packed;
113 __u16 type2 __attribute__((packed)); 113 __u16 type2 __packed;
114 } buf; /* STREAM only: temporary buffer */ 114 } buf; /* STREAM only: temporary buffer */
115 unsigned char* ptr; /* STREAM only: pointer to data */ 115 unsigned char* ptr; /* STREAM only: pointer to data */
116 size_t len; /* STREAM only: length of data to receive */ 116 size_t len; /* STREAM only: length of data to receive */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 2f22119b4b08..d52b570569be 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -54,6 +54,7 @@
54 54
55struct vlan_group; 55struct vlan_group;
56struct netpoll_info; 56struct netpoll_info;
57struct phy_device;
57/* 802.11 specific */ 58/* 802.11 specific */
58struct wireless_dev; 59struct wireless_dev;
59 /* source back-compat hooks */ 60 /* source back-compat hooks */
@@ -65,6 +66,11 @@ struct wireless_dev;
65#define HAVE_FREE_NETDEV /* free_netdev() */ 66#define HAVE_FREE_NETDEV /* free_netdev() */
66#define HAVE_NETDEV_PRIV /* netdev_priv() */ 67#define HAVE_NETDEV_PRIV /* netdev_priv() */
67 68
69/* hardware address assignment types */
70#define NET_ADDR_PERM 0 /* address is permanent (default) */
71#define NET_ADDR_RANDOM 1 /* address is generated randomly */
72#define NET_ADDR_STOLEN 2 /* address is stolen from other device */
73
68/* Backlog congestion levels */ 74/* Backlog congestion levels */
69#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ 75#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
70#define NET_RX_DROP 1 /* packet dropped */ 76#define NET_RX_DROP 1 /* packet dropped */
@@ -159,45 +165,39 @@ static inline bool dev_xmit_complete(int rc)
159#define MAX_HEADER (LL_MAX_HEADER + 48) 165#define MAX_HEADER (LL_MAX_HEADER + 48)
160#endif 166#endif
161 167
162#endif /* __KERNEL__ */
163
164/* 168/*
165 * Network device statistics. Akin to the 2.0 ether stats but 169 * Old network device statistics. Fields are native words
166 * with byte counters. 170 * (unsigned long) so they can be read and written atomically.
167 */ 171 */
168 172
169struct net_device_stats { 173struct net_device_stats {
170 unsigned long rx_packets; /* total packets received */ 174 unsigned long rx_packets;
171 unsigned long tx_packets; /* total packets transmitted */ 175 unsigned long tx_packets;
172 unsigned long rx_bytes; /* total bytes received */ 176 unsigned long rx_bytes;
173 unsigned long tx_bytes; /* total bytes transmitted */ 177 unsigned long tx_bytes;
174 unsigned long rx_errors; /* bad packets received */ 178 unsigned long rx_errors;
175 unsigned long tx_errors; /* packet transmit problems */ 179 unsigned long tx_errors;
176 unsigned long rx_dropped; /* no space in linux buffers */ 180 unsigned long rx_dropped;
177 unsigned long tx_dropped; /* no space available in linux */ 181 unsigned long tx_dropped;
178 unsigned long multicast; /* multicast packets received */ 182 unsigned long multicast;
179 unsigned long collisions; 183 unsigned long collisions;
180
181 /* detailed rx_errors: */
182 unsigned long rx_length_errors; 184 unsigned long rx_length_errors;
183 unsigned long rx_over_errors; /* receiver ring buff overflow */ 185 unsigned long rx_over_errors;
184 unsigned long rx_crc_errors; /* recved pkt with crc error */ 186 unsigned long rx_crc_errors;
185 unsigned long rx_frame_errors; /* recv'd frame alignment error */ 187 unsigned long rx_frame_errors;
186 unsigned long rx_fifo_errors; /* recv'r fifo overrun */ 188 unsigned long rx_fifo_errors;
187 unsigned long rx_missed_errors; /* receiver missed packet */ 189 unsigned long rx_missed_errors;
188
189 /* detailed tx_errors */
190 unsigned long tx_aborted_errors; 190 unsigned long tx_aborted_errors;
191 unsigned long tx_carrier_errors; 191 unsigned long tx_carrier_errors;
192 unsigned long tx_fifo_errors; 192 unsigned long tx_fifo_errors;
193 unsigned long tx_heartbeat_errors; 193 unsigned long tx_heartbeat_errors;
194 unsigned long tx_window_errors; 194 unsigned long tx_window_errors;
195
196 /* for cslip etc */
197 unsigned long rx_compressed; 195 unsigned long rx_compressed;
198 unsigned long tx_compressed; 196 unsigned long tx_compressed;
199}; 197};
200 198
199#endif /* __KERNEL__ */
200
201 201
202/* Media selection options. */ 202/* Media selection options. */
203enum { 203enum {
@@ -381,6 +381,8 @@ enum gro_result {
381}; 381};
382typedef enum gro_result gro_result_t; 382typedef enum gro_result gro_result_t;
383 383
384typedef struct sk_buff *rx_handler_func_t(struct sk_buff *skb);
385
384extern void __napi_schedule(struct napi_struct *n); 386extern void __napi_schedule(struct napi_struct *n);
385 387
386static inline int napi_disable_pending(struct napi_struct *n) 388static inline int napi_disable_pending(struct napi_struct *n)
@@ -504,9 +506,9 @@ struct netdev_queue {
504 * please use this field instead of dev->trans_start 506 * please use this field instead of dev->trans_start
505 */ 507 */
506 unsigned long trans_start; 508 unsigned long trans_start;
507 unsigned long tx_bytes; 509 u64 tx_bytes;
508 unsigned long tx_packets; 510 u64 tx_packets;
509 unsigned long tx_dropped; 511 u64 tx_dropped;
510} ____cacheline_aligned_in_smp; 512} ____cacheline_aligned_in_smp;
511 513
512#ifdef CONFIG_RPS 514#ifdef CONFIG_RPS
@@ -660,10 +662,19 @@ struct netdev_rx_queue {
660 * Callback uses when the transmitter has not made any progress 662 * Callback uses when the transmitter has not made any progress
661 * for dev->watchdog ticks. 663 * for dev->watchdog ticks.
662 * 664 *
665 * struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev,
666 * struct rtnl_link_stats64 *storage);
663 * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); 667 * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
664 * Called when a user wants to get the network device usage 668 * Called when a user wants to get the network device usage
665 * statistics. If not defined, the counters in dev->stats will 669 * statistics. Drivers must do one of the following:
666 * be used. 670 * 1. Define @ndo_get_stats64 to fill in a zero-initialised
671 * rtnl_link_stats64 structure passed by the caller.
672 * 2. Define @ndo_get_stats to update a net_device_stats structure
673 * (which should normally be dev->stats) and return a pointer to
674 * it. The structure may be changed asynchronously only if each
675 * field is written atomically.
676 * 3. Update dev->stats asynchronously and atomically, and define
677 * neither operation.
667 * 678 *
668 * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); 679 * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp);
669 * If device support VLAN receive accleration 680 * If device support VLAN receive accleration
@@ -718,6 +729,8 @@ struct net_device_ops {
718 struct neigh_parms *); 729 struct neigh_parms *);
719 void (*ndo_tx_timeout) (struct net_device *dev); 730 void (*ndo_tx_timeout) (struct net_device *dev);
720 731
732 struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev,
733 struct rtnl_link_stats64 *storage);
721 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); 734 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
722 735
723 void (*ndo_vlan_rx_register)(struct net_device *dev, 736 void (*ndo_vlan_rx_register)(struct net_device *dev,
@@ -728,6 +741,8 @@ struct net_device_ops {
728 unsigned short vid); 741 unsigned short vid);
729#ifdef CONFIG_NET_POLL_CONTROLLER 742#ifdef CONFIG_NET_POLL_CONTROLLER
730 void (*ndo_poll_controller)(struct net_device *dev); 743 void (*ndo_poll_controller)(struct net_device *dev);
744 int (*ndo_netpoll_setup)(struct net_device *dev,
745 struct netpoll_info *info);
731 void (*ndo_netpoll_cleanup)(struct net_device *dev); 746 void (*ndo_netpoll_cleanup)(struct net_device *dev);
732#endif 747#endif
733 int (*ndo_set_vf_mac)(struct net_device *dev, 748 int (*ndo_set_vf_mac)(struct net_device *dev,
@@ -847,7 +862,8 @@ struct net_device {
847#define NETIF_F_FSO (SKB_GSO_FCOE << NETIF_F_GSO_SHIFT) 862#define NETIF_F_FSO (SKB_GSO_FCOE << NETIF_F_GSO_SHIFT)
848 863
849 /* List of features with software fallbacks. */ 864 /* List of features with software fallbacks. */
850#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6) 865#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \
866 NETIF_F_TSO6 | NETIF_F_UFO)
851 867
852 868
853#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) 869#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
@@ -908,6 +924,7 @@ struct net_device {
908 924
909 /* Interface address info. */ 925 /* Interface address info. */
910 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ 926 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */
927 unsigned char addr_assign_type; /* hw address assignment type */
911 unsigned char addr_len; /* hardware address length */ 928 unsigned char addr_len; /* hardware address length */
912 unsigned short dev_id; /* for shared network cards */ 929 unsigned short dev_id; /* for shared network cards */
913 930
@@ -957,6 +974,8 @@ struct net_device {
957#endif 974#endif
958 975
959 struct netdev_queue rx_queue; 976 struct netdev_queue rx_queue;
977 rx_handler_func_t *rx_handler;
978 void *rx_handler_data;
960 979
961 struct netdev_queue *_tx ____cacheline_aligned_in_smp; 980 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
962 981
@@ -1024,10 +1043,6 @@ struct net_device {
1024 /* mid-layer private */ 1043 /* mid-layer private */
1025 void *ml_priv; 1044 void *ml_priv;
1026 1045
1027 /* bridge stuff */
1028 struct net_bridge_port *br_port;
1029 /* macvlan */
1030 struct macvlan_port *macvlan_port;
1031 /* GARP */ 1046 /* GARP */
1032 struct garp_port *garp_port; 1047 struct garp_port *garp_port;
1033 1048
@@ -1057,6 +1072,9 @@ struct net_device {
1057#endif 1072#endif
1058 /* n-tuple filter list attached to this device */ 1073 /* n-tuple filter list attached to this device */
1059 struct ethtool_rx_ntuple_list ethtool_ntuple_list; 1074 struct ethtool_rx_ntuple_list ethtool_ntuple_list;
1075
1076 /* phy device may attach itself for hardware timestamping */
1077 struct phy_device *phydev;
1060}; 1078};
1061#define to_net_dev(d) container_of(d, struct net_device, dev) 1079#define to_net_dev(d) container_of(d, struct net_device, dev)
1062 1080
@@ -1087,11 +1105,7 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
1087static inline 1105static inline
1088struct net *dev_net(const struct net_device *dev) 1106struct net *dev_net(const struct net_device *dev)
1089{ 1107{
1090#ifdef CONFIG_NET_NS 1108 return read_pnet(&dev->nd_net);
1091 return dev->nd_net;
1092#else
1093 return &init_net;
1094#endif
1095} 1109}
1096 1110
1097static inline 1111static inline
@@ -1272,8 +1286,8 @@ extern void dev_add_pack(struct packet_type *pt);
1272extern void dev_remove_pack(struct packet_type *pt); 1286extern void dev_remove_pack(struct packet_type *pt);
1273extern void __dev_remove_pack(struct packet_type *pt); 1287extern void __dev_remove_pack(struct packet_type *pt);
1274 1288
1275extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags, 1289extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1276 unsigned short mask); 1290 unsigned short mask);
1277extern struct net_device *dev_get_by_name(struct net *net, const char *name); 1291extern struct net_device *dev_get_by_name(struct net *net, const char *name);
1278extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); 1292extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);
1279extern struct net_device *__dev_get_by_name(struct net *net, const char *name); 1293extern struct net_device *__dev_get_by_name(struct net *net, const char *name);
@@ -1696,6 +1710,11 @@ static inline void napi_free_frags(struct napi_struct *napi)
1696 napi->skb = NULL; 1710 napi->skb = NULL;
1697} 1711}
1698 1712
1713extern int netdev_rx_handler_register(struct net_device *dev,
1714 rx_handler_func_t *rx_handler,
1715 void *rx_handler_data);
1716extern void netdev_rx_handler_unregister(struct net_device *dev);
1717
1699extern void netif_nit_deliver(struct sk_buff *skb); 1718extern void netif_nit_deliver(struct sk_buff *skb);
1700extern int dev_valid_name(const char *name); 1719extern int dev_valid_name(const char *name);
1701extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 1720extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
@@ -1775,6 +1794,8 @@ extern void netif_carrier_on(struct net_device *dev);
1775 1794
1776extern void netif_carrier_off(struct net_device *dev); 1795extern void netif_carrier_off(struct net_device *dev);
1777 1796
1797extern void netif_notify_peers(struct net_device *dev);
1798
1778/** 1799/**
1779 * netif_dormant_on - mark device as dormant. 1800 * netif_dormant_on - mark device as dormant.
1780 * @dev: network device 1801 * @dev: network device
@@ -2119,8 +2140,10 @@ extern void netdev_features_change(struct net_device *dev);
2119/* Load a device via the kmod */ 2140/* Load a device via the kmod */
2120extern void dev_load(struct net *net, const char *name); 2141extern void dev_load(struct net *net, const char *name);
2121extern void dev_mcast_init(void); 2142extern void dev_mcast_init(void);
2122extern const struct net_device_stats *dev_get_stats(struct net_device *dev); 2143extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
2123extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); 2144 struct rtnl_link_stats64 *storage);
2145extern void dev_txq_stats_fold(const struct net_device *dev,
2146 struct rtnl_link_stats64 *stats);
2124 2147
2125extern int netdev_max_backlog; 2148extern int netdev_max_backlog;
2126extern int netdev_tstamp_prequeue; 2149extern int netdev_tstamp_prequeue;
@@ -2230,25 +2253,23 @@ static inline const char *netdev_name(const struct net_device *dev)
2230 return dev->name; 2253 return dev->name;
2231} 2254}
2232 2255
2233#define netdev_printk(level, netdev, format, args...) \ 2256extern int netdev_printk(const char *level, const struct net_device *dev,
2234 dev_printk(level, (netdev)->dev.parent, \ 2257 const char *format, ...)
2235 "%s: " format, \ 2258 __attribute__ ((format (printf, 3, 4)));
2236 netdev_name(netdev), ##args) 2259extern int netdev_emerg(const struct net_device *dev, const char *format, ...)
2237 2260 __attribute__ ((format (printf, 2, 3)));
2238#define netdev_emerg(dev, format, args...) \ 2261extern int netdev_alert(const struct net_device *dev, const char *format, ...)
2239 netdev_printk(KERN_EMERG, dev, format, ##args) 2262 __attribute__ ((format (printf, 2, 3)));
2240#define netdev_alert(dev, format, args...) \ 2263extern int netdev_crit(const struct net_device *dev, const char *format, ...)
2241 netdev_printk(KERN_ALERT, dev, format, ##args) 2264 __attribute__ ((format (printf, 2, 3)));
2242#define netdev_crit(dev, format, args...) \ 2265extern int netdev_err(const struct net_device *dev, const char *format, ...)
2243 netdev_printk(KERN_CRIT, dev, format, ##args) 2266 __attribute__ ((format (printf, 2, 3)));
2244#define netdev_err(dev, format, args...) \ 2267extern int netdev_warn(const struct net_device *dev, const char *format, ...)
2245 netdev_printk(KERN_ERR, dev, format, ##args) 2268 __attribute__ ((format (printf, 2, 3)));
2246#define netdev_warn(dev, format, args...) \ 2269extern int netdev_notice(const struct net_device *dev, const char *format, ...)
2247 netdev_printk(KERN_WARNING, dev, format, ##args) 2270 __attribute__ ((format (printf, 2, 3)));
2248#define netdev_notice(dev, format, args...) \ 2271extern int netdev_info(const struct net_device *dev, const char *format, ...)
2249 netdev_printk(KERN_NOTICE, dev, format, ##args) 2272 __attribute__ ((format (printf, 2, 3)));
2250#define netdev_info(dev, format, args...) \
2251 netdev_printk(KERN_INFO, dev, format, ##args)
2252 2273
2253#if defined(DEBUG) 2274#if defined(DEBUG)
2254#define netdev_dbg(__dev, format, args...) \ 2275#define netdev_dbg(__dev, format, args...) \
@@ -2296,20 +2317,26 @@ do { \
2296 netdev_printk(level, (dev), fmt, ##args); \ 2317 netdev_printk(level, (dev), fmt, ##args); \
2297} while (0) 2318} while (0)
2298 2319
2320#define netif_level(level, priv, type, dev, fmt, args...) \
2321do { \
2322 if (netif_msg_##type(priv)) \
2323 netdev_##level(dev, fmt, ##args); \
2324} while (0)
2325
2299#define netif_emerg(priv, type, dev, fmt, args...) \ 2326#define netif_emerg(priv, type, dev, fmt, args...) \
2300 netif_printk(priv, type, KERN_EMERG, dev, fmt, ##args) 2327 netif_level(emerg, priv, type, dev, fmt, ##args)
2301#define netif_alert(priv, type, dev, fmt, args...) \ 2328#define netif_alert(priv, type, dev, fmt, args...) \
2302 netif_printk(priv, type, KERN_ALERT, dev, fmt, ##args) 2329 netif_level(alert, priv, type, dev, fmt, ##args)
2303#define netif_crit(priv, type, dev, fmt, args...) \ 2330#define netif_crit(priv, type, dev, fmt, args...) \
2304 netif_printk(priv, type, KERN_CRIT, dev, fmt, ##args) 2331 netif_level(crit, priv, type, dev, fmt, ##args)
2305#define netif_err(priv, type, dev, fmt, args...) \ 2332#define netif_err(priv, type, dev, fmt, args...) \
2306 netif_printk(priv, type, KERN_ERR, dev, fmt, ##args) 2333 netif_level(err, priv, type, dev, fmt, ##args)
2307#define netif_warn(priv, type, dev, fmt, args...) \ 2334#define netif_warn(priv, type, dev, fmt, args...) \
2308 netif_printk(priv, type, KERN_WARNING, dev, fmt, ##args) 2335 netif_level(warn, priv, type, dev, fmt, ##args)
2309#define netif_notice(priv, type, dev, fmt, args...) \ 2336#define netif_notice(priv, type, dev, fmt, args...) \
2310 netif_printk(priv, type, KERN_NOTICE, dev, fmt, ##args) 2337 netif_level(notice, priv, type, dev, fmt, ##args)
2311#define netif_info(priv, type, dev, fmt, args...) \ 2338#define netif_info(priv, type, dev, fmt, args...) \
2312 netif_printk(priv, type, KERN_INFO, (dev), fmt, ##args) 2339 netif_level(info, priv, type, dev, fmt, ##args)
2313 2340
2314#if defined(DEBUG) 2341#if defined(DEBUG)
2315#define netif_dbg(priv, type, dev, format, args...) \ 2342#define netif_dbg(priv, type, dev, format, args...) \
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 48767cd16453..edeeabdc1500 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -3,11 +3,13 @@ header-y += nf_conntrack_tuple_common.h
3header-y += nfnetlink_conntrack.h 3header-y += nfnetlink_conntrack.h
4header-y += nfnetlink_log.h 4header-y += nfnetlink_log.h
5header-y += nfnetlink_queue.h 5header-y += nfnetlink_queue.h
6header-y += xt_CHECKSUM.h
6header-y += xt_CLASSIFY.h 7header-y += xt_CLASSIFY.h
7header-y += xt_CONNMARK.h 8header-y += xt_CONNMARK.h
8header-y += xt_CONNSECMARK.h 9header-y += xt_CONNSECMARK.h
9header-y += xt_CT.h 10header-y += xt_CT.h
10header-y += xt_DSCP.h 11header-y += xt_DSCP.h
12header-y += xt_IDLETIMER.h
11header-y += xt_LED.h 13header-y += xt_LED.h
12header-y += xt_MARK.h 14header-y += xt_MARK.h
13header-y += xt_NFLOG.h 15header-y += xt_NFLOG.h
@@ -18,17 +20,19 @@ header-y += xt_TCPMSS.h
18header-y += xt_TCPOPTSTRIP.h 20header-y += xt_TCPOPTSTRIP.h
19header-y += xt_TEE.h 21header-y += xt_TEE.h
20header-y += xt_TPROXY.h 22header-y += xt_TPROXY.h
23header-y += xt_cluster.h
21header-y += xt_comment.h 24header-y += xt_comment.h
22header-y += xt_connbytes.h 25header-y += xt_connbytes.h
23header-y += xt_connlimit.h 26header-y += xt_connlimit.h
24header-y += xt_connmark.h 27header-y += xt_connmark.h
25header-y += xt_conntrack.h 28header-y += xt_conntrack.h
26header-y += xt_cluster.h 29header-y += xt_cpu.h
27header-y += xt_dccp.h 30header-y += xt_dccp.h
28header-y += xt_dscp.h 31header-y += xt_dscp.h
29header-y += xt_esp.h 32header-y += xt_esp.h
30header-y += xt_hashlimit.h 33header-y += xt_hashlimit.h
31header-y += xt_iprange.h 34header-y += xt_iprange.h
35header-y += xt_ipvs.h
32header-y += xt_helper.h 36header-y += xt_helper.h
33header-y += xt_length.h 37header-y += xt_length.h
34header-y += xt_limit.h 38header-y += xt_limit.h
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 14e6d32002c4..1afd18c855ec 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -76,6 +76,10 @@ enum ip_conntrack_status {
76 /* Conntrack is a template */ 76 /* Conntrack is a template */
77 IPS_TEMPLATE_BIT = 11, 77 IPS_TEMPLATE_BIT = 11,
78 IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT), 78 IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT),
79
80 /* Conntrack is a fake untracked entry */
81 IPS_UNTRACKED_BIT = 12,
82 IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),
79}; 83};
80 84
81/* Connection tracking event types */ 85/* Connection tracking event types */
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h
index d3bab7a2c9b7..ea9b8d380527 100644
--- a/include/linux/netfilter/nfnetlink_log.h
+++ b/include/linux/netfilter/nfnetlink_log.h
@@ -89,6 +89,7 @@ enum nfulnl_attr_config {
89#define NFULNL_COPY_NONE 0x00 89#define NFULNL_COPY_NONE 0x00
90#define NFULNL_COPY_META 0x01 90#define NFULNL_COPY_META 0x01
91#define NFULNL_COPY_PACKET 0x02 91#define NFULNL_COPY_PACKET 0x02
92/* 0xff is reserved, don't use it for new copy modes. */
92 93
93#define NFULNL_CFG_F_SEQ 0x0001 94#define NFULNL_CFG_F_SEQ 0x0001
94#define NFULNL_CFG_F_SEQ_GLOBAL 0x0002 95#define NFULNL_CFG_F_SEQ_GLOBAL 0x0002
diff --git a/include/linux/netfilter/xt_CHECKSUM.h b/include/linux/netfilter/xt_CHECKSUM.h
new file mode 100644
index 000000000000..9a2e4661654e
--- /dev/null
+++ b/include/linux/netfilter/xt_CHECKSUM.h
@@ -0,0 +1,20 @@
1/* Header file for iptables ipt_CHECKSUM target
2 *
3 * (C) 2002 by Harald Welte <laforge@gnumonks.org>
4 * (C) 2010 Red Hat Inc
5 * Author: Michael S. Tsirkin <mst@redhat.com>
6 *
7 * This software is distributed under GNU GPL v2, 1991
8*/
9#ifndef _XT_CHECKSUM_TARGET_H
10#define _XT_CHECKSUM_TARGET_H
11
12#include <linux/types.h>
13
14#define XT_CHECKSUM_OP_FILL 0x01 /* fill in checksum in IP header */
15
16struct xt_CHECKSUM_info {
17 __u8 operation; /* bitset of operations */
18};
19
20#endif /* _XT_CHECKSUM_TARGET_H */
diff --git a/include/linux/netfilter/xt_IDLETIMER.h b/include/linux/netfilter/xt_IDLETIMER.h
new file mode 100644
index 000000000000..3e1aa1be942e
--- /dev/null
+++ b/include/linux/netfilter/xt_IDLETIMER.h
@@ -0,0 +1,45 @@
1/*
2 * linux/include/linux/netfilter/xt_IDLETIMER.h
3 *
4 * Header file for Xtables timer target module.
5 *
6 * Copyright (C) 2004, 2010 Nokia Corporation
7 * Written by Timo Teras <ext-timo.teras@nokia.com>
8 *
9 * Converted to x_tables and forward-ported to 2.6.34
10 * by Luciano Coelho <luciano.coelho@nokia.com>
11 *
12 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * version 2 as published by the Free Software Foundation.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 * 02110-1301 USA
27 */
28
29#ifndef _XT_IDLETIMER_H
30#define _XT_IDLETIMER_H
31
32#include <linux/types.h>
33
34#define MAX_IDLETIMER_LABEL_SIZE 28
35
36struct idletimer_tg_info {
37 __u32 timeout;
38
39 char label[MAX_IDLETIMER_LABEL_SIZE];
40
41 /* for kernel module internal use only */
42 struct idletimer_tg *timer __attribute((aligned(8)));
43};
44
45#endif
diff --git a/include/linux/netfilter/xt_cpu.h b/include/linux/netfilter/xt_cpu.h
new file mode 100644
index 000000000000..93c7f11d8f42
--- /dev/null
+++ b/include/linux/netfilter/xt_cpu.h
@@ -0,0 +1,11 @@
1#ifndef _XT_CPU_H
2#define _XT_CPU_H
3
4#include <linux/types.h>
5
6struct xt_cpu_info {
7 __u32 cpu;
8 __u32 invert;
9};
10
11#endif /*_XT_CPU_H*/
diff --git a/include/linux/netfilter/xt_ipvs.h b/include/linux/netfilter/xt_ipvs.h
new file mode 100644
index 000000000000..1167aeb7a347
--- /dev/null
+++ b/include/linux/netfilter/xt_ipvs.h
@@ -0,0 +1,27 @@
1#ifndef _XT_IPVS_H
2#define _XT_IPVS_H
3
4enum {
5 XT_IPVS_IPVS_PROPERTY = 1 << 0, /* all other options imply this one */
6 XT_IPVS_PROTO = 1 << 1,
7 XT_IPVS_VADDR = 1 << 2,
8 XT_IPVS_VPORT = 1 << 3,
9 XT_IPVS_DIR = 1 << 4,
10 XT_IPVS_METHOD = 1 << 5,
11 XT_IPVS_VPORTCTL = 1 << 6,
12 XT_IPVS_MASK = (1 << 7) - 1,
13 XT_IPVS_ONCE_MASK = XT_IPVS_MASK & ~XT_IPVS_IPVS_PROPERTY
14};
15
16struct xt_ipvs_mtinfo {
17 union nf_inet_addr vaddr, vmask;
18 __be16 vport;
19 __u8 l4proto;
20 __u8 fwd_method;
21 __be16 vportctl;
22
23 __u8 invert;
24 __u8 bitmask;
25};
26
27#endif /* _XT_IPVS_H */
diff --git a/include/linux/netfilter/xt_quota.h b/include/linux/netfilter/xt_quota.h
index 8dc89dfc1361..b0d28c659ab7 100644
--- a/include/linux/netfilter/xt_quota.h
+++ b/include/linux/netfilter/xt_quota.h
@@ -11,9 +11,9 @@ struct xt_quota_priv;
11struct xt_quota_info { 11struct xt_quota_info {
12 u_int32_t flags; 12 u_int32_t flags;
13 u_int32_t pad; 13 u_int32_t pad;
14 aligned_u64 quota;
14 15
15 /* Used internally by the kernel */ 16 /* Used internally by the kernel */
16 aligned_u64 quota;
17 struct xt_quota_priv *master; 17 struct xt_quota_priv *master;
18}; 18};
19 19
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h
index 90fa6525ef9c..dcdbadf9fd4a 100644
--- a/include/linux/netfilter_ipv4/ipt_LOG.h
+++ b/include/linux/netfilter_ipv4/ipt_LOG.h
@@ -7,7 +7,8 @@
7#define IPT_LOG_IPOPT 0x04 /* Log IP options */ 7#define IPT_LOG_IPOPT 0x04 /* Log IP options */
8#define IPT_LOG_UID 0x08 /* Log UID owning local socket */ 8#define IPT_LOG_UID 0x08 /* Log UID owning local socket */
9#define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */ 9#define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */
10#define IPT_LOG_MASK 0x1f 10#define IPT_LOG_MACDECODE 0x20 /* Decode MAC header */
11#define IPT_LOG_MASK 0x2f
11 12
12struct ipt_log_info { 13struct ipt_log_info {
13 unsigned char level; 14 unsigned char level;
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h
index 0d0119b0458c..9dd5579e02ec 100644
--- a/include/linux/netfilter_ipv6/ip6t_LOG.h
+++ b/include/linux/netfilter_ipv6/ip6t_LOG.h
@@ -7,7 +7,8 @@
7#define IP6T_LOG_IPOPT 0x04 /* Log IP options */ 7#define IP6T_LOG_IPOPT 0x04 /* Log IP options */
8#define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ 8#define IP6T_LOG_UID 0x08 /* Log UID owning local socket */
9#define IP6T_LOG_NFLOG 0x10 /* Unsupported, don't use */ 9#define IP6T_LOG_NFLOG 0x10 /* Unsupported, don't use */
10#define IP6T_LOG_MASK 0x1f 10#define IP6T_LOG_MACDECODE 0x20 /* Decode MAC header */
11#define IP6T_LOG_MASK 0x2f
11 12
12struct ip6t_log_info { 13struct ip6t_log_info {
13 unsigned char level; 14 unsigned char level;
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index e9e231215865..413742c92d14 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -46,9 +46,11 @@ void netpoll_poll(struct netpoll *np);
46void netpoll_send_udp(struct netpoll *np, const char *msg, int len); 46void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
47void netpoll_print_options(struct netpoll *np); 47void netpoll_print_options(struct netpoll *np);
48int netpoll_parse_options(struct netpoll *np, char *opt); 48int netpoll_parse_options(struct netpoll *np, char *opt);
49int __netpoll_setup(struct netpoll *np);
49int netpoll_setup(struct netpoll *np); 50int netpoll_setup(struct netpoll *np);
50int netpoll_trap(void); 51int netpoll_trap(void);
51void netpoll_set_trap(int trap); 52void netpoll_set_trap(int trap);
53void __netpoll_cleanup(struct netpoll *np);
52void netpoll_cleanup(struct netpoll *np); 54void netpoll_cleanup(struct netpoll *np);
53int __netpoll_rx(struct sk_buff *skb); 55int __netpoll_rx(struct sk_buff *skb);
54void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); 56void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
@@ -57,12 +59,15 @@ void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
57#ifdef CONFIG_NETPOLL 59#ifdef CONFIG_NETPOLL
58static inline bool netpoll_rx(struct sk_buff *skb) 60static inline bool netpoll_rx(struct sk_buff *skb)
59{ 61{
60 struct netpoll_info *npinfo = skb->dev->npinfo; 62 struct netpoll_info *npinfo;
61 unsigned long flags; 63 unsigned long flags;
62 bool ret = false; 64 bool ret = false;
63 65
66 rcu_read_lock_bh();
67 npinfo = rcu_dereference_bh(skb->dev->npinfo);
68
64 if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) 69 if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags))
65 return false; 70 goto out;
66 71
67 spin_lock_irqsave(&npinfo->rx_lock, flags); 72 spin_lock_irqsave(&npinfo->rx_lock, flags);
68 /* check rx_flags again with the lock held */ 73 /* check rx_flags again with the lock held */
@@ -70,12 +75,14 @@ static inline bool netpoll_rx(struct sk_buff *skb)
70 ret = true; 75 ret = true;
71 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 76 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
72 77
78out:
79 rcu_read_unlock_bh();
73 return ret; 80 return ret;
74} 81}
75 82
76static inline int netpoll_rx_on(struct sk_buff *skb) 83static inline int netpoll_rx_on(struct sk_buff *skb)
77{ 84{
78 struct netpoll_info *npinfo = skb->dev->npinfo; 85 struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo);
79 86
80 return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags); 87 return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
81} 88}
@@ -91,7 +98,6 @@ static inline void *netpoll_poll_lock(struct napi_struct *napi)
91{ 98{
92 struct net_device *dev = napi->dev; 99 struct net_device *dev = napi->dev;
93 100
94 rcu_read_lock(); /* deal with race on ->npinfo */
95 if (dev && dev->npinfo) { 101 if (dev && dev->npinfo) {
96 spin_lock(&napi->poll_lock); 102 spin_lock(&napi->poll_lock);
97 napi->poll_owner = smp_processor_id(); 103 napi->poll_owner = smp_processor_id();
@@ -108,7 +114,11 @@ static inline void netpoll_poll_unlock(void *have)
108 napi->poll_owner = -1; 114 napi->poll_owner = -1;
109 spin_unlock(&napi->poll_lock); 115 spin_unlock(&napi->poll_lock);
110 } 116 }
111 rcu_read_unlock(); 117}
118
119static inline int netpoll_tx_running(struct net_device *dev)
120{
121 return irqs_disabled();
112} 122}
113 123
114#else 124#else
@@ -134,6 +144,10 @@ static inline void netpoll_poll_unlock(void *have)
134static inline void netpoll_netdev_init(struct net_device *dev) 144static inline void netpoll_netdev_init(struct net_device *dev)
135{ 145{
136} 146}
147static inline int netpoll_tx_running(struct net_device *dev)
148{
149 return 0;
150}
137#endif 151#endif
138 152
139#endif 153#endif
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index b7c77f9712f4..2c8701687336 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -132,7 +132,7 @@
132 * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and 132 * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
133 * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP. 133 * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
134 * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain 134 * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
135 * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will 135 * to the specified ISO/IEC 3166-1 alpha2 country code. The core will
136 * store this as a valid request and then query userspace for it. 136 * store this as a valid request and then query userspace for it.
137 * 137 *
138 * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the 138 * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the
@@ -725,6 +725,12 @@ enum nl80211_commands {
725 * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations 725 * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
726 * connected to this BSS. 726 * connected to this BSS.
727 * 727 *
728 * @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See
729 * &enum nl80211_tx_power_setting for possible values.
730 * @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units.
731 * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
732 * for non-automatic settings.
733 *
728 * @NL80211_ATTR_MAX: highest attribute number currently defined 734 * @NL80211_ATTR_MAX: highest attribute number currently defined
729 * @__NL80211_ATTR_AFTER_LAST: internal use 735 * @__NL80211_ATTR_AFTER_LAST: internal use
730 */ 736 */
@@ -882,6 +888,9 @@ enum nl80211_attrs {
882 888
883 NL80211_ATTR_AP_ISOLATE, 889 NL80211_ATTR_AP_ISOLATE,
884 890
891 NL80211_ATTR_WIPHY_TX_POWER_SETTING,
892 NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
893
885 /* add attributes here, update the policy in nl80211.c */ 894 /* add attributes here, update the policy in nl80211.c */
886 895
887 __NL80211_ATTR_AFTER_LAST, 896 __NL80211_ATTR_AFTER_LAST,
@@ -1659,4 +1668,17 @@ enum nl80211_cqm_rssi_threshold_event {
1659 NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, 1668 NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
1660}; 1669};
1661 1670
1671
1672/**
1673 * enum nl80211_tx_power_setting - TX power adjustment
1674 * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power
1675 * @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter
1676 * @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter
1677 */
1678enum nl80211_tx_power_setting {
1679 NL80211_TX_POWER_AUTOMATIC,
1680 NL80211_TX_POWER_LIMITED,
1681 NL80211_TX_POWER_FIXED,
1682};
1683
1662#endif /* __LINUX_NL80211_H */ 1684#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 540703b555cb..b2f1a4d83550 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -210,6 +210,7 @@ static inline int notifier_to_errno(int ret)
210#define NETDEV_POST_INIT 0x0010 210#define NETDEV_POST_INIT 0x0010
211#define NETDEV_UNREGISTER_BATCH 0x0011 211#define NETDEV_UNREGISTER_BATCH 0x0011
212#define NETDEV_BONDING_DESLAVE 0x0012 212#define NETDEV_BONDING_DESLAVE 0x0012
213#define NETDEV_NOTIFY_PEERS 0x0013
213 214
214#define SYS_DOWN 0x0001 /* Notify of system down */ 215#define SYS_DOWN 0x0001 /* Notify of system down */
215#define SYS_RESTART SYS_DOWN 216#define SYS_RESTART SYS_DOWN
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3bedcc149c84..e69612cace61 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1494,6 +1494,9 @@
1494#define PCI_DEVICE_ID_SBE_WANXL100 0x0301 1494#define PCI_DEVICE_ID_SBE_WANXL100 0x0301
1495#define PCI_DEVICE_ID_SBE_WANXL200 0x0302 1495#define PCI_DEVICE_ID_SBE_WANXL200 0x0302
1496#define PCI_DEVICE_ID_SBE_WANXL400 0x0104 1496#define PCI_DEVICE_ID_SBE_WANXL400 0x0104
1497#define PCI_SUBDEVICE_ID_SBE_T3E3 0x0009
1498#define PCI_SUBDEVICE_ID_SBE_2T3E3_P0 0x0901
1499#define PCI_SUBDEVICE_ID_SBE_2T3E3_P1 0x0902
1497 1500
1498#define PCI_VENDOR_ID_TOSHIBA 0x1179 1501#define PCI_VENDOR_ID_TOSHIBA 0x1179
1499#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0101 1502#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0101
@@ -2054,7 +2057,6 @@
2054#define PCI_DEVICE_ID_NX2_57711E 0x1650 2057#define PCI_DEVICE_ID_NX2_57711E 0x1650
2055#define PCI_DEVICE_ID_TIGON3_5705 0x1653 2058#define PCI_DEVICE_ID_TIGON3_5705 0x1653
2056#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 2059#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
2057#define PCI_DEVICE_ID_TIGON3_5720 0x1658
2058#define PCI_DEVICE_ID_TIGON3_5721 0x1659 2060#define PCI_DEVICE_ID_TIGON3_5721 0x1659
2059#define PCI_DEVICE_ID_TIGON3_5722 0x165a 2061#define PCI_DEVICE_ID_TIGON3_5722 0x165a
2060#define PCI_DEVICE_ID_TIGON3_5723 0x165b 2062#define PCI_DEVICE_ID_TIGON3_5723 0x165b
@@ -2068,13 +2070,11 @@
2068#define PCI_DEVICE_ID_TIGON3_5754M 0x1672 2070#define PCI_DEVICE_ID_TIGON3_5754M 0x1672
2069#define PCI_DEVICE_ID_TIGON3_5755M 0x1673 2071#define PCI_DEVICE_ID_TIGON3_5755M 0x1673
2070#define PCI_DEVICE_ID_TIGON3_5756 0x1674 2072#define PCI_DEVICE_ID_TIGON3_5756 0x1674
2071#define PCI_DEVICE_ID_TIGON3_5750 0x1676
2072#define PCI_DEVICE_ID_TIGON3_5751 0x1677 2073#define PCI_DEVICE_ID_TIGON3_5751 0x1677
2073#define PCI_DEVICE_ID_TIGON3_5715 0x1678 2074#define PCI_DEVICE_ID_TIGON3_5715 0x1678
2074#define PCI_DEVICE_ID_TIGON3_5715S 0x1679 2075#define PCI_DEVICE_ID_TIGON3_5715S 0x1679
2075#define PCI_DEVICE_ID_TIGON3_5754 0x167a 2076#define PCI_DEVICE_ID_TIGON3_5754 0x167a
2076#define PCI_DEVICE_ID_TIGON3_5755 0x167b 2077#define PCI_DEVICE_ID_TIGON3_5755 0x167b
2077#define PCI_DEVICE_ID_TIGON3_5750M 0x167c
2078#define PCI_DEVICE_ID_TIGON3_5751M 0x167d 2078#define PCI_DEVICE_ID_TIGON3_5751M 0x167d
2079#define PCI_DEVICE_ID_TIGON3_5751F 0x167e 2079#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
2080#define PCI_DEVICE_ID_TIGON3_5787F 0x167f 2080#define PCI_DEVICE_ID_TIGON3_5787F 0x167f
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index e5126cff9b2a..24426c3d6b5a 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -56,7 +56,7 @@ struct phonethdr {
56 __be16 pn_length; 56 __be16 pn_length;
57 __u8 pn_robj; 57 __u8 pn_robj;
58 __u8 pn_sobj; 58 __u8 pn_sobj;
59} __attribute__((packed)); 59} __packed;
60 60
61/* Common Phonet payload header */ 61/* Common Phonet payload header */
62struct phonetmsg { 62struct phonetmsg {
@@ -98,7 +98,7 @@ struct sockaddr_pn {
98 __u8 spn_dev; 98 __u8 spn_dev;
99 __u8 spn_resource; 99 __u8 spn_resource;
100 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; 100 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3];
101} __attribute__ ((packed)); 101} __packed;
102 102
103/* Well known address */ 103/* Well known address */
104#define PN_DEV_PC 0x10 104#define PN_DEV_PC 0x10
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 987e111f7b11..6b0a782c6224 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -234,6 +234,8 @@ enum phy_state {
234 PHY_RESUMING 234 PHY_RESUMING
235}; 235};
236 236
237struct sk_buff;
238
237/* phy_device: An instance of a PHY 239/* phy_device: An instance of a PHY
238 * 240 *
239 * drv: Pointer to the driver for this PHY instance 241 * drv: Pointer to the driver for this PHY instance
@@ -402,6 +404,26 @@ struct phy_driver {
402 /* Clears up any memory if needed */ 404 /* Clears up any memory if needed */
403 void (*remove)(struct phy_device *phydev); 405 void (*remove)(struct phy_device *phydev);
404 406
407 /* Handles SIOCSHWTSTAMP ioctl for hardware time stamping. */
408 int (*hwtstamp)(struct phy_device *phydev, struct ifreq *ifr);
409
410 /*
411 * Requests a Rx timestamp for 'skb'. If the skb is accepted,
412 * the phy driver promises to deliver it using netif_rx() as
413 * soon as a timestamp becomes available. One of the
414 * PTP_CLASS_ values is passed in 'type'. The function must
415 * return true if the skb is accepted for delivery.
416 */
417 bool (*rxtstamp)(struct phy_device *dev, struct sk_buff *skb, int type);
418
419 /*
420 * Requests a Tx timestamp for 'skb'. The phy driver promises
421 * to deliver it to the socket's error queue as soon as a
422 * timestamp becomes available. One of the PTP_CLASS_ values
423 * is passed in 'type'.
424 */
425 void (*txtstamp)(struct phy_device *dev, struct sk_buff *skb, int type);
426
405 struct device_driver driver; 427 struct device_driver driver;
406}; 428};
407#define to_phy_driver(d) container_of(d, struct phy_driver, driver) 429#define to_phy_driver(d) container_of(d, struct phy_driver, driver)
@@ -498,7 +520,7 @@ void phy_stop_machine(struct phy_device *phydev);
498int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); 520int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
499int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); 521int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
500int phy_mii_ioctl(struct phy_device *phydev, 522int phy_mii_ioctl(struct phy_device *phydev,
501 struct mii_ioctl_data *mii_data, int cmd); 523 struct ifreq *ifr, int cmd);
502int phy_start_interrupts(struct phy_device *phydev); 524int phy_start_interrupts(struct phy_device *phydev);
503void phy_print_status(struct phy_device *phydev); 525void phy_print_status(struct phy_device *phydev);
504struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id); 526struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id);
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h
new file mode 100644
index 000000000000..943a85ab0020
--- /dev/null
+++ b/include/linux/ptp_classify.h
@@ -0,0 +1,126 @@
1/*
2 * PTP 1588 support
3 *
4 * This file implements a BPF that recognizes PTP event messages.
5 *
6 * Copyright (C) 2010 OMICRON electronics GmbH
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#ifndef _PTP_CLASSIFY_H_
24#define _PTP_CLASSIFY_H_
25
26#include <linux/if_ether.h>
27#include <linux/if_vlan.h>
28#include <linux/filter.h>
29#ifdef __KERNEL__
30#include <linux/in.h>
31#else
32#include <netinet/in.h>
33#endif
34
35#define PTP_CLASS_NONE 0x00 /* not a PTP event message */
36#define PTP_CLASS_V1 0x01 /* protocol version 1 */
37#define PTP_CLASS_V2 0x02 /* protocol version 2 */
38#define PTP_CLASS_VMASK 0x0f /* max protocol version is 15 */
39#define PTP_CLASS_IPV4 0x10 /* event in an IPV4 UDP packet */
40#define PTP_CLASS_IPV6 0x20 /* event in an IPV6 UDP packet */
41#define PTP_CLASS_L2 0x30 /* event in a L2 packet */
42#define PTP_CLASS_VLAN 0x40 /* event in a VLAN tagged L2 packet */
43#define PTP_CLASS_PMASK 0xf0 /* mask for the packet type field */
44
45#define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4)
46#define PTP_CLASS_V1_IPV6 (PTP_CLASS_V1 | PTP_CLASS_IPV6) /*probably DNE*/
47#define PTP_CLASS_V2_IPV4 (PTP_CLASS_V2 | PTP_CLASS_IPV4)
48#define PTP_CLASS_V2_IPV6 (PTP_CLASS_V2 | PTP_CLASS_IPV6)
49#define PTP_CLASS_V2_L2 (PTP_CLASS_V2 | PTP_CLASS_L2)
50#define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN)
51
52#define PTP_EV_PORT 319
53
54#define OFF_ETYPE 12
55#define OFF_IHL 14
56#define OFF_FRAG 20
57#define OFF_PROTO4 23
58#define OFF_NEXT 6
59#define OFF_UDP_DST 2
60
61#define IP6_HLEN 40
62#define UDP_HLEN 8
63
64#define RELOFF_DST4 (ETH_HLEN + OFF_UDP_DST)
65#define OFF_DST6 (ETH_HLEN + IP6_HLEN + OFF_UDP_DST)
66#define OFF_PTP6 (ETH_HLEN + IP6_HLEN + UDP_HLEN)
67
68#define OP_AND (BPF_ALU | BPF_AND | BPF_K)
69#define OP_JEQ (BPF_JMP | BPF_JEQ | BPF_K)
70#define OP_JSET (BPF_JMP | BPF_JSET | BPF_K)
71#define OP_LDB (BPF_LD | BPF_B | BPF_ABS)
72#define OP_LDH (BPF_LD | BPF_H | BPF_ABS)
73#define OP_LDHI (BPF_LD | BPF_H | BPF_IND)
74#define OP_LDX (BPF_LDX | BPF_B | BPF_MSH)
75#define OP_OR (BPF_ALU | BPF_OR | BPF_K)
76#define OP_RETA (BPF_RET | BPF_A)
77#define OP_RETK (BPF_RET | BPF_K)
78
79static inline int ptp_filter_init(struct sock_filter *f, int len)
80{
81 if (OP_LDH == f[0].code)
82 return sk_chk_filter(f, len);
83 else
84 return 0;
85}
86
87#define PTP_FILTER \
88 {OP_LDH, 0, 0, OFF_ETYPE }, /* */ \
89 {OP_JEQ, 0, 12, ETH_P_IP }, /* f goto L20 */ \
90 {OP_LDB, 0, 0, OFF_PROTO4 }, /* */ \
91 {OP_JEQ, 0, 9, IPPROTO_UDP }, /* f goto L10 */ \
92 {OP_LDH, 0, 0, OFF_FRAG }, /* */ \
93 {OP_JSET, 7, 0, 0x1fff }, /* t goto L11 */ \
94 {OP_LDX, 0, 0, OFF_IHL }, /* */ \
95 {OP_LDHI, 0, 0, RELOFF_DST4 }, /* */ \
96 {OP_JEQ, 0, 4, PTP_EV_PORT }, /* f goto L12 */ \
97 {OP_LDHI, 0, 0, ETH_HLEN + UDP_HLEN }, /* */ \
98 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
99 {OP_OR, 0, 0, PTP_CLASS_IPV4 }, /* */ \
100 {OP_RETA, 0, 0, 0 }, /* */ \
101/*L1x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \
102/*L20*/ {OP_JEQ, 0, 9, ETH_P_IPV6 }, /* f goto L40 */ \
103 {OP_LDB, 0, 0, ETH_HLEN + OFF_NEXT }, /* */ \
104 {OP_JEQ, 0, 6, IPPROTO_UDP }, /* f goto L30 */ \
105 {OP_LDH, 0, 0, OFF_DST6 }, /* */ \
106 {OP_JEQ, 0, 4, PTP_EV_PORT }, /* f goto L31 */ \
107 {OP_LDH, 0, 0, OFF_PTP6 }, /* */ \
108 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
109 {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \
110 {OP_RETA, 0, 0, 0 }, /* */ \
111/*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \
112/*L40*/ {OP_JEQ, 0, 6, ETH_P_8021Q }, /* f goto L50 */ \
113 {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \
114 {OP_JEQ, 0, 9, ETH_P_1588 }, /* f goto L60 */ \
115 {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
116 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
117 {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \
118 {OP_RETA, 0, 0, 0 }, /* */ \
119/*L50*/ {OP_JEQ, 0, 4, ETH_P_1588 }, /* f goto L61 */ \
120 {OP_LDH, 0, 0, ETH_HLEN }, /* */ \
121 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
122 {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \
123 {OP_RETA, 0, 0, 0 }, /* */ \
124/*L6x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE },
125
126#endif
diff --git a/include/linux/rds.h b/include/linux/rds.h
index cab4994c2f63..24bce3ded9ea 100644
--- a/include/linux/rds.h
+++ b/include/linux/rds.h
@@ -100,7 +100,7 @@
100struct rds_info_counter { 100struct rds_info_counter {
101 u_int8_t name[32]; 101 u_int8_t name[32];
102 u_int64_t value; 102 u_int64_t value;
103} __attribute__((packed)); 103} __packed;
104 104
105#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 105#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
106#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02 106#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02
@@ -115,7 +115,7 @@ struct rds_info_connection {
115 __be32 faddr; 115 __be32 faddr;
116 u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */ 116 u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */
117 u_int8_t flags; 117 u_int8_t flags;
118} __attribute__((packed)); 118} __packed;
119 119
120struct rds_info_flow { 120struct rds_info_flow {
121 __be32 laddr; 121 __be32 laddr;
@@ -123,7 +123,7 @@ struct rds_info_flow {
123 u_int32_t bytes; 123 u_int32_t bytes;
124 __be16 lport; 124 __be16 lport;
125 __be16 fport; 125 __be16 fport;
126} __attribute__((packed)); 126} __packed;
127 127
128#define RDS_INFO_MESSAGE_FLAG_ACK 0x01 128#define RDS_INFO_MESSAGE_FLAG_ACK 0x01
129#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 129#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
@@ -136,7 +136,7 @@ struct rds_info_message {
136 __be16 lport; 136 __be16 lport;
137 __be16 fport; 137 __be16 fport;
138 u_int8_t flags; 138 u_int8_t flags;
139} __attribute__((packed)); 139} __packed;
140 140
141struct rds_info_socket { 141struct rds_info_socket {
142 u_int32_t sndbuf; 142 u_int32_t sndbuf;
@@ -146,7 +146,7 @@ struct rds_info_socket {
146 __be16 connected_port; 146 __be16 connected_port;
147 u_int32_t rcvbuf; 147 u_int32_t rcvbuf;
148 u_int64_t inum; 148 u_int64_t inum;
149} __attribute__((packed)); 149} __packed;
150 150
151struct rds_info_tcp_socket { 151struct rds_info_tcp_socket {
152 __be32 local_addr; 152 __be32 local_addr;
@@ -158,7 +158,7 @@ struct rds_info_tcp_socket {
158 u_int32_t last_sent_nxt; 158 u_int32_t last_sent_nxt;
159 u_int32_t last_expected_una; 159 u_int32_t last_expected_una;
160 u_int32_t last_seen_una; 160 u_int32_t last_seen_una;
161} __attribute__((packed)); 161} __packed;
162 162
163#define RDS_IB_GID_LEN 16 163#define RDS_IB_GID_LEN 16
164struct rds_info_rdma_connection { 164struct rds_info_rdma_connection {
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index fbc8cb0d48c3..58d44491880f 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -282,6 +282,7 @@ enum rtattr_type_t {
282 RTA_SESSION, /* no longer used */ 282 RTA_SESSION, /* no longer used */
283 RTA_MP_ALGO, /* no longer used */ 283 RTA_MP_ALGO, /* no longer used */
284 RTA_TABLE, 284 RTA_TABLE,
285 RTA_MARK,
285 __RTA_MAX 286 __RTA_MAX
286}; 287};
287 288
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index c20d3ce673c0..c11a28706fa4 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -61,7 +61,7 @@ typedef struct sctphdr {
61 __be16 dest; 61 __be16 dest;
62 __be32 vtag; 62 __be32 vtag;
63 __le32 checksum; 63 __le32 checksum;
64} __attribute__((packed)) sctp_sctphdr_t; 64} __packed sctp_sctphdr_t;
65 65
66#ifdef __KERNEL__ 66#ifdef __KERNEL__
67#include <linux/skbuff.h> 67#include <linux/skbuff.h>
@@ -77,7 +77,7 @@ typedef struct sctp_chunkhdr {
77 __u8 type; 77 __u8 type;
78 __u8 flags; 78 __u8 flags;
79 __be16 length; 79 __be16 length;
80} __attribute__((packed)) sctp_chunkhdr_t; 80} __packed sctp_chunkhdr_t;
81 81
82 82
83/* Section 3.2. Chunk Type Values. 83/* Section 3.2. Chunk Type Values.
@@ -167,7 +167,7 @@ enum { SCTP_CHUNK_FLAG_T = 0x01 };
167typedef struct sctp_paramhdr { 167typedef struct sctp_paramhdr {
168 __be16 type; 168 __be16 type;
169 __be16 length; 169 __be16 length;
170} __attribute__((packed)) sctp_paramhdr_t; 170} __packed sctp_paramhdr_t;
171 171
172typedef enum { 172typedef enum {
173 173
@@ -228,12 +228,12 @@ typedef struct sctp_datahdr {
228 __be16 ssn; 228 __be16 ssn;
229 __be32 ppid; 229 __be32 ppid;
230 __u8 payload[0]; 230 __u8 payload[0];
231} __attribute__((packed)) sctp_datahdr_t; 231} __packed sctp_datahdr_t;
232 232
233typedef struct sctp_data_chunk { 233typedef struct sctp_data_chunk {
234 sctp_chunkhdr_t chunk_hdr; 234 sctp_chunkhdr_t chunk_hdr;
235 sctp_datahdr_t data_hdr; 235 sctp_datahdr_t data_hdr;
236} __attribute__((packed)) sctp_data_chunk_t; 236} __packed sctp_data_chunk_t;
237 237
238/* DATA Chuck Specific Flags */ 238/* DATA Chuck Specific Flags */
239enum { 239enum {
@@ -259,78 +259,78 @@ typedef struct sctp_inithdr {
259 __be16 num_inbound_streams; 259 __be16 num_inbound_streams;
260 __be32 initial_tsn; 260 __be32 initial_tsn;
261 __u8 params[0]; 261 __u8 params[0];
262} __attribute__((packed)) sctp_inithdr_t; 262} __packed sctp_inithdr_t;
263 263
264typedef struct sctp_init_chunk { 264typedef struct sctp_init_chunk {
265 sctp_chunkhdr_t chunk_hdr; 265 sctp_chunkhdr_t chunk_hdr;
266 sctp_inithdr_t init_hdr; 266 sctp_inithdr_t init_hdr;
267} __attribute__((packed)) sctp_init_chunk_t; 267} __packed sctp_init_chunk_t;
268 268
269 269
270/* Section 3.3.2.1. IPv4 Address Parameter (5) */ 270/* Section 3.3.2.1. IPv4 Address Parameter (5) */
271typedef struct sctp_ipv4addr_param { 271typedef struct sctp_ipv4addr_param {
272 sctp_paramhdr_t param_hdr; 272 sctp_paramhdr_t param_hdr;
273 struct in_addr addr; 273 struct in_addr addr;
274} __attribute__((packed)) sctp_ipv4addr_param_t; 274} __packed sctp_ipv4addr_param_t;
275 275
276/* Section 3.3.2.1. IPv6 Address Parameter (6) */ 276/* Section 3.3.2.1. IPv6 Address Parameter (6) */
277typedef struct sctp_ipv6addr_param { 277typedef struct sctp_ipv6addr_param {
278 sctp_paramhdr_t param_hdr; 278 sctp_paramhdr_t param_hdr;
279 struct in6_addr addr; 279 struct in6_addr addr;
280} __attribute__((packed)) sctp_ipv6addr_param_t; 280} __packed sctp_ipv6addr_param_t;
281 281
282/* Section 3.3.2.1 Cookie Preservative (9) */ 282/* Section 3.3.2.1 Cookie Preservative (9) */
283typedef struct sctp_cookie_preserve_param { 283typedef struct sctp_cookie_preserve_param {
284 sctp_paramhdr_t param_hdr; 284 sctp_paramhdr_t param_hdr;
285 __be32 lifespan_increment; 285 __be32 lifespan_increment;
286} __attribute__((packed)) sctp_cookie_preserve_param_t; 286} __packed sctp_cookie_preserve_param_t;
287 287
288/* Section 3.3.2.1 Host Name Address (11) */ 288/* Section 3.3.2.1 Host Name Address (11) */
289typedef struct sctp_hostname_param { 289typedef struct sctp_hostname_param {
290 sctp_paramhdr_t param_hdr; 290 sctp_paramhdr_t param_hdr;
291 uint8_t hostname[0]; 291 uint8_t hostname[0];
292} __attribute__((packed)) sctp_hostname_param_t; 292} __packed sctp_hostname_param_t;
293 293
294/* Section 3.3.2.1 Supported Address Types (12) */ 294/* Section 3.3.2.1 Supported Address Types (12) */
295typedef struct sctp_supported_addrs_param { 295typedef struct sctp_supported_addrs_param {
296 sctp_paramhdr_t param_hdr; 296 sctp_paramhdr_t param_hdr;
297 __be16 types[0]; 297 __be16 types[0];
298} __attribute__((packed)) sctp_supported_addrs_param_t; 298} __packed sctp_supported_addrs_param_t;
299 299
300/* Appendix A. ECN Capable (32768) */ 300/* Appendix A. ECN Capable (32768) */
301typedef struct sctp_ecn_capable_param { 301typedef struct sctp_ecn_capable_param {
302 sctp_paramhdr_t param_hdr; 302 sctp_paramhdr_t param_hdr;
303} __attribute__((packed)) sctp_ecn_capable_param_t; 303} __packed sctp_ecn_capable_param_t;
304 304
305/* ADDIP Section 3.2.6 Adaptation Layer Indication */ 305/* ADDIP Section 3.2.6 Adaptation Layer Indication */
306typedef struct sctp_adaptation_ind_param { 306typedef struct sctp_adaptation_ind_param {
307 struct sctp_paramhdr param_hdr; 307 struct sctp_paramhdr param_hdr;
308 __be32 adaptation_ind; 308 __be32 adaptation_ind;
309} __attribute__((packed)) sctp_adaptation_ind_param_t; 309} __packed sctp_adaptation_ind_param_t;
310 310
311/* ADDIP Section 4.2.7 Supported Extensions Parameter */ 311/* ADDIP Section 4.2.7 Supported Extensions Parameter */
312typedef struct sctp_supported_ext_param { 312typedef struct sctp_supported_ext_param {
313 struct sctp_paramhdr param_hdr; 313 struct sctp_paramhdr param_hdr;
314 __u8 chunks[0]; 314 __u8 chunks[0];
315} __attribute__((packed)) sctp_supported_ext_param_t; 315} __packed sctp_supported_ext_param_t;
316 316
317/* AUTH Section 3.1 Random */ 317/* AUTH Section 3.1 Random */
318typedef struct sctp_random_param { 318typedef struct sctp_random_param {
319 sctp_paramhdr_t param_hdr; 319 sctp_paramhdr_t param_hdr;
320 __u8 random_val[0]; 320 __u8 random_val[0];
321} __attribute__((packed)) sctp_random_param_t; 321} __packed sctp_random_param_t;
322 322
323/* AUTH Section 3.2 Chunk List */ 323/* AUTH Section 3.2 Chunk List */
324typedef struct sctp_chunks_param { 324typedef struct sctp_chunks_param {
325 sctp_paramhdr_t param_hdr; 325 sctp_paramhdr_t param_hdr;
326 __u8 chunks[0]; 326 __u8 chunks[0];
327} __attribute__((packed)) sctp_chunks_param_t; 327} __packed sctp_chunks_param_t;
328 328
329/* AUTH Section 3.3 HMAC Algorithm */ 329/* AUTH Section 3.3 HMAC Algorithm */
330typedef struct sctp_hmac_algo_param { 330typedef struct sctp_hmac_algo_param {
331 sctp_paramhdr_t param_hdr; 331 sctp_paramhdr_t param_hdr;
332 __be16 hmac_ids[0]; 332 __be16 hmac_ids[0];
333} __attribute__((packed)) sctp_hmac_algo_param_t; 333} __packed sctp_hmac_algo_param_t;
334 334
335/* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): 335/* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2):
336 * The INIT ACK chunk is used to acknowledge the initiation of an SCTP 336 * The INIT ACK chunk is used to acknowledge the initiation of an SCTP
@@ -342,13 +342,13 @@ typedef sctp_init_chunk_t sctp_initack_chunk_t;
342typedef struct sctp_cookie_param { 342typedef struct sctp_cookie_param {
343 sctp_paramhdr_t p; 343 sctp_paramhdr_t p;
344 __u8 body[0]; 344 __u8 body[0];
345} __attribute__((packed)) sctp_cookie_param_t; 345} __packed sctp_cookie_param_t;
346 346
347/* Section 3.3.3.1 Unrecognized Parameters (8) */ 347/* Section 3.3.3.1 Unrecognized Parameters (8) */
348typedef struct sctp_unrecognized_param { 348typedef struct sctp_unrecognized_param {
349 sctp_paramhdr_t param_hdr; 349 sctp_paramhdr_t param_hdr;
350 sctp_paramhdr_t unrecognized; 350 sctp_paramhdr_t unrecognized;
351} __attribute__((packed)) sctp_unrecognized_param_t; 351} __packed sctp_unrecognized_param_t;
352 352
353 353
354 354
@@ -363,7 +363,7 @@ typedef struct sctp_unrecognized_param {
363typedef struct sctp_gap_ack_block { 363typedef struct sctp_gap_ack_block {
364 __be16 start; 364 __be16 start;
365 __be16 end; 365 __be16 end;
366} __attribute__((packed)) sctp_gap_ack_block_t; 366} __packed sctp_gap_ack_block_t;
367 367
368typedef __be32 sctp_dup_tsn_t; 368typedef __be32 sctp_dup_tsn_t;
369 369
@@ -378,12 +378,12 @@ typedef struct sctp_sackhdr {
378 __be16 num_gap_ack_blocks; 378 __be16 num_gap_ack_blocks;
379 __be16 num_dup_tsns; 379 __be16 num_dup_tsns;
380 sctp_sack_variable_t variable[0]; 380 sctp_sack_variable_t variable[0];
381} __attribute__((packed)) sctp_sackhdr_t; 381} __packed sctp_sackhdr_t;
382 382
383typedef struct sctp_sack_chunk { 383typedef struct sctp_sack_chunk {
384 sctp_chunkhdr_t chunk_hdr; 384 sctp_chunkhdr_t chunk_hdr;
385 sctp_sackhdr_t sack_hdr; 385 sctp_sackhdr_t sack_hdr;
386} __attribute__((packed)) sctp_sack_chunk_t; 386} __packed sctp_sack_chunk_t;
387 387
388 388
389/* RFC 2960. Section 3.3.5 Heartbeat Request (HEARTBEAT) (4): 389/* RFC 2960. Section 3.3.5 Heartbeat Request (HEARTBEAT) (4):
@@ -395,12 +395,12 @@ typedef struct sctp_sack_chunk {
395 395
396typedef struct sctp_heartbeathdr { 396typedef struct sctp_heartbeathdr {
397 sctp_paramhdr_t info; 397 sctp_paramhdr_t info;
398} __attribute__((packed)) sctp_heartbeathdr_t; 398} __packed sctp_heartbeathdr_t;
399 399
400typedef struct sctp_heartbeat_chunk { 400typedef struct sctp_heartbeat_chunk {
401 sctp_chunkhdr_t chunk_hdr; 401 sctp_chunkhdr_t chunk_hdr;
402 sctp_heartbeathdr_t hb_hdr; 402 sctp_heartbeathdr_t hb_hdr;
403} __attribute__((packed)) sctp_heartbeat_chunk_t; 403} __packed sctp_heartbeat_chunk_t;
404 404
405 405
406/* For the abort and shutdown ACK we must carry the init tag in the 406/* For the abort and shutdown ACK we must carry the init tag in the
@@ -409,7 +409,7 @@ typedef struct sctp_heartbeat_chunk {
409 */ 409 */
410typedef struct sctp_abort_chunk { 410typedef struct sctp_abort_chunk {
411 sctp_chunkhdr_t uh; 411 sctp_chunkhdr_t uh;
412} __attribute__((packed)) sctp_abort_chunk_t; 412} __packed sctp_abort_chunk_t;
413 413
414 414
415/* For the graceful shutdown we must carry the tag (in common header) 415/* For the graceful shutdown we must carry the tag (in common header)
@@ -417,12 +417,12 @@ typedef struct sctp_abort_chunk {
417 */ 417 */
418typedef struct sctp_shutdownhdr { 418typedef struct sctp_shutdownhdr {
419 __be32 cum_tsn_ack; 419 __be32 cum_tsn_ack;
420} __attribute__((packed)) sctp_shutdownhdr_t; 420} __packed sctp_shutdownhdr_t;
421 421
422struct sctp_shutdown_chunk_t { 422struct sctp_shutdown_chunk_t {
423 sctp_chunkhdr_t chunk_hdr; 423 sctp_chunkhdr_t chunk_hdr;
424 sctp_shutdownhdr_t shutdown_hdr; 424 sctp_shutdownhdr_t shutdown_hdr;
425} __attribute__ ((packed)); 425} __packed;
426 426
427/* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ 427/* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */
428 428
@@ -430,12 +430,12 @@ typedef struct sctp_errhdr {
430 __be16 cause; 430 __be16 cause;
431 __be16 length; 431 __be16 length;
432 __u8 variable[0]; 432 __u8 variable[0];
433} __attribute__((packed)) sctp_errhdr_t; 433} __packed sctp_errhdr_t;
434 434
435typedef struct sctp_operr_chunk { 435typedef struct sctp_operr_chunk {
436 sctp_chunkhdr_t chunk_hdr; 436 sctp_chunkhdr_t chunk_hdr;
437 sctp_errhdr_t err_hdr; 437 sctp_errhdr_t err_hdr;
438} __attribute__((packed)) sctp_operr_chunk_t; 438} __packed sctp_operr_chunk_t;
439 439
440/* RFC 2960 3.3.10 - Operation Error 440/* RFC 2960 3.3.10 - Operation Error
441 * 441 *
@@ -525,7 +525,7 @@ typedef struct sctp_ecnehdr {
525typedef struct sctp_ecne_chunk { 525typedef struct sctp_ecne_chunk {
526 sctp_chunkhdr_t chunk_hdr; 526 sctp_chunkhdr_t chunk_hdr;
527 sctp_ecnehdr_t ence_hdr; 527 sctp_ecnehdr_t ence_hdr;
528} __attribute__((packed)) sctp_ecne_chunk_t; 528} __packed sctp_ecne_chunk_t;
529 529
530/* RFC 2960. Appendix A. Explicit Congestion Notification. 530/* RFC 2960. Appendix A. Explicit Congestion Notification.
531 * Congestion Window Reduced (CWR) (13) 531 * Congestion Window Reduced (CWR) (13)
@@ -537,7 +537,7 @@ typedef struct sctp_cwrhdr {
537typedef struct sctp_cwr_chunk { 537typedef struct sctp_cwr_chunk {
538 sctp_chunkhdr_t chunk_hdr; 538 sctp_chunkhdr_t chunk_hdr;
539 sctp_cwrhdr_t cwr_hdr; 539 sctp_cwrhdr_t cwr_hdr;
540} __attribute__((packed)) sctp_cwr_chunk_t; 540} __packed sctp_cwr_chunk_t;
541 541
542/* PR-SCTP 542/* PR-SCTP
543 * 3.2 Forward Cumulative TSN Chunk Definition (FORWARD TSN) 543 * 3.2 Forward Cumulative TSN Chunk Definition (FORWARD TSN)
@@ -588,17 +588,17 @@ typedef struct sctp_cwr_chunk {
588struct sctp_fwdtsn_skip { 588struct sctp_fwdtsn_skip {
589 __be16 stream; 589 __be16 stream;
590 __be16 ssn; 590 __be16 ssn;
591} __attribute__((packed)); 591} __packed;
592 592
593struct sctp_fwdtsn_hdr { 593struct sctp_fwdtsn_hdr {
594 __be32 new_cum_tsn; 594 __be32 new_cum_tsn;
595 struct sctp_fwdtsn_skip skip[0]; 595 struct sctp_fwdtsn_skip skip[0];
596} __attribute((packed)); 596} __packed;
597 597
598struct sctp_fwdtsn_chunk { 598struct sctp_fwdtsn_chunk {
599 struct sctp_chunkhdr chunk_hdr; 599 struct sctp_chunkhdr chunk_hdr;
600 struct sctp_fwdtsn_hdr fwdtsn_hdr; 600 struct sctp_fwdtsn_hdr fwdtsn_hdr;
601} __attribute((packed)); 601} __packed;
602 602
603 603
604/* ADDIP 604/* ADDIP
@@ -636,17 +636,17 @@ struct sctp_fwdtsn_chunk {
636typedef struct sctp_addip_param { 636typedef struct sctp_addip_param {
637 sctp_paramhdr_t param_hdr; 637 sctp_paramhdr_t param_hdr;
638 __be32 crr_id; 638 __be32 crr_id;
639} __attribute__((packed)) sctp_addip_param_t; 639} __packed sctp_addip_param_t;
640 640
641typedef struct sctp_addiphdr { 641typedef struct sctp_addiphdr {
642 __be32 serial; 642 __be32 serial;
643 __u8 params[0]; 643 __u8 params[0];
644} __attribute__((packed)) sctp_addiphdr_t; 644} __packed sctp_addiphdr_t;
645 645
646typedef struct sctp_addip_chunk { 646typedef struct sctp_addip_chunk {
647 sctp_chunkhdr_t chunk_hdr; 647 sctp_chunkhdr_t chunk_hdr;
648 sctp_addiphdr_t addip_hdr; 648 sctp_addiphdr_t addip_hdr;
649} __attribute__((packed)) sctp_addip_chunk_t; 649} __packed sctp_addip_chunk_t;
650 650
651/* AUTH 651/* AUTH
652 * Section 4.1 Authentication Chunk (AUTH) 652 * Section 4.1 Authentication Chunk (AUTH)
@@ -701,11 +701,11 @@ typedef struct sctp_authhdr {
701 __be16 shkey_id; 701 __be16 shkey_id;
702 __be16 hmac_id; 702 __be16 hmac_id;
703 __u8 hmac[0]; 703 __u8 hmac[0];
704} __attribute__((packed)) sctp_authhdr_t; 704} __packed sctp_authhdr_t;
705 705
706typedef struct sctp_auth_chunk { 706typedef struct sctp_auth_chunk {
707 sctp_chunkhdr_t chunk_hdr; 707 sctp_chunkhdr_t chunk_hdr;
708 sctp_authhdr_t auth_hdr; 708 sctp_authhdr_t auth_hdr;
709} __attribute__((packed)) sctp_auth_chunk_t; 709} __packed sctp_auth_chunk_t;
710 710
711#endif /* __LINUX_SCTP_H__ */ 711#endif /* __LINUX_SCTP_H__ */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f89e7fd59a4c..d20d9e7a9bbd 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -169,6 +169,7 @@ struct skb_shared_hwtstamps {
169 * @software: generate software time stamp 169 * @software: generate software time stamp
170 * @in_progress: device driver is going to provide 170 * @in_progress: device driver is going to provide
171 * hardware time stamp 171 * hardware time stamp
172 * @prevent_sk_orphan: make sk reference available on driver level
172 * @flags: all shared_tx flags 173 * @flags: all shared_tx flags
173 * 174 *
174 * These flags are attached to packets as part of the 175 * These flags are attached to packets as part of the
@@ -178,7 +179,8 @@ union skb_shared_tx {
178 struct { 179 struct {
179 __u8 hardware:1, 180 __u8 hardware:1,
180 software:1, 181 software:1,
181 in_progress:1; 182 in_progress:1,
183 prevent_sk_orphan:1;
182 }; 184 };
183 __u8 flags; 185 __u8 flags;
184}; 186};
@@ -202,10 +204,11 @@ struct skb_shared_info {
202 */ 204 */
203 atomic_t dataref; 205 atomic_t dataref;
204 206
205 skb_frag_t frags[MAX_SKB_FRAGS];
206 /* Intermediate layers must ensure that destructor_arg 207 /* Intermediate layers must ensure that destructor_arg
207 * remains valid until skb destructor */ 208 * remains valid until skb destructor */
208 void * destructor_arg; 209 void * destructor_arg;
210 /* must be last field, see pskb_expand_head() */
211 skb_frag_t frags[MAX_SKB_FRAGS];
209}; 212};
210 213
211/* We divide dataref into two halves. The higher 16 bits hold references 214/* We divide dataref into two halves. The higher 16 bits hold references
@@ -1414,12 +1417,14 @@ static inline int skb_network_offset(const struct sk_buff *skb)
1414 * 1417 *
1415 * Various parts of the networking layer expect at least 32 bytes of 1418 * Various parts of the networking layer expect at least 32 bytes of
1416 * headroom, you should not reduce this. 1419 * headroom, you should not reduce this.
1417 * With RPS, we raised NET_SKB_PAD to 64 so that get_rps_cpus() fetches span 1420 *
1418 * a 64 bytes aligned block to fit modern (>= 64 bytes) cache line sizes 1421 * Using max(32, L1_CACHE_BYTES) makes sense (especially with RPS)
1422 * to reduce average number of cache lines per packet.
1423 * get_rps_cpus() for example only access one 64 bytes aligned block :
1419 * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) 1424 * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
1420 */ 1425 */
1421#ifndef NET_SKB_PAD 1426#ifndef NET_SKB_PAD
1422#define NET_SKB_PAD 64 1427#define NET_SKB_PAD max(32, L1_CACHE_BYTES)
1423#endif 1428#endif
1424 1429
1425extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); 1430extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
@@ -1931,6 +1936,36 @@ static inline ktime_t net_invalid_timestamp(void)
1931 return ktime_set(0, 0); 1936 return ktime_set(0, 0);
1932} 1937}
1933 1938
1939extern void skb_timestamping_init(void);
1940
1941#ifdef CONFIG_NETWORK_PHY_TIMESTAMPING
1942
1943extern void skb_clone_tx_timestamp(struct sk_buff *skb);
1944extern bool skb_defer_rx_timestamp(struct sk_buff *skb);
1945
1946#else /* CONFIG_NETWORK_PHY_TIMESTAMPING */
1947
1948static inline void skb_clone_tx_timestamp(struct sk_buff *skb)
1949{
1950}
1951
1952static inline bool skb_defer_rx_timestamp(struct sk_buff *skb)
1953{
1954 return false;
1955}
1956
1957#endif /* !CONFIG_NETWORK_PHY_TIMESTAMPING */
1958
1959/**
1960 * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps
1961 *
1962 * @skb: clone of the the original outgoing packet
1963 * @hwtstamps: hardware time stamps
1964 *
1965 */
1966void skb_complete_tx_timestamp(struct sk_buff *skb,
1967 struct skb_shared_hwtstamps *hwtstamps);
1968
1934/** 1969/**
1935 * skb_tstamp_tx - queue clone of skb with send time stamps 1970 * skb_tstamp_tx - queue clone of skb with send time stamps
1936 * @orig_skb: the original outgoing packet 1971 * @orig_skb: the original outgoing packet
@@ -1945,6 +1980,28 @@ static inline ktime_t net_invalid_timestamp(void)
1945extern void skb_tstamp_tx(struct sk_buff *orig_skb, 1980extern void skb_tstamp_tx(struct sk_buff *orig_skb,
1946 struct skb_shared_hwtstamps *hwtstamps); 1981 struct skb_shared_hwtstamps *hwtstamps);
1947 1982
1983static inline void sw_tx_timestamp(struct sk_buff *skb)
1984{
1985 union skb_shared_tx *shtx = skb_tx(skb);
1986 if (shtx->software && !shtx->in_progress)
1987 skb_tstamp_tx(skb, NULL);
1988}
1989
1990/**
1991 * skb_tx_timestamp() - Driver hook for transmit timestamping
1992 *
1993 * Ethernet MAC Drivers should call this function in their hard_xmit()
1994 * function as soon as possible after giving the sk_buff to the MAC
1995 * hardware, but before freeing the sk_buff.
1996 *
1997 * @skb: A socket buffer.
1998 */
1999static inline void skb_tx_timestamp(struct sk_buff *skb)
2000{
2001 skb_clone_tx_timestamp(skb);
2002 sw_tx_timestamp(skb);
2003}
2004
1948extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); 2005extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len);
1949extern __sum16 __skb_checksum_complete(struct sk_buff *skb); 2006extern __sum16 __skb_checksum_complete(struct sk_buff *skb);
1950 2007
@@ -2132,7 +2189,8 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb)
2132 /* LRO sets gso_size but not gso_type, whereas if GSO is really 2189 /* LRO sets gso_size but not gso_type, whereas if GSO is really
2133 * wanted then gso_type will be set. */ 2190 * wanted then gso_type will be set. */
2134 struct skb_shared_info *shinfo = skb_shinfo(skb); 2191 struct skb_shared_info *shinfo = skb_shinfo(skb);
2135 if (shinfo->gso_size != 0 && unlikely(shinfo->gso_type == 0)) { 2192 if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 &&
2193 unlikely(shinfo->gso_type == 0)) {
2136 __skb_warn_lro_forwarding(skb); 2194 __skb_warn_lro_forwarding(skb);
2137 return true; 2195 return true;
2138 } 2196 }
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 52797714ade7..ebb0c80ffd6e 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -229,6 +229,7 @@ enum
229 LINUX_MIB_TCPBACKLOGDROP, 229 LINUX_MIB_TCPBACKLOGDROP,
230 LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ 230 LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */
231 LINUX_MIB_TCPDEFERACCEPTDROP, 231 LINUX_MIB_TCPDEFERACCEPTDROP,
232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */
232 __LINUX_MIB_MAX 233 __LINUX_MIB_MAX
233}; 234};
234 235
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 032a19eb61b1..a2fada9becb6 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -24,6 +24,9 @@ struct __kernel_sockaddr_storage {
24#include <linux/types.h> /* pid_t */ 24#include <linux/types.h> /* pid_t */
25#include <linux/compiler.h> /* __user */ 25#include <linux/compiler.h> /* __user */
26 26
27struct pid;
28struct cred;
29
27#define __sockaddr_check_size(size) \ 30#define __sockaddr_check_size(size) \
28 BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) 31 BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage)))
29 32
@@ -309,6 +312,8 @@ struct ucred {
309#define IPX_TYPE 1 312#define IPX_TYPE 1
310 313
311#ifdef __KERNEL__ 314#ifdef __KERNEL__
315extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred);
316
312extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); 317extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
313extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, 318extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
314 int offset, int len); 319 int offset, int len);
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index a2608bff9c78..623b704fdc42 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -167,7 +167,7 @@ struct ssb_device {
167 * is an optimization. */ 167 * is an optimization. */
168 const struct ssb_bus_ops *ops; 168 const struct ssb_bus_ops *ops;
169 169
170 struct device *dev; 170 struct device *dev, *dma_dev;
171 171
172 struct ssb_bus *bus; 172 struct ssb_bus *bus;
173 struct ssb_device_id id; 173 struct ssb_device_id id;
@@ -470,14 +470,6 @@ extern u32 ssb_dma_translation(struct ssb_device *dev);
470#define SSB_DMA_TRANSLATION_MASK 0xC0000000 470#define SSB_DMA_TRANSLATION_MASK 0xC0000000
471#define SSB_DMA_TRANSLATION_SHIFT 30 471#define SSB_DMA_TRANSLATION_SHIFT 30
472 472
473extern int ssb_dma_set_mask(struct ssb_device *dev, u64 mask);
474
475extern void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size,
476 dma_addr_t *dma_handle, gfp_t gfp_flags);
477extern void ssb_dma_free_consistent(struct ssb_device *dev, size_t size,
478 void *vaddr, dma_addr_t dma_handle,
479 gfp_t gfp_flags);
480
481static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev) 473static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev)
482{ 474{
483#ifdef CONFIG_SSB_DEBUG 475#ifdef CONFIG_SSB_DEBUG
@@ -486,155 +478,6 @@ static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev)
486#endif /* DEBUG */ 478#endif /* DEBUG */
487} 479}
488 480
489static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr)
490{
491 switch (dev->bus->bustype) {
492 case SSB_BUSTYPE_PCI:
493#ifdef CONFIG_SSB_PCIHOST
494 return pci_dma_mapping_error(dev->bus->host_pci, addr);
495#endif
496 break;
497 case SSB_BUSTYPE_SSB:
498 return dma_mapping_error(dev->dev, addr);
499 default:
500 break;
501 }
502 __ssb_dma_not_implemented(dev);
503 return -ENOSYS;
504}
505
506static inline dma_addr_t ssb_dma_map_single(struct ssb_device *dev, void *p,
507 size_t size, enum dma_data_direction dir)
508{
509 switch (dev->bus->bustype) {
510 case SSB_BUSTYPE_PCI:
511#ifdef CONFIG_SSB_PCIHOST
512 return pci_map_single(dev->bus->host_pci, p, size, dir);
513#endif
514 break;
515 case SSB_BUSTYPE_SSB:
516 return dma_map_single(dev->dev, p, size, dir);
517 default:
518 break;
519 }
520 __ssb_dma_not_implemented(dev);
521 return 0;
522}
523
524static inline void ssb_dma_unmap_single(struct ssb_device *dev, dma_addr_t dma_addr,
525 size_t size, enum dma_data_direction dir)
526{
527 switch (dev->bus->bustype) {
528 case SSB_BUSTYPE_PCI:
529#ifdef CONFIG_SSB_PCIHOST
530 pci_unmap_single(dev->bus->host_pci, dma_addr, size, dir);
531 return;
532#endif
533 break;
534 case SSB_BUSTYPE_SSB:
535 dma_unmap_single(dev->dev, dma_addr, size, dir);
536 return;
537 default:
538 break;
539 }
540 __ssb_dma_not_implemented(dev);
541}
542
543static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev,
544 dma_addr_t dma_addr,
545 size_t size,
546 enum dma_data_direction dir)
547{
548 switch (dev->bus->bustype) {
549 case SSB_BUSTYPE_PCI:
550#ifdef CONFIG_SSB_PCIHOST
551 pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
552 size, dir);
553 return;
554#endif
555 break;
556 case SSB_BUSTYPE_SSB:
557 dma_sync_single_for_cpu(dev->dev, dma_addr, size, dir);
558 return;
559 default:
560 break;
561 }
562 __ssb_dma_not_implemented(dev);
563}
564
565static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev,
566 dma_addr_t dma_addr,
567 size_t size,
568 enum dma_data_direction dir)
569{
570 switch (dev->bus->bustype) {
571 case SSB_BUSTYPE_PCI:
572#ifdef CONFIG_SSB_PCIHOST
573 pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
574 size, dir);
575 return;
576#endif
577 break;
578 case SSB_BUSTYPE_SSB:
579 dma_sync_single_for_device(dev->dev, dma_addr, size, dir);
580 return;
581 default:
582 break;
583 }
584 __ssb_dma_not_implemented(dev);
585}
586
587static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev,
588 dma_addr_t dma_addr,
589 unsigned long offset,
590 size_t size,
591 enum dma_data_direction dir)
592{
593 switch (dev->bus->bustype) {
594 case SSB_BUSTYPE_PCI:
595#ifdef CONFIG_SSB_PCIHOST
596 /* Just sync everything. That's all the PCI API can do. */
597 pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
598 offset + size, dir);
599 return;
600#endif
601 break;
602 case SSB_BUSTYPE_SSB:
603 dma_sync_single_range_for_cpu(dev->dev, dma_addr, offset,
604 size, dir);
605 return;
606 default:
607 break;
608 }
609 __ssb_dma_not_implemented(dev);
610}
611
612static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev,
613 dma_addr_t dma_addr,
614 unsigned long offset,
615 size_t size,
616 enum dma_data_direction dir)
617{
618 switch (dev->bus->bustype) {
619 case SSB_BUSTYPE_PCI:
620#ifdef CONFIG_SSB_PCIHOST
621 /* Just sync everything. That's all the PCI API can do. */
622 pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
623 offset + size, dir);
624 return;
625#endif
626 break;
627 case SSB_BUSTYPE_SSB:
628 dma_sync_single_range_for_device(dev->dev, dma_addr, offset,
629 size, dir);
630 return;
631 default:
632 break;
633 }
634 __ssb_dma_not_implemented(dev);
635}
636
637
638#ifdef CONFIG_SSB_PCIHOST 481#ifdef CONFIG_SSB_PCIHOST
639/* PCI-host wrapper driver */ 482/* PCI-host wrapper driver */
640extern int ssb_pcihost_register(struct pci_driver *driver); 483extern int ssb_pcihost_register(struct pci_driver *driver);
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h
new file mode 100644
index 000000000000..fa261a0da280
--- /dev/null
+++ b/include/linux/u64_stats_sync.h
@@ -0,0 +1,140 @@
1#ifndef _LINUX_U64_STATS_SYNC_H
2#define _LINUX_U64_STATS_SYNC_H
3
4/*
5 * To properly implement 64bits network statistics on 32bit and 64bit hosts,
6 * we provide a synchronization point, that is a noop on 64bit or UP kernels.
7 *
8 * Key points :
9 * 1) Use a seqcount on SMP 32bits, with low overhead.
10 * 2) Whole thing is a noop on 64bit arches or UP kernels.
11 * 3) Write side must ensure mutual exclusion or one seqcount update could
12 * be lost, thus blocking readers forever.
13 * If this synchronization point is not a mutex, but a spinlock or
14 * spinlock_bh() or disable_bh() :
15 * 3.1) Write side should not sleep.
16 * 3.2) Write side should not allow preemption.
17 * 3.3) If applicable, interrupts should be disabled.
18 *
19 * 4) If reader fetches several counters, there is no guarantee the whole values
20 * are consistent (remember point 1) : this is a noop on 64bit arches anyway)
21 *
22 * 5) readers are allowed to sleep or be preempted/interrupted : They perform
23 * pure reads. But if they have to fetch many values, it's better to not allow
24 * preemptions/interruptions to avoid many retries.
25 *
26 * 6) If counter might be written by an interrupt, readers should block interrupts.
27 * (On UP, there is no seqcount_t protection, a reader allowing interrupts could
28 * read partial values)
29 *
30 * 7) For softirq uses, readers can use u64_stats_fetch_begin_bh() and
31 * u64_stats_fetch_retry_bh() helpers
32 *
33 * Usage :
34 *
35 * Stats producer (writer) should use following template granted it already got
36 * an exclusive access to counters (a lock is already taken, or per cpu
37 * data is used [in a non preemptable context])
38 *
39 * spin_lock_bh(...) or other synchronization to get exclusive access
40 * ...
41 * u64_stats_update_begin(&stats->syncp);
42 * stats->bytes64 += len; // non atomic operation
43 * stats->packets64++; // non atomic operation
44 * u64_stats_update_end(&stats->syncp);
45 *
46 * While a consumer (reader) should use following template to get consistent
47 * snapshot for each variable (but no guarantee on several ones)
48 *
49 * u64 tbytes, tpackets;
50 * unsigned int start;
51 *
52 * do {
53 * start = u64_stats_fetch_begin(&stats->syncp);
54 * tbytes = stats->bytes64; // non atomic operation
55 * tpackets = stats->packets64; // non atomic operation
56 * } while (u64_stats_fetch_retry(&stats->syncp, start));
57 *
58 *
59 * Example of use in drivers/net/loopback.c, using per_cpu containers,
60 * in BH disabled context.
61 */
62#include <linux/seqlock.h>
63
64struct u64_stats_sync {
65#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
66 seqcount_t seq;
67#endif
68};
69
70static void inline u64_stats_update_begin(struct u64_stats_sync *syncp)
71{
72#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
73 write_seqcount_begin(&syncp->seq);
74#endif
75}
76
77static void inline u64_stats_update_end(struct u64_stats_sync *syncp)
78{
79#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
80 write_seqcount_end(&syncp->seq);
81#endif
82}
83
84static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *syncp)
85{
86#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
87 return read_seqcount_begin(&syncp->seq);
88#else
89#if BITS_PER_LONG==32
90 preempt_disable();
91#endif
92 return 0;
93#endif
94}
95
96static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp,
97 unsigned int start)
98{
99#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
100 return read_seqcount_retry(&syncp->seq, start);
101#else
102#if BITS_PER_LONG==32
103 preempt_enable();
104#endif
105 return false;
106#endif
107}
108
109/*
110 * In case softirq handlers can update u64 counters, readers can use following helpers
111 * - SMP 32bit arches use seqcount protection, irq safe.
112 * - UP 32bit must disable BH.
113 * - 64bit have no problem atomically reading u64 values, irq safe.
114 */
115static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp)
116{
117#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
118 return read_seqcount_begin(&syncp->seq);
119#else
120#if BITS_PER_LONG==32
121 local_bh_disable();
122#endif
123 return 0;
124#endif
125}
126
127static bool inline u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp,
128 unsigned int start)
129{
130#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
131 return read_seqcount_retry(&syncp->seq, start);
132#else
133#if BITS_PER_LONG==32
134 local_bh_enable();
135#endif
136 return false;
137#endif
138}
139
140#endif /* _LINUX_U64_STATS_SYNC_H */
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index cc4f45361dbb..8178156711f9 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -36,6 +36,9 @@ static inline void put_user_ns(struct user_namespace *ns)
36 kref_put(&ns->kref, free_user_ns); 36 kref_put(&ns->kref, free_user_ns);
37} 37}
38 38
39uid_t user_ns_map_uid(struct user_namespace *to, const struct cred *cred, uid_t uid);
40gid_t user_ns_map_gid(struct user_namespace *to, const struct cred *cred, gid_t gid);
41
39#else 42#else
40 43
41static inline struct user_namespace *get_user_ns(struct user_namespace *ns) 44static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
@@ -52,6 +55,17 @@ static inline void put_user_ns(struct user_namespace *ns)
52{ 55{
53} 56}
54 57
58static inline uid_t user_ns_map_uid(struct user_namespace *to,
59 const struct cred *cred, uid_t uid)
60{
61 return uid;
62}
63static inline gid_t user_ns_map_gid(struct user_namespace *to,
64 const struct cred *cred, gid_t gid)
65{
66 return gid;
67}
68
55#endif 69#endif
56 70
57#endif /* _LINUX_USER_H */ 71#endif /* _LINUX_USER_H */
diff --git a/include/linux/wlp.h b/include/linux/wlp.h
index ac95ce6606ac..c76fe2392506 100644
--- a/include/linux/wlp.h
+++ b/include/linux/wlp.h
@@ -300,7 +300,7 @@ struct wlp_ie {
300 __le16 cycle_param; 300 __le16 cycle_param;
301 __le16 acw_anchor_addr; 301 __le16 acw_anchor_addr;
302 u8 wssid_hash_list[]; 302 u8 wssid_hash_list[];
303} __attribute__((packed)); 303} __packed;
304 304
305static inline int wlp_ie_hash_length(struct wlp_ie *ie) 305static inline int wlp_ie_hash_length(struct wlp_ie *ie)
306{ 306{
@@ -324,7 +324,7 @@ static inline void wlp_ie_set_hash_length(struct wlp_ie *ie, int hash_length)
324 */ 324 */
325struct wlp_nonce { 325struct wlp_nonce {
326 u8 data[16]; 326 u8 data[16];
327} __attribute__((packed)); 327} __packed;
328 328
329/** 329/**
330 * WLP UUID 330 * WLP UUID
@@ -336,7 +336,7 @@ struct wlp_nonce {
336 */ 336 */
337struct wlp_uuid { 337struct wlp_uuid {
338 u8 data[16]; 338 u8 data[16];
339} __attribute__((packed)); 339} __packed;
340 340
341 341
342/** 342/**
@@ -348,7 +348,7 @@ struct wlp_dev_type {
348 u8 OUI[3]; 348 u8 OUI[3];
349 u8 OUIsubdiv; 349 u8 OUIsubdiv;
350 __le16 subID; 350 __le16 subID;
351} __attribute__((packed)); 351} __packed;
352 352
353/** 353/**
354 * WLP frame header 354 * WLP frame header
@@ -357,7 +357,7 @@ struct wlp_dev_type {
357struct wlp_frame_hdr { 357struct wlp_frame_hdr {
358 __le16 mux_hdr; /* WLP_PROTOCOL_ID */ 358 __le16 mux_hdr; /* WLP_PROTOCOL_ID */
359 enum wlp_frame_type type:8; 359 enum wlp_frame_type type:8;
360} __attribute__((packed)); 360} __packed;
361 361
362/** 362/**
363 * WLP attribute field header 363 * WLP attribute field header
@@ -368,7 +368,7 @@ struct wlp_frame_hdr {
368struct wlp_attr_hdr { 368struct wlp_attr_hdr {
369 __le16 type; 369 __le16 type;
370 __le16 length; 370 __le16 length;
371} __attribute__((packed)); 371} __packed;
372 372
373/** 373/**
374 * Device information commonly used together 374 * Device information commonly used together
@@ -401,13 +401,13 @@ struct wlp_device_info {
401struct wlp_attr_##name { \ 401struct wlp_attr_##name { \
402 struct wlp_attr_hdr hdr; \ 402 struct wlp_attr_hdr hdr; \
403 type name; \ 403 type name; \
404} __attribute__((packed)); 404} __packed;
405 405
406#define wlp_attr_array(type, name) \ 406#define wlp_attr_array(type, name) \
407struct wlp_attr_##name { \ 407struct wlp_attr_##name { \
408 struct wlp_attr_hdr hdr; \ 408 struct wlp_attr_hdr hdr; \
409 type name[]; \ 409 type name[]; \
410} __attribute__((packed)); 410} __packed;
411 411
412/** 412/**
413 * WLP association attribute fields 413 * WLP association attribute fields
@@ -483,7 +483,7 @@ struct wlp_wss_info {
483 struct wlp_attr_accept_enrl accept; 483 struct wlp_attr_accept_enrl accept;
484 struct wlp_attr_wss_sec_status sec_stat; 484 struct wlp_attr_wss_sec_status sec_stat;
485 struct wlp_attr_wss_bcast bcast; 485 struct wlp_attr_wss_bcast bcast;
486} __attribute__((packed)); 486} __packed;
487 487
488/* WLP WSS Information */ 488/* WLP WSS Information */
489wlp_attr_array(struct wlp_wss_info, wss_info) 489wlp_attr_array(struct wlp_wss_info, wss_info)
@@ -520,7 +520,7 @@ wlp_attr(u8, wlp_assc_err)
520struct wlp_frame_std_abbrv_hdr { 520struct wlp_frame_std_abbrv_hdr {
521 struct wlp_frame_hdr hdr; 521 struct wlp_frame_hdr hdr;
522 u8 tag; 522 u8 tag;
523} __attribute__((packed)); 523} __packed;
524 524
525/** 525/**
526 * WLP association frames 526 * WLP association frames
@@ -533,7 +533,7 @@ struct wlp_frame_assoc {
533 struct wlp_attr_version version; 533 struct wlp_attr_version version;
534 struct wlp_attr_msg_type msg_type; 534 struct wlp_attr_msg_type msg_type;
535 u8 attr[]; 535 u8 attr[];
536} __attribute__((packed)); 536} __packed;
537 537
538/* Ethernet to dev address mapping */ 538/* Ethernet to dev address mapping */
539struct wlp_eda { 539struct wlp_eda {