diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 14:47:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 14:47:58 -0400 |
commit | 6ba74014c1ab0e37af7de6f64b4eccbbae3cb9e7 (patch) | |
tree | 8f3892fc44f1e403675a6d7e88fda5c70e56ee4c /include | |
parent | 5abd9ccced7a726c817dd6b5b96bc933859138d1 (diff) | |
parent | 3ff1c25927e3af61c6bf0e4ed959504058ae4565 (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')
117 files changed, 2053 insertions, 1002 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),) |
277 | unifdef-y += kvm_para.h | 277 | unifdef-y += kvm_para.h |
278 | endif | 278 | endif |
279 | unifdef-y += l2tp.h | ||
279 | unifdef-y += llc.h | 280 | unifdef-y += llc.h |
280 | unifdef-y += loop.h | 281 | unifdef-y += loop.h |
281 | unifdef-y += lp.h | 282 | unifdef-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 */ |
432 | struct atm_dev *atm_dev_lookup(int number); | 432 | struct atm_dev *atm_dev_lookup(int number); |
433 | void atm_dev_deregister(struct atm_dev *dev); | 433 | void 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 | */ | ||
440 | void atm_dev_signal_change(struct atm_dev *dev, char signal); | ||
441 | |||
434 | void vcc_insert_socket(struct sock *sk); | 442 | void vcc_insert_socket(struct sock *sk); |
435 | 443 | ||
436 | 444 | ||
@@ -510,6 +518,15 @@ void register_atm_ioctl(struct atm_ioctl *); | |||
510 | */ | 518 | */ |
511 | void deregister_atm_ioctl(struct atm_ioctl *); | 519 | void 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 | */ | ||
527 | int register_atmdevice_notifier(struct notifier_block *nb); | ||
528 | void 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 { | |||
83 | enum caif_at_type { | 85 | enum 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 | */ | ||
95 | enum 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 | */ | ||
106 | enum 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 | */ | ||
16 | struct 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, | |||
578 | void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); | 578 | void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); |
579 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | 579 | int cgroup_scan_tasks(struct cgroup_scanner *scan); |
580 | int cgroup_attach_task(struct cgroup *, struct task_struct *); | 580 | int cgroup_attach_task(struct cgroup *, struct task_struct *); |
581 | int 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 */ | ||
639 | static 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. */ |
640 | extern const char *dev_driver_string(const struct device *dev); | 640 | extern 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...) \ | 645 | extern 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) | 648 | extern 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) | 650 | extern 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) | 652 | extern 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) | 654 | extern 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) | 656 | extern 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) | 658 | extern int dev_notice(const struct device *dev, const char *fmt, ...) |
659 | __attribute__ ((format (printf, 2, 3))); | ||
660 | extern int _dev_info(const struct device *dev, const char *fmt, ...) | ||
661 | __attribute__ ((format (printf, 2, 3))); | ||
662 | |||
663 | #else | ||
664 | |||
665 | static inline int dev_printk(const char *level, const struct device *dev, | ||
666 | const char *fmt, ...) | ||
667 | __attribute__ ((format (printf, 3, 4))); | ||
668 | static inline int dev_printk(const char *level, const struct device *dev, | ||
669 | const char *fmt, ...) | ||
670 | { return 0; } | ||
671 | |||
672 | static inline int dev_emerg(const struct device *dev, const char *fmt, ...) | ||
673 | __attribute__ ((format (printf, 2, 3))); | ||
674 | static inline int dev_emerg(const struct device *dev, const char *fmt, ...) | ||
675 | { return 0; } | ||
676 | static inline int dev_crit(const struct device *dev, const char *fmt, ...) | ||
677 | __attribute__ ((format (printf, 2, 3))); | ||
678 | static inline int dev_crit(const struct device *dev, const char *fmt, ...) | ||
679 | { return 0; } | ||
680 | static inline int dev_alert(const struct device *dev, const char *fmt, ...) | ||
681 | __attribute__ ((format (printf, 2, 3))); | ||
682 | static inline int dev_alert(const struct device *dev, const char *fmt, ...) | ||
683 | { return 0; } | ||
684 | static inline int dev_err(const struct device *dev, const char *fmt, ...) | ||
685 | __attribute__ ((format (printf, 2, 3))); | ||
686 | static inline int dev_err(const struct device *dev, const char *fmt, ...) | ||
687 | { return 0; } | ||
688 | static inline int dev_warn(const struct device *dev, const char *fmt, ...) | ||
689 | __attribute__ ((format (printf, 2, 3))); | ||
690 | static inline int dev_warn(const struct device *dev, const char *fmt, ...) | ||
691 | { return 0; } | ||
692 | static inline int dev_notice(const struct device *dev, const char *fmt, ...) | ||
693 | __attribute__ ((format (printf, 2, 3))); | ||
694 | static inline int dev_notice(const struct device *dev, const char *fmt, ...) | ||
695 | { return 0; } | ||
696 | static inline int _dev_info(const struct device *dev, const char *fmt, ...) | ||
697 | __attribute__ ((format (printf, 2, 3))); | ||
698 | static 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, ...) \ |
717 | do { \ | ||
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 | */ | ||
137 | static 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 | ||
389 | struct 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 | |||
389 | struct ethtool_rx_ntuple_flow_spec { | 398 | struct 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); | |||
459 | u32 ethtool_op_get_ufo(struct net_device *dev); | 468 | u32 ethtool_op_get_ufo(struct net_device *dev); |
460 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | 469 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); |
461 | u32 ethtool_op_get_flags(struct net_device *dev); | 470 | u32 ethtool_op_get_flags(struct net_device *dev); |
462 | int ethtool_op_set_flags(struct net_device *dev, u32 data); | 471 | int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported); |
463 | void ethtool_ntuple_flush(struct net_device *dev); | 472 | void 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 | ||
94 | enum { | ||
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 | ||
104 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); | 104 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); |
105 | extern struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p, | ||
106 | struct sk_buff *skb); | ||
107 | extern int (*br_should_route_hook)(struct sk_buff *skb); | 105 | extern 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 */ |
73 | struct fddi_8022_2_hdr { | 73 | struct 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 */ |
91 | struct fddihdr { | 91 | struct 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 | ||
109 | struct hippi_le_hdr { | 109 | struct 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 | ||
147 | struct hippi_hdr { | 147 | struct 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 */ |
8 | struct rtnl_link_stats { | 8 | struct 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 */ | ||
40 | struct rtnl_link_stats64 { | 41 | struct 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) |
11 | struct socket *macvtap_get_socket(struct file *); | 12 | struct 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 | */ |
33 | struct macvlan_rx_stats { | 35 | struct 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 | ||
40 | struct macvlan_dev { | 43 | struct 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); | |||
86 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | 91 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, |
87 | struct net_device *dev); | 92 | struct net_device *dev); |
88 | 93 | ||
89 | |||
90 | extern 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 | ||
52 | struct tpacket_stats { | 53 | struct 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 | ||
174 | struct va_format { | ||
175 | const char *fmt; | ||
176 | va_list *va; | ||
177 | }; | ||
178 | |||
174 | extern struct atomic_notifier_head panic_notifier_list; | 179 | extern struct atomic_notifier_head panic_notifier_list; |
175 | extern long (*panic_blink)(long time); | 180 | extern long (*panic_blink)(long time); |
176 | NORET_TYPE void panic(const char * fmt, ...) | 181 | NORET_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 | */ |
30 | struct ks8842_platform_data { | 32 | struct 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 @@ | |||
251 | struct mISDNhead { | 251 | struct 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 | ||
195 | struct nw_search_sequence { | 195 | struct 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 | ||
55 | struct vlan_group; | 55 | struct vlan_group; |
56 | struct netpoll_info; | 56 | struct netpoll_info; |
57 | struct phy_device; | ||
57 | /* 802.11 specific */ | 58 | /* 802.11 specific */ |
58 | struct wireless_dev; | 59 | struct 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 | ||
169 | struct net_device_stats { | 173 | struct 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. */ |
203 | enum { | 203 | enum { |
@@ -381,6 +381,8 @@ enum gro_result { | |||
381 | }; | 381 | }; |
382 | typedef enum gro_result gro_result_t; | 382 | typedef enum gro_result gro_result_t; |
383 | 383 | ||
384 | typedef struct sk_buff *rx_handler_func_t(struct sk_buff *skb); | ||
385 | |||
384 | extern void __napi_schedule(struct napi_struct *n); | 386 | extern void __napi_schedule(struct napi_struct *n); |
385 | 387 | ||
386 | static inline int napi_disable_pending(struct napi_struct *n) | 388 | static 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, | |||
1087 | static inline | 1105 | static inline |
1088 | struct net *dev_net(const struct net_device *dev) | 1106 | struct 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 | ||
1097 | static inline | 1111 | static inline |
@@ -1272,8 +1286,8 @@ extern void dev_add_pack(struct packet_type *pt); | |||
1272 | extern void dev_remove_pack(struct packet_type *pt); | 1286 | extern void dev_remove_pack(struct packet_type *pt); |
1273 | extern void __dev_remove_pack(struct packet_type *pt); | 1287 | extern void __dev_remove_pack(struct packet_type *pt); |
1274 | 1288 | ||
1275 | extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags, | 1289 | extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, |
1276 | unsigned short mask); | 1290 | unsigned short mask); |
1277 | extern struct net_device *dev_get_by_name(struct net *net, const char *name); | 1291 | extern struct net_device *dev_get_by_name(struct net *net, const char *name); |
1278 | extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); | 1292 | extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); |
1279 | extern struct net_device *__dev_get_by_name(struct net *net, const char *name); | 1293 | extern 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 | ||
1713 | extern int netdev_rx_handler_register(struct net_device *dev, | ||
1714 | rx_handler_func_t *rx_handler, | ||
1715 | void *rx_handler_data); | ||
1716 | extern void netdev_rx_handler_unregister(struct net_device *dev); | ||
1717 | |||
1699 | extern void netif_nit_deliver(struct sk_buff *skb); | 1718 | extern void netif_nit_deliver(struct sk_buff *skb); |
1700 | extern int dev_valid_name(const char *name); | 1719 | extern int dev_valid_name(const char *name); |
1701 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1720 | extern 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 | ||
1776 | extern void netif_carrier_off(struct net_device *dev); | 1795 | extern void netif_carrier_off(struct net_device *dev); |
1777 | 1796 | ||
1797 | extern 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 */ |
2120 | extern void dev_load(struct net *net, const char *name); | 2141 | extern void dev_load(struct net *net, const char *name); |
2121 | extern void dev_mcast_init(void); | 2142 | extern void dev_mcast_init(void); |
2122 | extern const struct net_device_stats *dev_get_stats(struct net_device *dev); | 2143 | extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, |
2123 | extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); | 2144 | struct rtnl_link_stats64 *storage); |
2145 | extern void dev_txq_stats_fold(const struct net_device *dev, | ||
2146 | struct rtnl_link_stats64 *stats); | ||
2124 | 2147 | ||
2125 | extern int netdev_max_backlog; | 2148 | extern int netdev_max_backlog; |
2126 | extern int netdev_tstamp_prequeue; | 2149 | extern 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...) \ | 2256 | extern 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) | 2259 | extern 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...) \ | 2261 | extern 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...) \ | 2263 | extern 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...) \ | 2265 | extern 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...) \ | 2267 | extern 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...) \ | 2269 | extern 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...) \ | 2271 | extern 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...) \ | ||
2321 | do { \ | ||
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 | |||
3 | header-y += nfnetlink_conntrack.h | 3 | header-y += nfnetlink_conntrack.h |
4 | header-y += nfnetlink_log.h | 4 | header-y += nfnetlink_log.h |
5 | header-y += nfnetlink_queue.h | 5 | header-y += nfnetlink_queue.h |
6 | header-y += xt_CHECKSUM.h | ||
6 | header-y += xt_CLASSIFY.h | 7 | header-y += xt_CLASSIFY.h |
7 | header-y += xt_CONNMARK.h | 8 | header-y += xt_CONNMARK.h |
8 | header-y += xt_CONNSECMARK.h | 9 | header-y += xt_CONNSECMARK.h |
9 | header-y += xt_CT.h | 10 | header-y += xt_CT.h |
10 | header-y += xt_DSCP.h | 11 | header-y += xt_DSCP.h |
12 | header-y += xt_IDLETIMER.h | ||
11 | header-y += xt_LED.h | 13 | header-y += xt_LED.h |
12 | header-y += xt_MARK.h | 14 | header-y += xt_MARK.h |
13 | header-y += xt_NFLOG.h | 15 | header-y += xt_NFLOG.h |
@@ -18,17 +20,19 @@ header-y += xt_TCPMSS.h | |||
18 | header-y += xt_TCPOPTSTRIP.h | 20 | header-y += xt_TCPOPTSTRIP.h |
19 | header-y += xt_TEE.h | 21 | header-y += xt_TEE.h |
20 | header-y += xt_TPROXY.h | 22 | header-y += xt_TPROXY.h |
23 | header-y += xt_cluster.h | ||
21 | header-y += xt_comment.h | 24 | header-y += xt_comment.h |
22 | header-y += xt_connbytes.h | 25 | header-y += xt_connbytes.h |
23 | header-y += xt_connlimit.h | 26 | header-y += xt_connlimit.h |
24 | header-y += xt_connmark.h | 27 | header-y += xt_connmark.h |
25 | header-y += xt_conntrack.h | 28 | header-y += xt_conntrack.h |
26 | header-y += xt_cluster.h | 29 | header-y += xt_cpu.h |
27 | header-y += xt_dccp.h | 30 | header-y += xt_dccp.h |
28 | header-y += xt_dscp.h | 31 | header-y += xt_dscp.h |
29 | header-y += xt_esp.h | 32 | header-y += xt_esp.h |
30 | header-y += xt_hashlimit.h | 33 | header-y += xt_hashlimit.h |
31 | header-y += xt_iprange.h | 34 | header-y += xt_iprange.h |
35 | header-y += xt_ipvs.h | ||
32 | header-y += xt_helper.h | 36 | header-y += xt_helper.h |
33 | header-y += xt_length.h | 37 | header-y += xt_length.h |
34 | header-y += xt_limit.h | 38 | header-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 | |||
16 | struct 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 | |||
36 | struct 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 | |||
6 | struct 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 | |||
4 | enum { | ||
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 | |||
16 | struct 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; | |||
11 | struct xt_quota_info { | 11 | struct 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 | ||
12 | struct ipt_log_info { | 13 | struct 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 | ||
12 | struct ip6t_log_info { | 13 | struct 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); | |||
46 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); | 46 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); |
47 | void netpoll_print_options(struct netpoll *np); | 47 | void netpoll_print_options(struct netpoll *np); |
48 | int netpoll_parse_options(struct netpoll *np, char *opt); | 48 | int netpoll_parse_options(struct netpoll *np, char *opt); |
49 | int __netpoll_setup(struct netpoll *np); | ||
49 | int netpoll_setup(struct netpoll *np); | 50 | int netpoll_setup(struct netpoll *np); |
50 | int netpoll_trap(void); | 51 | int netpoll_trap(void); |
51 | void netpoll_set_trap(int trap); | 52 | void netpoll_set_trap(int trap); |
53 | void __netpoll_cleanup(struct netpoll *np); | ||
52 | void netpoll_cleanup(struct netpoll *np); | 54 | void netpoll_cleanup(struct netpoll *np); |
53 | int __netpoll_rx(struct sk_buff *skb); | 55 | int __netpoll_rx(struct sk_buff *skb); |
54 | void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); | 56 | void 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 |
58 | static inline bool netpoll_rx(struct sk_buff *skb) | 60 | static 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 | ||
78 | out: | ||
79 | rcu_read_unlock_bh(); | ||
73 | return ret; | 80 | return ret; |
74 | } | 81 | } |
75 | 82 | ||
76 | static inline int netpoll_rx_on(struct sk_buff *skb) | 83 | static 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 | |||
119 | static 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) | |||
134 | static inline void netpoll_netdev_init(struct net_device *dev) | 144 | static inline void netpoll_netdev_init(struct net_device *dev) |
135 | { | 145 | { |
136 | } | 146 | } |
147 | static 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 | */ | ||
1678 | enum 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 */ |
62 | struct phonetmsg { | 62 | struct 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 | ||
237 | struct 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); | |||
498 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 520 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
499 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 521 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
500 | int phy_mii_ioctl(struct phy_device *phydev, | 522 | int phy_mii_ioctl(struct phy_device *phydev, |
501 | struct mii_ioctl_data *mii_data, int cmd); | 523 | struct ifreq *ifr, int cmd); |
502 | int phy_start_interrupts(struct phy_device *phydev); | 524 | int phy_start_interrupts(struct phy_device *phydev); |
503 | void phy_print_status(struct phy_device *phydev); | 525 | void phy_print_status(struct phy_device *phydev); |
504 | struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id); | 526 | struct 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 | |||
79 | static 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 @@ | |||
100 | struct rds_info_counter { | 100 | struct 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 | ||
120 | struct rds_info_flow { | 120 | struct 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 | ||
141 | struct rds_info_socket { | 141 | struct 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 | ||
151 | struct rds_info_tcp_socket { | 151 | struct 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 |
164 | struct rds_info_rdma_connection { | 164 | struct 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 }; | |||
167 | typedef struct sctp_paramhdr { | 167 | typedef 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 | ||
172 | typedef enum { | 172 | typedef 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 | ||
233 | typedef struct sctp_data_chunk { | 233 | typedef 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 */ |
239 | enum { | 239 | enum { |
@@ -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 | ||
264 | typedef struct sctp_init_chunk { | 264 | typedef 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) */ |
271 | typedef struct sctp_ipv4addr_param { | 271 | typedef 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) */ |
277 | typedef struct sctp_ipv6addr_param { | 277 | typedef 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) */ |
283 | typedef struct sctp_cookie_preserve_param { | 283 | typedef 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) */ |
289 | typedef struct sctp_hostname_param { | 289 | typedef 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) */ |
295 | typedef struct sctp_supported_addrs_param { | 295 | typedef 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) */ |
301 | typedef struct sctp_ecn_capable_param { | 301 | typedef 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 */ |
306 | typedef struct sctp_adaptation_ind_param { | 306 | typedef 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 */ |
312 | typedef struct sctp_supported_ext_param { | 312 | typedef 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 */ |
318 | typedef struct sctp_random_param { | 318 | typedef 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 */ |
324 | typedef struct sctp_chunks_param { | 324 | typedef 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 */ |
330 | typedef struct sctp_hmac_algo_param { | 330 | typedef 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; | |||
342 | typedef struct sctp_cookie_param { | 342 | typedef 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) */ |
348 | typedef struct sctp_unrecognized_param { | 348 | typedef 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 { | |||
363 | typedef struct sctp_gap_ack_block { | 363 | typedef 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 | ||
368 | typedef __be32 sctp_dup_tsn_t; | 368 | typedef __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 | ||
383 | typedef struct sctp_sack_chunk { | 383 | typedef 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 | ||
396 | typedef struct sctp_heartbeathdr { | 396 | typedef 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 | ||
400 | typedef struct sctp_heartbeat_chunk { | 400 | typedef 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 | */ |
410 | typedef struct sctp_abort_chunk { | 410 | typedef 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 | */ |
418 | typedef struct sctp_shutdownhdr { | 418 | typedef 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 | ||
422 | struct sctp_shutdown_chunk_t { | 422 | struct 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 | ||
435 | typedef struct sctp_operr_chunk { | 435 | typedef 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 { | |||
525 | typedef struct sctp_ecne_chunk { | 525 | typedef 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 { | |||
537 | typedef struct sctp_cwr_chunk { | 537 | typedef 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 { | |||
588 | struct sctp_fwdtsn_skip { | 588 | struct sctp_fwdtsn_skip { |
589 | __be16 stream; | 589 | __be16 stream; |
590 | __be16 ssn; | 590 | __be16 ssn; |
591 | } __attribute__((packed)); | 591 | } __packed; |
592 | 592 | ||
593 | struct sctp_fwdtsn_hdr { | 593 | struct 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 | ||
598 | struct sctp_fwdtsn_chunk { | 598 | struct 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 { | |||
636 | typedef struct sctp_addip_param { | 636 | typedef 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 | ||
641 | typedef struct sctp_addiphdr { | 641 | typedef 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 | ||
646 | typedef struct sctp_addip_chunk { | 646 | typedef 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 | ||
706 | typedef struct sctp_auth_chunk { | 706 | typedef 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 | ||
1425 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); | 1430 | extern 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 | ||
1939 | extern void skb_timestamping_init(void); | ||
1940 | |||
1941 | #ifdef CONFIG_NETWORK_PHY_TIMESTAMPING | ||
1942 | |||
1943 | extern void skb_clone_tx_timestamp(struct sk_buff *skb); | ||
1944 | extern bool skb_defer_rx_timestamp(struct sk_buff *skb); | ||
1945 | |||
1946 | #else /* CONFIG_NETWORK_PHY_TIMESTAMPING */ | ||
1947 | |||
1948 | static inline void skb_clone_tx_timestamp(struct sk_buff *skb) | ||
1949 | { | ||
1950 | } | ||
1951 | |||
1952 | static 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 | */ | ||
1966 | void 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) | |||
1945 | extern void skb_tstamp_tx(struct sk_buff *orig_skb, | 1980 | extern void skb_tstamp_tx(struct sk_buff *orig_skb, |
1946 | struct skb_shared_hwtstamps *hwtstamps); | 1981 | struct skb_shared_hwtstamps *hwtstamps); |
1947 | 1982 | ||
1983 | static 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 | */ | ||
1999 | static inline void skb_tx_timestamp(struct sk_buff *skb) | ||
2000 | { | ||
2001 | skb_clone_tx_timestamp(skb); | ||
2002 | sw_tx_timestamp(skb); | ||
2003 | } | ||
2004 | |||
1948 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); | 2005 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); |
1949 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | 2006 | extern __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 | ||
27 | struct pid; | ||
28 | struct 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__ |
315 | extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred); | ||
316 | |||
312 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | 317 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); |
313 | extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, | 318 | extern 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 | ||
473 | extern int ssb_dma_set_mask(struct ssb_device *dev, u64 mask); | ||
474 | |||
475 | extern void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size, | ||
476 | dma_addr_t *dma_handle, gfp_t gfp_flags); | ||
477 | extern 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 | |||
481 | static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev) | 473 | static 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 | ||
489 | static 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 | |||
506 | static 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 | |||
524 | static 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 | |||
543 | static 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 | |||
565 | static 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 | |||
587 | static 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 | |||
612 | static 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 */ |
640 | extern int ssb_pcihost_register(struct pci_driver *driver); | 483 | extern 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 | |||
64 | struct u64_stats_sync { | ||
65 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | ||
66 | seqcount_t seq; | ||
67 | #endif | ||
68 | }; | ||
69 | |||
70 | static 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 | |||
77 | static 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 | |||
84 | static 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 | |||
96 | static 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 | */ | ||
115 | static 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 | |||
127 | static 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 | ||
39 | uid_t user_ns_map_uid(struct user_namespace *to, const struct cred *cred, uid_t uid); | ||
40 | gid_t user_ns_map_gid(struct user_namespace *to, const struct cred *cred, gid_t gid); | ||
41 | |||
39 | #else | 42 | #else |
40 | 43 | ||
41 | static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | 44 | static 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 | ||
58 | static inline uid_t user_ns_map_uid(struct user_namespace *to, | ||
59 | const struct cred *cred, uid_t uid) | ||
60 | { | ||
61 | return uid; | ||
62 | } | ||
63 | static 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 | ||
305 | static inline int wlp_ie_hash_length(struct wlp_ie *ie) | 305 | static 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 | */ |
325 | struct wlp_nonce { | 325 | struct 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 | */ |
337 | struct wlp_uuid { | 337 | struct 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 { | |||
357 | struct wlp_frame_hdr { | 357 | struct 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 { | |||
368 | struct wlp_attr_hdr { | 368 | struct 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 { | |||
401 | struct wlp_attr_##name { \ | 401 | struct 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) \ |
407 | struct wlp_attr_##name { \ | 407 | struct 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 */ |
489 | wlp_attr_array(struct wlp_wss_info, wss_info) | 489 | wlp_attr_array(struct wlp_wss_info, wss_info) |
@@ -520,7 +520,7 @@ wlp_attr(u8, wlp_assc_err) | |||
520 | struct wlp_frame_std_abbrv_hdr { | 520 | struct 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 */ |
539 | struct wlp_eda { | 539 | struct wlp_eda { |
diff --git a/include/net/act_api.h b/include/net/act_api.h index c05fd717c588..bab385f13ac3 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h | |||
@@ -20,6 +20,7 @@ struct tcf_common { | |||
20 | struct gnet_stats_queue tcfc_qstats; | 20 | struct gnet_stats_queue tcfc_qstats; |
21 | struct gnet_stats_rate_est tcfc_rate_est; | 21 | struct gnet_stats_rate_est tcfc_rate_est; |
22 | spinlock_t tcfc_lock; | 22 | spinlock_t tcfc_lock; |
23 | struct rcu_head tcfc_rcu; | ||
23 | }; | 24 | }; |
24 | #define tcf_next common.tcfc_next | 25 | #define tcf_next common.tcfc_next |
25 | #define tcf_index common.tcfc_index | 26 | #define tcf_index common.tcfc_index |
@@ -32,6 +33,7 @@ struct tcf_common { | |||
32 | #define tcf_qstats common.tcfc_qstats | 33 | #define tcf_qstats common.tcfc_qstats |
33 | #define tcf_rate_est common.tcfc_rate_est | 34 | #define tcf_rate_est common.tcfc_rate_est |
34 | #define tcf_lock common.tcfc_lock | 35 | #define tcf_lock common.tcfc_lock |
36 | #define tcf_rcu common.tcfc_rcu | ||
35 | 37 | ||
36 | struct tcf_police { | 38 | struct tcf_police { |
37 | struct tcf_common common; | 39 | struct tcf_common common; |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 20725e213aee..90c9e2872f27 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -23,7 +23,8 @@ struct unix_address { | |||
23 | }; | 23 | }; |
24 | 24 | ||
25 | struct unix_skb_parms { | 25 | struct unix_skb_parms { |
26 | struct ucred creds; /* Skb credentials */ | 26 | struct pid *pid; /* Skb credentials */ |
27 | const struct cred *cred; | ||
27 | struct scm_fp_list *fp; /* Passed files */ | 28 | struct scm_fp_list *fp; /* Passed files */ |
28 | #ifdef CONFIG_SECURITY_NETWORK | 29 | #ifdef CONFIG_SECURITY_NETWORK |
29 | u32 secid; /* Security ID */ | 30 | u32 secid; /* Security ID */ |
@@ -31,7 +32,6 @@ struct unix_skb_parms { | |||
31 | }; | 32 | }; |
32 | 33 | ||
33 | #define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) | 34 | #define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) |
34 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) | ||
35 | #define UNIXSID(skb) (&UNIXCB((skb)).secid) | 35 | #define UNIXSID(skb) (&UNIXCB((skb)).secid) |
36 | 36 | ||
37 | #define unix_state_lock(s) spin_lock(&unix_sk(s)->lock) | 37 | #define unix_state_lock(s) spin_lock(&unix_sk(s)->lock) |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index ff77e8f882f1..27a902d9b3a9 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -84,7 +84,7 @@ enum { | |||
84 | /* BD Address */ | 84 | /* BD Address */ |
85 | typedef struct { | 85 | typedef struct { |
86 | __u8 b[6]; | 86 | __u8 b[6]; |
87 | } __attribute__((packed)) bdaddr_t; | 87 | } __packed bdaddr_t; |
88 | 88 | ||
89 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) | 89 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) |
90 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) | 90 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) |
@@ -138,6 +138,7 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock); | |||
138 | struct bt_skb_cb { | 138 | struct bt_skb_cb { |
139 | __u8 pkt_type; | 139 | __u8 pkt_type; |
140 | __u8 incoming; | 140 | __u8 incoming; |
141 | __u16 expect; | ||
141 | __u8 tx_seq; | 142 | __u8 tx_seq; |
142 | __u8 retries; | 143 | __u8 retries; |
143 | __u8 sar; | 144 | __u8 sar; |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index fc0c502d9fd1..bcbdd6d4e6dd 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -100,6 +100,9 @@ enum { | |||
100 | #define HCISETACLMTU _IOW('H', 227, int) | 100 | #define HCISETACLMTU _IOW('H', 227, int) |
101 | #define HCISETSCOMTU _IOW('H', 228, int) | 101 | #define HCISETSCOMTU _IOW('H', 228, int) |
102 | 102 | ||
103 | #define HCIBLOCKADDR _IOW('H', 230, int) | ||
104 | #define HCIUNBLOCKADDR _IOW('H', 231, int) | ||
105 | |||
103 | #define HCIINQUIRY _IOR('H', 240, int) | 106 | #define HCIINQUIRY _IOR('H', 240, int) |
104 | 107 | ||
105 | /* HCI timeouts */ | 108 | /* HCI timeouts */ |
@@ -227,7 +230,7 @@ struct hci_cp_inquiry { | |||
227 | __u8 lap[3]; | 230 | __u8 lap[3]; |
228 | __u8 length; | 231 | __u8 length; |
229 | __u8 num_rsp; | 232 | __u8 num_rsp; |
230 | } __attribute__ ((packed)); | 233 | } __packed; |
231 | 234 | ||
232 | #define HCI_OP_INQUIRY_CANCEL 0x0402 | 235 | #define HCI_OP_INQUIRY_CANCEL 0x0402 |
233 | 236 | ||
@@ -241,81 +244,81 @@ struct hci_cp_create_conn { | |||
241 | __u8 pscan_mode; | 244 | __u8 pscan_mode; |
242 | __le16 clock_offset; | 245 | __le16 clock_offset; |
243 | __u8 role_switch; | 246 | __u8 role_switch; |
244 | } __attribute__ ((packed)); | 247 | } __packed; |
245 | 248 | ||
246 | #define HCI_OP_DISCONNECT 0x0406 | 249 | #define HCI_OP_DISCONNECT 0x0406 |
247 | struct hci_cp_disconnect { | 250 | struct hci_cp_disconnect { |
248 | __le16 handle; | 251 | __le16 handle; |
249 | __u8 reason; | 252 | __u8 reason; |
250 | } __attribute__ ((packed)); | 253 | } __packed; |
251 | 254 | ||
252 | #define HCI_OP_ADD_SCO 0x0407 | 255 | #define HCI_OP_ADD_SCO 0x0407 |
253 | struct hci_cp_add_sco { | 256 | struct hci_cp_add_sco { |
254 | __le16 handle; | 257 | __le16 handle; |
255 | __le16 pkt_type; | 258 | __le16 pkt_type; |
256 | } __attribute__ ((packed)); | 259 | } __packed; |
257 | 260 | ||
258 | #define HCI_OP_CREATE_CONN_CANCEL 0x0408 | 261 | #define HCI_OP_CREATE_CONN_CANCEL 0x0408 |
259 | struct hci_cp_create_conn_cancel { | 262 | struct hci_cp_create_conn_cancel { |
260 | bdaddr_t bdaddr; | 263 | bdaddr_t bdaddr; |
261 | } __attribute__ ((packed)); | 264 | } __packed; |
262 | 265 | ||
263 | #define HCI_OP_ACCEPT_CONN_REQ 0x0409 | 266 | #define HCI_OP_ACCEPT_CONN_REQ 0x0409 |
264 | struct hci_cp_accept_conn_req { | 267 | struct hci_cp_accept_conn_req { |
265 | bdaddr_t bdaddr; | 268 | bdaddr_t bdaddr; |
266 | __u8 role; | 269 | __u8 role; |
267 | } __attribute__ ((packed)); | 270 | } __packed; |
268 | 271 | ||
269 | #define HCI_OP_REJECT_CONN_REQ 0x040a | 272 | #define HCI_OP_REJECT_CONN_REQ 0x040a |
270 | struct hci_cp_reject_conn_req { | 273 | struct hci_cp_reject_conn_req { |
271 | bdaddr_t bdaddr; | 274 | bdaddr_t bdaddr; |
272 | __u8 reason; | 275 | __u8 reason; |
273 | } __attribute__ ((packed)); | 276 | } __packed; |
274 | 277 | ||
275 | #define HCI_OP_LINK_KEY_REPLY 0x040b | 278 | #define HCI_OP_LINK_KEY_REPLY 0x040b |
276 | struct hci_cp_link_key_reply { | 279 | struct hci_cp_link_key_reply { |
277 | bdaddr_t bdaddr; | 280 | bdaddr_t bdaddr; |
278 | __u8 link_key[16]; | 281 | __u8 link_key[16]; |
279 | } __attribute__ ((packed)); | 282 | } __packed; |
280 | 283 | ||
281 | #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c | 284 | #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c |
282 | struct hci_cp_link_key_neg_reply { | 285 | struct hci_cp_link_key_neg_reply { |
283 | bdaddr_t bdaddr; | 286 | bdaddr_t bdaddr; |
284 | } __attribute__ ((packed)); | 287 | } __packed; |
285 | 288 | ||
286 | #define HCI_OP_PIN_CODE_REPLY 0x040d | 289 | #define HCI_OP_PIN_CODE_REPLY 0x040d |
287 | struct hci_cp_pin_code_reply { | 290 | struct hci_cp_pin_code_reply { |
288 | bdaddr_t bdaddr; | 291 | bdaddr_t bdaddr; |
289 | __u8 pin_len; | 292 | __u8 pin_len; |
290 | __u8 pin_code[16]; | 293 | __u8 pin_code[16]; |
291 | } __attribute__ ((packed)); | 294 | } __packed; |
292 | 295 | ||
293 | #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e | 296 | #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e |
294 | struct hci_cp_pin_code_neg_reply { | 297 | struct hci_cp_pin_code_neg_reply { |
295 | bdaddr_t bdaddr; | 298 | bdaddr_t bdaddr; |
296 | } __attribute__ ((packed)); | 299 | } __packed; |
297 | 300 | ||
298 | #define HCI_OP_CHANGE_CONN_PTYPE 0x040f | 301 | #define HCI_OP_CHANGE_CONN_PTYPE 0x040f |
299 | struct hci_cp_change_conn_ptype { | 302 | struct hci_cp_change_conn_ptype { |
300 | __le16 handle; | 303 | __le16 handle; |
301 | __le16 pkt_type; | 304 | __le16 pkt_type; |
302 | } __attribute__ ((packed)); | 305 | } __packed; |
303 | 306 | ||
304 | #define HCI_OP_AUTH_REQUESTED 0x0411 | 307 | #define HCI_OP_AUTH_REQUESTED 0x0411 |
305 | struct hci_cp_auth_requested { | 308 | struct hci_cp_auth_requested { |
306 | __le16 handle; | 309 | __le16 handle; |
307 | } __attribute__ ((packed)); | 310 | } __packed; |
308 | 311 | ||
309 | #define HCI_OP_SET_CONN_ENCRYPT 0x0413 | 312 | #define HCI_OP_SET_CONN_ENCRYPT 0x0413 |
310 | struct hci_cp_set_conn_encrypt { | 313 | struct hci_cp_set_conn_encrypt { |
311 | __le16 handle; | 314 | __le16 handle; |
312 | __u8 encrypt; | 315 | __u8 encrypt; |
313 | } __attribute__ ((packed)); | 316 | } __packed; |
314 | 317 | ||
315 | #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 | 318 | #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415 |
316 | struct hci_cp_change_conn_link_key { | 319 | struct hci_cp_change_conn_link_key { |
317 | __le16 handle; | 320 | __le16 handle; |
318 | } __attribute__ ((packed)); | 321 | } __packed; |
319 | 322 | ||
320 | #define HCI_OP_REMOTE_NAME_REQ 0x0419 | 323 | #define HCI_OP_REMOTE_NAME_REQ 0x0419 |
321 | struct hci_cp_remote_name_req { | 324 | struct hci_cp_remote_name_req { |
@@ -323,28 +326,28 @@ struct hci_cp_remote_name_req { | |||
323 | __u8 pscan_rep_mode; | 326 | __u8 pscan_rep_mode; |
324 | __u8 pscan_mode; | 327 | __u8 pscan_mode; |
325 | __le16 clock_offset; | 328 | __le16 clock_offset; |
326 | } __attribute__ ((packed)); | 329 | } __packed; |
327 | 330 | ||
328 | #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a | 331 | #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a |
329 | struct hci_cp_remote_name_req_cancel { | 332 | struct hci_cp_remote_name_req_cancel { |
330 | bdaddr_t bdaddr; | 333 | bdaddr_t bdaddr; |
331 | } __attribute__ ((packed)); | 334 | } __packed; |
332 | 335 | ||
333 | #define HCI_OP_READ_REMOTE_FEATURES 0x041b | 336 | #define HCI_OP_READ_REMOTE_FEATURES 0x041b |
334 | struct hci_cp_read_remote_features { | 337 | struct hci_cp_read_remote_features { |
335 | __le16 handle; | 338 | __le16 handle; |
336 | } __attribute__ ((packed)); | 339 | } __packed; |
337 | 340 | ||
338 | #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c | 341 | #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c |
339 | struct hci_cp_read_remote_ext_features { | 342 | struct hci_cp_read_remote_ext_features { |
340 | __le16 handle; | 343 | __le16 handle; |
341 | __u8 page; | 344 | __u8 page; |
342 | } __attribute__ ((packed)); | 345 | } __packed; |
343 | 346 | ||
344 | #define HCI_OP_READ_REMOTE_VERSION 0x041d | 347 | #define HCI_OP_READ_REMOTE_VERSION 0x041d |
345 | struct hci_cp_read_remote_version { | 348 | struct hci_cp_read_remote_version { |
346 | __le16 handle; | 349 | __le16 handle; |
347 | } __attribute__ ((packed)); | 350 | } __packed; |
348 | 351 | ||
349 | #define HCI_OP_SETUP_SYNC_CONN 0x0428 | 352 | #define HCI_OP_SETUP_SYNC_CONN 0x0428 |
350 | struct hci_cp_setup_sync_conn { | 353 | struct hci_cp_setup_sync_conn { |
@@ -355,7 +358,7 @@ struct hci_cp_setup_sync_conn { | |||
355 | __le16 voice_setting; | 358 | __le16 voice_setting; |
356 | __u8 retrans_effort; | 359 | __u8 retrans_effort; |
357 | __le16 pkt_type; | 360 | __le16 pkt_type; |
358 | } __attribute__ ((packed)); | 361 | } __packed; |
359 | 362 | ||
360 | #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 | 363 | #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429 |
361 | struct hci_cp_accept_sync_conn_req { | 364 | struct hci_cp_accept_sync_conn_req { |
@@ -366,13 +369,13 @@ struct hci_cp_accept_sync_conn_req { | |||
366 | __le16 content_format; | 369 | __le16 content_format; |
367 | __u8 retrans_effort; | 370 | __u8 retrans_effort; |
368 | __le16 pkt_type; | 371 | __le16 pkt_type; |
369 | } __attribute__ ((packed)); | 372 | } __packed; |
370 | 373 | ||
371 | #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a | 374 | #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a |
372 | struct hci_cp_reject_sync_conn_req { | 375 | struct hci_cp_reject_sync_conn_req { |
373 | bdaddr_t bdaddr; | 376 | bdaddr_t bdaddr; |
374 | __u8 reason; | 377 | __u8 reason; |
375 | } __attribute__ ((packed)); | 378 | } __packed; |
376 | 379 | ||
377 | #define HCI_OP_SNIFF_MODE 0x0803 | 380 | #define HCI_OP_SNIFF_MODE 0x0803 |
378 | struct hci_cp_sniff_mode { | 381 | struct hci_cp_sniff_mode { |
@@ -381,59 +384,59 @@ struct hci_cp_sniff_mode { | |||
381 | __le16 min_interval; | 384 | __le16 min_interval; |
382 | __le16 attempt; | 385 | __le16 attempt; |
383 | __le16 timeout; | 386 | __le16 timeout; |
384 | } __attribute__ ((packed)); | 387 | } __packed; |
385 | 388 | ||
386 | #define HCI_OP_EXIT_SNIFF_MODE 0x0804 | 389 | #define HCI_OP_EXIT_SNIFF_MODE 0x0804 |
387 | struct hci_cp_exit_sniff_mode { | 390 | struct hci_cp_exit_sniff_mode { |
388 | __le16 handle; | 391 | __le16 handle; |
389 | } __attribute__ ((packed)); | 392 | } __packed; |
390 | 393 | ||
391 | #define HCI_OP_ROLE_DISCOVERY 0x0809 | 394 | #define HCI_OP_ROLE_DISCOVERY 0x0809 |
392 | struct hci_cp_role_discovery { | 395 | struct hci_cp_role_discovery { |
393 | __le16 handle; | 396 | __le16 handle; |
394 | } __attribute__ ((packed)); | 397 | } __packed; |
395 | struct hci_rp_role_discovery { | 398 | struct hci_rp_role_discovery { |
396 | __u8 status; | 399 | __u8 status; |
397 | __le16 handle; | 400 | __le16 handle; |
398 | __u8 role; | 401 | __u8 role; |
399 | } __attribute__ ((packed)); | 402 | } __packed; |
400 | 403 | ||
401 | #define HCI_OP_SWITCH_ROLE 0x080b | 404 | #define HCI_OP_SWITCH_ROLE 0x080b |
402 | struct hci_cp_switch_role { | 405 | struct hci_cp_switch_role { |
403 | bdaddr_t bdaddr; | 406 | bdaddr_t bdaddr; |
404 | __u8 role; | 407 | __u8 role; |
405 | } __attribute__ ((packed)); | 408 | } __packed; |
406 | 409 | ||
407 | #define HCI_OP_READ_LINK_POLICY 0x080c | 410 | #define HCI_OP_READ_LINK_POLICY 0x080c |
408 | struct hci_cp_read_link_policy { | 411 | struct hci_cp_read_link_policy { |
409 | __le16 handle; | 412 | __le16 handle; |
410 | } __attribute__ ((packed)); | 413 | } __packed; |
411 | struct hci_rp_read_link_policy { | 414 | struct hci_rp_read_link_policy { |
412 | __u8 status; | 415 | __u8 status; |
413 | __le16 handle; | 416 | __le16 handle; |
414 | __le16 policy; | 417 | __le16 policy; |
415 | } __attribute__ ((packed)); | 418 | } __packed; |
416 | 419 | ||
417 | #define HCI_OP_WRITE_LINK_POLICY 0x080d | 420 | #define HCI_OP_WRITE_LINK_POLICY 0x080d |
418 | struct hci_cp_write_link_policy { | 421 | struct hci_cp_write_link_policy { |
419 | __le16 handle; | 422 | __le16 handle; |
420 | __le16 policy; | 423 | __le16 policy; |
421 | } __attribute__ ((packed)); | 424 | } __packed; |
422 | struct hci_rp_write_link_policy { | 425 | struct hci_rp_write_link_policy { |
423 | __u8 status; | 426 | __u8 status; |
424 | __le16 handle; | 427 | __le16 handle; |
425 | } __attribute__ ((packed)); | 428 | } __packed; |
426 | 429 | ||
427 | #define HCI_OP_READ_DEF_LINK_POLICY 0x080e | 430 | #define HCI_OP_READ_DEF_LINK_POLICY 0x080e |
428 | struct hci_rp_read_def_link_policy { | 431 | struct hci_rp_read_def_link_policy { |
429 | __u8 status; | 432 | __u8 status; |
430 | __le16 policy; | 433 | __le16 policy; |
431 | } __attribute__ ((packed)); | 434 | } __packed; |
432 | 435 | ||
433 | #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f | 436 | #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f |
434 | struct hci_cp_write_def_link_policy { | 437 | struct hci_cp_write_def_link_policy { |
435 | __le16 policy; | 438 | __le16 policy; |
436 | } __attribute__ ((packed)); | 439 | } __packed; |
437 | 440 | ||
438 | #define HCI_OP_SNIFF_SUBRATE 0x0811 | 441 | #define HCI_OP_SNIFF_SUBRATE 0x0811 |
439 | struct hci_cp_sniff_subrate { | 442 | struct hci_cp_sniff_subrate { |
@@ -441,12 +444,12 @@ struct hci_cp_sniff_subrate { | |||
441 | __le16 max_latency; | 444 | __le16 max_latency; |
442 | __le16 min_remote_timeout; | 445 | __le16 min_remote_timeout; |
443 | __le16 min_local_timeout; | 446 | __le16 min_local_timeout; |
444 | } __attribute__ ((packed)); | 447 | } __packed; |
445 | 448 | ||
446 | #define HCI_OP_SET_EVENT_MASK 0x0c01 | 449 | #define HCI_OP_SET_EVENT_MASK 0x0c01 |
447 | struct hci_cp_set_event_mask { | 450 | struct hci_cp_set_event_mask { |
448 | __u8 mask[8]; | 451 | __u8 mask[8]; |
449 | } __attribute__ ((packed)); | 452 | } __packed; |
450 | 453 | ||
451 | #define HCI_OP_RESET 0x0c03 | 454 | #define HCI_OP_RESET 0x0c03 |
452 | 455 | ||
@@ -455,7 +458,7 @@ struct hci_cp_set_event_flt { | |||
455 | __u8 flt_type; | 458 | __u8 flt_type; |
456 | __u8 cond_type; | 459 | __u8 cond_type; |
457 | __u8 condition[0]; | 460 | __u8 condition[0]; |
458 | } __attribute__ ((packed)); | 461 | } __packed; |
459 | 462 | ||
460 | /* Filter types */ | 463 | /* Filter types */ |
461 | #define HCI_FLT_CLEAR_ALL 0x00 | 464 | #define HCI_FLT_CLEAR_ALL 0x00 |
@@ -474,13 +477,13 @@ struct hci_cp_set_event_flt { | |||
474 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 | 477 | #define HCI_OP_WRITE_LOCAL_NAME 0x0c13 |
475 | struct hci_cp_write_local_name { | 478 | struct hci_cp_write_local_name { |
476 | __u8 name[248]; | 479 | __u8 name[248]; |
477 | } __attribute__ ((packed)); | 480 | } __packed; |
478 | 481 | ||
479 | #define HCI_OP_READ_LOCAL_NAME 0x0c14 | 482 | #define HCI_OP_READ_LOCAL_NAME 0x0c14 |
480 | struct hci_rp_read_local_name { | 483 | struct hci_rp_read_local_name { |
481 | __u8 status; | 484 | __u8 status; |
482 | __u8 name[248]; | 485 | __u8 name[248]; |
483 | } __attribute__ ((packed)); | 486 | } __packed; |
484 | 487 | ||
485 | #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 | 488 | #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 |
486 | 489 | ||
@@ -508,23 +511,23 @@ struct hci_rp_read_local_name { | |||
508 | struct hci_rp_read_class_of_dev { | 511 | struct hci_rp_read_class_of_dev { |
509 | __u8 status; | 512 | __u8 status; |
510 | __u8 dev_class[3]; | 513 | __u8 dev_class[3]; |
511 | } __attribute__ ((packed)); | 514 | } __packed; |
512 | 515 | ||
513 | #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 | 516 | #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24 |
514 | struct hci_cp_write_class_of_dev { | 517 | struct hci_cp_write_class_of_dev { |
515 | __u8 dev_class[3]; | 518 | __u8 dev_class[3]; |
516 | } __attribute__ ((packed)); | 519 | } __packed; |
517 | 520 | ||
518 | #define HCI_OP_READ_VOICE_SETTING 0x0c25 | 521 | #define HCI_OP_READ_VOICE_SETTING 0x0c25 |
519 | struct hci_rp_read_voice_setting { | 522 | struct hci_rp_read_voice_setting { |
520 | __u8 status; | 523 | __u8 status; |
521 | __le16 voice_setting; | 524 | __le16 voice_setting; |
522 | } __attribute__ ((packed)); | 525 | } __packed; |
523 | 526 | ||
524 | #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 | 527 | #define HCI_OP_WRITE_VOICE_SETTING 0x0c26 |
525 | struct hci_cp_write_voice_setting { | 528 | struct hci_cp_write_voice_setting { |
526 | __le16 voice_setting; | 529 | __le16 voice_setting; |
527 | } __attribute__ ((packed)); | 530 | } __packed; |
528 | 531 | ||
529 | #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 | 532 | #define HCI_OP_HOST_BUFFER_SIZE 0x0c33 |
530 | struct hci_cp_host_buffer_size { | 533 | struct hci_cp_host_buffer_size { |
@@ -532,18 +535,18 @@ struct hci_cp_host_buffer_size { | |||
532 | __u8 sco_mtu; | 535 | __u8 sco_mtu; |
533 | __le16 acl_max_pkt; | 536 | __le16 acl_max_pkt; |
534 | __le16 sco_max_pkt; | 537 | __le16 sco_max_pkt; |
535 | } __attribute__ ((packed)); | 538 | } __packed; |
536 | 539 | ||
537 | #define HCI_OP_READ_SSP_MODE 0x0c55 | 540 | #define HCI_OP_READ_SSP_MODE 0x0c55 |
538 | struct hci_rp_read_ssp_mode { | 541 | struct hci_rp_read_ssp_mode { |
539 | __u8 status; | 542 | __u8 status; |
540 | __u8 mode; | 543 | __u8 mode; |
541 | } __attribute__ ((packed)); | 544 | } __packed; |
542 | 545 | ||
543 | #define HCI_OP_WRITE_SSP_MODE 0x0c56 | 546 | #define HCI_OP_WRITE_SSP_MODE 0x0c56 |
544 | struct hci_cp_write_ssp_mode { | 547 | struct hci_cp_write_ssp_mode { |
545 | __u8 mode; | 548 | __u8 mode; |
546 | } __attribute__ ((packed)); | 549 | } __packed; |
547 | 550 | ||
548 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 551 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
549 | struct hci_rp_read_local_version { | 552 | struct hci_rp_read_local_version { |
@@ -553,19 +556,19 @@ struct hci_rp_read_local_version { | |||
553 | __u8 lmp_ver; | 556 | __u8 lmp_ver; |
554 | __le16 manufacturer; | 557 | __le16 manufacturer; |
555 | __le16 lmp_subver; | 558 | __le16 lmp_subver; |
556 | } __attribute__ ((packed)); | 559 | } __packed; |
557 | 560 | ||
558 | #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 | 561 | #define HCI_OP_READ_LOCAL_COMMANDS 0x1002 |
559 | struct hci_rp_read_local_commands { | 562 | struct hci_rp_read_local_commands { |
560 | __u8 status; | 563 | __u8 status; |
561 | __u8 commands[64]; | 564 | __u8 commands[64]; |
562 | } __attribute__ ((packed)); | 565 | } __packed; |
563 | 566 | ||
564 | #define HCI_OP_READ_LOCAL_FEATURES 0x1003 | 567 | #define HCI_OP_READ_LOCAL_FEATURES 0x1003 |
565 | struct hci_rp_read_local_features { | 568 | struct hci_rp_read_local_features { |
566 | __u8 status; | 569 | __u8 status; |
567 | __u8 features[8]; | 570 | __u8 features[8]; |
568 | } __attribute__ ((packed)); | 571 | } __packed; |
569 | 572 | ||
570 | #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 | 573 | #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 |
571 | struct hci_rp_read_local_ext_features { | 574 | struct hci_rp_read_local_ext_features { |
@@ -573,7 +576,7 @@ struct hci_rp_read_local_ext_features { | |||
573 | __u8 page; | 576 | __u8 page; |
574 | __u8 max_page; | 577 | __u8 max_page; |
575 | __u8 features[8]; | 578 | __u8 features[8]; |
576 | } __attribute__ ((packed)); | 579 | } __packed; |
577 | 580 | ||
578 | #define HCI_OP_READ_BUFFER_SIZE 0x1005 | 581 | #define HCI_OP_READ_BUFFER_SIZE 0x1005 |
579 | struct hci_rp_read_buffer_size { | 582 | struct hci_rp_read_buffer_size { |
@@ -582,13 +585,13 @@ struct hci_rp_read_buffer_size { | |||
582 | __u8 sco_mtu; | 585 | __u8 sco_mtu; |
583 | __le16 acl_max_pkt; | 586 | __le16 acl_max_pkt; |
584 | __le16 sco_max_pkt; | 587 | __le16 sco_max_pkt; |
585 | } __attribute__ ((packed)); | 588 | } __packed; |
586 | 589 | ||
587 | #define HCI_OP_READ_BD_ADDR 0x1009 | 590 | #define HCI_OP_READ_BD_ADDR 0x1009 |
588 | struct hci_rp_read_bd_addr { | 591 | struct hci_rp_read_bd_addr { |
589 | __u8 status; | 592 | __u8 status; |
590 | bdaddr_t bdaddr; | 593 | bdaddr_t bdaddr; |
591 | } __attribute__ ((packed)); | 594 | } __packed; |
592 | 595 | ||
593 | /* ---- HCI Events ---- */ | 596 | /* ---- HCI Events ---- */ |
594 | #define HCI_EV_INQUIRY_COMPLETE 0x01 | 597 | #define HCI_EV_INQUIRY_COMPLETE 0x01 |
@@ -601,7 +604,7 @@ struct inquiry_info { | |||
601 | __u8 pscan_mode; | 604 | __u8 pscan_mode; |
602 | __u8 dev_class[3]; | 605 | __u8 dev_class[3]; |
603 | __le16 clock_offset; | 606 | __le16 clock_offset; |
604 | } __attribute__ ((packed)); | 607 | } __packed; |
605 | 608 | ||
606 | #define HCI_EV_CONN_COMPLETE 0x03 | 609 | #define HCI_EV_CONN_COMPLETE 0x03 |
607 | struct hci_ev_conn_complete { | 610 | struct hci_ev_conn_complete { |
@@ -610,54 +613,54 @@ struct hci_ev_conn_complete { | |||
610 | bdaddr_t bdaddr; | 613 | bdaddr_t bdaddr; |
611 | __u8 link_type; | 614 | __u8 link_type; |
612 | __u8 encr_mode; | 615 | __u8 encr_mode; |
613 | } __attribute__ ((packed)); | 616 | } __packed; |
614 | 617 | ||
615 | #define HCI_EV_CONN_REQUEST 0x04 | 618 | #define HCI_EV_CONN_REQUEST 0x04 |
616 | struct hci_ev_conn_request { | 619 | struct hci_ev_conn_request { |
617 | bdaddr_t bdaddr; | 620 | bdaddr_t bdaddr; |
618 | __u8 dev_class[3]; | 621 | __u8 dev_class[3]; |
619 | __u8 link_type; | 622 | __u8 link_type; |
620 | } __attribute__ ((packed)); | 623 | } __packed; |
621 | 624 | ||
622 | #define HCI_EV_DISCONN_COMPLETE 0x05 | 625 | #define HCI_EV_DISCONN_COMPLETE 0x05 |
623 | struct hci_ev_disconn_complete { | 626 | struct hci_ev_disconn_complete { |
624 | __u8 status; | 627 | __u8 status; |
625 | __le16 handle; | 628 | __le16 handle; |
626 | __u8 reason; | 629 | __u8 reason; |
627 | } __attribute__ ((packed)); | 630 | } __packed; |
628 | 631 | ||
629 | #define HCI_EV_AUTH_COMPLETE 0x06 | 632 | #define HCI_EV_AUTH_COMPLETE 0x06 |
630 | struct hci_ev_auth_complete { | 633 | struct hci_ev_auth_complete { |
631 | __u8 status; | 634 | __u8 status; |
632 | __le16 handle; | 635 | __le16 handle; |
633 | } __attribute__ ((packed)); | 636 | } __packed; |
634 | 637 | ||
635 | #define HCI_EV_REMOTE_NAME 0x07 | 638 | #define HCI_EV_REMOTE_NAME 0x07 |
636 | struct hci_ev_remote_name { | 639 | struct hci_ev_remote_name { |
637 | __u8 status; | 640 | __u8 status; |
638 | bdaddr_t bdaddr; | 641 | bdaddr_t bdaddr; |
639 | __u8 name[248]; | 642 | __u8 name[248]; |
640 | } __attribute__ ((packed)); | 643 | } __packed; |
641 | 644 | ||
642 | #define HCI_EV_ENCRYPT_CHANGE 0x08 | 645 | #define HCI_EV_ENCRYPT_CHANGE 0x08 |
643 | struct hci_ev_encrypt_change { | 646 | struct hci_ev_encrypt_change { |
644 | __u8 status; | 647 | __u8 status; |
645 | __le16 handle; | 648 | __le16 handle; |
646 | __u8 encrypt; | 649 | __u8 encrypt; |
647 | } __attribute__ ((packed)); | 650 | } __packed; |
648 | 651 | ||
649 | #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 | 652 | #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09 |
650 | struct hci_ev_change_link_key_complete { | 653 | struct hci_ev_change_link_key_complete { |
651 | __u8 status; | 654 | __u8 status; |
652 | __le16 handle; | 655 | __le16 handle; |
653 | } __attribute__ ((packed)); | 656 | } __packed; |
654 | 657 | ||
655 | #define HCI_EV_REMOTE_FEATURES 0x0b | 658 | #define HCI_EV_REMOTE_FEATURES 0x0b |
656 | struct hci_ev_remote_features { | 659 | struct hci_ev_remote_features { |
657 | __u8 status; | 660 | __u8 status; |
658 | __le16 handle; | 661 | __le16 handle; |
659 | __u8 features[8]; | 662 | __u8 features[8]; |
660 | } __attribute__ ((packed)); | 663 | } __packed; |
661 | 664 | ||
662 | #define HCI_EV_REMOTE_VERSION 0x0c | 665 | #define HCI_EV_REMOTE_VERSION 0x0c |
663 | struct hci_ev_remote_version { | 666 | struct hci_ev_remote_version { |
@@ -666,7 +669,7 @@ struct hci_ev_remote_version { | |||
666 | __u8 lmp_ver; | 669 | __u8 lmp_ver; |
667 | __le16 manufacturer; | 670 | __le16 manufacturer; |
668 | __le16 lmp_subver; | 671 | __le16 lmp_subver; |
669 | } __attribute__ ((packed)); | 672 | } __packed; |
670 | 673 | ||
671 | #define HCI_EV_QOS_SETUP_COMPLETE 0x0d | 674 | #define HCI_EV_QOS_SETUP_COMPLETE 0x0d |
672 | struct hci_qos { | 675 | struct hci_qos { |
@@ -675,38 +678,38 @@ struct hci_qos { | |||
675 | __u32 peak_bandwidth; | 678 | __u32 peak_bandwidth; |
676 | __u32 latency; | 679 | __u32 latency; |
677 | __u32 delay_variation; | 680 | __u32 delay_variation; |
678 | } __attribute__ ((packed)); | 681 | } __packed; |
679 | struct hci_ev_qos_setup_complete { | 682 | struct hci_ev_qos_setup_complete { |
680 | __u8 status; | 683 | __u8 status; |
681 | __le16 handle; | 684 | __le16 handle; |
682 | struct hci_qos qos; | 685 | struct hci_qos qos; |
683 | } __attribute__ ((packed)); | 686 | } __packed; |
684 | 687 | ||
685 | #define HCI_EV_CMD_COMPLETE 0x0e | 688 | #define HCI_EV_CMD_COMPLETE 0x0e |
686 | struct hci_ev_cmd_complete { | 689 | struct hci_ev_cmd_complete { |
687 | __u8 ncmd; | 690 | __u8 ncmd; |
688 | __le16 opcode; | 691 | __le16 opcode; |
689 | } __attribute__ ((packed)); | 692 | } __packed; |
690 | 693 | ||
691 | #define HCI_EV_CMD_STATUS 0x0f | 694 | #define HCI_EV_CMD_STATUS 0x0f |
692 | struct hci_ev_cmd_status { | 695 | struct hci_ev_cmd_status { |
693 | __u8 status; | 696 | __u8 status; |
694 | __u8 ncmd; | 697 | __u8 ncmd; |
695 | __le16 opcode; | 698 | __le16 opcode; |
696 | } __attribute__ ((packed)); | 699 | } __packed; |
697 | 700 | ||
698 | #define HCI_EV_ROLE_CHANGE 0x12 | 701 | #define HCI_EV_ROLE_CHANGE 0x12 |
699 | struct hci_ev_role_change { | 702 | struct hci_ev_role_change { |
700 | __u8 status; | 703 | __u8 status; |
701 | bdaddr_t bdaddr; | 704 | bdaddr_t bdaddr; |
702 | __u8 role; | 705 | __u8 role; |
703 | } __attribute__ ((packed)); | 706 | } __packed; |
704 | 707 | ||
705 | #define HCI_EV_NUM_COMP_PKTS 0x13 | 708 | #define HCI_EV_NUM_COMP_PKTS 0x13 |
706 | struct hci_ev_num_comp_pkts { | 709 | struct hci_ev_num_comp_pkts { |
707 | __u8 num_hndl; | 710 | __u8 num_hndl; |
708 | /* variable length part */ | 711 | /* variable length part */ |
709 | } __attribute__ ((packed)); | 712 | } __packed; |
710 | 713 | ||
711 | #define HCI_EV_MODE_CHANGE 0x14 | 714 | #define HCI_EV_MODE_CHANGE 0x14 |
712 | struct hci_ev_mode_change { | 715 | struct hci_ev_mode_change { |
@@ -714,44 +717,44 @@ struct hci_ev_mode_change { | |||
714 | __le16 handle; | 717 | __le16 handle; |
715 | __u8 mode; | 718 | __u8 mode; |
716 | __le16 interval; | 719 | __le16 interval; |
717 | } __attribute__ ((packed)); | 720 | } __packed; |
718 | 721 | ||
719 | #define HCI_EV_PIN_CODE_REQ 0x16 | 722 | #define HCI_EV_PIN_CODE_REQ 0x16 |
720 | struct hci_ev_pin_code_req { | 723 | struct hci_ev_pin_code_req { |
721 | bdaddr_t bdaddr; | 724 | bdaddr_t bdaddr; |
722 | } __attribute__ ((packed)); | 725 | } __packed; |
723 | 726 | ||
724 | #define HCI_EV_LINK_KEY_REQ 0x17 | 727 | #define HCI_EV_LINK_KEY_REQ 0x17 |
725 | struct hci_ev_link_key_req { | 728 | struct hci_ev_link_key_req { |
726 | bdaddr_t bdaddr; | 729 | bdaddr_t bdaddr; |
727 | } __attribute__ ((packed)); | 730 | } __packed; |
728 | 731 | ||
729 | #define HCI_EV_LINK_KEY_NOTIFY 0x18 | 732 | #define HCI_EV_LINK_KEY_NOTIFY 0x18 |
730 | struct hci_ev_link_key_notify { | 733 | struct hci_ev_link_key_notify { |
731 | bdaddr_t bdaddr; | 734 | bdaddr_t bdaddr; |
732 | __u8 link_key[16]; | 735 | __u8 link_key[16]; |
733 | __u8 key_type; | 736 | __u8 key_type; |
734 | } __attribute__ ((packed)); | 737 | } __packed; |
735 | 738 | ||
736 | #define HCI_EV_CLOCK_OFFSET 0x1c | 739 | #define HCI_EV_CLOCK_OFFSET 0x1c |
737 | struct hci_ev_clock_offset { | 740 | struct hci_ev_clock_offset { |
738 | __u8 status; | 741 | __u8 status; |
739 | __le16 handle; | 742 | __le16 handle; |
740 | __le16 clock_offset; | 743 | __le16 clock_offset; |
741 | } __attribute__ ((packed)); | 744 | } __packed; |
742 | 745 | ||
743 | #define HCI_EV_PKT_TYPE_CHANGE 0x1d | 746 | #define HCI_EV_PKT_TYPE_CHANGE 0x1d |
744 | struct hci_ev_pkt_type_change { | 747 | struct hci_ev_pkt_type_change { |
745 | __u8 status; | 748 | __u8 status; |
746 | __le16 handle; | 749 | __le16 handle; |
747 | __le16 pkt_type; | 750 | __le16 pkt_type; |
748 | } __attribute__ ((packed)); | 751 | } __packed; |
749 | 752 | ||
750 | #define HCI_EV_PSCAN_REP_MODE 0x20 | 753 | #define HCI_EV_PSCAN_REP_MODE 0x20 |
751 | struct hci_ev_pscan_rep_mode { | 754 | struct hci_ev_pscan_rep_mode { |
752 | bdaddr_t bdaddr; | 755 | bdaddr_t bdaddr; |
753 | __u8 pscan_rep_mode; | 756 | __u8 pscan_rep_mode; |
754 | } __attribute__ ((packed)); | 757 | } __packed; |
755 | 758 | ||
756 | #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 | 759 | #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 |
757 | struct inquiry_info_with_rssi { | 760 | struct inquiry_info_with_rssi { |
@@ -761,7 +764,7 @@ struct inquiry_info_with_rssi { | |||
761 | __u8 dev_class[3]; | 764 | __u8 dev_class[3]; |
762 | __le16 clock_offset; | 765 | __le16 clock_offset; |
763 | __s8 rssi; | 766 | __s8 rssi; |
764 | } __attribute__ ((packed)); | 767 | } __packed; |
765 | struct inquiry_info_with_rssi_and_pscan_mode { | 768 | struct inquiry_info_with_rssi_and_pscan_mode { |
766 | bdaddr_t bdaddr; | 769 | bdaddr_t bdaddr; |
767 | __u8 pscan_rep_mode; | 770 | __u8 pscan_rep_mode; |
@@ -770,7 +773,7 @@ struct inquiry_info_with_rssi_and_pscan_mode { | |||
770 | __u8 dev_class[3]; | 773 | __u8 dev_class[3]; |
771 | __le16 clock_offset; | 774 | __le16 clock_offset; |
772 | __s8 rssi; | 775 | __s8 rssi; |
773 | } __attribute__ ((packed)); | 776 | } __packed; |
774 | 777 | ||
775 | #define HCI_EV_REMOTE_EXT_FEATURES 0x23 | 778 | #define HCI_EV_REMOTE_EXT_FEATURES 0x23 |
776 | struct hci_ev_remote_ext_features { | 779 | struct hci_ev_remote_ext_features { |
@@ -779,7 +782,7 @@ struct hci_ev_remote_ext_features { | |||
779 | __u8 page; | 782 | __u8 page; |
780 | __u8 max_page; | 783 | __u8 max_page; |
781 | __u8 features[8]; | 784 | __u8 features[8]; |
782 | } __attribute__ ((packed)); | 785 | } __packed; |
783 | 786 | ||
784 | #define HCI_EV_SYNC_CONN_COMPLETE 0x2c | 787 | #define HCI_EV_SYNC_CONN_COMPLETE 0x2c |
785 | struct hci_ev_sync_conn_complete { | 788 | struct hci_ev_sync_conn_complete { |
@@ -792,7 +795,7 @@ struct hci_ev_sync_conn_complete { | |||
792 | __le16 rx_pkt_len; | 795 | __le16 rx_pkt_len; |
793 | __le16 tx_pkt_len; | 796 | __le16 tx_pkt_len; |
794 | __u8 air_mode; | 797 | __u8 air_mode; |
795 | } __attribute__ ((packed)); | 798 | } __packed; |
796 | 799 | ||
797 | #define HCI_EV_SYNC_CONN_CHANGED 0x2d | 800 | #define HCI_EV_SYNC_CONN_CHANGED 0x2d |
798 | struct hci_ev_sync_conn_changed { | 801 | struct hci_ev_sync_conn_changed { |
@@ -802,7 +805,7 @@ struct hci_ev_sync_conn_changed { | |||
802 | __u8 retrans_window; | 805 | __u8 retrans_window; |
803 | __le16 rx_pkt_len; | 806 | __le16 rx_pkt_len; |
804 | __le16 tx_pkt_len; | 807 | __le16 tx_pkt_len; |
805 | } __attribute__ ((packed)); | 808 | } __packed; |
806 | 809 | ||
807 | #define HCI_EV_SNIFF_SUBRATE 0x2e | 810 | #define HCI_EV_SNIFF_SUBRATE 0x2e |
808 | struct hci_ev_sniff_subrate { | 811 | struct hci_ev_sniff_subrate { |
@@ -812,7 +815,7 @@ struct hci_ev_sniff_subrate { | |||
812 | __le16 max_rx_latency; | 815 | __le16 max_rx_latency; |
813 | __le16 max_remote_timeout; | 816 | __le16 max_remote_timeout; |
814 | __le16 max_local_timeout; | 817 | __le16 max_local_timeout; |
815 | } __attribute__ ((packed)); | 818 | } __packed; |
816 | 819 | ||
817 | #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f | 820 | #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f |
818 | struct extended_inquiry_info { | 821 | struct extended_inquiry_info { |
@@ -823,37 +826,37 @@ struct extended_inquiry_info { | |||
823 | __le16 clock_offset; | 826 | __le16 clock_offset; |
824 | __s8 rssi; | 827 | __s8 rssi; |
825 | __u8 data[240]; | 828 | __u8 data[240]; |
826 | } __attribute__ ((packed)); | 829 | } __packed; |
827 | 830 | ||
828 | #define HCI_EV_IO_CAPA_REQUEST 0x31 | 831 | #define HCI_EV_IO_CAPA_REQUEST 0x31 |
829 | struct hci_ev_io_capa_request { | 832 | struct hci_ev_io_capa_request { |
830 | bdaddr_t bdaddr; | 833 | bdaddr_t bdaddr; |
831 | } __attribute__ ((packed)); | 834 | } __packed; |
832 | 835 | ||
833 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 | 836 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 |
834 | struct hci_ev_simple_pair_complete { | 837 | struct hci_ev_simple_pair_complete { |
835 | __u8 status; | 838 | __u8 status; |
836 | bdaddr_t bdaddr; | 839 | bdaddr_t bdaddr; |
837 | } __attribute__ ((packed)); | 840 | } __packed; |
838 | 841 | ||
839 | #define HCI_EV_REMOTE_HOST_FEATURES 0x3d | 842 | #define HCI_EV_REMOTE_HOST_FEATURES 0x3d |
840 | struct hci_ev_remote_host_features { | 843 | struct hci_ev_remote_host_features { |
841 | bdaddr_t bdaddr; | 844 | bdaddr_t bdaddr; |
842 | __u8 features[8]; | 845 | __u8 features[8]; |
843 | } __attribute__ ((packed)); | 846 | } __packed; |
844 | 847 | ||
845 | /* Internal events generated by Bluetooth stack */ | 848 | /* Internal events generated by Bluetooth stack */ |
846 | #define HCI_EV_STACK_INTERNAL 0xfd | 849 | #define HCI_EV_STACK_INTERNAL 0xfd |
847 | struct hci_ev_stack_internal { | 850 | struct hci_ev_stack_internal { |
848 | __u16 type; | 851 | __u16 type; |
849 | __u8 data[0]; | 852 | __u8 data[0]; |
850 | } __attribute__ ((packed)); | 853 | } __packed; |
851 | 854 | ||
852 | #define HCI_EV_SI_DEVICE 0x01 | 855 | #define HCI_EV_SI_DEVICE 0x01 |
853 | struct hci_ev_si_device { | 856 | struct hci_ev_si_device { |
854 | __u16 event; | 857 | __u16 event; |
855 | __u16 dev_id; | 858 | __u16 dev_id; |
856 | } __attribute__ ((packed)); | 859 | } __packed; |
857 | 860 | ||
858 | #define HCI_EV_SI_SECURITY 0x02 | 861 | #define HCI_EV_SI_SECURITY 0x02 |
859 | struct hci_ev_si_security { | 862 | struct hci_ev_si_security { |
@@ -861,7 +864,7 @@ struct hci_ev_si_security { | |||
861 | __u16 proto; | 864 | __u16 proto; |
862 | __u16 subproto; | 865 | __u16 subproto; |
863 | __u8 incoming; | 866 | __u8 incoming; |
864 | } __attribute__ ((packed)); | 867 | } __packed; |
865 | 868 | ||
866 | /* ---- HCI Packet structures ---- */ | 869 | /* ---- HCI Packet structures ---- */ |
867 | #define HCI_COMMAND_HDR_SIZE 3 | 870 | #define HCI_COMMAND_HDR_SIZE 3 |
@@ -872,22 +875,22 @@ struct hci_ev_si_security { | |||
872 | struct hci_command_hdr { | 875 | struct hci_command_hdr { |
873 | __le16 opcode; /* OCF & OGF */ | 876 | __le16 opcode; /* OCF & OGF */ |
874 | __u8 plen; | 877 | __u8 plen; |
875 | } __attribute__ ((packed)); | 878 | } __packed; |
876 | 879 | ||
877 | struct hci_event_hdr { | 880 | struct hci_event_hdr { |
878 | __u8 evt; | 881 | __u8 evt; |
879 | __u8 plen; | 882 | __u8 plen; |
880 | } __attribute__ ((packed)); | 883 | } __packed; |
881 | 884 | ||
882 | struct hci_acl_hdr { | 885 | struct hci_acl_hdr { |
883 | __le16 handle; /* Handle & Flags(PB, BC) */ | 886 | __le16 handle; /* Handle & Flags(PB, BC) */ |
884 | __le16 dlen; | 887 | __le16 dlen; |
885 | } __attribute__ ((packed)); | 888 | } __packed; |
886 | 889 | ||
887 | struct hci_sco_hdr { | 890 | struct hci_sco_hdr { |
888 | __le16 handle; | 891 | __le16 handle; |
889 | __u8 dlen; | 892 | __u8 dlen; |
890 | } __attribute__ ((packed)); | 893 | } __packed; |
891 | 894 | ||
892 | #ifdef __KERNEL__ | 895 | #ifdef __KERNEL__ |
893 | #include <linux/skbuff.h> | 896 | #include <linux/skbuff.h> |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index e42f6ed5421c..8b28962e737e 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved. |
4 | 4 | ||
5 | Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> | 5 | Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> |
6 | 6 | ||
@@ -12,13 +12,13 @@ | |||
12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | 19 | ||
20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
23 | */ | 23 | */ |
24 | 24 | ||
@@ -62,6 +62,11 @@ struct hci_conn_hash { | |||
62 | unsigned int sco_num; | 62 | unsigned int sco_num; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | struct bdaddr_list { | ||
66 | struct list_head list; | ||
67 | bdaddr_t bdaddr; | ||
68 | }; | ||
69 | #define NUM_REASSEMBLY 4 | ||
65 | struct hci_dev { | 70 | struct hci_dev { |
66 | struct list_head list; | 71 | struct list_head list; |
67 | spinlock_t lock; | 72 | spinlock_t lock; |
@@ -118,7 +123,7 @@ struct hci_dev { | |||
118 | struct sk_buff_head cmd_q; | 123 | struct sk_buff_head cmd_q; |
119 | 124 | ||
120 | struct sk_buff *sent_cmd; | 125 | struct sk_buff *sent_cmd; |
121 | struct sk_buff *reassembly[3]; | 126 | struct sk_buff *reassembly[NUM_REASSEMBLY]; |
122 | 127 | ||
123 | struct mutex req_lock; | 128 | struct mutex req_lock; |
124 | wait_queue_head_t req_wait_q; | 129 | wait_queue_head_t req_wait_q; |
@@ -127,6 +132,7 @@ struct hci_dev { | |||
127 | 132 | ||
128 | struct inquiry_cache inq_cache; | 133 | struct inquiry_cache inq_cache; |
129 | struct hci_conn_hash conn_hash; | 134 | struct hci_conn_hash conn_hash; |
135 | struct bdaddr_list blacklist; | ||
130 | 136 | ||
131 | struct hci_dev_stats stat; | 137 | struct hci_dev_stats stat; |
132 | 138 | ||
@@ -250,6 +256,7 @@ enum { | |||
250 | HCI_CONN_ENCRYPT_PEND, | 256 | HCI_CONN_ENCRYPT_PEND, |
251 | HCI_CONN_RSWITCH_PEND, | 257 | HCI_CONN_RSWITCH_PEND, |
252 | HCI_CONN_MODE_CHANGE_PEND, | 258 | HCI_CONN_MODE_CHANGE_PEND, |
259 | HCI_CONN_SCO_SETUP_PEND, | ||
253 | }; | 260 | }; |
254 | 261 | ||
255 | static inline void hci_conn_hash_init(struct hci_dev *hdev) | 262 | static inline void hci_conn_hash_init(struct hci_dev *hdev) |
@@ -330,6 +337,7 @@ void hci_acl_connect(struct hci_conn *conn); | |||
330 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); | 337 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); |
331 | void hci_add_sco(struct hci_conn *conn, __u16 handle); | 338 | void hci_add_sco(struct hci_conn *conn, __u16 handle); |
332 | void hci_setup_sync(struct hci_conn *conn, __u16 handle); | 339 | void hci_setup_sync(struct hci_conn *conn, __u16 handle); |
340 | void hci_sco_setup(struct hci_conn *conn, __u8 status); | ||
333 | 341 | ||
334 | struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); | 342 | struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); |
335 | int hci_conn_del(struct hci_conn *conn); | 343 | int hci_conn_del(struct hci_conn *conn); |
@@ -380,7 +388,7 @@ static inline void __hci_dev_put(struct hci_dev *d) | |||
380 | } | 388 | } |
381 | 389 | ||
382 | static inline void hci_dev_put(struct hci_dev *d) | 390 | static inline void hci_dev_put(struct hci_dev *d) |
383 | { | 391 | { |
384 | __hci_dev_put(d); | 392 | __hci_dev_put(d); |
385 | module_put(d->owner); | 393 | module_put(d->owner); |
386 | } | 394 | } |
@@ -424,10 +432,14 @@ int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); | |||
424 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | 432 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); |
425 | int hci_inquiry(void __user *arg); | 433 | int hci_inquiry(void __user *arg); |
426 | 434 | ||
435 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); | ||
436 | int hci_blacklist_clear(struct hci_dev *hdev); | ||
437 | |||
427 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 438 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
428 | 439 | ||
429 | int hci_recv_frame(struct sk_buff *skb); | 440 | int hci_recv_frame(struct sk_buff *skb); |
430 | int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); | 441 | int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); |
442 | int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count); | ||
431 | 443 | ||
432 | int hci_register_sysfs(struct hci_dev *hdev); | 444 | int hci_register_sysfs(struct hci_dev *hdev); |
433 | void hci_unregister_sysfs(struct hci_dev *hdev); | 445 | void hci_unregister_sysfs(struct hci_dev *hdev); |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 7c695bfd853c..636724b203ee 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -1,6 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
4 | Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org> | ||
5 | Copyright (C) 2010 Google Inc. | ||
4 | 6 | ||
5 | Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> | 7 | Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> |
6 | 8 | ||
@@ -129,31 +131,31 @@ struct l2cap_conninfo { | |||
129 | struct l2cap_hdr { | 131 | struct l2cap_hdr { |
130 | __le16 len; | 132 | __le16 len; |
131 | __le16 cid; | 133 | __le16 cid; |
132 | } __attribute__ ((packed)); | 134 | } __packed; |
133 | #define L2CAP_HDR_SIZE 4 | 135 | #define L2CAP_HDR_SIZE 4 |
134 | 136 | ||
135 | struct l2cap_cmd_hdr { | 137 | struct l2cap_cmd_hdr { |
136 | __u8 code; | 138 | __u8 code; |
137 | __u8 ident; | 139 | __u8 ident; |
138 | __le16 len; | 140 | __le16 len; |
139 | } __attribute__ ((packed)); | 141 | } __packed; |
140 | #define L2CAP_CMD_HDR_SIZE 4 | 142 | #define L2CAP_CMD_HDR_SIZE 4 |
141 | 143 | ||
142 | struct l2cap_cmd_rej { | 144 | struct l2cap_cmd_rej { |
143 | __le16 reason; | 145 | __le16 reason; |
144 | } __attribute__ ((packed)); | 146 | } __packed; |
145 | 147 | ||
146 | struct l2cap_conn_req { | 148 | struct l2cap_conn_req { |
147 | __le16 psm; | 149 | __le16 psm; |
148 | __le16 scid; | 150 | __le16 scid; |
149 | } __attribute__ ((packed)); | 151 | } __packed; |
150 | 152 | ||
151 | struct l2cap_conn_rsp { | 153 | struct l2cap_conn_rsp { |
152 | __le16 dcid; | 154 | __le16 dcid; |
153 | __le16 scid; | 155 | __le16 scid; |
154 | __le16 result; | 156 | __le16 result; |
155 | __le16 status; | 157 | __le16 status; |
156 | } __attribute__ ((packed)); | 158 | } __packed; |
157 | 159 | ||
158 | /* channel indentifier */ | 160 | /* channel indentifier */ |
159 | #define L2CAP_CID_SIGNALING 0x0001 | 161 | #define L2CAP_CID_SIGNALING 0x0001 |
@@ -177,14 +179,14 @@ struct l2cap_conf_req { | |||
177 | __le16 dcid; | 179 | __le16 dcid; |
178 | __le16 flags; | 180 | __le16 flags; |
179 | __u8 data[0]; | 181 | __u8 data[0]; |
180 | } __attribute__ ((packed)); | 182 | } __packed; |
181 | 183 | ||
182 | struct l2cap_conf_rsp { | 184 | struct l2cap_conf_rsp { |
183 | __le16 scid; | 185 | __le16 scid; |
184 | __le16 flags; | 186 | __le16 flags; |
185 | __le16 result; | 187 | __le16 result; |
186 | __u8 data[0]; | 188 | __u8 data[0]; |
187 | } __attribute__ ((packed)); | 189 | } __packed; |
188 | 190 | ||
189 | #define L2CAP_CONF_SUCCESS 0x0000 | 191 | #define L2CAP_CONF_SUCCESS 0x0000 |
190 | #define L2CAP_CONF_UNACCEPT 0x0001 | 192 | #define L2CAP_CONF_UNACCEPT 0x0001 |
@@ -195,7 +197,7 @@ struct l2cap_conf_opt { | |||
195 | __u8 type; | 197 | __u8 type; |
196 | __u8 len; | 198 | __u8 len; |
197 | __u8 val[0]; | 199 | __u8 val[0]; |
198 | } __attribute__ ((packed)); | 200 | } __packed; |
199 | #define L2CAP_CONF_OPT_SIZE 2 | 201 | #define L2CAP_CONF_OPT_SIZE 2 |
200 | 202 | ||
201 | #define L2CAP_CONF_HINT 0x80 | 203 | #define L2CAP_CONF_HINT 0x80 |
@@ -216,7 +218,7 @@ struct l2cap_conf_rfc { | |||
216 | __le16 retrans_timeout; | 218 | __le16 retrans_timeout; |
217 | __le16 monitor_timeout; | 219 | __le16 monitor_timeout; |
218 | __le16 max_pdu_size; | 220 | __le16 max_pdu_size; |
219 | } __attribute__ ((packed)); | 221 | } __packed; |
220 | 222 | ||
221 | #define L2CAP_MODE_BASIC 0x00 | 223 | #define L2CAP_MODE_BASIC 0x00 |
222 | #define L2CAP_MODE_RETRANS 0x01 | 224 | #define L2CAP_MODE_RETRANS 0x01 |
@@ -227,22 +229,22 @@ struct l2cap_conf_rfc { | |||
227 | struct l2cap_disconn_req { | 229 | struct l2cap_disconn_req { |
228 | __le16 dcid; | 230 | __le16 dcid; |
229 | __le16 scid; | 231 | __le16 scid; |
230 | } __attribute__ ((packed)); | 232 | } __packed; |
231 | 233 | ||
232 | struct l2cap_disconn_rsp { | 234 | struct l2cap_disconn_rsp { |
233 | __le16 dcid; | 235 | __le16 dcid; |
234 | __le16 scid; | 236 | __le16 scid; |
235 | } __attribute__ ((packed)); | 237 | } __packed; |
236 | 238 | ||
237 | struct l2cap_info_req { | 239 | struct l2cap_info_req { |
238 | __le16 type; | 240 | __le16 type; |
239 | } __attribute__ ((packed)); | 241 | } __packed; |
240 | 242 | ||
241 | struct l2cap_info_rsp { | 243 | struct l2cap_info_rsp { |
242 | __le16 type; | 244 | __le16 type; |
243 | __le16 result; | 245 | __le16 result; |
244 | __u8 data[0]; | 246 | __u8 data[0]; |
245 | } __attribute__ ((packed)); | 247 | } __packed; |
246 | 248 | ||
247 | /* info type */ | 249 | /* info type */ |
248 | #define L2CAP_IT_CL_MTU 0x0001 | 250 | #define L2CAP_IT_CL_MTU 0x0001 |
@@ -287,6 +289,11 @@ struct l2cap_conn { | |||
287 | struct l2cap_chan_list chan_list; | 289 | struct l2cap_chan_list chan_list; |
288 | }; | 290 | }; |
289 | 291 | ||
292 | struct sock_del_list { | ||
293 | struct sock *sk; | ||
294 | struct list_head list; | ||
295 | }; | ||
296 | |||
290 | #define L2CAP_INFO_CL_MTU_REQ_SENT 0x01 | 297 | #define L2CAP_INFO_CL_MTU_REQ_SENT 0x01 |
291 | #define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04 | 298 | #define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04 |
292 | #define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08 | 299 | #define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08 |
@@ -353,7 +360,6 @@ struct l2cap_pinfo { | |||
353 | 360 | ||
354 | __le16 sport; | 361 | __le16 sport; |
355 | 362 | ||
356 | spinlock_t send_lock; | ||
357 | struct timer_list retrans_timer; | 363 | struct timer_list retrans_timer; |
358 | struct timer_list monitor_timer; | 364 | struct timer_list monitor_timer; |
359 | struct timer_list ack_timer; | 365 | struct timer_list ack_timer; |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 921d7b3c7f8d..a140847d622c 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -106,19 +106,19 @@ struct rfcomm_hdr { | |||
106 | u8 addr; | 106 | u8 addr; |
107 | u8 ctrl; | 107 | u8 ctrl; |
108 | u8 len; // Actual size can be 2 bytes | 108 | u8 len; // Actual size can be 2 bytes |
109 | } __attribute__ ((packed)); | 109 | } __packed; |
110 | 110 | ||
111 | struct rfcomm_cmd { | 111 | struct rfcomm_cmd { |
112 | u8 addr; | 112 | u8 addr; |
113 | u8 ctrl; | 113 | u8 ctrl; |
114 | u8 len; | 114 | u8 len; |
115 | u8 fcs; | 115 | u8 fcs; |
116 | } __attribute__ ((packed)); | 116 | } __packed; |
117 | 117 | ||
118 | struct rfcomm_mcc { | 118 | struct rfcomm_mcc { |
119 | u8 type; | 119 | u8 type; |
120 | u8 len; | 120 | u8 len; |
121 | } __attribute__ ((packed)); | 121 | } __packed; |
122 | 122 | ||
123 | struct rfcomm_pn { | 123 | struct rfcomm_pn { |
124 | u8 dlci; | 124 | u8 dlci; |
@@ -128,7 +128,7 @@ struct rfcomm_pn { | |||
128 | __le16 mtu; | 128 | __le16 mtu; |
129 | u8 max_retrans; | 129 | u8 max_retrans; |
130 | u8 credits; | 130 | u8 credits; |
131 | } __attribute__ ((packed)); | 131 | } __packed; |
132 | 132 | ||
133 | struct rfcomm_rpn { | 133 | struct rfcomm_rpn { |
134 | u8 dlci; | 134 | u8 dlci; |
@@ -138,17 +138,17 @@ struct rfcomm_rpn { | |||
138 | u8 xon_char; | 138 | u8 xon_char; |
139 | u8 xoff_char; | 139 | u8 xoff_char; |
140 | __le16 param_mask; | 140 | __le16 param_mask; |
141 | } __attribute__ ((packed)); | 141 | } __packed; |
142 | 142 | ||
143 | struct rfcomm_rls { | 143 | struct rfcomm_rls { |
144 | u8 dlci; | 144 | u8 dlci; |
145 | u8 status; | 145 | u8 status; |
146 | } __attribute__ ((packed)); | 146 | } __packed; |
147 | 147 | ||
148 | struct rfcomm_msc { | 148 | struct rfcomm_msc { |
149 | u8 dlci; | 149 | u8 dlci; |
150 | u8 v24_sig; | 150 | u8 v24_sig; |
151 | } __attribute__ ((packed)); | 151 | } __packed; |
152 | 152 | ||
153 | /* ---- Core structures, flags etc ---- */ | 153 | /* ---- Core structures, flags etc ---- */ |
154 | 154 | ||
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h index 318ab9478a44..6da573c75d54 100644 --- a/include/net/caif/caif_dev.h +++ b/include/net/caif/caif_dev.h | |||
@@ -50,6 +50,9 @@ struct caif_connect_request { | |||
50 | * @client_layer: User implementation of client layer. This layer | 50 | * @client_layer: User implementation of client layer. This layer |
51 | * MUST have receive and control callback functions | 51 | * MUST have receive and control callback functions |
52 | * implemented. | 52 | * implemented. |
53 | * @ifindex: Link layer interface index used for this connection. | ||
54 | * @headroom: Head room needed by CAIF protocol. | ||
55 | * @tailroom: Tail room needed by CAIF protocol. | ||
53 | * | 56 | * |
54 | * This function connects a CAIF channel. The Client must implement | 57 | * This function connects a CAIF channel. The Client must implement |
55 | * the struct cflayer. This layer represents the Client layer and holds | 58 | * the struct cflayer. This layer represents the Client layer and holds |
@@ -59,8 +62,9 @@ struct caif_connect_request { | |||
59 | * E.g. CAIF Socket will call this function for each socket it connects | 62 | * E.g. CAIF Socket will call this function for each socket it connects |
60 | * and have one client_layer instance for each socket. | 63 | * and have one client_layer instance for each socket. |
61 | */ | 64 | */ |
62 | int caif_connect_client(struct caif_connect_request *config, | 65 | int caif_connect_client(struct caif_connect_request *conn_req, |
63 | struct cflayer *client_layer); | 66 | struct cflayer *client_layer, int *ifindex, |
67 | int *headroom, int *tailroom); | ||
64 | 68 | ||
65 | /** | 69 | /** |
66 | * caif_disconnect_client - Disconnects a client from the CAIF stack. | 70 | * caif_disconnect_client - Disconnects a client from the CAIF stack. |
diff --git a/include/net/caif/caif_layer.h b/include/net/caif/caif_layer.h index 25c472f0e5b8..c8b07a904e78 100644 --- a/include/net/caif/caif_layer.h +++ b/include/net/caif/caif_layer.h | |||
@@ -15,14 +15,8 @@ struct cfpktq; | |||
15 | struct caif_payload_info; | 15 | struct caif_payload_info; |
16 | struct caif_packet_funcs; | 16 | struct caif_packet_funcs; |
17 | 17 | ||
18 | #define CAIF_MAX_FRAMESIZE 4096 | ||
19 | #define CAIF_MAX_PAYLOAD_SIZE (4096 - 64) | ||
20 | #define CAIF_NEEDED_HEADROOM (10) | ||
21 | #define CAIF_NEEDED_TAILROOM (2) | ||
22 | 18 | ||
23 | #define CAIF_LAYER_NAME_SZ 16 | 19 | #define CAIF_LAYER_NAME_SZ 16 |
24 | #define CAIF_SUCCESS 1 | ||
25 | #define CAIF_FAILURE 0 | ||
26 | 20 | ||
27 | /** | 21 | /** |
28 | * caif_assert() - Assert function for CAIF. | 22 | * caif_assert() - Assert function for CAIF. |
diff --git a/include/net/caif/caif_spi.h b/include/net/caif/caif_spi.h new file mode 100644 index 000000000000..ce4570dff020 --- /dev/null +++ b/include/net/caif/caif_spi.h | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson AB 2010 | ||
3 | * Author: Daniel Martensson / Daniel.Martensson@stericsson.com | ||
4 | * License terms: GNU General Public License (GPL) version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef CAIF_SPI_H_ | ||
8 | #define CAIF_SPI_H_ | ||
9 | |||
10 | #include <net/caif/caif_device.h> | ||
11 | |||
12 | #define SPI_CMD_WR 0x00 | ||
13 | #define SPI_CMD_RD 0x01 | ||
14 | #define SPI_CMD_EOT 0x02 | ||
15 | #define SPI_CMD_IND 0x04 | ||
16 | |||
17 | #define SPI_DMA_BUF_LEN 8192 | ||
18 | |||
19 | #define WL_SZ 2 /* 16 bits. */ | ||
20 | #define SPI_CMD_SZ 4 /* 32 bits. */ | ||
21 | #define SPI_IND_SZ 4 /* 32 bits. */ | ||
22 | |||
23 | #define SPI_XFER 0 | ||
24 | #define SPI_SS_ON 1 | ||
25 | #define SPI_SS_OFF 2 | ||
26 | #define SPI_TERMINATE 3 | ||
27 | |||
28 | /* Minimum time between different levels is 50 microseconds. */ | ||
29 | #define MIN_TRANSITION_TIME_USEC 50 | ||
30 | |||
31 | /* Defines for calculating duration of SPI transfers for a particular | ||
32 | * number of bytes. | ||
33 | */ | ||
34 | #define SPI_MASTER_CLK_MHZ 13 | ||
35 | #define SPI_XFER_TIME_USEC(bytes, clk) (((bytes) * 8) / clk) | ||
36 | |||
37 | /* Normally this should be aligned on the modem in order to benefit from full | ||
38 | * duplex transfers. However a size of 8188 provokes errors when running with | ||
39 | * the modem. These errors occur when packet sizes approaches 4 kB of data. | ||
40 | */ | ||
41 | #define CAIF_MAX_SPI_FRAME 4092 | ||
42 | |||
43 | /* Maximum number of uplink CAIF frames that can reside in the same SPI frame. | ||
44 | * This number should correspond with the modem setting. The application side | ||
45 | * CAIF accepts any number of embedded downlink CAIF frames. | ||
46 | */ | ||
47 | #define CAIF_MAX_SPI_PKTS 9 | ||
48 | |||
49 | /* Decides if SPI buffers should be prefilled with 0xFF pattern for easier | ||
50 | * debugging. Both TX and RX buffers will be filled before the transfer. | ||
51 | */ | ||
52 | #define CFSPI_DBG_PREFILL 0 | ||
53 | |||
54 | /* Structure describing a SPI transfer. */ | ||
55 | struct cfspi_xfer { | ||
56 | u16 tx_dma_len; | ||
57 | u16 rx_dma_len; | ||
58 | void *va_tx; | ||
59 | dma_addr_t pa_tx; | ||
60 | void *va_rx; | ||
61 | dma_addr_t pa_rx; | ||
62 | }; | ||
63 | |||
64 | /* Structure implemented by the SPI interface. */ | ||
65 | struct cfspi_ifc { | ||
66 | void (*ss_cb) (bool assert, struct cfspi_ifc *ifc); | ||
67 | void (*xfer_done_cb) (struct cfspi_ifc *ifc); | ||
68 | void *priv; | ||
69 | }; | ||
70 | |||
71 | /* Structure implemented by SPI clients. */ | ||
72 | struct cfspi_dev { | ||
73 | int (*init_xfer) (struct cfspi_xfer *xfer, struct cfspi_dev *dev); | ||
74 | void (*sig_xfer) (bool xfer, struct cfspi_dev *dev); | ||
75 | struct cfspi_ifc *ifc; | ||
76 | char *name; | ||
77 | u32 clk_mhz; | ||
78 | void *priv; | ||
79 | }; | ||
80 | |||
81 | /* Enumeration describing the CAIF SPI state. */ | ||
82 | enum cfspi_state { | ||
83 | CFSPI_STATE_WAITING = 0, | ||
84 | CFSPI_STATE_AWAKE, | ||
85 | CFSPI_STATE_FETCH_PKT, | ||
86 | CFSPI_STATE_GET_NEXT, | ||
87 | CFSPI_STATE_INIT_XFER, | ||
88 | CFSPI_STATE_WAIT_ACTIVE, | ||
89 | CFSPI_STATE_SIG_ACTIVE, | ||
90 | CFSPI_STATE_WAIT_XFER_DONE, | ||
91 | CFSPI_STATE_XFER_DONE, | ||
92 | CFSPI_STATE_WAIT_INACTIVE, | ||
93 | CFSPI_STATE_SIG_INACTIVE, | ||
94 | CFSPI_STATE_DELIVER_PKT, | ||
95 | CFSPI_STATE_MAX, | ||
96 | }; | ||
97 | |||
98 | /* Structure implemented by SPI physical interfaces. */ | ||
99 | struct cfspi { | ||
100 | struct caif_dev_common cfdev; | ||
101 | struct net_device *ndev; | ||
102 | struct platform_device *pdev; | ||
103 | struct sk_buff_head qhead; | ||
104 | struct sk_buff_head chead; | ||
105 | u16 cmd; | ||
106 | u16 tx_cpck_len; | ||
107 | u16 tx_npck_len; | ||
108 | u16 rx_cpck_len; | ||
109 | u16 rx_npck_len; | ||
110 | struct cfspi_ifc ifc; | ||
111 | struct cfspi_xfer xfer; | ||
112 | struct cfspi_dev *dev; | ||
113 | unsigned long state; | ||
114 | struct work_struct work; | ||
115 | struct workqueue_struct *wq; | ||
116 | struct list_head list; | ||
117 | int flow_off_sent; | ||
118 | u32 qd_low_mark; | ||
119 | u32 qd_high_mark; | ||
120 | struct completion comp; | ||
121 | wait_queue_head_t wait; | ||
122 | spinlock_t lock; | ||
123 | bool flow_stop; | ||
124 | #ifdef CONFIG_DEBUG_FS | ||
125 | enum cfspi_state dbg_state; | ||
126 | u16 pcmd; | ||
127 | u16 tx_ppck_len; | ||
128 | u16 rx_ppck_len; | ||
129 | struct dentry *dbgfs_dir; | ||
130 | struct dentry *dbgfs_state; | ||
131 | struct dentry *dbgfs_frame; | ||
132 | #endif /* CONFIG_DEBUG_FS */ | ||
133 | }; | ||
134 | |||
135 | extern int spi_frm_align; | ||
136 | extern int spi_up_head_align; | ||
137 | extern int spi_up_tail_align; | ||
138 | extern int spi_down_head_align; | ||
139 | extern int spi_down_tail_align; | ||
140 | extern struct platform_driver cfspi_spi_driver; | ||
141 | |||
142 | void cfspi_dbg_state(struct cfspi *cfspi, int state); | ||
143 | int cfspi_xmitfrm(struct cfspi *cfspi, u8 *buf, size_t len); | ||
144 | int cfspi_xmitlen(struct cfspi *cfspi); | ||
145 | int cfspi_rxfrm(struct cfspi *cfspi, u8 *buf, size_t len); | ||
146 | int cfspi_spi_remove(struct platform_device *pdev); | ||
147 | int cfspi_spi_probe(struct platform_device *pdev); | ||
148 | int cfspi_xmitfrm(struct cfspi *cfspi, u8 *buf, size_t len); | ||
149 | int cfspi_xmitlen(struct cfspi *cfspi); | ||
150 | int cfspi_rxfrm(struct cfspi *cfspi, u8 *buf, size_t len); | ||
151 | void cfspi_xfer(struct work_struct *work); | ||
152 | |||
153 | #endif /* CAIF_SPI_H_ */ | ||
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h index 9fc2fc20b884..bd646faffa47 100644 --- a/include/net/caif/cfcnfg.h +++ b/include/net/caif/cfcnfg.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #ifndef CFCNFG_H_ | 7 | #ifndef CFCNFG_H_ |
8 | #define CFCNFG_H_ | 8 | #define CFCNFG_H_ |
9 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
10 | #include <linux/netdevice.h> | ||
10 | #include <net/caif/caif_layer.h> | 11 | #include <net/caif/caif_layer.h> |
11 | #include <net/caif/cfctrl.h> | 12 | #include <net/caif/cfctrl.h> |
12 | 13 | ||
@@ -73,8 +74,8 @@ void cfcnfg_remove(struct cfcnfg *cfg); | |||
73 | 74 | ||
74 | void | 75 | void |
75 | cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, | 76 | cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, |
76 | void *dev, struct cflayer *phy_layer, u16 *phyid, | 77 | struct net_device *dev, struct cflayer *phy_layer, |
77 | enum cfcnfg_phy_preference pref, | 78 | u16 *phyid, enum cfcnfg_phy_preference pref, |
78 | bool fcs, bool stx); | 79 | bool fcs, bool stx); |
79 | 80 | ||
80 | /** | 81 | /** |
@@ -114,11 +115,18 @@ void cfcnfg_release_adap_layer(struct cflayer *adap_layer); | |||
114 | * @param: Link setup parameters. | 115 | * @param: Link setup parameters. |
115 | * @adap_layer: Specify the adaptation layer; the receive and | 116 | * @adap_layer: Specify the adaptation layer; the receive and |
116 | * flow-control functions MUST be set in the structure. | 117 | * flow-control functions MUST be set in the structure. |
117 | * | 118 | * @ifindex: Link layer interface index used for this connection. |
119 | * @proto_head: Protocol head-space needed by CAIF protocol, | ||
120 | * excluding link layer. | ||
121 | * @proto_tail: Protocol tail-space needed by CAIF protocol, | ||
122 | * excluding link layer. | ||
118 | */ | 123 | */ |
119 | int cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg, | 124 | int cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg, |
120 | struct cfctrl_link_param *param, | 125 | struct cfctrl_link_param *param, |
121 | struct cflayer *adap_layer); | 126 | struct cflayer *adap_layer, |
127 | int *ifindex, | ||
128 | int *proto_head, | ||
129 | int *proto_tail); | ||
122 | 130 | ||
123 | /** | 131 | /** |
124 | * cfcnfg_get_phyid() - Get physical ID, given type. | 132 | * cfcnfg_get_phyid() - Get physical ID, given type. |
diff --git a/include/net/caif/cfsrvl.h b/include/net/caif/cfsrvl.h index 2dc9eb193ecf..b1fa87ee0992 100644 --- a/include/net/caif/cfsrvl.h +++ b/include/net/caif/cfsrvl.h | |||
@@ -16,6 +16,8 @@ struct cfsrvl { | |||
16 | bool open; | 16 | bool open; |
17 | bool phy_flow_on; | 17 | bool phy_flow_on; |
18 | bool modem_flow_on; | 18 | bool modem_flow_on; |
19 | bool supports_flowctrl; | ||
20 | void (*release)(struct kref *); | ||
19 | struct dev_info dev_info; | 21 | struct dev_info dev_info; |
20 | struct kref ref; | 22 | struct kref ref; |
21 | }; | 23 | }; |
@@ -25,13 +27,15 @@ struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info); | |||
25 | struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info); | 27 | struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info); |
26 | struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info); | 28 | struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info); |
27 | struct cflayer *cfvidl_create(u8 linkid, struct dev_info *dev_info); | 29 | struct cflayer *cfvidl_create(u8 linkid, struct dev_info *dev_info); |
28 | struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info); | 30 | struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info, |
31 | int mtu_size); | ||
29 | struct cflayer *cfdbgl_create(u8 linkid, struct dev_info *dev_info); | 32 | struct cflayer *cfdbgl_create(u8 linkid, struct dev_info *dev_info); |
30 | bool cfsrvl_phyid_match(struct cflayer *layer, int phyid); | 33 | bool cfsrvl_phyid_match(struct cflayer *layer, int phyid); |
31 | void cfservl_destroy(struct cflayer *layer); | 34 | void cfservl_destroy(struct cflayer *layer); |
32 | void cfsrvl_init(struct cfsrvl *service, | 35 | void cfsrvl_init(struct cfsrvl *service, |
33 | u8 channel_id, | 36 | u8 channel_id, |
34 | struct dev_info *dev_info); | 37 | struct dev_info *dev_info, |
38 | bool supports_flowctrl); | ||
35 | bool cfsrvl_ready(struct cfsrvl *service, int *err); | 39 | bool cfsrvl_ready(struct cfsrvl *service, int *err); |
36 | u8 cfsrvl_getphyid(struct cflayer *layer); | 40 | u8 cfsrvl_getphyid(struct cflayer *layer); |
37 | 41 | ||
@@ -50,7 +54,10 @@ static inline void cfsrvl_put(struct cflayer *layr) | |||
50 | if (layr == NULL) | 54 | if (layr == NULL) |
51 | return; | 55 | return; |
52 | s = container_of(layr, struct cfsrvl, layer); | 56 | s = container_of(layr, struct cfsrvl, layer); |
53 | kref_put(&s->ref, cfsrvl_release); | 57 | |
58 | WARN_ON(!s->release); | ||
59 | if (s->release) | ||
60 | kref_put(&s->ref, s->release); | ||
54 | } | 61 | } |
55 | 62 | ||
56 | #endif /* CFSRVL_H_ */ | 63 | #endif /* CFSRVL_H_ */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index b44a2e5321a3..2fd06c60ffbb 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -37,6 +37,7 @@ | |||
37 | * | 37 | * |
38 | * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band | 38 | * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band |
39 | * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) | 39 | * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) |
40 | * @IEEE80211_NUM_BANDS: number of defined bands | ||
40 | */ | 41 | */ |
41 | enum ieee80211_band { | 42 | enum ieee80211_band { |
42 | IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, | 43 | IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, |
@@ -89,7 +90,7 @@ enum ieee80211_channel_flags { | |||
89 | * @max_power: maximum transmission power (in dBm) | 90 | * @max_power: maximum transmission power (in dBm) |
90 | * @beacon_found: helper to regulatory code to indicate when a beacon | 91 | * @beacon_found: helper to regulatory code to indicate when a beacon |
91 | * has been found on this channel. Use regulatory_hint_found_beacon() | 92 | * has been found on this channel. Use regulatory_hint_found_beacon() |
92 | * to enable this, this is is useful only on 5 GHz band. | 93 | * to enable this, this is useful only on 5 GHz band. |
93 | * @orig_mag: internal use | 94 | * @orig_mag: internal use |
94 | * @orig_mpwr: internal use | 95 | * @orig_mpwr: internal use |
95 | */ | 96 | */ |
@@ -188,6 +189,7 @@ struct ieee80211_sta_ht_cap { | |||
188 | * in this band. Must be sorted to give a valid "supported | 189 | * in this band. Must be sorted to give a valid "supported |
189 | * rates" IE, i.e. CCK rates first, then OFDM. | 190 | * rates" IE, i.e. CCK rates first, then OFDM. |
190 | * @n_bitrates: Number of bitrates in @bitrates | 191 | * @n_bitrates: Number of bitrates in @bitrates |
192 | * @ht_cap: HT capabilities in this band | ||
191 | */ | 193 | */ |
192 | struct ieee80211_supported_band { | 194 | struct ieee80211_supported_band { |
193 | struct ieee80211_channel *channels; | 195 | struct ieee80211_channel *channels; |
@@ -225,6 +227,7 @@ struct vif_params { | |||
225 | * @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used | 227 | * @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used |
226 | * with the get_key() callback, must be in little endian, | 228 | * with the get_key() callback, must be in little endian, |
227 | * length given by @seq_len. | 229 | * length given by @seq_len. |
230 | * @seq_len: length of @seq. | ||
228 | */ | 231 | */ |
229 | struct key_params { | 232 | struct key_params { |
230 | u8 *key; | 233 | u8 *key; |
@@ -237,6 +240,8 @@ struct key_params { | |||
237 | /** | 240 | /** |
238 | * enum survey_info_flags - survey information flags | 241 | * enum survey_info_flags - survey information flags |
239 | * | 242 | * |
243 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in | ||
244 | * | ||
240 | * Used by the driver to indicate which info in &struct survey_info | 245 | * Used by the driver to indicate which info in &struct survey_info |
241 | * it has filled in during the get_survey(). | 246 | * it has filled in during the get_survey(). |
242 | */ | 247 | */ |
@@ -247,13 +252,13 @@ enum survey_info_flags { | |||
247 | /** | 252 | /** |
248 | * struct survey_info - channel survey response | 253 | * struct survey_info - channel survey response |
249 | * | 254 | * |
250 | * Used by dump_survey() to report back per-channel survey information. | ||
251 | * | ||
252 | * @channel: the channel this survey record reports, mandatory | 255 | * @channel: the channel this survey record reports, mandatory |
253 | * @filled: bitflag of flags from &enum survey_info_flags | 256 | * @filled: bitflag of flags from &enum survey_info_flags |
254 | * @noise: channel noise in dBm. This and all following fields are | 257 | * @noise: channel noise in dBm. This and all following fields are |
255 | * optional | 258 | * optional |
256 | * | 259 | * |
260 | * Used by dump_survey() to report back per-channel survey information. | ||
261 | * | ||
257 | * This structure can later be expanded with things like | 262 | * This structure can later be expanded with things like |
258 | * channel duty cycle etc. | 263 | * channel duty cycle etc. |
259 | */ | 264 | */ |
@@ -288,7 +293,7 @@ struct beacon_parameters { | |||
288 | * | 293 | * |
289 | * @PLINK_ACTION_INVALID: action 0 is reserved | 294 | * @PLINK_ACTION_INVALID: action 0 is reserved |
290 | * @PLINK_ACTION_OPEN: start mesh peer link establishment | 295 | * @PLINK_ACTION_OPEN: start mesh peer link establishment |
291 | * @PLINK_ACTION_BLOCL: block traffic from this mesh peer | 296 | * @PLINK_ACTION_BLOCK: block traffic from this mesh peer |
292 | */ | 297 | */ |
293 | enum plink_actions { | 298 | enum plink_actions { |
294 | PLINK_ACTION_INVALID, | 299 | PLINK_ACTION_INVALID, |
@@ -311,6 +316,8 @@ enum plink_actions { | |||
311 | * (bitmask of BIT(NL80211_STA_FLAG_...)) | 316 | * (bitmask of BIT(NL80211_STA_FLAG_...)) |
312 | * @listen_interval: listen interval or -1 for no change | 317 | * @listen_interval: listen interval or -1 for no change |
313 | * @aid: AID or zero for no change | 318 | * @aid: AID or zero for no change |
319 | * @plink_action: plink action to take | ||
320 | * @ht_capa: HT capabilities of station | ||
314 | */ | 321 | */ |
315 | struct station_parameters { | 322 | struct station_parameters { |
316 | u8 *supported_rates; | 323 | u8 *supported_rates; |
@@ -448,13 +455,13 @@ enum monitor_flags { | |||
448 | * Used by the driver to indicate which info in &struct mpath_info it has filled | 455 | * Used by the driver to indicate which info in &struct mpath_info it has filled |
449 | * in during get_station() or dump_station(). | 456 | * in during get_station() or dump_station(). |
450 | * | 457 | * |
451 | * MPATH_INFO_FRAME_QLEN: @frame_qlen filled | 458 | * @MPATH_INFO_FRAME_QLEN: @frame_qlen filled |
452 | * MPATH_INFO_SN: @sn filled | 459 | * @MPATH_INFO_SN: @sn filled |
453 | * MPATH_INFO_METRIC: @metric filled | 460 | * @MPATH_INFO_METRIC: @metric filled |
454 | * MPATH_INFO_EXPTIME: @exptime filled | 461 | * @MPATH_INFO_EXPTIME: @exptime filled |
455 | * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled | 462 | * @MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled |
456 | * MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled | 463 | * @MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled |
457 | * MPATH_INFO_FLAGS: @flags filled | 464 | * @MPATH_INFO_FLAGS: @flags filled |
458 | */ | 465 | */ |
459 | enum mpath_info_flags { | 466 | enum mpath_info_flags { |
460 | MPATH_INFO_FRAME_QLEN = BIT(0), | 467 | MPATH_INFO_FRAME_QLEN = BIT(0), |
@@ -587,6 +594,7 @@ struct cfg80211_ssid { | |||
587 | * @ie_len: length of ie in octets | 594 | * @ie_len: length of ie in octets |
588 | * @wiphy: the wiphy this was for | 595 | * @wiphy: the wiphy this was for |
589 | * @dev: the interface | 596 | * @dev: the interface |
597 | * @aborted: (internal) scan request was notified as aborted | ||
590 | */ | 598 | */ |
591 | struct cfg80211_scan_request { | 599 | struct cfg80211_scan_request { |
592 | struct cfg80211_ssid *ssids; | 600 | struct cfg80211_ssid *ssids; |
@@ -623,6 +631,7 @@ enum cfg80211_signal_type { | |||
623 | * This structure describes a BSS (which may also be a mesh network) | 631 | * This structure describes a BSS (which may also be a mesh network) |
624 | * for use in scan results and similar. | 632 | * for use in scan results and similar. |
625 | * | 633 | * |
634 | * @channel: channel this BSS is on | ||
626 | * @bssid: BSSID of the BSS | 635 | * @bssid: BSSID of the BSS |
627 | * @tsf: timestamp of last received update | 636 | * @tsf: timestamp of last received update |
628 | * @beacon_interval: the beacon interval as from the frame | 637 | * @beacon_interval: the beacon interval as from the frame |
@@ -801,6 +810,7 @@ struct cfg80211_disassoc_request { | |||
801 | * @beacon_interval: beacon interval to use | 810 | * @beacon_interval: beacon interval to use |
802 | * @privacy: this is a protected network, keys will be configured | 811 | * @privacy: this is a protected network, keys will be configured |
803 | * after joining | 812 | * after joining |
813 | * @basic_rates: bitmap of basic rates to use when creating the IBSS | ||
804 | */ | 814 | */ |
805 | struct cfg80211_ibss_params { | 815 | struct cfg80211_ibss_params { |
806 | u8 *ssid; | 816 | u8 *ssid; |
@@ -809,6 +819,7 @@ struct cfg80211_ibss_params { | |||
809 | u8 *ie; | 819 | u8 *ie; |
810 | u8 ssid_len, ie_len; | 820 | u8 ssid_len, ie_len; |
811 | u16 beacon_interval; | 821 | u16 beacon_interval; |
822 | u32 basic_rates; | ||
812 | bool channel_fixed; | 823 | bool channel_fixed; |
813 | bool privacy; | 824 | bool privacy; |
814 | }; | 825 | }; |
@@ -826,8 +837,8 @@ struct cfg80211_ibss_params { | |||
826 | * @ssid: SSID | 837 | * @ssid: SSID |
827 | * @ssid_len: Length of ssid in octets | 838 | * @ssid_len: Length of ssid in octets |
828 | * @auth_type: Authentication type (algorithm) | 839 | * @auth_type: Authentication type (algorithm) |
829 | * @assoc_ie: IEs for association request | 840 | * @ie: IEs for association request |
830 | * @assoc_ie_len: Length of assoc_ie in octets | 841 | * @ie_len: Length of assoc_ie in octets |
831 | * @privacy: indicates whether privacy-enabled APs should be used | 842 | * @privacy: indicates whether privacy-enabled APs should be used |
832 | * @crypto: crypto settings | 843 | * @crypto: crypto settings |
833 | * @key_len: length of WEP key for shared key authentication | 844 | * @key_len: length of WEP key for shared key authentication |
@@ -850,10 +861,11 @@ struct cfg80211_connect_params { | |||
850 | 861 | ||
851 | /** | 862 | /** |
852 | * enum wiphy_params_flags - set_wiphy_params bitfield values | 863 | * enum wiphy_params_flags - set_wiphy_params bitfield values |
853 | * WIPHY_PARAM_RETRY_SHORT: wiphy->retry_short has changed | 864 | * @WIPHY_PARAM_RETRY_SHORT: wiphy->retry_short has changed |
854 | * WIPHY_PARAM_RETRY_LONG: wiphy->retry_long has changed | 865 | * @WIPHY_PARAM_RETRY_LONG: wiphy->retry_long has changed |
855 | * WIPHY_PARAM_FRAG_THRESHOLD: wiphy->frag_threshold has changed | 866 | * @WIPHY_PARAM_FRAG_THRESHOLD: wiphy->frag_threshold has changed |
856 | * WIPHY_PARAM_RTS_THRESHOLD: wiphy->rts_threshold has changed | 867 | * @WIPHY_PARAM_RTS_THRESHOLD: wiphy->rts_threshold has changed |
868 | * @WIPHY_PARAM_COVERAGE_CLASS: coverage class changed | ||
857 | */ | 869 | */ |
858 | enum wiphy_params_flags { | 870 | enum wiphy_params_flags { |
859 | WIPHY_PARAM_RETRY_SHORT = 1 << 0, | 871 | WIPHY_PARAM_RETRY_SHORT = 1 << 0, |
@@ -863,19 +875,6 @@ enum wiphy_params_flags { | |||
863 | WIPHY_PARAM_COVERAGE_CLASS = 1 << 4, | 875 | WIPHY_PARAM_COVERAGE_CLASS = 1 << 4, |
864 | }; | 876 | }; |
865 | 877 | ||
866 | /** | ||
867 | * enum tx_power_setting - TX power adjustment | ||
868 | * | ||
869 | * @TX_POWER_AUTOMATIC: the dbm parameter is ignored | ||
870 | * @TX_POWER_LIMITED: limit TX power by the dbm parameter | ||
871 | * @TX_POWER_FIXED: fix TX power to the dbm parameter | ||
872 | */ | ||
873 | enum tx_power_setting { | ||
874 | TX_POWER_AUTOMATIC, | ||
875 | TX_POWER_LIMITED, | ||
876 | TX_POWER_FIXED, | ||
877 | }; | ||
878 | |||
879 | /* | 878 | /* |
880 | * cfg80211_bitrate_mask - masks for bitrate control | 879 | * cfg80211_bitrate_mask - masks for bitrate control |
881 | */ | 880 | */ |
@@ -949,10 +948,16 @@ struct cfg80211_pmksa { | |||
949 | * @del_beacon: Remove beacon configuration and stop sending the beacon. | 948 | * @del_beacon: Remove beacon configuration and stop sending the beacon. |
950 | * | 949 | * |
951 | * @add_station: Add a new station. | 950 | * @add_station: Add a new station. |
952 | * | ||
953 | * @del_station: Remove a station; @mac may be NULL to remove all stations. | 951 | * @del_station: Remove a station; @mac may be NULL to remove all stations. |
954 | * | ||
955 | * @change_station: Modify a given station. | 952 | * @change_station: Modify a given station. |
953 | * @get_station: get station information for the station identified by @mac | ||
954 | * @dump_station: dump station callback -- resume dump at index @idx | ||
955 | * | ||
956 | * @add_mpath: add a fixed mesh path | ||
957 | * @del_mpath: delete a given mesh path | ||
958 | * @change_mpath: change a given mesh path | ||
959 | * @get_mpath: get a mesh path for the given parameters | ||
960 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx | ||
956 | * | 961 | * |
957 | * @get_mesh_params: Put the current mesh parameters into *params | 962 | * @get_mesh_params: Put the current mesh parameters into *params |
958 | * | 963 | * |
@@ -960,8 +965,6 @@ struct cfg80211_pmksa { | |||
960 | * The mask is a bitfield which tells us which parameters to | 965 | * The mask is a bitfield which tells us which parameters to |
961 | * set, and which to leave alone. | 966 | * set, and which to leave alone. |
962 | * | 967 | * |
963 | * @set_mesh_cfg: set mesh parameters (by now, just mesh id) | ||
964 | * | ||
965 | * @change_bss: Modify parameters for a given BSS. | 968 | * @change_bss: Modify parameters for a given BSS. |
966 | * | 969 | * |
967 | * @set_txq_params: Set TX queue parameters | 970 | * @set_txq_params: Set TX queue parameters |
@@ -1002,6 +1005,8 @@ struct cfg80211_pmksa { | |||
1002 | * @get_tx_power: store the current TX power into the dbm variable; | 1005 | * @get_tx_power: store the current TX power into the dbm variable; |
1003 | * return 0 if successful | 1006 | * return 0 if successful |
1004 | * | 1007 | * |
1008 | * @set_wds_peer: set the WDS peer for a WDS interface | ||
1009 | * | ||
1005 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting | 1010 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting |
1006 | * functions to adjust rfkill hw state | 1011 | * functions to adjust rfkill hw state |
1007 | * | 1012 | * |
@@ -1019,6 +1024,8 @@ struct cfg80211_pmksa { | |||
1019 | * | 1024 | * |
1020 | * @testmode_cmd: run a test mode command | 1025 | * @testmode_cmd: run a test mode command |
1021 | * | 1026 | * |
1027 | * @set_bitrate_mask: set the bitrate mask configuration | ||
1028 | * | ||
1022 | * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac | 1029 | * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac |
1023 | * devices running firmwares capable of generating the (re) association | 1030 | * devices running firmwares capable of generating the (re) association |
1024 | * RSN IE. It allows for faster roaming between WPA2 BSSIDs. | 1031 | * RSN IE. It allows for faster roaming between WPA2 BSSIDs. |
@@ -1129,7 +1136,7 @@ struct cfg80211_ops { | |||
1129 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); | 1136 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); |
1130 | 1137 | ||
1131 | int (*set_tx_power)(struct wiphy *wiphy, | 1138 | int (*set_tx_power)(struct wiphy *wiphy, |
1132 | enum tx_power_setting type, int dbm); | 1139 | enum nl80211_tx_power_setting type, int mbm); |
1133 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | 1140 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); |
1134 | 1141 | ||
1135 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, | 1142 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, |
@@ -1168,6 +1175,7 @@ struct cfg80211_ops { | |||
1168 | int (*action)(struct wiphy *wiphy, struct net_device *dev, | 1175 | int (*action)(struct wiphy *wiphy, struct net_device *dev, |
1169 | struct ieee80211_channel *chan, | 1176 | struct ieee80211_channel *chan, |
1170 | enum nl80211_channel_type channel_type, | 1177 | enum nl80211_channel_type channel_type, |
1178 | bool channel_type_valid, | ||
1171 | const u8 *buf, size_t len, u64 *cookie); | 1179 | const u8 *buf, size_t len, u64 *cookie); |
1172 | 1180 | ||
1173 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1181 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
@@ -1230,8 +1238,6 @@ struct mac_address { | |||
1230 | 1238 | ||
1231 | /** | 1239 | /** |
1232 | * struct wiphy - wireless hardware description | 1240 | * struct wiphy - wireless hardware description |
1233 | * @idx: the wiphy index assigned to this item | ||
1234 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> | ||
1235 | * @reg_notifier: the driver's regulatory notification callback | 1241 | * @reg_notifier: the driver's regulatory notification callback |
1236 | * @regd: the driver's regulatory domain, if one was requested via | 1242 | * @regd: the driver's regulatory domain, if one was requested via |
1237 | * the regulatory_hint() API. This can be used by the driver | 1243 | * the regulatory_hint() API. This can be used by the driver |
@@ -1245,7 +1251,7 @@ struct mac_address { | |||
1245 | * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold); | 1251 | * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold); |
1246 | * -1 = fragmentation disabled, only odd values >= 256 used | 1252 | * -1 = fragmentation disabled, only odd values >= 256 used |
1247 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled | 1253 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled |
1248 | * @net: the network namespace this wiphy currently lives in | 1254 | * @_net: the network namespace this wiphy currently lives in |
1249 | * @perm_addr: permanent MAC address of this device | 1255 | * @perm_addr: permanent MAC address of this device |
1250 | * @addr_mask: If the device supports multiple MAC addresses by masking, | 1256 | * @addr_mask: If the device supports multiple MAC addresses by masking, |
1251 | * set this to a mask with variable bits set to 1, e.g. if the last | 1257 | * set this to a mask with variable bits set to 1, e.g. if the last |
@@ -1258,6 +1264,28 @@ struct mac_address { | |||
1258 | * by default for perm_addr. In this case, the mask should be set to | 1264 | * by default for perm_addr. In this case, the mask should be set to |
1259 | * all-zeroes. In this case it is assumed that the device can handle | 1265 | * all-zeroes. In this case it is assumed that the device can handle |
1260 | * the same number of arbitrary MAC addresses. | 1266 | * the same number of arbitrary MAC addresses. |
1267 | * @debugfsdir: debugfs directory used for this wiphy, will be renamed | ||
1268 | * automatically on wiphy renames | ||
1269 | * @dev: (virtual) struct device for this wiphy | ||
1270 | * @wext: wireless extension handlers | ||
1271 | * @priv: driver private data (sized according to wiphy_new() parameter) | ||
1272 | * @interface_modes: bitmask of interfaces types valid for this wiphy, | ||
1273 | * must be set by driver | ||
1274 | * @flags: wiphy flags, see &enum wiphy_flags | ||
1275 | * @bss_priv_size: each BSS struct has private data allocated with it, | ||
1276 | * this variable determines its size | ||
1277 | * @max_scan_ssids: maximum number of SSIDs the device can scan for in | ||
1278 | * any given scan | ||
1279 | * @max_scan_ie_len: maximum length of user-controlled IEs device can | ||
1280 | * add to probe request frames transmitted during a scan, must not | ||
1281 | * include fixed IEs like supported rates | ||
1282 | * @coverage_class: current coverage class | ||
1283 | * @fw_version: firmware version for ethtool reporting | ||
1284 | * @hw_version: hardware version for ethtool reporting | ||
1285 | * @max_num_pmkids: maximum number of PMKIDs supported by device | ||
1286 | * @privid: a pointer that drivers can use to identify if an arbitrary | ||
1287 | * wiphy is theirs, e.g. in global notifiers | ||
1288 | * @bands: information about bands/channels supported by this device | ||
1261 | */ | 1289 | */ |
1262 | struct wiphy { | 1290 | struct wiphy { |
1263 | /* assign these fields before you register the wiphy */ | 1291 | /* assign these fields before you register the wiphy */ |
@@ -1330,27 +1358,16 @@ struct wiphy { | |||
1330 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 1358 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
1331 | }; | 1359 | }; |
1332 | 1360 | ||
1333 | #ifdef CONFIG_NET_NS | ||
1334 | static inline struct net *wiphy_net(struct wiphy *wiphy) | 1361 | static inline struct net *wiphy_net(struct wiphy *wiphy) |
1335 | { | 1362 | { |
1336 | return wiphy->_net; | 1363 | return read_pnet(&wiphy->_net); |
1337 | } | 1364 | } |
1338 | 1365 | ||
1339 | static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net) | 1366 | static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net) |
1340 | { | 1367 | { |
1341 | wiphy->_net = net; | 1368 | write_pnet(&wiphy->_net, net); |
1342 | } | ||
1343 | #else | ||
1344 | static inline struct net *wiphy_net(struct wiphy *wiphy) | ||
1345 | { | ||
1346 | return &init_net; | ||
1347 | } | 1369 | } |
1348 | 1370 | ||
1349 | static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net) | ||
1350 | { | ||
1351 | } | ||
1352 | #endif | ||
1353 | |||
1354 | /** | 1371 | /** |
1355 | * wiphy_priv - return priv from wiphy | 1372 | * wiphy_priv - return priv from wiphy |
1356 | * | 1373 | * |
@@ -1399,7 +1416,7 @@ static inline struct device *wiphy_dev(struct wiphy *wiphy) | |||
1399 | * | 1416 | * |
1400 | * @wiphy: The wiphy whose name to return | 1417 | * @wiphy: The wiphy whose name to return |
1401 | */ | 1418 | */ |
1402 | static inline const char *wiphy_name(struct wiphy *wiphy) | 1419 | static inline const char *wiphy_name(const struct wiphy *wiphy) |
1403 | { | 1420 | { |
1404 | return dev_name(&wiphy->dev); | 1421 | return dev_name(&wiphy->dev); |
1405 | } | 1422 | } |
@@ -1471,13 +1488,14 @@ struct cfg80211_cached_keys; | |||
1471 | * @ssid: (private) Used by the internal configuration code | 1488 | * @ssid: (private) Used by the internal configuration code |
1472 | * @ssid_len: (private) Used by the internal configuration code | 1489 | * @ssid_len: (private) Used by the internal configuration code |
1473 | * @wext: (private) Used by the internal wireless extensions compat code | 1490 | * @wext: (private) Used by the internal wireless extensions compat code |
1474 | * @wext_bssid: (private) Used by the internal wireless extensions compat code | ||
1475 | * @use_4addr: indicates 4addr mode is used on this interface, must be | 1491 | * @use_4addr: indicates 4addr mode is used on this interface, must be |
1476 | * set by driver (if supported) on add_interface BEFORE registering the | 1492 | * set by driver (if supported) on add_interface BEFORE registering the |
1477 | * netdev and may otherwise be used by driver read-only, will be update | 1493 | * netdev and may otherwise be used by driver read-only, will be update |
1478 | * by cfg80211 on change_interface | 1494 | * by cfg80211 on change_interface |
1479 | * @action_registrations: list of registrations for action frames | 1495 | * @action_registrations: list of registrations for action frames |
1480 | * @action_registrations_lock: lock for the list | 1496 | * @action_registrations_lock: lock for the list |
1497 | * @mtx: mutex used to lock data in this struct | ||
1498 | * @cleanup_work: work struct used for cleanup that can't be done directly | ||
1481 | */ | 1499 | */ |
1482 | struct wireless_dev { | 1500 | struct wireless_dev { |
1483 | struct wiphy *wiphy; | 1501 | struct wiphy *wiphy; |
@@ -1551,11 +1569,13 @@ static inline void *wdev_priv(struct wireless_dev *wdev) | |||
1551 | 1569 | ||
1552 | /** | 1570 | /** |
1553 | * ieee80211_channel_to_frequency - convert channel number to frequency | 1571 | * ieee80211_channel_to_frequency - convert channel number to frequency |
1572 | * @chan: channel number | ||
1554 | */ | 1573 | */ |
1555 | extern int ieee80211_channel_to_frequency(int chan); | 1574 | extern int ieee80211_channel_to_frequency(int chan); |
1556 | 1575 | ||
1557 | /** | 1576 | /** |
1558 | * ieee80211_frequency_to_channel - convert frequency to channel number | 1577 | * ieee80211_frequency_to_channel - convert frequency to channel number |
1578 | * @freq: center frequency | ||
1559 | */ | 1579 | */ |
1560 | extern int ieee80211_frequency_to_channel(int freq); | 1580 | extern int ieee80211_frequency_to_channel(int freq); |
1561 | 1581 | ||
@@ -1570,6 +1590,8 @@ extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, | |||
1570 | int freq); | 1590 | int freq); |
1571 | /** | 1591 | /** |
1572 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency | 1592 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency |
1593 | * @wiphy: the struct wiphy to get the channel for | ||
1594 | * @freq: the center frequency of the channel | ||
1573 | */ | 1595 | */ |
1574 | static inline struct ieee80211_channel * | 1596 | static inline struct ieee80211_channel * |
1575 | ieee80211_get_channel(struct wiphy *wiphy, int freq) | 1597 | ieee80211_get_channel(struct wiphy *wiphy, int freq) |
@@ -1630,9 +1652,6 @@ struct ieee80211_radiotap_vendor_namespaces { | |||
1630 | * @is_radiotap_ns: indicates whether the current namespace is the default | 1652 | * @is_radiotap_ns: indicates whether the current namespace is the default |
1631 | * radiotap namespace or not | 1653 | * radiotap namespace or not |
1632 | * | 1654 | * |
1633 | * @overrides: override standard radiotap fields | ||
1634 | * @n_overrides: number of overrides | ||
1635 | * | ||
1636 | * @_rtheader: pointer to the radiotap header we are walking through | 1655 | * @_rtheader: pointer to the radiotap header we are walking through |
1637 | * @_max_length: length of radiotap header in cpu byte ordering | 1656 | * @_max_length: length of radiotap header in cpu byte ordering |
1638 | * @_arg_index: next argument index | 1657 | * @_arg_index: next argument index |
@@ -1933,6 +1952,10 @@ int cfg80211_wext_giwap(struct net_device *dev, | |||
1933 | struct iw_request_info *info, | 1952 | struct iw_request_info *info, |
1934 | struct sockaddr *ap_addr, char *extra); | 1953 | struct sockaddr *ap_addr, char *extra); |
1935 | 1954 | ||
1955 | int cfg80211_wext_siwpmksa(struct net_device *dev, | ||
1956 | struct iw_request_info *info, | ||
1957 | struct iw_point *data, char *extra); | ||
1958 | |||
1936 | /* | 1959 | /* |
1937 | * callbacks for asynchronous cfg80211 methods, notification | 1960 | * callbacks for asynchronous cfg80211 methods, notification |
1938 | * functions and BSS handling helpers | 1961 | * functions and BSS handling helpers |
@@ -1948,10 +1971,12 @@ int cfg80211_wext_giwap(struct net_device *dev, | |||
1948 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted); | 1971 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted); |
1949 | 1972 | ||
1950 | /** | 1973 | /** |
1951 | * cfg80211_inform_bss - inform cfg80211 of a new BSS | 1974 | * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame |
1952 | * | 1975 | * |
1953 | * @wiphy: the wiphy reporting the BSS | 1976 | * @wiphy: the wiphy reporting the BSS |
1954 | * @bss: the found BSS | 1977 | * @channel: The channel the frame was received on |
1978 | * @mgmt: the management frame (probe response or beacon) | ||
1979 | * @len: length of the management frame | ||
1955 | * @signal: the signal strength, type depends on the wiphy's signal_type | 1980 | * @signal: the signal strength, type depends on the wiphy's signal_type |
1956 | * @gfp: context flags | 1981 | * @gfp: context flags |
1957 | * | 1982 | * |
@@ -1964,6 +1989,23 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy, | |||
1964 | struct ieee80211_mgmt *mgmt, size_t len, | 1989 | struct ieee80211_mgmt *mgmt, size_t len, |
1965 | s32 signal, gfp_t gfp); | 1990 | s32 signal, gfp_t gfp); |
1966 | 1991 | ||
1992 | /** | ||
1993 | * cfg80211_inform_bss - inform cfg80211 of a new BSS | ||
1994 | * | ||
1995 | * @wiphy: the wiphy reporting the BSS | ||
1996 | * @channel: The channel the frame was received on | ||
1997 | * @bssid: the BSSID of the BSS | ||
1998 | * @timestamp: the TSF timestamp sent by the peer | ||
1999 | * @capability: the capability field sent by the peer | ||
2000 | * @beacon_interval: the beacon interval announced by the peer | ||
2001 | * @ie: additional IEs sent by the peer | ||
2002 | * @ielen: length of the additional IEs | ||
2003 | * @signal: the signal strength, type depends on the wiphy's signal_type | ||
2004 | * @gfp: context flags | ||
2005 | * | ||
2006 | * This informs cfg80211 that BSS information was found and | ||
2007 | * the BSS should be updated/added. | ||
2008 | */ | ||
1967 | struct cfg80211_bss* | 2009 | struct cfg80211_bss* |
1968 | cfg80211_inform_bss(struct wiphy *wiphy, | 2010 | cfg80211_inform_bss(struct wiphy *wiphy, |
1969 | struct ieee80211_channel *channel, | 2011 | struct ieee80211_channel *channel, |
@@ -2378,4 +2420,67 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
2378 | enum nl80211_cqm_rssi_threshold_event rssi_event, | 2420 | enum nl80211_cqm_rssi_threshold_event rssi_event, |
2379 | gfp_t gfp); | 2421 | gfp_t gfp); |
2380 | 2422 | ||
2423 | #ifdef __KERNEL__ | ||
2424 | |||
2425 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | ||
2426 | |||
2427 | /* wiphy_printk helpers, similar to dev_printk */ | ||
2428 | |||
2429 | #define wiphy_printk(level, wiphy, format, args...) \ | ||
2430 | printk(level "%s: " format, wiphy_name(wiphy), ##args) | ||
2431 | #define wiphy_emerg(wiphy, format, args...) \ | ||
2432 | wiphy_printk(KERN_EMERG, wiphy, format, ##args) | ||
2433 | #define wiphy_alert(wiphy, format, args...) \ | ||
2434 | wiphy_printk(KERN_ALERT, wiphy, format, ##args) | ||
2435 | #define wiphy_crit(wiphy, format, args...) \ | ||
2436 | wiphy_printk(KERN_CRIT, wiphy, format, ##args) | ||
2437 | #define wiphy_err(wiphy, format, args...) \ | ||
2438 | wiphy_printk(KERN_ERR, wiphy, format, ##args) | ||
2439 | #define wiphy_warn(wiphy, format, args...) \ | ||
2440 | wiphy_printk(KERN_WARNING, wiphy, format, ##args) | ||
2441 | #define wiphy_notice(wiphy, format, args...) \ | ||
2442 | wiphy_printk(KERN_NOTICE, wiphy, format, ##args) | ||
2443 | #define wiphy_info(wiphy, format, args...) \ | ||
2444 | wiphy_printk(KERN_INFO, wiphy, format, ##args) | ||
2445 | |||
2446 | int wiphy_debug(const struct wiphy *wiphy, const char *format, ...) | ||
2447 | __attribute__ ((format (printf, 2, 3))); | ||
2448 | |||
2449 | #if defined(DEBUG) | ||
2450 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2451 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args) | ||
2452 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
2453 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2454 | dynamic_pr_debug("%s: " format, wiphy_name(wiphy), ##args) | ||
2455 | #else | ||
2456 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2457 | ({ \ | ||
2458 | if (0) \ | ||
2459 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ | ||
2460 | 0; \ | ||
2461 | }) | ||
2462 | #endif | ||
2463 | |||
2464 | #if defined(VERBOSE_DEBUG) | ||
2465 | #define wiphy_vdbg wiphy_dbg | ||
2466 | #else | ||
2467 | |||
2468 | #define wiphy_vdbg(wiphy, format, args...) \ | ||
2469 | ({ \ | ||
2470 | if (0) \ | ||
2471 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ | ||
2472 | 0; \ | ||
2473 | }) | ||
2474 | #endif | ||
2475 | |||
2476 | /* | ||
2477 | * wiphy_WARN() acts like wiphy_printk(), but with the key difference | ||
2478 | * of using a WARN/WARN_ON to get the message out, including the | ||
2479 | * file/line information and a backtrace. | ||
2480 | */ | ||
2481 | #define wiphy_WARN(wiphy, format, args...) \ | ||
2482 | WARN(1, "wiphy: %s\n" format, wiphy_name(wiphy), ##args); | ||
2483 | |||
2484 | #endif | ||
2485 | |||
2381 | #endif /* __NET_CFG80211_H */ | 2486 | #endif /* __NET_CFG80211_H */ |
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index 511a459ec10f..0916bbf3bdff 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
@@ -101,7 +101,7 @@ struct dn_short_packet { | |||
101 | __le16 dstnode; | 101 | __le16 dstnode; |
102 | __le16 srcnode; | 102 | __le16 srcnode; |
103 | __u8 forward; | 103 | __u8 forward; |
104 | } __attribute__((packed)); | 104 | } __packed; |
105 | 105 | ||
106 | struct dn_long_packet { | 106 | struct dn_long_packet { |
107 | __u8 msgflg; | 107 | __u8 msgflg; |
@@ -115,7 +115,7 @@ struct dn_long_packet { | |||
115 | __u8 visit_ct; | 115 | __u8 visit_ct; |
116 | __u8 s_class; | 116 | __u8 s_class; |
117 | __u8 pt; | 117 | __u8 pt; |
118 | } __attribute__((packed)); | 118 | } __packed; |
119 | 119 | ||
120 | /*------------------------- DRP - Routing messages ---------------------*/ | 120 | /*------------------------- DRP - Routing messages ---------------------*/ |
121 | 121 | ||
@@ -132,7 +132,7 @@ struct endnode_hello_message { | |||
132 | __u8 mpd; | 132 | __u8 mpd; |
133 | __u8 datalen; | 133 | __u8 datalen; |
134 | __u8 data[2]; | 134 | __u8 data[2]; |
135 | } __attribute__((packed)); | 135 | } __packed; |
136 | 136 | ||
137 | struct rtnode_hello_message { | 137 | struct rtnode_hello_message { |
138 | __u8 msgflg; | 138 | __u8 msgflg; |
@@ -144,7 +144,7 @@ struct rtnode_hello_message { | |||
144 | __u8 area; | 144 | __u8 area; |
145 | __le16 timer; | 145 | __le16 timer; |
146 | __u8 mpd; | 146 | __u8 mpd; |
147 | } __attribute__((packed)); | 147 | } __packed; |
148 | 148 | ||
149 | 149 | ||
150 | extern void dn_dev_init(void); | 150 | extern void dn_dev_init(void); |
diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h index 17d43d2db5ec..e43a2893f132 100644 --- a/include/net/dn_nsp.h +++ b/include/net/dn_nsp.h | |||
@@ -74,18 +74,18 @@ struct nsp_data_seg_msg { | |||
74 | __u8 msgflg; | 74 | __u8 msgflg; |
75 | __le16 dstaddr; | 75 | __le16 dstaddr; |
76 | __le16 srcaddr; | 76 | __le16 srcaddr; |
77 | } __attribute__((packed)); | 77 | } __packed; |
78 | 78 | ||
79 | struct nsp_data_opt_msg { | 79 | struct nsp_data_opt_msg { |
80 | __le16 acknum; | 80 | __le16 acknum; |
81 | __le16 segnum; | 81 | __le16 segnum; |
82 | __le16 lsflgs; | 82 | __le16 lsflgs; |
83 | } __attribute__((packed)); | 83 | } __packed; |
84 | 84 | ||
85 | struct nsp_data_opt_msg1 { | 85 | struct nsp_data_opt_msg1 { |
86 | __le16 acknum; | 86 | __le16 acknum; |
87 | __le16 segnum; | 87 | __le16 segnum; |
88 | } __attribute__((packed)); | 88 | } __packed; |
89 | 89 | ||
90 | 90 | ||
91 | /* Acknowledgment Message (data/other data) */ | 91 | /* Acknowledgment Message (data/other data) */ |
@@ -94,13 +94,13 @@ struct nsp_data_ack_msg { | |||
94 | __le16 dstaddr; | 94 | __le16 dstaddr; |
95 | __le16 srcaddr; | 95 | __le16 srcaddr; |
96 | __le16 acknum; | 96 | __le16 acknum; |
97 | } __attribute__((packed)); | 97 | } __packed; |
98 | 98 | ||
99 | /* Connect Acknowledgment Message */ | 99 | /* Connect Acknowledgment Message */ |
100 | struct nsp_conn_ack_msg { | 100 | struct nsp_conn_ack_msg { |
101 | __u8 msgflg; | 101 | __u8 msgflg; |
102 | __le16 dstaddr; | 102 | __le16 dstaddr; |
103 | } __attribute__((packed)); | 103 | } __packed; |
104 | 104 | ||
105 | 105 | ||
106 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ | 106 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ |
@@ -117,7 +117,7 @@ struct nsp_conn_init_msg { | |||
117 | #define NSP_FC_MASK 0x0c /* FC type mask */ | 117 | #define NSP_FC_MASK 0x0c /* FC type mask */ |
118 | __u8 info; | 118 | __u8 info; |
119 | __le16 segsize; | 119 | __le16 segsize; |
120 | } __attribute__((packed)); | 120 | } __packed; |
121 | 121 | ||
122 | /* Disconnect Initiate/Disconnect Confirm */ | 122 | /* Disconnect Initiate/Disconnect Confirm */ |
123 | struct nsp_disconn_init_msg { | 123 | struct nsp_disconn_init_msg { |
@@ -125,7 +125,7 @@ struct nsp_disconn_init_msg { | |||
125 | __le16 dstaddr; | 125 | __le16 dstaddr; |
126 | __le16 srcaddr; | 126 | __le16 srcaddr; |
127 | __le16 reason; | 127 | __le16 reason; |
128 | } __attribute__((packed)); | 128 | } __packed; |
129 | 129 | ||
130 | 130 | ||
131 | 131 | ||
@@ -135,7 +135,7 @@ struct srcobj_fmt { | |||
135 | __le16 grpcode; | 135 | __le16 grpcode; |
136 | __le16 usrcode; | 136 | __le16 usrcode; |
137 | __u8 dlen; | 137 | __u8 dlen; |
138 | } __attribute__((packed)); | 138 | } __packed; |
139 | 139 | ||
140 | /* | 140 | /* |
141 | * A collection of functions for manipulating the sequence | 141 | * A collection of functions for manipulating the sequence |
diff --git a/include/net/dn_route.h b/include/net/dn_route.h index 60c9f22d8694..ccadab3aa3f6 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h | |||
@@ -65,9 +65,7 @@ extern void dn_rt_cache_flush(int delay); | |||
65 | * packets to the originating host. | 65 | * packets to the originating host. |
66 | */ | 66 | */ |
67 | struct dn_route { | 67 | struct dn_route { |
68 | union { | 68 | struct dst_entry dst; |
69 | struct dst_entry dst; | ||
70 | } u; | ||
71 | 69 | ||
72 | struct flowi fl; | 70 | struct flowi fl; |
73 | 71 | ||
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index eb551baafc04..f7dcd2c70412 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -68,26 +68,15 @@ struct genl_info { | |||
68 | #endif | 68 | #endif |
69 | }; | 69 | }; |
70 | 70 | ||
71 | #ifdef CONFIG_NET_NS | ||
72 | static inline struct net *genl_info_net(struct genl_info *info) | 71 | static inline struct net *genl_info_net(struct genl_info *info) |
73 | { | 72 | { |
74 | return info->_net; | 73 | return read_pnet(&info->_net); |
75 | } | 74 | } |
76 | 75 | ||
77 | static inline void genl_info_net_set(struct genl_info *info, struct net *net) | 76 | static inline void genl_info_net_set(struct genl_info *info, struct net *net) |
78 | { | 77 | { |
79 | info->_net = net; | 78 | write_pnet(&info->_net, net); |
80 | } | 79 | } |
81 | #else | ||
82 | static inline struct net *genl_info_net(struct genl_info *info) | ||
83 | { | ||
84 | return &init_net; | ||
85 | } | ||
86 | |||
87 | static inline void genl_info_net_set(struct genl_info *info, struct net *net) | ||
88 | { | ||
89 | } | ||
90 | #endif | ||
91 | 80 | ||
92 | /** | 81 | /** |
93 | * struct genl_ops - generic netlink operations | 82 | * struct genl_ops - generic netlink operations |
diff --git a/include/net/inet_common.h b/include/net/inet_common.h index 18c773286b91..22fac9892b16 100644 --- a/include/net/inet_common.h +++ b/include/net/inet_common.h | |||
@@ -1,8 +1,8 @@ | |||
1 | #ifndef _INET_COMMON_H | 1 | #ifndef _INET_COMMON_H |
2 | #define _INET_COMMON_H | 2 | #define _INET_COMMON_H |
3 | 3 | ||
4 | extern const struct proto_ops inet_stream_ops; | 4 | extern const struct proto_ops inet_stream_ops; |
5 | extern const struct proto_ops inet_dgram_ops; | 5 | extern const struct proto_ops inet_dgram_ops; |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * INET4 prototypes used by INET6 | 8 | * INET4 prototypes used by INET6 |
@@ -13,37 +13,28 @@ struct sock; | |||
13 | struct sockaddr; | 13 | struct sockaddr; |
14 | struct socket; | 14 | struct socket; |
15 | 15 | ||
16 | extern int inet_release(struct socket *sock); | 16 | extern int inet_release(struct socket *sock); |
17 | extern int inet_stream_connect(struct socket *sock, | 17 | extern int inet_stream_connect(struct socket *sock, struct sockaddr * uaddr, |
18 | struct sockaddr * uaddr, | 18 | int addr_len, int flags); |
19 | int addr_len, int flags); | 19 | extern int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr, |
20 | extern int inet_dgram_connect(struct socket *sock, | 20 | int addr_len, int flags); |
21 | struct sockaddr * uaddr, | 21 | extern int inet_accept(struct socket *sock, struct socket *newsock, int flags); |
22 | int addr_len, int flags); | 22 | extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock, |
23 | extern int inet_accept(struct socket *sock, | 23 | struct msghdr *msg, size_t size); |
24 | struct socket *newsock, int flags); | 24 | extern ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, |
25 | extern int inet_sendmsg(struct kiocb *iocb, | 25 | size_t size, int flags); |
26 | struct socket *sock, | 26 | extern int inet_recvmsg(struct kiocb *iocb, struct socket *sock, |
27 | struct msghdr *msg, | 27 | struct msghdr *msg, size_t size, int flags); |
28 | size_t size); | 28 | extern int inet_shutdown(struct socket *sock, int how); |
29 | extern int inet_shutdown(struct socket *sock, int how); | 29 | extern int inet_listen(struct socket *sock, int backlog); |
30 | extern int inet_listen(struct socket *sock, int backlog); | 30 | extern void inet_sock_destruct(struct sock *sk); |
31 | 31 | extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); | |
32 | extern void inet_sock_destruct(struct sock *sk); | 32 | extern int inet_getname(struct socket *sock, struct sockaddr *uaddr, |
33 | 33 | int *uaddr_len, int peer); | |
34 | extern int inet_bind(struct socket *sock, | 34 | extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
35 | struct sockaddr *uaddr, int addr_len); | 35 | extern int inet_ctl_sock_create(struct sock **sk, unsigned short family, |
36 | extern int inet_getname(struct socket *sock, | 36 | unsigned short type, unsigned char protocol, |
37 | struct sockaddr *uaddr, | 37 | struct net *net); |
38 | int *uaddr_len, int peer); | ||
39 | extern int inet_ioctl(struct socket *sock, | ||
40 | unsigned int cmd, unsigned long arg); | ||
41 | |||
42 | extern int inet_ctl_sock_create(struct sock **sk, | ||
43 | unsigned short family, | ||
44 | unsigned short type, | ||
45 | unsigned char protocol, | ||
46 | struct net *net); | ||
47 | 38 | ||
48 | static inline void inet_ctl_sock_destroy(struct sock *sk) | 39 | static inline void inet_ctl_sock_destroy(struct sock *sk) |
49 | { | 40 | { |
@@ -51,5 +42,3 @@ static inline void inet_ctl_sock_destroy(struct sock *sk) | |||
51 | } | 42 | } |
52 | 43 | ||
53 | #endif | 44 | #endif |
54 | |||
55 | |||
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 39f2dc943908..16ff29a7bb30 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
@@ -20,6 +20,7 @@ struct inet_frag_queue { | |||
20 | atomic_t refcnt; | 20 | atomic_t refcnt; |
21 | struct timer_list timer; /* when will this queue expire? */ | 21 | struct timer_list timer; /* when will this queue expire? */ |
22 | struct sk_buff *fragments; /* list of received fragments */ | 22 | struct sk_buff *fragments; /* list of received fragments */ |
23 | struct sk_buff *fragments_tail; | ||
23 | ktime_t stamp; | 24 | ktime_t stamp; |
24 | int len; /* total length of orig datagram */ | 25 | int len; /* total length of orig datagram */ |
25 | int meat; | 26 | int meat; |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 1653de515cee..1989cfd7405f 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -137,7 +137,8 @@ struct inet_sock { | |||
137 | hdrincl:1, | 137 | hdrincl:1, |
138 | mc_loop:1, | 138 | mc_loop:1, |
139 | transparent:1, | 139 | transparent:1, |
140 | mc_all:1; | 140 | mc_all:1, |
141 | nodefrag:1; | ||
141 | int mc_index; | 142 | int mc_index; |
142 | __be32 mc_addr; | 143 | __be32 mc_addr; |
143 | struct ip_mc_socklist *mc_list; | 144 | struct ip_mc_socklist *mc_list; |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 87b1df0d4d8c..417d0c894f29 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -22,10 +22,21 @@ struct inet_peer { | |||
22 | __u32 dtime; /* the time of last use of not | 22 | __u32 dtime; /* the time of last use of not |
23 | * referenced entries */ | 23 | * referenced entries */ |
24 | atomic_t refcnt; | 24 | atomic_t refcnt; |
25 | atomic_t rid; /* Frag reception counter */ | 25 | /* |
26 | atomic_t ip_id_count; /* IP ID for the next packet */ | 26 | * Once inet_peer is queued for deletion (refcnt == -1), following fields |
27 | __u32 tcp_ts; | 27 | * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp |
28 | __u32 tcp_ts_stamp; | 28 | * We can share memory with rcu_head to keep inet_peer small |
29 | * (less then 64 bytes) | ||
30 | */ | ||
31 | union { | ||
32 | struct { | ||
33 | atomic_t rid; /* Frag reception counter */ | ||
34 | atomic_t ip_id_count; /* IP ID for the next packet */ | ||
35 | __u32 tcp_ts; | ||
36 | __u32 tcp_ts_stamp; | ||
37 | }; | ||
38 | struct rcu_head rcu; | ||
39 | }; | ||
29 | }; | 40 | }; |
30 | 41 | ||
31 | void inet_initpeers(void) __init; | 42 | void inet_initpeers(void) __init; |
@@ -36,10 +47,21 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create); | |||
36 | /* can be called from BH context or outside */ | 47 | /* can be called from BH context or outside */ |
37 | extern void inet_putpeer(struct inet_peer *p); | 48 | extern void inet_putpeer(struct inet_peer *p); |
38 | 49 | ||
50 | /* | ||
51 | * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, | ||
52 | * tcp_ts_stamp if no refcount is taken on inet_peer | ||
53 | */ | ||
54 | static inline void inet_peer_refcheck(const struct inet_peer *p) | ||
55 | { | ||
56 | WARN_ON_ONCE(atomic_read(&p->refcnt) <= 0); | ||
57 | } | ||
58 | |||
59 | |||
39 | /* can be called with or without local BH being disabled */ | 60 | /* can be called with or without local BH being disabled */ |
40 | static inline __u16 inet_getid(struct inet_peer *p, int more) | 61 | static inline __u16 inet_getid(struct inet_peer *p, int more) |
41 | { | 62 | { |
42 | more++; | 63 | more++; |
64 | inet_peer_refcheck(p); | ||
43 | return atomic_add_return(more, &p->ip_id_count) - more; | 65 | return atomic_add_return(more, &p->ip_id_count) - more; |
44 | } | 66 | } |
45 | 67 | ||
diff --git a/include/net/ip.h b/include/net/ip.h index 452f229c380a..890f9725d681 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -61,11 +61,14 @@ struct ipcm_cookie { | |||
61 | struct ip_ra_chain { | 61 | struct ip_ra_chain { |
62 | struct ip_ra_chain *next; | 62 | struct ip_ra_chain *next; |
63 | struct sock *sk; | 63 | struct sock *sk; |
64 | void (*destructor)(struct sock *); | 64 | union { |
65 | void (*destructor)(struct sock *); | ||
66 | struct sock *saved_sk; | ||
67 | }; | ||
68 | struct rcu_head rcu; | ||
65 | }; | 69 | }; |
66 | 70 | ||
67 | extern struct ip_ra_chain *ip_ra_chain; | 71 | extern struct ip_ra_chain *ip_ra_chain; |
68 | extern rwlock_t ip_ra_lock; | ||
69 | 72 | ||
70 | /* IP flags. */ | 73 | /* IP flags. */ |
71 | #define IP_CE 0x8000 /* Flag: "Congestion" */ | 74 | #define IP_CE 0x8000 /* Flag: "Congestion" */ |
@@ -162,12 +165,12 @@ struct ipv4_config { | |||
162 | }; | 165 | }; |
163 | 166 | ||
164 | extern struct ipv4_config ipv4_config; | 167 | extern struct ipv4_config ipv4_config; |
165 | #define IP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.ip_statistics, field) | 168 | #define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field) |
166 | #define IP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.ip_statistics, field) | 169 | #define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field) |
167 | #define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.ip_statistics, field, val) | 170 | #define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val) |
168 | #define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS_BH((net)->mib.ip_statistics, field, val) | 171 | #define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS64_BH((net)->mib.ip_statistics, field, val) |
169 | #define IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS((net)->mib.ip_statistics, field, val) | 172 | #define IP_UPD_PO_STATS(net, field, val) SNMP_UPD_PO_STATS64((net)->mib.ip_statistics, field, val) |
170 | #define IP_UPD_PO_STATS_BH(net, field, val) SNMP_UPD_PO_STATS_BH((net)->mib.ip_statistics, field, val) | 173 | #define IP_UPD_PO_STATS_BH(net, field, val) SNMP_UPD_PO_STATS64_BH((net)->mib.ip_statistics, field, val) |
171 | #define NET_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.net_statistics, field) | 174 | #define NET_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.net_statistics, field) |
172 | #define NET_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.net_statistics, field) | 175 | #define NET_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.net_statistics, field) |
173 | #define NET_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->mib.net_statistics, field) | 176 | #define NET_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->mib.net_statistics, field) |
@@ -175,7 +178,15 @@ extern struct ipv4_config ipv4_config; | |||
175 | #define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd) | 178 | #define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd) |
176 | 179 | ||
177 | extern unsigned long snmp_fold_field(void __percpu *mib[], int offt); | 180 | extern unsigned long snmp_fold_field(void __percpu *mib[], int offt); |
178 | extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize); | 181 | #if BITS_PER_LONG==32 |
182 | extern u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t sync_off); | ||
183 | #else | ||
184 | static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp_off) | ||
185 | { | ||
186 | return snmp_fold_field(mib, offt); | ||
187 | } | ||
188 | #endif | ||
189 | extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align); | ||
179 | extern void snmp_mib_free(void __percpu *ptr[2]); | 190 | extern void snmp_mib_free(void __percpu *ptr[2]); |
180 | 191 | ||
181 | extern struct local_ports { | 192 | extern struct local_ports { |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 4b1dc1161c37..062a823d311c 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -84,13 +84,11 @@ struct rt6key { | |||
84 | struct fib6_table; | 84 | struct fib6_table; |
85 | 85 | ||
86 | struct rt6_info { | 86 | struct rt6_info { |
87 | union { | 87 | struct dst_entry dst; |
88 | struct dst_entry dst; | ||
89 | } u; | ||
90 | 88 | ||
91 | #define rt6i_dev u.dst.dev | 89 | #define rt6i_dev dst.dev |
92 | #define rt6i_nexthop u.dst.neighbour | 90 | #define rt6i_nexthop dst.neighbour |
93 | #define rt6i_expires u.dst.expires | 91 | #define rt6i_expires dst.expires |
94 | 92 | ||
95 | /* | 93 | /* |
96 | * Tail elements of dst_entry (__refcnt etc.) | 94 | * Tail elements of dst_entry (__refcnt etc.) |
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index fbf9d1cda27b..fc94ec568a50 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
@@ -27,6 +27,6 @@ struct ipv6_tlv_tnl_enc_lim { | |||
27 | __u8 type; /* type-code for option */ | 27 | __u8 type; /* type-code for option */ |
28 | __u8 length; /* option length */ | 28 | __u8 length; /* option length */ |
29 | __u8 encap_limit; /* tunnel encapsulation limit */ | 29 | __u8 encap_limit; /* tunnel encapsulation limit */ |
30 | } __attribute__ ((packed)); | 30 | } __packed; |
31 | 31 | ||
32 | #endif | 32 | #endif |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index fe82b1e10a29..a4747a0f7303 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -632,10 +632,22 @@ extern struct ip_vs_conn *ip_vs_ct_in_get | |||
632 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, | 632 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, |
633 | const union nf_inet_addr *d_addr, __be16 d_port); | 633 | const union nf_inet_addr *d_addr, __be16 d_port); |
634 | 634 | ||
635 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | ||
636 | struct ip_vs_protocol *pp, | ||
637 | const struct ip_vs_iphdr *iph, | ||
638 | unsigned int proto_off, | ||
639 | int inverse); | ||
640 | |||
635 | extern struct ip_vs_conn *ip_vs_conn_out_get | 641 | extern struct ip_vs_conn *ip_vs_conn_out_get |
636 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, | 642 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, |
637 | const union nf_inet_addr *d_addr, __be16 d_port); | 643 | const union nf_inet_addr *d_addr, __be16 d_port); |
638 | 644 | ||
645 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, | ||
646 | struct ip_vs_protocol *pp, | ||
647 | const struct ip_vs_iphdr *iph, | ||
648 | unsigned int proto_off, | ||
649 | int inverse); | ||
650 | |||
639 | /* put back the conn without restarting its timer */ | 651 | /* put back the conn without restarting its timer */ |
640 | static inline void __ip_vs_conn_put(struct ip_vs_conn *cp) | 652 | static inline void __ip_vs_conn_put(struct ip_vs_conn *cp) |
641 | { | 653 | { |
@@ -736,8 +748,6 @@ extern void ip_vs_app_inc_put(struct ip_vs_app *inc); | |||
736 | 748 | ||
737 | extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb); | 749 | extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb); |
738 | extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb); | 750 | extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb); |
739 | extern int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri, | ||
740 | char *o_buf, int o_len, char *n_buf, int n_len); | ||
741 | extern int ip_vs_app_init(void); | 751 | extern int ip_vs_app_init(void); |
742 | extern void ip_vs_app_cleanup(void); | 752 | extern void ip_vs_app_cleanup(void); |
743 | 753 | ||
diff --git a/include/net/ipip.h b/include/net/ipip.h index 11e8513d2d07..65caea8b414f 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -50,7 +50,7 @@ struct ip_tunnel_prl_entry { | |||
50 | int pkt_len = skb->len - skb_transport_offset(skb); \ | 50 | int pkt_len = skb->len - skb_transport_offset(skb); \ |
51 | \ | 51 | \ |
52 | skb->ip_summed = CHECKSUM_NONE; \ | 52 | skb->ip_summed = CHECKSUM_NONE; \ |
53 | ip_select_ident(iph, &rt->u.dst, NULL); \ | 53 | ip_select_ident(iph, &rt->dst, NULL); \ |
54 | \ | 54 | \ |
55 | err = ip_local_out(skb); \ | 55 | err = ip_local_out(skb); \ |
56 | if (likely(net_xmit_eval(err) == 0)) { \ | 56 | if (likely(net_xmit_eval(err) == 0)) { \ |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 2600b69757b8..1f8412410998 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -136,17 +136,17 @@ extern struct ctl_path net_ipv6_ctl_path[]; | |||
136 | /* MIBs */ | 136 | /* MIBs */ |
137 | 137 | ||
138 | #define IP6_INC_STATS(net, idev,field) \ | 138 | #define IP6_INC_STATS(net, idev,field) \ |
139 | _DEVINC(net, ipv6, , idev, field) | 139 | _DEVINC(net, ipv6, 64, idev, field) |
140 | #define IP6_INC_STATS_BH(net, idev,field) \ | 140 | #define IP6_INC_STATS_BH(net, idev,field) \ |
141 | _DEVINC(net, ipv6, _BH, idev, field) | 141 | _DEVINC(net, ipv6, 64_BH, idev, field) |
142 | #define IP6_ADD_STATS(net, idev,field,val) \ | 142 | #define IP6_ADD_STATS(net, idev,field,val) \ |
143 | _DEVADD(net, ipv6, , idev, field, val) | 143 | _DEVADD(net, ipv6, 64, idev, field, val) |
144 | #define IP6_ADD_STATS_BH(net, idev,field,val) \ | 144 | #define IP6_ADD_STATS_BH(net, idev,field,val) \ |
145 | _DEVADD(net, ipv6, _BH, idev, field, val) | 145 | _DEVADD(net, ipv6, 64_BH, idev, field, val) |
146 | #define IP6_UPD_PO_STATS(net, idev,field,val) \ | 146 | #define IP6_UPD_PO_STATS(net, idev,field,val) \ |
147 | _DEVUPD(net, ipv6, , idev, field, val) | 147 | _DEVUPD(net, ipv6, 64, idev, field, val) |
148 | #define IP6_UPD_PO_STATS_BH(net, idev,field,val) \ | 148 | #define IP6_UPD_PO_STATS_BH(net, idev,field,val) \ |
149 | _DEVUPD(net, ipv6, _BH, idev, field, val) | 149 | _DEVUPD(net, ipv6, 64_BH, idev, field, val) |
150 | #define ICMP6_INC_STATS(net, idev, field) \ | 150 | #define ICMP6_INC_STATS(net, idev, field) \ |
151 | _DEVINC(net, icmpv6, , idev, field) | 151 | _DEVINC(net, icmpv6, , idev, field) |
152 | #define ICMP6_INC_STATS_BH(net, idev, field) \ | 152 | #define ICMP6_INC_STATS_BH(net, idev, field) \ |
@@ -551,6 +551,10 @@ extern int ipv6_ext_hdr(u8 nexthdr); | |||
551 | 551 | ||
552 | extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); | 552 | extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); |
553 | 553 | ||
554 | extern struct in6_addr *fl6_update_dst(struct flowi *fl, | ||
555 | const struct ipv6_txoptions *opt, | ||
556 | struct in6_addr *orig); | ||
557 | |||
554 | /* | 558 | /* |
555 | * socket options (ipv6_sockglue.c) | 559 | * socket options (ipv6_sockglue.c) |
556 | */ | 560 | */ |
diff --git a/include/net/ipx.h b/include/net/ipx.h index ef51a668ba19..05d7e4a88b49 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h | |||
@@ -27,9 +27,9 @@ struct ipx_address { | |||
27 | #define IPX_MAX_PPROP_HOPS 8 | 27 | #define IPX_MAX_PPROP_HOPS 8 |
28 | 28 | ||
29 | struct ipxhdr { | 29 | struct ipxhdr { |
30 | __be16 ipx_checksum __attribute__ ((packed)); | 30 | __be16 ipx_checksum __packed; |
31 | #define IPX_NO_CHECKSUM cpu_to_be16(0xFFFF) | 31 | #define IPX_NO_CHECKSUM cpu_to_be16(0xFFFF) |
32 | __be16 ipx_pktsize __attribute__ ((packed)); | 32 | __be16 ipx_pktsize __packed; |
33 | __u8 ipx_tctrl; | 33 | __u8 ipx_tctrl; |
34 | __u8 ipx_type; | 34 | __u8 ipx_type; |
35 | #define IPX_TYPE_UNKNOWN 0x00 | 35 | #define IPX_TYPE_UNKNOWN 0x00 |
@@ -38,8 +38,8 @@ struct ipxhdr { | |||
38 | #define IPX_TYPE_SPX 0x05 /* SPX protocol */ | 38 | #define IPX_TYPE_SPX 0x05 /* SPX protocol */ |
39 | #define IPX_TYPE_NCP 0x11 /* $lots for docs on this (SPIT) */ | 39 | #define IPX_TYPE_NCP 0x11 /* $lots for docs on this (SPIT) */ |
40 | #define IPX_TYPE_PPROP 0x14 /* complicated flood fill brdcast */ | 40 | #define IPX_TYPE_PPROP 0x14 /* complicated flood fill brdcast */ |
41 | struct ipx_address ipx_dest __attribute__ ((packed)); | 41 | struct ipx_address ipx_dest __packed; |
42 | struct ipx_address ipx_source __attribute__ ((packed)); | 42 | struct ipx_address ipx_source __packed; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb) | 45 | static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb) |
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h index 7e582061b230..3bed61d379a8 100644 --- a/include/net/irda/irda.h +++ b/include/net/irda/irda.h | |||
@@ -53,10 +53,6 @@ typedef __u32 magic_t; | |||
53 | #ifndef IRDA_ALIGN | 53 | #ifndef IRDA_ALIGN |
54 | # define IRDA_ALIGN __attribute__((aligned)) | 54 | # define IRDA_ALIGN __attribute__((aligned)) |
55 | #endif | 55 | #endif |
56 | #ifndef IRDA_PACK | ||
57 | # define IRDA_PACK __attribute__((packed)) | ||
58 | #endif | ||
59 | |||
60 | 56 | ||
61 | #ifdef CONFIG_IRDA_DEBUG | 57 | #ifdef CONFIG_IRDA_DEBUG |
62 | 58 | ||
diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h index 641f88e848bd..6b1dc4f8eca5 100644 --- a/include/net/irda/irlap_frame.h +++ b/include/net/irda/irlap_frame.h | |||
@@ -85,7 +85,7 @@ struct discovery_t; | |||
85 | struct disc_frame { | 85 | struct disc_frame { |
86 | __u8 caddr; /* Connection address */ | 86 | __u8 caddr; /* Connection address */ |
87 | __u8 control; | 87 | __u8 control; |
88 | } IRDA_PACK; | 88 | } __packed; |
89 | 89 | ||
90 | struct xid_frame { | 90 | struct xid_frame { |
91 | __u8 caddr; /* Connection address */ | 91 | __u8 caddr; /* Connection address */ |
@@ -96,41 +96,41 @@ struct xid_frame { | |||
96 | __u8 flags; /* Discovery flags */ | 96 | __u8 flags; /* Discovery flags */ |
97 | __u8 slotnr; | 97 | __u8 slotnr; |
98 | __u8 version; | 98 | __u8 version; |
99 | } IRDA_PACK; | 99 | } __packed; |
100 | 100 | ||
101 | struct test_frame { | 101 | struct test_frame { |
102 | __u8 caddr; /* Connection address */ | 102 | __u8 caddr; /* Connection address */ |
103 | __u8 control; | 103 | __u8 control; |
104 | __le32 saddr; /* Source device address */ | 104 | __le32 saddr; /* Source device address */ |
105 | __le32 daddr; /* Destination device address */ | 105 | __le32 daddr; /* Destination device address */ |
106 | } IRDA_PACK; | 106 | } __packed; |
107 | 107 | ||
108 | struct ua_frame { | 108 | struct ua_frame { |
109 | __u8 caddr; | 109 | __u8 caddr; |
110 | __u8 control; | 110 | __u8 control; |
111 | __le32 saddr; /* Source device address */ | 111 | __le32 saddr; /* Source device address */ |
112 | __le32 daddr; /* Dest device address */ | 112 | __le32 daddr; /* Dest device address */ |
113 | } IRDA_PACK; | 113 | } __packed; |
114 | 114 | ||
115 | struct dm_frame { | 115 | struct dm_frame { |
116 | __u8 caddr; /* Connection address */ | 116 | __u8 caddr; /* Connection address */ |
117 | __u8 control; | 117 | __u8 control; |
118 | } IRDA_PACK; | 118 | } __packed; |
119 | 119 | ||
120 | struct rd_frame { | 120 | struct rd_frame { |
121 | __u8 caddr; /* Connection address */ | 121 | __u8 caddr; /* Connection address */ |
122 | __u8 control; | 122 | __u8 control; |
123 | } IRDA_PACK; | 123 | } __packed; |
124 | 124 | ||
125 | struct rr_frame { | 125 | struct rr_frame { |
126 | __u8 caddr; /* Connection address */ | 126 | __u8 caddr; /* Connection address */ |
127 | __u8 control; | 127 | __u8 control; |
128 | } IRDA_PACK; | 128 | } __packed; |
129 | 129 | ||
130 | struct i_frame { | 130 | struct i_frame { |
131 | __u8 caddr; | 131 | __u8 caddr; |
132 | __u8 control; | 132 | __u8 control; |
133 | } IRDA_PACK; | 133 | } __packed; |
134 | 134 | ||
135 | struct snrm_frame { | 135 | struct snrm_frame { |
136 | __u8 caddr; | 136 | __u8 caddr; |
@@ -138,7 +138,7 @@ struct snrm_frame { | |||
138 | __le32 saddr; | 138 | __le32 saddr; |
139 | __le32 daddr; | 139 | __le32 daddr; |
140 | __u8 ncaddr; | 140 | __u8 ncaddr; |
141 | } IRDA_PACK; | 141 | } __packed; |
142 | 142 | ||
143 | void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb); | 143 | void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb); |
144 | void irlap_send_discovery_xid_frame(struct irlap_cb *, int S, __u8 s, | 144 | void irlap_send_discovery_xid_frame(struct irlap_cb *, int S, __u8 s, |
diff --git a/include/net/lib80211.h b/include/net/lib80211.h index fb4e2784857d..848cce1bb7a5 100644 --- a/include/net/lib80211.h +++ b/include/net/lib80211.h | |||
@@ -54,9 +54,6 @@ struct lib80211_crypto_ops { | |||
54 | /* deinitialize crypto context and free allocated private data */ | 54 | /* deinitialize crypto context and free allocated private data */ |
55 | void (*deinit) (void *priv); | 55 | void (*deinit) (void *priv); |
56 | 56 | ||
57 | int (*build_iv) (struct sk_buff * skb, int hdr_len, | ||
58 | u8 *key, int keylen, void *priv); | ||
59 | |||
60 | /* encrypt/decrypt return < 0 on error or >= 0 on success. The return | 57 | /* encrypt/decrypt return < 0 on error or >= 0 on success. The return |
61 | * value from decrypt_mpdu is passed as the keyidx value for | 58 | * value from decrypt_mpdu is passed as the keyidx value for |
62 | * decrypt_msdu. skb must have enough head and tail room for the | 59 | * decrypt_msdu. skb must have enough head and tail room for the |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index de22cbfef232..b0787a1dea90 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -146,6 +146,9 @@ struct ieee80211_low_level_stats { | |||
146 | * enabled/disabled (beaconing modes) | 146 | * enabled/disabled (beaconing modes) |
147 | * @BSS_CHANGED_CQM: Connection quality monitor config changed | 147 | * @BSS_CHANGED_CQM: Connection quality monitor config changed |
148 | * @BSS_CHANGED_IBSS: IBSS join status changed | 148 | * @BSS_CHANGED_IBSS: IBSS join status changed |
149 | * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. | ||
150 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note | ||
151 | * that it is only ever disabled for station mode. | ||
149 | */ | 152 | */ |
150 | enum ieee80211_bss_change { | 153 | enum ieee80211_bss_change { |
151 | BSS_CHANGED_ASSOC = 1<<0, | 154 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -160,10 +163,19 @@ enum ieee80211_bss_change { | |||
160 | BSS_CHANGED_BEACON_ENABLED = 1<<9, | 163 | BSS_CHANGED_BEACON_ENABLED = 1<<9, |
161 | BSS_CHANGED_CQM = 1<<10, | 164 | BSS_CHANGED_CQM = 1<<10, |
162 | BSS_CHANGED_IBSS = 1<<11, | 165 | BSS_CHANGED_IBSS = 1<<11, |
166 | BSS_CHANGED_ARP_FILTER = 1<<12, | ||
167 | BSS_CHANGED_QOS = 1<<13, | ||
163 | 168 | ||
164 | /* when adding here, make sure to change ieee80211_reconfig */ | 169 | /* when adding here, make sure to change ieee80211_reconfig */ |
165 | }; | 170 | }; |
166 | 171 | ||
172 | /* | ||
173 | * The maximum number of IPv4 addresses listed for ARP filtering. If the number | ||
174 | * of addresses for an interface increase beyond this value, hardware ARP | ||
175 | * filtering will be disabled. | ||
176 | */ | ||
177 | #define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 | ||
178 | |||
167 | /** | 179 | /** |
168 | * struct ieee80211_bss_conf - holds the BSS's changing parameters | 180 | * struct ieee80211_bss_conf - holds the BSS's changing parameters |
169 | * | 181 | * |
@@ -182,7 +194,9 @@ enum ieee80211_bss_change { | |||
182 | * if the hardware cannot handle this it must set the | 194 | * if the hardware cannot handle this it must set the |
183 | * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag | 195 | * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag |
184 | * @dtim_period: num of beacons before the next DTIM, for beaconing, | 196 | * @dtim_period: num of beacons before the next DTIM, for beaconing, |
185 | * not valid in station mode (cf. hw conf ps_dtim_period) | 197 | * valid in station mode only while @assoc is true and if also |
198 | * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf | ||
199 | * @ps_dtim_period) | ||
186 | * @timestamp: beacon timestamp | 200 | * @timestamp: beacon timestamp |
187 | * @beacon_int: beacon interval | 201 | * @beacon_int: beacon interval |
188 | * @assoc_capability: capabilities taken from assoc resp | 202 | * @assoc_capability: capabilities taken from assoc resp |
@@ -199,6 +213,16 @@ enum ieee80211_bss_change { | |||
199 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | 213 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value |
200 | * implies disabled | 214 | * implies disabled |
201 | * @cqm_rssi_hyst: Connection quality monitor RSSI hysteresis | 215 | * @cqm_rssi_hyst: Connection quality monitor RSSI hysteresis |
216 | * @arp_addr_list: List of IPv4 addresses for hardware ARP filtering. The | ||
217 | * may filter ARP queries targeted for other addresses than listed here. | ||
218 | * The driver must allow ARP queries targeted for all address listed here | ||
219 | * to pass through. An empty list implies no ARP queries need to pass. | ||
220 | * @arp_addr_cnt: Number of addresses currently on the list. | ||
221 | * @arp_filter_enabled: Enable ARP filtering - if enabled, the hardware may | ||
222 | * filter ARP queries based on the @arp_addr_list, if disabled, the | ||
223 | * hardware must not perform any ARP filtering. Note, that the filter will | ||
224 | * be enabled also in promiscuous mode. | ||
225 | * @qos: This is a QoS-enabled BSS. | ||
202 | */ | 226 | */ |
203 | struct ieee80211_bss_conf { | 227 | struct ieee80211_bss_conf { |
204 | const u8 *bssid; | 228 | const u8 *bssid; |
@@ -219,6 +243,10 @@ struct ieee80211_bss_conf { | |||
219 | s32 cqm_rssi_thold; | 243 | s32 cqm_rssi_thold; |
220 | u32 cqm_rssi_hyst; | 244 | u32 cqm_rssi_hyst; |
221 | enum nl80211_channel_type channel_type; | 245 | enum nl80211_channel_type channel_type; |
246 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; | ||
247 | u8 arp_addr_cnt; | ||
248 | bool arp_filter_enabled; | ||
249 | bool qos; | ||
222 | }; | 250 | }; |
223 | 251 | ||
224 | /** | 252 | /** |
@@ -312,9 +340,10 @@ enum mac80211_tx_control_flags { | |||
312 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 340 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
313 | IEEE80211_TX_CTL_LDPC = BIT(22), | 341 | IEEE80211_TX_CTL_LDPC = BIT(22), |
314 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | 342 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), |
315 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | ||
316 | }; | 343 | }; |
317 | 344 | ||
345 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | ||
346 | |||
318 | /** | 347 | /** |
319 | * enum mac80211_rate_control_flags - per-rate flags set by the | 348 | * enum mac80211_rate_control_flags - per-rate flags set by the |
320 | * Rate Control algorithm. | 349 | * Rate Control algorithm. |
@@ -390,7 +419,7 @@ struct ieee80211_tx_rate { | |||
390 | s8 idx; | 419 | s8 idx; |
391 | u8 count; | 420 | u8 count; |
392 | u8 flags; | 421 | u8 flags; |
393 | } __attribute__((packed)); | 422 | } __packed; |
394 | 423 | ||
395 | /** | 424 | /** |
396 | * struct ieee80211_tx_info - skb transmit information | 425 | * struct ieee80211_tx_info - skb transmit information |
@@ -412,8 +441,6 @@ struct ieee80211_tx_rate { | |||
412 | * @driver_data: array of driver_data pointers | 441 | * @driver_data: array of driver_data pointers |
413 | * @ampdu_ack_len: number of acked aggregated frames. | 442 | * @ampdu_ack_len: number of acked aggregated frames. |
414 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. | 443 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
415 | * @ampdu_ack_map: block ack bit map for the aggregation. | ||
416 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. | ||
417 | * @ampdu_len: number of aggregated frames. | 444 | * @ampdu_len: number of aggregated frames. |
418 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. | 445 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
419 | * @ack_signal: signal strength of the ACK frame | 446 | * @ack_signal: signal strength of the ACK frame |
@@ -448,10 +475,9 @@ struct ieee80211_tx_info { | |||
448 | struct { | 475 | struct { |
449 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; | 476 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; |
450 | u8 ampdu_ack_len; | 477 | u8 ampdu_ack_len; |
451 | u64 ampdu_ack_map; | ||
452 | int ack_signal; | 478 | int ack_signal; |
453 | u8 ampdu_len; | 479 | u8 ampdu_len; |
454 | /* 7 bytes free */ | 480 | /* 15 bytes free */ |
455 | } status; | 481 | } status; |
456 | struct { | 482 | struct { |
457 | struct ieee80211_tx_rate driver_rates[ | 483 | struct ieee80211_tx_rate driver_rates[ |
@@ -601,15 +627,14 @@ struct ieee80211_rx_status { | |||
601 | * may turn the device off as much as possible. Typically, this flag will | 627 | * may turn the device off as much as possible. Typically, this flag will |
602 | * be set when an interface is set UP but not associated or scanning, but | 628 | * be set when an interface is set UP but not associated or scanning, but |
603 | * it can also be unset in that case when monitor interfaces are active. | 629 | * it can also be unset in that case when monitor interfaces are active. |
604 | * @IEEE80211_CONF_QOS: Enable 802.11e QoS also know as WMM (Wireless | 630 | * @IEEE80211_CONF_OFFCHANNEL: The device is currently not on its main |
605 | * Multimedia). On some drivers (iwlwifi is one of know) we have | 631 | * operating channel. |
606 | * to enable/disable QoS explicitly. | ||
607 | */ | 632 | */ |
608 | enum ieee80211_conf_flags { | 633 | enum ieee80211_conf_flags { |
609 | IEEE80211_CONF_MONITOR = (1<<0), | 634 | IEEE80211_CONF_MONITOR = (1<<0), |
610 | IEEE80211_CONF_PS = (1<<1), | 635 | IEEE80211_CONF_PS = (1<<1), |
611 | IEEE80211_CONF_IDLE = (1<<2), | 636 | IEEE80211_CONF_IDLE = (1<<2), |
612 | IEEE80211_CONF_QOS = (1<<3), | 637 | IEEE80211_CONF_OFFCHANNEL = (1<<3), |
613 | }; | 638 | }; |
614 | 639 | ||
615 | 640 | ||
@@ -624,7 +649,6 @@ enum ieee80211_conf_flags { | |||
624 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed | 649 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed |
625 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed | 650 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed |
626 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed | 651 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed |
627 | * @IEEE80211_CONF_CHANGE_QOS: Quality of service was enabled or disabled | ||
628 | */ | 652 | */ |
629 | enum ieee80211_conf_changed { | 653 | enum ieee80211_conf_changed { |
630 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), | 654 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), |
@@ -635,7 +659,6 @@ enum ieee80211_conf_changed { | |||
635 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), | 659 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), |
636 | IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), | 660 | IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), |
637 | IEEE80211_CONF_CHANGE_IDLE = BIT(8), | 661 | IEEE80211_CONF_CHANGE_IDLE = BIT(8), |
638 | IEEE80211_CONF_CHANGE_QOS = BIT(9), | ||
639 | }; | 662 | }; |
640 | 663 | ||
641 | /** | 664 | /** |
@@ -676,9 +699,6 @@ enum ieee80211_smps_mode { | |||
676 | * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the | 699 | * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the |
677 | * powersave documentation below. This variable is valid only when | 700 | * powersave documentation below. This variable is valid only when |
678 | * the CONF_PS flag is set. | 701 | * the CONF_PS flag is set. |
679 | * @dynamic_ps_forced_timeout: The dynamic powersave timeout (in ms) configured | ||
680 | * by cfg80211 (essentially, wext) If set, this value overrules the value | ||
681 | * chosen by mac80211 based on ps qos network latency. | ||
682 | * | 702 | * |
683 | * @power_level: requested transmit power (in dBm) | 703 | * @power_level: requested transmit power (in dBm) |
684 | * | 704 | * |
@@ -698,7 +718,7 @@ enum ieee80211_smps_mode { | |||
698 | */ | 718 | */ |
699 | struct ieee80211_conf { | 719 | struct ieee80211_conf { |
700 | u32 flags; | 720 | u32 flags; |
701 | int power_level, dynamic_ps_timeout, dynamic_ps_forced_timeout; | 721 | int power_level, dynamic_ps_timeout; |
702 | int max_sleep_period; | 722 | int max_sleep_period; |
703 | 723 | ||
704 | u16 listen_interval; | 724 | u16 listen_interval; |
@@ -815,7 +835,6 @@ enum ieee80211_key_flags { | |||
815 | * encrypted in hardware. | 835 | * encrypted in hardware. |
816 | * @alg: The key algorithm. | 836 | * @alg: The key algorithm. |
817 | * @flags: key flags, see &enum ieee80211_key_flags. | 837 | * @flags: key flags, see &enum ieee80211_key_flags. |
818 | * @ap_addr: AP's MAC address | ||
819 | * @keyidx: the key index (0-3) | 838 | * @keyidx: the key index (0-3) |
820 | * @keylen: key material length | 839 | * @keylen: key material length |
821 | * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte) | 840 | * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte) |
@@ -881,16 +900,12 @@ struct ieee80211_sta { | |||
881 | * enum sta_notify_cmd - sta notify command | 900 | * enum sta_notify_cmd - sta notify command |
882 | * | 901 | * |
883 | * Used with the sta_notify() callback in &struct ieee80211_ops, this | 902 | * Used with the sta_notify() callback in &struct ieee80211_ops, this |
884 | * indicates addition and removal of a station to station table, | 903 | * indicates if an associated station made a power state transition. |
885 | * or if a associated station made a power state transition. | ||
886 | * | 904 | * |
887 | * @STA_NOTIFY_ADD: (DEPRECATED) a station was added to the station table | ||
888 | * @STA_NOTIFY_REMOVE: (DEPRECATED) a station being removed from the station table | ||
889 | * @STA_NOTIFY_SLEEP: a station is now sleeping | 905 | * @STA_NOTIFY_SLEEP: a station is now sleeping |
890 | * @STA_NOTIFY_AWAKE: a sleeping station woke up | 906 | * @STA_NOTIFY_AWAKE: a sleeping station woke up |
891 | */ | 907 | */ |
892 | enum sta_notify_cmd { | 908 | enum sta_notify_cmd { |
893 | STA_NOTIFY_ADD, STA_NOTIFY_REMOVE, | ||
894 | STA_NOTIFY_SLEEP, STA_NOTIFY_AWAKE, | 909 | STA_NOTIFY_SLEEP, STA_NOTIFY_AWAKE, |
895 | }; | 910 | }; |
896 | 911 | ||
@@ -1014,6 +1029,9 @@ enum ieee80211_tkip_key_type { | |||
1014 | * connection quality related parameters, such as the RSSI level and | 1029 | * connection quality related parameters, such as the RSSI level and |
1015 | * provide notifications if configured trigger levels are reached. | 1030 | * provide notifications if configured trigger levels are reached. |
1016 | * | 1031 | * |
1032 | * @IEEE80211_HW_NEED_DTIM_PERIOD: | ||
1033 | * This device needs to know the DTIM period for the BSS before | ||
1034 | * associating. | ||
1017 | */ | 1035 | */ |
1018 | enum ieee80211_hw_flags { | 1036 | enum ieee80211_hw_flags { |
1019 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1037 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
@@ -1023,7 +1041,7 @@ enum ieee80211_hw_flags { | |||
1023 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | 1041 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, |
1024 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, | 1042 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, |
1025 | IEEE80211_HW_SIGNAL_DBM = 1<<6, | 1043 | IEEE80211_HW_SIGNAL_DBM = 1<<6, |
1026 | /* use this hole */ | 1044 | IEEE80211_HW_NEED_DTIM_PERIOD = 1<<7, |
1027 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, | 1045 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, |
1028 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, | 1046 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, |
1029 | IEEE80211_HW_SUPPORTS_PS = 1<<10, | 1047 | IEEE80211_HW_SUPPORTS_PS = 1<<10, |
@@ -1260,6 +1278,15 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1260 | * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS | 1278 | * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS |
1261 | * enabled whenever user has enabled powersave. | 1279 | * enabled whenever user has enabled powersave. |
1262 | * | 1280 | * |
1281 | * Some hardware need to toggle a single shared antenna between WLAN and | ||
1282 | * Bluetooth to facilitate co-existence. These types of hardware set | ||
1283 | * limitations on the use of host controlled dynamic powersave whenever there | ||
1284 | * is simultaneous WLAN and Bluetooth traffic. For these types of hardware, the | ||
1285 | * driver may request temporarily going into full power save, in order to | ||
1286 | * enable toggling the antenna between BT and WLAN. If the driver requests | ||
1287 | * disabling dynamic powersave, the @dynamic_ps_timeout value will be | ||
1288 | * temporarily set to zero until the driver re-enables dynamic powersave. | ||
1289 | * | ||
1263 | * Driver informs U-APSD client support by enabling | 1290 | * Driver informs U-APSD client support by enabling |
1264 | * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the | 1291 | * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the |
1265 | * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS | 1292 | * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS |
@@ -1451,7 +1478,7 @@ enum ieee80211_filter_flags { | |||
1451 | * | 1478 | * |
1452 | * Note that drivers MUST be able to deal with a TX aggregation | 1479 | * Note that drivers MUST be able to deal with a TX aggregation |
1453 | * session being stopped even before they OK'ed starting it by | 1480 | * session being stopped even before they OK'ed starting it by |
1454 | * calling ieee80211_start_tx_ba_cb(_irqsafe), because the peer | 1481 | * calling ieee80211_start_tx_ba_cb_irqsafe, because the peer |
1455 | * might receive the addBA frame and send a delBA right away! | 1482 | * might receive the addBA frame and send a delBA right away! |
1456 | * | 1483 | * |
1457 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation | 1484 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation |
@@ -1636,7 +1663,7 @@ enum ieee80211_ampdu_mlme_action { | |||
1636 | * is the first frame we expect to perform the action on. Notice | 1663 | * is the first frame we expect to perform the action on. Notice |
1637 | * that TX/RX_STOP can pass NULL for this parameter. | 1664 | * that TX/RX_STOP can pass NULL for this parameter. |
1638 | * Returns a negative error code on failure. | 1665 | * Returns a negative error code on failure. |
1639 | * The callback must be atomic. | 1666 | * The callback can sleep. |
1640 | * | 1667 | * |
1641 | * @get_survey: Return per-channel survey information | 1668 | * @get_survey: Return per-channel survey information |
1642 | * | 1669 | * |
@@ -2307,25 +2334,14 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
2307 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); | 2334 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); |
2308 | 2335 | ||
2309 | /** | 2336 | /** |
2310 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. | ||
2311 | * @vif: &struct ieee80211_vif pointer from the add_interface callback | ||
2312 | * @ra: receiver address of the BA session recipient. | ||
2313 | * @tid: the TID to BA on. | ||
2314 | * | ||
2315 | * This function must be called by low level driver once it has | ||
2316 | * finished with preparations for the BA session. | ||
2317 | */ | ||
2318 | void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); | ||
2319 | |||
2320 | /** | ||
2321 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2337 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
2322 | * @vif: &struct ieee80211_vif pointer from the add_interface callback | 2338 | * @vif: &struct ieee80211_vif pointer from the add_interface callback |
2323 | * @ra: receiver address of the BA session recipient. | 2339 | * @ra: receiver address of the BA session recipient. |
2324 | * @tid: the TID to BA on. | 2340 | * @tid: the TID to BA on. |
2325 | * | 2341 | * |
2326 | * This function must be called by low level driver once it has | 2342 | * This function must be called by low level driver once it has |
2327 | * finished with preparations for the BA session. | 2343 | * finished with preparations for the BA session. It can be called |
2328 | * This version of the function is IRQ-safe. | 2344 | * from any context. |
2329 | */ | 2345 | */ |
2330 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, | 2346 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
2331 | u16 tid); | 2347 | u16 tid); |
@@ -2334,27 +2350,14 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, | |||
2334 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. | 2350 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. |
2335 | * @sta: the station whose BA session to stop | 2351 | * @sta: the station whose BA session to stop |
2336 | * @tid: the TID to stop BA. | 2352 | * @tid: the TID to stop BA. |
2337 | * @initiator: if indicates initiator DELBA frame will be sent. | ||
2338 | * | 2353 | * |
2339 | * Return: error if no sta with matching da found, success otherwise | 2354 | * Return: negative error if the TID is invalid, or no aggregation active |
2340 | * | 2355 | * |
2341 | * Although mac80211/low level driver/user space application can estimate | 2356 | * Although mac80211/low level driver/user space application can estimate |
2342 | * the need to stop aggregation on a certain RA/TID, the session level | 2357 | * the need to stop aggregation on a certain RA/TID, the session level |
2343 | * will be managed by the mac80211. | 2358 | * will be managed by the mac80211. |
2344 | */ | 2359 | */ |
2345 | int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid, | 2360 | int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid); |
2346 | enum ieee80211_back_parties initiator); | ||
2347 | |||
2348 | /** | ||
2349 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. | ||
2350 | * @vif: &struct ieee80211_vif pointer from the add_interface callback | ||
2351 | * @ra: receiver address of the BA session recipient. | ||
2352 | * @tid: the desired TID to BA on. | ||
2353 | * | ||
2354 | * This function must be called by low level driver once it has | ||
2355 | * finished with preparations for the BA session tear down. | ||
2356 | */ | ||
2357 | void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); | ||
2358 | 2361 | ||
2359 | /** | 2362 | /** |
2360 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. | 2363 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. |
@@ -2363,8 +2366,8 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); | |||
2363 | * @tid: the desired TID to BA on. | 2366 | * @tid: the desired TID to BA on. |
2364 | * | 2367 | * |
2365 | * This function must be called by low level driver once it has | 2368 | * This function must be called by low level driver once it has |
2366 | * finished with preparations for the BA session tear down. | 2369 | * finished with preparations for the BA session tear down. It |
2367 | * This version of the function is IRQ-safe. | 2370 | * can be called from any context. |
2368 | */ | 2371 | */ |
2369 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, | 2372 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
2370 | u16 tid); | 2373 | u16 tid); |
@@ -2460,6 +2463,36 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif); | |||
2460 | void ieee80211_connection_loss(struct ieee80211_vif *vif); | 2463 | void ieee80211_connection_loss(struct ieee80211_vif *vif); |
2461 | 2464 | ||
2462 | /** | 2465 | /** |
2466 | * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm | ||
2467 | * | ||
2468 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2469 | * | ||
2470 | * Some hardware require full power save to manage simultaneous BT traffic | ||
2471 | * on the WLAN frequency. Full PSM is required periodically, whenever there are | ||
2472 | * burst of BT traffic. The hardware gets information of BT traffic via | ||
2473 | * hardware co-existence lines, and consequentially requests mac80211 to | ||
2474 | * (temporarily) enter full psm. | ||
2475 | * This function will only temporarily disable dynamic PS, not enable PSM if | ||
2476 | * it was not already enabled. | ||
2477 | * The driver must make sure to re-enable dynamic PS using | ||
2478 | * ieee80211_enable_dyn_ps() if the driver has disabled it. | ||
2479 | * | ||
2480 | */ | ||
2481 | void ieee80211_disable_dyn_ps(struct ieee80211_vif *vif); | ||
2482 | |||
2483 | /** | ||
2484 | * ieee80211_enable_dyn_ps - restore dynamic psm after being disabled | ||
2485 | * | ||
2486 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2487 | * | ||
2488 | * This function restores dynamic PS after being temporarily disabled via | ||
2489 | * ieee80211_disable_dyn_ps(). Each ieee80211_disable_dyn_ps() call must | ||
2490 | * be coupled with an eventual call to this function. | ||
2491 | * | ||
2492 | */ | ||
2493 | void ieee80211_enable_dyn_ps(struct ieee80211_vif *vif); | ||
2494 | |||
2495 | /** | ||
2463 | * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring | 2496 | * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring |
2464 | * rssi threshold triggered | 2497 | * rssi threshold triggered |
2465 | * | 2498 | * |
diff --git a/include/net/mip6.h b/include/net/mip6.h index a83ad1982a90..26ba99b5a4b1 100644 --- a/include/net/mip6.h +++ b/include/net/mip6.h | |||
@@ -39,7 +39,7 @@ struct ip6_mh { | |||
39 | __u16 ip6mh_cksum; | 39 | __u16 ip6mh_cksum; |
40 | /* Followed by type specific messages */ | 40 | /* Followed by type specific messages */ |
41 | __u8 data[0]; | 41 | __u8 data[0]; |
42 | } __attribute__ ((__packed__)); | 42 | } __packed; |
43 | 43 | ||
44 | #define IP6_MH_TYPE_BRR 0 /* Binding Refresh Request */ | 44 | #define IP6_MH_TYPE_BRR 0 /* Binding Refresh Request */ |
45 | #define IP6_MH_TYPE_HOTI 1 /* HOTI Message */ | 45 | #define IP6_MH_TYPE_HOTI 1 /* HOTI Message */ |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index f76f22d05721..895997bc2ead 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -82,7 +82,7 @@ struct ra_msg { | |||
82 | struct nd_opt_hdr { | 82 | struct nd_opt_hdr { |
83 | __u8 nd_opt_type; | 83 | __u8 nd_opt_type; |
84 | __u8 nd_opt_len; | 84 | __u8 nd_opt_len; |
85 | } __attribute__((__packed__)); | 85 | } __packed; |
86 | 86 | ||
87 | 87 | ||
88 | extern int ndisc_init(void); | 88 | extern int ndisc_init(void); |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index eb21340a573b..242879b6c4df 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -151,7 +151,7 @@ struct neigh_table { | |||
151 | void (*proxy_redo)(struct sk_buff *skb); | 151 | void (*proxy_redo)(struct sk_buff *skb); |
152 | char *id; | 152 | char *id; |
153 | struct neigh_parms parms; | 153 | struct neigh_parms parms; |
154 | /* HACK. gc_* shoul follow parms without a gap! */ | 154 | /* HACK. gc_* should follow parms without a gap! */ |
155 | int gc_interval; | 155 | int gc_interval; |
156 | int gc_thresh1; | 156 | int gc_thresh1; |
157 | int gc_thresh2; | 157 | int gc_thresh2; |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index bde095f7e845..e624dae54fa4 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -152,11 +152,7 @@ extern struct net init_net; | |||
152 | 152 | ||
153 | static inline struct net *nf_ct_net(const struct nf_conn *ct) | 153 | static inline struct net *nf_ct_net(const struct nf_conn *ct) |
154 | { | 154 | { |
155 | #ifdef CONFIG_NET_NS | 155 | return read_pnet(&ct->ct_net); |
156 | return ct->ct_net; | ||
157 | #else | ||
158 | return &init_net; | ||
159 | #endif | ||
160 | } | 156 | } |
161 | 157 | ||
162 | /* Alter reply tuple (maybe alter helper). */ | 158 | /* Alter reply tuple (maybe alter helper). */ |
@@ -261,7 +257,12 @@ extern s16 (*nf_ct_nat_offset)(const struct nf_conn *ct, | |||
261 | u32 seq); | 257 | u32 seq); |
262 | 258 | ||
263 | /* Fake conntrack entry for untracked connections */ | 259 | /* Fake conntrack entry for untracked connections */ |
264 | extern struct nf_conn nf_conntrack_untracked; | 260 | DECLARE_PER_CPU(struct nf_conn, nf_conntrack_untracked); |
261 | static inline struct nf_conn *nf_ct_untracked_get(void) | ||
262 | { | ||
263 | return &__raw_get_cpu_var(nf_conntrack_untracked); | ||
264 | } | ||
265 | extern void nf_ct_untracked_status_or(unsigned long bits); | ||
265 | 266 | ||
266 | /* Iterate over all conntracks: if iter returns true, it's deleted. */ | 267 | /* Iterate over all conntracks: if iter returns true, it's deleted. */ |
267 | extern void | 268 | extern void |
@@ -289,9 +290,9 @@ static inline int nf_ct_is_dying(struct nf_conn *ct) | |||
289 | return test_bit(IPS_DYING_BIT, &ct->status); | 290 | return test_bit(IPS_DYING_BIT, &ct->status); |
290 | } | 291 | } |
291 | 292 | ||
292 | static inline int nf_ct_is_untracked(const struct sk_buff *skb) | 293 | static inline int nf_ct_is_untracked(const struct nf_conn *ct) |
293 | { | 294 | { |
294 | return (skb->nfct == &nf_conntrack_untracked.ct_general); | 295 | return test_bit(IPS_UNTRACKED_BIT, &ct->status); |
295 | } | 296 | } |
296 | 297 | ||
297 | extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); | 298 | extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); |
diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h index 03e218f0be43..4e9c63a20db2 100644 --- a/include/net/netfilter/nf_conntrack_acct.h +++ b/include/net/netfilter/nf_conntrack_acct.h | |||
@@ -45,6 +45,18 @@ struct nf_conn_counter *nf_ct_acct_ext_add(struct nf_conn *ct, gfp_t gfp) | |||
45 | extern unsigned int | 45 | extern unsigned int |
46 | seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir); | 46 | seq_print_acct(struct seq_file *s, const struct nf_conn *ct, int dir); |
47 | 47 | ||
48 | /* Check if connection tracking accounting is enabled */ | ||
49 | static inline bool nf_ct_acct_enabled(struct net *net) | ||
50 | { | ||
51 | return net->ct.sysctl_acct != 0; | ||
52 | } | ||
53 | |||
54 | /* Enable/disable connection tracking accounting */ | ||
55 | static inline void nf_ct_set_acct(struct net *net, bool enable) | ||
56 | { | ||
57 | net->ct.sysctl_acct = enable; | ||
58 | } | ||
59 | |||
48 | extern int nf_conntrack_acct_init(struct net *net); | 60 | extern int nf_conntrack_acct_init(struct net *net); |
49 | extern void nf_conntrack_acct_fini(struct net *net); | 61 | extern void nf_conntrack_acct_fini(struct net *net); |
50 | 62 | ||
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index 3d7524fba194..aced085132e7 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
@@ -60,7 +60,7 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb) | |||
60 | struct nf_conn *ct = (struct nf_conn *)skb->nfct; | 60 | struct nf_conn *ct = (struct nf_conn *)skb->nfct; |
61 | int ret = NF_ACCEPT; | 61 | int ret = NF_ACCEPT; |
62 | 62 | ||
63 | if (ct && ct != &nf_conntrack_untracked) { | 63 | if (ct && !nf_ct_is_untracked(ct)) { |
64 | if (!nf_ct_is_confirmed(ct)) | 64 | if (!nf_ct_is_confirmed(ct)) |
65 | ret = __nf_conntrack_confirm(skb); | 65 | ret = __nf_conntrack_confirm(skb); |
66 | if (likely(ret == NF_ACCEPT)) | 66 | if (likely(ret == NF_ACCEPT)) |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 32d15bd6efa3..0772d296dfdb 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
@@ -28,9 +28,14 @@ struct nf_ct_ext { | |||
28 | char data[0]; | 28 | char data[0]; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | static inline int nf_ct_ext_exist(const struct nf_conn *ct, u8 id) | 31 | static inline bool __nf_ct_ext_exist(const struct nf_ct_ext *ext, u8 id) |
32 | { | 32 | { |
33 | return (ct->ext && ct->ext->offset[id]); | 33 | return !!ext->offset[id]; |
34 | } | ||
35 | |||
36 | static inline bool nf_ct_ext_exist(const struct nf_conn *ct, u8 id) | ||
37 | { | ||
38 | return (ct->ext && __nf_ct_ext_exist(ct->ext, id)); | ||
34 | } | 39 | } |
35 | 40 | ||
36 | static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id) | 41 | static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id) |
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h index c398017ccfa3..df17bac46bf5 100644 --- a/include/net/netfilter/nf_nat_protocol.h +++ b/include/net/netfilter/nf_nat_protocol.h | |||
@@ -27,9 +27,9 @@ struct nf_nat_protocol { | |||
27 | 27 | ||
28 | /* Alter the per-proto part of the tuple (depending on | 28 | /* Alter the per-proto part of the tuple (depending on |
29 | maniptype), to give a unique tuple in the given range if | 29 | maniptype), to give a unique tuple in the given range if |
30 | possible; return false if not. Per-protocol part of tuple | 30 | possible. Per-protocol part of tuple is initialized to the |
31 | is initialized to the incoming packet. */ | 31 | incoming packet. */ |
32 | bool (*unique_tuple)(struct nf_conntrack_tuple *tuple, | 32 | void (*unique_tuple)(struct nf_conntrack_tuple *tuple, |
33 | const struct nf_nat_range *range, | 33 | const struct nf_nat_range *range, |
34 | enum nf_nat_manip_type maniptype, | 34 | enum nf_nat_manip_type maniptype, |
35 | const struct nf_conn *ct); | 35 | const struct nf_conn *ct); |
@@ -63,7 +63,7 @@ extern bool nf_nat_proto_in_range(const struct nf_conntrack_tuple *tuple, | |||
63 | const union nf_conntrack_man_proto *min, | 63 | const union nf_conntrack_man_proto *min, |
64 | const union nf_conntrack_man_proto *max); | 64 | const union nf_conntrack_man_proto *max); |
65 | 65 | ||
66 | extern bool nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple, | 66 | extern void nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple, |
67 | const struct nf_nat_range *range, | 67 | const struct nf_nat_range *range, |
68 | enum nf_nat_manip_type maniptype, | 68 | enum nf_nat_manip_type maniptype, |
69 | const struct nf_conn *ct, | 69 | const struct nf_conn *ct, |
diff --git a/include/net/netfilter/nf_nat_rule.h b/include/net/netfilter/nf_nat_rule.h index e4a18ae361c6..2890bdc4cd92 100644 --- a/include/net/netfilter/nf_nat_rule.h +++ b/include/net/netfilter/nf_nat_rule.h | |||
@@ -12,6 +12,4 @@ extern int nf_nat_rule_find(struct sk_buff *skb, | |||
12 | const struct net_device *out, | 12 | const struct net_device *out, |
13 | struct nf_conn *ct); | 13 | struct nf_conn *ct); |
14 | 14 | ||
15 | extern unsigned int | ||
16 | alloc_null_binding(struct nf_conn *ct, unsigned int hooknum); | ||
17 | #endif /* _NF_NAT_RULE_H */ | 15 | #endif /* _NF_NAT_RULE_H */ |
diff --git a/include/net/netfilter/nfnetlink_log.h b/include/net/netfilter/nfnetlink_log.h index b0569ff0775e..e2dec42c2db2 100644 --- a/include/net/netfilter/nfnetlink_log.h +++ b/include/net/netfilter/nfnetlink_log.h | |||
@@ -10,5 +10,7 @@ nfulnl_log_packet(u_int8_t pf, | |||
10 | const struct nf_loginfo *li_user, | 10 | const struct nf_loginfo *li_user, |
11 | const char *prefix); | 11 | const char *prefix); |
12 | 12 | ||
13 | #define NFULNL_COPY_DISABLED 0xff | ||
14 | |||
13 | #endif /* _KER_NFNETLINK_LOG_H */ | 15 | #endif /* _KER_NFNETLINK_LOG_H */ |
14 | 16 | ||
diff --git a/include/net/netfilter/xt_rateest.h b/include/net/netfilter/xt_rateest.h index ddbf37e19616..5a2978d1cb22 100644 --- a/include/net/netfilter/xt_rateest.h +++ b/include/net/netfilter/xt_rateest.h | |||
@@ -2,13 +2,18 @@ | |||
2 | #define _XT_RATEEST_H | 2 | #define _XT_RATEEST_H |
3 | 3 | ||
4 | struct xt_rateest { | 4 | struct xt_rateest { |
5 | /* keep lock and bstats on same cache line to speedup xt_rateest_tg() */ | ||
6 | struct gnet_stats_basic_packed bstats; | ||
7 | spinlock_t lock; | ||
8 | /* keep rstats and lock on same cache line to speedup xt_rateest_mt() */ | ||
9 | struct gnet_stats_rate_est rstats; | ||
10 | |||
11 | /* following fields not accessed in hot path */ | ||
5 | struct hlist_node list; | 12 | struct hlist_node list; |
6 | char name[IFNAMSIZ]; | 13 | char name[IFNAMSIZ]; |
7 | unsigned int refcnt; | 14 | unsigned int refcnt; |
8 | spinlock_t lock; | ||
9 | struct gnet_estimator params; | 15 | struct gnet_estimator params; |
10 | struct gnet_stats_rate_est rstats; | 16 | struct rcu_head rcu; |
11 | struct gnet_stats_basic_packed bstats; | ||
12 | }; | 17 | }; |
13 | 18 | ||
14 | extern struct xt_rateest *xt_rateest_lookup(const char *name); | 19 | extern struct xt_rateest *xt_rateest_lookup(const char *name); |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 4fc05b58503e..f3b201d335b3 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -35,7 +35,7 @@ | |||
35 | * nlmsg_new() create a new netlink message | 35 | * nlmsg_new() create a new netlink message |
36 | * nlmsg_put() add a netlink message to an skb | 36 | * nlmsg_put() add a netlink message to an skb |
37 | * nlmsg_put_answer() callback based nlmsg_put() | 37 | * nlmsg_put_answer() callback based nlmsg_put() |
38 | * nlmsg_end() finanlize netlink message | 38 | * nlmsg_end() finalize netlink message |
39 | * nlmsg_get_pos() return current position in message | 39 | * nlmsg_get_pos() return current position in message |
40 | * nlmsg_trim() trim part of message | 40 | * nlmsg_trim() trim part of message |
41 | * nlmsg_cancel() cancel message construction | 41 | * nlmsg_cancel() cancel message construction |
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index d7b989ca3d63..2d16783d5e20 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
@@ -34,6 +34,7 @@ struct phonet_device { | |||
34 | struct list_head list; | 34 | struct list_head list; |
35 | struct net_device *netdev; | 35 | struct net_device *netdev; |
36 | DECLARE_BITMAP(addrs, 64); | 36 | DECLARE_BITMAP(addrs, 64); |
37 | struct rcu_head rcu; | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | int phonet_device_init(void); | 40 | int phonet_device_init(void); |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 9d4d87cc970e..d9549af6929a 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -95,7 +95,7 @@ extern void __qdisc_run(struct Qdisc *q); | |||
95 | 95 | ||
96 | static inline void qdisc_run(struct Qdisc *q) | 96 | static inline void qdisc_run(struct Qdisc *q) |
97 | { | 97 | { |
98 | if (!test_and_set_bit(__QDISC_STATE_RUNNING, &q->state)) | 98 | if (qdisc_run_begin(q)) |
99 | __qdisc_run(q); | 99 | __qdisc_run(q); |
100 | } | 100 | } |
101 | 101 | ||
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index f873ee37f7e4..9e103a4e91ee 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
@@ -54,7 +54,6 @@ struct regulatory_request { | |||
54 | enum nl80211_reg_initiator initiator; | 54 | enum nl80211_reg_initiator initiator; |
55 | char alpha2[2]; | 55 | char alpha2[2]; |
56 | bool intersect; | 56 | bool intersect; |
57 | u32 country_ie_checksum; | ||
58 | enum environment_cap country_ie_env; | 57 | enum environment_cap country_ie_env; |
59 | struct list_head list; | 58 | struct list_head list; |
60 | }; | 59 | }; |
diff --git a/include/net/route.h b/include/net/route.h index af6cf4b4c9dc..bd732d62e1c3 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -50,9 +50,7 @@ | |||
50 | struct fib_nh; | 50 | struct fib_nh; |
51 | struct inet_peer; | 51 | struct inet_peer; |
52 | struct rtable { | 52 | struct rtable { |
53 | union { | 53 | struct dst_entry dst; |
54 | struct dst_entry dst; | ||
55 | } u; | ||
56 | 54 | ||
57 | /* Cache lookup keys */ | 55 | /* Cache lookup keys */ |
58 | struct flowi fl; | 56 | struct flowi fl; |
@@ -144,7 +142,7 @@ extern void fib_add_ifaddr(struct in_ifaddr *); | |||
144 | static inline void ip_rt_put(struct rtable * rt) | 142 | static inline void ip_rt_put(struct rtable * rt) |
145 | { | 143 | { |
146 | if (rt) | 144 | if (rt) |
147 | dst_release(&rt->u.dst); | 145 | dst_release(&rt->dst); |
148 | } | 146 | } |
149 | 147 | ||
150 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) | 148 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 433604bb3fe8..3c8728aaab4e 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -23,11 +23,17 @@ struct qdisc_rate_table { | |||
23 | }; | 23 | }; |
24 | 24 | ||
25 | enum qdisc_state_t { | 25 | enum qdisc_state_t { |
26 | __QDISC_STATE_RUNNING, | ||
27 | __QDISC_STATE_SCHED, | 26 | __QDISC_STATE_SCHED, |
28 | __QDISC_STATE_DEACTIVATED, | 27 | __QDISC_STATE_DEACTIVATED, |
29 | }; | 28 | }; |
30 | 29 | ||
30 | /* | ||
31 | * following bits are only changed while qdisc lock is held | ||
32 | */ | ||
33 | enum qdisc___state_t { | ||
34 | __QDISC___STATE_RUNNING, | ||
35 | }; | ||
36 | |||
31 | struct qdisc_size_table { | 37 | struct qdisc_size_table { |
32 | struct list_head list; | 38 | struct list_head list; |
33 | struct tc_sizespec szopts; | 39 | struct tc_sizespec szopts; |
@@ -72,10 +78,27 @@ struct Qdisc { | |||
72 | unsigned long state; | 78 | unsigned long state; |
73 | struct sk_buff_head q; | 79 | struct sk_buff_head q; |
74 | struct gnet_stats_basic_packed bstats; | 80 | struct gnet_stats_basic_packed bstats; |
81 | unsigned long __state; | ||
75 | struct gnet_stats_queue qstats; | 82 | struct gnet_stats_queue qstats; |
76 | struct rcu_head rcu_head; | 83 | struct rcu_head rcu_head; |
84 | spinlock_t busylock; | ||
77 | }; | 85 | }; |
78 | 86 | ||
87 | static inline bool qdisc_is_running(struct Qdisc *qdisc) | ||
88 | { | ||
89 | return test_bit(__QDISC___STATE_RUNNING, &qdisc->__state); | ||
90 | } | ||
91 | |||
92 | static inline bool qdisc_run_begin(struct Qdisc *qdisc) | ||
93 | { | ||
94 | return !__test_and_set_bit(__QDISC___STATE_RUNNING, &qdisc->__state); | ||
95 | } | ||
96 | |||
97 | static inline void qdisc_run_end(struct Qdisc *qdisc) | ||
98 | { | ||
99 | __clear_bit(__QDISC___STATE_RUNNING, &qdisc->__state); | ||
100 | } | ||
101 | |||
79 | struct Qdisc_class_ops { | 102 | struct Qdisc_class_ops { |
80 | /* Child qdisc manipulation */ | 103 | /* Child qdisc manipulation */ |
81 | struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); | 104 | struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); |
@@ -583,9 +606,16 @@ static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen) | |||
583 | } | 606 | } |
584 | 607 | ||
585 | #ifdef CONFIG_NET_CLS_ACT | 608 | #ifdef CONFIG_NET_CLS_ACT |
586 | static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask) | 609 | static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask, |
610 | int action) | ||
587 | { | 611 | { |
588 | struct sk_buff *n = skb_clone(skb, gfp_mask); | 612 | struct sk_buff *n; |
613 | |||
614 | if ((action == TC_ACT_STOLEN || action == TC_ACT_QUEUED) && | ||
615 | !skb_shared(skb)) | ||
616 | n = skb_get(skb); | ||
617 | else | ||
618 | n = skb_clone(skb, gfp_mask); | ||
589 | 619 | ||
590 | if (n) { | 620 | if (n) { |
591 | n->tc_verd = SET_TC_VERD(n->tc_verd, 0); | 621 | n->tc_verd = SET_TC_VERD(n->tc_verd, 0); |
diff --git a/include/net/scm.h b/include/net/scm.h index 8360e47aa7e3..31656506d967 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -19,8 +19,10 @@ struct scm_fp_list { | |||
19 | }; | 19 | }; |
20 | 20 | ||
21 | struct scm_cookie { | 21 | struct scm_cookie { |
22 | struct ucred creds; /* Skb credentials */ | 22 | struct pid *pid; /* Skb credentials */ |
23 | const struct cred *cred; | ||
23 | struct scm_fp_list *fp; /* Passed files */ | 24 | struct scm_fp_list *fp; /* Passed files */ |
25 | struct ucred creds; /* Skb credentials */ | ||
24 | #ifdef CONFIG_SECURITY_NETWORK | 26 | #ifdef CONFIG_SECURITY_NETWORK |
25 | u32 secid; /* Passed security ID */ | 27 | u32 secid; /* Passed security ID */ |
26 | #endif | 28 | #endif |
@@ -42,8 +44,27 @@ static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_co | |||
42 | { } | 44 | { } |
43 | #endif /* CONFIG_SECURITY_NETWORK */ | 45 | #endif /* CONFIG_SECURITY_NETWORK */ |
44 | 46 | ||
47 | static __inline__ void scm_set_cred(struct scm_cookie *scm, | ||
48 | struct pid *pid, const struct cred *cred) | ||
49 | { | ||
50 | scm->pid = get_pid(pid); | ||
51 | scm->cred = get_cred(cred); | ||
52 | cred_to_ucred(pid, cred, &scm->creds); | ||
53 | } | ||
54 | |||
55 | static __inline__ void scm_destroy_cred(struct scm_cookie *scm) | ||
56 | { | ||
57 | put_pid(scm->pid); | ||
58 | scm->pid = NULL; | ||
59 | |||
60 | if (scm->cred) | ||
61 | put_cred(scm->cred); | ||
62 | scm->cred = NULL; | ||
63 | } | ||
64 | |||
45 | static __inline__ void scm_destroy(struct scm_cookie *scm) | 65 | static __inline__ void scm_destroy(struct scm_cookie *scm) |
46 | { | 66 | { |
67 | scm_destroy_cred(scm); | ||
47 | if (scm && scm->fp) | 68 | if (scm && scm->fp) |
48 | __scm_destroy(scm); | 69 | __scm_destroy(scm); |
49 | } | 70 | } |
@@ -51,10 +72,7 @@ static __inline__ void scm_destroy(struct scm_cookie *scm) | |||
51 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, | 72 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, |
52 | struct scm_cookie *scm) | 73 | struct scm_cookie *scm) |
53 | { | 74 | { |
54 | struct task_struct *p = current; | 75 | scm_set_cred(scm, task_tgid(current), current_cred()); |
55 | scm->creds.uid = current_uid(); | ||
56 | scm->creds.gid = current_gid(); | ||
57 | scm->creds.pid = task_tgid_vnr(p); | ||
58 | scm->fp = NULL; | 76 | scm->fp = NULL; |
59 | unix_get_peersec_dgram(sock, scm); | 77 | unix_get_peersec_dgram(sock, scm); |
60 | if (msg->msg_controllen <= 0) | 78 | if (msg->msg_controllen <= 0) |
@@ -96,6 +114,8 @@ static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, | |||
96 | if (test_bit(SOCK_PASSCRED, &sock->flags)) | 114 | if (test_bit(SOCK_PASSCRED, &sock->flags)) |
97 | put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(scm->creds), &scm->creds); | 115 | put_cmsg(msg, SOL_SOCKET, SCM_CREDENTIALS, sizeof(scm->creds), &scm->creds); |
98 | 116 | ||
117 | scm_destroy_cred(scm); | ||
118 | |||
99 | scm_passec(sock, msg, scm); | 119 | scm_passec(sock, msg, scm); |
100 | 120 | ||
101 | if (!scm->fp) | 121 | if (!scm->fp) |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 4b860116e096..f9e7473613bd 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -443,7 +443,7 @@ struct sctp_signed_cookie { | |||
443 | __u8 signature[SCTP_SECRET_SIZE]; | 443 | __u8 signature[SCTP_SECRET_SIZE]; |
444 | __u32 __pad; /* force sctp_cookie alignment to 64 bits */ | 444 | __u32 __pad; /* force sctp_cookie alignment to 64 bits */ |
445 | struct sctp_cookie c; | 445 | struct sctp_cookie c; |
446 | } __attribute__((packed)); | 446 | } __packed; |
447 | 447 | ||
448 | /* This is another convenience type to allocate memory for address | 448 | /* This is another convenience type to allocate memory for address |
449 | * params for the maximum size and pass such structures around | 449 | * params for the maximum size and pass such structures around |
@@ -488,7 +488,7 @@ typedef struct sctp_sender_hb_info { | |||
488 | union sctp_addr daddr; | 488 | union sctp_addr daddr; |
489 | unsigned long sent_at; | 489 | unsigned long sent_at; |
490 | __u64 hb_nonce; | 490 | __u64 hb_nonce; |
491 | } __attribute__((packed)) sctp_sender_hb_info_t; | 491 | } __packed sctp_sender_hb_info_t; |
492 | 492 | ||
493 | /* | 493 | /* |
494 | * RFC 2960 1.3.2 Sequenced Delivery within Streams | 494 | * RFC 2960 1.3.2 Sequenced Delivery within Streams |
diff --git a/include/net/snmp.h b/include/net/snmp.h index 899003d18db9..a0e61806d480 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -47,15 +47,16 @@ struct snmp_mib { | |||
47 | } | 47 | } |
48 | 48 | ||
49 | /* | 49 | /* |
50 | * We use all unsigned longs. Linux will soon be so reliable that even | 50 | * We use unsigned longs for most mibs but u64 for ipstats. |
51 | * these will rapidly get too small 8-). Seriously consider the IpInReceives | ||
52 | * count on the 20Gb/s + networks people expect in a few years time! | ||
53 | */ | 51 | */ |
52 | #include <linux/u64_stats_sync.h> | ||
54 | 53 | ||
55 | /* IPstats */ | 54 | /* IPstats */ |
56 | #define IPSTATS_MIB_MAX __IPSTATS_MIB_MAX | 55 | #define IPSTATS_MIB_MAX __IPSTATS_MIB_MAX |
57 | struct ipstats_mib { | 56 | struct ipstats_mib { |
58 | unsigned long mibs[IPSTATS_MIB_MAX]; | 57 | /* mibs[] must be first field of struct ipstats_mib */ |
58 | u64 mibs[IPSTATS_MIB_MAX]; | ||
59 | struct u64_stats_sync syncp; | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | /* ICMP */ | 62 | /* ICMP */ |
@@ -155,4 +156,70 @@ struct linux_xfrm_mib { | |||
155 | ptr->mibs[basefield##PKTS]++; \ | 156 | ptr->mibs[basefield##PKTS]++; \ |
156 | ptr->mibs[basefield##OCTETS] += addend;\ | 157 | ptr->mibs[basefield##OCTETS] += addend;\ |
157 | } while (0) | 158 | } while (0) |
159 | |||
160 | |||
161 | #if BITS_PER_LONG==32 | ||
162 | |||
163 | #define SNMP_ADD_STATS64_BH(mib, field, addend) \ | ||
164 | do { \ | ||
165 | __typeof__(*mib[0]) *ptr = __this_cpu_ptr((mib)[0]); \ | ||
166 | u64_stats_update_begin(&ptr->syncp); \ | ||
167 | ptr->mibs[field] += addend; \ | ||
168 | u64_stats_update_end(&ptr->syncp); \ | ||
169 | } while (0) | ||
170 | #define SNMP_ADD_STATS64_USER(mib, field, addend) \ | ||
171 | do { \ | ||
172 | __typeof__(*mib[0]) *ptr; \ | ||
173 | preempt_disable(); \ | ||
174 | ptr = __this_cpu_ptr((mib)[1]); \ | ||
175 | u64_stats_update_begin(&ptr->syncp); \ | ||
176 | ptr->mibs[field] += addend; \ | ||
177 | u64_stats_update_end(&ptr->syncp); \ | ||
178 | preempt_enable(); \ | ||
179 | } while (0) | ||
180 | #define SNMP_ADD_STATS64(mib, field, addend) \ | ||
181 | do { \ | ||
182 | __typeof__(*mib[0]) *ptr; \ | ||
183 | preempt_disable(); \ | ||
184 | ptr = __this_cpu_ptr((mib)[!in_softirq()]); \ | ||
185 | u64_stats_update_begin(&ptr->syncp); \ | ||
186 | ptr->mibs[field] += addend; \ | ||
187 | u64_stats_update_end(&ptr->syncp); \ | ||
188 | preempt_enable(); \ | ||
189 | } while (0) | ||
190 | #define SNMP_INC_STATS64_BH(mib, field) SNMP_ADD_STATS64_BH(mib, field, 1) | ||
191 | #define SNMP_INC_STATS64_USER(mib, field) SNMP_ADD_STATS64_USER(mib, field, 1) | ||
192 | #define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1) | ||
193 | #define SNMP_UPD_PO_STATS64(mib, basefield, addend) \ | ||
194 | do { \ | ||
195 | __typeof__(*mib[0]) *ptr; \ | ||
196 | preempt_disable(); \ | ||
197 | ptr = __this_cpu_ptr((mib)[!in_softirq()]); \ | ||
198 | u64_stats_update_begin(&ptr->syncp); \ | ||
199 | ptr->mibs[basefield##PKTS]++; \ | ||
200 | ptr->mibs[basefield##OCTETS] += addend; \ | ||
201 | u64_stats_update_end(&ptr->syncp); \ | ||
202 | preempt_enable(); \ | ||
203 | } while (0) | ||
204 | #define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) \ | ||
205 | do { \ | ||
206 | __typeof__(*mib[0]) *ptr; \ | ||
207 | ptr = __this_cpu_ptr((mib)[!in_softirq()]); \ | ||
208 | u64_stats_update_begin(&ptr->syncp); \ | ||
209 | ptr->mibs[basefield##PKTS]++; \ | ||
210 | ptr->mibs[basefield##OCTETS] += addend; \ | ||
211 | u64_stats_update_end(&ptr->syncp); \ | ||
212 | } while (0) | ||
213 | #else | ||
214 | #define SNMP_INC_STATS64_BH(mib, field) SNMP_INC_STATS_BH(mib, field) | ||
215 | #define SNMP_INC_STATS64_USER(mib, field) SNMP_INC_STATS_USER(mib, field) | ||
216 | #define SNMP_INC_STATS64(mib, field) SNMP_INC_STATS(mib, field) | ||
217 | #define SNMP_DEC_STATS64(mib, field) SNMP_DEC_STATS(mib, field) | ||
218 | #define SNMP_ADD_STATS64_BH(mib, field, addend) SNMP_ADD_STATS_BH(mib, field, addend) | ||
219 | #define SNMP_ADD_STATS64_USER(mib, field, addend) SNMP_ADD_STATS_USER(mib, field, addend) | ||
220 | #define SNMP_ADD_STATS64(mib, field, addend) SNMP_ADD_STATS(mib, field, addend) | ||
221 | #define SNMP_UPD_PO_STATS64(mib, basefield, addend) SNMP_UPD_PO_STATS(mib, basefield, addend) | ||
222 | #define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) SNMP_UPD_PO_STATS_BH(mib, basefield, addend) | ||
223 | #endif | ||
224 | |||
158 | #endif | 225 | #endif |
diff --git a/include/net/sock.h b/include/net/sock.h index 0a691ea7654a..a441c9cdd625 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -295,7 +295,8 @@ struct sock { | |||
295 | unsigned short sk_ack_backlog; | 295 | unsigned short sk_ack_backlog; |
296 | unsigned short sk_max_ack_backlog; | 296 | unsigned short sk_max_ack_backlog; |
297 | __u32 sk_priority; | 297 | __u32 sk_priority; |
298 | struct ucred sk_peercred; | 298 | struct pid *sk_peer_pid; |
299 | const struct cred *sk_peer_cred; | ||
299 | long sk_rcvtimeo; | 300 | long sk_rcvtimeo; |
300 | long sk_sndtimeo; | 301 | long sk_sndtimeo; |
301 | struct sk_filter *sk_filter; | 302 | struct sk_filter *sk_filter; |
@@ -771,6 +772,7 @@ struct proto { | |||
771 | int *sysctl_wmem; | 772 | int *sysctl_wmem; |
772 | int *sysctl_rmem; | 773 | int *sysctl_rmem; |
773 | int max_header; | 774 | int max_header; |
775 | bool no_autobind; | ||
774 | 776 | ||
775 | struct kmem_cache *slab; | 777 | struct kmem_cache *slab; |
776 | unsigned int obj_size; | 778 | unsigned int obj_size; |
@@ -1706,19 +1708,13 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e | |||
1706 | static inline | 1708 | static inline |
1707 | struct net *sock_net(const struct sock *sk) | 1709 | struct net *sock_net(const struct sock *sk) |
1708 | { | 1710 | { |
1709 | #ifdef CONFIG_NET_NS | 1711 | return read_pnet(&sk->sk_net); |
1710 | return sk->sk_net; | ||
1711 | #else | ||
1712 | return &init_net; | ||
1713 | #endif | ||
1714 | } | 1712 | } |
1715 | 1713 | ||
1716 | static inline | 1714 | static inline |
1717 | void sock_net_set(struct sock *sk, struct net *net) | 1715 | void sock_net_set(struct sock *sk, struct net *net) |
1718 | { | 1716 | { |
1719 | #ifdef CONFIG_NET_NS | 1717 | write_pnet(&sk->sk_net, net); |
1720 | sk->sk_net = net; | ||
1721 | #endif | ||
1722 | } | 1718 | } |
1723 | 1719 | ||
1724 | /* | 1720 | /* |
diff --git a/include/net/tcp.h b/include/net/tcp.h index a1449144848a..df6a2eb20193 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -296,45 +296,30 @@ extern struct proto tcp_prot; | |||
296 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) | 296 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) |
297 | #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) | 297 | #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) |
298 | 298 | ||
299 | extern void tcp_v4_err(struct sk_buff *skb, u32); | 299 | extern void tcp_v4_err(struct sk_buff *skb, u32); |
300 | 300 | ||
301 | extern void tcp_shutdown (struct sock *sk, int how); | 301 | extern void tcp_shutdown (struct sock *sk, int how); |
302 | 302 | ||
303 | extern int tcp_v4_rcv(struct sk_buff *skb); | 303 | extern int tcp_v4_rcv(struct sk_buff *skb); |
304 | 304 | ||
305 | extern int tcp_v4_remember_stamp(struct sock *sk); | 305 | extern int tcp_v4_remember_stamp(struct sock *sk); |
306 | 306 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | |
307 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 307 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
308 | 308 | size_t size); | |
309 | extern int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, | 309 | extern int tcp_sendpage(struct sock *sk, struct page *page, int offset, |
310 | struct msghdr *msg, size_t size); | 310 | size_t size, int flags); |
311 | extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags); | 311 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
312 | 312 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |
313 | extern int tcp_ioctl(struct sock *sk, | 313 | struct tcphdr *th, unsigned len); |
314 | int cmd, | 314 | extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, |
315 | unsigned long arg); | 315 | struct tcphdr *th, unsigned len); |
316 | 316 | extern void tcp_rcv_space_adjust(struct sock *sk); | |
317 | extern int tcp_rcv_state_process(struct sock *sk, | 317 | extern void tcp_cleanup_rbuf(struct sock *sk, int copied); |
318 | struct sk_buff *skb, | 318 | extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); |
319 | struct tcphdr *th, | 319 | extern void tcp_twsk_destructor(struct sock *sk); |
320 | unsigned len); | 320 | extern ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos, |
321 | 321 | struct pipe_inode_info *pipe, size_t len, | |
322 | extern int tcp_rcv_established(struct sock *sk, | 322 | unsigned int flags); |
323 | struct sk_buff *skb, | ||
324 | struct tcphdr *th, | ||
325 | unsigned len); | ||
326 | |||
327 | extern void tcp_rcv_space_adjust(struct sock *sk); | ||
328 | |||
329 | extern void tcp_cleanup_rbuf(struct sock *sk, int copied); | ||
330 | |||
331 | extern int tcp_twsk_unique(struct sock *sk, | ||
332 | struct sock *sktw, void *twp); | ||
333 | |||
334 | extern void tcp_twsk_destructor(struct sock *sk); | ||
335 | |||
336 | extern ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos, | ||
337 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); | ||
338 | 323 | ||
339 | static inline void tcp_dec_quickack_mode(struct sock *sk, | 324 | static inline void tcp_dec_quickack_mode(struct sock *sk, |
340 | const unsigned int pkts) | 325 | const unsigned int pkts) |
@@ -372,88 +357,59 @@ enum tcp_tw_status { | |||
372 | }; | 357 | }; |
373 | 358 | ||
374 | 359 | ||
375 | extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw, | 360 | extern enum tcp_tw_status tcp_timewait_state_process(struct inet_timewait_sock *tw, |
376 | struct sk_buff *skb, | 361 | struct sk_buff *skb, |
377 | const struct tcphdr *th); | 362 | const struct tcphdr *th); |
378 | 363 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, | |
379 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, | 364 | struct request_sock *req, |
380 | struct request_sock *req, | 365 | struct request_sock **prev); |
381 | struct request_sock **prev); | 366 | extern int tcp_child_process(struct sock *parent, struct sock *child, |
382 | extern int tcp_child_process(struct sock *parent, | 367 | struct sk_buff *skb); |
383 | struct sock *child, | 368 | extern int tcp_use_frto(struct sock *sk); |
384 | struct sk_buff *skb); | 369 | extern void tcp_enter_frto(struct sock *sk); |
385 | extern int tcp_use_frto(struct sock *sk); | 370 | extern void tcp_enter_loss(struct sock *sk, int how); |
386 | extern void tcp_enter_frto(struct sock *sk); | 371 | extern void tcp_clear_retrans(struct tcp_sock *tp); |
387 | extern void tcp_enter_loss(struct sock *sk, int how); | 372 | extern void tcp_update_metrics(struct sock *sk); |
388 | extern void tcp_clear_retrans(struct tcp_sock *tp); | 373 | extern void tcp_close(struct sock *sk, long timeout); |
389 | extern void tcp_update_metrics(struct sock *sk); | 374 | extern unsigned int tcp_poll(struct file * file, struct socket *sock, |
390 | 375 | struct poll_table_struct *wait); | |
391 | extern void tcp_close(struct sock *sk, | 376 | extern int tcp_getsockopt(struct sock *sk, int level, int optname, |
392 | long timeout); | 377 | char __user *optval, int __user *optlen); |
393 | extern unsigned int tcp_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait); | 378 | extern int tcp_setsockopt(struct sock *sk, int level, int optname, |
394 | 379 | char __user *optval, unsigned int optlen); | |
395 | extern int tcp_getsockopt(struct sock *sk, int level, | 380 | extern int compat_tcp_getsockopt(struct sock *sk, int level, int optname, |
396 | int optname, | 381 | char __user *optval, int __user *optlen); |
397 | char __user *optval, | 382 | extern int compat_tcp_setsockopt(struct sock *sk, int level, int optname, |
398 | int __user *optlen); | 383 | char __user *optval, unsigned int optlen); |
399 | extern int tcp_setsockopt(struct sock *sk, int level, | 384 | extern void tcp_set_keepalive(struct sock *sk, int val); |
400 | int optname, char __user *optval, | 385 | extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req); |
401 | unsigned int optlen); | 386 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
402 | extern int compat_tcp_getsockopt(struct sock *sk, | 387 | size_t len, int nonblock, int flags, int *addr_len); |
403 | int level, int optname, | 388 | extern void tcp_parse_options(struct sk_buff *skb, |
404 | char __user *optval, int __user *optlen); | 389 | struct tcp_options_received *opt_rx, u8 **hvpp, |
405 | extern int compat_tcp_setsockopt(struct sock *sk, | 390 | int estab); |
406 | int level, int optname, | 391 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); |
407 | char __user *optval, unsigned int optlen); | ||
408 | extern void tcp_set_keepalive(struct sock *sk, int val); | ||
409 | extern void tcp_syn_ack_timeout(struct sock *sk, | ||
410 | struct request_sock *req); | ||
411 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, | ||
412 | struct msghdr *msg, | ||
413 | size_t len, int nonblock, | ||
414 | int flags, int *addr_len); | ||
415 | |||
416 | extern void tcp_parse_options(struct sk_buff *skb, | ||
417 | struct tcp_options_received *opt_rx, | ||
418 | u8 **hvpp, | ||
419 | int estab); | ||
420 | |||
421 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); | ||
422 | 392 | ||
423 | /* | 393 | /* |
424 | * TCP v4 functions exported for the inet6 API | 394 | * TCP v4 functions exported for the inet6 API |
425 | */ | 395 | */ |
426 | 396 | ||
427 | extern void tcp_v4_send_check(struct sock *sk, | 397 | extern void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb); |
428 | struct sk_buff *skb); | 398 | extern int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb); |
429 | 399 | extern struct sock * tcp_create_openreq_child(struct sock *sk, | |
430 | extern int tcp_v4_conn_request(struct sock *sk, | 400 | struct request_sock *req, |
431 | struct sk_buff *skb); | ||
432 | |||
433 | extern struct sock * tcp_create_openreq_child(struct sock *sk, | ||
434 | struct request_sock *req, | ||
435 | struct sk_buff *skb); | ||
436 | |||
437 | extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, | ||
438 | struct sk_buff *skb, | ||
439 | struct request_sock *req, | ||
440 | struct dst_entry *dst); | ||
441 | |||
442 | extern int tcp_v4_do_rcv(struct sock *sk, | ||
443 | struct sk_buff *skb); | 401 | struct sk_buff *skb); |
444 | 402 | extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |
445 | extern int tcp_v4_connect(struct sock *sk, | 403 | struct request_sock *req, |
446 | struct sockaddr *uaddr, | 404 | struct dst_entry *dst); |
447 | int addr_len); | 405 | extern int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb); |
448 | 406 | extern int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, | |
449 | extern int tcp_connect(struct sock *sk); | 407 | int addr_len); |
450 | 408 | extern int tcp_connect(struct sock *sk); | |
451 | extern struct sk_buff * tcp_make_synack(struct sock *sk, | 409 | extern struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, |
452 | struct dst_entry *dst, | 410 | struct request_sock *req, |
453 | struct request_sock *req, | 411 | struct request_values *rvp); |
454 | struct request_values *rvp); | 412 | extern int tcp_disconnect(struct sock *sk, int flags); |
455 | |||
456 | extern int tcp_disconnect(struct sock *sk, int flags); | ||
457 | 413 | ||
458 | 414 | ||
459 | /* From syncookies.c */ | 415 | /* From syncookies.c */ |
@@ -464,7 +420,7 @@ extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, | |||
464 | __u16 *mss); | 420 | __u16 *mss); |
465 | 421 | ||
466 | extern __u32 cookie_init_timestamp(struct request_sock *req); | 422 | extern __u32 cookie_init_timestamp(struct request_sock *req); |
467 | extern void cookie_check_timestamp(struct tcp_options_received *tcp_opt); | 423 | extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); |
468 | 424 | ||
469 | /* From net/ipv6/syncookies.c */ | 425 | /* From net/ipv6/syncookies.c */ |
470 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); | 426 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); |
@@ -485,10 +441,10 @@ extern int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int); | |||
485 | 441 | ||
486 | extern void tcp_send_probe0(struct sock *); | 442 | extern void tcp_send_probe0(struct sock *); |
487 | extern void tcp_send_partial(struct sock *); | 443 | extern void tcp_send_partial(struct sock *); |
488 | extern int tcp_write_wakeup(struct sock *); | 444 | extern int tcp_write_wakeup(struct sock *); |
489 | extern void tcp_send_fin(struct sock *sk); | 445 | extern void tcp_send_fin(struct sock *sk); |
490 | extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); | 446 | extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); |
491 | extern int tcp_send_synack(struct sock *); | 447 | extern int tcp_send_synack(struct sock *); |
492 | extern void tcp_push_one(struct sock *, unsigned int mss_now); | 448 | extern void tcp_push_one(struct sock *, unsigned int mss_now); |
493 | extern void tcp_send_ack(struct sock *sk); | 449 | extern void tcp_send_ack(struct sock *sk); |
494 | extern void tcp_send_delayed_ack(struct sock *sk); | 450 | extern void tcp_send_delayed_ack(struct sock *sk); |
@@ -592,7 +548,7 @@ static inline u32 tcp_receive_window(const struct tcp_sock *tp) | |||
592 | * scaling applied to the result. The caller does these things | 548 | * scaling applied to the result. The caller does these things |
593 | * if necessary. This is a "raw" window selection. | 549 | * if necessary. This is a "raw" window selection. |
594 | */ | 550 | */ |
595 | extern u32 __tcp_select_window(struct sock *sk); | 551 | extern u32 __tcp_select_window(struct sock *sk); |
596 | 552 | ||
597 | /* TCP timestamps are only 32-bits, this causes a slight | 553 | /* TCP timestamps are only 32-bits, this causes a slight |
598 | * complication on 64-bit systems since we store a snapshot | 554 | * complication on 64-bit systems since we store a snapshot |
@@ -602,12 +558,22 @@ extern u32 __tcp_select_window(struct sock *sk); | |||
602 | */ | 558 | */ |
603 | #define tcp_time_stamp ((__u32)(jiffies)) | 559 | #define tcp_time_stamp ((__u32)(jiffies)) |
604 | 560 | ||
561 | #define tcp_flag_byte(th) (((u_int8_t *)th)[13]) | ||
562 | |||
563 | #define TCPHDR_FIN 0x01 | ||
564 | #define TCPHDR_SYN 0x02 | ||
565 | #define TCPHDR_RST 0x04 | ||
566 | #define TCPHDR_PSH 0x08 | ||
567 | #define TCPHDR_ACK 0x10 | ||
568 | #define TCPHDR_URG 0x20 | ||
569 | #define TCPHDR_ECE 0x40 | ||
570 | #define TCPHDR_CWR 0x80 | ||
571 | |||
605 | /* This is what the send packet queuing engine uses to pass | 572 | /* This is what the send packet queuing engine uses to pass |
606 | * TCP per-packet control information to the transmission | 573 | * TCP per-packet control information to the transmission code. |
607 | * code. We also store the host-order sequence numbers in | 574 | * We also store the host-order sequence numbers in here too. |
608 | * here too. This is 36 bytes on 32-bit architectures, | 575 | * This is 44 bytes if IPV6 is enabled. |
609 | * 40 bytes on 64-bit machines, if this grows please adjust | 576 | * If this grows please adjust skbuff.h:skbuff->cb[xxx] size appropriately. |
610 | * skbuff.h:skbuff->cb[xxx] size appropriately. | ||
611 | */ | 577 | */ |
612 | struct tcp_skb_cb { | 578 | struct tcp_skb_cb { |
613 | union { | 579 | union { |
@@ -620,19 +586,6 @@ struct tcp_skb_cb { | |||
620 | __u32 end_seq; /* SEQ + FIN + SYN + datalen */ | 586 | __u32 end_seq; /* SEQ + FIN + SYN + datalen */ |
621 | __u32 when; /* used to compute rtt's */ | 587 | __u32 when; /* used to compute rtt's */ |
622 | __u8 flags; /* TCP header flags. */ | 588 | __u8 flags; /* TCP header flags. */ |
623 | |||
624 | /* NOTE: These must match up to the flags byte in a | ||
625 | * real TCP header. | ||
626 | */ | ||
627 | #define TCPCB_FLAG_FIN 0x01 | ||
628 | #define TCPCB_FLAG_SYN 0x02 | ||
629 | #define TCPCB_FLAG_RST 0x04 | ||
630 | #define TCPCB_FLAG_PSH 0x08 | ||
631 | #define TCPCB_FLAG_ACK 0x10 | ||
632 | #define TCPCB_FLAG_URG 0x20 | ||
633 | #define TCPCB_FLAG_ECE 0x40 | ||
634 | #define TCPCB_FLAG_CWR 0x80 | ||
635 | |||
636 | __u8 sacked; /* State flags for SACK/FACK. */ | 589 | __u8 sacked; /* State flags for SACK/FACK. */ |
637 | #define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */ | 590 | #define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */ |
638 | #define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ | 591 | #define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ |
@@ -1176,22 +1129,14 @@ struct tcp_md5sig_pool { | |||
1176 | #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ | 1129 | #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ |
1177 | 1130 | ||
1178 | /* - functions */ | 1131 | /* - functions */ |
1179 | extern int tcp_v4_md5_hash_skb(char *md5_hash, | 1132 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, |
1180 | struct tcp_md5sig_key *key, | 1133 | struct sock *sk, struct request_sock *req, |
1181 | struct sock *sk, | 1134 | struct sk_buff *skb); |
1182 | struct request_sock *req, | 1135 | extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk, |
1183 | struct sk_buff *skb); | 1136 | struct sock *addr_sk); |
1184 | 1137 | extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey, | |
1185 | extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, | 1138 | u8 newkeylen); |
1186 | struct sock *addr_sk); | 1139 | extern int tcp_v4_md5_do_del(struct sock *sk, __be32 addr); |
1187 | |||
1188 | extern int tcp_v4_md5_do_add(struct sock *sk, | ||
1189 | __be32 addr, | ||
1190 | u8 *newkey, | ||
1191 | u8 newkeylen); | ||
1192 | |||
1193 | extern int tcp_v4_md5_do_del(struct sock *sk, | ||
1194 | __be32 addr); | ||
1195 | 1140 | ||
1196 | #ifdef CONFIG_TCP_MD5SIG | 1141 | #ifdef CONFIG_TCP_MD5SIG |
1197 | #define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \ | 1142 | #define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \ |
@@ -1204,10 +1149,10 @@ extern int tcp_v4_md5_do_del(struct sock *sk, | |||
1204 | #endif | 1149 | #endif |
1205 | 1150 | ||
1206 | extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); | 1151 | extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); |
1207 | extern void tcp_free_md5sig_pool(void); | 1152 | extern void tcp_free_md5sig_pool(void); |
1208 | 1153 | ||
1209 | extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); | 1154 | extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); |
1210 | extern void tcp_put_md5sig_pool(void); | 1155 | extern void tcp_put_md5sig_pool(void); |
1211 | 1156 | ||
1212 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); | 1157 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); |
1213 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, | 1158 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, |
@@ -1413,7 +1358,8 @@ struct tcp_iter_state { | |||
1413 | sa_family_t family; | 1358 | sa_family_t family; |
1414 | enum tcp_seq_states state; | 1359 | enum tcp_seq_states state; |
1415 | struct sock *syn_wait_sk; | 1360 | struct sock *syn_wait_sk; |
1416 | int bucket, sbucket, num, uid; | 1361 | int bucket, offset, sbucket, num, uid; |
1362 | loff_t last_pos; | ||
1417 | }; | 1363 | }; |
1418 | 1364 | ||
1419 | extern int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo); | 1365 | extern int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo); |
@@ -1434,7 +1380,7 @@ extern int tcp_gro_complete(struct sk_buff *skb); | |||
1434 | extern int tcp4_gro_complete(struct sk_buff *skb); | 1380 | extern int tcp4_gro_complete(struct sk_buff *skb); |
1435 | 1381 | ||
1436 | #ifdef CONFIG_PROC_FS | 1382 | #ifdef CONFIG_PROC_FS |
1437 | extern int tcp4_proc_init(void); | 1383 | extern int tcp4_proc_init(void); |
1438 | extern void tcp4_proc_exit(void); | 1384 | extern void tcp4_proc_exit(void); |
1439 | #endif | 1385 | #endif |
1440 | 1386 | ||
diff --git a/include/net/udp.h b/include/net/udp.h index 5348d80b25bb..7abdf305da50 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -157,30 +157,28 @@ static inline void udp_lib_close(struct sock *sk, long timeout) | |||
157 | sk_common_release(sk); | 157 | sk_common_release(sk); |
158 | } | 158 | } |
159 | 159 | ||
160 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, | 160 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, |
161 | int (*)(const struct sock *,const struct sock *), | 161 | int (*)(const struct sock *,const struct sock *), |
162 | unsigned int hash2_nulladdr); | 162 | unsigned int hash2_nulladdr); |
163 | 163 | ||
164 | /* net/ipv4/udp.c */ | 164 | /* net/ipv4/udp.c */ |
165 | extern int udp_get_port(struct sock *sk, unsigned short snum, | 165 | extern int udp_get_port(struct sock *sk, unsigned short snum, |
166 | int (*saddr_cmp)(const struct sock *, const struct sock *)); | 166 | int (*saddr_cmp)(const struct sock *, |
167 | extern void udp_err(struct sk_buff *, u32); | 167 | const struct sock *)); |
168 | 168 | extern void udp_err(struct sk_buff *, u32); | |
169 | extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, | 169 | extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, |
170 | struct msghdr *msg, size_t len); | 170 | struct msghdr *msg, size_t len); |
171 | extern void udp_flush_pending_frames(struct sock *sk); | 171 | extern void udp_flush_pending_frames(struct sock *sk); |
172 | 172 | extern int udp_rcv(struct sk_buff *skb); | |
173 | extern int udp_rcv(struct sk_buff *skb); | 173 | extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
174 | extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 174 | extern int udp_disconnect(struct sock *sk, int flags); |
175 | extern int udp_disconnect(struct sock *sk, int flags); | ||
176 | extern unsigned int udp_poll(struct file *file, struct socket *sock, | 175 | extern unsigned int udp_poll(struct file *file, struct socket *sock, |
177 | poll_table *wait); | 176 | poll_table *wait); |
178 | extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, | 177 | extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, |
179 | char __user *optval, int __user *optlen); | 178 | char __user *optval, int __user *optlen); |
180 | extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, | 179 | extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, |
181 | char __user *optval, unsigned int optlen, | 180 | char __user *optval, unsigned int optlen, |
182 | int (*push_pending_frames)(struct sock *)); | 181 | int (*push_pending_frames)(struct sock *)); |
183 | |||
184 | extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, | 182 | extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, |
185 | __be32 daddr, __be16 dport, | 183 | __be32 daddr, __be16 dport, |
186 | int dif); | 184 | int dif); |
@@ -236,7 +234,7 @@ struct udp_iter_state { | |||
236 | extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); | 234 | extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo); |
237 | extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); | 235 | extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo); |
238 | 236 | ||
239 | extern int udp4_proc_init(void); | 237 | extern int udp4_proc_init(void); |
240 | extern void udp4_proc_exit(void); | 238 | extern void udp4_proc_exit(void); |
241 | #endif | 239 | #endif |
242 | 240 | ||
diff --git a/include/rxrpc/packet.h b/include/rxrpc/packet.h index b69e6e173ea1..9b2c30897e50 100644 --- a/include/rxrpc/packet.h +++ b/include/rxrpc/packet.h | |||
@@ -65,7 +65,7 @@ struct rxrpc_header { | |||
65 | }; | 65 | }; |
66 | __be16 serviceId; /* service ID */ | 66 | __be16 serviceId; /* service ID */ |
67 | 67 | ||
68 | } __attribute__((packed)); | 68 | } __packed; |
69 | 69 | ||
70 | #define __rxrpc_header_off(X) offsetof(struct rxrpc_header,X) | 70 | #define __rxrpc_header_off(X) offsetof(struct rxrpc_header,X) |
71 | 71 | ||
@@ -120,7 +120,7 @@ struct rxrpc_ackpacket { | |||
120 | #define RXRPC_ACK_TYPE_NACK 0 | 120 | #define RXRPC_ACK_TYPE_NACK 0 |
121 | #define RXRPC_ACK_TYPE_ACK 1 | 121 | #define RXRPC_ACK_TYPE_ACK 1 |
122 | 122 | ||
123 | } __attribute__((packed)); | 123 | } __packed; |
124 | 124 | ||
125 | /* | 125 | /* |
126 | * ACK packets can have a further piece of information tagged on the end | 126 | * ACK packets can have a further piece of information tagged on the end |
@@ -141,7 +141,7 @@ struct rxkad_challenge { | |||
141 | __be32 nonce; /* encrypted random number */ | 141 | __be32 nonce; /* encrypted random number */ |
142 | __be32 min_level; /* minimum security level */ | 142 | __be32 min_level; /* minimum security level */ |
143 | __be32 __padding; /* padding to 8-byte boundary */ | 143 | __be32 __padding; /* padding to 8-byte boundary */ |
144 | } __attribute__((packed)); | 144 | } __packed; |
145 | 145 | ||
146 | /*****************************************************************************/ | 146 | /*****************************************************************************/ |
147 | /* | 147 | /* |
@@ -164,7 +164,7 @@ struct rxkad_response { | |||
164 | 164 | ||
165 | __be32 kvno; /* Kerberos key version number */ | 165 | __be32 kvno; /* Kerberos key version number */ |
166 | __be32 ticket_len; /* Kerberos ticket length */ | 166 | __be32 ticket_len; /* Kerberos ticket length */ |
167 | } __attribute__((packed)); | 167 | } __packed; |
168 | 168 | ||
169 | /*****************************************************************************/ | 169 | /*****************************************************************************/ |
170 | /* | 170 | /* |