aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 21:07:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 21:07:07 -0500
commit6be35c700f742e911ecedd07fcc43d4439922334 (patch)
treeca9f37214d204465fcc2d79c82efd291e357c53c /include
parente37aa63e87bd581f9be5555ed0ba83f5295c92fc (diff)
parent520dfe3a3645257bf83660f672c47f8558f3d4c4 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking changes from David Miller: 1) Allow to dump, monitor, and change the bridge multicast database using netlink. From Cong Wang. 2) RFC 5961 TCP blind data injection attack mitigation, from Eric Dumazet. 3) Networking user namespace support from Eric W. Biederman. 4) tuntap/virtio-net multiqueue support by Jason Wang. 5) Support for checksum offload of encapsulated packets (basically, tunneled traffic can still be checksummed by HW). From Joseph Gasparakis. 6) Allow BPF filter access to VLAN tags, from Eric Dumazet and Daniel Borkmann. 7) Bridge port parameters over netlink and BPDU blocking support from Stephen Hemminger. 8) Improve data access patterns during inet socket demux by rearranging socket layout, from Eric Dumazet. 9) TIPC protocol updates and cleanups from Ying Xue, Paul Gortmaker, and Jon Maloy. 10) Update TCP socket hash sizing to be more in line with current day realities. The existing heurstics were choosen a decade ago. From Eric Dumazet. 11) Fix races, queue bloat, and excessive wakeups in ATM and associated drivers, from Krzysztof Mazur and David Woodhouse. 12) Support DOVE (Distributed Overlay Virtual Ethernet) extensions in VXLAN driver, from David Stevens. 13) Add "oops_only" mode to netconsole, from Amerigo Wang. 14) Support set and query of VEB/VEPA bridge mode via PF_BRIDGE, also allow DCB netlink to work on namespaces other than the initial namespace. From John Fastabend. 15) Support PTP in the Tigon3 driver, from Matt Carlson. 16) tun/vhost zero copy fixes and improvements, plus turn it on by default, from Michael S. Tsirkin. 17) Support per-association statistics in SCTP, from Michele Baldessari. And many, many, driver updates, cleanups, and improvements. Too numerous to mention individually. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1722 commits) net/mlx4_en: Add support for destination MAC in steering rules net/mlx4_en: Use generic etherdevice.h functions. net: ethtool: Add destination MAC address to flow steering API bridge: add support of adding and deleting mdb entries bridge: notify mdb changes via netlink ndisc: Unexport ndisc_{build,send}_skb(). uapi: add missing netconf.h to export list pkt_sched: avoid requeues if possible solos-pci: fix double-free of TX skb in DMA mode bnx2: Fix accidental reversions. bna: Driver Version Updated to 3.1.2.1 bna: Firmware update bna: Add RX State bna: Rx Page Based Allocation bna: TX Intr Coalescing Fix bna: Tx and Rx Optimizations bna: Code Cleanup and Enhancements ath9k: check pdata variable before dereferencing it ath5k: RX timestamp is reported at end of frame ath9k_htc: RX timestamp is reported at end of frame ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/bcm47xx_wdt.h19
-rw-r--r--include/linux/bcma/bcma.h7
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h12
-rw-r--r--include/linux/bcma/bcma_driver_mips.h3
-rw-r--r--include/linux/bcma/bcma_regs.h5
-rw-r--r--include/linux/etherdevice.h20
-rw-r--r--include/linux/filter.h3
-rw-r--r--include/linux/hdlc/Kbuild1
-rw-r--r--include/linux/ieee80211.h188
-rw-r--r--include/linux/if_tunnel.h17
-rw-r--r--include/linux/inetdevice.h3
-rw-r--r--include/linux/ip.h5
-rw-r--r--include/linux/ipv6.h38
-rw-r--r--include/linux/ktime.h19
-rw-r--r--include/linux/micrel_phy.h1
-rw-r--r--include/linux/netdevice.h44
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h9
-rw-r--r--include/linux/nfc/pn544.h104
-rw-r--r--include/linux/openvswitch.h1
-rw-r--r--include/linux/pci.h14
-rw-r--r--include/linux/platform_data/cpsw.h23
-rw-r--r--include/linux/platform_data/macb.h1
-rw-r--r--include/linux/platform_data/pn544.h44
-rw-r--r--include/linux/rtnetlink.h3
-rw-r--r--include/linux/skbuff.h102
-rw-r--r--include/linux/smscphy.h5
-rw-r--r--include/linux/ssb/ssb.h2
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h5
-rw-r--r--include/linux/ssb/ssb_driver_extif.h52
-rw-r--r--include/linux/ssb/ssb_driver_mips.h10
-rw-r--r--include/linux/ssb/ssb_regs.h2
-rw-r--r--include/linux/stmmac.h1
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--include/linux/tcp.h10
-rw-r--r--include/linux/timecompare.h125
-rw-r--r--include/linux/udp.h5
-rw-r--r--include/linux/usb/cdc_ncm.h134
-rw-r--r--include/linux/usb/usbnet.h10
-rw-r--r--include/net/addrconf.h3
-rw-r--r--include/net/af_unix.h1
-rw-r--r--include/net/bluetooth/a2mp.h24
-rw-r--r--include/net/bluetooth/amp.h54
-rw-r--r--include/net/bluetooth/bluetooth.h1
-rw-r--r--include/net/bluetooth/hci.h69
-rw-r--r--include/net/bluetooth/hci_core.h123
-rw-r--r--include/net/bluetooth/l2cap.h50
-rw-r--r--include/net/cfg80211.h306
-rw-r--r--include/net/cls_cgroup.h6
-rw-r--r--include/net/gro_cells.h14
-rw-r--r--include/net/ieee80211_radiotap.h24
-rw-r--r--include/net/inet_hashtables.h50
-rw-r--r--include/net/inet_sock.h8
-rw-r--r--include/net/inet_timewait_sock.h7
-rw-r--r--include/net/ip6_checksum.h35
-rw-r--r--include/net/ip6_fib.h20
-rw-r--r--include/net/ip6_route.h3
-rw-r--r--include/net/ip_vs.h195
-rw-r--r--include/net/ipip.h40
-rw-r--r--include/net/ipv6.h19
-rw-r--r--include/net/mac80211.h275
-rw-r--r--include/net/ndisc.h15
-rw-r--r--include/net/net_namespace.h24
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--include/net/netfilter/nf_nat.h15
-rw-r--r--include/net/netfilter/nf_queue.h8
-rw-r--r--include/net/netns/sctp.h3
-rw-r--r--include/net/nfc/hci.h21
-rw-r--r--include/net/nfc/nfc.h2
-rw-r--r--include/net/protocol.h31
-rw-r--r--include/net/request_sock.h12
-rw-r--r--include/net/route.h9
-rw-r--r--include/net/rtnetlink.h2
-rw-r--r--include/net/sch_generic.h7
-rw-r--r--include/net/sctp/command.h38
-rw-r--r--include/net/sctp/constants.h8
-rw-r--r--include/net/sctp/sctp.h12
-rw-r--r--include/net/sctp/sm.h2
-rw-r--r--include/net/sctp/structs.h39
-rw-r--r--include/net/sctp/ulpqueue.h2
-rw-r--r--include/net/sctp/user.h27
-rw-r--r--include/net/sock.h28
-rw-r--r--include/net/tcp.h1
-rw-r--r--include/uapi/asm-generic/socket.h1
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/ethtool.h11
-rw-r--r--include/uapi/linux/filter.h4
-rw-r--r--include/uapi/linux/hdlc/Kbuild1
-rw-r--r--include/uapi/linux/hdlc/ioctl.h (renamed from include/linux/hdlc/ioctl.h)7
-rw-r--r--include/uapi/linux/if_bridge.h81
-rw-r--r--include/uapi/linux/if_ether.h1
-rw-r--r--include/uapi/linux/if_link.h22
-rw-r--r--include/uapi/linux/if_packet.h1
-rw-r--r--include/uapi/linux/if_tun.h7
-rw-r--r--include/uapi/linux/if_tunnel.h20
-rw-r--r--include/uapi/linux/in6.h1
-rw-r--r--include/uapi/linux/inet_diag.h3
-rw-r--r--include/uapi/linux/ipv6.h1
-rw-r--r--include/uapi/linux/ipv6_route.h3
-rw-r--r--include/uapi/linux/netconf.h24
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_conntrack.h2
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6_tables.h3
-rw-r--r--include/uapi/linux/nfc.h15
-rw-r--r--include/uapi/linux/nl80211.h177
-rw-r--r--include/uapi/linux/ptp_clock.h14
-rw-r--r--include/uapi/linux/rtnetlink.h26
-rw-r--r--include/uapi/linux/unix_diag.h1
-rw-r--r--include/uapi/linux/usb/cdc.h23
-rw-r--r--include/uapi/linux/virtio_net.h27
110 files changed, 2476 insertions, 690 deletions
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index 6e3f54f3784..fcdd81bd531 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -22,6 +22,8 @@
22#define ATH9K_PLAT_EEP_MAX_WORDS 2048 22#define ATH9K_PLAT_EEP_MAX_WORDS 2048
23 23
24struct ath9k_platform_data { 24struct ath9k_platform_data {
25 const char *eeprom_name;
26
25 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; 27 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
26 u8 *macaddr; 28 u8 *macaddr;
27 29
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 22ef21c33d0..c1da539f5e2 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -99,6 +99,7 @@ struct atm_vcc {
99 struct atm_dev *dev; /* device back pointer */ 99 struct atm_dev *dev; /* device back pointer */
100 struct atm_qos qos; /* QOS */ 100 struct atm_qos qos; /* QOS */
101 struct atm_sap sap; /* SAP */ 101 struct atm_sap sap; /* SAP */
102 void (*release_cb)(struct atm_vcc *vcc); /* release_sock callback */
102 void (*push)(struct atm_vcc *vcc,struct sk_buff *skb); 103 void (*push)(struct atm_vcc *vcc,struct sk_buff *skb);
103 void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */ 104 void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */
104 int (*push_oam)(struct atm_vcc *vcc,void *cell); 105 int (*push_oam)(struct atm_vcc *vcc,void *cell);
@@ -106,6 +107,7 @@ struct atm_vcc {
106 void *dev_data; /* per-device data */ 107 void *dev_data; /* per-device data */
107 void *proto_data; /* per-protocol data */ 108 void *proto_data; /* per-protocol data */
108 struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ 109 struct k_atm_aal_stats *stats; /* pointer to AAL stats group */
110 struct module *owner; /* owner of ->push function */
109 /* SVC part --- may move later ------------------------------------- */ 111 /* SVC part --- may move later ------------------------------------- */
110 short itf; /* interface number */ 112 short itf; /* interface number */
111 struct sockaddr_atmsvc local; 113 struct sockaddr_atmsvc local;
diff --git a/include/linux/bcm47xx_wdt.h b/include/linux/bcm47xx_wdt.h
new file mode 100644
index 00000000000..e5dfc256485
--- /dev/null
+++ b/include/linux/bcm47xx_wdt.h
@@ -0,0 +1,19 @@
1#ifndef LINUX_BCM47XX_WDT_H_
2#define LINUX_BCM47XX_WDT_H_
3
4#include <linux/types.h>
5
6
7struct bcm47xx_wdt {
8 u32 (*timer_set)(struct bcm47xx_wdt *, u32);
9 u32 (*timer_set_ms)(struct bcm47xx_wdt *, u32);
10 u32 max_timer_ms;
11
12 void *driver_data;
13};
14
15static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt)
16{
17 return wdt->driver_data;
18}
19#endif /* LINUX_BCM47XX_WDT_H_ */
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 4180eb78d57..93b1e091b1e 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -157,6 +157,7 @@ struct bcma_host_ops {
157 157
158/* Chip IDs of SoCs */ 158/* Chip IDs of SoCs */
159#define BCMA_CHIP_ID_BCM4706 0x5300 159#define BCMA_CHIP_ID_BCM4706 0x5300
160#define BCMA_PKG_ID_BCM4706L 1
160#define BCMA_CHIP_ID_BCM4716 0x4716 161#define BCMA_CHIP_ID_BCM4716 0x4716
161#define BCMA_PKG_ID_BCM4716 8 162#define BCMA_PKG_ID_BCM4716 8
162#define BCMA_PKG_ID_BCM4717 9 163#define BCMA_PKG_ID_BCM4717 9
@@ -166,7 +167,11 @@ struct bcma_host_ops {
166#define BCMA_CHIP_ID_BCM4749 0x4749 167#define BCMA_CHIP_ID_BCM4749 0x4749
167#define BCMA_CHIP_ID_BCM5356 0x5356 168#define BCMA_CHIP_ID_BCM5356 0x5356
168#define BCMA_CHIP_ID_BCM5357 0x5357 169#define BCMA_CHIP_ID_BCM5357 0x5357
170#define BCMA_PKG_ID_BCM5358 9
171#define BCMA_PKG_ID_BCM47186 10
172#define BCMA_PKG_ID_BCM5357 11
169#define BCMA_CHIP_ID_BCM53572 53572 173#define BCMA_CHIP_ID_BCM53572 53572
174#define BCMA_PKG_ID_BCM47188 9
170 175
171struct bcma_device { 176struct bcma_device {
172 struct bcma_bus *bus; 177 struct bcma_bus *bus;
@@ -251,7 +256,7 @@ struct bcma_bus {
251 u8 num; 256 u8 num;
252 257
253 struct bcma_drv_cc drv_cc; 258 struct bcma_drv_cc drv_cc;
254 struct bcma_drv_pci drv_pci; 259 struct bcma_drv_pci drv_pci[2];
255 struct bcma_drv_mips drv_mips; 260 struct bcma_drv_mips drv_mips;
256 struct bcma_drv_gmac_cmn drv_gmac_cmn; 261 struct bcma_drv_gmac_cmn drv_gmac_cmn;
257 262
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 1cf1749440a..e51359180b6 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -1,6 +1,8 @@
1#ifndef LINUX_BCMA_DRIVER_CC_H_ 1#ifndef LINUX_BCMA_DRIVER_CC_H_
2#define LINUX_BCMA_DRIVER_CC_H_ 2#define LINUX_BCMA_DRIVER_CC_H_
3 3
4#include <linux/platform_device.h>
5
4/** ChipCommon core registers. **/ 6/** ChipCommon core registers. **/
5#define BCMA_CC_ID 0x0000 7#define BCMA_CC_ID 0x0000
6#define BCMA_CC_ID_ID 0x0000FFFF 8#define BCMA_CC_ID_ID 0x0000FFFF
@@ -510,6 +512,7 @@ struct bcma_chipcommon_pmu {
510 512
511#ifdef CONFIG_BCMA_DRIVER_MIPS 513#ifdef CONFIG_BCMA_DRIVER_MIPS
512struct bcma_pflash { 514struct bcma_pflash {
515 bool present;
513 u8 buswidth; 516 u8 buswidth;
514 u32 window; 517 u32 window;
515 u32 window_size; 518 u32 window_size;
@@ -532,6 +535,7 @@ struct mtd_info;
532 535
533struct bcma_nflash { 536struct bcma_nflash {
534 bool present; 537 bool present;
538 bool boot; /* This is the flash the SoC boots from */
535 539
536 struct mtd_info *mtd; 540 struct mtd_info *mtd;
537}; 541};
@@ -552,6 +556,7 @@ struct bcma_drv_cc {
552 u32 capabilities; 556 u32 capabilities;
553 u32 capabilities_ext; 557 u32 capabilities_ext;
554 u8 setup_done:1; 558 u8 setup_done:1;
559 u8 early_setup_done:1;
555 /* Fast Powerup Delay constant */ 560 /* Fast Powerup Delay constant */
556 u16 fast_pwrup_delay; 561 u16 fast_pwrup_delay;
557 struct bcma_chipcommon_pmu pmu; 562 struct bcma_chipcommon_pmu pmu;
@@ -567,6 +572,8 @@ struct bcma_drv_cc {
567 int nr_serial_ports; 572 int nr_serial_ports;
568 struct bcma_serial_port serial_ports[4]; 573 struct bcma_serial_port serial_ports[4];
569#endif /* CONFIG_BCMA_DRIVER_MIPS */ 574#endif /* CONFIG_BCMA_DRIVER_MIPS */
575 u32 ticks_per_ms;
576 struct platform_device *watchdog;
570}; 577};
571 578
572/* Register access */ 579/* Register access */
@@ -583,14 +590,14 @@ struct bcma_drv_cc {
583 bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) 590 bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set))
584 591
585extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); 592extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
593extern void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
586 594
587extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); 595extern void bcma_chipco_suspend(struct bcma_drv_cc *cc);
588extern void bcma_chipco_resume(struct bcma_drv_cc *cc); 596extern void bcma_chipco_resume(struct bcma_drv_cc *cc);
589 597
590void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable); 598void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
591 599
592extern void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, 600extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks);
593 u32 ticks);
594 601
595void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value); 602void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value);
596 603
@@ -606,6 +613,7 @@ u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value);
606 613
607/* PMU support */ 614/* PMU support */
608extern void bcma_pmu_init(struct bcma_drv_cc *cc); 615extern void bcma_pmu_init(struct bcma_drv_cc *cc);
616extern void bcma_pmu_early_init(struct bcma_drv_cc *cc);
609 617
610extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, 618extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset,
611 u32 value); 619 u32 value);
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h
index c0043645cdc..0baf8a56b79 100644
--- a/include/linux/bcma/bcma_driver_mips.h
+++ b/include/linux/bcma/bcma_driver_mips.h
@@ -35,13 +35,16 @@ struct bcma_device;
35struct bcma_drv_mips { 35struct bcma_drv_mips {
36 struct bcma_device *core; 36 struct bcma_device *core;
37 u8 setup_done:1; 37 u8 setup_done:1;
38 u8 early_setup_done:1;
38 unsigned int assigned_irqs; 39 unsigned int assigned_irqs;
39}; 40};
40 41
41#ifdef CONFIG_BCMA_DRIVER_MIPS 42#ifdef CONFIG_BCMA_DRIVER_MIPS
42extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); 43extern void bcma_core_mips_init(struct bcma_drv_mips *mcore);
44extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
43#else 45#else
44static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } 46static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { }
47static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { }
45#endif 48#endif
46 49
47extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); 50extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index 6c9cb93ae3d..7e8104bb7a7 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -85,6 +85,9 @@
85 * (2 ZettaBytes), high 32 bits 85 * (2 ZettaBytes), high 32 bits
86 */ 86 */
87 87
88#define BCMA_SFLASH 0x1c000000 88#define BCMA_SOC_FLASH1 0x1fc00000 /* MIPS Flash Region 1 */
89#define BCMA_SOC_FLASH1_SZ 0x00400000 /* MIPS Size of Flash Region 1 */
90#define BCMA_SOC_FLASH2 0x1c000000 /* Flash Region 2 (region 1 shadowed here) */
91#define BCMA_SOC_FLASH2_SZ 0x02000000 /* Size of Flash Region 2 */
89 92
90#endif /* LINUX_BCMA_REGS_H_ */ 93#endif /* LINUX_BCMA_REGS_H_ */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index b006ba0a9f4..243eea1e33d 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -51,6 +51,26 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
51#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) 51#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1)
52#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) 52#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count)
53 53
54/* Reserved Ethernet Addresses per IEEE 802.1Q */
55static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
56{ 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
57
58/**
59 * is_link_local_ether_addr - Determine if given Ethernet address is link-local
60 * @addr: Pointer to a six-byte array containing the Ethernet address
61 *
62 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
63 * IEEE 802.1Q 8.6.3 Frame filtering.
64 */
65static inline bool is_link_local_ether_addr(const u8 *addr)
66{
67 __be16 *a = (__be16 *)addr;
68 static const __be16 *b = (const __be16 *)eth_reserved_addr_base;
69 static const __be16 m = cpu_to_be16(0xfff0);
70
71 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
72}
73
54/** 74/**
55 * is_zero_ether_addr - Determine if give Ethernet address is all zeros. 75 * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
56 * @addr: Pointer to a six-byte array containing the Ethernet address 76 * @addr: Pointer to a six-byte array containing the Ethernet address
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 24d251f3bab..c45eabc135e 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -45,6 +45,7 @@ extern void sk_unattached_filter_destroy(struct sk_filter *fp);
45extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 45extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
46extern int sk_detach_filter(struct sock *sk); 46extern int sk_detach_filter(struct sock *sk);
47extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); 47extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
48extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len);
48 49
49#ifdef CONFIG_BPF_JIT 50#ifdef CONFIG_BPF_JIT
50extern void bpf_jit_compile(struct sk_filter *fp); 51extern void bpf_jit_compile(struct sk_filter *fp);
@@ -123,6 +124,8 @@ enum {
123 BPF_S_ANC_CPU, 124 BPF_S_ANC_CPU,
124 BPF_S_ANC_ALU_XOR_X, 125 BPF_S_ANC_ALU_XOR_X,
125 BPF_S_ANC_SECCOMP_LD_W, 126 BPF_S_ANC_SECCOMP_LD_W,
127 BPF_S_ANC_VLAN_TAG,
128 BPF_S_ANC_VLAN_TAG_PRESENT,
126}; 129};
127 130
128#endif /* __LINUX_FILTER_H__ */ 131#endif /* __LINUX_FILTER_H__ */
diff --git a/include/linux/hdlc/Kbuild b/include/linux/hdlc/Kbuild
index 1fb26448faa..e69de29bb2d 100644
--- a/include/linux/hdlc/Kbuild
+++ b/include/linux/hdlc/Kbuild
@@ -1 +0,0 @@
1header-y += ioctl.h
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 2385119f8bb..f0859cc7386 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -131,6 +131,8 @@
131 131
132#define IEEE80211_MAX_MESH_ID_LEN 32 132#define IEEE80211_MAX_MESH_ID_LEN 32
133 133
134#define IEEE80211_NUM_TIDS 16
135
134#define IEEE80211_QOS_CTL_LEN 2 136#define IEEE80211_QOS_CTL_LEN 2
135/* 1d tag mask */ 137/* 1d tag mask */
136#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 138#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
@@ -666,6 +668,21 @@ struct ieee80211_meshconf_ie {
666} __attribute__ ((packed)); 668} __attribute__ ((packed));
667 669
668/** 670/**
671 * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags
672 *
673 * @IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS: STA is willing to establish
674 * additional mesh peerings with other mesh STAs
675 * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs
676 * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure
677 * is ongoing
678 */
679enum mesh_config_capab_flags {
680 IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01,
681 IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08,
682 IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20,
683};
684
685/**
669 * struct ieee80211_rann_ie 686 * struct ieee80211_rann_ie
670 * 687 *
671 * This structure refers to "Root Announcement information element" 688 * This structure refers to "Root Announcement information element"
@@ -905,6 +922,38 @@ struct ieee80211_tdls_data {
905 } u; 922 } u;
906} __packed; 923} __packed;
907 924
925/*
926 * Peer-to-Peer IE attribute related definitions.
927 */
928/**
929 * enum ieee80211_p2p_attr_id - identifies type of peer-to-peer attribute.
930 */
931enum ieee80211_p2p_attr_id {
932 IEEE80211_P2P_ATTR_STATUS = 0,
933 IEEE80211_P2P_ATTR_MINOR_REASON,
934 IEEE80211_P2P_ATTR_CAPABILITY,
935 IEEE80211_P2P_ATTR_DEVICE_ID,
936 IEEE80211_P2P_ATTR_GO_INTENT,
937 IEEE80211_P2P_ATTR_GO_CONFIG_TIMEOUT,
938 IEEE80211_P2P_ATTR_LISTEN_CHANNEL,
939 IEEE80211_P2P_ATTR_GROUP_BSSID,
940 IEEE80211_P2P_ATTR_EXT_LISTEN_TIMING,
941 IEEE80211_P2P_ATTR_INTENDED_IFACE_ADDR,
942 IEEE80211_P2P_ATTR_MANAGABILITY,
943 IEEE80211_P2P_ATTR_CHANNEL_LIST,
944 IEEE80211_P2P_ATTR_ABSENCE_NOTICE,
945 IEEE80211_P2P_ATTR_DEVICE_INFO,
946 IEEE80211_P2P_ATTR_GROUP_INFO,
947 IEEE80211_P2P_ATTR_GROUP_ID,
948 IEEE80211_P2P_ATTR_INTERFACE,
949 IEEE80211_P2P_ATTR_OPER_CHANNEL,
950 IEEE80211_P2P_ATTR_INVITE_FLAGS,
951 /* 19 - 220: Reserved */
952 IEEE80211_P2P_ATTR_VENDOR_SPECIFIC = 221,
953
954 IEEE80211_P2P_ATTR_MAX
955};
956
908/** 957/**
909 * struct ieee80211_bar - HT Block Ack Request 958 * struct ieee80211_bar - HT Block Ack Request
910 * 959 *
@@ -1107,20 +1156,6 @@ struct ieee80211_ht_operation {
1107#define WLAN_HT_SMPS_CONTROL_STATIC 1 1156#define WLAN_HT_SMPS_CONTROL_STATIC 1
1108#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 1157#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
1109 1158
1110#define VHT_MCS_SUPPORTED_SET_SIZE 8
1111
1112struct ieee80211_vht_capabilities {
1113 __le32 vht_capabilities_info;
1114 u8 vht_supported_mcs_set[VHT_MCS_SUPPORTED_SET_SIZE];
1115} __packed;
1116
1117struct ieee80211_vht_operation {
1118 u8 vht_op_info_chwidth;
1119 u8 vht_op_info_chan_center_freq_seg1_idx;
1120 u8 vht_op_info_chan_center_freq_seg2_idx;
1121 __le16 vht_basic_mcs_set;
1122} __packed;
1123
1124/** 1159/**
1125 * struct ieee80211_vht_mcs_info - VHT MCS information 1160 * struct ieee80211_vht_mcs_info - VHT MCS information
1126 * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams 1161 * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams
@@ -1128,11 +1163,13 @@ struct ieee80211_vht_operation {
1128 * STA can receive. Rate expressed in units of 1 Mbps. 1163 * STA can receive. Rate expressed in units of 1 Mbps.
1129 * If this field is 0 this value should not be used to 1164 * If this field is 0 this value should not be used to
1130 * consider the highest RX data rate supported. 1165 * consider the highest RX data rate supported.
1166 * The top 3 bits of this field are reserved.
1131 * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams 1167 * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
1132 * @tx_highest: Indicates highest long GI VHT PPDU data rate 1168 * @tx_highest: Indicates highest long GI VHT PPDU data rate
1133 * STA can transmit. Rate expressed in units of 1 Mbps. 1169 * STA can transmit. Rate expressed in units of 1 Mbps.
1134 * If this field is 0 this value should not be used to 1170 * If this field is 0 this value should not be used to
1135 * consider the highest TX data rate supported. 1171 * consider the highest TX data rate supported.
1172 * The top 3 bits of this field are reserved.
1136 */ 1173 */
1137struct ieee80211_vht_mcs_info { 1174struct ieee80211_vht_mcs_info {
1138 __le16 rx_mcs_map; 1175 __le16 rx_mcs_map;
@@ -1141,38 +1178,107 @@ struct ieee80211_vht_mcs_info {
1141 __le16 tx_highest; 1178 __le16 tx_highest;
1142} __packed; 1179} __packed;
1143 1180
1181/**
1182 * enum ieee80211_vht_mcs_support - VHT MCS support definitions
1183 * @IEEE80211_VHT_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the
1184 * number of streams
1185 * @IEEE80211_VHT_MCS_SUPPORT_0_8: MCSes 0-8 are supported
1186 * @IEEE80211_VHT_MCS_SUPPORT_0_9: MCSes 0-9 are supported
1187 * @IEEE80211_VHT_MCS_NOT_SUPPORTED: This number of streams isn't supported
1188 *
1189 * These definitions are used in each 2-bit subfield of the @rx_mcs_map
1190 * and @tx_mcs_map fields of &struct ieee80211_vht_mcs_info, which are
1191 * both split into 8 subfields by number of streams. These values indicate
1192 * which MCSes are supported for the number of streams the value appears
1193 * for.
1194 */
1195enum ieee80211_vht_mcs_support {
1196 IEEE80211_VHT_MCS_SUPPORT_0_7 = 0,
1197 IEEE80211_VHT_MCS_SUPPORT_0_8 = 1,
1198 IEEE80211_VHT_MCS_SUPPORT_0_9 = 2,
1199 IEEE80211_VHT_MCS_NOT_SUPPORTED = 3,
1200};
1201
1202/**
1203 * struct ieee80211_vht_cap - VHT capabilities
1204 *
1205 * This structure is the "VHT capabilities element" as
1206 * described in 802.11ac D3.0 8.4.2.160
1207 * @vht_cap_info: VHT capability info
1208 * @supp_mcs: VHT MCS supported rates
1209 */
1210struct ieee80211_vht_cap {
1211 __le32 vht_cap_info;
1212 struct ieee80211_vht_mcs_info supp_mcs;
1213} __packed;
1214
1215/**
1216 * enum ieee80211_vht_chanwidth - VHT channel width
1217 * @IEEE80211_VHT_CHANWIDTH_USE_HT: use the HT operation IE to
1218 * determine the channel width (20 or 40 MHz)
1219 * @IEEE80211_VHT_CHANWIDTH_80MHZ: 80 MHz bandwidth
1220 * @IEEE80211_VHT_CHANWIDTH_160MHZ: 160 MHz bandwidth
1221 * @IEEE80211_VHT_CHANWIDTH_80P80MHZ: 80+80 MHz bandwidth
1222 */
1223enum ieee80211_vht_chanwidth {
1224 IEEE80211_VHT_CHANWIDTH_USE_HT = 0,
1225 IEEE80211_VHT_CHANWIDTH_80MHZ = 1,
1226 IEEE80211_VHT_CHANWIDTH_160MHZ = 2,
1227 IEEE80211_VHT_CHANWIDTH_80P80MHZ = 3,
1228};
1229
1230/**
1231 * struct ieee80211_vht_operation - VHT operation IE
1232 *
1233 * This structure is the "VHT operation element" as
1234 * described in 802.11ac D3.0 8.4.2.161
1235 * @chan_width: Operating channel width
1236 * @center_freq_seg1_idx: center freq segment 1 index
1237 * @center_freq_seg2_idx: center freq segment 2 index
1238 * @basic_mcs_set: VHT Basic MCS rate set
1239 */
1240struct ieee80211_vht_operation {
1241 u8 chan_width;
1242 u8 center_freq_seg1_idx;
1243 u8 center_freq_seg2_idx;
1244 __le16 basic_mcs_set;
1245} __packed;
1246
1247
1144#define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0 1248#define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0
1145#define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1 1249#define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1
1146#define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2 1250#define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2
1147#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3 1251#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3
1148 1252
1149/* 802.11ac VHT Capabilities */ 1253/* 802.11ac VHT Capabilities */
1150#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 1254#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
1151#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 1255#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001
1152#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 1256#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
1153#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 1257#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
1154#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 1258#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
1155#define IEEE80211_VHT_CAP_RXLDPC 0x00000010 1259#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
1156#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 1260#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
1157#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 1261#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
1158#define IEEE80211_VHT_CAP_TXSTBC 0x00000080 1262#define IEEE80211_VHT_CAP_TXSTBC 0x00000080
1159#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 1263#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100
1160#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200 1264#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200
1161#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300 1265#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300
1162#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400 1266#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400
1163#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 1267#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
1164#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 1268#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
1165#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000 1269#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000
1166#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000 1270#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000
1167#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 1271#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
1168#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 1272#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
1169#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 1273#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
1170#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 1274#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000
1171#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT 0x00800000 1275#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23
1172#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000 1276#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \
1173#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 1277 (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT)
1174#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 1278#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000
1175#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 1279#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000
1280#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000
1281#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000
1176 1282
1177/* Authentication algorithms */ 1283/* Authentication algorithms */
1178#define WLAN_AUTH_OPEN 0 1284#define WLAN_AUTH_OPEN 0
@@ -1440,8 +1546,6 @@ enum ieee80211_eid {
1440 1546
1441 WLAN_EID_RSN = 48, 1547 WLAN_EID_RSN = 48,
1442 WLAN_EID_MMIE = 76, 1548 WLAN_EID_MMIE = 76,
1443 WLAN_EID_WPA = 221,
1444 WLAN_EID_GENERIC = 221,
1445 WLAN_EID_VENDOR_SPECIFIC = 221, 1549 WLAN_EID_VENDOR_SPECIFIC = 221,
1446 WLAN_EID_QOS_PARAMETER = 222, 1550 WLAN_EID_QOS_PARAMETER = 222,
1447 1551
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 1cc595a67cc..f4e56ecd0b1 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -4,5 +4,22 @@
4#include <linux/ip.h> 4#include <linux/ip.h>
5#include <linux/in6.h> 5#include <linux/in6.h>
6#include <uapi/linux/if_tunnel.h> 6#include <uapi/linux/if_tunnel.h>
7#include <linux/u64_stats_sync.h>
8
9/*
10 * Locking : hash tables are protected by RCU and RTNL
11 */
12
13#define for_each_ip_tunnel_rcu(pos, start) \
14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next))
15
16/* often modified stats are per cpu, other are shared (netdev->stats) */
17struct pcpu_tstats {
18 u64 rx_packets;
19 u64 rx_bytes;
20 u64 tx_packets;
21 u64 tx_bytes;
22 struct u64_stats_sync syncp;
23};
7 24
8#endif /* _IF_TUNNEL_H_ */ 25#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index d032780d0ce..a9d828976a7 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -171,6 +171,9 @@ struct in_ifaddr {
171extern int register_inetaddr_notifier(struct notifier_block *nb); 171extern int register_inetaddr_notifier(struct notifier_block *nb);
172extern int unregister_inetaddr_notifier(struct notifier_block *nb); 172extern int unregister_inetaddr_notifier(struct notifier_block *nb);
173 173
174extern void inet_netconf_notify_devconf(struct net *net, int type, int ifindex,
175 struct ipv4_devconf *devconf);
176
174extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref); 177extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref);
175static inline struct net_device *ip_dev_find(struct net *net, __be32 addr) 178static inline struct net_device *ip_dev_find(struct net *net, __be32 addr)
176{ 179{
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 58b82a22a52..492bc651353 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -25,6 +25,11 @@ static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
25 return (struct iphdr *)skb_network_header(skb); 25 return (struct iphdr *)skb_network_header(skb);
26} 26}
27 27
28static inline struct iphdr *inner_ip_hdr(const struct sk_buff *skb)
29{
30 return (struct iphdr *)skb_inner_network_header(skb);
31}
32
28static inline struct iphdr *ipip_hdr(const struct sk_buff *skb) 33static inline struct iphdr *ipip_hdr(const struct sk_buff *skb)
29{ 34{
30 return (struct iphdr *)skb_transport_header(skb); 35 return (struct iphdr *)skb_transport_header(skb);
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index bcba48a9786..faed1e357dd 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -47,6 +47,7 @@ struct ipv6_devconf {
47 __s32 disable_ipv6; 47 __s32 disable_ipv6;
48 __s32 accept_dad; 48 __s32 accept_dad;
49 __s32 force_tllao; 49 __s32 force_tllao;
50 __s32 ndisc_notify;
50 void *sysctl; 51 void *sysctl;
51}; 52};
52 53
@@ -66,6 +67,11 @@ static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb)
66 return (struct ipv6hdr *)skb_network_header(skb); 67 return (struct ipv6hdr *)skb_network_header(skb);
67} 68}
68 69
70static inline struct ipv6hdr *inner_ipv6_hdr(const struct sk_buff *skb)
71{
72 return (struct ipv6hdr *)skb_inner_network_header(skb);
73}
74
69static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) 75static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
70{ 76{
71 return (struct ipv6hdr *)skb_transport_header(skb); 77 return (struct ipv6hdr *)skb_transport_header(skb);
@@ -363,20 +369,22 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
363#define inet_v6_ipv6only(__sk) 0 369#define inet_v6_ipv6only(__sk) 0
364#endif /* IS_ENABLED(CONFIG_IPV6) */ 370#endif /* IS_ENABLED(CONFIG_IPV6) */
365 371
366#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ 372#define INET6_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \
367 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 373 ((inet_sk(__sk)->inet_portpair == (__ports)) && \
368 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ 374 ((__sk)->sk_family == AF_INET6) && \
369 ((__sk)->sk_family == AF_INET6) && \ 375 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
370 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ 376 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
371 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ 377 (!(__sk)->sk_bound_dev_if || \
372 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 378 ((__sk)->sk_bound_dev_if == (__dif))) && \
373 379 net_eq(sock_net(__sk), (__net)))
374#define INET6_TW_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif) \ 380
375 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 381#define INET6_TW_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \
376 (*((__portpair *)&(inet_twsk(__sk)->tw_dport)) == (__ports)) && \ 382 ((inet_twsk(__sk)->tw_portpair == (__ports)) && \
377 ((__sk)->sk_family == PF_INET6) && \ 383 ((__sk)->sk_family == AF_INET6) && \
378 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr))) && \ 384 ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr)) && \
379 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr))) && \ 385 ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr)) && \
380 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 386 (!(__sk)->sk_bound_dev_if || \
387 ((__sk)->sk_bound_dev_if == (__dif))) && \
388 net_eq(sock_net(__sk), (__net)))
381 389
382#endif /* _IPV6_H */ 390#endif /* _IPV6_H */
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 06177ba10a1..e83512f63df 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -282,6 +282,25 @@ static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
282 return cmp1.tv64 == cmp2.tv64; 282 return cmp1.tv64 == cmp2.tv64;
283} 283}
284 284
285/**
286 * ktime_compare - Compares two ktime_t variables for less, greater or equal
287 * @cmp1: comparable1
288 * @cmp2: comparable2
289 *
290 * Returns ...
291 * cmp1 < cmp2: return <0
292 * cmp1 == cmp2: return 0
293 * cmp1 > cmp2: return >0
294 */
295static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2)
296{
297 if (cmp1.tv64 < cmp2.tv64)
298 return -1;
299 if (cmp1.tv64 > cmp2.tv64)
300 return 1;
301 return 0;
302}
303
285static inline s64 ktime_to_us(const ktime_t kt) 304static inline s64 ktime_to_us(const ktime_t kt)
286{ 305{
287 struct timeval tv = ktime_to_timeval(kt); 306 struct timeval tv = ktime_to_timeval(kt);
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index de201203bc7..adfe8c058f2 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -15,6 +15,7 @@
15 15
16#define MICREL_PHY_ID_MASK 0x00fffff0 16#define MICREL_PHY_ID_MASK 0x00fffff0
17 17
18#define PHY_ID_KSZ8873MLL 0x000e7237
18#define PHY_ID_KSZ9021 0x00221610 19#define PHY_ID_KSZ9021 0x00221610
19#define PHY_ID_KS8737 0x00221720 20#define PHY_ID_KS8737 0x00221720
20#define PHY_ID_KSZ8021 0x00221555 21#define PHY_ID_KSZ8021 0x00221555
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a848ffc327f..ef9336c9d46 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -887,6 +887,10 @@ struct netdev_fcoe_hbainfo {
887 * struct net_device *dev, int idx) 887 * struct net_device *dev, int idx)
888 * Used to add FDB entries to dump requests. Implementers should add 888 * Used to add FDB entries to dump requests. Implementers should add
889 * entries to skb and update idx with the number of entries. 889 * entries to skb and update idx with the number of entries.
890 *
891 * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh)
892 * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq,
893 * struct net_device *dev)
890 */ 894 */
891struct net_device_ops { 895struct net_device_ops {
892 int (*ndo_init)(struct net_device *dev); 896 int (*ndo_init)(struct net_device *dev);
@@ -998,6 +1002,12 @@ struct net_device_ops {
998 struct netlink_callback *cb, 1002 struct netlink_callback *cb,
999 struct net_device *dev, 1003 struct net_device *dev,
1000 int idx); 1004 int idx);
1005
1006 int (*ndo_bridge_setlink)(struct net_device *dev,
1007 struct nlmsghdr *nlh);
1008 int (*ndo_bridge_getlink)(struct sk_buff *skb,
1009 u32 pid, u32 seq,
1010 struct net_device *dev);
1001}; 1011};
1002 1012
1003/* 1013/*
@@ -1053,6 +1063,12 @@ struct net_device {
1053 netdev_features_t wanted_features; 1063 netdev_features_t wanted_features;
1054 /* mask of features inheritable by VLAN devices */ 1064 /* mask of features inheritable by VLAN devices */
1055 netdev_features_t vlan_features; 1065 netdev_features_t vlan_features;
1066 /* mask of features inherited by encapsulating devices
1067 * This field indicates what encapsulation offloads
1068 * the hardware is capable of doing, and drivers will
1069 * need to set them appropriately.
1070 */
1071 netdev_features_t hw_enc_features;
1056 1072
1057 /* Interface index. Unique device identifier */ 1073 /* Interface index. Unique device identifier */
1058 int ifindex; 1074 int ifindex;
@@ -1502,16 +1518,25 @@ struct packet_type {
1502 struct net_device *, 1518 struct net_device *,
1503 struct packet_type *, 1519 struct packet_type *,
1504 struct net_device *); 1520 struct net_device *);
1521 bool (*id_match)(struct packet_type *ptype,
1522 struct sock *sk);
1523 void *af_packet_priv;
1524 struct list_head list;
1525};
1526
1527struct offload_callbacks {
1505 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 1528 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
1506 netdev_features_t features); 1529 netdev_features_t features);
1507 int (*gso_send_check)(struct sk_buff *skb); 1530 int (*gso_send_check)(struct sk_buff *skb);
1508 struct sk_buff **(*gro_receive)(struct sk_buff **head, 1531 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1509 struct sk_buff *skb); 1532 struct sk_buff *skb);
1510 int (*gro_complete)(struct sk_buff *skb); 1533 int (*gro_complete)(struct sk_buff *skb);
1511 bool (*id_match)(struct packet_type *ptype, 1534};
1512 struct sock *sk); 1535
1513 void *af_packet_priv; 1536struct packet_offload {
1514 struct list_head list; 1537 __be16 type; /* This is really htons(ether_type). */
1538 struct offload_callbacks callbacks;
1539 struct list_head list;
1515}; 1540};
1516 1541
1517#include <linux/notifier.h> 1542#include <linux/notifier.h>
@@ -1551,6 +1576,8 @@ extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1551 1576
1552extern rwlock_t dev_base_lock; /* Device list lock */ 1577extern rwlock_t dev_base_lock; /* Device list lock */
1553 1578
1579extern seqlock_t devnet_rename_seq; /* Device rename lock */
1580
1554 1581
1555#define for_each_netdev(net, d) \ 1582#define for_each_netdev(net, d) \
1556 list_for_each_entry(d, &(net)->dev_base_head, dev_list) 1583 list_for_each_entry(d, &(net)->dev_base_head, dev_list)
@@ -1608,6 +1635,9 @@ extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short
1608extern void dev_add_pack(struct packet_type *pt); 1635extern void dev_add_pack(struct packet_type *pt);
1609extern void dev_remove_pack(struct packet_type *pt); 1636extern void dev_remove_pack(struct packet_type *pt);
1610extern void __dev_remove_pack(struct packet_type *pt); 1637extern void __dev_remove_pack(struct packet_type *pt);
1638extern void dev_add_offload(struct packet_offload *po);
1639extern void dev_remove_offload(struct packet_offload *po);
1640extern void __dev_remove_offload(struct packet_offload *po);
1611 1641
1612extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, 1642extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1613 unsigned short mask); 1643 unsigned short mask);
@@ -2132,16 +2162,10 @@ extern void dev_kfree_skb_any(struct sk_buff *skb);
2132extern int netif_rx(struct sk_buff *skb); 2162extern int netif_rx(struct sk_buff *skb);
2133extern int netif_rx_ni(struct sk_buff *skb); 2163extern int netif_rx_ni(struct sk_buff *skb);
2134extern int netif_receive_skb(struct sk_buff *skb); 2164extern int netif_receive_skb(struct sk_buff *skb);
2135extern gro_result_t dev_gro_receive(struct napi_struct *napi,
2136 struct sk_buff *skb);
2137extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
2138extern gro_result_t napi_gro_receive(struct napi_struct *napi, 2165extern gro_result_t napi_gro_receive(struct napi_struct *napi,
2139 struct sk_buff *skb); 2166 struct sk_buff *skb);
2140extern void napi_gro_flush(struct napi_struct *napi, bool flush_old); 2167extern void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2141extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 2168extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
2142extern gro_result_t napi_frags_finish(struct napi_struct *napi,
2143 struct sk_buff *skb,
2144 gro_result_t ret);
2145extern gro_result_t napi_gro_frags(struct napi_struct *napi); 2169extern gro_result_t napi_gro_frags(struct napi_struct *napi);
2146 2170
2147static inline void napi_free_frags(struct napi_struct *napi) 2171static inline void napi_free_frags(struct napi_struct *napi)
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 5f84c6229dc..610208b18c0 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -47,15 +47,6 @@ ip6t_ext_hdr(u8 nexthdr)
47 (nexthdr == IPPROTO_DSTOPTS); 47 (nexthdr == IPPROTO_DSTOPTS);
48} 48}
49 49
50enum {
51 IP6T_FH_F_FRAG = (1 << 0),
52 IP6T_FH_F_AUTH = (1 << 1),
53};
54
55/* find specified header and get offset to it */
56extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
57 int target, unsigned short *fragoff, int *fragflg);
58
59#ifdef CONFIG_COMPAT 50#ifdef CONFIG_COMPAT
60#include <net/compat.h> 51#include <net/compat.h>
61 52
diff --git a/include/linux/nfc/pn544.h b/include/linux/nfc/pn544.h
deleted file mode 100644
index 9890bbaf432..00000000000
--- a/include/linux/nfc/pn544.h
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * Driver include for the PN544 NFC chip.
3 *
4 * Copyright (C) Nokia Corporation
5 *
6 * Author: Jari Vanhala <ext-jari.vanhala@nokia.com>
7 * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef _PN544_H_
24#define _PN544_H_
25
26#include <linux/i2c.h>
27
28#define PN544_DRIVER_NAME "pn544"
29#define PN544_MAXWINDOW_SIZE 7
30#define PN544_WINDOW_SIZE 4
31#define PN544_RETRIES 10
32#define PN544_MAX_I2C_TRANSFER 0x0400
33#define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */
34
35/* ioctl */
36#define PN544_CHAR_BASE 'P'
37#define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype)
38#define PN544_IOW(num, dtype) _IOW(PN544_CHAR_BASE, num, dtype)
39#define PN544_GET_FW_MODE PN544_IOW(1, unsigned int)
40#define PN544_SET_FW_MODE PN544_IOW(2, unsigned int)
41#define PN544_GET_DEBUG PN544_IOW(3, unsigned int)
42#define PN544_SET_DEBUG PN544_IOW(4, unsigned int)
43
44/* Timing restrictions (ms) */
45#define PN544_RESETVEN_TIME 30 /* 7 */
46#define PN544_PVDDVEN_TIME 0
47#define PN544_VBATVEN_TIME 0
48#define PN544_GPIO4VEN_TIME 0
49#define PN544_WAKEUP_ACK 5
50#define PN544_WAKEUP_GUARD (PN544_WAKEUP_ACK + 1)
51#define PN544_INACTIVITY_TIME 1000
52#define PN544_INTERFRAME_DELAY 200 /* us */
53#define PN544_BAUDRATE_CHANGE 150 /* us */
54
55/* Debug bits */
56#define PN544_DEBUG_BUF 0x01
57#define PN544_DEBUG_READ 0x02
58#define PN544_DEBUG_WRITE 0x04
59#define PN544_DEBUG_IRQ 0x08
60#define PN544_DEBUG_CALLS 0x10
61#define PN544_DEBUG_MODE 0x20
62
63/* Normal (HCI) mode */
64#define PN544_LLC_HCI_OVERHEAD 3 /* header + crc (to length) */
65#define PN544_LLC_MIN_SIZE (1 + PN544_LLC_HCI_OVERHEAD) /* length + */
66#define PN544_LLC_MAX_DATA (PN544_MSG_MAX_SIZE - 2)
67#define PN544_LLC_MAX_HCI_SIZE (PN544_LLC_MAX_DATA - 2)
68
69struct pn544_llc_packet {
70 unsigned char length; /* of rest of packet */
71 unsigned char header;
72 unsigned char data[PN544_LLC_MAX_DATA]; /* includes crc-ccitt */
73};
74
75/* Firmware upgrade mode */
76#define PN544_FW_HEADER_SIZE 3
77/* max fw transfer is 1024bytes, but I2C limits it to 0xC0 */
78#define PN544_MAX_FW_DATA (PN544_MAX_I2C_TRANSFER - PN544_FW_HEADER_SIZE)
79
80struct pn544_fw_packet {
81 unsigned char command; /* status in answer */
82 unsigned char length[2]; /* big-endian order (msf) */
83 unsigned char data[PN544_MAX_FW_DATA];
84};
85
86#ifdef __KERNEL__
87enum {
88 NFC_GPIO_ENABLE,
89 NFC_GPIO_FW_RESET,
90 NFC_GPIO_IRQ
91};
92
93/* board config */
94struct pn544_nfc_platform_data {
95 int (*request_resources) (struct i2c_client *client);
96 void (*free_resources) (void);
97 void (*enable) (int fw);
98 int (*test) (void);
99 void (*disable) (void);
100 int (*get_gpio)(int type);
101};
102#endif /* __KERNEL__ */
103
104#endif /* _PN544_H_ */
diff --git a/include/linux/openvswitch.h b/include/linux/openvswitch.h
index eb1efa54fe8..d42e174bd0c 100644
--- a/include/linux/openvswitch.h
+++ b/include/linux/openvswitch.h
@@ -243,6 +243,7 @@ enum ovs_key_attr {
243 OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */ 243 OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */
244 OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */ 244 OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */
245 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */ 245 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */
246 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */
246 __OVS_KEY_ATTR_MAX 247 __OVS_KEY_ATTR_MAX
247}; 248};
248 249
diff --git a/include/linux/pci.h b/include/linux/pci.h
index d03d2463efa..af8229244ee 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -604,6 +604,20 @@ struct pci_driver {
604 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID 604 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
605 605
606/** 606/**
607 * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem
608 * @vend: the 16 bit PCI Vendor ID
609 * @dev: the 16 bit PCI Device ID
610 * @subvend: the 16 bit PCI Subvendor ID
611 * @subdev: the 16 bit PCI Subdevice ID
612 *
613 * This macro is used to create a struct pci_device_id that matches a
614 * specific device with subsystem information.
615 */
616#define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \
617 .vendor = (vend), .device = (dev), \
618 .subvendor = (subvend), .subdevice = (subdev)
619
620/**
607 * PCI_DEVICE_CLASS - macro used to describe a specific pci device class 621 * PCI_DEVICE_CLASS - macro used to describe a specific pci device class
608 * @dev_class: the class, subclass, prog-if triple for this device 622 * @dev_class: the class, subclass, prog-if triple for this device
609 * @dev_class_mask: the class mask for this device 623 * @dev_class_mask: the class mask for this device
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h
index c4e23d02949..24368a2e8b8 100644
--- a/include/linux/platform_data/cpsw.h
+++ b/include/linux/platform_data/cpsw.h
@@ -18,9 +18,7 @@
18#include <linux/if_ether.h> 18#include <linux/if_ether.h>
19 19
20struct cpsw_slave_data { 20struct cpsw_slave_data {
21 u32 slave_reg_ofs; 21 char phy_id[MII_BUS_ID_SIZE];
22 u32 sliver_reg_ofs;
23 const char *phy_id;
24 int phy_if; 22 int phy_if;
25 u8 mac_addr[ETH_ALEN]; 23 u8 mac_addr[ETH_ALEN];
26}; 24};
@@ -28,27 +26,14 @@ struct cpsw_slave_data {
28struct cpsw_platform_data { 26struct cpsw_platform_data {
29 u32 ss_reg_ofs; /* Subsystem control register offset */ 27 u32 ss_reg_ofs; /* Subsystem control register offset */
30 u32 channels; /* number of cpdma channels (symmetric) */ 28 u32 channels; /* number of cpdma channels (symmetric) */
31 u32 cpdma_reg_ofs; /* cpdma register offset */
32 u32 cpdma_sram_ofs; /* cpdma sram offset */
33
34 u32 slaves; /* number of slave cpgmac ports */ 29 u32 slaves; /* number of slave cpgmac ports */
35 struct cpsw_slave_data *slave_data; 30 struct cpsw_slave_data *slave_data;
36 31 u32 cpts_active_slave; /* time stamping slave */
37 u32 ale_reg_ofs; /* address lookup engine reg offset */ 32 u32 cpts_clock_mult; /* convert input clock ticks to nanoseconds */
33 u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */
38 u32 ale_entries; /* ale table size */ 34 u32 ale_entries; /* ale table size */
39
40 u32 host_port_reg_ofs; /* cpsw cpdma host port registers */
41 u32 host_port_num; /* The port number for the host port */
42
43 u32 hw_stats_reg_ofs; /* cpsw hardware statistics counters */
44
45 u32 bd_ram_ofs; /* embedded buffer descriptor RAM offset*/
46 u32 bd_ram_size; /*buffer descriptor ram size */ 35 u32 bd_ram_size; /*buffer descriptor ram size */
47 u32 hw_ram_addr; /*if the HW address for BD RAM is different */
48 bool no_bd_ram; /* no embedded BD ram*/
49
50 u32 rx_descs; /* Number of Rx Descriptios */ 36 u32 rx_descs; /* Number of Rx Descriptios */
51
52 u32 mac_control; /* Mac control register */ 37 u32 mac_control; /* Mac control register */
53}; 38};
54 39
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h
index b081c7245ec..044a124bfbb 100644
--- a/include/linux/platform_data/macb.h
+++ b/include/linux/platform_data/macb.h
@@ -12,6 +12,7 @@ struct macb_platform_data {
12 u32 phy_mask; 12 u32 phy_mask;
13 int phy_irq_pin; /* PHY IRQ */ 13 int phy_irq_pin; /* PHY IRQ */
14 u8 is_rmii; /* using RMII interface? */ 14 u8 is_rmii; /* using RMII interface? */
15 u8 rev_eth_addr; /* reverse Ethernet address byte order */
15}; 16};
16 17
17#endif /* __MACB_PDATA_H__ */ 18#endif /* __MACB_PDATA_H__ */
diff --git a/include/linux/platform_data/pn544.h b/include/linux/platform_data/pn544.h
new file mode 100644
index 00000000000..713bfd70334
--- /dev/null
+++ b/include/linux/platform_data/pn544.h
@@ -0,0 +1,44 @@
1/*
2 * Driver include for the PN544 NFC chip.
3 *
4 * Copyright (C) Nokia Corporation
5 *
6 * Author: Jari Vanhala <ext-jari.vanhala@nokia.com>
7 * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef _PN544_H_
24#define _PN544_H_
25
26#include <linux/i2c.h>
27
28enum {
29 NFC_GPIO_ENABLE,
30 NFC_GPIO_FW_RESET,
31 NFC_GPIO_IRQ
32};
33
34/* board config */
35struct pn544_nfc_platform_data {
36 int (*request_resources) (struct i2c_client *client);
37 void (*free_resources) (void);
38 void (*enable) (int fw);
39 int (*test) (void);
40 void (*disable) (void);
41 int (*get_gpio)(int type);
42};
43
44#endif /* _PN544_H_ */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 7002bbfd5d4..489dd7bb28e 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -69,4 +69,7 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
69 struct netlink_callback *cb, 69 struct netlink_callback *cb,
70 struct net_device *dev, 70 struct net_device *dev,
71 int idx); 71 int idx);
72
73extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
74 struct net_device *dev, u16 mode);
72#endif /* __LINUX_RTNETLINK_H */ 75#endif /* __LINUX_RTNETLINK_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6a2c34e6d96..320e976d5ab 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -235,11 +235,13 @@ enum {
235/* 235/*
236 * The callback notifies userspace to release buffers when skb DMA is done in 236 * The callback notifies userspace to release buffers when skb DMA is done in
237 * lower device, the skb last reference should be 0 when calling this. 237 * lower device, the skb last reference should be 0 when calling this.
238 * The zerocopy_success argument is true if zero copy transmit occurred,
239 * false on data copy or out of memory error caused by data copy attempt.
238 * The ctx field is used to track device context. 240 * The ctx field is used to track device context.
239 * The desc field is used to track userspace buffer index. 241 * The desc field is used to track userspace buffer index.
240 */ 242 */
241struct ubuf_info { 243struct ubuf_info {
242 void (*callback)(struct ubuf_info *); 244 void (*callback)(struct ubuf_info *, bool zerocopy_success);
243 void *ctx; 245 void *ctx;
244 unsigned long desc; 246 unsigned long desc;
245}; 247};
@@ -374,6 +376,8 @@ typedef unsigned char *sk_buff_data_t;
374 * @mark: Generic packet mark 376 * @mark: Generic packet mark
375 * @dropcount: total number of sk_receive_queue overflows 377 * @dropcount: total number of sk_receive_queue overflows
376 * @vlan_tci: vlan tag control information 378 * @vlan_tci: vlan tag control information
379 * @inner_transport_header: Inner transport layer header (encapsulation)
380 * @inner_network_header: Network layer header (encapsulation)
377 * @transport_header: Transport layer header 381 * @transport_header: Transport layer header
378 * @network_header: Network layer header 382 * @network_header: Network layer header
379 * @mac_header: Link layer header 383 * @mac_header: Link layer header
@@ -469,7 +473,13 @@ struct sk_buff {
469 __u8 wifi_acked:1; 473 __u8 wifi_acked:1;
470 __u8 no_fcs:1; 474 __u8 no_fcs:1;
471 __u8 head_frag:1; 475 __u8 head_frag:1;
472 /* 8/10 bit hole (depending on ndisc_nodetype presence) */ 476 /* Encapsulation protocol and NIC drivers should use
477 * this flag to indicate to each other if the skb contains
478 * encapsulated packet or not and maybe use the inner packet
479 * headers if needed
480 */
481 __u8 encapsulation:1;
482 /* 7/9 bit hole (depending on ndisc_nodetype presence) */
473 kmemcheck_bitfield_end(flags2); 483 kmemcheck_bitfield_end(flags2);
474 484
475#ifdef CONFIG_NET_DMA 485#ifdef CONFIG_NET_DMA
@@ -484,6 +494,8 @@ struct sk_buff {
484 __u32 avail_size; 494 __u32 avail_size;
485 }; 495 };
486 496
497 sk_buff_data_t inner_transport_header;
498 sk_buff_data_t inner_network_header;
487 sk_buff_data_t transport_header; 499 sk_buff_data_t transport_header;
488 sk_buff_data_t network_header; 500 sk_buff_data_t network_header;
489 sk_buff_data_t mac_header; 501 sk_buff_data_t mac_header;
@@ -566,6 +578,7 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb)
566} 578}
567 579
568extern void kfree_skb(struct sk_buff *skb); 580extern void kfree_skb(struct sk_buff *skb);
581extern void skb_tx_error(struct sk_buff *skb);
569extern void consume_skb(struct sk_buff *skb); 582extern void consume_skb(struct sk_buff *skb);
570extern void __kfree_skb(struct sk_buff *skb); 583extern void __kfree_skb(struct sk_buff *skb);
571extern struct kmem_cache *skbuff_head_cache; 584extern struct kmem_cache *skbuff_head_cache;
@@ -643,7 +656,7 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
643extern void __skb_get_rxhash(struct sk_buff *skb); 656extern void __skb_get_rxhash(struct sk_buff *skb);
644static inline __u32 skb_get_rxhash(struct sk_buff *skb) 657static inline __u32 skb_get_rxhash(struct sk_buff *skb)
645{ 658{
646 if (!skb->rxhash) 659 if (!skb->l4_rxhash)
647 __skb_get_rxhash(skb); 660 __skb_get_rxhash(skb);
648 661
649 return skb->rxhash; 662 return skb->rxhash;
@@ -1432,12 +1445,53 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
1432 skb->tail += len; 1445 skb->tail += len;
1433} 1446}
1434 1447
1448static inline void skb_reset_inner_headers(struct sk_buff *skb)
1449{
1450 skb->inner_network_header = skb->network_header;
1451 skb->inner_transport_header = skb->transport_header;
1452}
1453
1435static inline void skb_reset_mac_len(struct sk_buff *skb) 1454static inline void skb_reset_mac_len(struct sk_buff *skb)
1436{ 1455{
1437 skb->mac_len = skb->network_header - skb->mac_header; 1456 skb->mac_len = skb->network_header - skb->mac_header;
1438} 1457}
1439 1458
1440#ifdef NET_SKBUFF_DATA_USES_OFFSET 1459#ifdef NET_SKBUFF_DATA_USES_OFFSET
1460static inline unsigned char *skb_inner_transport_header(const struct sk_buff
1461 *skb)
1462{
1463 return skb->head + skb->inner_transport_header;
1464}
1465
1466static inline void skb_reset_inner_transport_header(struct sk_buff *skb)
1467{
1468 skb->inner_transport_header = skb->data - skb->head;
1469}
1470
1471static inline void skb_set_inner_transport_header(struct sk_buff *skb,
1472 const int offset)
1473{
1474 skb_reset_inner_transport_header(skb);
1475 skb->inner_transport_header += offset;
1476}
1477
1478static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb)
1479{
1480 return skb->head + skb->inner_network_header;
1481}
1482
1483static inline void skb_reset_inner_network_header(struct sk_buff *skb)
1484{
1485 skb->inner_network_header = skb->data - skb->head;
1486}
1487
1488static inline void skb_set_inner_network_header(struct sk_buff *skb,
1489 const int offset)
1490{
1491 skb_reset_inner_network_header(skb);
1492 skb->inner_network_header += offset;
1493}
1494
1441static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1495static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1442{ 1496{
1443 return skb->head + skb->transport_header; 1497 return skb->head + skb->transport_header;
@@ -1493,6 +1547,38 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
1493} 1547}
1494 1548
1495#else /* NET_SKBUFF_DATA_USES_OFFSET */ 1549#else /* NET_SKBUFF_DATA_USES_OFFSET */
1550static inline unsigned char *skb_inner_transport_header(const struct sk_buff
1551 *skb)
1552{
1553 return skb->inner_transport_header;
1554}
1555
1556static inline void skb_reset_inner_transport_header(struct sk_buff *skb)
1557{
1558 skb->inner_transport_header = skb->data;
1559}
1560
1561static inline void skb_set_inner_transport_header(struct sk_buff *skb,
1562 const int offset)
1563{
1564 skb->inner_transport_header = skb->data + offset;
1565}
1566
1567static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb)
1568{
1569 return skb->inner_network_header;
1570}
1571
1572static inline void skb_reset_inner_network_header(struct sk_buff *skb)
1573{
1574 skb->inner_network_header = skb->data;
1575}
1576
1577static inline void skb_set_inner_network_header(struct sk_buff *skb,
1578 const int offset)
1579{
1580 skb->inner_network_header = skb->data + offset;
1581}
1496 1582
1497static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1583static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1498{ 1584{
@@ -1571,11 +1657,21 @@ static inline u32 skb_network_header_len(const struct sk_buff *skb)
1571 return skb->transport_header - skb->network_header; 1657 return skb->transport_header - skb->network_header;
1572} 1658}
1573 1659
1660static inline u32 skb_inner_network_header_len(const struct sk_buff *skb)
1661{
1662 return skb->inner_transport_header - skb->inner_network_header;
1663}
1664
1574static inline int skb_network_offset(const struct sk_buff *skb) 1665static inline int skb_network_offset(const struct sk_buff *skb)
1575{ 1666{
1576 return skb_network_header(skb) - skb->data; 1667 return skb_network_header(skb) - skb->data;
1577} 1668}
1578 1669
1670static inline int skb_inner_network_offset(const struct sk_buff *skb)
1671{
1672 return skb_inner_network_header(skb) - skb->data;
1673}
1674
1579static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) 1675static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
1580{ 1676{
1581 return pskb_may_pull(skb, skb_network_offset(skb) + len); 1677 return pskb_may_pull(skb, skb_network_offset(skb) + len);
diff --git a/include/linux/smscphy.h b/include/linux/smscphy.h
index ce718cbce43..f4bf16e16e1 100644
--- a/include/linux/smscphy.h
+++ b/include/linux/smscphy.h
@@ -4,6 +4,7 @@
4#define MII_LAN83C185_ISF 29 /* Interrupt Source Flags */ 4#define MII_LAN83C185_ISF 29 /* Interrupt Source Flags */
5#define MII_LAN83C185_IM 30 /* Interrupt Mask */ 5#define MII_LAN83C185_IM 30 /* Interrupt Mask */
6#define MII_LAN83C185_CTRL_STATUS 17 /* Mode/Status Register */ 6#define MII_LAN83C185_CTRL_STATUS 17 /* Mode/Status Register */
7#define MII_LAN83C185_SPECIAL_MODES 18 /* Special Modes Register */
7 8
8#define MII_LAN83C185_ISF_INT1 (1<<1) /* Auto-Negotiation Page Received */ 9#define MII_LAN83C185_ISF_INT1 (1<<1) /* Auto-Negotiation Page Received */
9#define MII_LAN83C185_ISF_INT2 (1<<2) /* Parallel Detection Fault */ 10#define MII_LAN83C185_ISF_INT2 (1<<2) /* Parallel Detection Fault */
@@ -22,4 +23,8 @@
22#define MII_LAN83C185_EDPWRDOWN (1 << 13) /* EDPWRDOWN */ 23#define MII_LAN83C185_EDPWRDOWN (1 << 13) /* EDPWRDOWN */
23#define MII_LAN83C185_ENERGYON (1 << 1) /* ENERGYON */ 24#define MII_LAN83C185_ENERGYON (1 << 1) /* ENERGYON */
24 25
26#define MII_LAN83C185_MODE_MASK 0xE0
27#define MII_LAN83C185_MODE_POWERDOWN 0xC0 /* Power Down mode */
28#define MII_LAN83C185_MODE_ALL 0xE0 /* All capable mode */
29
25#endif /* __LINUX_SMSCPHY_H__ */ 30#endif /* __LINUX_SMSCPHY_H__ */
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index bb674c02f30..1f64e3f1f22 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -8,6 +8,7 @@
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/mod_devicetable.h> 9#include <linux/mod_devicetable.h>
10#include <linux/dma-mapping.h> 10#include <linux/dma-mapping.h>
11#include <linux/platform_device.h>
11 12
12#include <linux/ssb/ssb_regs.h> 13#include <linux/ssb/ssb_regs.h>
13 14
@@ -432,6 +433,7 @@ struct ssb_bus {
432#ifdef CONFIG_SSB_EMBEDDED 433#ifdef CONFIG_SSB_EMBEDDED
433 /* Lock for GPIO register access. */ 434 /* Lock for GPIO register access. */
434 spinlock_t gpio_lock; 435 spinlock_t gpio_lock;
436 struct platform_device *watchdog;
435#endif /* EMBEDDED */ 437#endif /* EMBEDDED */
436 438
437 /* Internal-only stuff follows. Do not touch. */ 439 /* Internal-only stuff follows. Do not touch. */
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index c2b02a5c86a..38339fd68a5 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -591,6 +591,8 @@ struct ssb_chipcommon {
591 /* Fast Powerup Delay constant */ 591 /* Fast Powerup Delay constant */
592 u16 fast_pwrup_delay; 592 u16 fast_pwrup_delay;
593 struct ssb_chipcommon_pmu pmu; 593 struct ssb_chipcommon_pmu pmu;
594 u32 ticks_per_ms;
595 u32 max_timer_ms;
594}; 596};
595 597
596static inline bool ssb_chipco_available(struct ssb_chipcommon *cc) 598static inline bool ssb_chipco_available(struct ssb_chipcommon *cc)
@@ -630,8 +632,7 @@ enum ssb_clkmode {
630extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc, 632extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,
631 enum ssb_clkmode mode); 633 enum ssb_clkmode mode);
632 634
633extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, 635extern u32 ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, u32 ticks);
634 u32 ticks);
635 636
636void ssb_chipco_irq_mask(struct ssb_chipcommon *cc, u32 mask, u32 value); 637void ssb_chipco_irq_mask(struct ssb_chipcommon *cc, u32 mask, u32 value);
637 638
diff --git a/include/linux/ssb/ssb_driver_extif.h b/include/linux/ssb/ssb_driver_extif.h
index 91161f0aa22..99511d0e931 100644
--- a/include/linux/ssb/ssb_driver_extif.h
+++ b/include/linux/ssb/ssb_driver_extif.h
@@ -152,6 +152,9 @@
152/* watchdog */ 152/* watchdog */
153#define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */ 153#define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */
154 154
155#define SSB_EXTIF_WATCHDOG_MAX_TIMER ((1 << 28) - 1)
156#define SSB_EXTIF_WATCHDOG_MAX_TIMER_MS (SSB_EXTIF_WATCHDOG_MAX_TIMER \
157 / (SSB_EXTIF_WATCHDOG_CLK / 1000))
155 158
156 159
157#ifdef CONFIG_SSB_DRIVER_EXTIF 160#ifdef CONFIG_SSB_DRIVER_EXTIF
@@ -171,8 +174,7 @@ extern void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
171extern void ssb_extif_timing_init(struct ssb_extif *extif, 174extern void ssb_extif_timing_init(struct ssb_extif *extif,
172 unsigned long ns); 175 unsigned long ns);
173 176
174extern void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, 177extern u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks);
175 u32 ticks);
176 178
177/* Extif GPIO pin access */ 179/* Extif GPIO pin access */
178u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask); 180u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask);
@@ -205,10 +207,52 @@ void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
205} 207}
206 208
207static inline 209static inline
208void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, 210void ssb_extif_timing_init(struct ssb_extif *extif, unsigned long ns)
209 u32 ticks)
210{ 211{
211} 212}
212 213
214static inline
215u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks)
216{
217 return 0;
218}
219
220static inline u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask)
221{
222 return 0;
223}
224
225static inline u32 ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask,
226 u32 value)
227{
228 return 0;
229}
230
231static inline u32 ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask,
232 u32 value)
233{
234 return 0;
235}
236
237static inline u32 ssb_extif_gpio_polarity(struct ssb_extif *extif, u32 mask,
238 u32 value)
239{
240 return 0;
241}
242
243static inline u32 ssb_extif_gpio_intmask(struct ssb_extif *extif, u32 mask,
244 u32 value)
245{
246 return 0;
247}
248
249#ifdef CONFIG_SSB_SERIAL
250static inline int ssb_extif_serial_init(struct ssb_extif *extif,
251 struct ssb_serial_port *ports)
252{
253 return 0;
254}
255#endif /* CONFIG_SSB_SERIAL */
256
213#endif /* CONFIG_SSB_DRIVER_EXTIF */ 257#endif /* CONFIG_SSB_DRIVER_EXTIF */
214#endif /* LINUX_SSB_EXTIFCORE_H_ */ 258#endif /* LINUX_SSB_EXTIFCORE_H_ */
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h
index 5f44e9740cd..07a9c7a2e08 100644
--- a/include/linux/ssb/ssb_driver_mips.h
+++ b/include/linux/ssb/ssb_driver_mips.h
@@ -13,6 +13,12 @@ struct ssb_serial_port {
13 unsigned int reg_shift; 13 unsigned int reg_shift;
14}; 14};
15 15
16struct ssb_pflash {
17 bool present;
18 u8 buswidth;
19 u32 window;
20 u32 window_size;
21};
16 22
17struct ssb_mipscore { 23struct ssb_mipscore {
18 struct ssb_device *dev; 24 struct ssb_device *dev;
@@ -20,9 +26,7 @@ struct ssb_mipscore {
20 int nr_serial_ports; 26 int nr_serial_ports;
21 struct ssb_serial_port serial_ports[4]; 27 struct ssb_serial_port serial_ports[4];
22 28
23 u8 flash_buswidth; 29 struct ssb_pflash pflash;
24 u32 flash_window;
25 u32 flash_window_size;
26}; 30};
27 31
28extern void ssb_mipscore_init(struct ssb_mipscore *mcore); 32extern void ssb_mipscore_init(struct ssb_mipscore *mcore);
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index a0525019e1d..6ecfa02ddba 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -485,7 +485,7 @@
485#define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4 485#define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4
486#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020 486#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020
487#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5 487#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5
488#define SSB_SPROM8_TEMPDELTA 0x00BA 488#define SSB_SPROM8_TEMPDELTA 0x00BC
489#define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff 489#define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff
490#define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0 490#define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0
491#define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00 491#define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index a1547ea3920..de5b2f8176c 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -104,6 +104,7 @@ struct plat_stmmacenet_data {
104 int bugged_jumbo; 104 int bugged_jumbo;
105 int pmt; 105 int pmt;
106 int force_sf_dma_mode; 106 int force_sf_dma_mode;
107 int riwt_off;
107 void (*fix_mac_speed)(void *priv, unsigned int speed); 108 void (*fix_mac_speed)(void *priv, unsigned int speed);
108 void (*bus_setup)(void __iomem *ioaddr); 109 void (*bus_setup)(void __iomem *ioaddr);
109 int (*init)(struct platform_device *pdev); 110 int (*init)(struct platform_device *pdev);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index cd844a6a8d5..14a8ff2de11 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -158,8 +158,7 @@ struct ctl_table_root {
158 struct ctl_table_set default_set; 158 struct ctl_table_set default_set;
159 struct ctl_table_set *(*lookup)(struct ctl_table_root *root, 159 struct ctl_table_set *(*lookup)(struct ctl_table_root *root,
160 struct nsproxy *namespaces); 160 struct nsproxy *namespaces);
161 int (*permissions)(struct ctl_table_root *root, 161 int (*permissions)(struct ctl_table_header *head, struct ctl_table *table);
162 struct nsproxy *namespaces, struct ctl_table *table);
163}; 162};
164 163
165/* struct ctl_path describes where in the hierarchy a table is added */ 164/* struct ctl_path describes where in the hierarchy a table is added */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 60b7aac15e0..4e1d2283e3c 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -35,6 +35,16 @@ static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
35 return tcp_hdr(skb)->doff * 4; 35 return tcp_hdr(skb)->doff * 4;
36} 36}
37 37
38static inline struct tcphdr *inner_tcp_hdr(const struct sk_buff *skb)
39{
40 return (struct tcphdr *)skb_inner_transport_header(skb);
41}
42
43static inline unsigned int inner_tcp_hdrlen(const struct sk_buff *skb)
44{
45 return inner_tcp_hdr(skb)->doff * 4;
46}
47
38static inline unsigned int tcp_optlen(const struct sk_buff *skb) 48static inline unsigned int tcp_optlen(const struct sk_buff *skb)
39{ 49{
40 return (tcp_hdr(skb)->doff - 5) * 4; 50 return (tcp_hdr(skb)->doff - 5) * 4;
diff --git a/include/linux/timecompare.h b/include/linux/timecompare.h
deleted file mode 100644
index 546e2234e4b..00000000000
--- a/include/linux/timecompare.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * Utility code which helps transforming between two different time
3 * bases, called "source" and "target" time in this code.
4 *
5 * Source time has to be provided via the timecounter API while target
6 * time is accessed via a function callback whose prototype
7 * intentionally matches ktime_get() and ktime_get_real(). These
8 * interfaces where chosen like this so that the code serves its
9 * initial purpose without additional glue code.
10 *
11 * This purpose is synchronizing a hardware clock in a NIC with system
12 * time, in order to implement the Precision Time Protocol (PTP,
13 * IEEE1588) with more accurate hardware assisted time stamping. In
14 * that context only synchronization against system time (=
15 * ktime_get_real()) is currently needed. But this utility code might
16 * become useful in other situations, which is why it was written as
17 * general purpose utility code.
18 *
19 * The source timecounter is assumed to return monotonically
20 * increasing time (but this code does its best to compensate if that
21 * is not the case) whereas target time may jump.
22 *
23 * The target time corresponding to a source time is determined by
24 * reading target time, reading source time, reading target time
25 * again, then assuming that average target time corresponds to source
26 * time. In other words, the assumption is that reading the source
27 * time is slow and involves equal time for sending the request and
28 * receiving the reply, whereas reading target time is assumed to be
29 * fast.
30 *
31 * Copyright (C) 2009 Intel Corporation.
32 * Author: Patrick Ohly <patrick.ohly@intel.com>
33 *
34 * This program is free software; you can redistribute it and/or modify it
35 * under the terms and conditions of the GNU General Public License,
36 * version 2, as published by the Free Software Foundation.
37 *
38 * This program is distributed in the hope it will be useful, but WITHOUT
39 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
40 * FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for
41 * more details.
42 *
43 * You should have received a copy of the GNU General Public License along with
44 * this program; if not, write to the Free Software Foundation, Inc.,
45 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
46 */
47#ifndef _LINUX_TIMECOMPARE_H
48#define _LINUX_TIMECOMPARE_H
49
50#include <linux/clocksource.h>
51#include <linux/ktime.h>
52
53/**
54 * struct timecompare - stores state and configuration for the two clocks
55 *
56 * Initialize to zero, then set source/target/num_samples.
57 *
58 * Transformation between source time and target time is done with:
59 * target_time = source_time + offset +
60 * (source_time - last_update) * skew /
61 * TIMECOMPARE_SKEW_RESOLUTION
62 *
63 * @source: used to get source time stamps via timecounter_read()
64 * @target: function returning target time (for example, ktime_get
65 * for monotonic time, or ktime_get_real for wall clock)
66 * @num_samples: number of times that source time and target time are to
67 * be compared when determining their offset
68 * @offset: (target time - source time) at the time of the last update
69 * @skew: average (target time - source time) / delta source time *
70 * TIMECOMPARE_SKEW_RESOLUTION
71 * @last_update: last source time stamp when time offset was measured
72 */
73struct timecompare {
74 struct timecounter *source;
75 ktime_t (*target)(void);
76 int num_samples;
77
78 s64 offset;
79 s64 skew;
80 u64 last_update;
81};
82
83/**
84 * timecompare_transform - transform source time stamp into target time base
85 * @sync: context for time sync
86 * @source_tstamp: the result of timecounter_read() or
87 * timecounter_cyc2time()
88 */
89extern ktime_t timecompare_transform(struct timecompare *sync,
90 u64 source_tstamp);
91
92/**
93 * timecompare_offset - measure current (target time - source time) offset
94 * @sync: context for time sync
95 * @offset: average offset during sample period returned here
96 * @source_tstamp: average source time during sample period returned here
97 *
98 * Returns number of samples used. Might be zero (= no result) in the
99 * unlikely case that target time was monotonically decreasing for all
100 * samples (= broken).
101 */
102extern int timecompare_offset(struct timecompare *sync,
103 s64 *offset,
104 u64 *source_tstamp);
105
106extern void __timecompare_update(struct timecompare *sync,
107 u64 source_tstamp);
108
109/**
110 * timecompare_update - update offset and skew by measuring current offset
111 * @sync: context for time sync
112 * @source_tstamp: the result of timecounter_read() or
113 * timecounter_cyc2time(), pass zero to force update
114 *
115 * Updates are only done at most once per second.
116 */
117static inline void timecompare_update(struct timecompare *sync,
118 u64 source_tstamp)
119{
120 if (!source_tstamp ||
121 (s64)(source_tstamp - sync->last_update) >= NSEC_PER_SEC)
122 __timecompare_update(sync, source_tstamp);
123}
124
125#endif /* _LINUX_TIMECOMPARE_H */
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 0b67d779352..9d81de123c9 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -27,6 +27,11 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
27 return (struct udphdr *)skb_transport_header(skb); 27 return (struct udphdr *)skb_transport_header(skb);
28} 28}
29 29
30static inline struct udphdr *inner_udp_hdr(const struct sk_buff *skb)
31{
32 return (struct udphdr *)skb_inner_transport_header(skb);
33}
34
30#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) 35#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256)
31 36
32static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask) 37static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask)
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
new file mode 100644
index 00000000000..3b8f9d4fc3f
--- /dev/null
+++ b/include/linux/usb/cdc_ncm.h
@@ -0,0 +1,134 @@
1/*
2 * Copyright (C) ST-Ericsson 2010-2012
3 * Contact: Alexey Orishko <alexey.orishko@stericsson.com>
4 * Original author: Hans Petter Selasky <hans.petter.selasky@stericsson.com>
5 *
6 * USB Host Driver for Network Control Model (NCM)
7 * http://www.usb.org/developers/devclass_docs/NCM10.zip
8 *
9 * The NCM encoding, decoding and initialization logic
10 * derives from FreeBSD 8.x. if_cdce.c and if_cdcereg.h
11 *
12 * This software is available to you under a choice of one of two
13 * licenses. You may choose this file to be licensed under the terms
14 * of the GNU General Public License (GPL) Version 2 or the 2-clause
15 * BSD license listed below:
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 */
38
39#define CDC_NCM_COMM_ALTSETTING_NCM 0
40#define CDC_NCM_COMM_ALTSETTING_MBIM 1
41
42#define CDC_NCM_DATA_ALTSETTING_NCM 1
43#define CDC_NCM_DATA_ALTSETTING_MBIM 2
44
45/* CDC NCM subclass 3.2.1 */
46#define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10
47
48/* Maximum NTB length */
49#define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */
50#define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */
51
52/* Minimum value for MaxDatagramSize, ch. 6.2.9 */
53#define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */
54
55/* Minimum value for MaxDatagramSize, ch. 8.1.3 */
56#define CDC_MBIM_MIN_DATAGRAM_SIZE 2048 /* bytes */
57
58#define CDC_NCM_MIN_TX_PKT 512 /* bytes */
59
60/* Default value for MaxDatagramSize */
61#define CDC_NCM_MAX_DATAGRAM_SIZE 8192 /* bytes */
62
63/*
64 * Maximum amount of datagrams in NCM Datagram Pointer Table, not counting
65 * the last NULL entry.
66 */
67#define CDC_NCM_DPT_DATAGRAMS_MAX 40
68
69/* Restart the timer, if amount of datagrams is less than given value */
70#define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3
71#define CDC_NCM_TIMER_PENDING_CNT 2
72#define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC)
73
74/* The following macro defines the minimum header space */
75#define CDC_NCM_MIN_HDR_SIZE \
76 (sizeof(struct usb_cdc_ncm_nth16) + sizeof(struct usb_cdc_ncm_ndp16) + \
77 (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16))
78
79#define CDC_NCM_NDP_SIZE \
80 (sizeof(struct usb_cdc_ncm_ndp16) + \
81 (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16))
82
83#define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \
84 (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
85#define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB)
86
87struct cdc_ncm_ctx {
88 struct usb_cdc_ncm_ntb_parameters ncm_parm;
89 struct hrtimer tx_timer;
90 struct tasklet_struct bh;
91
92 const struct usb_cdc_ncm_desc *func_desc;
93 const struct usb_cdc_mbim_desc *mbim_desc;
94 const struct usb_cdc_header_desc *header_desc;
95 const struct usb_cdc_union_desc *union_desc;
96 const struct usb_cdc_ether_desc *ether_desc;
97
98 struct net_device *netdev;
99 struct usb_device *udev;
100 struct usb_host_endpoint *in_ep;
101 struct usb_host_endpoint *out_ep;
102 struct usb_host_endpoint *status_ep;
103 struct usb_interface *intf;
104 struct usb_interface *control;
105 struct usb_interface *data;
106
107 struct sk_buff *tx_curr_skb;
108 struct sk_buff *tx_rem_skb;
109 __le32 tx_rem_sign;
110
111 spinlock_t mtx;
112 atomic_t stop;
113
114 u32 tx_timer_pending;
115 u32 tx_curr_frame_num;
116 u32 rx_speed;
117 u32 tx_speed;
118 u32 rx_max;
119 u32 tx_max;
120 u32 max_datagram_size;
121 u16 tx_max_datagrams;
122 u16 tx_remainder;
123 u16 tx_modulus;
124 u16 tx_ndp_modulus;
125 u16 tx_seq;
126 u16 rx_seq;
127 u16 connected;
128};
129
130extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting);
131extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf);
132extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign);
133extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in);
134extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset);
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index ddbbb7de894..9bbeabf66c5 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -163,6 +163,16 @@ extern int usbnet_resume(struct usb_interface *);
163extern void usbnet_disconnect(struct usb_interface *); 163extern void usbnet_disconnect(struct usb_interface *);
164extern void usbnet_device_suggests_idle(struct usbnet *dev); 164extern void usbnet_device_suggests_idle(struct usbnet *dev);
165 165
166extern int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
167 u16 value, u16 index, void *data, u16 size);
168extern int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
169 u16 value, u16 index, const void *data, u16 size);
170extern int usbnet_read_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
171 u16 value, u16 index, void *data, u16 size);
172extern int usbnet_write_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
173 u16 value, u16 index, const void *data, u16 size);
174extern int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype,
175 u16 value, u16 index, const void *data, u16 size);
166 176
167/* Drivers that reuse some of the standard USB CDC infrastructure 177/* Drivers that reuse some of the standard USB CDC infrastructure
168 * (notably, using multiple interfaces according to the CDC 178 * (notably, using multiple interfaces according to the CDC
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 9e63e76b20e..df4ef945338 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -172,6 +172,9 @@ extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
172extern int register_inet6addr_notifier(struct notifier_block *nb); 172extern int register_inet6addr_notifier(struct notifier_block *nb);
173extern int unregister_inet6addr_notifier(struct notifier_block *nb); 173extern int unregister_inet6addr_notifier(struct notifier_block *nb);
174 174
175extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
176 struct ipv6_devconf *devconf);
177
175/** 178/**
176 * __in6_dev_get - get inet6_dev pointer from netdevice 179 * __in6_dev_get - get inet6_dev pointer from netdevice
177 * @dev: network device 180 * @dev: network device
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index b5f8988e428..0a996a3517e 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -53,7 +53,6 @@ struct unix_sock {
53 struct path path; 53 struct path path;
54 struct mutex readlock; 54 struct mutex readlock;
55 struct sock *peer; 55 struct sock *peer;
56 struct sock *other;
57 struct list_head link; 56 struct list_head link;
58 atomic_long_t inflight; 57 atomic_long_t inflight;
59 spinlock_t lock; 58 spinlock_t lock;
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h
index 6a76e0a0705..42f21766c53 100644
--- a/include/net/bluetooth/a2mp.h
+++ b/include/net/bluetooth/a2mp.h
@@ -19,13 +19,25 @@
19 19
20#define A2MP_FEAT_EXT 0x8000 20#define A2MP_FEAT_EXT 0x8000
21 21
22enum amp_mgr_state {
23 READ_LOC_AMP_INFO,
24 READ_LOC_AMP_ASSOC,
25 READ_LOC_AMP_ASSOC_FINAL,
26};
27
22struct amp_mgr { 28struct amp_mgr {
29 struct list_head list;
23 struct l2cap_conn *l2cap_conn; 30 struct l2cap_conn *l2cap_conn;
24 struct l2cap_chan *a2mp_chan; 31 struct l2cap_chan *a2mp_chan;
32 struct l2cap_chan *bredr_chan;
25 struct kref kref; 33 struct kref kref;
26 __u8 ident; 34 __u8 ident;
27 __u8 handle; 35 __u8 handle;
36 enum amp_mgr_state state;
28 unsigned long flags; 37 unsigned long flags;
38
39 struct list_head amp_ctrls;
40 struct mutex amp_ctrls_lock;
29}; 41};
30 42
31struct a2mp_cmd { 43struct a2mp_cmd {
@@ -118,9 +130,19 @@ struct a2mp_physlink_rsp {
118#define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 130#define A2MP_STATUS_PHYS_LINK_EXISTS 0x05
119#define A2MP_STATUS_SECURITY_VIOLATION 0x06 131#define A2MP_STATUS_SECURITY_VIOLATION 0x06
120 132
121void amp_mgr_get(struct amp_mgr *mgr); 133extern struct list_head amp_mgr_list;
134extern struct mutex amp_mgr_list_lock;
135
136struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr);
122int amp_mgr_put(struct amp_mgr *mgr); 137int amp_mgr_put(struct amp_mgr *mgr);
138u8 __next_ident(struct amp_mgr *mgr);
123struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, 139struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn,
124 struct sk_buff *skb); 140 struct sk_buff *skb);
141struct amp_mgr *amp_mgr_lookup_by_state(u8 state);
142void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len, void *data);
143void a2mp_discover_amp(struct l2cap_chan *chan);
144void a2mp_send_getinfo_rsp(struct hci_dev *hdev);
145void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status);
146void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status);
125 147
126#endif /* __A2MP_H */ 148#endif /* __A2MP_H */
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h
new file mode 100644
index 00000000000..7ea3db77ba8
--- /dev/null
+++ b/include/net/bluetooth/amp.h
@@ -0,0 +1,54 @@
1/*
2 Copyright (c) 2011,2012 Intel Corp.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License version 2 and
6 only version 2 as published by the Free Software Foundation.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12*/
13
14#ifndef __AMP_H
15#define __AMP_H
16
17struct amp_ctrl {
18 struct list_head list;
19 struct kref kref;
20 __u8 id;
21 __u16 assoc_len_so_far;
22 __u16 assoc_rem_len;
23 __u16 assoc_len;
24 __u8 *assoc;
25};
26
27int amp_ctrl_put(struct amp_ctrl *ctrl);
28void amp_ctrl_get(struct amp_ctrl *ctrl);
29struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id);
30struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id);
31void amp_ctrl_list_flush(struct amp_mgr *mgr);
32
33struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
34 u8 remote_id, bool out);
35
36int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type);
37
38void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr);
39void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle);
40void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr);
41void amp_read_loc_assoc_final_data(struct hci_dev *hdev,
42 struct hci_conn *hcon);
43void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
44 struct hci_conn *hcon);
45void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
46 struct hci_conn *hcon);
47void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle);
48void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle);
49void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon);
50void amp_create_logical_link(struct l2cap_chan *chan);
51void amp_disconnect_logical_link(struct hci_chan *hchan);
52void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason);
53
54#endif /* __AMP_H */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index ede036977ae..2554b3f5222 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -180,7 +180,6 @@ static inline void bacpy(bdaddr_t *dst, bdaddr_t *src)
180} 180}
181 181
182void baswap(bdaddr_t *dst, bdaddr_t *src); 182void baswap(bdaddr_t *dst, bdaddr_t *src);
183char *batostr(bdaddr_t *ba);
184 183
185/* Common socket structures and functions */ 184/* Common socket structures and functions */
186 185
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 76b2b6bdcf3..45eee08157b 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -33,6 +33,8 @@
33#define HCI_LINK_KEY_SIZE 16 33#define HCI_LINK_KEY_SIZE 16
34#define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) 34#define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE)
35 35
36#define HCI_MAX_AMP_ASSOC_SIZE 672
37
36/* HCI dev events */ 38/* HCI dev events */
37#define HCI_DEV_REG 1 39#define HCI_DEV_REG 1
38#define HCI_DEV_UNREG 2 40#define HCI_DEV_UNREG 2
@@ -113,6 +115,7 @@ enum {
113 HCI_SSP_ENABLED, 115 HCI_SSP_ENABLED,
114 HCI_HS_ENABLED, 116 HCI_HS_ENABLED,
115 HCI_LE_ENABLED, 117 HCI_LE_ENABLED,
118 HCI_LE_PERIPHERAL,
116 HCI_CONNECTABLE, 119 HCI_CONNECTABLE,
117 HCI_DISCOVERABLE, 120 HCI_DISCOVERABLE,
118 HCI_LINK_SECURITY, 121 HCI_LINK_SECURITY,
@@ -151,7 +154,7 @@ enum {
151#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 154#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
152#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 155#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */
153#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 156#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */
154#define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ 157#define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
155#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 158#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */
156#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 159#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
157 160
@@ -196,6 +199,7 @@ enum {
196#define ACL_START_NO_FLUSH 0x00 199#define ACL_START_NO_FLUSH 0x00
197#define ACL_CONT 0x01 200#define ACL_CONT 0x01
198#define ACL_START 0x02 201#define ACL_START 0x02
202#define ACL_COMPLETE 0x03
199#define ACL_ACTIVE_BCAST 0x04 203#define ACL_ACTIVE_BCAST 0x04
200#define ACL_PICO_BCAST 0x08 204#define ACL_PICO_BCAST 0x08
201 205
@@ -205,6 +209,7 @@ enum {
205#define ESCO_LINK 0x02 209#define ESCO_LINK 0x02
206/* Low Energy links do not have defined link type. Use invented one */ 210/* Low Energy links do not have defined link type. Use invented one */
207#define LE_LINK 0x80 211#define LE_LINK 0x80
212#define AMP_LINK 0x81
208 213
209/* LMP features */ 214/* LMP features */
210#define LMP_3SLOT 0x01 215#define LMP_3SLOT 0x01
@@ -314,6 +319,9 @@ enum {
314#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 319#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00
315#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 320#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01
316 321
322/* The core spec defines 127 as the "not available" value */
323#define HCI_TX_POWER_INVALID 127
324
317/* Extended Inquiry Response field types */ 325/* Extended Inquiry Response field types */
318#define EIR_FLAGS 0x01 /* flags */ 326#define EIR_FLAGS 0x01 /* flags */
319#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 327#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */
@@ -330,6 +338,13 @@ enum {
330#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ 338#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */
331#define EIR_DEVICE_ID 0x10 /* device ID */ 339#define EIR_DEVICE_ID 0x10 /* device ID */
332 340
341/* Low Energy Advertising Flags */
342#define LE_AD_LIMITED 0x01 /* Limited Discoverable */
343#define LE_AD_GENERAL 0x02 /* General Discoverable */
344#define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */
345#define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */
346#define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */
347
333/* ----- HCI Commands ---- */ 348/* ----- HCI Commands ---- */
334#define HCI_OP_NOP 0x0000 349#define HCI_OP_NOP 0x0000
335 350
@@ -556,12 +571,46 @@ struct hci_cp_accept_phy_link {
556 __u8 key[HCI_AMP_LINK_KEY_SIZE]; 571 __u8 key[HCI_AMP_LINK_KEY_SIZE];
557} __packed; 572} __packed;
558 573
559#define HCI_OP_DISCONN_PHY_LINK 0x0437 574#define HCI_OP_DISCONN_PHY_LINK 0x0437
560struct hci_cp_disconn_phy_link { 575struct hci_cp_disconn_phy_link {
561 __u8 phy_handle; 576 __u8 phy_handle;
562 __u8 reason; 577 __u8 reason;
563} __packed; 578} __packed;
564 579
580struct ext_flow_spec {
581 __u8 id;
582 __u8 stype;
583 __le16 msdu;
584 __le32 sdu_itime;
585 __le32 acc_lat;
586 __le32 flush_to;
587} __packed;
588
589#define HCI_OP_CREATE_LOGICAL_LINK 0x0438
590#define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439
591struct hci_cp_create_accept_logical_link {
592 __u8 phy_handle;
593 struct ext_flow_spec tx_flow_spec;
594 struct ext_flow_spec rx_flow_spec;
595} __packed;
596
597#define HCI_OP_DISCONN_LOGICAL_LINK 0x043a
598struct hci_cp_disconn_logical_link {
599 __le16 log_handle;
600} __packed;
601
602#define HCI_OP_LOGICAL_LINK_CANCEL 0x043b
603struct hci_cp_logical_link_cancel {
604 __u8 phy_handle;
605 __u8 flow_spec_id;
606} __packed;
607
608struct hci_rp_logical_link_cancel {
609 __u8 status;
610 __u8 phy_handle;
611 __u8 flow_spec_id;
612} __packed;
613
565#define HCI_OP_SNIFF_MODE 0x0803 614#define HCI_OP_SNIFF_MODE 0x0803
566struct hci_cp_sniff_mode { 615struct hci_cp_sniff_mode {
567 __le16 handle; 616 __le16 handle;
@@ -894,6 +943,22 @@ struct hci_rp_le_read_buffer_size {
894 __u8 le_max_pkt; 943 __u8 le_max_pkt;
895} __packed; 944} __packed;
896 945
946#define HCI_OP_LE_READ_ADV_TX_POWER 0x2007
947struct hci_rp_le_read_adv_tx_power {
948 __u8 status;
949 __s8 tx_power;
950} __packed;
951
952#define HCI_MAX_AD_LENGTH 31
953
954#define HCI_OP_LE_SET_ADV_DATA 0x2008
955struct hci_cp_le_set_adv_data {
956 __u8 length;
957 __u8 data[HCI_MAX_AD_LENGTH];
958} __packed;
959
960#define HCI_OP_LE_SET_ADV_ENABLE 0x200a
961
897#define HCI_OP_LE_SET_SCAN_PARAM 0x200b 962#define HCI_OP_LE_SET_SCAN_PARAM 0x200b
898struct hci_cp_le_set_scan_param { 963struct hci_cp_le_set_scan_param {
899 __u8 type; 964 __u8 type;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index e7d45460988..014a2eaa538 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -73,6 +73,7 @@ struct discovery_state {
73struct hci_conn_hash { 73struct hci_conn_hash {
74 struct list_head list; 74 struct list_head list;
75 unsigned int acl_num; 75 unsigned int acl_num;
76 unsigned int amp_num;
76 unsigned int sco_num; 77 unsigned int sco_num;
77 unsigned int le_num; 78 unsigned int le_num;
78}; 79};
@@ -124,6 +125,14 @@ struct le_scan_params {
124 125
125#define HCI_MAX_SHORT_NAME_LENGTH 10 126#define HCI_MAX_SHORT_NAME_LENGTH 10
126 127
128struct amp_assoc {
129 __u16 len;
130 __u16 offset;
131 __u16 rem_len;
132 __u16 len_so_far;
133 __u8 data[HCI_MAX_AMP_ASSOC_SIZE];
134};
135
127#define NUM_REASSEMBLY 4 136#define NUM_REASSEMBLY 4
128struct hci_dev { 137struct hci_dev {
129 struct list_head list; 138 struct list_head list;
@@ -177,6 +186,8 @@ struct hci_dev {
177 __u32 amp_max_flush_to; 186 __u32 amp_max_flush_to;
178 __u32 amp_be_flush_to; 187 __u32 amp_be_flush_to;
179 188
189 struct amp_assoc loc_assoc;
190
180 __u8 flow_ctl_mode; 191 __u8 flow_ctl_mode;
181 192
182 unsigned int auto_accept_delay; 193 unsigned int auto_accept_delay;
@@ -252,8 +263,6 @@ struct hci_dev {
252 263
253 struct sk_buff_head driver_init; 264 struct sk_buff_head driver_init;
254 265
255 void *core_data;
256
257 atomic_t promisc; 266 atomic_t promisc;
258 267
259 struct dentry *debugfs; 268 struct dentry *debugfs;
@@ -269,6 +278,10 @@ struct hci_dev {
269 struct work_struct le_scan; 278 struct work_struct le_scan;
270 struct le_scan_params le_scan_params; 279 struct le_scan_params le_scan_params;
271 280
281 __s8 adv_tx_power;
282 __u8 adv_data[HCI_MAX_AD_LENGTH];
283 __u8 adv_data_len;
284
272 int (*open)(struct hci_dev *hdev); 285 int (*open)(struct hci_dev *hdev);
273 int (*close)(struct hci_dev *hdev); 286 int (*close)(struct hci_dev *hdev);
274 int (*flush)(struct hci_dev *hdev); 287 int (*flush)(struct hci_dev *hdev);
@@ -277,6 +290,8 @@ struct hci_dev {
277 int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); 290 int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
278}; 291};
279 292
293#define HCI_PHY_HANDLE(handle) (handle & 0xff)
294
280struct hci_conn { 295struct hci_conn {
281 struct list_head list; 296 struct list_head list;
282 297
@@ -310,6 +325,7 @@ struct hci_conn {
310 325
311 __u8 remote_cap; 326 __u8 remote_cap;
312 __u8 remote_auth; 327 __u8 remote_auth;
328 __u8 remote_id;
313 bool flush_key; 329 bool flush_key;
314 330
315 unsigned int sent; 331 unsigned int sent;
@@ -339,10 +355,11 @@ struct hci_conn {
339 355
340struct hci_chan { 356struct hci_chan {
341 struct list_head list; 357 struct list_head list;
342 358 __u16 handle;
343 struct hci_conn *conn; 359 struct hci_conn *conn;
344 struct sk_buff_head data_q; 360 struct sk_buff_head data_q;
345 unsigned int sent; 361 unsigned int sent;
362 __u8 state;
346}; 363};
347 364
348extern struct list_head hci_dev_list; 365extern struct list_head hci_dev_list;
@@ -359,7 +376,7 @@ extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt);
359extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, 376extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb,
360 u16 flags); 377 u16 flags);
361 378
362extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); 379extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags);
363extern void sco_connect_cfm(struct hci_conn *hcon, __u8 status); 380extern void sco_connect_cfm(struct hci_conn *hcon, __u8 status);
364extern void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason); 381extern void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason);
365extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb); 382extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb);
@@ -438,6 +455,9 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
438 case ACL_LINK: 455 case ACL_LINK:
439 h->acl_num++; 456 h->acl_num++;
440 break; 457 break;
458 case AMP_LINK:
459 h->amp_num++;
460 break;
441 case LE_LINK: 461 case LE_LINK:
442 h->le_num++; 462 h->le_num++;
443 break; 463 break;
@@ -459,6 +479,9 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
459 case ACL_LINK: 479 case ACL_LINK:
460 h->acl_num--; 480 h->acl_num--;
461 break; 481 break;
482 case AMP_LINK:
483 h->amp_num--;
484 break;
462 case LE_LINK: 485 case LE_LINK:
463 h->le_num--; 486 h->le_num--;
464 break; 487 break;
@@ -475,6 +498,8 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type)
475 switch (type) { 498 switch (type) {
476 case ACL_LINK: 499 case ACL_LINK:
477 return h->acl_num; 500 return h->acl_num;
501 case AMP_LINK:
502 return h->amp_num;
478 case LE_LINK: 503 case LE_LINK:
479 return h->le_num; 504 return h->le_num;
480 case SCO_LINK: 505 case SCO_LINK:
@@ -552,10 +577,12 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst);
552int hci_conn_del(struct hci_conn *conn); 577int hci_conn_del(struct hci_conn *conn);
553void hci_conn_hash_flush(struct hci_dev *hdev); 578void hci_conn_hash_flush(struct hci_dev *hdev);
554void hci_conn_check_pending(struct hci_dev *hdev); 579void hci_conn_check_pending(struct hci_dev *hdev);
580void hci_conn_accept(struct hci_conn *conn, int mask);
555 581
556struct hci_chan *hci_chan_create(struct hci_conn *conn); 582struct hci_chan *hci_chan_create(struct hci_conn *conn);
557void hci_chan_del(struct hci_chan *chan); 583void hci_chan_del(struct hci_chan *chan);
558void hci_chan_list_flush(struct hci_conn *conn); 584void hci_chan_list_flush(struct hci_conn *conn);
585struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle);
559 586
560struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, 587struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
561 __u8 dst_type, __u8 sec_level, __u8 auth_type); 588 __u8 dst_type, __u8 sec_level, __u8 auth_type);
@@ -584,7 +611,10 @@ static inline void hci_conn_put(struct hci_conn *conn)
584 611
585 if (atomic_dec_and_test(&conn->refcnt)) { 612 if (atomic_dec_and_test(&conn->refcnt)) {
586 unsigned long timeo; 613 unsigned long timeo;
587 if (conn->type == ACL_LINK || conn->type == LE_LINK) { 614
615 switch (conn->type) {
616 case ACL_LINK:
617 case LE_LINK:
588 del_timer(&conn->idle_timer); 618 del_timer(&conn->idle_timer);
589 if (conn->state == BT_CONNECTED) { 619 if (conn->state == BT_CONNECTED) {
590 timeo = conn->disc_timeout; 620 timeo = conn->disc_timeout;
@@ -593,12 +623,20 @@ static inline void hci_conn_put(struct hci_conn *conn)
593 } else { 623 } else {
594 timeo = msecs_to_jiffies(10); 624 timeo = msecs_to_jiffies(10);
595 } 625 }
596 } else { 626 break;
627
628 case AMP_LINK:
629 timeo = conn->disc_timeout;
630 break;
631
632 default:
597 timeo = msecs_to_jiffies(10); 633 timeo = msecs_to_jiffies(10);
634 break;
598 } 635 }
636
599 cancel_delayed_work(&conn->disc_work); 637 cancel_delayed_work(&conn->disc_work);
600 queue_delayed_work(conn->hdev->workqueue, 638 queue_delayed_work(conn->hdev->workqueue,
601 &conn->disc_work, timeo); 639 &conn->disc_work, timeo);
602 } 640 }
603} 641}
604 642
@@ -650,7 +688,7 @@ static inline uint8_t __hci_num_ctrl(void)
650} 688}
651 689
652struct hci_dev *hci_dev_get(int index); 690struct hci_dev *hci_dev_get(int index);
653struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); 691struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src);
654 692
655struct hci_dev *hci_alloc_dev(void); 693struct hci_dev *hci_alloc_dev(void);
656void hci_free_dev(struct hci_dev *hdev); 694void hci_free_dev(struct hci_dev *hdev);
@@ -699,6 +737,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
699 u8 *randomizer); 737 u8 *randomizer);
700int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); 738int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
701 739
740int hci_update_ad(struct hci_dev *hdev);
741
702void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 742void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
703 743
704int hci_recv_frame(struct sk_buff *skb); 744int hci_recv_frame(struct sk_buff *skb);
@@ -715,22 +755,51 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
715#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) 755#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev))
716 756
717/* ----- LMP capabilities ----- */ 757/* ----- LMP capabilities ----- */
718#define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH)
719#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) 758#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT)
759#define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH)
760#define lmp_hold_capable(dev) ((dev)->features[0] & LMP_HOLD)
720#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) 761#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF)
721#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) 762#define lmp_park_capable(dev) ((dev)->features[1] & LMP_PARK)
763#define lmp_inq_rssi_capable(dev) ((dev)->features[3] & LMP_RSSI_INQ)
722#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) 764#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
765#define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR))
766#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
767#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
768#define lmp_pause_enc_capable(dev) ((dev)->features[5] & LMP_PAUSE_ENC)
769#define lmp_ext_inq_capable(dev) ((dev)->features[6] & LMP_EXT_INQ)
770#define lmp_le_br_capable(dev) !!((dev)->features[6] & LMP_SIMUL_LE_BR)
723#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) 771#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR)
724#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) 772#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
725#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) 773#define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO)
726#define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) 774#define lmp_inq_tx_pwr_capable(dev) ((dev)->features[7] & LMP_INQ_TX_PWR)
775#define lmp_ext_feat_capable(dev) ((dev)->features[7] & LMP_EXTFEATURES)
727 776
728/* ----- Extended LMP capabilities ----- */ 777/* ----- Extended LMP capabilities ----- */
729#define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) 778#define lmp_host_ssp_capable(dev) ((dev)->host_features[0] & LMP_HOST_SSP)
779#define lmp_host_le_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE)
780#define lmp_host_le_br_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE_BREDR)
781
782/* returns true if at least one AMP active */
783static inline bool hci_amp_capable(void)
784{
785 struct hci_dev *hdev;
786 bool ret = false;
787
788 read_lock(&hci_dev_list_lock);
789 list_for_each_entry(hdev, &hci_dev_list, list)
790 if (hdev->amp_type == HCI_AMP &&
791 test_bit(HCI_UP, &hdev->flags))
792 ret = true;
793 read_unlock(&hci_dev_list_lock);
794
795 return ret;
796}
730 797
731/* ----- HCI protocols ----- */ 798/* ----- HCI protocols ----- */
799#define HCI_PROTO_DEFER 0x01
800
732static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, 801static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
733 __u8 type) 802 __u8 type, __u8 *flags)
734{ 803{
735 switch (type) { 804 switch (type) {
736 case ACL_LINK: 805 case ACL_LINK:
@@ -738,7 +807,7 @@ static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
738 807
739 case SCO_LINK: 808 case SCO_LINK:
740 case ESCO_LINK: 809 case ESCO_LINK:
741 return sco_connect_ind(hdev, bdaddr); 810 return sco_connect_ind(hdev, bdaddr, flags);
742 811
743 default: 812 default:
744 BT_ERR("unknown link type %d", type); 813 BT_ERR("unknown link type %d", type);
@@ -789,6 +858,10 @@ static inline void hci_proto_disconn_cfm(struct hci_conn *conn, __u8 reason)
789 sco_disconn_cfm(conn, reason); 858 sco_disconn_cfm(conn, reason);
790 break; 859 break;
791 860
861 /* L2CAP would be handled for BREDR chan */
862 case AMP_LINK:
863 break;
864
792 default: 865 default:
793 BT_ERR("unknown link type %d", conn->type); 866 BT_ERR("unknown link type %d", conn->type);
794 break; 867 break;
@@ -841,7 +914,7 @@ struct hci_cb {
841 914
842static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) 915static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
843{ 916{
844 struct list_head *p; 917 struct hci_cb *cb;
845 __u8 encrypt; 918 __u8 encrypt;
846 919
847 hci_proto_auth_cfm(conn, status); 920 hci_proto_auth_cfm(conn, status);
@@ -852,8 +925,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
852 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; 925 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00;
853 926
854 read_lock(&hci_cb_list_lock); 927 read_lock(&hci_cb_list_lock);
855 list_for_each(p, &hci_cb_list) { 928 list_for_each_entry(cb, &hci_cb_list, list) {
856 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
857 if (cb->security_cfm) 929 if (cb->security_cfm)
858 cb->security_cfm(conn, status, encrypt); 930 cb->security_cfm(conn, status, encrypt);
859 } 931 }
@@ -863,7 +935,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
863static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, 935static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
864 __u8 encrypt) 936 __u8 encrypt)
865{ 937{
866 struct list_head *p; 938 struct hci_cb *cb;
867 939
868 if (conn->sec_level == BT_SECURITY_SDP) 940 if (conn->sec_level == BT_SECURITY_SDP)
869 conn->sec_level = BT_SECURITY_LOW; 941 conn->sec_level = BT_SECURITY_LOW;
@@ -874,8 +946,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
874 hci_proto_encrypt_cfm(conn, status, encrypt); 946 hci_proto_encrypt_cfm(conn, status, encrypt);
875 947
876 read_lock(&hci_cb_list_lock); 948 read_lock(&hci_cb_list_lock);
877 list_for_each(p, &hci_cb_list) { 949 list_for_each_entry(cb, &hci_cb_list, list) {
878 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
879 if (cb->security_cfm) 950 if (cb->security_cfm)
880 cb->security_cfm(conn, status, encrypt); 951 cb->security_cfm(conn, status, encrypt);
881 } 952 }
@@ -884,11 +955,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
884 955
885static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) 956static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
886{ 957{
887 struct list_head *p; 958 struct hci_cb *cb;
888 959
889 read_lock(&hci_cb_list_lock); 960 read_lock(&hci_cb_list_lock);
890 list_for_each(p, &hci_cb_list) { 961 list_for_each_entry(cb, &hci_cb_list, list) {
891 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
892 if (cb->key_change_cfm) 962 if (cb->key_change_cfm)
893 cb->key_change_cfm(conn, status); 963 cb->key_change_cfm(conn, status);
894 } 964 }
@@ -898,11 +968,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
898static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, 968static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
899 __u8 role) 969 __u8 role)
900{ 970{
901 struct list_head *p; 971 struct hci_cb *cb;
902 972
903 read_lock(&hci_cb_list_lock); 973 read_lock(&hci_cb_list_lock);
904 list_for_each(p, &hci_cb_list) { 974 list_for_each_entry(cb, &hci_cb_list, list) {
905 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
906 if (cb->role_switch_cfm) 975 if (cb->role_switch_cfm)
907 cb->role_switch_cfm(conn, status, role); 976 cb->role_switch_cfm(conn, status, role);
908 } 977 }
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7ed8e356425..7588ef44eba 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -32,13 +32,14 @@
32/* L2CAP defaults */ 32/* L2CAP defaults */
33#define L2CAP_DEFAULT_MTU 672 33#define L2CAP_DEFAULT_MTU 672
34#define L2CAP_DEFAULT_MIN_MTU 48 34#define L2CAP_DEFAULT_MIN_MTU 48
35#define L2CAP_DEFAULT_FLUSH_TO 0xffff 35#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF
36#define L2CAP_EFS_DEFAULT_FLUSH_TO 0xFFFFFFFF
36#define L2CAP_DEFAULT_TX_WINDOW 63 37#define L2CAP_DEFAULT_TX_WINDOW 63
37#define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF 38#define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF
38#define L2CAP_DEFAULT_MAX_TX 3 39#define L2CAP_DEFAULT_MAX_TX 3
39#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ 40#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */
40#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ 41#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */
41#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ 42#define L2CAP_DEFAULT_MAX_PDU_SIZE 1492 /* Sized for AMP packet */
42#define L2CAP_DEFAULT_ACK_TO 200 43#define L2CAP_DEFAULT_ACK_TO 200
43#define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF 44#define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF
44#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF 45#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF
@@ -51,6 +52,8 @@
51#define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) 52#define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000)
52#define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) 53#define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000)
53#define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) 54#define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000)
55#define L2CAP_MOVE_TIMEOUT msecs_to_jiffies(4000)
56#define L2CAP_MOVE_ERTX_TIMEOUT msecs_to_jiffies(60000)
54 57
55#define L2CAP_A2MP_DEFAULT_MTU 670 58#define L2CAP_A2MP_DEFAULT_MTU 670
56 59
@@ -433,6 +436,8 @@ struct l2cap_chan {
433 struct sock *sk; 436 struct sock *sk;
434 437
435 struct l2cap_conn *conn; 438 struct l2cap_conn *conn;
439 struct hci_conn *hs_hcon;
440 struct hci_chan *hs_hchan;
436 struct kref kref; 441 struct kref kref;
437 442
438 __u8 state; 443 __u8 state;
@@ -476,6 +481,12 @@ struct l2cap_chan {
476 unsigned long conn_state; 481 unsigned long conn_state;
477 unsigned long flags; 482 unsigned long flags;
478 483
484 __u8 remote_amp_id;
485 __u8 local_amp_id;
486 __u8 move_id;
487 __u8 move_state;
488 __u8 move_role;
489
479 __u16 next_tx_seq; 490 __u16 next_tx_seq;
480 __u16 expected_ack_seq; 491 __u16 expected_ack_seq;
481 __u16 expected_tx_seq; 492 __u16 expected_tx_seq;
@@ -538,6 +549,7 @@ struct l2cap_ops {
538 void (*state_change) (struct l2cap_chan *chan, 549 void (*state_change) (struct l2cap_chan *chan,
539 int state); 550 int state);
540 void (*ready) (struct l2cap_chan *chan); 551 void (*ready) (struct l2cap_chan *chan);
552 void (*defer) (struct l2cap_chan *chan);
541 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, 553 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
542 unsigned long len, int nb); 554 unsigned long len, int nb);
543}; 555};
@@ -599,7 +611,7 @@ enum {
599 CONF_MTU_DONE, 611 CONF_MTU_DONE,
600 CONF_MODE_DONE, 612 CONF_MODE_DONE,
601 CONF_CONNECT_PEND, 613 CONF_CONNECT_PEND,
602 CONF_NO_FCS_RECV, 614 CONF_RECV_NO_FCS,
603 CONF_STATE2_DEVICE, 615 CONF_STATE2_DEVICE,
604 CONF_EWS_RECV, 616 CONF_EWS_RECV,
605 CONF_LOC_CONF_PEND, 617 CONF_LOC_CONF_PEND,
@@ -640,6 +652,9 @@ enum {
640enum { 652enum {
641 L2CAP_RX_STATE_RECV, 653 L2CAP_RX_STATE_RECV,
642 L2CAP_RX_STATE_SREJ_SENT, 654 L2CAP_RX_STATE_SREJ_SENT,
655 L2CAP_RX_STATE_MOVE,
656 L2CAP_RX_STATE_WAIT_P,
657 L2CAP_RX_STATE_WAIT_F,
643}; 658};
644 659
645enum { 660enum {
@@ -670,6 +685,25 @@ enum {
670 L2CAP_EV_RECV_FRAME, 685 L2CAP_EV_RECV_FRAME,
671}; 686};
672 687
688enum {
689 L2CAP_MOVE_ROLE_NONE,
690 L2CAP_MOVE_ROLE_INITIATOR,
691 L2CAP_MOVE_ROLE_RESPONDER,
692};
693
694enum {
695 L2CAP_MOVE_STABLE,
696 L2CAP_MOVE_WAIT_REQ,
697 L2CAP_MOVE_WAIT_RSP,
698 L2CAP_MOVE_WAIT_RSP_SUCCESS,
699 L2CAP_MOVE_WAIT_CONFIRM,
700 L2CAP_MOVE_WAIT_CONFIRM_RSP,
701 L2CAP_MOVE_WAIT_LOGICAL_COMP,
702 L2CAP_MOVE_WAIT_LOGICAL_CFM,
703 L2CAP_MOVE_WAIT_LOCAL_BUSY,
704 L2CAP_MOVE_WAIT_PREPARE,
705};
706
673void l2cap_chan_hold(struct l2cap_chan *c); 707void l2cap_chan_hold(struct l2cap_chan *c);
674void l2cap_chan_put(struct l2cap_chan *c); 708void l2cap_chan_put(struct l2cap_chan *c);
675 709
@@ -745,6 +779,10 @@ static inline void l2cap_chan_no_ready(struct l2cap_chan *chan)
745{ 779{
746} 780}
747 781
782static inline void l2cap_chan_no_defer(struct l2cap_chan *chan)
783{
784}
785
748extern bool disable_ertm; 786extern bool disable_ertm;
749 787
750int l2cap_init_sockets(void); 788int l2cap_init_sockets(void);
@@ -767,6 +805,12 @@ int l2cap_chan_check_security(struct l2cap_chan *chan);
767void l2cap_chan_set_defaults(struct l2cap_chan *chan); 805void l2cap_chan_set_defaults(struct l2cap_chan *chan);
768int l2cap_ertm_init(struct l2cap_chan *chan); 806int l2cap_ertm_init(struct l2cap_chan *chan);
769void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); 807void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
808void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
770void l2cap_chan_del(struct l2cap_chan *chan, int err); 809void l2cap_chan_del(struct l2cap_chan *chan, int err);
810void l2cap_send_conn_req(struct l2cap_chan *chan);
811void l2cap_move_start(struct l2cap_chan *chan);
812void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan,
813 u8 status);
814void __l2cap_physical_cfm(struct l2cap_chan *chan, int result);
771 815
772#endif /* __L2CAP_H */ 816#endif /* __L2CAP_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7d5b6000378..8e6a6b73b9c 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -58,6 +58,8 @@
58 * structures here describe these capabilities in detail. 58 * structures here describe these capabilities in detail.
59 */ 59 */
60 60
61struct wiphy;
62
61/* 63/*
62 * wireless hardware capability structures 64 * wireless hardware capability structures
63 */ 65 */
@@ -306,6 +308,104 @@ struct key_params {
306}; 308};
307 309
308/** 310/**
311 * struct cfg80211_chan_def - channel definition
312 * @chan: the (control) channel
313 * @width: channel width
314 * @center_freq1: center frequency of first segment
315 * @center_freq2: center frequency of second segment
316 * (only with 80+80 MHz)
317 */
318struct cfg80211_chan_def {
319 struct ieee80211_channel *chan;
320 enum nl80211_chan_width width;
321 u32 center_freq1;
322 u32 center_freq2;
323};
324
325/**
326 * cfg80211_get_chandef_type - return old channel type from chandef
327 * @chandef: the channel definition
328 *
329 * Returns the old channel type (NOHT, HT20, HT40+/-) from a given
330 * chandef, which must have a bandwidth allowing this conversion.
331 */
332static inline enum nl80211_channel_type
333cfg80211_get_chandef_type(const struct cfg80211_chan_def *chandef)
334{
335 switch (chandef->width) {
336 case NL80211_CHAN_WIDTH_20_NOHT:
337 return NL80211_CHAN_NO_HT;
338 case NL80211_CHAN_WIDTH_20:
339 return NL80211_CHAN_HT20;
340 case NL80211_CHAN_WIDTH_40:
341 if (chandef->center_freq1 > chandef->chan->center_freq)
342 return NL80211_CHAN_HT40PLUS;
343 return NL80211_CHAN_HT40MINUS;
344 default:
345 WARN_ON(1);
346 return NL80211_CHAN_NO_HT;
347 }
348}
349
350/**
351 * cfg80211_chandef_create - create channel definition using channel type
352 * @chandef: the channel definition struct to fill
353 * @channel: the control channel
354 * @chantype: the channel type
355 *
356 * Given a channel type, create a channel definition.
357 */
358void cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
359 struct ieee80211_channel *channel,
360 enum nl80211_channel_type chantype);
361
362/**
363 * cfg80211_chandef_identical - check if two channel definitions are identical
364 * @chandef1: first channel definition
365 * @chandef2: second channel definition
366 *
367 * Returns %true if the channels defined by the channel definitions are
368 * identical, %false otherwise.
369 */
370static inline bool
371cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1,
372 const struct cfg80211_chan_def *chandef2)
373{
374 return (chandef1->chan == chandef2->chan &&
375 chandef1->width == chandef2->width &&
376 chandef1->center_freq1 == chandef2->center_freq1 &&
377 chandef1->center_freq2 == chandef2->center_freq2);
378}
379
380/**
381 * cfg80211_chandef_compatible - check if two channel definitions are compatible
382 * @chandef1: first channel definition
383 * @chandef2: second channel definition
384 *
385 * Returns %NULL if the given channel definitions are incompatible,
386 * chandef1 or chandef2 otherwise.
387 */
388const struct cfg80211_chan_def *
389cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1,
390 const struct cfg80211_chan_def *chandef2);
391
392/**
393 * cfg80211_chandef_valid - check if a channel definition is valid
394 * @chandef: the channel definition to check
395 */
396bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef);
397
398/**
399 * cfg80211_chandef_usable - check if secondary channels can be used
400 * @wiphy: the wiphy to validate against
401 * @chandef: the channel definition to check
402 * @prohibited_flags: the regulatory chanenl flags that must not be set
403 */
404bool cfg80211_chandef_usable(struct wiphy *wiphy,
405 const struct cfg80211_chan_def *chandef,
406 u32 prohibited_flags);
407
408/**
309 * enum survey_info_flags - survey information flags 409 * enum survey_info_flags - survey information flags
310 * 410 *
311 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in 411 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
@@ -426,8 +526,7 @@ struct cfg80211_beacon_data {
426 * 526 *
427 * Used to configure an AP interface. 527 * Used to configure an AP interface.
428 * 528 *
429 * @channel: the channel to start the AP on 529 * @chandef: defines the channel to use
430 * @channel_type: the channel type to use
431 * @beacon: beacon data 530 * @beacon: beacon data
432 * @beacon_interval: beacon interval 531 * @beacon_interval: beacon interval
433 * @dtim_period: DTIM period 532 * @dtim_period: DTIM period
@@ -439,10 +538,11 @@ struct cfg80211_beacon_data {
439 * @privacy: the BSS uses privacy 538 * @privacy: the BSS uses privacy
440 * @auth_type: Authentication type (algorithm) 539 * @auth_type: Authentication type (algorithm)
441 * @inactivity_timeout: time in seconds to determine station's inactivity. 540 * @inactivity_timeout: time in seconds to determine station's inactivity.
541 * @p2p_ctwindow: P2P CT Window
542 * @p2p_opp_ps: P2P opportunistic PS
442 */ 543 */
443struct cfg80211_ap_settings { 544struct cfg80211_ap_settings {
444 struct ieee80211_channel *channel; 545 struct cfg80211_chan_def chandef;
445 enum nl80211_channel_type channel_type;
446 546
447 struct cfg80211_beacon_data beacon; 547 struct cfg80211_beacon_data beacon;
448 548
@@ -454,6 +554,8 @@ struct cfg80211_ap_settings {
454 bool privacy; 554 bool privacy;
455 enum nl80211_auth_type auth_type; 555 enum nl80211_auth_type auth_type;
456 int inactivity_timeout; 556 int inactivity_timeout;
557 u8 p2p_ctwindow;
558 bool p2p_opp_ps;
457}; 559};
458 560
459/** 561/**
@@ -498,6 +600,7 @@ enum station_parameters_apply_mask {
498 * @plink_action: plink action to take 600 * @plink_action: plink action to take
499 * @plink_state: set the peer link state for a station 601 * @plink_state: set the peer link state for a station
500 * @ht_capa: HT capabilities of station 602 * @ht_capa: HT capabilities of station
603 * @vht_capa: VHT capabilities of station
501 * @uapsd_queues: bitmap of queues configured for uapsd. same format 604 * @uapsd_queues: bitmap of queues configured for uapsd. same format
502 * as the AC bitmap in the QoS info field 605 * as the AC bitmap in the QoS info field
503 * @max_sp: max Service Period. same format as the MAX_SP in the 606 * @max_sp: max Service Period. same format as the MAX_SP in the
@@ -517,6 +620,7 @@ struct station_parameters {
517 u8 plink_action; 620 u8 plink_action;
518 u8 plink_state; 621 u8 plink_state;
519 struct ieee80211_ht_cap *ht_capa; 622 struct ieee80211_ht_cap *ht_capa;
623 struct ieee80211_vht_cap *vht_capa;
520 u8 uapsd_queues; 624 u8 uapsd_queues;
521 u8 max_sp; 625 u8 max_sp;
522}; 626};
@@ -580,16 +684,24 @@ enum station_info_flags {
580 * Used by the driver to indicate the specific rate transmission 684 * Used by the driver to indicate the specific rate transmission
581 * type for 802.11n transmissions. 685 * type for 802.11n transmissions.
582 * 686 *
583 * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled 687 * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS
584 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission 688 * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS
689 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission
690 * @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission
691 * @RATE_INFO_FLAGS_80P80_MHZ_WIDTH: 80+80 MHz width transmission
692 * @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission
585 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval 693 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
586 * @RATE_INFO_FLAGS_60G: 60gHz MCS 694 * @RATE_INFO_FLAGS_60G: 60GHz MCS
587 */ 695 */
588enum rate_info_flags { 696enum rate_info_flags {
589 RATE_INFO_FLAGS_MCS = 1<<0, 697 RATE_INFO_FLAGS_MCS = BIT(0),
590 RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, 698 RATE_INFO_FLAGS_VHT_MCS = BIT(1),
591 RATE_INFO_FLAGS_SHORT_GI = 1<<2, 699 RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2),
592 RATE_INFO_FLAGS_60G = 1<<3, 700 RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3),
701 RATE_INFO_FLAGS_80P80_MHZ_WIDTH = BIT(4),
702 RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(5),
703 RATE_INFO_FLAGS_SHORT_GI = BIT(6),
704 RATE_INFO_FLAGS_60G = BIT(7),
593}; 705};
594 706
595/** 707/**
@@ -600,11 +712,13 @@ enum rate_info_flags {
600 * @flags: bitflag of flags from &enum rate_info_flags 712 * @flags: bitflag of flags from &enum rate_info_flags
601 * @mcs: mcs index if struct describes a 802.11n bitrate 713 * @mcs: mcs index if struct describes a 802.11n bitrate
602 * @legacy: bitrate in 100kbit/s for 802.11abg 714 * @legacy: bitrate in 100kbit/s for 802.11abg
715 * @nss: number of streams (VHT only)
603 */ 716 */
604struct rate_info { 717struct rate_info {
605 u8 flags; 718 u8 flags;
606 u8 mcs; 719 u8 mcs;
607 u16 legacy; 720 u16 legacy;
721 u8 nss;
608}; 722};
609 723
610/** 724/**
@@ -803,6 +917,8 @@ struct mpath_info {
803 * @ap_isolate: do not forward packets between connected stations 917 * @ap_isolate: do not forward packets between connected stations
804 * @ht_opmode: HT Operation mode 918 * @ht_opmode: HT Operation mode
805 * (u16 = opmode, -1 = do not change) 919 * (u16 = opmode, -1 = do not change)
920 * @p2p_ctwindow: P2P CT Window (-1 = no change)
921 * @p2p_opp_ps: P2P opportunistic PS (-1 = no change)
806 */ 922 */
807struct bss_parameters { 923struct bss_parameters {
808 int use_cts_prot; 924 int use_cts_prot;
@@ -812,6 +928,7 @@ struct bss_parameters {
812 u8 basic_rates_len; 928 u8 basic_rates_len;
813 int ap_isolate; 929 int ap_isolate;
814 int ht_opmode; 930 int ht_opmode;
931 s8 p2p_ctwindow, p2p_opp_ps;
815}; 932};
816 933
817/** 934/**
@@ -907,8 +1024,7 @@ struct mesh_config {
907 1024
908/** 1025/**
909 * struct mesh_setup - 802.11s mesh setup configuration 1026 * struct mesh_setup - 802.11s mesh setup configuration
910 * @channel: the channel to start the mesh network on 1027 * @chandef: defines the channel to use
911 * @channel_type: the channel type to use
912 * @mesh_id: the mesh ID 1028 * @mesh_id: the mesh ID
913 * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes 1029 * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes
914 * @sync_method: which synchronization method to use 1030 * @sync_method: which synchronization method to use
@@ -923,8 +1039,7 @@ struct mesh_config {
923 * These parameters are fixed when the mesh is created. 1039 * These parameters are fixed when the mesh is created.
924 */ 1040 */
925struct mesh_setup { 1041struct mesh_setup {
926 struct ieee80211_channel *channel; 1042 struct cfg80211_chan_def chandef;
927 enum nl80211_channel_type channel_type;
928 const u8 *mesh_id; 1043 const u8 *mesh_id;
929 u8 mesh_id_len; 1044 u8 mesh_id_len;
930 u8 sync_method; 1045 u8 sync_method;
@@ -955,9 +1070,6 @@ struct ieee80211_txq_params {
955 u8 aifs; 1070 u8 aifs;
956}; 1071};
957 1072
958/* from net/wireless.h */
959struct wiphy;
960
961/** 1073/**
962 * DOC: Scanning and BSS list handling 1074 * DOC: Scanning and BSS list handling
963 * 1075 *
@@ -1000,8 +1112,10 @@ struct cfg80211_ssid {
1000 * @n_channels: total number of channels to scan 1112 * @n_channels: total number of channels to scan
1001 * @ie: optional information element(s) to add into Probe Request or %NULL 1113 * @ie: optional information element(s) to add into Probe Request or %NULL
1002 * @ie_len: length of ie in octets 1114 * @ie_len: length of ie in octets
1115 * @flags: bit field of flags controlling operation
1003 * @rates: bitmap of rates to advertise for each band 1116 * @rates: bitmap of rates to advertise for each band
1004 * @wiphy: the wiphy this was for 1117 * @wiphy: the wiphy this was for
1118 * @scan_start: time (in jiffies) when the scan started
1005 * @wdev: the wireless device to scan for 1119 * @wdev: the wireless device to scan for
1006 * @aborted: (internal) scan request was notified as aborted 1120 * @aborted: (internal) scan request was notified as aborted
1007 * @no_cck: used to send probe requests at non CCK rate in 2GHz band 1121 * @no_cck: used to send probe requests at non CCK rate in 2GHz band
@@ -1012,6 +1126,7 @@ struct cfg80211_scan_request {
1012 u32 n_channels; 1126 u32 n_channels;
1013 const u8 *ie; 1127 const u8 *ie;
1014 size_t ie_len; 1128 size_t ie_len;
1129 u32 flags;
1015 1130
1016 u32 rates[IEEE80211_NUM_BANDS]; 1131 u32 rates[IEEE80211_NUM_BANDS];
1017 1132
@@ -1019,6 +1134,7 @@ struct cfg80211_scan_request {
1019 1134
1020 /* internal */ 1135 /* internal */
1021 struct wiphy *wiphy; 1136 struct wiphy *wiphy;
1137 unsigned long scan_start;
1022 bool aborted; 1138 bool aborted;
1023 bool no_cck; 1139 bool no_cck;
1024 1140
@@ -1044,6 +1160,7 @@ struct cfg80211_match_set {
1044 * @interval: interval between each scheduled scan cycle 1160 * @interval: interval between each scheduled scan cycle
1045 * @ie: optional information element(s) to add into Probe Request or %NULL 1161 * @ie: optional information element(s) to add into Probe Request or %NULL
1046 * @ie_len: length of ie in octets 1162 * @ie_len: length of ie in octets
1163 * @flags: bit field of flags controlling operation
1047 * @match_sets: sets of parameters to be matched for a scan result 1164 * @match_sets: sets of parameters to be matched for a scan result
1048 * entry to be considered valid and to be passed to the host 1165 * entry to be considered valid and to be passed to the host
1049 * (others are filtered out). 1166 * (others are filtered out).
@@ -1061,6 +1178,7 @@ struct cfg80211_sched_scan_request {
1061 u32 interval; 1178 u32 interval;
1062 const u8 *ie; 1179 const u8 *ie;
1063 size_t ie_len; 1180 size_t ie_len;
1181 u32 flags;
1064 struct cfg80211_match_set *match_sets; 1182 struct cfg80211_match_set *match_sets;
1065 int n_match_sets; 1183 int n_match_sets;
1066 s32 rssi_thold; 1184 s32 rssi_thold;
@@ -1068,6 +1186,7 @@ struct cfg80211_sched_scan_request {
1068 /* internal */ 1186 /* internal */
1069 struct wiphy *wiphy; 1187 struct wiphy *wiphy;
1070 struct net_device *dev; 1188 struct net_device *dev;
1189 unsigned long scan_start;
1071 1190
1072 /* keep last */ 1191 /* keep last */
1073 struct ieee80211_channel *channels[0]; 1192 struct ieee80211_channel *channels[0];
@@ -1087,6 +1206,18 @@ enum cfg80211_signal_type {
1087}; 1206};
1088 1207
1089/** 1208/**
1209 * struct cfg80211_bss_ie_data - BSS entry IE data
1210 * @rcu_head: internal use, for freeing
1211 * @len: length of the IEs
1212 * @data: IE data
1213 */
1214struct cfg80211_bss_ies {
1215 struct rcu_head rcu_head;
1216 int len;
1217 u8 data[];
1218};
1219
1220/**
1090 * struct cfg80211_bss - BSS description 1221 * struct cfg80211_bss - BSS description
1091 * 1222 *
1092 * This structure describes a BSS (which may also be a mesh network) 1223 * This structure describes a BSS (which may also be a mesh network)
@@ -1097,36 +1228,34 @@ enum cfg80211_signal_type {
1097 * @tsf: timestamp of last received update 1228 * @tsf: timestamp of last received update
1098 * @beacon_interval: the beacon interval as from the frame 1229 * @beacon_interval: the beacon interval as from the frame
1099 * @capability: the capability field in host byte order 1230 * @capability: the capability field in host byte order
1100 * @information_elements: the information elements (Note that there 1231 * @ies: the information elements (Note that there
1101 * is no guarantee that these are well-formed!); this is a pointer to 1232 * is no guarantee that these are well-formed!); this is a pointer to
1102 * either the beacon_ies or proberesp_ies depending on whether Probe 1233 * either the beacon_ies or proberesp_ies depending on whether Probe
1103 * Response frame has been received 1234 * Response frame has been received
1104 * @len_information_elements: total length of the information elements
1105 * @beacon_ies: the information elements from the last Beacon frame 1235 * @beacon_ies: the information elements from the last Beacon frame
1106 * @len_beacon_ies: total length of the beacon_ies
1107 * @proberesp_ies: the information elements from the last Probe Response frame 1236 * @proberesp_ies: the information elements from the last Probe Response frame
1108 * @len_proberesp_ies: total length of the proberesp_ies
1109 * @signal: signal strength value (type depends on the wiphy's signal_type) 1237 * @signal: signal strength value (type depends on the wiphy's signal_type)
1110 * @free_priv: function pointer to free private data 1238 * @free_priv: function pointer to free private data
1111 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes 1239 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
1112 */ 1240 */
1113struct cfg80211_bss { 1241struct cfg80211_bss {
1242 u64 tsf;
1243
1114 struct ieee80211_channel *channel; 1244 struct ieee80211_channel *channel;
1115 1245
1116 u8 bssid[ETH_ALEN]; 1246 const struct cfg80211_bss_ies __rcu *ies;
1117 u64 tsf; 1247 const struct cfg80211_bss_ies __rcu *beacon_ies;
1248 const struct cfg80211_bss_ies __rcu *proberesp_ies;
1249
1250 void (*free_priv)(struct cfg80211_bss *bss);
1251
1252 s32 signal;
1253
1118 u16 beacon_interval; 1254 u16 beacon_interval;
1119 u16 capability; 1255 u16 capability;
1120 u8 *information_elements;
1121 size_t len_information_elements;
1122 u8 *beacon_ies;
1123 size_t len_beacon_ies;
1124 u8 *proberesp_ies;
1125 size_t len_proberesp_ies;
1126 1256
1127 s32 signal; 1257 u8 bssid[ETH_ALEN];
1128 1258
1129 void (*free_priv)(struct cfg80211_bss *bss);
1130 u8 priv[0] __attribute__((__aligned__(sizeof(void *)))); 1259 u8 priv[0] __attribute__((__aligned__(sizeof(void *))));
1131}; 1260};
1132 1261
@@ -1134,6 +1263,9 @@ struct cfg80211_bss {
1134 * ieee80211_bss_get_ie - find IE with given ID 1263 * ieee80211_bss_get_ie - find IE with given ID
1135 * @bss: the bss to search 1264 * @bss: the bss to search
1136 * @ie: the IE ID 1265 * @ie: the IE ID
1266 *
1267 * Note that the return value is an RCU-protected pointer, so
1268 * rcu_read_lock() must be held when calling this function.
1137 * Returns %NULL if not found. 1269 * Returns %NULL if not found.
1138 */ 1270 */
1139const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); 1271const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
@@ -1152,6 +1284,9 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
1152 * @key_len: length of WEP key for shared key authentication 1284 * @key_len: length of WEP key for shared key authentication
1153 * @key_idx: index of WEP key for shared key authentication 1285 * @key_idx: index of WEP key for shared key authentication
1154 * @key: WEP key for shared key authentication 1286 * @key: WEP key for shared key authentication
1287 * @sae_data: Non-IE data to use with SAE or %NULL. This starts with
1288 * Authentication transaction sequence number field.
1289 * @sae_data_len: Length of sae_data buffer in octets
1155 */ 1290 */
1156struct cfg80211_auth_request { 1291struct cfg80211_auth_request {
1157 struct cfg80211_bss *bss; 1292 struct cfg80211_bss *bss;
@@ -1160,6 +1295,8 @@ struct cfg80211_auth_request {
1160 enum nl80211_auth_type auth_type; 1295 enum nl80211_auth_type auth_type;
1161 const u8 *key; 1296 const u8 *key;
1162 u8 key_len, key_idx; 1297 u8 key_len, key_idx;
1298 const u8 *sae_data;
1299 size_t sae_data_len;
1163}; 1300};
1164 1301
1165/** 1302/**
@@ -1252,8 +1389,7 @@ struct cfg80211_disassoc_request {
1252 * @ssid_len: The length of the SSID, will always be non-zero. 1389 * @ssid_len: The length of the SSID, will always be non-zero.
1253 * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not 1390 * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not
1254 * search for IBSSs with a different BSSID. 1391 * search for IBSSs with a different BSSID.
1255 * @channel: The channel to use if no IBSS can be found to join. 1392 * @chandef: defines the channel to use if no other IBSS to join can be found
1256 * @channel_type: channel type (HT mode)
1257 * @channel_fixed: The channel should be fixed -- do not search for 1393 * @channel_fixed: The channel should be fixed -- do not search for
1258 * IBSSs to join on other channels. 1394 * IBSSs to join on other channels.
1259 * @ie: information element(s) to include in the beacon 1395 * @ie: information element(s) to include in the beacon
@@ -1271,8 +1407,7 @@ struct cfg80211_disassoc_request {
1271struct cfg80211_ibss_params { 1407struct cfg80211_ibss_params {
1272 u8 *ssid; 1408 u8 *ssid;
1273 u8 *bssid; 1409 u8 *bssid;
1274 struct ieee80211_channel *channel; 1410 struct cfg80211_chan_def chandef;
1275 enum nl80211_channel_type channel_type;
1276 u8 *ie; 1411 u8 *ie;
1277 u8 ssid_len, ie_len; 1412 u8 ssid_len, ie_len;
1278 u16 beacon_interval; 1413 u16 beacon_interval;
@@ -1531,13 +1666,19 @@ struct cfg80211_gtk_rekey_data {
1531 * to a merge. 1666 * to a merge.
1532 * @leave_ibss: Leave the IBSS. 1667 * @leave_ibss: Leave the IBSS.
1533 * 1668 *
1669 * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or
1670 * MESH mode)
1671 *
1534 * @set_wiphy_params: Notify that wiphy parameters have changed; 1672 * @set_wiphy_params: Notify that wiphy parameters have changed;
1535 * @changed bitfield (see &enum wiphy_params_flags) describes which values 1673 * @changed bitfield (see &enum wiphy_params_flags) describes which values
1536 * have changed. The actual parameter values are available in 1674 * have changed. The actual parameter values are available in
1537 * struct wiphy. If returning an error, no value should be changed. 1675 * struct wiphy. If returning an error, no value should be changed.
1538 * 1676 *
1539 * @set_tx_power: set the transmit power according to the parameters, 1677 * @set_tx_power: set the transmit power according to the parameters,
1540 * the power passed is in mBm, to get dBm use MBM_TO_DBM(). 1678 * the power passed is in mBm, to get dBm use MBM_TO_DBM(). The
1679 * wdev may be %NULL if power was set for the wiphy, and will
1680 * always be %NULL unless the driver supports per-vif TX power
1681 * (as advertised by the nl80211 feature flag.)
1541 * @get_tx_power: store the current TX power into the dbm variable; 1682 * @get_tx_power: store the current TX power into the dbm variable;
1542 * return 0 if successful 1683 * return 0 if successful
1543 * 1684 *
@@ -1708,8 +1849,7 @@ struct cfg80211_ops {
1708 struct ieee80211_channel *chan); 1849 struct ieee80211_channel *chan);
1709 1850
1710 int (*set_monitor_channel)(struct wiphy *wiphy, 1851 int (*set_monitor_channel)(struct wiphy *wiphy,
1711 struct ieee80211_channel *chan, 1852 struct cfg80211_chan_def *chandef);
1712 enum nl80211_channel_type channel_type);
1713 1853
1714 int (*scan)(struct wiphy *wiphy, 1854 int (*scan)(struct wiphy *wiphy,
1715 struct cfg80211_scan_request *request); 1855 struct cfg80211_scan_request *request);
@@ -1732,11 +1872,15 @@ struct cfg80211_ops {
1732 struct cfg80211_ibss_params *params); 1872 struct cfg80211_ibss_params *params);
1733 int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); 1873 int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev);
1734 1874
1875 int (*set_mcast_rate)(struct wiphy *wiphy, struct net_device *dev,
1876 int rate[IEEE80211_NUM_BANDS]);
1877
1735 int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); 1878 int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed);
1736 1879
1737 int (*set_tx_power)(struct wiphy *wiphy, 1880 int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
1738 enum nl80211_tx_power_setting type, int mbm); 1881 enum nl80211_tx_power_setting type, int mbm);
1739 int (*get_tx_power)(struct wiphy *wiphy, int *dbm); 1882 int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
1883 int *dbm);
1740 1884
1741 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, 1885 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
1742 const u8 *addr); 1886 const u8 *addr);
@@ -1767,7 +1911,6 @@ struct cfg80211_ops {
1767 int (*remain_on_channel)(struct wiphy *wiphy, 1911 int (*remain_on_channel)(struct wiphy *wiphy,
1768 struct wireless_dev *wdev, 1912 struct wireless_dev *wdev,
1769 struct ieee80211_channel *chan, 1913 struct ieee80211_channel *chan,
1770 enum nl80211_channel_type channel_type,
1771 unsigned int duration, 1914 unsigned int duration,
1772 u64 *cookie); 1915 u64 *cookie);
1773 int (*cancel_remain_on_channel)(struct wiphy *wiphy, 1916 int (*cancel_remain_on_channel)(struct wiphy *wiphy,
@@ -1776,10 +1919,8 @@ struct cfg80211_ops {
1776 1919
1777 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, 1920 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
1778 struct ieee80211_channel *chan, bool offchan, 1921 struct ieee80211_channel *chan, bool offchan,
1779 enum nl80211_channel_type channel_type, 1922 unsigned int wait, const u8 *buf, size_t len,
1780 bool channel_type_valid, unsigned int wait, 1923 bool no_cck, bool dont_wait_for_ack, u64 *cookie);
1781 const u8 *buf, size_t len, bool no_cck,
1782 bool dont_wait_for_ack, u64 *cookie);
1783 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 1924 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
1784 struct wireless_dev *wdev, 1925 struct wireless_dev *wdev,
1785 u64 cookie); 1926 u64 cookie);
@@ -1834,10 +1975,9 @@ struct cfg80211_ops {
1834 void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, 1975 void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev,
1835 u32 sset, u8 *data); 1976 u32 sset, u8 *data);
1836 1977
1837 struct ieee80211_channel * 1978 int (*get_channel)(struct wiphy *wiphy,
1838 (*get_channel)(struct wiphy *wiphy,
1839 struct wireless_dev *wdev, 1979 struct wireless_dev *wdev,
1840 enum nl80211_channel_type *type); 1980 struct cfg80211_chan_def *chandef);
1841 1981
1842 int (*start_p2p_device)(struct wiphy *wiphy, 1982 int (*start_p2p_device)(struct wiphy *wiphy,
1843 struct wireless_dev *wdev); 1983 struct wireless_dev *wdev);
@@ -2445,8 +2585,7 @@ struct wireless_dev {
2445 spinlock_t event_lock; 2585 spinlock_t event_lock;
2446 2586
2447 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 2587 struct cfg80211_internal_bss *current_bss; /* associated / joined */
2448 struct ieee80211_channel *preset_chan; 2588 struct cfg80211_chan_def preset_chandef;
2449 enum nl80211_channel_type preset_chantype;
2450 2589
2451 /* for AP and mesh channel tracking */ 2590 /* for AP and mesh channel tracking */
2452 struct ieee80211_channel *channel; 2591 struct ieee80211_channel *channel;
@@ -3326,14 +3465,12 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason,
3326 * @wdev: wireless device 3465 * @wdev: wireless device
3327 * @cookie: the request cookie 3466 * @cookie: the request cookie
3328 * @chan: The current channel (from remain_on_channel request) 3467 * @chan: The current channel (from remain_on_channel request)
3329 * @channel_type: Channel type
3330 * @duration: Duration in milliseconds that the driver intents to remain on the 3468 * @duration: Duration in milliseconds that the driver intents to remain on the
3331 * channel 3469 * channel
3332 * @gfp: allocation flags 3470 * @gfp: allocation flags
3333 */ 3471 */
3334void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, 3472void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
3335 struct ieee80211_channel *chan, 3473 struct ieee80211_channel *chan,
3336 enum nl80211_channel_type channel_type,
3337 unsigned int duration, gfp_t gfp); 3474 unsigned int duration, gfp_t gfp);
3338 3475
3339/** 3476/**
@@ -3341,12 +3478,10 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
3341 * @wdev: wireless device 3478 * @wdev: wireless device
3342 * @cookie: the request cookie 3479 * @cookie: the request cookie
3343 * @chan: The current channel (from remain_on_channel request) 3480 * @chan: The current channel (from remain_on_channel request)
3344 * @channel_type: Channel type
3345 * @gfp: allocation flags 3481 * @gfp: allocation flags
3346 */ 3482 */
3347void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, 3483void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
3348 struct ieee80211_channel *chan, 3484 struct ieee80211_channel *chan,
3349 enum nl80211_channel_type channel_type,
3350 gfp_t gfp); 3485 gfp_t gfp);
3351 3486
3352 3487
@@ -3536,7 +3671,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
3536 * @len: length of the frame 3671 * @len: length of the frame
3537 * @freq: frequency the frame was received on 3672 * @freq: frequency the frame was received on
3538 * @sig_dbm: signal strength in mBm, or 0 if unknown 3673 * @sig_dbm: signal strength in mBm, or 0 if unknown
3539 * @gfp: allocation flags
3540 * 3674 *
3541 * Use this function to report to userspace when a beacon was 3675 * Use this function to report to userspace when a beacon was
3542 * received. It is not useful to call this when there is no 3676 * received. It is not useful to call this when there is no
@@ -3544,31 +3678,47 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
3544 */ 3678 */
3545void cfg80211_report_obss_beacon(struct wiphy *wiphy, 3679void cfg80211_report_obss_beacon(struct wiphy *wiphy,
3546 const u8 *frame, size_t len, 3680 const u8 *frame, size_t len,
3547 int freq, int sig_dbm, gfp_t gfp); 3681 int freq, int sig_dbm);
3548 3682
3549/** 3683/**
3550 * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used 3684 * cfg80211_reg_can_beacon - check if beaconing is allowed
3551 * @wiphy: the wiphy 3685 * @wiphy: the wiphy
3552 * @chan: main channel 3686 * @chandef: the channel definition
3553 * @channel_type: HT mode
3554 * 3687 *
3555 * This function returns true if there is no secondary channel or the secondary 3688 * This function returns true if there is no secondary channel or the secondary
3556 * channel can be used for beaconing (i.e. is not a radar channel etc.) 3689 * channel(s) can be used for beaconing (i.e. is not a radar channel etc.)
3557 */ 3690 */
3558bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, 3691bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
3559 struct ieee80211_channel *chan, 3692 struct cfg80211_chan_def *chandef);
3560 enum nl80211_channel_type channel_type);
3561 3693
3562/* 3694/*
3563 * cfg80211_ch_switch_notify - update wdev channel and notify userspace 3695 * cfg80211_ch_switch_notify - update wdev channel and notify userspace
3564 * @dev: the device which switched channels 3696 * @dev: the device which switched channels
3565 * @freq: new channel frequency (in MHz) 3697 * @chandef: the new channel definition
3566 * @type: channel type
3567 * 3698 *
3568 * Acquires wdev_lock, so must only be called from sleepable driver context! 3699 * Acquires wdev_lock, so must only be called from sleepable driver context!
3569 */ 3700 */
3570void cfg80211_ch_switch_notify(struct net_device *dev, int freq, 3701void cfg80211_ch_switch_notify(struct net_device *dev,
3571 enum nl80211_channel_type type); 3702 struct cfg80211_chan_def *chandef);
3703
3704/*
3705 * cfg80211_tdls_oper_request - request userspace to perform TDLS operation
3706 * @dev: the device on which the operation is requested
3707 * @peer: the MAC address of the peer device
3708 * @oper: the requested TDLS operation (NL80211_TDLS_SETUP or
3709 * NL80211_TDLS_TEARDOWN)
3710 * @reason_code: the reason code for teardown request
3711 * @gfp: allocation flags
3712 *
3713 * This function is used to request userspace to perform TDLS operation that
3714 * requires knowledge of keys, i.e., link setup or teardown when the AP
3715 * connection uses encryption. This is optional mechanism for the driver to use
3716 * if it can automatically determine when a TDLS link could be useful (e.g.,
3717 * based on traffic and signal strength for a peer).
3718 */
3719void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
3720 enum nl80211_tdls_operation oper,
3721 u16 reason_code, gfp_t gfp);
3572 3722
3573/* 3723/*
3574 * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) 3724 * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units)
@@ -3594,6 +3744,26 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate);
3594 */ 3744 */
3595void cfg80211_unregister_wdev(struct wireless_dev *wdev); 3745void cfg80211_unregister_wdev(struct wireless_dev *wdev);
3596 3746
3747/**
3748 * cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer
3749 * @ies: the input IE buffer
3750 * @len: the input length
3751 * @attr: the attribute ID to find
3752 * @buf: output buffer, can be %NULL if the data isn't needed, e.g.
3753 * if the function is only called to get the needed buffer size
3754 * @bufsize: size of the output buffer
3755 *
3756 * The function finds a given P2P attribute in the (vendor) IEs and
3757 * copies its contents to the given buffer.
3758 *
3759 * The return value is a negative error code (-%EILSEQ or -%ENOENT) if
3760 * the data is malformed or the attribute can't be found (respectively),
3761 * or the length of the found attribute (which can be zero).
3762 */
3763int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len,
3764 enum ieee80211_p2p_attr_id attr,
3765 u8 *buf, unsigned int bufsize);
3766
3597/* Logging, debugging and troubleshooting/diagnostic helpers. */ 3767/* Logging, debugging and troubleshooting/diagnostic helpers. */
3598 3768
3599/* wiphy_printk helpers, similar to dev_printk */ 3769/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index b6a6eeb3905..2581638f4a3 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -24,12 +24,12 @@ struct cgroup_cls_state
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27extern void sock_update_classid(struct sock *sk); 27extern void sock_update_classid(struct sock *sk, struct task_struct *task);
28 28
29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) 29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
30static inline u32 task_cls_classid(struct task_struct *p) 30static inline u32 task_cls_classid(struct task_struct *p)
31{ 31{
32 int classid; 32 u32 classid;
33 33
34 if (in_interrupt()) 34 if (in_interrupt())
35 return 0; 35 return 0;
@@ -61,7 +61,7 @@ static inline u32 task_cls_classid(struct task_struct *p)
61} 61}
62#endif 62#endif
63#else /* !CGROUP_NET_CLS_CGROUP */ 63#else /* !CGROUP_NET_CLS_CGROUP */
64static inline void sock_update_classid(struct sock *sk) 64static inline void sock_update_classid(struct sock *sk, struct task_struct *task)
65{ 65{
66} 66}
67 67
diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h
index 4fd8a4b4b7e..e5062c955ea 100644
--- a/include/net/gro_cells.h
+++ b/include/net/gro_cells.h
@@ -17,7 +17,6 @@ struct gro_cells {
17 17
18static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) 18static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb)
19{ 19{
20 unsigned long flags;
21 struct gro_cell *cell = gcells->cells; 20 struct gro_cell *cell = gcells->cells;
22 struct net_device *dev = skb->dev; 21 struct net_device *dev = skb->dev;
23 22
@@ -35,32 +34,37 @@ static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *s
35 return; 34 return;
36 } 35 }
37 36
38 spin_lock_irqsave(&cell->napi_skbs.lock, flags); 37 /* We run in BH context */
38 spin_lock(&cell->napi_skbs.lock);
39 39
40 __skb_queue_tail(&cell->napi_skbs, skb); 40 __skb_queue_tail(&cell->napi_skbs, skb);
41 if (skb_queue_len(&cell->napi_skbs) == 1) 41 if (skb_queue_len(&cell->napi_skbs) == 1)
42 napi_schedule(&cell->napi); 42 napi_schedule(&cell->napi);
43 43
44 spin_unlock_irqrestore(&cell->napi_skbs.lock, flags); 44 spin_unlock(&cell->napi_skbs.lock);
45} 45}
46 46
47/* called unser BH context */
47static inline int gro_cell_poll(struct napi_struct *napi, int budget) 48static inline int gro_cell_poll(struct napi_struct *napi, int budget)
48{ 49{
49 struct gro_cell *cell = container_of(napi, struct gro_cell, napi); 50 struct gro_cell *cell = container_of(napi, struct gro_cell, napi);
50 struct sk_buff *skb; 51 struct sk_buff *skb;
51 int work_done = 0; 52 int work_done = 0;
52 53
54 spin_lock(&cell->napi_skbs.lock);
53 while (work_done < budget) { 55 while (work_done < budget) {
54 skb = skb_dequeue(&cell->napi_skbs); 56 skb = __skb_dequeue(&cell->napi_skbs);
55 if (!skb) 57 if (!skb)
56 break; 58 break;
57 59 spin_unlock(&cell->napi_skbs.lock);
58 napi_gro_receive(napi, skb); 60 napi_gro_receive(napi, skb);
59 work_done++; 61 work_done++;
62 spin_lock(&cell->napi_skbs.lock);
60 } 63 }
61 64
62 if (work_done < budget) 65 if (work_done < budget)
63 napi_complete(napi); 66 napi_complete(napi);
67 spin_unlock(&cell->napi_skbs.lock);
64 return work_done; 68 return work_done;
65} 69}
66 70
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index 7f0df133d11..c3999632e61 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -186,6 +186,10 @@ struct ieee80211_radiotap_header {
186 * IEEE80211_RADIOTAP_AMPDU_STATUS u32, u16, u8, u8 unitless 186 * IEEE80211_RADIOTAP_AMPDU_STATUS u32, u16, u8, u8 unitless
187 * 187 *
188 * Contains the AMPDU information for the subframe. 188 * Contains the AMPDU information for the subframe.
189 *
190 * IEEE80211_RADIOTAP_VHT u16, u8, u8, u8[4], u8, u8, u16
191 *
192 * Contains VHT information about this frame.
189 */ 193 */
190enum ieee80211_radiotap_type { 194enum ieee80211_radiotap_type {
191 IEEE80211_RADIOTAP_TSFT = 0, 195 IEEE80211_RADIOTAP_TSFT = 0,
@@ -209,6 +213,7 @@ enum ieee80211_radiotap_type {
209 213
210 IEEE80211_RADIOTAP_MCS = 19, 214 IEEE80211_RADIOTAP_MCS = 19,
211 IEEE80211_RADIOTAP_AMPDU_STATUS = 20, 215 IEEE80211_RADIOTAP_AMPDU_STATUS = 20,
216 IEEE80211_RADIOTAP_VHT = 21,
212 217
213 /* valid in every it_present bitmap, even vendor namespaces */ 218 /* valid in every it_present bitmap, even vendor namespaces */
214 IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29, 219 IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
@@ -282,6 +287,25 @@ enum ieee80211_radiotap_type {
282#define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_ERR 0x0010 287#define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_ERR 0x0010
283#define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN 0x0020 288#define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN 0x0020
284 289
290/* For IEEE80211_RADIOTAP_VHT */
291#define IEEE80211_RADIOTAP_VHT_KNOWN_STBC 0x0001
292#define IEEE80211_RADIOTAP_VHT_KNOWN_TXOP_PS_NA 0x0002
293#define IEEE80211_RADIOTAP_VHT_KNOWN_GI 0x0004
294#define IEEE80211_RADIOTAP_VHT_KNOWN_SGI_NSYM_DIS 0x0008
295#define IEEE80211_RADIOTAP_VHT_KNOWN_LDPC_EXTRA_OFDM_SYM 0x0010
296#define IEEE80211_RADIOTAP_VHT_KNOWN_BEAMFORMED 0x0020
297#define IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH 0x0040
298#define IEEE80211_RADIOTAP_VHT_KNOWN_GROUP_ID 0x0080
299#define IEEE80211_RADIOTAP_VHT_KNOWN_PARTIAL_AID 0x0100
300
301#define IEEE80211_RADIOTAP_VHT_FLAG_STBC 0x01
302#define IEEE80211_RADIOTAP_VHT_FLAG_TXOP_PS_NA 0x02
303#define IEEE80211_RADIOTAP_VHT_FLAG_SGI 0x04
304#define IEEE80211_RADIOTAP_VHT_FLAG_SGI_NSYM_M10_9 0x08
305#define IEEE80211_RADIOTAP_VHT_FLAG_LDPC_EXTRA_OFDM_SYM 0x10
306#define IEEE80211_RADIOTAP_VHT_FLAG_BEAMFORMED 0x20
307
308
285/* helpers */ 309/* helpers */
286static inline int ieee80211_get_radiotap_len(unsigned char *data) 310static inline int ieee80211_get_radiotap_len(unsigned char *data)
287{ 311{
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 54be0287eb9..67a8fa098e3 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -277,7 +277,6 @@ static inline struct sock *inet_lookup_listener(struct net *net,
277 On 64bit targets we combine comparisons with pair of adjacent __be32 277 On 64bit targets we combine comparisons with pair of adjacent __be32
278 fields in the same way. 278 fields in the same way.
279*/ 279*/
280typedef __u32 __bitwise __portpair;
281#ifdef __BIG_ENDIAN 280#ifdef __BIG_ENDIAN
282#define INET_COMBINED_PORTS(__sport, __dport) \ 281#define INET_COMBINED_PORTS(__sport, __dport) \
283 ((__force __portpair)(((__force __u32)(__be16)(__sport) << 16) | (__u32)(__dport))) 282 ((__force __portpair)(((__force __u32)(__be16)(__sport) << 16) | (__u32)(__dport)))
@@ -287,7 +286,6 @@ typedef __u32 __bitwise __portpair;
287#endif 286#endif
288 287
289#if (BITS_PER_LONG == 64) 288#if (BITS_PER_LONG == 64)
290typedef __u64 __bitwise __addrpair;
291#ifdef __BIG_ENDIAN 289#ifdef __BIG_ENDIAN
292#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ 290#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
293 const __addrpair __name = (__force __addrpair) ( \ 291 const __addrpair __name = (__force __addrpair) ( \
@@ -299,30 +297,34 @@ typedef __u64 __bitwise __addrpair;
299 (((__force __u64)(__be32)(__daddr)) << 32) | \ 297 (((__force __u64)(__be32)(__daddr)) << 32) | \
300 ((__force __u64)(__be32)(__saddr))); 298 ((__force __u64)(__be32)(__saddr)));
301#endif /* __BIG_ENDIAN */ 299#endif /* __BIG_ENDIAN */
302#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 300#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \
303 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 301 ((inet_sk(__sk)->inet_portpair == (__ports)) && \
304 ((*((__addrpair *)&(inet_sk(__sk)->inet_daddr))) == (__cookie)) && \ 302 (inet_sk(__sk)->inet_addrpair == (__cookie)) && \
305 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ 303 (!(__sk)->sk_bound_dev_if || \
306 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 304 ((__sk)->sk_bound_dev_if == (__dif))) && \
307#define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 305 net_eq(sock_net(__sk), (__net)))
308 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 306#define INET_TW_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif)\
309 ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ 307 ((inet_twsk(__sk)->tw_portpair == (__ports)) && \
310 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ 308 (inet_twsk(__sk)->tw_addrpair == (__cookie)) && \
311 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 309 (!(__sk)->sk_bound_dev_if || \
310 ((__sk)->sk_bound_dev_if == (__dif))) && \
311 net_eq(sock_net(__sk), (__net)))
312#else /* 32-bit arch */ 312#else /* 32-bit arch */
313#define INET_ADDR_COOKIE(__name, __saddr, __daddr) 313#define INET_ADDR_COOKIE(__name, __saddr, __daddr)
314#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ 314#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \
315 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 315 ((inet_sk(__sk)->inet_portpair == (__ports)) && \
316 (inet_sk(__sk)->inet_daddr == (__saddr)) && \ 316 (inet_sk(__sk)->inet_daddr == (__saddr)) && \
317 (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \ 317 (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \
318 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ 318 (!(__sk)->sk_bound_dev_if || \
319 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 319 ((__sk)->sk_bound_dev_if == (__dif))) && \
320#define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ 320 net_eq(sock_net(__sk), (__net)))
321 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 321#define INET_TW_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \
322 (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ 322 ((inet_twsk(__sk)->tw_portpair == (__ports)) && \
323 (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ 323 (inet_twsk(__sk)->tw_daddr == (__saddr)) && \
324 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ 324 (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \
325 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 325 (!(__sk)->sk_bound_dev_if || \
326 ((__sk)->sk_bound_dev_if == (__dif))) && \
327 net_eq(sock_net(__sk), (__net)))
326#endif /* 64-bit arch */ 328#endif /* 64-bit arch */
327 329
328/* 330/*
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 256c1ed2d69..a4196cbc84e 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -144,9 +144,11 @@ struct inet_sock {
144 /* Socket demultiplex comparisons on incoming packets. */ 144 /* Socket demultiplex comparisons on incoming packets. */
145#define inet_daddr sk.__sk_common.skc_daddr 145#define inet_daddr sk.__sk_common.skc_daddr
146#define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr 146#define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr
147#define inet_addrpair sk.__sk_common.skc_addrpair
148#define inet_dport sk.__sk_common.skc_dport
149#define inet_num sk.__sk_common.skc_num
150#define inet_portpair sk.__sk_common.skc_portpair
147 151
148 __be16 inet_dport;
149 __u16 inet_num;
150 __be32 inet_saddr; 152 __be32 inet_saddr;
151 __s16 uc_ttl; 153 __s16 uc_ttl;
152 __u16 cmsg_flags; 154 __u16 cmsg_flags;
@@ -154,6 +156,7 @@ struct inet_sock {
154 __u16 inet_id; 156 __u16 inet_id;
155 157
156 struct ip_options_rcu __rcu *inet_opt; 158 struct ip_options_rcu __rcu *inet_opt;
159 int rx_dst_ifindex;
157 __u8 tos; 160 __u8 tos;
158 __u8 min_ttl; 161 __u8 min_ttl;
159 __u8 mc_ttl; 162 __u8 mc_ttl;
@@ -170,7 +173,6 @@ struct inet_sock {
170 int uc_index; 173 int uc_index;
171 int mc_index; 174 int mc_index;
172 __be32 mc_addr; 175 __be32 mc_addr;
173 int rx_dst_ifindex;
174 struct ip_mc_socklist __rcu *mc_list; 176 struct ip_mc_socklist __rcu *mc_list;
175 struct inet_cork_full cork; 177 struct inet_cork_full cork;
176}; 178};
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index ba52c830a7a..7d658d57736 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -112,6 +112,11 @@ struct inet_timewait_sock {
112#define tw_net __tw_common.skc_net 112#define tw_net __tw_common.skc_net
113#define tw_daddr __tw_common.skc_daddr 113#define tw_daddr __tw_common.skc_daddr
114#define tw_rcv_saddr __tw_common.skc_rcv_saddr 114#define tw_rcv_saddr __tw_common.skc_rcv_saddr
115#define tw_addrpair __tw_common.skc_addrpair
116#define tw_dport __tw_common.skc_dport
117#define tw_num __tw_common.skc_num
118#define tw_portpair __tw_common.skc_portpair
119
115 int tw_timeout; 120 int tw_timeout;
116 volatile unsigned char tw_substate; 121 volatile unsigned char tw_substate;
117 unsigned char tw_rcv_wscale; 122 unsigned char tw_rcv_wscale;
@@ -119,8 +124,6 @@ struct inet_timewait_sock {
119 /* Socket demultiplex comparisons on incoming packets. */ 124 /* Socket demultiplex comparisons on incoming packets. */
120 /* these three are in inet_sock */ 125 /* these three are in inet_sock */
121 __be16 tw_sport; 126 __be16 tw_sport;
122 __be16 tw_dport;
123 __u16 tw_num;
124 kmemcheck_bitfield_begin(flags); 127 kmemcheck_bitfield_begin(flags);
125 /* And these are ours. */ 128 /* And these are ours. */
126 unsigned int tw_ipv6only : 1, 129 unsigned int tw_ipv6only : 1,
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
index bc1b0fda2b0..652d3d30935 100644
--- a/include/net/ip6_checksum.h
+++ b/include/net/ip6_checksum.h
@@ -31,6 +31,8 @@
31#include <net/ip.h> 31#include <net/ip.h>
32#include <asm/checksum.h> 32#include <asm/checksum.h>
33#include <linux/in6.h> 33#include <linux/in6.h>
34#include <linux/tcp.h>
35#include <linux/ipv6.h>
34 36
35#ifndef _HAVE_ARCH_IPV6_CSUM 37#ifndef _HAVE_ARCH_IPV6_CSUM
36 38
@@ -91,4 +93,37 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
91} 93}
92 94
93#endif 95#endif
96
97static __inline__ __sum16 tcp_v6_check(int len,
98 const struct in6_addr *saddr,
99 const struct in6_addr *daddr,
100 __wsum base)
101{
102 return csum_ipv6_magic(saddr, daddr, len, IPPROTO_TCP, base);
103}
104
105static inline void __tcp_v6_send_check(struct sk_buff *skb,
106 const struct in6_addr *saddr,
107 const struct in6_addr *daddr)
108{
109 struct tcphdr *th = tcp_hdr(skb);
110
111 if (skb->ip_summed == CHECKSUM_PARTIAL) {
112 th->check = ~tcp_v6_check(skb->len, saddr, daddr, 0);
113 skb->csum_start = skb_transport_header(skb) - skb->head;
114 skb->csum_offset = offsetof(struct tcphdr, check);
115 } else {
116 th->check = tcp_v6_check(skb->len, saddr, daddr,
117 csum_partial(th, th->doff << 2,
118 skb->csum));
119 }
120}
121
122static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
123{
124 struct ipv6_pinfo *np = inet6_sk(sk);
125
126 __tcp_v6_send_check(skb, &np->saddr, &np->daddr);
127}
128
94#endif 129#endif
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 8a2a203eb15..fdc48a94a06 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -47,6 +47,8 @@ struct fib6_config {
47 unsigned long fc_expires; 47 unsigned long fc_expires;
48 struct nlattr *fc_mx; 48 struct nlattr *fc_mx;
49 int fc_mx_len; 49 int fc_mx_len;
50 int fc_mp_len;
51 struct nlattr *fc_mp;
50 52
51 struct nl_info fc_nlinfo; 53 struct nl_info fc_nlinfo;
52}; 54};
@@ -99,6 +101,14 @@ struct rt6_info {
99 101
100 struct in6_addr rt6i_gateway; 102 struct in6_addr rt6i_gateway;
101 103
104 /* Multipath routes:
105 * siblings is a list of rt6_info that have the the same metric/weight,
106 * destination, but not the same gateway. nsiblings is just a cache
107 * to speed up lookup.
108 */
109 struct list_head rt6i_siblings;
110 unsigned int rt6i_nsiblings;
111
102 atomic_t rt6i_ref; 112 atomic_t rt6i_ref;
103 113
104 /* These are in a separate cache line. */ 114 /* These are in a separate cache line. */
@@ -107,7 +117,6 @@ struct rt6_info {
107 struct rt6key rt6i_src; 117 struct rt6key rt6i_src;
108 struct rt6key rt6i_prefsrc; 118 struct rt6key rt6i_prefsrc;
109 u32 rt6i_metric; 119 u32 rt6i_metric;
110 u32 rt6i_peer_genid;
111 120
112 struct inet6_dev *rt6i_idev; 121 struct inet6_dev *rt6i_idev;
113 unsigned long _rt6i_peer; 122 unsigned long _rt6i_peer;
@@ -203,6 +212,15 @@ static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from)
203 dst_hold(new); 212 dst_hold(new);
204} 213}
205 214
215static inline void ip6_rt_put(struct rt6_info *rt)
216{
217 /* dst_release() accepts a NULL parameter.
218 * We rely on dst being first structure in struct rt6_info
219 */
220 BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0);
221 dst_release(&rt->dst);
222}
223
206struct fib6_walker_t { 224struct fib6_walker_t {
207 struct list_head lh; 225 struct list_head lh;
208 struct fib6_node *root, *node; 226 struct fib6_node *root, *node;
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 5fa2af00634..27d83183e61 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -1,9 +1,6 @@
1#ifndef _NET_IP6_ROUTE_H 1#ifndef _NET_IP6_ROUTE_H
2#define _NET_IP6_ROUTE_H 2#define _NET_IP6_ROUTE_H
3 3
4#define IP6_RT_PRIO_USER 1024
5#define IP6_RT_PRIO_ADDRCONF 256
6
7struct route_info { 4struct route_info {
8 __u8 type; 5 __u8 type;
9 __u8 length; 6 __u8 length;
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index ee75ccdf518..68c69d54d39 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -22,7 +22,10 @@
22#include <linux/ip.h> 22#include <linux/ip.h>
23#include <linux/ipv6.h> /* for struct ipv6hdr */ 23#include <linux/ipv6.h> /* for struct ipv6hdr */
24#include <net/ipv6.h> 24#include <net/ipv6.h>
25#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 25#if IS_ENABLED(CONFIG_IP_VS_IPV6)
26#include <linux/netfilter_ipv6/ip6_tables.h>
27#endif
28#if IS_ENABLED(CONFIG_NF_CONNTRACK)
26#include <net/netfilter/nf_conntrack.h> 29#include <net/netfilter/nf_conntrack.h>
27#endif 30#endif
28#include <net/net_namespace.h> /* Netw namespace */ 31#include <net/net_namespace.h> /* Netw namespace */
@@ -103,30 +106,117 @@ static inline struct net *seq_file_single_net(struct seq_file *seq)
103/* Connections' size value needed by ip_vs_ctl.c */ 106/* Connections' size value needed by ip_vs_ctl.c */
104extern int ip_vs_conn_tab_size; 107extern int ip_vs_conn_tab_size;
105 108
106
107struct ip_vs_iphdr { 109struct ip_vs_iphdr {
108 int len; 110 __u32 len; /* IPv4 simply where L4 starts
109 __u8 protocol; 111 IPv6 where L4 Transport Header starts */
112 __u32 thoff_reasm; /* Transport Header Offset in nfct_reasm skb */
113 __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/
114 __s16 protocol;
115 __s32 flags;
110 union nf_inet_addr saddr; 116 union nf_inet_addr saddr;
111 union nf_inet_addr daddr; 117 union nf_inet_addr daddr;
112}; 118};
113 119
120/* Dependency to module: nf_defrag_ipv6 */
121#if defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE)
122static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb)
123{
124 return skb->nfct_reasm;
125}
126static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset,
127 int len, void *buffer,
128 const struct ip_vs_iphdr *ipvsh)
129{
130 if (unlikely(ipvsh->fragoffs && skb_nfct_reasm(skb)))
131 return skb_header_pointer(skb_nfct_reasm(skb),
132 ipvsh->thoff_reasm, len, buffer);
133
134 return skb_header_pointer(skb, offset, len, buffer);
135}
136#else
137static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb)
138{
139 return NULL;
140}
141static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset,
142 int len, void *buffer,
143 const struct ip_vs_iphdr *ipvsh)
144{
145 return skb_header_pointer(skb, offset, len, buffer);
146}
147#endif
148
114static inline void 149static inline void
115ip_vs_fill_iphdr(int af, const void *nh, struct ip_vs_iphdr *iphdr) 150ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr)
151{
152 const struct iphdr *iph = nh;
153
154 iphdr->len = iph->ihl * 4;
155 iphdr->fragoffs = 0;
156 iphdr->protocol = iph->protocol;
157 iphdr->saddr.ip = iph->saddr;
158 iphdr->daddr.ip = iph->daddr;
159}
160
161/* This function handles filling *ip_vs_iphdr, both for IPv4 and IPv6.
162 * IPv6 requires some extra work, as finding proper header position,
163 * depend on the IPv6 extension headers.
164 */
165static inline void
166ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr)
116{ 167{
117#ifdef CONFIG_IP_VS_IPV6 168#ifdef CONFIG_IP_VS_IPV6
118 if (af == AF_INET6) { 169 if (af == AF_INET6) {
119 const struct ipv6hdr *iph = nh; 170 const struct ipv6hdr *iph =
120 iphdr->len = sizeof(struct ipv6hdr); 171 (struct ipv6hdr *)skb_network_header(skb);
121 iphdr->protocol = iph->nexthdr;
122 iphdr->saddr.in6 = iph->saddr; 172 iphdr->saddr.in6 = iph->saddr;
123 iphdr->daddr.in6 = iph->daddr; 173 iphdr->daddr.in6 = iph->daddr;
174 /* ipv6_find_hdr() updates len, flags, thoff_reasm */
175 iphdr->thoff_reasm = 0;
176 iphdr->len = 0;
177 iphdr->flags = 0;
178 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1,
179 &iphdr->fragoffs,
180 &iphdr->flags);
181 /* get proto from re-assembled packet and it's offset */
182 if (skb_nfct_reasm(skb))
183 iphdr->protocol = ipv6_find_hdr(skb_nfct_reasm(skb),
184 &iphdr->thoff_reasm,
185 -1, NULL, NULL);
186
124 } else 187 } else
125#endif 188#endif
126 { 189 {
127 const struct iphdr *iph = nh; 190 const struct iphdr *iph =
128 iphdr->len = iph->ihl * 4; 191 (struct iphdr *)skb_network_header(skb);
129 iphdr->protocol = iph->protocol; 192 iphdr->len = iph->ihl * 4;
193 iphdr->fragoffs = 0;
194 iphdr->protocol = iph->protocol;
195 iphdr->saddr.ip = iph->saddr;
196 iphdr->daddr.ip = iph->daddr;
197 }
198}
199
200/* This function is a faster version of ip_vs_fill_iph_skb().
201 * Where we only populate {s,d}addr (and avoid calling ipv6_find_hdr()).
202 * This is used by the some of the ip_vs_*_schedule() functions.
203 * (Mostly done to avoid ABI breakage of external schedulers)
204 */
205static inline void
206ip_vs_fill_iph_addr_only(int af, const struct sk_buff *skb,
207 struct ip_vs_iphdr *iphdr)
208{
209#ifdef CONFIG_IP_VS_IPV6
210 if (af == AF_INET6) {
211 const struct ipv6hdr *iph =
212 (struct ipv6hdr *)skb_network_header(skb);
213 iphdr->saddr.in6 = iph->saddr;
214 iphdr->daddr.in6 = iph->daddr;
215 } else
216#endif
217 {
218 const struct iphdr *iph =
219 (struct iphdr *)skb_network_header(skb);
130 iphdr->saddr.ip = iph->saddr; 220 iphdr->saddr.ip = iph->saddr;
131 iphdr->daddr.ip = iph->daddr; 221 iphdr->daddr.ip = iph->daddr;
132 } 222 }
@@ -165,7 +255,7 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
165 int len; 255 int len;
166#ifdef CONFIG_IP_VS_IPV6 256#ifdef CONFIG_IP_VS_IPV6
167 if (af == AF_INET6) 257 if (af == AF_INET6)
168 len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]", 258 len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6c]",
169 &addr->in6) + 1; 259 &addr->in6) + 1;
170 else 260 else
171#endif 261#endif
@@ -398,27 +488,26 @@ struct ip_vs_protocol {
398 488
399 int (*conn_schedule)(int af, struct sk_buff *skb, 489 int (*conn_schedule)(int af, struct sk_buff *skb,
400 struct ip_vs_proto_data *pd, 490 struct ip_vs_proto_data *pd,
401 int *verdict, struct ip_vs_conn **cpp); 491 int *verdict, struct ip_vs_conn **cpp,
492 struct ip_vs_iphdr *iph);
402 493
403 struct ip_vs_conn * 494 struct ip_vs_conn *
404 (*conn_in_get)(int af, 495 (*conn_in_get)(int af,
405 const struct sk_buff *skb, 496 const struct sk_buff *skb,
406 const struct ip_vs_iphdr *iph, 497 const struct ip_vs_iphdr *iph,
407 unsigned int proto_off,
408 int inverse); 498 int inverse);
409 499
410 struct ip_vs_conn * 500 struct ip_vs_conn *
411 (*conn_out_get)(int af, 501 (*conn_out_get)(int af,
412 const struct sk_buff *skb, 502 const struct sk_buff *skb,
413 const struct ip_vs_iphdr *iph, 503 const struct ip_vs_iphdr *iph,
414 unsigned int proto_off,
415 int inverse); 504 int inverse);
416 505
417 int (*snat_handler)(struct sk_buff *skb, 506 int (*snat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp,
418 struct ip_vs_protocol *pp, struct ip_vs_conn *cp); 507 struct ip_vs_conn *cp, struct ip_vs_iphdr *iph);
419 508
420 int (*dnat_handler)(struct sk_buff *skb, 509 int (*dnat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp,
421 struct ip_vs_protocol *pp, struct ip_vs_conn *cp); 510 struct ip_vs_conn *cp, struct ip_vs_iphdr *iph);
422 511
423 int (*csum_check)(int af, struct sk_buff *skb, 512 int (*csum_check)(int af, struct sk_buff *skb,
424 struct ip_vs_protocol *pp); 513 struct ip_vs_protocol *pp);
@@ -518,7 +607,7 @@ struct ip_vs_conn {
518 NF_ACCEPT can be returned when destination is local. 607 NF_ACCEPT can be returned when destination is local.
519 */ 608 */
520 int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, 609 int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp,
521 struct ip_vs_protocol *pp); 610 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
522 611
523 /* Note: we can group the following members into a structure, 612 /* Note: we can group the following members into a structure,
524 in order to save more space, and the following members are 613 in order to save more space, and the following members are
@@ -769,13 +858,11 @@ struct ip_vs_app {
769 858
770 struct ip_vs_conn * 859 struct ip_vs_conn *
771 (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app, 860 (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app,
772 const struct iphdr *iph, unsigned int proto_off, 861 const struct iphdr *iph, int inverse);
773 int inverse);
774 862
775 struct ip_vs_conn * 863 struct ip_vs_conn *
776 (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app, 864 (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app,
777 const struct iphdr *iph, unsigned int proto_off, 865 const struct iphdr *iph, int inverse);
778 int inverse);
779 866
780 int (*state_transition)(struct ip_vs_conn *cp, int direction, 867 int (*state_transition)(struct ip_vs_conn *cp, int direction,
781 const struct sk_buff *skb, 868 const struct sk_buff *skb,
@@ -1074,14 +1161,12 @@ struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p);
1074 1161
1075struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, 1162struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
1076 const struct ip_vs_iphdr *iph, 1163 const struct ip_vs_iphdr *iph,
1077 unsigned int proto_off,
1078 int inverse); 1164 int inverse);
1079 1165
1080struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); 1166struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p);
1081 1167
1082struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, 1168struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb,
1083 const struct ip_vs_iphdr *iph, 1169 const struct ip_vs_iphdr *iph,
1084 unsigned int proto_off,
1085 int inverse); 1170 int inverse);
1086 1171
1087/* put back the conn without restarting its timer */ 1172/* put back the conn without restarting its timer */
@@ -1254,9 +1339,10 @@ extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name);
1254extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); 1339extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler);
1255extern struct ip_vs_conn * 1340extern struct ip_vs_conn *
1256ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, 1341ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
1257 struct ip_vs_proto_data *pd, int *ignored); 1342 struct ip_vs_proto_data *pd, int *ignored,
1343 struct ip_vs_iphdr *iph);
1258extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, 1344extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
1259 struct ip_vs_proto_data *pd); 1345 struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph);
1260 1346
1261extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); 1347extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);
1262 1348
@@ -1315,33 +1401,38 @@ extern void ip_vs_read_estimator(struct ip_vs_stats_user *dst,
1315/* 1401/*
1316 * Various IPVS packet transmitters (from ip_vs_xmit.c) 1402 * Various IPVS packet transmitters (from ip_vs_xmit.c)
1317 */ 1403 */
1318extern int ip_vs_null_xmit 1404extern int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1319(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1405 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1320extern int ip_vs_bypass_xmit 1406extern int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1321(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1407 struct ip_vs_protocol *pp,
1322extern int ip_vs_nat_xmit 1408 struct ip_vs_iphdr *iph);
1323(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1409extern int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1324extern int ip_vs_tunnel_xmit 1410 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1325(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1411extern int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1326extern int ip_vs_dr_xmit 1412 struct ip_vs_protocol *pp,
1327(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1413 struct ip_vs_iphdr *iph);
1328extern int ip_vs_icmp_xmit 1414extern int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1329(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, 1415 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1330 int offset, unsigned int hooknum); 1416extern int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1417 struct ip_vs_protocol *pp, int offset,
1418 unsigned int hooknum, struct ip_vs_iphdr *iph);
1331extern void ip_vs_dst_reset(struct ip_vs_dest *dest); 1419extern void ip_vs_dst_reset(struct ip_vs_dest *dest);
1332 1420
1333#ifdef CONFIG_IP_VS_IPV6 1421#ifdef CONFIG_IP_VS_IPV6
1334extern int ip_vs_bypass_xmit_v6 1422extern int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1335(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1423 struct ip_vs_protocol *pp,
1336extern int ip_vs_nat_xmit_v6 1424 struct ip_vs_iphdr *iph);
1337(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1425extern int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1338extern int ip_vs_tunnel_xmit_v6 1426 struct ip_vs_protocol *pp,
1339(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1427 struct ip_vs_iphdr *iph);
1340extern int ip_vs_dr_xmit_v6 1428extern int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1341(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1429 struct ip_vs_protocol *pp,
1342extern int ip_vs_icmp_xmit_v6 1430 struct ip_vs_iphdr *iph);
1343(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, 1431extern int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1344 int offset, unsigned int hooknum); 1432 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1433extern int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1434 struct ip_vs_protocol *pp, int offset,
1435 unsigned int hooknum, struct ip_vs_iphdr *iph);
1345#endif 1436#endif
1346 1437
1347#ifdef CONFIG_SYSCTL 1438#ifdef CONFIG_SYSCTL
diff --git a/include/net/ipip.h b/include/net/ipip.h
index ddc077c51f3..21947cf4fa4 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -48,25 +48,27 @@ struct ip_tunnel_prl_entry {
48 struct rcu_head rcu_head; 48 struct rcu_head rcu_head;
49}; 49};
50 50
51#define __IPTUNNEL_XMIT(stats1, stats2) do { \ 51static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev)
52 int err; \ 52{
53 int pkt_len = skb->len - skb_transport_offset(skb); \ 53 int err;
54 \ 54 struct iphdr *iph = ip_hdr(skb);
55 skb->ip_summed = CHECKSUM_NONE; \ 55 int pkt_len = skb->len - skb_transport_offset(skb);
56 ip_select_ident(iph, &rt->dst, NULL); \ 56 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats);
57 \
58 err = ip_local_out(skb); \
59 if (likely(net_xmit_eval(err) == 0)) { \
60 u64_stats_update_begin(&(stats1)->syncp); \
61 (stats1)->tx_bytes += pkt_len; \
62 (stats1)->tx_packets++; \
63 u64_stats_update_end(&(stats1)->syncp); \
64 } else { \
65 (stats2)->tx_errors++; \
66 (stats2)->tx_aborted_errors++; \
67 } \
68} while (0)
69 57
70#define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats) 58 nf_reset(skb);
59 skb->ip_summed = CHECKSUM_NONE;
60 ip_select_ident(iph, skb_dst(skb), NULL);
61
62 err = ip_local_out(skb);
63 if (likely(net_xmit_eval(err) == 0)) {
64 u64_stats_update_begin(&tstats->syncp);
65 tstats->tx_bytes += pkt_len;
66 tstats->tx_packets++;
67 u64_stats_update_end(&tstats->syncp);
68 } else {
69 dev->stats.tx_errors++;
70 dev->stats.tx_aborted_errors++;
71 }
72}
71 73
72#endif 74#endif
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 979bf6c1314..5af66b26ebd 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -271,6 +271,15 @@ struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
271 271
272extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb); 272extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb);
273 273
274static inline bool ipv6_accept_ra(struct inet6_dev *idev)
275{
276 /* If forwarding is enabled, RA are not accepted unless the special
277 * hybrid mode (accept_ra=2) is enabled.
278 */
279 return idev->cnf.forwarding ? idev->cnf.accept_ra == 2 :
280 idev->cnf.accept_ra;
281}
282
274#if IS_ENABLED(CONFIG_IPV6) 283#if IS_ENABLED(CONFIG_IPV6)
275static inline int ip6_frag_nqueues(struct net *net) 284static inline int ip6_frag_nqueues(struct net *net)
276{ 285{
@@ -630,6 +639,16 @@ extern int ipv6_skip_exthdr(const struct sk_buff *, int start,
630 639
631extern bool ipv6_ext_hdr(u8 nexthdr); 640extern bool ipv6_ext_hdr(u8 nexthdr);
632 641
642enum {
643 IP6_FH_F_FRAG = (1 << 0),
644 IP6_FH_F_AUTH = (1 << 1),
645 IP6_FH_F_SKIP_RH = (1 << 2),
646};
647
648/* find specified header and get offset to it */
649extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
650 int target, unsigned short *fragoff, int *fragflg);
651
633extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); 652extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);
634 653
635extern struct in6_addr *fl6_update_dst(struct flowi6 *fl6, 654extern struct in6_addr *fl6_update_dst(struct flowi6 *fl6,
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 82558c8decf..ee50c5eba50 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -144,6 +144,39 @@ struct ieee80211_low_level_stats {
144}; 144};
145 145
146/** 146/**
147 * enum ieee80211_chanctx_change - change flag for channel context
148 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
149 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
150 */
151enum ieee80211_chanctx_change {
152 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
153 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
154};
155
156/**
157 * struct ieee80211_chanctx_conf - channel context that vifs may be tuned to
158 *
159 * This is the driver-visible part. The ieee80211_chanctx
160 * that contains it is visible in mac80211 only.
161 *
162 * @def: the channel definition
163 * @rx_chains_static: The number of RX chains that must always be
164 * active on the channel to receive MIMO transmissions
165 * @rx_chains_dynamic: The number of RX chains that must be enabled
166 * after RTS/CTS handshake to receive SMPS MIMO transmissions;
167 * this will always be >= @rx_chains_static.
168 * @drv_priv: data area for driver use, will always be aligned to
169 * sizeof(void *), size is determined in hw information.
170 */
171struct ieee80211_chanctx_conf {
172 struct cfg80211_chan_def def;
173
174 u8 rx_chains_static, rx_chains_dynamic;
175
176 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
177};
178
179/**
147 * enum ieee80211_bss_change - BSS change notification flags 180 * enum ieee80211_bss_change - BSS change notification flags
148 * 181 *
149 * These flags are used with the bss_info_changed() callback 182 * These flags are used with the bss_info_changed() callback
@@ -172,6 +205,9 @@ struct ieee80211_low_level_stats {
172 * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) 205 * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode)
173 * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) 206 * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode)
174 * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) 207 * @BSS_CHANGED_PS: PS changed for this BSS (STA mode)
208 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface
209 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS)
210 * changed (currently only in P2P client mode, GO mode will be later)
175 */ 211 */
176enum ieee80211_bss_change { 212enum ieee80211_bss_change {
177 BSS_CHANGED_ASSOC = 1<<0, 213 BSS_CHANGED_ASSOC = 1<<0,
@@ -192,6 +228,8 @@ enum ieee80211_bss_change {
192 BSS_CHANGED_SSID = 1<<15, 228 BSS_CHANGED_SSID = 1<<15,
193 BSS_CHANGED_AP_PROBE_RESP = 1<<16, 229 BSS_CHANGED_AP_PROBE_RESP = 1<<16,
194 BSS_CHANGED_PS = 1<<17, 230 BSS_CHANGED_PS = 1<<17,
231 BSS_CHANGED_TXPOWER = 1<<18,
232 BSS_CHANGED_P2P_PS = 1<<19,
195 233
196 /* when adding here, make sure to change ieee80211_reconfig */ 234 /* when adding here, make sure to change ieee80211_reconfig */
197}; 235};
@@ -223,6 +261,7 @@ enum ieee80211_rssi_event {
223 * @assoc: association status 261 * @assoc: association status
224 * @ibss_joined: indicates whether this station is part of an IBSS 262 * @ibss_joined: indicates whether this station is part of an IBSS
225 * or not 263 * or not
264 * @ibss_creator: indicates if a new IBSS network is being created
226 * @aid: association ID number, valid only when @assoc is true 265 * @aid: association ID number, valid only when @assoc is true
227 * @use_cts_prot: use CTS protection 266 * @use_cts_prot: use CTS protection
228 * @use_short_preamble: use 802.11b short preamble; 267 * @use_short_preamble: use 802.11b short preamble;
@@ -247,9 +286,8 @@ enum ieee80211_rssi_event {
247 * @mcast_rate: per-band multicast rate index + 1 (0: disabled) 286 * @mcast_rate: per-band multicast rate index + 1 (0: disabled)
248 * @bssid: The BSSID for this BSS 287 * @bssid: The BSSID for this BSS
249 * @enable_beacon: whether beaconing should be enabled or not 288 * @enable_beacon: whether beaconing should be enabled or not
250 * @channel_type: Channel type for this BSS -- the hardware might be 289 * @chandef: Channel definition for this BSS -- the hardware might be
251 * configured for HT40+ while this BSS only uses no-HT, for 290 * configured a higher bandwidth than this BSS uses, for example.
252 * example.
253 * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. 291 * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation.
254 * This field is only valid when the channel type is one of the HT types. 292 * This field is only valid when the channel type is one of the HT types.
255 * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value 293 * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value
@@ -273,11 +311,15 @@ enum ieee80211_rssi_event {
273 * @ssid: The SSID of the current vif. Only valid in AP-mode. 311 * @ssid: The SSID of the current vif. Only valid in AP-mode.
274 * @ssid_len: Length of SSID given in @ssid. 312 * @ssid_len: Length of SSID given in @ssid.
275 * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. 313 * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode.
314 * @txpower: TX power in dBm
315 * @p2p_ctwindow: P2P CTWindow, only for P2P client interfaces
316 * @p2p_oppps: P2P opportunistic PS is enabled
276 */ 317 */
277struct ieee80211_bss_conf { 318struct ieee80211_bss_conf {
278 const u8 *bssid; 319 const u8 *bssid;
279 /* association related data */ 320 /* association related data */
280 bool assoc, ibss_joined; 321 bool assoc, ibss_joined;
322 bool ibss_creator;
281 u16 aid; 323 u16 aid;
282 /* erp related data */ 324 /* erp related data */
283 bool use_cts_prot; 325 bool use_cts_prot;
@@ -294,7 +336,7 @@ struct ieee80211_bss_conf {
294 u16 ht_operation_mode; 336 u16 ht_operation_mode;
295 s32 cqm_rssi_thold; 337 s32 cqm_rssi_thold;
296 u32 cqm_rssi_hyst; 338 u32 cqm_rssi_hyst;
297 enum nl80211_channel_type channel_type; 339 struct cfg80211_chan_def chandef;
298 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; 340 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN];
299 u8 arp_addr_cnt; 341 u8 arp_addr_cnt;
300 bool arp_filter_enabled; 342 bool arp_filter_enabled;
@@ -304,6 +346,9 @@ struct ieee80211_bss_conf {
304 u8 ssid[IEEE80211_MAX_SSID_LEN]; 346 u8 ssid[IEEE80211_MAX_SSID_LEN];
305 size_t ssid_len; 347 size_t ssid_len;
306 bool hidden_ssid; 348 bool hidden_ssid;
349 int txpower;
350 u8 p2p_ctwindow;
351 bool p2p_oppps;
307}; 352};
308 353
309/** 354/**
@@ -454,9 +499,14 @@ enum mac80211_tx_control_flags {
454 * This is set if the current BSS requires ERP protection. 499 * This is set if the current BSS requires ERP protection.
455 * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. 500 * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble.
456 * @IEEE80211_TX_RC_MCS: HT rate. 501 * @IEEE80211_TX_RC_MCS: HT rate.
502 * @IEEE80211_TX_RC_VHT_MCS: VHT MCS rate, in this case the idx field is split
503 * into a higher 4 bits (Nss) and lower 4 bits (MCS number)
457 * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in 504 * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in
458 * Greenfield mode. 505 * Greenfield mode.
459 * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. 506 * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz.
507 * @IEEE80211_TX_RC_80_MHZ_WIDTH: Indicates 80 MHz transmission
508 * @IEEE80211_TX_RC_160_MHZ_WIDTH: Indicates 160 MHz transmission
509 * (80+80 isn't supported yet)
460 * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the 510 * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the
461 * adjacent 20 MHz channels, if the current channel type is 511 * adjacent 20 MHz channels, if the current channel type is
462 * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. 512 * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS.
@@ -467,12 +517,15 @@ enum mac80211_rate_control_flags {
467 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), 517 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1),
468 IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), 518 IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2),
469 519
470 /* rate index is an MCS rate number instead of an index */ 520 /* rate index is an HT/VHT MCS instead of an index */
471 IEEE80211_TX_RC_MCS = BIT(3), 521 IEEE80211_TX_RC_MCS = BIT(3),
472 IEEE80211_TX_RC_GREEN_FIELD = BIT(4), 522 IEEE80211_TX_RC_GREEN_FIELD = BIT(4),
473 IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), 523 IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5),
474 IEEE80211_TX_RC_DUP_DATA = BIT(6), 524 IEEE80211_TX_RC_DUP_DATA = BIT(6),
475 IEEE80211_TX_RC_SHORT_GI = BIT(7), 525 IEEE80211_TX_RC_SHORT_GI = BIT(7),
526 IEEE80211_TX_RC_VHT_MCS = BIT(8),
527 IEEE80211_TX_RC_80_MHZ_WIDTH = BIT(9),
528 IEEE80211_TX_RC_160_MHZ_WIDTH = BIT(10),
476}; 529};
477 530
478 531
@@ -515,10 +568,32 @@ enum mac80211_rate_control_flags {
515 */ 568 */
516struct ieee80211_tx_rate { 569struct ieee80211_tx_rate {
517 s8 idx; 570 s8 idx;
518 u8 count; 571 u16 count:5,
519 u8 flags; 572 flags:11;
520} __packed; 573} __packed;
521 574
575#define IEEE80211_MAX_TX_RETRY 31
576
577static inline void ieee80211_rate_set_vht(struct ieee80211_tx_rate *rate,
578 u8 mcs, u8 nss)
579{
580 WARN_ON(mcs & ~0xF);
581 WARN_ON(nss & ~0x7);
582 rate->idx = (nss << 4) | mcs;
583}
584
585static inline u8
586ieee80211_rate_get_vht_mcs(const struct ieee80211_tx_rate *rate)
587{
588 return rate->idx & 0xF;
589}
590
591static inline u8
592ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate)
593{
594 return rate->idx >> 4;
595}
596
522/** 597/**
523 * struct ieee80211_tx_info - skb transmit information 598 * struct ieee80211_tx_info - skb transmit information
524 * 599 *
@@ -663,13 +738,20 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
663 * the frame. 738 * the frame.
664 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on 739 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
665 * the frame. 740 * the frame.
666 * @RX_FLAG_MACTIME_MPDU: The timestamp passed in the RX status (@mactime 741 * @RX_FLAG_MACTIME_START: The timestamp passed in the RX status (@mactime
667 * field) is valid and contains the time the first symbol of the MPDU 742 * field) is valid and contains the time the first symbol of the MPDU
668 * was received. This is useful in monitor mode and for proper IBSS 743 * was received. This is useful in monitor mode and for proper IBSS
669 * merging. 744 * merging.
745 * @RX_FLAG_MACTIME_END: The timestamp passed in the RX status (@mactime
746 * field) is valid and contains the time the last symbol of the MPDU
747 * (including FCS) was received.
670 * @RX_FLAG_SHORTPRE: Short preamble was used for this frame 748 * @RX_FLAG_SHORTPRE: Short preamble was used for this frame
671 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index 749 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index
750 * @RX_FLAG_VHT: VHT MCS was used and rate_index is MCS index
672 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used 751 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used
752 * @RX_FLAG_80MHZ: 80 MHz was used
753 * @RX_FLAG_80P80MHZ: 80+80 MHz was used
754 * @RX_FLAG_160MHZ: 160 MHz was used
673 * @RX_FLAG_SHORT_GI: Short guard interval was used 755 * @RX_FLAG_SHORT_GI: Short guard interval was used
674 * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. 756 * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present.
675 * Valid only for data frames (mainly A-MPDU) 757 * Valid only for data frames (mainly A-MPDU)
@@ -697,7 +779,7 @@ enum mac80211_rx_flags {
697 RX_FLAG_IV_STRIPPED = BIT(4), 779 RX_FLAG_IV_STRIPPED = BIT(4),
698 RX_FLAG_FAILED_FCS_CRC = BIT(5), 780 RX_FLAG_FAILED_FCS_CRC = BIT(5),
699 RX_FLAG_FAILED_PLCP_CRC = BIT(6), 781 RX_FLAG_FAILED_PLCP_CRC = BIT(6),
700 RX_FLAG_MACTIME_MPDU = BIT(7), 782 RX_FLAG_MACTIME_START = BIT(7),
701 RX_FLAG_SHORTPRE = BIT(8), 783 RX_FLAG_SHORTPRE = BIT(8),
702 RX_FLAG_HT = BIT(9), 784 RX_FLAG_HT = BIT(9),
703 RX_FLAG_40MHZ = BIT(10), 785 RX_FLAG_40MHZ = BIT(10),
@@ -711,6 +793,11 @@ enum mac80211_rx_flags {
711 RX_FLAG_AMPDU_IS_LAST = BIT(18), 793 RX_FLAG_AMPDU_IS_LAST = BIT(18),
712 RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), 794 RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19),
713 RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), 795 RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20),
796 RX_FLAG_MACTIME_END = BIT(21),
797 RX_FLAG_VHT = BIT(22),
798 RX_FLAG_80MHZ = BIT(23),
799 RX_FLAG_80P80MHZ = BIT(24),
800 RX_FLAG_160MHZ = BIT(25),
714}; 801};
715 802
716/** 803/**
@@ -731,25 +818,39 @@ enum mac80211_rx_flags {
731 * @IEEE80211_HW_SIGNAL_* 818 * @IEEE80211_HW_SIGNAL_*
732 * @antenna: antenna used 819 * @antenna: antenna used
733 * @rate_idx: index of data rate into band's supported rates or MCS index if 820 * @rate_idx: index of data rate into band's supported rates or MCS index if
734 * HT rates are use (RX_FLAG_HT) 821 * HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT)
822 * @vht_nss: number of streams (VHT only)
735 * @flag: %RX_FLAG_* 823 * @flag: %RX_FLAG_*
736 * @rx_flags: internal RX flags for mac80211 824 * @rx_flags: internal RX flags for mac80211
737 * @ampdu_reference: A-MPDU reference number, must be a different value for 825 * @ampdu_reference: A-MPDU reference number, must be a different value for
738 * each A-MPDU but the same for each subframe within one A-MPDU 826 * each A-MPDU but the same for each subframe within one A-MPDU
739 * @ampdu_delimiter_crc: A-MPDU delimiter CRC 827 * @ampdu_delimiter_crc: A-MPDU delimiter CRC
828 * @vendor_radiotap_bitmap: radiotap vendor namespace presence bitmap
829 * @vendor_radiotap_len: radiotap vendor namespace length
830 * @vendor_radiotap_align: radiotap vendor namespace alignment. Note
831 * that the actual data must be at the start of the SKB data
832 * already.
833 * @vendor_radiotap_oui: radiotap vendor namespace OUI
834 * @vendor_radiotap_subns: radiotap vendor sub namespace
740 */ 835 */
741struct ieee80211_rx_status { 836struct ieee80211_rx_status {
742 u64 mactime; 837 u64 mactime;
743 u32 device_timestamp; 838 u32 device_timestamp;
744 u32 ampdu_reference; 839 u32 ampdu_reference;
745 u32 flag; 840 u32 flag;
841 u32 vendor_radiotap_bitmap;
842 u16 vendor_radiotap_len;
746 u16 freq; 843 u16 freq;
747 u8 rate_idx; 844 u8 rate_idx;
845 u8 vht_nss;
748 u8 rx_flags; 846 u8 rx_flags;
749 u8 band; 847 u8 band;
750 u8 antenna; 848 u8 antenna;
751 s8 signal; 849 s8 signal;
752 u8 ampdu_delimiter_crc; 850 u8 ampdu_delimiter_crc;
851 u8 vendor_radiotap_align;
852 u8 vendor_radiotap_oui[3];
853 u8 vendor_radiotap_subns;
753}; 854};
754 855
755/** 856/**
@@ -794,6 +895,8 @@ enum ieee80211_conf_flags {
794 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 895 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
795 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed 896 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed
796 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed 897 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed
898 * Note that this is only valid if channel contexts are not used,
899 * otherwise each channel context has the number of chains listed.
797 */ 900 */
798enum ieee80211_conf_changed { 901enum ieee80211_conf_changed {
799 IEEE80211_CONF_CHANGE_SMPS = BIT(1), 902 IEEE80211_CONF_CHANGE_SMPS = BIT(1),
@@ -845,7 +948,8 @@ enum ieee80211_smps_mode {
845 * powersave documentation below. This variable is valid only when 948 * powersave documentation below. This variable is valid only when
846 * the CONF_PS flag is set. 949 * the CONF_PS flag is set.
847 * 950 *
848 * @power_level: requested transmit power (in dBm) 951 * @power_level: requested transmit power (in dBm), backward compatibility
952 * value only that is set to the minimum of all interfaces
849 * 953 *
850 * @channel: the channel to tune to 954 * @channel: the channel to tune to
851 * @channel_type: the channel (HT) type 955 * @channel_type: the channel (HT) type
@@ -859,7 +963,9 @@ enum ieee80211_smps_mode {
859 * 963 *
860 * @smps_mode: spatial multiplexing powersave mode; note that 964 * @smps_mode: spatial multiplexing powersave mode; note that
861 * %IEEE80211_SMPS_STATIC is used when the device is not 965 * %IEEE80211_SMPS_STATIC is used when the device is not
862 * configured for an HT channel 966 * configured for an HT channel.
967 * Note that this is only valid if channel contexts are not used,
968 * otherwise each channel context has the number of chains listed.
863 */ 969 */
864struct ieee80211_conf { 970struct ieee80211_conf {
865 u32 flags; 971 u32 flags;
@@ -931,6 +1037,11 @@ enum ieee80211_vif_flags {
931 * at runtime, mac80211 will never touch this field 1037 * at runtime, mac80211 will never touch this field
932 * @hw_queue: hardware queue for each AC 1038 * @hw_queue: hardware queue for each AC
933 * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only 1039 * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only
1040 * @chanctx_conf: The channel context this interface is assigned to, or %NULL
1041 * when it is not assigned. This pointer is RCU-protected due to the TX
1042 * path needing to access it; even though the netdev carrier will always
1043 * be off when it is %NULL there can still be races and packets could be
1044 * processed after it switches back to %NULL.
934 * @drv_priv: data area for driver use, will always be aligned to 1045 * @drv_priv: data area for driver use, will always be aligned to
935 * sizeof(void *). 1046 * sizeof(void *).
936 */ 1047 */
@@ -943,6 +1054,8 @@ struct ieee80211_vif {
943 u8 cab_queue; 1054 u8 cab_queue;
944 u8 hw_queue[IEEE80211_NUM_ACS]; 1055 u8 hw_queue[IEEE80211_NUM_ACS];
945 1056
1057 struct ieee80211_chanctx_conf __rcu *chanctx_conf;
1058
946 u32 driver_flags; 1059 u32 driver_flags;
947 1060
948 /* must be last */ 1061 /* must be last */
@@ -1076,6 +1189,8 @@ enum ieee80211_sta_state {
1076 * @aid: AID we assigned to the station if we're an AP 1189 * @aid: AID we assigned to the station if we're an AP
1077 * @supp_rates: Bitmap of supported rates (per band) 1190 * @supp_rates: Bitmap of supported rates (per band)
1078 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities 1191 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
1192 * @vht_cap: VHT capabilities of this STA; Not restricting any capabilities
1193 * of remote STA. Taking as is.
1079 * @wme: indicates whether the STA supports WME. Only valid during AP-mode. 1194 * @wme: indicates whether the STA supports WME. Only valid during AP-mode.
1080 * @drv_priv: data area for driver use, will always be aligned to 1195 * @drv_priv: data area for driver use, will always be aligned to
1081 * sizeof(void *), size is determined in hw information. 1196 * sizeof(void *), size is determined in hw information.
@@ -1088,6 +1203,7 @@ struct ieee80211_sta {
1088 u8 addr[ETH_ALEN]; 1203 u8 addr[ETH_ALEN];
1089 u16 aid; 1204 u16 aid;
1090 struct ieee80211_sta_ht_cap ht_cap; 1205 struct ieee80211_sta_ht_cap ht_cap;
1206 struct ieee80211_sta_vht_cap vht_cap;
1091 bool wme; 1207 bool wme;
1092 u8 uapsd_queues; 1208 u8 uapsd_queues;
1093 u8 max_sp; 1209 u8 max_sp;
@@ -1253,6 +1369,10 @@ struct ieee80211_tx_control {
1253 * @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any 1369 * @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any
1254 * P2P Interface. This will be honoured even if more than one interface 1370 * P2P Interface. This will be honoured even if more than one interface
1255 * is supported. 1371 * is supported.
1372 *
1373 * @IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL: On this hardware TX BA session
1374 * should be tear down once BAR frame will not be acked.
1375 *
1256 */ 1376 */
1257enum ieee80211_hw_flags { 1377enum ieee80211_hw_flags {
1258 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1378 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1281,6 +1401,7 @@ enum ieee80211_hw_flags {
1281 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, 1401 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
1282 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24, 1402 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24,
1283 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, 1403 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25,
1404 IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL = 1<<26,
1284}; 1405};
1285 1406
1286/** 1407/**
@@ -1325,6 +1446,8 @@ enum ieee80211_hw_flags {
1325 * within &struct ieee80211_vif. 1446 * within &struct ieee80211_vif.
1326 * @sta_data_size: size (in bytes) of the drv_priv data area 1447 * @sta_data_size: size (in bytes) of the drv_priv data area
1327 * within &struct ieee80211_sta. 1448 * within &struct ieee80211_sta.
1449 * @chanctx_data_size: size (in bytes) of the drv_priv data area
1450 * within &struct ieee80211_chanctx_conf.
1328 * 1451 *
1329 * @max_rates: maximum number of alternate rate retry stages the hw 1452 * @max_rates: maximum number of alternate rate retry stages the hw
1330 * can handle. 1453 * can handle.
@@ -1355,6 +1478,10 @@ enum ieee80211_hw_flags {
1355 * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only 1478 * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only
1356 * adding _BW is supported today. 1479 * adding _BW is supported today.
1357 * 1480 *
1481 * @radiotap_vht_details: lists which VHT MCS information the HW reports,
1482 * the default is _GI | _BANDWIDTH.
1483 * Use the %IEEE80211_RADIOTAP_VHT_KNOWN_* values.
1484 *
1358 * @netdev_features: netdev features to be set in each netdev created 1485 * @netdev_features: netdev features to be set in each netdev created
1359 * from this HW. Note only HW checksum features are currently 1486 * from this HW. Note only HW checksum features are currently
1360 * compatible with mac80211. Other feature bits will be rejected. 1487 * compatible with mac80211. Other feature bits will be rejected.
@@ -1369,6 +1496,7 @@ struct ieee80211_hw {
1369 int channel_change_time; 1496 int channel_change_time;
1370 int vif_data_size; 1497 int vif_data_size;
1371 int sta_data_size; 1498 int sta_data_size;
1499 int chanctx_data_size;
1372 int napi_weight; 1500 int napi_weight;
1373 u16 queues; 1501 u16 queues;
1374 u16 max_listen_interval; 1502 u16 max_listen_interval;
@@ -1380,6 +1508,7 @@ struct ieee80211_hw {
1380 u8 max_tx_aggregation_subframes; 1508 u8 max_tx_aggregation_subframes;
1381 u8 offchannel_tx_hw_queue; 1509 u8 offchannel_tx_hw_queue;
1382 u8 radiotap_mcs_details; 1510 u8 radiotap_mcs_details;
1511 u16 radiotap_vht_details;
1383 netdev_features_t netdev_features; 1512 netdev_features_t netdev_features;
1384}; 1513};
1385 1514
@@ -2126,6 +2255,14 @@ enum ieee80211_rate_control_changed {
2126 * @sta_remove: Notifies low level driver about removal of an associated 2255 * @sta_remove: Notifies low level driver about removal of an associated
2127 * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2256 * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep.
2128 * 2257 *
2258 * @sta_add_debugfs: Drivers can use this callback to add debugfs files
2259 * when a station is added to mac80211's station list. This callback
2260 * and @sta_remove_debugfs should be within a CONFIG_MAC80211_DEBUGFS
2261 * conditional. This callback can sleep.
2262 *
2263 * @sta_remove_debugfs: Remove the debugfs files which were added using
2264 * @sta_add_debugfs. This callback can sleep.
2265 *
2129 * @sta_notify: Notifies low level driver about power state transition of an 2266 * @sta_notify: Notifies low level driver about power state transition of an
2130 * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating 2267 * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating
2131 * in AP mode, this callback will not be called when the flag 2268 * in AP mode, this callback will not be called when the flag
@@ -2317,6 +2454,27 @@ enum ieee80211_rate_control_changed {
2317 * The callback will be called before each transmission and upon return 2454 * The callback will be called before each transmission and upon return
2318 * mac80211 will transmit the frame right away. 2455 * mac80211 will transmit the frame right away.
2319 * The callback is optional and can (should!) sleep. 2456 * The callback is optional and can (should!) sleep.
2457 *
2458 * @add_chanctx: Notifies device driver about new channel context creation.
2459 * @remove_chanctx: Notifies device driver about channel context destruction.
2460 * @change_chanctx: Notifies device driver about channel context changes that
2461 * may happen when combining different virtual interfaces on the same
2462 * channel context with different settings
2463 * @assign_vif_chanctx: Notifies device driver about channel context being bound
2464 * to vif. Possible use is for hw queue remapping.
2465 * @unassign_vif_chanctx: Notifies device driver about channel context being
2466 * unbound from vif.
2467 * @start_ap: Start operation on the AP interface, this is called after all the
2468 * information in bss_conf is set and beacon can be retrieved. A channel
2469 * context is bound before this is called. Note that if the driver uses
2470 * software scan or ROC, this (and @stop_ap) isn't called when the AP is
2471 * just "paused" for scanning/ROC, which is indicated by the beacon being
2472 * disabled/enabled via @bss_info_changed.
2473 * @stop_ap: Stop operation on the AP interface.
2474 *
2475 * @restart_complete: Called after a call to ieee80211_restart_hw(), when the
2476 * reconfiguration has completed. This can help the driver implement the
2477 * reconfiguration step. This callback may sleep.
2320 */ 2478 */
2321struct ieee80211_ops { 2479struct ieee80211_ops {
2322 void (*tx)(struct ieee80211_hw *hw, 2480 void (*tx)(struct ieee80211_hw *hw,
@@ -2342,6 +2500,9 @@ struct ieee80211_ops {
2342 struct ieee80211_bss_conf *info, 2500 struct ieee80211_bss_conf *info,
2343 u32 changed); 2501 u32 changed);
2344 2502
2503 int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2504 void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2505
2345 u64 (*prepare_multicast)(struct ieee80211_hw *hw, 2506 u64 (*prepare_multicast)(struct ieee80211_hw *hw,
2346 struct netdev_hw_addr_list *mc_list); 2507 struct netdev_hw_addr_list *mc_list);
2347 void (*configure_filter)(struct ieee80211_hw *hw, 2508 void (*configure_filter)(struct ieee80211_hw *hw,
@@ -2383,6 +2544,16 @@ struct ieee80211_ops {
2383 struct ieee80211_sta *sta); 2544 struct ieee80211_sta *sta);
2384 int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2545 int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2385 struct ieee80211_sta *sta); 2546 struct ieee80211_sta *sta);
2547#ifdef CONFIG_MAC80211_DEBUGFS
2548 void (*sta_add_debugfs)(struct ieee80211_hw *hw,
2549 struct ieee80211_vif *vif,
2550 struct ieee80211_sta *sta,
2551 struct dentry *dir);
2552 void (*sta_remove_debugfs)(struct ieee80211_hw *hw,
2553 struct ieee80211_vif *vif,
2554 struct ieee80211_sta *sta,
2555 struct dentry *dir);
2556#endif
2386 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2557 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2387 enum sta_notify_cmd, struct ieee80211_sta *sta); 2558 enum sta_notify_cmd, struct ieee80211_sta *sta);
2388 int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2559 int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -2424,8 +2595,8 @@ struct ieee80211_ops {
2424 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); 2595 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
2425 2596
2426 int (*remain_on_channel)(struct ieee80211_hw *hw, 2597 int (*remain_on_channel)(struct ieee80211_hw *hw,
2598 struct ieee80211_vif *vif,
2427 struct ieee80211_channel *chan, 2599 struct ieee80211_channel *chan,
2428 enum nl80211_channel_type channel_type,
2429 int duration); 2600 int duration);
2430 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); 2601 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
2431 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); 2602 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
@@ -2461,6 +2632,22 @@ struct ieee80211_ops {
2461 2632
2462 void (*mgd_prepare_tx)(struct ieee80211_hw *hw, 2633 void (*mgd_prepare_tx)(struct ieee80211_hw *hw,
2463 struct ieee80211_vif *vif); 2634 struct ieee80211_vif *vif);
2635
2636 int (*add_chanctx)(struct ieee80211_hw *hw,
2637 struct ieee80211_chanctx_conf *ctx);
2638 void (*remove_chanctx)(struct ieee80211_hw *hw,
2639 struct ieee80211_chanctx_conf *ctx);
2640 void (*change_chanctx)(struct ieee80211_hw *hw,
2641 struct ieee80211_chanctx_conf *ctx,
2642 u32 changed);
2643 int (*assign_vif_chanctx)(struct ieee80211_hw *hw,
2644 struct ieee80211_vif *vif,
2645 struct ieee80211_chanctx_conf *ctx);
2646 void (*unassign_vif_chanctx)(struct ieee80211_hw *hw,
2647 struct ieee80211_vif *vif,
2648 struct ieee80211_chanctx_conf *ctx);
2649
2650 void (*restart_complete)(struct ieee80211_hw *hw);
2464}; 2651};
2465 2652
2466/** 2653/**
@@ -2962,8 +3149,7 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
2962 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3149 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2963 * @ssid: SSID buffer 3150 * @ssid: SSID buffer
2964 * @ssid_len: length of SSID 3151 * @ssid_len: length of SSID
2965 * @ie: buffer containing all IEs except SSID for the template 3152 * @tailroom: tailroom to reserve at end of SKB for IEs
2966 * @ie_len: length of the IE buffer
2967 * 3153 *
2968 * Creates a Probe Request template which can, for example, be uploaded to 3154 * Creates a Probe Request template which can, for example, be uploaded to
2969 * hardware. 3155 * hardware.
@@ -2971,7 +3157,7 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
2971struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw, 3157struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw,
2972 struct ieee80211_vif *vif, 3158 struct ieee80211_vif *vif,
2973 const u8 *ssid, size_t ssid_len, 3159 const u8 *ssid, size_t ssid_len,
2974 const u8 *ie, size_t ie_len); 3160 size_t tailroom);
2975 3161
2976/** 3162/**
2977 * ieee80211_rts_get - RTS frame generation function 3163 * ieee80211_rts_get - RTS frame generation function
@@ -3145,6 +3331,19 @@ void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
3145 struct sk_buff *skb, u8 *p2k); 3331 struct sk_buff *skb, u8 *p2k);
3146 3332
3147/** 3333/**
3334 * ieee80211_aes_cmac_calculate_k1_k2 - calculate the AES-CMAC sub keys
3335 *
3336 * This function computes the two AES-CMAC sub-keys, based on the
3337 * previously installed master key.
3338 *
3339 * @keyconf: the parameter passed with the set key
3340 * @k1: a buffer to be filled with the 1st sub-key
3341 * @k2: a buffer to be filled with the 2nd sub-key
3342 */
3343void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf,
3344 u8 *k1, u8 *k2);
3345
3346/**
3148 * struct ieee80211_key_seq - key sequence counter 3347 * struct ieee80211_key_seq - key sequence counter
3149 * 3348 *
3150 * @tkip: TKIP data, containing IV32 and IV16 in host byte order 3349 * @tkip: TKIP data, containing IV32 and IV16 in host byte order
@@ -3294,6 +3493,21 @@ void ieee80211_sched_scan_results(struct ieee80211_hw *hw);
3294void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); 3493void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw);
3295 3494
3296/** 3495/**
3496 * enum ieee80211_interface_iteration_flags - interface iteration flags
3497 * @IEEE80211_IFACE_ITER_NORMAL: Iterate over all interfaces that have
3498 * been added to the driver; However, note that during hardware
3499 * reconfiguration (after restart_hw) it will iterate over a new
3500 * interface and over all the existing interfaces even if they
3501 * haven't been re-added to the driver yet.
3502 * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all
3503 * interfaces, even if they haven't been re-added to the driver yet.
3504 */
3505enum ieee80211_interface_iteration_flags {
3506 IEEE80211_IFACE_ITER_NORMAL = 0,
3507 IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0),
3508};
3509
3510/**
3297 * ieee80211_iterate_active_interfaces - iterate active interfaces 3511 * ieee80211_iterate_active_interfaces - iterate active interfaces
3298 * 3512 *
3299 * This function iterates over the interfaces associated with a given 3513 * This function iterates over the interfaces associated with a given
@@ -3301,13 +3515,15 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw);
3301 * This function allows the iterator function to sleep, when the iterator 3515 * This function allows the iterator function to sleep, when the iterator
3302 * function is atomic @ieee80211_iterate_active_interfaces_atomic can 3516 * function is atomic @ieee80211_iterate_active_interfaces_atomic can
3303 * be used. 3517 * be used.
3304 * Does not iterate over a new interface during add_interface() 3518 * Does not iterate over a new interface during add_interface().
3305 * 3519 *
3306 * @hw: the hardware struct of which the interfaces should be iterated over 3520 * @hw: the hardware struct of which the interfaces should be iterated over
3521 * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags
3307 * @iterator: the iterator function to call 3522 * @iterator: the iterator function to call
3308 * @data: first argument of the iterator function 3523 * @data: first argument of the iterator function
3309 */ 3524 */
3310void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, 3525void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
3526 u32 iter_flags,
3311 void (*iterator)(void *data, u8 *mac, 3527 void (*iterator)(void *data, u8 *mac,
3312 struct ieee80211_vif *vif), 3528 struct ieee80211_vif *vif),
3313 void *data); 3529 void *data);
@@ -3319,13 +3535,15 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
3319 * hardware that are currently active and calls the callback for them. 3535 * hardware that are currently active and calls the callback for them.
3320 * This function requires the iterator callback function to be atomic, 3536 * This function requires the iterator callback function to be atomic,
3321 * if that is not desired, use @ieee80211_iterate_active_interfaces instead. 3537 * if that is not desired, use @ieee80211_iterate_active_interfaces instead.
3322 * Does not iterate over a new interface during add_interface() 3538 * Does not iterate over a new interface during add_interface().
3323 * 3539 *
3324 * @hw: the hardware struct of which the interfaces should be iterated over 3540 * @hw: the hardware struct of which the interfaces should be iterated over
3541 * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags
3325 * @iterator: the iterator function to call, cannot sleep 3542 * @iterator: the iterator function to call, cannot sleep
3326 * @data: first argument of the iterator function 3543 * @data: first argument of the iterator function
3327 */ 3544 */
3328void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, 3545void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw,
3546 u32 iter_flags,
3329 void (*iterator)(void *data, 3547 void (*iterator)(void *data,
3330 u8 *mac, 3548 u8 *mac,
3331 struct ieee80211_vif *vif), 3549 struct ieee80211_vif *vif),
@@ -3524,6 +3742,27 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,
3524 void *iter_data); 3742 void *iter_data);
3525 3743
3526/** 3744/**
3745 * ieee80211_iter_chan_contexts_atomic - iterate channel contexts
3746 * @hw: pointre obtained from ieee80211_alloc_hw().
3747 * @iter: iterator function
3748 * @iter_data: data passed to iterator function
3749 *
3750 * Iterate all active channel contexts. This function is atomic and
3751 * doesn't acquire any locks internally that might be held in other
3752 * places while calling into the driver.
3753 *
3754 * The iterator will not find a context that's being added (during
3755 * the driver callback to add it) but will find it while it's being
3756 * removed.
3757 */
3758void ieee80211_iter_chan_contexts_atomic(
3759 struct ieee80211_hw *hw,
3760 void (*iter)(struct ieee80211_hw *hw,
3761 struct ieee80211_chanctx_conf *chanctx_conf,
3762 void *data),
3763 void *iter_data);
3764
3765/**
3527 * ieee80211_ap_probereq_get - retrieve a Probe Request template 3766 * ieee80211_ap_probereq_get - retrieve a Probe Request template
3528 * @hw: pointer obtained from ieee80211_alloc_hw(). 3767 * @hw: pointer obtained from ieee80211_alloc_hw().
3529 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3768 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 980d263765c..7af1ea89303 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -190,21 +190,6 @@ extern void ndisc_send_redirect(struct sk_buff *skb,
190extern int ndisc_mc_map(const struct in6_addr *addr, char *buf, 190extern int ndisc_mc_map(const struct in6_addr *addr, char *buf,
191 struct net_device *dev, int dir); 191 struct net_device *dev, int dir);
192 192
193extern struct sk_buff *ndisc_build_skb(struct net_device *dev,
194 const struct in6_addr *daddr,
195 const struct in6_addr *saddr,
196 struct icmp6hdr *icmp6h,
197 const struct in6_addr *target,
198 int llinfo);
199
200extern void ndisc_send_skb(struct sk_buff *skb,
201 struct net_device *dev,
202 struct neighbour *neigh,
203 const struct in6_addr *daddr,
204 const struct in6_addr *saddr,
205 struct icmp6hdr *icmp6h);
206
207
208 193
209/* 194/*
210 * IGMP 195 * IGMP
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 95e64664118..c5a43f56b79 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -23,6 +23,7 @@
23#endif 23#endif
24#include <net/netns/xfrm.h> 24#include <net/netns/xfrm.h>
25 25
26struct user_namespace;
26struct proc_dir_entry; 27struct proc_dir_entry;
27struct net_device; 28struct net_device;
28struct sock; 29struct sock;
@@ -53,6 +54,8 @@ struct net {
53 struct list_head cleanup_list; /* namespaces on death row */ 54 struct list_head cleanup_list; /* namespaces on death row */
54 struct list_head exit_list; /* Use only net_mutex */ 55 struct list_head exit_list; /* Use only net_mutex */
55 56
57 struct user_namespace *user_ns; /* Owning user namespace */
58
56 struct proc_dir_entry *proc_net; 59 struct proc_dir_entry *proc_net;
57 struct proc_dir_entry *proc_net_stat; 60 struct proc_dir_entry *proc_net_stat;
58 61
@@ -126,16 +129,21 @@ struct net {
126/* Init's network namespace */ 129/* Init's network namespace */
127extern struct net init_net; 130extern struct net init_net;
128 131
129#ifdef CONFIG_NET 132#ifdef CONFIG_NET_NS
130extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); 133extern struct net *copy_net_ns(unsigned long flags,
131 134 struct user_namespace *user_ns, struct net *old_net);
132#else /* CONFIG_NET */ 135
133static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) 136#else /* CONFIG_NET_NS */
137#include <linux/sched.h>
138#include <linux/nsproxy.h>
139static inline struct net *copy_net_ns(unsigned long flags,
140 struct user_namespace *user_ns, struct net *old_net)
134{ 141{
135 /* There is nothing to copy so this is a noop */ 142 if (flags & CLONE_NEWNET)
136 return net_ns; 143 return ERR_PTR(-EINVAL);
144 return old_net;
137} 145}
138#endif /* CONFIG_NET */ 146#endif /* CONFIG_NET_NS */
139 147
140 148
141extern struct list_head net_namespace_list; 149extern struct list_head net_namespace_list;
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index f1494feba79..caca0c4d6b4 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -182,7 +182,7 @@ __nf_conntrack_find(struct net *net, u16 zone,
182 182
183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); 183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct);
184extern void nf_ct_delete_from_lists(struct nf_conn *ct); 184extern void nf_ct_delete_from_lists(struct nf_conn *ct);
185extern void nf_ct_insert_dying_list(struct nf_conn *ct); 185extern void nf_ct_dying_timeout(struct nf_conn *ct);
186 186
187extern void nf_conntrack_flush_report(struct net *net, u32 pid, int report); 187extern void nf_conntrack_flush_report(struct net *net, u32 pid, int report);
188 188
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index bd8eea720f2..ad14a799fd2 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -68,4 +68,19 @@ static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct)
68#endif 68#endif
69} 69}
70 70
71static inline bool nf_nat_oif_changed(unsigned int hooknum,
72 enum ip_conntrack_info ctinfo,
73 struct nf_conn_nat *nat,
74 const struct net_device *out)
75{
76#if IS_ENABLED(CONFIG_IP_NF_TARGET_MASQUERADE) || \
77 IS_ENABLED(CONFIG_IP6_NF_TARGET_MASQUERADE)
78 return nat->masq_index && hooknum == NF_INET_POST_ROUTING &&
79 CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL &&
80 nat->masq_index != out->ifindex;
81#else
82 return false;
83#endif
84}
85
71#endif 86#endif
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
index 252fd1010b7..fb1c0be38b6 100644
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -21,14 +21,10 @@ struct nf_queue_entry {
21struct nf_queue_handler { 21struct nf_queue_handler {
22 int (*outfn)(struct nf_queue_entry *entry, 22 int (*outfn)(struct nf_queue_entry *entry,
23 unsigned int queuenum); 23 unsigned int queuenum);
24 char *name;
25}; 24};
26 25
27extern int nf_register_queue_handler(u_int8_t pf, 26void nf_register_queue_handler(const struct nf_queue_handler *qh);
28 const struct nf_queue_handler *qh); 27void nf_unregister_queue_handler(void);
29extern int nf_unregister_queue_handler(u_int8_t pf,
30 const struct nf_queue_handler *qh);
31extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh);
32extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); 28extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
33 29
34#endif /* _NF_QUEUE_H */ 30#endif /* _NF_QUEUE_H */
diff --git a/include/net/netns/sctp.h b/include/net/netns/sctp.h
index 5e5eb1f9f14..3573a81815a 100644
--- a/include/net/netns/sctp.h
+++ b/include/net/netns/sctp.h
@@ -62,6 +62,9 @@ struct netns_sctp {
62 /* Whether Cookie Preservative is enabled(1) or not(0) */ 62 /* Whether Cookie Preservative is enabled(1) or not(0) */
63 int cookie_preserve_enable; 63 int cookie_preserve_enable;
64 64
65 /* The namespace default hmac alg */
66 char *sctp_hmac_alg;
67
65 /* Valid.Cookie.Life - 60 seconds */ 68 /* Valid.Cookie.Life - 60 seconds */
66 unsigned int valid_cookie_life; 69 unsigned int valid_cookie_life;
67 70
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index e900072950c..671953e1157 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -24,6 +24,12 @@
24 24
25#include <net/nfc/nfc.h> 25#include <net/nfc/nfc.h>
26 26
27struct nfc_phy_ops {
28 int (*write)(void *dev_id, struct sk_buff *skb);
29 int (*enable)(void *dev_id);
30 void (*disable)(void *dev_id);
31};
32
27struct nfc_hci_dev; 33struct nfc_hci_dev;
28 34
29struct nfc_hci_ops { 35struct nfc_hci_ops {
@@ -38,15 +44,21 @@ struct nfc_hci_ops {
38 int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); 44 int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb);
39 int (*start_poll) (struct nfc_hci_dev *hdev, 45 int (*start_poll) (struct nfc_hci_dev *hdev,
40 u32 im_protocols, u32 tm_protocols); 46 u32 im_protocols, u32 tm_protocols);
47 int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target,
48 u8 comm_mode, u8 *gb, size_t gb_len);
49 int (*dep_link_down)(struct nfc_hci_dev *hdev);
41 int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, 50 int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate,
42 struct nfc_target *target); 51 struct nfc_target *target);
43 int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, 52 int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate,
44 struct nfc_target *target); 53 struct nfc_target *target);
45 int (*data_exchange) (struct nfc_hci_dev *hdev, 54 int (*im_transceive) (struct nfc_hci_dev *hdev,
46 struct nfc_target *target, struct sk_buff *skb, 55 struct nfc_target *target, struct sk_buff *skb,
47 data_exchange_cb_t cb, void *cb_context); 56 data_exchange_cb_t cb, void *cb_context);
57 int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb);
48 int (*check_presence)(struct nfc_hci_dev *hdev, 58 int (*check_presence)(struct nfc_hci_dev *hdev,
49 struct nfc_target *target); 59 struct nfc_target *target);
60 void (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event,
61 struct sk_buff *skb);
50}; 62};
51 63
52/* Pipes */ 64/* Pipes */
@@ -114,6 +126,9 @@ struct nfc_hci_dev {
114 int async_cb_type; 126 int async_cb_type;
115 data_exchange_cb_t async_cb; 127 data_exchange_cb_t async_cb;
116 void *async_cb_context; 128 void *async_cb_context;
129
130 u8 *gb;
131 size_t gb_len;
117}; 132};
118 133
119/* hci device allocation */ 134/* hci device allocation */
@@ -134,6 +149,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev);
134 149
135void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); 150void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err);
136 151
152int nfc_hci_result_to_errno(u8 result);
153
137/* Host IDs */ 154/* Host IDs */
138#define NFC_HCI_HOST_CONTROLLER_ID 0x00 155#define NFC_HCI_HOST_CONTROLLER_ID 0x00
139#define NFC_HCI_TERMINAL_HOST_ID 0x01 156#define NFC_HCI_TERMINAL_HOST_ID 0x01
@@ -219,5 +236,7 @@ int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response,
219 const u8 *param, size_t param_len); 236 const u8 *param, size_t param_len);
220int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, 237int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event,
221 const u8 *param, size_t param_len); 238 const u8 *param, size_t param_len);
239int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate);
240u32 nfc_hci_sak_to_protocol(u8 sak);
222 241
223#endif /* __NET_HCI_H */ 242#endif /* __NET_HCI_H */
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index f05b10682c9..fce80b2f9be 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -95,7 +95,7 @@ struct nfc_genl_data {
95}; 95};
96 96
97struct nfc_dev { 97struct nfc_dev {
98 unsigned int idx; 98 int idx;
99 u32 target_next_idx; 99 u32 target_next_idx;
100 struct nfc_target *targets; 100 struct nfc_target *targets;
101 int n_targets; 101 int n_targets;
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 929528c73fe..047c0476c0a 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -25,9 +25,11 @@
25#define _PROTOCOL_H 25#define _PROTOCOL_H
26 26
27#include <linux/in6.h> 27#include <linux/in6.h>
28#include <linux/skbuff.h>
28#if IS_ENABLED(CONFIG_IPV6) 29#if IS_ENABLED(CONFIG_IPV6)
29#include <linux/ipv6.h> 30#include <linux/ipv6.h>
30#endif 31#endif
32#include <linux/netdevice.h>
31 33
32/* This is one larger than the largest protocol value that can be 34/* This is one larger than the largest protocol value that can be
33 * found in an ipv4 or ipv6 header. Since in both cases the protocol 35 * found in an ipv4 or ipv6 header. Since in both cases the protocol
@@ -40,12 +42,6 @@ struct net_protocol {
40 void (*early_demux)(struct sk_buff *skb); 42 void (*early_demux)(struct sk_buff *skb);
41 int (*handler)(struct sk_buff *skb); 43 int (*handler)(struct sk_buff *skb);
42 void (*err_handler)(struct sk_buff *skb, u32 info); 44 void (*err_handler)(struct sk_buff *skb, u32 info);
43 int (*gso_send_check)(struct sk_buff *skb);
44 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
45 netdev_features_t features);
46 struct sk_buff **(*gro_receive)(struct sk_buff **head,
47 struct sk_buff *skb);
48 int (*gro_complete)(struct sk_buff *skb);
49 unsigned int no_policy:1, 45 unsigned int no_policy:1,
50 netns_ok:1; 46 netns_ok:1;
51}; 47};
@@ -60,23 +56,20 @@ struct inet6_protocol {
60 struct inet6_skb_parm *opt, 56 struct inet6_skb_parm *opt,
61 u8 type, u8 code, int offset, 57 u8 type, u8 code, int offset,
62 __be32 info); 58 __be32 info);
63
64 int (*gso_send_check)(struct sk_buff *skb);
65 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
66 netdev_features_t features);
67 struct sk_buff **(*gro_receive)(struct sk_buff **head,
68 struct sk_buff *skb);
69 int (*gro_complete)(struct sk_buff *skb);
70
71 unsigned int flags; /* INET6_PROTO_xxx */ 59 unsigned int flags; /* INET6_PROTO_xxx */
72}; 60};
73 61
74#define INET6_PROTO_NOPOLICY 0x1 62#define INET6_PROTO_NOPOLICY 0x1
75#define INET6_PROTO_FINAL 0x2 63#define INET6_PROTO_FINAL 0x2
76/* This should be set for any extension header which is compatible with GSO. */
77#define INET6_PROTO_GSO_EXTHDR 0x4
78#endif 64#endif
79 65
66struct net_offload {
67 struct offload_callbacks callbacks;
68 unsigned int flags; /* Flags used by IPv6 for now */
69};
70/* This should be set for any extension header which is compatible with GSO. */
71#define INET6_PROTO_GSO_EXTHDR 0x1
72
80/* This is used to register socket interfaces for IP protocols. */ 73/* This is used to register socket interfaces for IP protocols. */
81struct inet_protosw { 74struct inet_protosw {
82 struct list_head list; 75 struct list_head list;
@@ -96,6 +89,8 @@ struct inet_protosw {
96#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ 89#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */
97 90
98extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; 91extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS];
92extern const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS];
93extern const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS];
99 94
100#if IS_ENABLED(CONFIG_IPV6) 95#if IS_ENABLED(CONFIG_IPV6)
101extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; 96extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
@@ -103,6 +98,8 @@ extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
103 98
104extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); 99extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num);
105extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); 100extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num);
101extern int inet_add_offload(const struct net_offload *prot, unsigned char num);
102extern int inet_del_offload(const struct net_offload *prot, unsigned char num);
106extern void inet_register_protosw(struct inet_protosw *p); 103extern void inet_register_protosw(struct inet_protosw *p);
107extern void inet_unregister_protosw(struct inet_protosw *p); 104extern void inet_unregister_protosw(struct inet_protosw *p);
108 105
@@ -112,5 +109,7 @@ extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char n
112extern int inet6_register_protosw(struct inet_protosw *p); 109extern int inet6_register_protosw(struct inet_protosw *p);
113extern void inet6_unregister_protosw(struct inet_protosw *p); 110extern void inet6_unregister_protosw(struct inet_protosw *p);
114#endif 111#endif
112extern int inet6_add_offload(const struct net_offload *prot, unsigned char num);
113extern int inet6_del_offload(const struct net_offload *prot, unsigned char num);
115 114
116#endif /* _PROTOCOL_H */ 115#endif /* _PROTOCOL_H */
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index b01d8dd9ee7..a51dbd17c2d 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -49,13 +49,16 @@ struct request_sock_ops {
49 struct request_sock *req); 49 struct request_sock *req);
50}; 50};
51 51
52extern int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req);
53
52/* struct request_sock - mini sock to represent a connection request 54/* struct request_sock - mini sock to represent a connection request
53 */ 55 */
54struct request_sock { 56struct request_sock {
55 struct request_sock *dl_next; /* Must be first member! */ 57 struct request_sock *dl_next; /* Must be first member! */
56 u16 mss; 58 u16 mss;
57 u8 retrans; 59 u8 num_retrans; /* number of retransmits */
58 u8 cookie_ts; /* syncookie: encode tcpopts in timestamp */ 60 u8 cookie_ts:1; /* syncookie: encode tcpopts in timestamp */
61 u8 num_timeout:7; /* number of timeouts */
59 /* The following two fields can be easily recomputed I think -AK */ 62 /* The following two fields can be easily recomputed I think -AK */
60 u32 window_clamp; /* window clamp at creation time */ 63 u32 window_clamp; /* window clamp at creation time */
61 u32 rcv_wnd; /* rcv_wnd offered first time */ 64 u32 rcv_wnd; /* rcv_wnd offered first time */
@@ -231,7 +234,7 @@ static inline int reqsk_queue_removed(struct request_sock_queue *queue,
231{ 234{
232 struct listen_sock *lopt = queue->listen_opt; 235 struct listen_sock *lopt = queue->listen_opt;
233 236
234 if (req->retrans == 0) 237 if (req->num_timeout == 0)
235 --lopt->qlen_young; 238 --lopt->qlen_young;
236 239
237 return --lopt->qlen; 240 return --lopt->qlen;
@@ -269,7 +272,8 @@ static inline void reqsk_queue_hash_req(struct request_sock_queue *queue,
269 struct listen_sock *lopt = queue->listen_opt; 272 struct listen_sock *lopt = queue->listen_opt;
270 273
271 req->expires = jiffies + timeout; 274 req->expires = jiffies + timeout;
272 req->retrans = 0; 275 req->num_retrans = 0;
276 req->num_timeout = 0;
273 req->sk = NULL; 277 req->sk = NULL;
274 req->dl_next = lopt->syn_table[hash]; 278 req->dl_next = lopt->syn_table[hash];
275 279
diff --git a/include/net/route.h b/include/net/route.h
index bc40b633a5c..2ea40c1b5e0 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -198,10 +198,13 @@ struct in_ifaddr;
198extern void fib_add_ifaddr(struct in_ifaddr *); 198extern void fib_add_ifaddr(struct in_ifaddr *);
199extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); 199extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *);
200 200
201static inline void ip_rt_put(struct rtable * rt) 201static inline void ip_rt_put(struct rtable *rt)
202{ 202{
203 if (rt) 203 /* dst_release() accepts a NULL parameter.
204 dst_release(&rt->dst); 204 * We rely on dst being first structure in struct rtable
205 */
206 BUILD_BUG_ON(offsetof(struct rtable, dst) != 0);
207 dst_release(&rt->dst);
205} 208}
206 209
207#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) 210#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3)
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 6b00c4fc429..5a15fabd6a7 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -125,7 +125,7 @@ extern void rtnl_af_unregister(struct rtnl_af_ops *ops);
125 125
126 126
127extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); 127extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
128extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, 128extern struct net_device *rtnl_create_link(struct net *net,
129 char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); 129 char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]);
130extern int rtnl_configure_link(struct net_device *dev, 130extern int rtnl_configure_link(struct net_device *dev,
131 const struct ifinfomsg *ifm); 131 const struct ifinfomsg *ifm);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 4616f468d59..1540f9c2fcf 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -50,6 +50,13 @@ struct Qdisc {
50#define TCQ_F_INGRESS 2 50#define TCQ_F_INGRESS 2
51#define TCQ_F_CAN_BYPASS 4 51#define TCQ_F_CAN_BYPASS 4
52#define TCQ_F_MQROOT 8 52#define TCQ_F_MQROOT 8
53#define TCQ_F_ONETXQUEUE 0x10 /* dequeue_skb() can assume all skbs are for
54 * q->dev_queue : It can test
55 * netif_xmit_frozen_or_stopped() before
56 * dequeueing next packet.
57 * Its true for MQ/MQPRIO slaves, or non
58 * multiqueue device.
59 */
53#define TCQ_F_WARN_NONWC (1 << 16) 60#define TCQ_F_WARN_NONWC (1 << 16)
54 int padded; 61 int padded;
55 const struct Qdisc_ops *ops; 62 const struct Qdisc_ops *ops;
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 712b3bebeda..35247271e55 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -130,8 +130,6 @@ typedef union {
130 __be16 err; 130 __be16 err;
131 sctp_state_t state; 131 sctp_state_t state;
132 sctp_event_timeout_t to; 132 sctp_event_timeout_t to;
133 unsigned long zero;
134 void *ptr;
135 struct sctp_chunk *chunk; 133 struct sctp_chunk *chunk;
136 struct sctp_association *asoc; 134 struct sctp_association *asoc;
137 struct sctp_transport *transport; 135 struct sctp_transport *transport;
@@ -154,23 +152,15 @@ typedef union {
154 * which takes an __s32 and returns a sctp_arg_t containing the 152 * which takes an __s32 and returns a sctp_arg_t containing the
155 * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg. 153 * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg.
156 */ 154 */
157static inline sctp_arg_t SCTP_NULL(void)
158{
159 sctp_arg_t retval; retval.ptr = NULL; return retval;
160}
161static inline sctp_arg_t SCTP_NOFORCE(void)
162{
163 sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 0; return retval;
164}
165static inline sctp_arg_t SCTP_FORCE(void)
166{
167 sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 1; return retval;
168}
169 155
170#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ 156#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \
171static inline sctp_arg_t \ 157static inline sctp_arg_t \
172SCTP_## name (type arg) \ 158SCTP_## name (type arg) \
173{ sctp_arg_t retval = {.zero = 0UL}; retval.elt = arg; return retval; } 159{ sctp_arg_t retval;\
160 memset(&retval, 0, sizeof(sctp_arg_t));\
161 retval.elt = arg;\
162 return retval;\
163}
174 164
175SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) 165SCTP_ARG_CONSTRUCTOR(I32, __s32, i32)
176SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) 166SCTP_ARG_CONSTRUCTOR(U32, __u32, u32)
@@ -181,7 +171,6 @@ SCTP_ARG_CONSTRUCTOR(ERROR, int, error)
181SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */ 171SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */
182SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) 172SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state)
183SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) 173SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to)
184SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr)
185SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) 174SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk)
186SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) 175SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc)
187SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) 176SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport)
@@ -192,6 +181,23 @@ SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet)
192SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) 181SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh)
193SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) 182SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg)
194 183
184static inline sctp_arg_t SCTP_FORCE(void)
185{
186 return SCTP_I32(1);
187}
188
189static inline sctp_arg_t SCTP_NOFORCE(void)
190{
191 return SCTP_I32(0);
192}
193
194static inline sctp_arg_t SCTP_NULL(void)
195{
196 sctp_arg_t retval;
197 memset(&retval, 0, sizeof(sctp_arg_t));
198 return retval;
199}
200
195typedef struct { 201typedef struct {
196 sctp_arg_t obj; 202 sctp_arg_t obj;
197 sctp_verb_t verb; 203 sctp_verb_t verb;
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index d053d2e9987..c29707d654c 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -312,14 +312,6 @@ enum { SCTP_MAX_GABS = 16 };
312 * functions simpler to write. 312 * functions simpler to write.
313 */ 313 */
314 314
315#if defined (CONFIG_SCTP_HMAC_MD5)
316#define SCTP_COOKIE_HMAC_ALG "hmac(md5)"
317#elif defined (CONFIG_SCTP_HMAC_SHA1)
318#define SCTP_COOKIE_HMAC_ALG "hmac(sha1)"
319#else
320#define SCTP_COOKIE_HMAC_ALG NULL
321#endif
322
323/* These return values describe the success or failure of a number of 315/* These return values describe the success or failure of a number of
324 * routines which form the lower interface to SCTP_outqueue. 316 * routines which form the lower interface to SCTP_outqueue.
325 */ 317 */
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 9c6414f553f..7fdf298a47e 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -272,6 +272,18 @@ struct sctp_mib {
272 unsigned long mibs[SCTP_MIB_MAX]; 272 unsigned long mibs[SCTP_MIB_MAX];
273}; 273};
274 274
275/* helper function to track stats about max rto and related transport */
276static inline void sctp_max_rto(struct sctp_association *asoc,
277 struct sctp_transport *trans)
278{
279 if (asoc->stats.max_obs_rto < (__u64)trans->rto) {
280 asoc->stats.max_obs_rto = trans->rto;
281 memset(&asoc->stats.obs_rto_ipaddr, 0,
282 sizeof(struct sockaddr_storage));
283 memcpy(&asoc->stats.obs_rto_ipaddr, &trans->ipaddr,
284 trans->af_specific->sockaddr_len);
285 }
286}
275 287
276/* Print debugging messages. */ 288/* Print debugging messages. */
277#if SCTP_DEBUG 289#if SCTP_DEBUG
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index b5887e1677e..2a82d138470 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -234,6 +234,8 @@ struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *,
234struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, 234struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *,
235 const struct sctp_chunk *, 235 const struct sctp_chunk *,
236 struct sctp_paramhdr *); 236 struct sctp_paramhdr *);
237struct sctp_chunk *sctp_make_violation_max_retrans(const struct sctp_association *,
238 const struct sctp_chunk *);
237struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, 239struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *,
238 const struct sctp_transport *); 240 const struct sctp_transport *);
239struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, 241struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *,
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 64158aa1bb5..fdeb85a970f 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -177,6 +177,7 @@ struct sctp_sock {
177 177
178 /* Access to HMAC transform. */ 178 /* Access to HMAC transform. */
179 struct crypto_hash *hmac; 179 struct crypto_hash *hmac;
180 char *sctp_hmac_alg;
180 181
181 /* What is our base endpointer? */ 182 /* What is our base endpointer? */
182 struct sctp_endpoint *ep; 183 struct sctp_endpoint *ep;
@@ -948,6 +949,8 @@ struct sctp_transport {
948 949
949 /* 64-bit random number sent with heartbeat. */ 950 /* 64-bit random number sent with heartbeat. */
950 __u64 hb_nonce; 951 __u64 hb_nonce;
952
953 struct rcu_head rcu;
951}; 954};
952 955
953struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *, 956struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *,
@@ -1311,6 +1314,40 @@ struct sctp_inithdr_host {
1311 __u32 initial_tsn; 1314 __u32 initial_tsn;
1312}; 1315};
1313 1316
1317/* SCTP_GET_ASSOC_STATS counters */
1318struct sctp_priv_assoc_stats {
1319 /* Maximum observed rto in the association during subsequent
1320 * observations. Value is set to 0 if no RTO measurement took place
1321 * The transport where the max_rto was observed is returned in
1322 * obs_rto_ipaddr
1323 */
1324 struct sockaddr_storage obs_rto_ipaddr;
1325 __u64 max_obs_rto;
1326 /* Total In and Out SACKs received and sent */
1327 __u64 isacks;
1328 __u64 osacks;
1329 /* Total In and Out packets received and sent */
1330 __u64 opackets;
1331 __u64 ipackets;
1332 /* Total retransmitted chunks */
1333 __u64 rtxchunks;
1334 /* TSN received > next expected */
1335 __u64 outofseqtsns;
1336 /* Duplicate Chunks received */
1337 __u64 idupchunks;
1338 /* Gap Ack Blocks received */
1339 __u64 gapcnt;
1340 /* Unordered data chunks sent and received */
1341 __u64 ouodchunks;
1342 __u64 iuodchunks;
1343 /* Ordered data chunks sent and received */
1344 __u64 oodchunks;
1345 __u64 iodchunks;
1346 /* Control chunks sent and received */
1347 __u64 octrlchunks;
1348 __u64 ictrlchunks;
1349};
1350
1314/* RFC2960 1351/* RFC2960
1315 * 1352 *
1316 * 12. Recommended Transmission Control Block (TCB) Parameters 1353 * 12. Recommended Transmission Control Block (TCB) Parameters
@@ -1829,6 +1866,8 @@ struct sctp_association {
1829 1866
1830 __u8 need_ecne:1, /* Need to send an ECNE Chunk? */ 1867 __u8 need_ecne:1, /* Need to send an ECNE Chunk? */
1831 temp:1; /* Is it a temporary association? */ 1868 temp:1; /* Is it a temporary association? */
1869
1870 struct sctp_priv_assoc_stats stats;
1832}; 1871};
1833 1872
1834 1873
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 2e5ee0d8458..ff1b8ba73ab 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -72,7 +72,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev);
72void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); 72void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
73 73
74/* Perform partial delivery. */ 74/* Perform partial delivery. */
75void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); 75void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t);
76 76
77/* Abort the partial delivery. */ 77/* Abort the partial delivery. */
78void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); 78void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t);
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 1b02d7ad453..9a0ae091366 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -107,6 +107,7 @@ typedef __s32 sctp_assoc_t;
107#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */ 107#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */
108#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ 108#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
109#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ 109#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
110#define SCTP_GET_ASSOC_STATS 112 /* Read only */
110 111
111/* 112/*
112 * 5.2.1 SCTP Initiation Structure (SCTP_INIT) 113 * 5.2.1 SCTP Initiation Structure (SCTP_INIT)
@@ -719,6 +720,32 @@ struct sctp_getaddrs {
719 __u8 addrs[0]; /*output, variable size*/ 720 __u8 addrs[0]; /*output, variable size*/
720}; 721};
721 722
723/* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves
724 * association stats. All stats are counts except sas_maxrto and
725 * sas_obs_rto_ipaddr. maxrto is the max observed rto + transport since
726 * the last call. Will return 0 when RTO was not update since last call
727 */
728struct sctp_assoc_stats {
729 sctp_assoc_t sas_assoc_id; /* Input */
730 /* Transport of observed max RTO */
731 struct sockaddr_storage sas_obs_rto_ipaddr;
732 __u64 sas_maxrto; /* Maximum Observed RTO for period */
733 __u64 sas_isacks; /* SACKs received */
734 __u64 sas_osacks; /* SACKs sent */
735 __u64 sas_opackets; /* Packets sent */
736 __u64 sas_ipackets; /* Packets received */
737 __u64 sas_rtxchunks; /* Retransmitted Chunks */
738 __u64 sas_outofseqtsns;/* TSN received > next expected */
739 __u64 sas_idupchunks; /* Dups received (ordered+unordered) */
740 __u64 sas_gapcnt; /* Gap Acknowledgements Received */
741 __u64 sas_ouodchunks; /* Unordered data chunks sent */
742 __u64 sas_iuodchunks; /* Unordered data chunks received */
743 __u64 sas_oodchunks; /* Ordered data chunks sent */
744 __u64 sas_iodchunks; /* Ordered data chunks received */
745 __u64 sas_octrlchunks; /* Control chunks sent */
746 __u64 sas_ictrlchunks; /* Control chunks received */
747};
748
722/* These are bit fields for msghdr->msg_flags. See section 5.1. */ 749/* These are bit fields for msghdr->msg_flags. See section 5.1. */
723/* On user space Linux, these live in <bits/socket.h> as an enum. */ 750/* On user space Linux, these live in <bits/socket.h> as an enum. */
724enum sctp_msg_flags { 751enum sctp_msg_flags {
diff --git a/include/net/sock.h b/include/net/sock.h
index c945fba4f54..0a9a01a5b0d 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -126,12 +126,17 @@ struct sock;
126struct proto; 126struct proto;
127struct net; 127struct net;
128 128
129typedef __u32 __bitwise __portpair;
130typedef __u64 __bitwise __addrpair;
131
129/** 132/**
130 * struct sock_common - minimal network layer representation of sockets 133 * struct sock_common - minimal network layer representation of sockets
131 * @skc_daddr: Foreign IPv4 addr 134 * @skc_daddr: Foreign IPv4 addr
132 * @skc_rcv_saddr: Bound local IPv4 addr 135 * @skc_rcv_saddr: Bound local IPv4 addr
133 * @skc_hash: hash value used with various protocol lookup tables 136 * @skc_hash: hash value used with various protocol lookup tables
134 * @skc_u16hashes: two u16 hash values used by UDP lookup tables 137 * @skc_u16hashes: two u16 hash values used by UDP lookup tables
138 * @skc_dport: placeholder for inet_dport/tw_dport
139 * @skc_num: placeholder for inet_num/tw_num
135 * @skc_family: network address family 140 * @skc_family: network address family
136 * @skc_state: Connection state 141 * @skc_state: Connection state
137 * @skc_reuse: %SO_REUSEADDR setting 142 * @skc_reuse: %SO_REUSEADDR setting
@@ -149,16 +154,29 @@ struct net;
149 * for struct sock and struct inet_timewait_sock. 154 * for struct sock and struct inet_timewait_sock.
150 */ 155 */
151struct sock_common { 156struct sock_common {
152 /* skc_daddr and skc_rcv_saddr must be grouped : 157 /* skc_daddr and skc_rcv_saddr must be grouped on a 8 bytes aligned
153 * cf INET_MATCH() and INET_TW_MATCH() 158 * address on 64bit arches : cf INET_MATCH() and INET_TW_MATCH()
154 */ 159 */
155 __be32 skc_daddr; 160 union {
156 __be32 skc_rcv_saddr; 161 __addrpair skc_addrpair;
157 162 struct {
163 __be32 skc_daddr;
164 __be32 skc_rcv_saddr;
165 };
166 };
158 union { 167 union {
159 unsigned int skc_hash; 168 unsigned int skc_hash;
160 __u16 skc_u16hashes[2]; 169 __u16 skc_u16hashes[2];
161 }; 170 };
171 /* skc_dport && skc_num must be grouped as well */
172 union {
173 __portpair skc_portpair;
174 struct {
175 __be16 skc_dport;
176 __u16 skc_num;
177 };
178 };
179
162 unsigned short skc_family; 180 unsigned short skc_family;
163 volatile unsigned char skc_state; 181 volatile unsigned char skc_state;
164 unsigned char skc_reuse; 182 unsigned char skc_reuse;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4af45e33105..aed42c78515 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -369,7 +369,6 @@ extern void tcp_shutdown (struct sock *sk, int how);
369extern void tcp_v4_early_demux(struct sk_buff *skb); 369extern void tcp_v4_early_demux(struct sk_buff *skb);
370extern int tcp_v4_rcv(struct sk_buff *skb); 370extern int tcp_v4_rcv(struct sk_buff *skb);
371 371
372extern struct inet_peer *tcp_v4_get_peer(struct sock *sk);
373extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); 372extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
374extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 373extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
375 size_t size); 374 size_t size);
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index b1bea03274d..2d32d073a6f 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -43,6 +43,7 @@
43/* Socket filtering */ 43/* Socket filtering */
44#define SO_ATTACH_FILTER 26 44#define SO_ATTACH_FILTER 26
45#define SO_DETACH_FILTER 27 45#define SO_DETACH_FILTER 27
46#define SO_GET_FILTER SO_ATTACH_FILTER
46 47
47#define SO_PEERNAME 28 48#define SO_PEERNAME 28
48#define SO_TIMESTAMP 29 49#define SO_TIMESTAMP 29
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 19e765fbfef..4e67194fd2c 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -258,6 +258,7 @@ header-y += neighbour.h
258header-y += net.h 258header-y += net.h
259header-y += net_dropmon.h 259header-y += net_dropmon.h
260header-y += net_tstamp.h 260header-y += net_tstamp.h
261header-y += netconf.h
261header-y += netdevice.h 262header-y += netdevice.h
262header-y += netfilter.h 263header-y += netfilter.h
263header-y += netfilter_arp.h 264header-y += netfilter_arp.h
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index d3eaaaf1009..be8c41e2dc1 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -500,13 +500,15 @@ union ethtool_flow_union {
500 struct ethtool_ah_espip4_spec esp_ip4_spec; 500 struct ethtool_ah_espip4_spec esp_ip4_spec;
501 struct ethtool_usrip4_spec usr_ip4_spec; 501 struct ethtool_usrip4_spec usr_ip4_spec;
502 struct ethhdr ether_spec; 502 struct ethhdr ether_spec;
503 __u8 hdata[60]; 503 __u8 hdata[52];
504}; 504};
505 505
506struct ethtool_flow_ext { 506struct ethtool_flow_ext {
507 __be16 vlan_etype; 507 __u8 padding[2];
508 __be16 vlan_tci; 508 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
509 __be32 data[2]; 509 __be16 vlan_etype;
510 __be16 vlan_tci;
511 __be32 data[2];
510}; 512};
511 513
512/** 514/**
@@ -1027,6 +1029,7 @@ enum ethtool_sfeatures_retval_bits {
1027#define ETHER_FLOW 0x12 /* spec only (ether_spec) */ 1029#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
1028/* Flag to enable additional fields in struct ethtool_rx_flow_spec */ 1030/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
1029#define FLOW_EXT 0x80000000 1031#define FLOW_EXT 0x80000000
1032#define FLOW_MAC_EXT 0x40000000
1030 1033
1031/* L3-L4 network traffic flow hash options */ 1034/* L3-L4 network traffic flow hash options */
1032#define RXH_L2DA (1 << 1) 1035#define RXH_L2DA (1 << 1)
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h
index 3d7922433ab..9cfde694109 100644
--- a/include/uapi/linux/filter.h
+++ b/include/uapi/linux/filter.h
@@ -127,7 +127,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
127#define SKF_AD_RXHASH 32 127#define SKF_AD_RXHASH 32
128#define SKF_AD_CPU 36 128#define SKF_AD_CPU 36
129#define SKF_AD_ALU_XOR_X 40 129#define SKF_AD_ALU_XOR_X 40
130#define SKF_AD_MAX 44 130#define SKF_AD_VLAN_TAG 44
131#define SKF_AD_VLAN_TAG_PRESENT 48
132#define SKF_AD_MAX 52
131#define SKF_NET_OFF (-0x100000) 133#define SKF_NET_OFF (-0x100000)
132#define SKF_LL_OFF (-0x200000) 134#define SKF_LL_OFF (-0x200000)
133 135
diff --git a/include/uapi/linux/hdlc/Kbuild b/include/uapi/linux/hdlc/Kbuild
index aafaa5aa54d..8c1d2cb75e3 100644
--- a/include/uapi/linux/hdlc/Kbuild
+++ b/include/uapi/linux/hdlc/Kbuild
@@ -1 +1,2 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += ioctl.h
diff --git a/include/linux/hdlc/ioctl.h b/include/uapi/linux/hdlc/ioctl.h
index 58397236435..04bc0274a18 100644
--- a/include/linux/hdlc/ioctl.h
+++ b/include/uapi/linux/hdlc/ioctl.h
@@ -34,13 +34,15 @@
34#define LMI_CCITT 3 /* ITU-T Annex A */ 34#define LMI_CCITT 3 /* ITU-T Annex A */
35#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ 35#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
36 36
37typedef struct { 37#ifndef __ASSEMBLY__
38
39typedef struct {
38 unsigned int clock_rate; /* bits per second */ 40 unsigned int clock_rate; /* bits per second */
39 unsigned int clock_type; /* internal, external, TX-internal etc. */ 41 unsigned int clock_type; /* internal, external, TX-internal etc. */
40 unsigned short loopback; 42 unsigned short loopback;
41} sync_serial_settings; /* V.35, V.24, X.21 */ 43} sync_serial_settings; /* V.35, V.24, X.21 */
42 44
43typedef struct { 45typedef struct {
44 unsigned int clock_rate; /* bits per second */ 46 unsigned int clock_rate; /* bits per second */
45 unsigned int clock_type; /* internal, external, TX-internal etc. */ 47 unsigned int clock_type; /* internal, external, TX-internal etc. */
46 unsigned short loopback; 48 unsigned short loopback;
@@ -78,4 +80,5 @@ typedef struct {
78 80
79/* PPP doesn't need any info now - supply length = 0 to ioctl */ 81/* PPP doesn't need any info now - supply length = 0 to ioctl */
80 82
83#endif /* __ASSEMBLY__ */
81#endif /* __HDLC_IOCTL_H__ */ 84#endif /* __HDLC_IOCTL_H__ */
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index a8fe9549ddb..afbb18a0227 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -97,5 +97,86 @@ struct __fdb_entry {
97 __u16 unused; 97 __u16 unused;
98}; 98};
99 99
100/* Bridge Flags */
101#define BRIDGE_FLAGS_MASTER 1 /* Bridge command to/from master */
102#define BRIDGE_FLAGS_SELF 2 /* Bridge command to/from lowerdev */
103
104#define BRIDGE_MODE_VEB 0 /* Default loopback mode */
105#define BRIDGE_MODE_VEPA 1 /* 802.1Qbg defined VEPA mode */
106
107/* Bridge management nested attributes
108 * [IFLA_AF_SPEC] = {
109 * [IFLA_BRIDGE_FLAGS]
110 * [IFLA_BRIDGE_MODE]
111 * }
112 */
113enum {
114 IFLA_BRIDGE_FLAGS,
115 IFLA_BRIDGE_MODE,
116 __IFLA_BRIDGE_MAX,
117};
118#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
119
120/* Bridge multicast database attributes
121 * [MDBA_MDB] = {
122 * [MDBA_MDB_ENTRY] = {
123 * [MDBA_MDB_ENTRY_INFO]
124 * }
125 * }
126 * [MDBA_ROUTER] = {
127 * [MDBA_ROUTER_PORT]
128 * }
129 */
130enum {
131 MDBA_UNSPEC,
132 MDBA_MDB,
133 MDBA_ROUTER,
134 __MDBA_MAX,
135};
136#define MDBA_MAX (__MDBA_MAX - 1)
137
138enum {
139 MDBA_MDB_UNSPEC,
140 MDBA_MDB_ENTRY,
141 __MDBA_MDB_MAX,
142};
143#define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)
144
145enum {
146 MDBA_MDB_ENTRY_UNSPEC,
147 MDBA_MDB_ENTRY_INFO,
148 __MDBA_MDB_ENTRY_MAX,
149};
150#define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
151
152enum {
153 MDBA_ROUTER_UNSPEC,
154 MDBA_ROUTER_PORT,
155 __MDBA_ROUTER_MAX,
156};
157#define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
158
159struct br_port_msg {
160 __u8 family;
161 __u32 ifindex;
162};
163
164struct br_mdb_entry {
165 __u32 ifindex;
166 struct {
167 union {
168 __be32 ip4;
169 struct in6_addr ip6;
170 } u;
171 __be16 proto;
172 } addr;
173};
174
175enum {
176 MDBA_SET_ENTRY_UNSPEC,
177 MDBA_SET_ENTRY,
178 __MDBA_SET_ENTRY_MAX,
179};
180#define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
100 181
101#endif /* _UAPI_LINUX_IF_BRIDGE_H */ 182#endif /* _UAPI_LINUX_IF_BRIDGE_H */
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 0343e1f0582..67fb87ca109 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -48,6 +48,7 @@
48#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ 48#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
49#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ 49#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
50#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ 50#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
51#define ETH_P_BATMAN 0x4305 /* B.A.T.M.A.N.-Advanced packet [ NOT AN OFFICIALLY REGISTERED ID ] */
51#define ETH_P_DEC 0x6000 /* DEC Assigned proto */ 52#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
52#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ 53#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
53#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ 54#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 5c80cb11518..60f3b6b9060 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -205,6 +205,24 @@ enum {
205 205
206#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) 206#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
207 207
208enum {
209 BRIDGE_MODE_UNSPEC,
210 BRIDGE_MODE_HAIRPIN,
211};
212
213enum {
214 IFLA_BRPORT_UNSPEC,
215 IFLA_BRPORT_STATE, /* Spanning tree state */
216 IFLA_BRPORT_PRIORITY, /* " priority */
217 IFLA_BRPORT_COST, /* " cost */
218 IFLA_BRPORT_MODE, /* mode (hairpin) */
219 IFLA_BRPORT_GUARD, /* bpdu guard */
220 IFLA_BRPORT_PROTECT, /* root port protection */
221 IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
222 __IFLA_BRPORT_MAX
223};
224#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
225
208struct ifla_cacheinfo { 226struct ifla_cacheinfo {
209 __u32 max_reasm_len; 227 __u32 max_reasm_len;
210 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ 228 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
@@ -285,6 +303,10 @@ enum {
285 IFLA_VXLAN_AGEING, 303 IFLA_VXLAN_AGEING,
286 IFLA_VXLAN_LIMIT, 304 IFLA_VXLAN_LIMIT,
287 IFLA_VXLAN_PORT_RANGE, 305 IFLA_VXLAN_PORT_RANGE,
306 IFLA_VXLAN_PROXY,
307 IFLA_VXLAN_RSC,
308 IFLA_VXLAN_L2MISS,
309 IFLA_VXLAN_L3MISS,
288 __IFLA_VXLAN_MAX 310 __IFLA_VXLAN_MAX
289}; 311};
290#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) 312#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index f3799295d23..f9a60375f0d 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -50,6 +50,7 @@ struct sockaddr_ll {
50#define PACKET_TX_TIMESTAMP 16 50#define PACKET_TX_TIMESTAMP 16
51#define PACKET_TIMESTAMP 17 51#define PACKET_TIMESTAMP 17
52#define PACKET_FANOUT 18 52#define PACKET_FANOUT 18
53#define PACKET_TX_HAS_OFF 19
53 54
54#define PACKET_FANOUT_HASH 0 55#define PACKET_FANOUT_HASH 0
55#define PACKET_FANOUT_LB 1 56#define PACKET_FANOUT_LB 1
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index 25a585ce23e..2835b85fd46 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -31,9 +31,11 @@
31#define TUN_FASYNC 0x0010 31#define TUN_FASYNC 0x0010
32#define TUN_NOCHECKSUM 0x0020 32#define TUN_NOCHECKSUM 0x0020
33#define TUN_NO_PI 0x0040 33#define TUN_NO_PI 0x0040
34/* This flag has no real effect */
34#define TUN_ONE_QUEUE 0x0080 35#define TUN_ONE_QUEUE 0x0080
35#define TUN_PERSIST 0x0100 36#define TUN_PERSIST 0x0100
36#define TUN_VNET_HDR 0x0200 37#define TUN_VNET_HDR 0x0200
38#define TUN_TAP_MQ 0x0400
37 39
38/* Ioctl defines */ 40/* Ioctl defines */
39#define TUNSETNOCSUM _IOW('T', 200, int) 41#define TUNSETNOCSUM _IOW('T', 200, int)
@@ -53,14 +55,19 @@
53#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) 55#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
54#define TUNGETVNETHDRSZ _IOR('T', 215, int) 56#define TUNGETVNETHDRSZ _IOR('T', 215, int)
55#define TUNSETVNETHDRSZ _IOW('T', 216, int) 57#define TUNSETVNETHDRSZ _IOW('T', 216, int)
58#define TUNSETQUEUE _IOW('T', 217, int)
56 59
57/* TUNSETIFF ifr flags */ 60/* TUNSETIFF ifr flags */
58#define IFF_TUN 0x0001 61#define IFF_TUN 0x0001
59#define IFF_TAP 0x0002 62#define IFF_TAP 0x0002
60#define IFF_NO_PI 0x1000 63#define IFF_NO_PI 0x1000
64/* This flag has no real effect */
61#define IFF_ONE_QUEUE 0x2000 65#define IFF_ONE_QUEUE 0x2000
62#define IFF_VNET_HDR 0x4000 66#define IFF_VNET_HDR 0x4000
63#define IFF_TUN_EXCL 0x8000 67#define IFF_TUN_EXCL 0x8000
68#define IFF_MULTI_QUEUE 0x0100
69#define IFF_ATTACH_QUEUE 0x0200
70#define IFF_DETACH_QUEUE 0x0400
64 71
65/* Features for GSO (TUNSETOFFLOAD). */ 72/* Features for GSO (TUNSETOFFLOAD). */
66#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ 73#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h
index 5db5942575f..aee73d0611f 100644
--- a/include/uapi/linux/if_tunnel.h
+++ b/include/uapi/linux/if_tunnel.h
@@ -37,6 +37,26 @@ struct ip_tunnel_parm {
37 struct iphdr iph; 37 struct iphdr iph;
38}; 38};
39 39
40enum {
41 IFLA_IPTUN_UNSPEC,
42 IFLA_IPTUN_LINK,
43 IFLA_IPTUN_LOCAL,
44 IFLA_IPTUN_REMOTE,
45 IFLA_IPTUN_TTL,
46 IFLA_IPTUN_TOS,
47 IFLA_IPTUN_ENCAP_LIMIT,
48 IFLA_IPTUN_FLOWINFO,
49 IFLA_IPTUN_FLAGS,
50 IFLA_IPTUN_PROTO,
51 IFLA_IPTUN_PMTUDISC,
52 IFLA_IPTUN_6RD_PREFIX,
53 IFLA_IPTUN_6RD_RELAY_PREFIX,
54 IFLA_IPTUN_6RD_PREFIXLEN,
55 IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
56 __IFLA_IPTUN_MAX,
57};
58#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
59
40/* SIT-mode i_flags */ 60/* SIT-mode i_flags */
41#define SIT_ISATAP 0x0001 61#define SIT_ISATAP 0x0001
42 62
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index 1e315998995..f79c3721da6 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -240,6 +240,7 @@ struct in6_flowlabel_req {
240 * 240 *
241 * IP6T_SO_GET_REVISION_MATCH 68 241 * IP6T_SO_GET_REVISION_MATCH 68
242 * IP6T_SO_GET_REVISION_TARGET 69 242 * IP6T_SO_GET_REVISION_TARGET 69
243 * IP6T_SO_ORIGINAL_DST 80
243 */ 244 */
244 245
245/* RFC5014: Source address selection */ 246/* RFC5014: Source address selection */
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h
index 8c469af939a..bbde90fa583 100644
--- a/include/uapi/linux/inet_diag.h
+++ b/include/uapi/linux/inet_diag.h
@@ -109,9 +109,10 @@ enum {
109 INET_DIAG_TOS, 109 INET_DIAG_TOS,
110 INET_DIAG_TCLASS, 110 INET_DIAG_TCLASS,
111 INET_DIAG_SKMEMINFO, 111 INET_DIAG_SKMEMINFO,
112 INET_DIAG_SHUTDOWN,
112}; 113};
113 114
114#define INET_DIAG_MAX INET_DIAG_SKMEMINFO 115#define INET_DIAG_MAX INET_DIAG_SHUTDOWN
115 116
116 117
117/* INET_DIAG_MEM */ 118/* INET_DIAG_MEM */
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index a6d7d1c536c..5a2991cf025 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -157,6 +157,7 @@ enum {
157 DEVCONF_DISABLE_IPV6, 157 DEVCONF_DISABLE_IPV6,
158 DEVCONF_ACCEPT_DAD, 158 DEVCONF_ACCEPT_DAD,
159 DEVCONF_FORCE_TLLAO, 159 DEVCONF_FORCE_TLLAO,
160 DEVCONF_NDISC_NOTIFY,
160 DEVCONF_MAX 161 DEVCONF_MAX
161}; 162};
162 163
diff --git a/include/uapi/linux/ipv6_route.h b/include/uapi/linux/ipv6_route.h
index 0459664c263..2be7bd17475 100644
--- a/include/uapi/linux/ipv6_route.h
+++ b/include/uapi/linux/ipv6_route.h
@@ -55,4 +55,7 @@ struct in6_rtmsg {
55#define RTMSG_NEWROUTE 0x21 55#define RTMSG_NEWROUTE 0x21
56#define RTMSG_DELROUTE 0x22 56#define RTMSG_DELROUTE 0x22
57 57
58#define IP6_RT_PRIO_USER 1024
59#define IP6_RT_PRIO_ADDRCONF 256
60
58#endif /* _UAPI_LINUX_IPV6_ROUTE_H */ 61#endif /* _UAPI_LINUX_IPV6_ROUTE_H */
diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h
new file mode 100644
index 00000000000..64804a798b0
--- /dev/null
+++ b/include/uapi/linux/netconf.h
@@ -0,0 +1,24 @@
1#ifndef _UAPI_LINUX_NETCONF_H_
2#define _UAPI_LINUX_NETCONF_H_
3
4#include <linux/types.h>
5#include <linux/netlink.h>
6
7struct netconfmsg {
8 __u8 ncm_family;
9};
10
11enum {
12 NETCONFA_UNSPEC,
13 NETCONFA_IFINDEX,
14 NETCONFA_FORWARDING,
15 NETCONFA_RP_FILTER,
16 NETCONFA_MC_FORWARDING,
17 __NETCONFA_MAX
18};
19#define NETCONFA_MAX (__NETCONFA_MAX - 1)
20
21#define NETCONFA_IFINDEX_ALL -1
22#define NETCONFA_IFINDEX_DEFAULT -2
23
24#endif /* _UAPI_LINUX_NETCONF_H_ */
diff --git a/include/uapi/linux/netfilter/nfnetlink_conntrack.h b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
index 43bfe3e1685..86e930cf3df 100644
--- a/include/uapi/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
@@ -9,6 +9,8 @@ enum cntl_msg_types {
9 IPCTNL_MSG_CT_GET_CTRZERO, 9 IPCTNL_MSG_CT_GET_CTRZERO,
10 IPCTNL_MSG_CT_GET_STATS_CPU, 10 IPCTNL_MSG_CT_GET_STATS_CPU,
11 IPCTNL_MSG_CT_GET_STATS, 11 IPCTNL_MSG_CT_GET_STATS,
12 IPCTNL_MSG_CT_GET_DYING,
13 IPCTNL_MSG_CT_GET_UNCONFIRMED,
12 14
13 IPCTNL_MSG_MAX 15 IPCTNL_MSG_MAX
14}; 16};
diff --git a/include/uapi/linux/netfilter_ipv6/ip6_tables.h b/include/uapi/linux/netfilter_ipv6/ip6_tables.h
index bf1ef65cc58..649c68062dc 100644
--- a/include/uapi/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6_tables.h
@@ -178,6 +178,9 @@ struct ip6t_error {
178#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) 178#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
179#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET 179#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
180 180
181/* obtain original address if REDIRECT'd connection */
182#define IP6T_SO_ORIGINAL_DST 80
183
181/* ICMP matching stuff */ 184/* ICMP matching stuff */
182struct ip6t_icmp { 185struct ip6t_icmp {
183 __u8 type; /* type to match */ 186 __u8 type; /* type to match */
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index d908d17da56..0e63cee8d81 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -60,6 +60,13 @@
60 * target mode. 60 * target mode.
61 * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated 61 * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated
62 * from target mode. 62 * from target mode.
63 * @NFC_CMD_LLC_GET_PARAMS: request LTO, RW, and MIUX parameters for a device
64 * @NFC_CMD_LLC_SET_PARAMS: set one or more of LTO, RW, and MIUX parameters for
65 * a device. LTO must be set before the link is up otherwise -EINPROGRESS
66 * is returned. RW and MIUX can be set at anytime and will be passed in
67 * subsequent CONNECT and CC messages.
68 * If one of the passed parameters is wrong none is set and -EINVAL is
69 * returned.
63 */ 70 */
64enum nfc_commands { 71enum nfc_commands {
65 NFC_CMD_UNSPEC, 72 NFC_CMD_UNSPEC,
@@ -77,6 +84,8 @@ enum nfc_commands {
77 NFC_EVENT_TARGET_LOST, 84 NFC_EVENT_TARGET_LOST,
78 NFC_EVENT_TM_ACTIVATED, 85 NFC_EVENT_TM_ACTIVATED,
79 NFC_EVENT_TM_DEACTIVATED, 86 NFC_EVENT_TM_DEACTIVATED,
87 NFC_CMD_LLC_GET_PARAMS,
88 NFC_CMD_LLC_SET_PARAMS,
80/* private: internal use only */ 89/* private: internal use only */
81 __NFC_CMD_AFTER_LAST 90 __NFC_CMD_AFTER_LAST
82}; 91};
@@ -102,6 +111,9 @@ enum nfc_commands {
102 * @NFC_ATTR_RF_MODE: Initiator or target 111 * @NFC_ATTR_RF_MODE: Initiator or target
103 * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for 112 * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for
104 * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for 113 * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for
114 * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter
115 * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter
116 * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter
105 */ 117 */
106enum nfc_attrs { 118enum nfc_attrs {
107 NFC_ATTR_UNSPEC, 119 NFC_ATTR_UNSPEC,
@@ -119,6 +131,9 @@ enum nfc_attrs {
119 NFC_ATTR_DEVICE_POWERED, 131 NFC_ATTR_DEVICE_POWERED,
120 NFC_ATTR_IM_PROTOCOLS, 132 NFC_ATTR_IM_PROTOCOLS,
121 NFC_ATTR_TM_PROTOCOLS, 133 NFC_ATTR_TM_PROTOCOLS,
134 NFC_ATTR_LLC_PARAM_LTO,
135 NFC_ATTR_LLC_PARAM_RW,
136 NFC_ATTR_LLC_PARAM_MIUX,
122/* private: internal use only */ 137/* private: internal use only */
123 __NFC_ATTR_AFTER_LAST 138 __NFC_ATTR_AFTER_LAST
124}; 139};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 7df9b500c80..e3e19f8b16f 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -118,8 +118,9 @@
118 * to get a list of all present wiphys. 118 * to get a list of all present wiphys.
119 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or 119 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
120 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, 120 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
121 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, 121 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the
122 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT, 122 * attributes determining the channel width; this is used for setting
123 * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT,
123 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, 124 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
124 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. 125 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
125 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL 126 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
@@ -171,7 +172,7 @@
171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, 172 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. 173 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
173 * The channel to use can be set on the interface or be given using the 174 * The channel to use can be set on the interface or be given using the
174 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs. 175 * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
175 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP 176 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
176 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface 177 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
177 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP 178 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
@@ -401,8 +402,7 @@
401 * a response while being associated to an AP on another channel. 402 * a response while being associated to an AP on another channel.
402 * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus 403 * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
403 * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the 404 * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
404 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be 405 * frequency for the operation.
405 * optionally used to specify additional channel parameters.
406 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds 406 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
407 * to remain on the channel. This command is also used as an event to 407 * to remain on the channel. This command is also used as an event to
408 * notify when the requested duration starts (it may take a while for the 408 * notify when the requested duration starts (it may take a while for the
@@ -440,12 +440,11 @@
440 * as an event indicating reception of a frame that was not processed in 440 * as an event indicating reception of a frame that was not processed in
441 * kernel code, but is for us (i.e., which may need to be processed in a 441 * kernel code, but is for us (i.e., which may need to be processed in a
442 * user space application). %NL80211_ATTR_FRAME is used to specify the 442 * user space application). %NL80211_ATTR_FRAME is used to specify the
443 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and 443 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used
444 * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on 444 * to indicate on which channel the frame is to be transmitted or was
445 * which channel the frame is to be transmitted or was received. If this 445 * received. If this channel is not the current channel (remain-on-channel
446 * channel is not the current channel (remain-on-channel or the 446 * or the operational channel) the device will switch to the given channel
447 * operational channel) the device will switch to the given channel and 447 * and transmit the frame, optionally waiting for a response for the time
448 * transmit the frame, optionally waiting for a response for the time
449 * specified using %NL80211_ATTR_DURATION. When called, this operation 448 * specified using %NL80211_ATTR_DURATION. When called, this operation
450 * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the 449 * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
451 * TX status event pertaining to the TX request. 450 * TX status event pertaining to the TX request.
@@ -473,8 +472,8 @@
473 * command is used as an event to indicate the that a trigger level was 472 * command is used as an event to indicate the that a trigger level was
474 * reached. 473 * reached.
475 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ 474 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
476 * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed 475 * and the attributes determining channel width) the given interface
477 * by %NL80211_ATTR_IFINDEX) shall operate on. 476 * (identifed by %NL80211_ATTR_IFINDEX) shall operate on.
478 * In case multiple channels are supported by the device, the mechanism 477 * In case multiple channels are supported by the device, the mechanism
479 * with which it switches channels is implementation-defined. 478 * with which it switches channels is implementation-defined.
480 * When a monitor interface is given, it can only switch channel while 479 * When a monitor interface is given, it can only switch channel while
@@ -526,6 +525,12 @@
526 * of PMKSA caching dandidates. 525 * of PMKSA caching dandidates.
527 * 526 *
528 * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). 527 * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
528 * In addition, this can be used as an event to request userspace to take
529 * actions on TDLS links (set up a new link or tear down an existing one).
530 * In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested
531 * operation, %NL80211_ATTR_MAC contains the peer MAC address, and
532 * %NL80211_ATTR_REASON_CODE the reason code to be used (only with
533 * %NL80211_TDLS_TEARDOWN).
529 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. 534 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame.
530 * 535 *
531 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP 536 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
@@ -562,8 +567,8 @@
562 * 567 *
563 * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels 568 * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
564 * independently of the userspace SME, send this event indicating 569 * independently of the userspace SME, send this event indicating
565 * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with 570 * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
566 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE. 571 * attributes determining channel width.
567 * 572 *
568 * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by 573 * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
569 * its %NL80211_ATTR_WDEV identifier. It must have been created with 574 * its %NL80211_ATTR_WDEV identifier. It must have been created with
@@ -578,6 +583,9 @@
578 * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON 583 * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
579 * is used for this. 584 * is used for this.
580 * 585 *
586 * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
587 * for IBSS or MESH vif.
588 *
581 * @NL80211_CMD_MAX: highest used command number 589 * @NL80211_CMD_MAX: highest used command number
582 * @__NL80211_CMD_AFTER_LAST: internal use 590 * @__NL80211_CMD_AFTER_LAST: internal use
583 */ 591 */
@@ -726,6 +734,8 @@ enum nl80211_commands {
726 734
727 NL80211_CMD_CONN_FAILED, 735 NL80211_CMD_CONN_FAILED,
728 736
737 NL80211_CMD_SET_MCAST_RATE,
738
729 /* add new commands above here */ 739 /* add new commands above here */
730 740
731 /* used to define NL80211_CMD_MAX below */ 741 /* used to define NL80211_CMD_MAX below */
@@ -762,14 +772,26 @@ enum nl80211_commands {
762 * /sys/class/ieee80211/<phyname>/index 772 * /sys/class/ieee80211/<phyname>/index
763 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) 773 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
764 * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters 774 * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
765 * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz 775 * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz,
776 * defines the channel together with the (deprecated)
777 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes
778 * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1
779 * and %NL80211_ATTR_CENTER_FREQ2
780 * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values
781 * of &enum nl80211_chan_width, describing the channel width. See the
782 * documentation of the enum for more information.
783 * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
784 * channel, used for anything but 20 MHz bandwidth
785 * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
786 * channel, used only for 80+80 MHz bandwidth
766 * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ 787 * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
767 * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included): 788 * if HT20 or HT40 are to be used (i.e., HT disabled if not included):
768 * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including 789 * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
769 * this attribute) 790 * this attribute)
770 * NL80211_CHAN_HT20 = HT20 only 791 * NL80211_CHAN_HT20 = HT20 only
771 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel 792 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
772 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel 793 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
794 * This attribute is now deprecated.
773 * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is 795 * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
774 * less than or equal to the RTS threshold; allowed range: 1..255; 796 * less than or equal to the RTS threshold; allowed range: 1..255;
775 * dot11ShortRetryLimit; u8 797 * dot11ShortRetryLimit; u8
@@ -1273,6 +1295,21 @@ enum nl80211_commands {
1273 * the connection request from a station. nl80211_connect_failed_reason 1295 * the connection request from a station. nl80211_connect_failed_reason
1274 * enum has different reasons of connection failure. 1296 * enum has different reasons of connection failure.
1275 * 1297 *
1298 * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts
1299 * with the Authentication transaction sequence number field.
1300 *
1301 * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
1302 * association request when used with NL80211_CMD_NEW_STATION)
1303 *
1304 * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32)
1305 *
1306 * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with
1307 * the START_AP and SET_BSS commands
1308 * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the
1309 * START_AP and SET_BSS commands. This can have the values 0 or 1;
1310 * if not given in START_AP 0 is assumed, if not given in SET_BSS
1311 * no change is made.
1312 *
1276 * @NL80211_ATTR_MAX: highest attribute number currently defined 1313 * @NL80211_ATTR_MAX: highest attribute number currently defined
1277 * @__NL80211_ATTR_AFTER_LAST: internal use 1314 * @__NL80211_ATTR_AFTER_LAST: internal use
1278 */ 1315 */
@@ -1530,6 +1567,19 @@ enum nl80211_attrs {
1530 1567
1531 NL80211_ATTR_CONN_FAILED_REASON, 1568 NL80211_ATTR_CONN_FAILED_REASON,
1532 1569
1570 NL80211_ATTR_SAE_DATA,
1571
1572 NL80211_ATTR_VHT_CAPABILITY,
1573
1574 NL80211_ATTR_SCAN_FLAGS,
1575
1576 NL80211_ATTR_CHANNEL_WIDTH,
1577 NL80211_ATTR_CENTER_FREQ1,
1578 NL80211_ATTR_CENTER_FREQ2,
1579
1580 NL80211_ATTR_P2P_CTWINDOW,
1581 NL80211_ATTR_P2P_OPPPS,
1582
1533 /* add attributes here, update the policy in nl80211.c */ 1583 /* add attributes here, update the policy in nl80211.c */
1534 1584
1535 __NL80211_ATTR_AFTER_LAST, 1585 __NL80211_ATTR_AFTER_LAST,
@@ -1573,6 +1623,7 @@ enum nl80211_attrs {
1573#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 1623#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
1574#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 1624#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
1575#define NL80211_HT_CAPABILITY_LEN 26 1625#define NL80211_HT_CAPABILITY_LEN 26
1626#define NL80211_VHT_CAPABILITY_LEN 12
1576 1627
1577#define NL80211_MAX_NR_CIPHER_SUITES 5 1628#define NL80211_MAX_NR_CIPHER_SUITES 5
1578#define NL80211_MAX_NR_AKM_SUITES 2 1629#define NL80211_MAX_NR_AKM_SUITES 2
@@ -1693,10 +1744,15 @@ struct nl80211_sta_flag_update {
1693 * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved 1744 * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
1694 * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) 1745 * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
1695 * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) 1746 * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
1696 * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate 1747 * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate
1697 * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval 1748 * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
1698 * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) 1749 * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
1699 * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined 1750 * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
1751 * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
1752 * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
1753 * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
1754 * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate
1755 * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
1700 * @__NL80211_RATE_INFO_AFTER_LAST: internal use 1756 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
1701 */ 1757 */
1702enum nl80211_rate_info { 1758enum nl80211_rate_info {
@@ -1706,6 +1762,11 @@ enum nl80211_rate_info {
1706 NL80211_RATE_INFO_40_MHZ_WIDTH, 1762 NL80211_RATE_INFO_40_MHZ_WIDTH,
1707 NL80211_RATE_INFO_SHORT_GI, 1763 NL80211_RATE_INFO_SHORT_GI,
1708 NL80211_RATE_INFO_BITRATE32, 1764 NL80211_RATE_INFO_BITRATE32,
1765 NL80211_RATE_INFO_VHT_MCS,
1766 NL80211_RATE_INFO_VHT_NSS,
1767 NL80211_RATE_INFO_80_MHZ_WIDTH,
1768 NL80211_RATE_INFO_80P80_MHZ_WIDTH,
1769 NL80211_RATE_INFO_160_MHZ_WIDTH,
1709 1770
1710 /* keep last */ 1771 /* keep last */
1711 __NL80211_RATE_INFO_AFTER_LAST, 1772 __NL80211_RATE_INFO_AFTER_LAST,
@@ -2414,6 +2475,15 @@ enum nl80211_ac {
2414#define NL80211_TXQ_Q_BE NL80211_AC_BE 2475#define NL80211_TXQ_Q_BE NL80211_AC_BE
2415#define NL80211_TXQ_Q_BK NL80211_AC_BK 2476#define NL80211_TXQ_Q_BK NL80211_AC_BK
2416 2477
2478/**
2479 * enum nl80211_channel_type - channel type
2480 * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel
2481 * @NL80211_CHAN_HT20: 20 MHz HT channel
2482 * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel
2483 * below the control channel
2484 * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel
2485 * above the control channel
2486 */
2417enum nl80211_channel_type { 2487enum nl80211_channel_type {
2418 NL80211_CHAN_NO_HT, 2488 NL80211_CHAN_NO_HT,
2419 NL80211_CHAN_HT20, 2489 NL80211_CHAN_HT20,
@@ -2422,6 +2492,32 @@ enum nl80211_channel_type {
2422}; 2492};
2423 2493
2424/** 2494/**
2495 * enum nl80211_chan_width - channel width definitions
2496 *
2497 * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
2498 * attribute.
2499 *
2500 * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel
2501 * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel
2502 * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2503 * attribute must be provided as well
2504 * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2505 * attribute must be provided as well
2506 * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2507 * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
2508 * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2509 * attribute must be provided as well
2510 */
2511enum nl80211_chan_width {
2512 NL80211_CHAN_WIDTH_20_NOHT,
2513 NL80211_CHAN_WIDTH_20,
2514 NL80211_CHAN_WIDTH_40,
2515 NL80211_CHAN_WIDTH_80,
2516 NL80211_CHAN_WIDTH_80P80,
2517 NL80211_CHAN_WIDTH_160,
2518};
2519
2520/**
2425 * enum nl80211_bss - netlink attributes for a BSS 2521 * enum nl80211_bss - netlink attributes for a BSS
2426 * 2522 *
2427 * @__NL80211_BSS_INVALID: invalid 2523 * @__NL80211_BSS_INVALID: invalid
@@ -2489,6 +2585,7 @@ enum nl80211_bss_status {
2489 * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) 2585 * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
2490 * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) 2586 * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
2491 * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) 2587 * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
2588 * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals
2492 * @__NL80211_AUTHTYPE_NUM: internal 2589 * @__NL80211_AUTHTYPE_NUM: internal
2493 * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm 2590 * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
2494 * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by 2591 * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
@@ -2500,6 +2597,7 @@ enum nl80211_auth_type {
2500 NL80211_AUTHTYPE_SHARED_KEY, 2597 NL80211_AUTHTYPE_SHARED_KEY,
2501 NL80211_AUTHTYPE_FT, 2598 NL80211_AUTHTYPE_FT,
2502 NL80211_AUTHTYPE_NETWORK_EAP, 2599 NL80211_AUTHTYPE_NETWORK_EAP,
2600 NL80211_AUTHTYPE_SAE,
2503 2601
2504 /* keep last */ 2602 /* keep last */
2505 __NL80211_AUTHTYPE_NUM, 2603 __NL80211_AUTHTYPE_NUM,
@@ -3028,6 +3126,20 @@ enum nl80211_ap_sme_features {
3028 * in the interface combinations, even when it's only used for scan 3126 * in the interface combinations, even when it's only used for scan
3029 * and remain-on-channel. This could be due to, for example, the 3127 * and remain-on-channel. This could be due to, for example, the
3030 * remain-on-channel implementation requiring a channel context. 3128 * remain-on-channel implementation requiring a channel context.
3129 * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
3130 * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
3131 * mode
3132 * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan
3133 * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported
3134 * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif
3135 * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting
3136 * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform
3137 * OBSS scans and generate 20/40 BSS coex reports. This flag is used only
3138 * for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied.
3139 * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window
3140 * setting
3141 * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic
3142 * powersave
3031 */ 3143 */
3032enum nl80211_feature_flags { 3144enum nl80211_feature_flags {
3033 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3145 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3035,6 +3147,14 @@ enum nl80211_feature_flags {
3035 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, 3147 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
3036 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, 3148 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
3037 NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, 3149 NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
3150 NL80211_FEATURE_SAE = 1 << 5,
3151 NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
3152 NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
3153 NL80211_FEATURE_AP_SCAN = 1 << 8,
3154 NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
3155 NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
3156 NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
3157 NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
3038}; 3158};
3039 3159
3040/** 3160/**
@@ -3069,4 +3189,25 @@ enum nl80211_connect_failed_reason {
3069 NL80211_CONN_FAIL_BLOCKED_CLIENT, 3189 NL80211_CONN_FAIL_BLOCKED_CLIENT,
3070}; 3190};
3071 3191
3192/**
3193 * enum nl80211_scan_flags - scan request control flags
3194 *
3195 * Scan request control flags are used to control the handling
3196 * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN
3197 * requests.
3198 *
3199 * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority
3200 * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning
3201 * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured
3202 * as AP and the beaconing has already been configured. This attribute is
3203 * dangerous because will destroy stations performance as a lot of frames
3204 * will be lost while scanning off-channel, therefore it must be used only
3205 * when really needed
3206 */
3207enum nl80211_scan_flags {
3208 NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,
3209 NL80211_SCAN_FLAG_FLUSH = 1<<1,
3210 NL80211_SCAN_FLAG_AP = 1<<2,
3211};
3212
3072#endif /* __LINUX_NL80211_H */ 3213#endif /* __LINUX_NL80211_H */
diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h
index 94e981f810a..b65c834f83e 100644
--- a/include/uapi/linux/ptp_clock.h
+++ b/include/uapi/linux/ptp_clock.h
@@ -67,12 +67,26 @@ struct ptp_perout_request {
67 unsigned int rsv[4]; /* Reserved for future use. */ 67 unsigned int rsv[4]; /* Reserved for future use. */
68}; 68};
69 69
70#define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */
71
72struct ptp_sys_offset {
73 unsigned int n_samples; /* Desired number of measurements. */
74 unsigned int rsv[3]; /* Reserved for future use. */
75 /*
76 * Array of interleaved system/phc time stamps. The kernel
77 * will provide 2*n_samples + 1 time stamps, with the last
78 * one as a system time stamp.
79 */
80 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
81};
82
70#define PTP_CLK_MAGIC '=' 83#define PTP_CLK_MAGIC '='
71 84
72#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) 85#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps)
73#define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) 86#define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request)
74#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) 87#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request)
75#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) 88#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int)
89#define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset)
76 90
77struct ptp_extts_event { 91struct ptp_extts_event {
78 struct ptp_clock_time t; /* Time event occured. */ 92 struct ptp_clock_time t; /* Time event occured. */
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index fcd768b09f6..7a5eb196ade 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -120,6 +120,18 @@ enum {
120 RTM_SETDCB, 120 RTM_SETDCB,
121#define RTM_SETDCB RTM_SETDCB 121#define RTM_SETDCB RTM_SETDCB
122 122
123 RTM_NEWNETCONF = 80,
124#define RTM_NEWNETCONF RTM_NEWNETCONF
125 RTM_GETNETCONF = 82,
126#define RTM_GETNETCONF RTM_GETNETCONF
127
128 RTM_NEWMDB = 84,
129#define RTM_NEWMDB RTM_NEWMDB
130 RTM_DELMDB = 85,
131#define RTM_DELMDB RTM_DELMDB
132 RTM_GETMDB = 86,
133#define RTM_GETMDB RTM_GETMDB
134
123 __RTM_MAX, 135 __RTM_MAX,
124#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) 136#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
125}; 137};
@@ -222,6 +234,7 @@ enum {
222#define RTPROT_XORP 14 /* XORP */ 234#define RTPROT_XORP 14 /* XORP */
223#define RTPROT_NTK 15 /* Netsukuku */ 235#define RTPROT_NTK 15 /* Netsukuku */
224#define RTPROT_DHCP 16 /* DHCP client */ 236#define RTPROT_DHCP 16 /* DHCP client */
237#define RTPROT_MROUTED 17 /* Multicast daemon */
225 238
226/* rtm_scope 239/* rtm_scope
227 240
@@ -283,6 +296,7 @@ enum rtattr_type_t {
283 RTA_MP_ALGO, /* no longer used */ 296 RTA_MP_ALGO, /* no longer used */
284 RTA_TABLE, 297 RTA_TABLE,
285 RTA_MARK, 298 RTA_MARK,
299 RTA_MFC_STATS,
286 __RTA_MAX 300 __RTA_MAX
287}; 301};
288 302
@@ -403,6 +417,12 @@ struct rta_session {
403 } u; 417 } u;
404}; 418};
405 419
420struct rta_mfc_stats {
421 __u64 mfcs_packets;
422 __u64 mfcs_bytes;
423 __u64 mfcs_wrong_if;
424};
425
406/**** 426/****
407 * General form of address family dependent message. 427 * General form of address family dependent message.
408 ****/ 428 ****/
@@ -587,6 +607,12 @@ enum rtnetlink_groups {
587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE 607#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
588 RTNLGRP_DCB, 608 RTNLGRP_DCB,
589#define RTNLGRP_DCB RTNLGRP_DCB 609#define RTNLGRP_DCB RTNLGRP_DCB
610 RTNLGRP_IPV4_NETCONF,
611#define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF
612 RTNLGRP_IPV6_NETCONF,
613#define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF
614 RTNLGRP_MDB,
615#define RTNLGRP_MDB RTNLGRP_MDB
590 __RTNLGRP_MAX 616 __RTNLGRP_MAX
591}; 617};
592#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) 618#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h
index b1d2bf16b33..b8a24941db2 100644
--- a/include/uapi/linux/unix_diag.h
+++ b/include/uapi/linux/unix_diag.h
@@ -37,6 +37,7 @@ enum {
37 UNIX_DIAG_ICONS, 37 UNIX_DIAG_ICONS,
38 UNIX_DIAG_RQLEN, 38 UNIX_DIAG_RQLEN,
39 UNIX_DIAG_MEMINFO, 39 UNIX_DIAG_MEMINFO,
40 UNIX_DIAG_SHUTDOWN,
40 41
41 UNIX_DIAG_MAX, 42 UNIX_DIAG_MAX,
42}; 43};
diff --git a/include/uapi/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h
index 81a927930bf..f35aa0a338c 100644
--- a/include/uapi/linux/usb/cdc.h
+++ b/include/uapi/linux/usb/cdc.h
@@ -19,6 +19,7 @@
19#define USB_CDC_SUBCLASS_OBEX 0x0b 19#define USB_CDC_SUBCLASS_OBEX 0x0b
20#define USB_CDC_SUBCLASS_EEM 0x0c 20#define USB_CDC_SUBCLASS_EEM 0x0c
21#define USB_CDC_SUBCLASS_NCM 0x0d 21#define USB_CDC_SUBCLASS_NCM 0x0d
22#define USB_CDC_SUBCLASS_MBIM 0x0e
22 23
23#define USB_CDC_PROTO_NONE 0 24#define USB_CDC_PROTO_NONE 0
24 25
@@ -33,6 +34,7 @@
33#define USB_CDC_PROTO_EEM 7 34#define USB_CDC_PROTO_EEM 7
34 35
35#define USB_CDC_NCM_PROTO_NTB 1 36#define USB_CDC_NCM_PROTO_NTB 1
37#define USB_CDC_MBIM_PROTO_NTB 2
36 38
37/*-------------------------------------------------------------------------*/ 39/*-------------------------------------------------------------------------*/
38 40
@@ -53,6 +55,7 @@
53#define USB_CDC_DMM_TYPE 0x14 55#define USB_CDC_DMM_TYPE 0x14
54#define USB_CDC_OBEX_TYPE 0x15 56#define USB_CDC_OBEX_TYPE 0x15
55#define USB_CDC_NCM_TYPE 0x1a 57#define USB_CDC_NCM_TYPE 0x1a
58#define USB_CDC_MBIM_TYPE 0x1b
56 59
57/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ 60/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */
58struct usb_cdc_header_desc { 61struct usb_cdc_header_desc {
@@ -187,6 +190,21 @@ struct usb_cdc_ncm_desc {
187 __le16 bcdNcmVersion; 190 __le16 bcdNcmVersion;
188 __u8 bmNetworkCapabilities; 191 __u8 bmNetworkCapabilities;
189} __attribute__ ((packed)); 192} __attribute__ ((packed));
193
194/* "MBIM Control Model Functional Descriptor" */
195struct usb_cdc_mbim_desc {
196 __u8 bLength;
197 __u8 bDescriptorType;
198 __u8 bDescriptorSubType;
199
200 __le16 bcdMBIMVersion;
201 __le16 wMaxControlMessage;
202 __u8 bNumberFilters;
203 __u8 bMaxFilterSize;
204 __le16 wMaxSegmentSize;
205 __u8 bmNetworkCapabilities;
206} __attribute__ ((packed));
207
190/*-------------------------------------------------------------------------*/ 208/*-------------------------------------------------------------------------*/
191 209
192/* 210/*
@@ -332,6 +350,11 @@ struct usb_cdc_ncm_nth32 {
332#define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ 350#define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */
333#define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ 351#define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */
334 352
353#define USB_CDC_MBIM_NDP16_IPS_SIGN 0x00535049 /* IPS<sessionID> : IPS0 for now */
354#define USB_CDC_MBIM_NDP32_IPS_SIGN 0x00737069 /* ips<sessionID> : ips0 for now */
355#define USB_CDC_MBIM_NDP16_DSS_SIGN 0x00535344 /* DSS<sessionID> */
356#define USB_CDC_MBIM_NDP32_DSS_SIGN 0x00737364 /* dss<sessionID> */
357
335/* 16-bit NCM Datagram Pointer Entry */ 358/* 16-bit NCM Datagram Pointer Entry */
336struct usb_cdc_ncm_dpe16 { 359struct usb_cdc_ncm_dpe16 {
337 __le16 wDatagramIndex; 360 __le16 wDatagramIndex;
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index 2470f541af5..848e3584d7c 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -51,6 +51,8 @@
51#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */ 51#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
52#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the 52#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the
53 * network */ 53 * network */
54#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow
55 * Steering */
54 56
55#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ 57#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
56#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ 58#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
@@ -60,6 +62,11 @@ struct virtio_net_config {
60 __u8 mac[6]; 62 __u8 mac[6];
61 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ 63 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
62 __u16 status; 64 __u16 status;
65 /* Maximum number of each of transmit and receive queues;
66 * see VIRTIO_NET_F_MQ and VIRTIO_NET_CTRL_MQ.
67 * Legal values are between 1 and 0x8000
68 */
69 __u16 max_virtqueue_pairs;
63} __attribute__((packed)); 70} __attribute__((packed));
64 71
65/* This is the first element of the scatter-gather list. If you don't 72/* This is the first element of the scatter-gather list. If you don't
@@ -166,4 +173,24 @@ struct virtio_net_ctrl_mac {
166#define VIRTIO_NET_CTRL_ANNOUNCE 3 173#define VIRTIO_NET_CTRL_ANNOUNCE 3
167 #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0 174 #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0
168 175
176/*
177 * Control Receive Flow Steering
178 *
179 * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET
180 * enables Receive Flow Steering, specifying the number of the transmit and
181 * receive queues that will be used. After the command is consumed and acked by
182 * the device, the device will not steer new packets on receive virtqueues
183 * other than specified nor read from transmit virtqueues other than specified.
184 * Accordingly, driver should not transmit new packets on virtqueues other than
185 * specified.
186 */
187struct virtio_net_ctrl_mq {
188 u16 virtqueue_pairs;
189};
190
191#define VIRTIO_NET_CTRL_MQ 4
192 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET 0
193 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1
194 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000
195
169#endif /* _LINUX_VIRTIO_NET_H */ 196#endif /* _LINUX_VIRTIO_NET_H */