aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-20 21:58:50 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-20 21:58:50 -0500
commita0b1c42951dd06ec83cc1bc2c9788131d9fefcd8 (patch)
treea572f1523cf904c93020c9cdb32f3bc84ec3ac16 /include
parent8ec4942212a6d337982967778a3dc3b60aea782e (diff)
parentecd9883724b78cc72ed92c98bcb1a46c764fff21 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking update from David Miller: 1) Checkpoint/restarted TCP sockets now can properly propagate the TCP timestamp offset. From Andrey Vagin. 2) VMWARE VM VSOCK layer, from Andy King. 3) Much improved support for virtual functions and SR-IOV in bnx2x, from Ariel ELior. 4) All protocols on ipv4 and ipv6 are now network namespace aware, and all the compatability checks for initial-namespace-only protocols is removed. Thanks to Tom Parkin for helping deal with the last major holdout, L2TP. 5) IPV6 support in netpoll and network namespace support in pktgen, from Cong Wang. 6) Multiple Registration Protocol (MRP) and Multiple VLAN Registration Protocol (MVRP) support, from David Ward. 7) Compute packet lengths more accurately in the packet scheduler, from Eric Dumazet. 8) Use per-task page fragment allocator in skb_append_datato_frags(), also from Eric Dumazet. 9) Add support for connection tracking labels in netfilter, from Florian Westphal. 10) Fix default multicast group joining on ipv6, and add anti-spoofing checks to 6to4 and 6rd. From Hannes Frederic Sowa. 11) Make ipv4/ipv6 fragmentation memory limits more reasonable in modern times, rearrange inet frag datastructures for better cacheline locality, and move more operations outside of locking. From Jesper Dangaard Brouer. 12) Instead of strict master <--> slave relationships, allow arbitrary scenerios with "upper device lists". From Jiri Pirko. 13) Improve rate limiting accuracy in TBF and act_police, also from Jiri Pirko. 14) Add a BPF filter netfilter match target, from Willem de Bruijn. 15) Orphan and delete a bunch of pre-historic networking drivers from Paul Gortmaker. 16) Add TSO support for GRE tunnels, from Pravin B SHelar. Although this still needs some minor bug fixing before it's %100 correct in all cases. 17) Handle unresolved IPSEC states like ARP, with a resolution packet queue. From Steffen Klassert. 18) Remove TCP Appropriate Byte Count support (ABC), from Stephen Hemminger. This was long overdue. 19) Support SO_REUSEPORT, from Tom Herbert. 20) Allow locking a socket BPF filter, so that it cannot change after a process drops capabilities. 21) Add VLAN filtering to bridge, from Vlad Yasevich. 22) Bring ipv6 on-par with ipv4 and do not cache neighbour entries in the ipv6 routes, from YOSHIFUJI Hideaki. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1538 commits) ipv6: fix race condition regarding dst->expires and dst->from. net: fix a wrong assignment in skb_split() ip_gre: remove an extra dst_release() ppp: set qdisc_tx_busylock to avoid LOCKDEP splat atl1c: restore buffer state net: fix a build failure when !CONFIG_PROC_FS net: ipv4: fix waring -Wunused-variable net: proc: fix build failed when procfs is not configured Revert "xen: netback: remove redundant xenvif_put" net: move procfs code to net/core/net-procfs.c qmi_wwan, cdc-ether: add ADU960S bonding: set sysfs device_type to 'bond' bonding: fix bond_release_all inconsistencies b44: use netdev_alloc_skb_ip_align() xen: netback: remove redundant xenvif_put net: fec: Do a sanity check on the gpio number ip_gre: propogate target device GSO capability to the tunnel device ip_gre: allow CSUM capable devices to handle packets bonding: Fix initialize after use for 3ad machine state spinlock bonding: Fix race condition between bond_enslave() and bond_3ad_update_lacp_rate() ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h4
-rw-r--r--include/linux/bcma/bcma_driver_mips.h11
-rw-r--r--include/linux/bcma/bcma_driver_pci.h2
-rw-r--r--include/linux/can/dev.h11
-rw-r--r--include/linux/can/led.h51
-rw-r--r--include/linux/can/skb.h45
-rw-r--r--include/linux/cyclomx.h77
-rw-r--r--include/linux/cycx_drv.h64
-rw-r--r--include/linux/etherdevice.h4
-rw-r--r--include/linux/ieee80211.h155
-rw-r--r--include/linux/if_macvlan.h6
-rw-r--r--include/linux/if_team.h1
-rw-r--r--include/linux/in6.h13
-rw-r--r--include/linux/inetdevice.h6
-rw-r--r--include/linux/ipv6.h10
-rw-r--r--include/linux/micrel_phy.h9
-rw-r--r--include/linux/mlx4/device.h8
-rw-r--r--include/linux/mroute.h2
-rw-r--r--include/linux/mroute6.h2
-rw-r--r--include/linux/netdev_features.h3
-rw-r--r--include/linux/netdevice.h113
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h3
-rw-r--r--include/linux/netfilter/nfnetlink.h4
-rw-r--r--include/linux/netpoll.h28
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/phy.h6
-rw-r--r--include/linux/platform_data/cpsw.h4
-rw-r--r--include/linux/platform_data/microread.h35
-rw-r--r--include/linux/proc_fs.h15
-rw-r--r--include/linux/random.h6
-rw-r--r--include/linux/skbuff.h61
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/ssb/ssb_driver_gige.h23
-rw-r--r--include/linux/ssb/ssb_driver_mips.h5
-rw-r--r--include/linux/tcp.h4
-rw-r--r--include/linux/wanrouter.h127
-rw-r--r--include/linux/wl12xx.h16
-rw-r--r--include/net/act_api.h27
-rw-r--r--include/net/addrconf.h63
-rw-r--r--include/net/bluetooth/a2mp.h4
-rw-r--r--include/net/bluetooth/bluetooth.h23
-rw-r--r--include/net/bluetooth/hci.h18
-rw-r--r--include/net/bluetooth/hci_core.h5
-rw-r--r--include/net/bluetooth/l2cap.h1
-rw-r--r--include/net/cfg80211.h480
-rw-r--r--include/net/dn_route.h2
-rw-r--r--include/net/dsfield.h6
-rw-r--r--include/net/dst.h9
-rw-r--r--include/net/gro_cells.h4
-rw-r--r--include/net/inet6_hashtables.h5
-rw-r--r--include/net/inet_frag.h84
-rw-r--r--include/net/inet_hashtables.h13
-rw-r--r--include/net/ip6_checksum.h62
-rw-r--r--include/net/ip6_fib.h41
-rw-r--r--include/net/ip6_route.h9
-rw-r--r--include/net/ipv6.h140
-rw-r--r--include/net/mac80211.h313
-rw-r--r--include/net/mrp.h143
-rw-r--r--include/net/ndisc.h32
-rw-r--r--include/net/neighbour.h3
-rw-r--r--include/net/netevent.h3
-rw-r--r--include/net/netfilter/nf_conntrack_acct.h6
-rw-r--r--include/net/netfilter/nf_conntrack_core.h15
-rw-r--r--include/net/netfilter/nf_conntrack_ecache.h19
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h7
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h4
-rw-r--r--include/net/netfilter/nf_conntrack_helper.h11
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h11
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h10
-rw-r--r--include/net/netfilter/nf_conntrack_labels.h58
-rw-r--r--include/net/netfilter/nf_conntrack_timeout.h8
-rw-r--r--include/net/netfilter/nf_conntrack_timestamp.h21
-rw-r--r--include/net/netfilter/nf_tproxy_core.h2
-rw-r--r--include/net/netns/conntrack.h4
-rw-r--r--include/net/netns/ipv4.h3
-rw-r--r--include/net/netns/ipv6.h1
-rw-r--r--include/net/nfc/hci.h22
-rw-r--r--include/net/nfc/nci_core.h1
-rw-r--r--include/net/nfc/nfc.h8
-rw-r--r--include/net/pkt_cls.h7
-rw-r--r--include/net/pkt_sched.h10
-rw-r--r--include/net/regulatory.h4
-rw-r--r--include/net/sch_generic.h21
-rw-r--r--include/net/sctp/constants.h2
-rw-r--r--include/net/sctp/structs.h5
-rw-r--r--include/net/sock.h10
-rw-r--r--include/net/tcp.h10
-rw-r--r--include/net/xfrm.h40
-rw-r--r--include/uapi/asm-generic/socket.h5
-rw-r--r--include/uapi/linux/can/gw.h2
-rw-r--r--include/uapi/linux/if_bridge.h11
-rw-r--r--include/uapi/linux/if_ether.h1
-rw-r--r--include/uapi/linux/if_link.h1
-rw-r--r--include/uapi/linux/if_vlan.h1
-rw-r--r--include/uapi/linux/in6.h20
-rw-r--r--include/uapi/linux/ipv6.h2
-rw-r--r--include/uapi/linux/mroute.h3
-rw-r--r--include/uapi/linux/mroute6.h3
-rw-r--r--include/uapi/linux/neighbour.h1
-rw-r--r--include/uapi/linux/netfilter/Kbuild2
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_common.h1
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_conntrack.h2
-rw-r--r--include/uapi/linux/netfilter/xt_CT.h6
-rw-r--r--include/uapi/linux/netfilter/xt_bpf.h17
-rw-r--r--include/uapi/linux/netfilter/xt_connlabel.h12
-rw-r--r--include/uapi/linux/netfilter/xt_conntrack.h1
-rw-r--r--include/uapi/linux/nfc.h37
-rw-r--r--include/uapi/linux/nl80211.h395
-rw-r--r--include/uapi/linux/rtnetlink.h1
-rw-r--r--include/uapi/linux/snmp.h1
-rw-r--r--include/uapi/linux/tcp.h1
-rw-r--r--include/uapi/linux/virtio_net.h8
-rw-r--r--include/uapi/linux/vm_sockets.h163
-rw-r--r--include/uapi/linux/wanrouter.h443
114 files changed, 2588 insertions, 1301 deletions
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 9a0e3fa3ca95..1d002b58b60b 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -27,7 +27,7 @@
27#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ 27#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */
28#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ 28#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */
29#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ 29#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */
30#define BCMA_CC_FLASHT_NFLASH 0x00000200 /* NAND flash */ 30#define BCMA_CC_FLASHT_NAND 0x00000300 /* NAND flash */
31#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ 31#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */
32#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ 32#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */
33#define BCMA_PLLTYPE_NONE 0x00000000 33#define BCMA_PLLTYPE_NONE 0x00000000
@@ -634,4 +634,6 @@ extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc,
634 u32 offset, u32 mask, u32 set); 634 u32 offset, u32 mask, u32 set);
635extern void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid); 635extern void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid);
636 636
637extern u32 bcma_pmu_get_bus_clock(struct bcma_drv_cc *cc);
638
637#endif /* LINUX_BCMA_DRIVER_CC_H_ */ 639#endif /* LINUX_BCMA_DRIVER_CC_H_ */
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h
index 0baf8a56b794..fb61f3fb4ddb 100644
--- a/include/linux/bcma/bcma_driver_mips.h
+++ b/include/linux/bcma/bcma_driver_mips.h
@@ -28,6 +28,7 @@
28#define BCMA_MIPS_MIPS74K_GPIOEN 0x0048 28#define BCMA_MIPS_MIPS74K_GPIOEN 0x0048
29#define BCMA_MIPS_MIPS74K_CLKCTLST 0x01E0 29#define BCMA_MIPS_MIPS74K_CLKCTLST 0x01E0
30 30
31#define BCMA_MIPS_OOBSELINA74 0x004
31#define BCMA_MIPS_OOBSELOUTA30 0x100 32#define BCMA_MIPS_OOBSELOUTA30 0x100
32 33
33struct bcma_device; 34struct bcma_device;
@@ -36,19 +37,23 @@ struct bcma_drv_mips {
36 struct bcma_device *core; 37 struct bcma_device *core;
37 u8 setup_done:1; 38 u8 setup_done:1;
38 u8 early_setup_done:1; 39 u8 early_setup_done:1;
39 unsigned int assigned_irqs;
40}; 40};
41 41
42#ifdef CONFIG_BCMA_DRIVER_MIPS 42#ifdef CONFIG_BCMA_DRIVER_MIPS
43extern 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); 44extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
45
46extern unsigned int bcma_core_irq(struct bcma_device *core);
45#else 47#else
46static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } 48static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { }
47static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { } 49static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { }
50
51static inline unsigned int bcma_core_irq(struct bcma_device *core)
52{
53 return 0;
54}
48#endif 55#endif
49 56
50extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); 57extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
51 58
52extern unsigned int bcma_core_mips_irq(struct bcma_device *dev);
53
54#endif /* LINUX_BCMA_DRIVER_MIPS_H_ */ 59#endif /* LINUX_BCMA_DRIVER_MIPS_H_ */
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index c48d98d27b77..424760f01b9d 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -179,6 +179,8 @@ struct pci_dev;
179#define BCMA_CORE_PCI_CFG_FUN_MASK 7 /* Function mask */ 179#define BCMA_CORE_PCI_CFG_FUN_MASK 7 /* Function mask */
180#define BCMA_CORE_PCI_CFG_OFF_MASK 0xfff /* Register mask */ 180#define BCMA_CORE_PCI_CFG_OFF_MASK 0xfff /* Register mask */
181 181
182#define BCMA_CORE_PCI_CFG_DEVCTRL 0xd8
183
182/* PCIE Root Capability Register bits (Host mode only) */ 184/* PCIE Root Capability Register bits (Host mode only) */
183#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001 185#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
184 186
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 2b2fc345afca..fb0ab651a041 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -16,6 +16,7 @@
16#include <linux/can.h> 16#include <linux/can.h>
17#include <linux/can/netlink.h> 17#include <linux/can/netlink.h>
18#include <linux/can/error.h> 18#include <linux/can/error.h>
19#include <linux/can/led.h>
19 20
20/* 21/*
21 * CAN mode 22 * CAN mode
@@ -52,6 +53,13 @@ struct can_priv {
52 53
53 unsigned int echo_skb_max; 54 unsigned int echo_skb_max;
54 struct sk_buff **echo_skb; 55 struct sk_buff **echo_skb;
56
57#ifdef CONFIG_CAN_LEDS
58 struct led_trigger *tx_led_trig;
59 char tx_led_trig_name[CAN_LED_NAME_SZ];
60 struct led_trigger *rx_led_trig;
61 char rx_led_trig_name[CAN_LED_NAME_SZ];
62#endif
55}; 63};
56 64
57/* 65/*
@@ -98,6 +106,9 @@ u8 can_len2dlc(u8 len);
98struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); 106struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
99void free_candev(struct net_device *dev); 107void free_candev(struct net_device *dev);
100 108
109/* a candev safe wrapper around netdev_priv */
110struct can_priv *safe_candev_priv(struct net_device *dev);
111
101int open_candev(struct net_device *dev); 112int open_candev(struct net_device *dev);
102void close_candev(struct net_device *dev); 113void close_candev(struct net_device *dev);
103 114
diff --git a/include/linux/can/led.h b/include/linux/can/led.h
new file mode 100644
index 000000000000..9c1167baf273
--- /dev/null
+++ b/include/linux/can/led.h
@@ -0,0 +1,51 @@
1/*
2 * Copyright 2012, Fabio Baltieri <fabio.baltieri@gmail.com>
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 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef CAN_LED_H
10#define CAN_LED_H
11
12#include <linux/if.h>
13#include <linux/leds.h>
14
15enum can_led_event {
16 CAN_LED_EVENT_OPEN,
17 CAN_LED_EVENT_STOP,
18 CAN_LED_EVENT_TX,
19 CAN_LED_EVENT_RX,
20};
21
22#ifdef CONFIG_CAN_LEDS
23
24/* keep space for interface name + "-tx"/"-rx" suffix and null terminator */
25#define CAN_LED_NAME_SZ (IFNAMSIZ + 4)
26
27void can_led_event(struct net_device *netdev, enum can_led_event event);
28void devm_can_led_init(struct net_device *netdev);
29int __init can_led_notifier_init(void);
30void __exit can_led_notifier_exit(void);
31
32#else
33
34static inline void can_led_event(struct net_device *netdev,
35 enum can_led_event event)
36{
37}
38static inline void devm_can_led_init(struct net_device *netdev)
39{
40}
41static inline int can_led_notifier_init(void)
42{
43 return 0;
44}
45static inline void can_led_notifier_exit(void)
46{
47}
48
49#endif
50
51#endif
diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h
new file mode 100644
index 000000000000..2f0543f7510c
--- /dev/null
+++ b/include/linux/can/skb.h
@@ -0,0 +1,45 @@
1/*
2 * linux/can/skb.h
3 *
4 * Definitions for the CAN network socket buffer
5 *
6 * Copyright (C) 2012 Oliver Hartkopp <socketcan@hartkopp.net>
7 *
8 */
9
10#ifndef CAN_SKB_H
11#define CAN_SKB_H
12
13#include <linux/types.h>
14#include <linux/can.h>
15
16/*
17 * The struct can_skb_priv is used to transport additional information along
18 * with the stored struct can(fd)_frame that can not be contained in existing
19 * struct sk_buff elements.
20 * N.B. that this information must not be modified in cloned CAN sk_buffs.
21 * To modify the CAN frame content or the struct can_skb_priv content
22 * skb_copy() needs to be used instead of skb_clone().
23 */
24
25/**
26 * struct can_skb_priv - private additional data inside CAN sk_buffs
27 * @ifindex: ifindex of the first interface the CAN frame appeared on
28 * @cf: align to the following CAN frame at skb->data
29 */
30struct can_skb_priv {
31 int ifindex;
32 struct can_frame cf[0];
33};
34
35static inline struct can_skb_priv *can_skb_prv(struct sk_buff *skb)
36{
37 return (struct can_skb_priv *)(skb->head);
38}
39
40static inline void can_skb_reserve(struct sk_buff *skb)
41{
42 skb_reserve(skb, sizeof(struct can_skb_priv));
43}
44
45#endif /* CAN_SKB_H */
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h
deleted file mode 100644
index b88f7f428e58..000000000000
--- a/include/linux/cyclomx.h
+++ /dev/null
@@ -1,77 +0,0 @@
1#ifndef _CYCLOMX_H
2#define _CYCLOMX_H
3/*
4* cyclomx.h Cyclom 2X WAN Link Driver.
5* User-level API definitions.
6*
7* Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
8*
9* Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo
10*
11* Based on wanpipe.h by Gene Kozin <genek@compuserve.com>
12*
13* This program is free software; you can redistribute it and/or
14* modify it under the terms of the GNU General Public License
15* as published by the Free Software Foundation; either version
16* 2 of the License, or (at your option) any later version.
17* ============================================================================
18* 2000/07/13 acme remove crap #if KERNEL_VERSION > blah
19* 2000/01/21 acme rename cyclomx_open to cyclomx_mod_inc_use_count
20* and cyclomx_close to cyclomx_mod_dec_use_count
21* 1999/05/19 acme wait_queue_head_t wait_stats(support for 2.3.*)
22* 1999/01/03 acme judicious use of data types
23* 1998/12/27 acme cleanup: PACKED not needed
24* 1998/08/08 acme Version 0.0.1
25*/
26
27#include <linux/wanrouter.h>
28#include <linux/spinlock.h>
29
30#ifdef __KERNEL__
31/* Kernel Interface */
32
33#include <linux/cycx_drv.h> /* Cyclom 2X support module API definitions */
34#include <linux/cycx_cfm.h> /* Cyclom 2X firmware module definitions */
35#ifdef CONFIG_CYCLOMX_X25
36#include <linux/cycx_x25.h>
37#endif
38
39/* Adapter Data Space.
40 * This structure is needed because we handle multiple cards, otherwise
41 * static data would do it.
42 */
43struct cycx_device {
44 char devname[WAN_DRVNAME_SZ + 1];/* card name */
45 struct cycx_hw hw; /* hardware configuration */
46 struct wan_device wandev; /* WAN device data space */
47 u32 state_tick; /* link state timestamp */
48 spinlock_t lock;
49 char in_isr; /* interrupt-in-service flag */
50 char buff_int_mode_unbusy; /* flag for carrying out dev_tint */
51 wait_queue_head_t wait_stats; /* to wait for the STATS indication */
52 void __iomem *mbox; /* -> mailbox */
53 void (*isr)(struct cycx_device* card); /* interrupt service routine */
54 int (*exec)(struct cycx_device* card, void* u_cmd, void* u_data);
55 union {
56#ifdef CONFIG_CYCLOMX_X25
57 struct { /* X.25 specific data */
58 u32 lo_pvc;
59 u32 hi_pvc;
60 u32 lo_svc;
61 u32 hi_svc;
62 struct cycx_x25_stats stats;
63 spinlock_t lock;
64 u32 connection_keys;
65 } x;
66#endif
67 } u;
68};
69
70/* Public Functions */
71void cycx_set_state(struct cycx_device *card, int state);
72
73#ifdef CONFIG_CYCLOMX_X25
74int cycx_x25_wan_init(struct cycx_device *card, wandev_conf_t *conf);
75#endif
76#endif /* __KERNEL__ */
77#endif /* _CYCLOMX_H */
diff --git a/include/linux/cycx_drv.h b/include/linux/cycx_drv.h
deleted file mode 100644
index 12fe6b0bfcff..000000000000
--- a/include/linux/cycx_drv.h
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2* cycx_drv.h CYCX Support Module. Kernel API Definitions.
3*
4* Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
5*
6* Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo
7*
8* Based on sdladrv.h by Gene Kozin <genek@compuserve.com>
9*
10* This program is free software; you can redistribute it and/or
11* modify it under the terms of the GNU General Public License
12* as published by the Free Software Foundation; either version
13* 2 of the License, or (at your option) any later version.
14* ============================================================================
15* 1999/10/23 acme cycxhw_t cleanup
16* 1999/01/03 acme more judicious use of data types...
17* uclong, ucchar, etc deleted, the u8, u16, u32
18* types are the portable way to go.
19* 1999/01/03 acme judicious use of data types... u16, u32, etc
20* 1998/12/26 acme FIXED_BUFFERS, CONF_OFFSET,
21* removal of cy_read{bwl}
22* 1998/08/08 acme Initial version.
23*/
24#ifndef _CYCX_DRV_H
25#define _CYCX_DRV_H
26
27#define CYCX_WINDOWSIZE 0x4000 /* default dual-port memory window size */
28#define GEN_CYCX_INTR 0x02
29#define RST_ENABLE 0x04
30#define START_CPU 0x06
31#define RST_DISABLE 0x08
32#define FIXED_BUFFERS 0x08
33#define TEST_PATTERN 0xaa55
34#define CMD_OFFSET 0x20
35#define CONF_OFFSET 0x0380
36#define RESET_OFFSET 0x3c00 /* For reset file load */
37#define DATA_OFFSET 0x0100 /* For code and data files load */
38#define START_OFFSET 0x3ff0 /* 80186 starts here */
39
40/**
41 * struct cycx_hw - Adapter hardware configuration
42 * @fwid - firmware ID
43 * @irq - interrupt request level
44 * @dpmbase - dual-port memory base
45 * @dpmsize - dual-port memory size
46 * @reserved - reserved for future use
47 */
48struct cycx_hw {
49 u32 fwid;
50 int irq;
51 void __iomem *dpmbase;
52 u32 dpmsize;
53 u32 reserved[5];
54};
55
56/* Function Prototypes */
57extern int cycx_setup(struct cycx_hw *hw, void *sfm, u32 len, unsigned long base);
58extern int cycx_down(struct cycx_hw *hw);
59extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
60extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
61extern int cycx_exec(void __iomem *addr);
62
63extern void cycx_intr(struct cycx_hw *hw);
64#endif /* _CYCX_DRV_H */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 243eea1e33d8..c623861964e4 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -40,6 +40,8 @@ extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh,
40extern void eth_header_cache_update(struct hh_cache *hh, 40extern void eth_header_cache_update(struct hh_cache *hh,
41 const struct net_device *dev, 41 const struct net_device *dev,
42 const unsigned char *haddr); 42 const unsigned char *haddr);
43extern int eth_prepare_mac_addr_change(struct net_device *dev, void *p);
44extern void eth_commit_mac_addr_change(struct net_device *dev, void *p);
43extern int eth_mac_addr(struct net_device *dev, void *p); 45extern int eth_mac_addr(struct net_device *dev, void *p);
44extern int eth_change_mtu(struct net_device *dev, int new_mtu); 46extern int eth_change_mtu(struct net_device *dev, int new_mtu);
45extern int eth_validate_addr(struct net_device *dev); 47extern int eth_validate_addr(struct net_device *dev);
@@ -192,7 +194,7 @@ static inline void eth_zero_addr(u8 *addr)
192 */ 194 */
193static inline void eth_hw_addr_random(struct net_device *dev) 195static inline void eth_hw_addr_random(struct net_device *dev)
194{ 196{
195 dev->addr_assign_type |= NET_ADDR_RANDOM; 197 dev->addr_assign_type = NET_ADDR_RANDOM;
196 eth_random_addr(dev->dev_addr); 198 eth_random_addr(dev->dev_addr);
197} 199}
198 200
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index f0859cc73861..7e24fe0cfbcd 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -151,6 +151,11 @@
151/* Mesh Control 802.11s */ 151/* Mesh Control 802.11s */
152#define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100 152#define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100
153 153
154/* Mesh Power Save Level */
155#define IEEE80211_QOS_CTL_MESH_PS_LEVEL 0x0200
156/* Mesh Receiver Service Period Initiated */
157#define IEEE80211_QOS_CTL_RSPI 0x0400
158
154/* U-APSD queue for WMM IEs sent by AP */ 159/* U-APSD queue for WMM IEs sent by AP */
155#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) 160#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7)
156#define IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK 0x0f 161#define IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK 0x0f
@@ -180,7 +185,7 @@ struct ieee80211_hdr {
180 u8 addr3[6]; 185 u8 addr3[6];
181 __le16 seq_ctrl; 186 __le16 seq_ctrl;
182 u8 addr4[6]; 187 u8 addr4[6];
183} __attribute__ ((packed)); 188} __packed;
184 189
185struct ieee80211_hdr_3addr { 190struct ieee80211_hdr_3addr {
186 __le16 frame_control; 191 __le16 frame_control;
@@ -189,7 +194,7 @@ struct ieee80211_hdr_3addr {
189 u8 addr2[6]; 194 u8 addr2[6];
190 u8 addr3[6]; 195 u8 addr3[6];
191 __le16 seq_ctrl; 196 __le16 seq_ctrl;
192} __attribute__ ((packed)); 197} __packed;
193 198
194struct ieee80211_qos_hdr { 199struct ieee80211_qos_hdr {
195 __le16 frame_control; 200 __le16 frame_control;
@@ -199,7 +204,7 @@ struct ieee80211_qos_hdr {
199 u8 addr3[6]; 204 u8 addr3[6];
200 __le16 seq_ctrl; 205 __le16 seq_ctrl;
201 __le16 qos_ctrl; 206 __le16 qos_ctrl;
202} __attribute__ ((packed)); 207} __packed;
203 208
204/** 209/**
205 * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set 210 * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set
@@ -576,7 +581,7 @@ struct ieee80211s_hdr {
576 __le32 seqnum; 581 __le32 seqnum;
577 u8 eaddr1[6]; 582 u8 eaddr1[6];
578 u8 eaddr2[6]; 583 u8 eaddr2[6];
579} __attribute__ ((packed)); 584} __packed;
580 585
581/* Mesh flags */ 586/* Mesh flags */
582#define MESH_FLAGS_AE_A4 0x1 587#define MESH_FLAGS_AE_A4 0x1
@@ -614,7 +619,7 @@ struct ieee80211_quiet_ie {
614 u8 period; 619 u8 period;
615 __le16 duration; 620 __le16 duration;
616 __le16 offset; 621 __le16 offset;
617} __attribute__ ((packed)); 622} __packed;
618 623
619/** 624/**
620 * struct ieee80211_msrment_ie 625 * struct ieee80211_msrment_ie
@@ -626,7 +631,7 @@ struct ieee80211_msrment_ie {
626 u8 mode; 631 u8 mode;
627 u8 type; 632 u8 type;
628 u8 request[0]; 633 u8 request[0];
629} __attribute__ ((packed)); 634} __packed;
630 635
631/** 636/**
632 * struct ieee80211_channel_sw_ie 637 * struct ieee80211_channel_sw_ie
@@ -637,7 +642,7 @@ struct ieee80211_channel_sw_ie {
637 u8 mode; 642 u8 mode;
638 u8 new_ch_num; 643 u8 new_ch_num;
639 u8 count; 644 u8 count;
640} __attribute__ ((packed)); 645} __packed;
641 646
642/** 647/**
643 * struct ieee80211_tim 648 * struct ieee80211_tim
@@ -650,7 +655,7 @@ struct ieee80211_tim_ie {
650 u8 bitmap_ctrl; 655 u8 bitmap_ctrl;
651 /* variable size: 1 - 251 bytes */ 656 /* variable size: 1 - 251 bytes */
652 u8 virtual_map[1]; 657 u8 virtual_map[1];
653} __attribute__ ((packed)); 658} __packed;
654 659
655/** 660/**
656 * struct ieee80211_meshconf_ie 661 * struct ieee80211_meshconf_ie
@@ -665,7 +670,7 @@ struct ieee80211_meshconf_ie {
665 u8 meshconf_auth; 670 u8 meshconf_auth;
666 u8 meshconf_form; 671 u8 meshconf_form;
667 u8 meshconf_cap; 672 u8 meshconf_cap;
668} __attribute__ ((packed)); 673} __packed;
669 674
670/** 675/**
671 * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags 676 * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags
@@ -675,11 +680,14 @@ struct ieee80211_meshconf_ie {
675 * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs 680 * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs
676 * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure 681 * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure
677 * is ongoing 682 * is ongoing
683 * @IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL: STA is in deep sleep mode or has
684 * neighbors in deep sleep mode
678 */ 685 */
679enum mesh_config_capab_flags { 686enum mesh_config_capab_flags {
680 IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01, 687 IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01,
681 IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08, 688 IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08,
682 IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20, 689 IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20,
690 IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL = 0x40,
683}; 691};
684 692
685/** 693/**
@@ -695,12 +703,41 @@ struct ieee80211_rann_ie {
695 __le32 rann_seq; 703 __le32 rann_seq;
696 __le32 rann_interval; 704 __le32 rann_interval;
697 __le32 rann_metric; 705 __le32 rann_metric;
698} __attribute__ ((packed)); 706} __packed;
699 707
700enum ieee80211_rann_flags { 708enum ieee80211_rann_flags {
701 RANN_FLAG_IS_GATE = 1 << 0, 709 RANN_FLAG_IS_GATE = 1 << 0,
702}; 710};
703 711
712enum ieee80211_ht_chanwidth_values {
713 IEEE80211_HT_CHANWIDTH_20MHZ = 0,
714 IEEE80211_HT_CHANWIDTH_ANY = 1,
715};
716
717/**
718 * enum ieee80211_opmode_bits - VHT operating mode field bits
719 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK: channel width mask
720 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ: 20 MHz channel width
721 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_40MHZ: 40 MHz channel width
722 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_80MHZ: 80 MHz channel width
723 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_160MHZ: 160 MHz or 80+80 MHz channel width
724 * @IEEE80211_OPMODE_NOTIF_RX_NSS_MASK: number of spatial streams mask
725 * (the NSS value is the value of this field + 1)
726 * @IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT: number of spatial streams shift
727 * @IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF: indicates streams in SU-MIMO PPDU
728 * using a beamforming steering matrix
729 */
730enum ieee80211_vht_opmode_bits {
731 IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK = 3,
732 IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ = 0,
733 IEEE80211_OPMODE_NOTIF_CHANWIDTH_40MHZ = 1,
734 IEEE80211_OPMODE_NOTIF_CHANWIDTH_80MHZ = 2,
735 IEEE80211_OPMODE_NOTIF_CHANWIDTH_160MHZ = 3,
736 IEEE80211_OPMODE_NOTIF_RX_NSS_MASK = 0x70,
737 IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT = 4,
738 IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF = 0x80,
739};
740
704#define WLAN_SA_QUERY_TR_ID_LEN 2 741#define WLAN_SA_QUERY_TR_ID_LEN 2
705 742
706struct ieee80211_mgmt { 743struct ieee80211_mgmt {
@@ -717,33 +754,33 @@ struct ieee80211_mgmt {
717 __le16 status_code; 754 __le16 status_code;
718 /* possibly followed by Challenge text */ 755 /* possibly followed by Challenge text */
719 u8 variable[0]; 756 u8 variable[0];
720 } __attribute__ ((packed)) auth; 757 } __packed auth;
721 struct { 758 struct {
722 __le16 reason_code; 759 __le16 reason_code;
723 } __attribute__ ((packed)) deauth; 760 } __packed deauth;
724 struct { 761 struct {
725 __le16 capab_info; 762 __le16 capab_info;
726 __le16 listen_interval; 763 __le16 listen_interval;
727 /* followed by SSID and Supported rates */ 764 /* followed by SSID and Supported rates */
728 u8 variable[0]; 765 u8 variable[0];
729 } __attribute__ ((packed)) assoc_req; 766 } __packed assoc_req;
730 struct { 767 struct {
731 __le16 capab_info; 768 __le16 capab_info;
732 __le16 status_code; 769 __le16 status_code;
733 __le16 aid; 770 __le16 aid;
734 /* followed by Supported rates */ 771 /* followed by Supported rates */
735 u8 variable[0]; 772 u8 variable[0];
736 } __attribute__ ((packed)) assoc_resp, reassoc_resp; 773 } __packed assoc_resp, reassoc_resp;
737 struct { 774 struct {
738 __le16 capab_info; 775 __le16 capab_info;
739 __le16 listen_interval; 776 __le16 listen_interval;
740 u8 current_ap[6]; 777 u8 current_ap[6];
741 /* followed by SSID and Supported rates */ 778 /* followed by SSID and Supported rates */
742 u8 variable[0]; 779 u8 variable[0];
743 } __attribute__ ((packed)) reassoc_req; 780 } __packed reassoc_req;
744 struct { 781 struct {
745 __le16 reason_code; 782 __le16 reason_code;
746 } __attribute__ ((packed)) disassoc; 783 } __packed disassoc;
747 struct { 784 struct {
748 __le64 timestamp; 785 __le64 timestamp;
749 __le16 beacon_int; 786 __le16 beacon_int;
@@ -751,11 +788,11 @@ struct ieee80211_mgmt {
751 /* followed by some of SSID, Supported rates, 788 /* followed by some of SSID, Supported rates,
752 * FH Params, DS Params, CF Params, IBSS Params, TIM */ 789 * FH Params, DS Params, CF Params, IBSS Params, TIM */
753 u8 variable[0]; 790 u8 variable[0];
754 } __attribute__ ((packed)) beacon; 791 } __packed beacon;
755 struct { 792 struct {
756 /* only variable items: SSID, Supported rates */ 793 /* only variable items: SSID, Supported rates */
757 u8 variable[0]; 794 u8 variable[0];
758 } __attribute__ ((packed)) probe_req; 795 } __packed probe_req;
759 struct { 796 struct {
760 __le64 timestamp; 797 __le64 timestamp;
761 __le16 beacon_int; 798 __le16 beacon_int;
@@ -763,7 +800,7 @@ struct ieee80211_mgmt {
763 /* followed by some of SSID, Supported rates, 800 /* followed by some of SSID, Supported rates,
764 * FH Params, DS Params, CF Params, IBSS Params */ 801 * FH Params, DS Params, CF Params, IBSS Params */
765 u8 variable[0]; 802 u8 variable[0];
766 } __attribute__ ((packed)) probe_resp; 803 } __packed probe_resp;
767 struct { 804 struct {
768 u8 category; 805 u8 category;
769 union { 806 union {
@@ -772,65 +809,73 @@ struct ieee80211_mgmt {
772 u8 dialog_token; 809 u8 dialog_token;
773 u8 status_code; 810 u8 status_code;
774 u8 variable[0]; 811 u8 variable[0];
775 } __attribute__ ((packed)) wme_action; 812 } __packed wme_action;
776 struct{ 813 struct{
777 u8 action_code; 814 u8 action_code;
778 u8 element_id; 815 u8 element_id;
779 u8 length; 816 u8 length;
780 struct ieee80211_channel_sw_ie sw_elem; 817 struct ieee80211_channel_sw_ie sw_elem;
781 } __attribute__((packed)) chan_switch; 818 } __packed chan_switch;
782 struct{ 819 struct{
783 u8 action_code; 820 u8 action_code;
784 u8 dialog_token; 821 u8 dialog_token;
785 u8 element_id; 822 u8 element_id;
786 u8 length; 823 u8 length;
787 struct ieee80211_msrment_ie msr_elem; 824 struct ieee80211_msrment_ie msr_elem;
788 } __attribute__((packed)) measurement; 825 } __packed measurement;
789 struct{ 826 struct{
790 u8 action_code; 827 u8 action_code;
791 u8 dialog_token; 828 u8 dialog_token;
792 __le16 capab; 829 __le16 capab;
793 __le16 timeout; 830 __le16 timeout;
794 __le16 start_seq_num; 831 __le16 start_seq_num;
795 } __attribute__((packed)) addba_req; 832 } __packed addba_req;
796 struct{ 833 struct{
797 u8 action_code; 834 u8 action_code;
798 u8 dialog_token; 835 u8 dialog_token;
799 __le16 status; 836 __le16 status;
800 __le16 capab; 837 __le16 capab;
801 __le16 timeout; 838 __le16 timeout;
802 } __attribute__((packed)) addba_resp; 839 } __packed addba_resp;
803 struct{ 840 struct{
804 u8 action_code; 841 u8 action_code;
805 __le16 params; 842 __le16 params;
806 __le16 reason_code; 843 __le16 reason_code;
807 } __attribute__((packed)) delba; 844 } __packed delba;
808 struct { 845 struct {
809 u8 action_code; 846 u8 action_code;
810 u8 variable[0]; 847 u8 variable[0];
811 } __attribute__((packed)) self_prot; 848 } __packed self_prot;
812 struct{ 849 struct{
813 u8 action_code; 850 u8 action_code;
814 u8 variable[0]; 851 u8 variable[0];
815 } __attribute__((packed)) mesh_action; 852 } __packed mesh_action;
816 struct { 853 struct {
817 u8 action; 854 u8 action;
818 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; 855 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
819 } __attribute__ ((packed)) sa_query; 856 } __packed sa_query;
820 struct { 857 struct {
821 u8 action; 858 u8 action;
822 u8 smps_control; 859 u8 smps_control;
823 } __attribute__ ((packed)) ht_smps; 860 } __packed ht_smps;
861 struct {
862 u8 action_code;
863 u8 chanwidth;
864 } __packed ht_notify_cw;
824 struct { 865 struct {
825 u8 action_code; 866 u8 action_code;
826 u8 dialog_token; 867 u8 dialog_token;
827 __le16 capability; 868 __le16 capability;
828 u8 variable[0]; 869 u8 variable[0];
829 } __packed tdls_discover_resp; 870 } __packed tdls_discover_resp;
871 struct {
872 u8 action_code;
873 u8 operating_mode;
874 } __packed vht_opmode_notif;
830 } u; 875 } u;
831 } __attribute__ ((packed)) action; 876 } __packed action;
832 } u; 877 } u;
833} __attribute__ ((packed)); 878} __packed;
834 879
835/* Supported Rates value encodings in 802.11n-2009 7.3.2.2 */ 880/* Supported Rates value encodings in 802.11n-2009 7.3.2.2 */
836#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 881#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
@@ -846,7 +891,7 @@ struct ieee80211_mmie {
846 __le16 key_id; 891 __le16 key_id;
847 u8 sequence_number[6]; 892 u8 sequence_number[6];
848 u8 mic[8]; 893 u8 mic[8];
849} __attribute__ ((packed)); 894} __packed;
850 895
851struct ieee80211_vendor_ie { 896struct ieee80211_vendor_ie {
852 u8 element_id; 897 u8 element_id;
@@ -861,20 +906,20 @@ struct ieee80211_rts {
861 __le16 duration; 906 __le16 duration;
862 u8 ra[6]; 907 u8 ra[6];
863 u8 ta[6]; 908 u8 ta[6];
864} __attribute__ ((packed)); 909} __packed;
865 910
866struct ieee80211_cts { 911struct ieee80211_cts {
867 __le16 frame_control; 912 __le16 frame_control;
868 __le16 duration; 913 __le16 duration;
869 u8 ra[6]; 914 u8 ra[6];
870} __attribute__ ((packed)); 915} __packed;
871 916
872struct ieee80211_pspoll { 917struct ieee80211_pspoll {
873 __le16 frame_control; 918 __le16 frame_control;
874 __le16 aid; 919 __le16 aid;
875 u8 bssid[6]; 920 u8 bssid[6];
876 u8 ta[6]; 921 u8 ta[6];
877} __attribute__ ((packed)); 922} __packed;
878 923
879/* TDLS */ 924/* TDLS */
880 925
@@ -967,7 +1012,7 @@ struct ieee80211_bar {
967 __u8 ta[6]; 1012 __u8 ta[6];
968 __le16 control; 1013 __le16 control;
969 __le16 start_seq_num; 1014 __le16 start_seq_num;
970} __attribute__((packed)); 1015} __packed;
971 1016
972/* 802.11 BAR control masks */ 1017/* 802.11 BAR control masks */
973#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 1018#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000
@@ -992,7 +1037,7 @@ struct ieee80211_mcs_info {
992 __le16 rx_highest; 1037 __le16 rx_highest;
993 u8 tx_params; 1038 u8 tx_params;
994 u8 reserved[3]; 1039 u8 reserved[3];
995} __attribute__((packed)); 1040} __packed;
996 1041
997/* 802.11n HT capability MSC set */ 1042/* 802.11n HT capability MSC set */
998#define IEEE80211_HT_MCS_RX_HIGHEST_MASK 0x3ff 1043#define IEEE80211_HT_MCS_RX_HIGHEST_MASK 0x3ff
@@ -1031,7 +1076,7 @@ struct ieee80211_ht_cap {
1031 __le16 extended_ht_cap_info; 1076 __le16 extended_ht_cap_info;
1032 __le32 tx_BF_cap_info; 1077 __le32 tx_BF_cap_info;
1033 u8 antenna_selection_info; 1078 u8 antenna_selection_info;
1034} __attribute__ ((packed)); 1079} __packed;
1035 1080
1036/* 802.11n HT capabilities masks (for cap_info) */ 1081/* 802.11n HT capabilities masks (for cap_info) */
1037#define IEEE80211_HT_CAP_LDPC_CODING 0x0001 1082#define IEEE80211_HT_CAP_LDPC_CODING 0x0001
@@ -1102,7 +1147,7 @@ struct ieee80211_ht_operation {
1102 __le16 operation_mode; 1147 __le16 operation_mode;
1103 __le16 stbc_param; 1148 __le16 stbc_param;
1104 u8 basic_set[16]; 1149 u8 basic_set[16];
1105} __attribute__ ((packed)); 1150} __packed;
1106 1151
1107/* for ht_param */ 1152/* for ht_param */
1108#define IEEE80211_HT_PARAM_CHA_SEC_OFFSET 0x03 1153#define IEEE80211_HT_PARAM_CHA_SEC_OFFSET 0x03
@@ -1256,6 +1301,7 @@ struct ieee80211_vht_operation {
1256#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 1301#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
1257#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 1302#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
1258#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 1303#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
1304#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000C
1259#define IEEE80211_VHT_CAP_RXLDPC 0x00000010 1305#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
1260#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 1306#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
1261#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 1307#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
@@ -1311,16 +1357,21 @@ struct ieee80211_vht_operation {
1311#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) 1357#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
1312#define WLAN_CAPABILITY_QOS (1<<9) 1358#define WLAN_CAPABILITY_QOS (1<<9)
1313#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) 1359#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
1360#define WLAN_CAPABILITY_APSD (1<<11)
1361#define WLAN_CAPABILITY_RADIO_MEASURE (1<<12)
1314#define WLAN_CAPABILITY_DSSS_OFDM (1<<13) 1362#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
1363#define WLAN_CAPABILITY_DEL_BACK (1<<14)
1364#define WLAN_CAPABILITY_IMM_BACK (1<<15)
1315 1365
1316/* DMG (60gHz) 802.11ad */ 1366/* DMG (60gHz) 802.11ad */
1317/* type - bits 0..1 */ 1367/* type - bits 0..1 */
1368#define WLAN_CAPABILITY_DMG_TYPE_MASK (3<<0)
1318#define WLAN_CAPABILITY_DMG_TYPE_IBSS (1<<0) /* Tx by: STA */ 1369#define WLAN_CAPABILITY_DMG_TYPE_IBSS (1<<0) /* Tx by: STA */
1319#define WLAN_CAPABILITY_DMG_TYPE_PBSS (2<<0) /* Tx by: PCP */ 1370#define WLAN_CAPABILITY_DMG_TYPE_PBSS (2<<0) /* Tx by: PCP */
1320#define WLAN_CAPABILITY_DMG_TYPE_AP (3<<0) /* Tx by: AP */ 1371#define WLAN_CAPABILITY_DMG_TYPE_AP (3<<0) /* Tx by: AP */
1321 1372
1322#define WLAN_CAPABILITY_DMG_CBAP_ONLY (1<<2) 1373#define WLAN_CAPABILITY_DMG_CBAP_ONLY (1<<2)
1323#define WLAN_CAPABILITY_DMG_CBAP_SOURCE (1<<3) 1374#define WLAN_CAPABILITY_DMG_CBAP_SOURCE (1<<3)
1324#define WLAN_CAPABILITY_DMG_PRIVACY (1<<4) 1375#define WLAN_CAPABILITY_DMG_PRIVACY (1<<4)
1325#define WLAN_CAPABILITY_DMG_ECPAC (1<<5) 1376#define WLAN_CAPABILITY_DMG_ECPAC (1<<5)
1326 1377
@@ -1576,6 +1627,7 @@ enum ieee80211_eid {
1576 1627
1577 WLAN_EID_VHT_CAPABILITY = 191, 1628 WLAN_EID_VHT_CAPABILITY = 191,
1578 WLAN_EID_VHT_OPERATION = 192, 1629 WLAN_EID_VHT_OPERATION = 192,
1630 WLAN_EID_OPMODE_NOTIF = 199,
1579 1631
1580 /* 802.11ad */ 1632 /* 802.11ad */
1581 WLAN_EID_NON_TX_BSSID_CAP = 83, 1633 WLAN_EID_NON_TX_BSSID_CAP = 83,
@@ -1630,6 +1682,7 @@ enum ieee80211_category {
1630 WLAN_CATEGORY_WMM = 17, 1682 WLAN_CATEGORY_WMM = 17,
1631 WLAN_CATEGORY_FST = 18, 1683 WLAN_CATEGORY_FST = 18,
1632 WLAN_CATEGORY_UNPROT_DMG = 20, 1684 WLAN_CATEGORY_UNPROT_DMG = 20,
1685 WLAN_CATEGORY_VHT = 21,
1633 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, 1686 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
1634 WLAN_CATEGORY_VENDOR_SPECIFIC = 127, 1687 WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
1635}; 1688};
@@ -1655,6 +1708,13 @@ enum ieee80211_ht_actioncode {
1655 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, 1708 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7,
1656}; 1709};
1657 1710
1711/* VHT action codes */
1712enum ieee80211_vht_actioncode {
1713 WLAN_VHT_ACTION_COMPRESSED_BF = 0,
1714 WLAN_VHT_ACTION_GROUPID_MGMT = 1,
1715 WLAN_VHT_ACTION_OPMODE_NOTIF = 2,
1716};
1717
1658/* Self Protected Action codes */ 1718/* Self Protected Action codes */
1659enum ieee80211_self_protected_actioncode { 1719enum ieee80211_self_protected_actioncode {
1660 WLAN_SP_RESERVED = 0, 1720 WLAN_SP_RESERVED = 0,
@@ -1716,6 +1776,8 @@ enum ieee80211_tdls_actioncode {
1716#define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5) 1776#define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5)
1717#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) 1777#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
1718 1778
1779#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6)
1780
1719/* TDLS specific payload type in the LLC/SNAP header */ 1781/* TDLS specific payload type in the LLC/SNAP header */
1720#define WLAN_TDLS_SNAP_RFTYPE 0x2 1782#define WLAN_TDLS_SNAP_RFTYPE 0x2
1721 1783
@@ -1834,14 +1896,14 @@ struct ieee80211_country_ie_triplet {
1834 u8 first_channel; 1896 u8 first_channel;
1835 u8 num_channels; 1897 u8 num_channels;
1836 s8 max_power; 1898 s8 max_power;
1837 } __attribute__ ((packed)) chans; 1899 } __packed chans;
1838 struct { 1900 struct {
1839 u8 reg_extension_id; 1901 u8 reg_extension_id;
1840 u8 reg_class; 1902 u8 reg_class;
1841 u8 coverage_class; 1903 u8 coverage_class;
1842 } __attribute__ ((packed)) ext; 1904 } __packed ext;
1843 }; 1905 };
1844} __attribute__ ((packed)); 1906} __packed;
1845 1907
1846enum ieee80211_timeout_interval_type { 1908enum ieee80211_timeout_interval_type {
1847 WLAN_TIMEOUT_REASSOC_DEADLINE = 1 /* 802.11r */, 1909 WLAN_TIMEOUT_REASSOC_DEADLINE = 1 /* 802.11r */,
@@ -1884,7 +1946,10 @@ enum ieee80211_sa_query_action {
1884/* AKM suite selectors */ 1946/* AKM suite selectors */
1885#define WLAN_AKM_SUITE_8021X 0x000FAC01 1947#define WLAN_AKM_SUITE_8021X 0x000FAC01
1886#define WLAN_AKM_SUITE_PSK 0x000FAC02 1948#define WLAN_AKM_SUITE_PSK 0x000FAC02
1887#define WLAN_AKM_SUITE_SAE 0x000FAC08 1949#define WLAN_AKM_SUITE_8021X_SHA256 0x000FAC05
1950#define WLAN_AKM_SUITE_PSK_SHA256 0x000FAC06
1951#define WLAN_AKM_SUITE_TDLS 0x000FAC07
1952#define WLAN_AKM_SUITE_SAE 0x000FAC08
1888#define WLAN_AKM_SUITE_FT_OVER_SAE 0x000FAC09 1953#define WLAN_AKM_SUITE_FT_OVER_SAE 0x000FAC09
1889 1954
1890#define WLAN_MAX_KEY_LEN 32 1955#define WLAN_MAX_KEY_LEN 32
@@ -2089,7 +2154,7 @@ static inline unsigned long ieee80211_tu_to_usec(unsigned long tu)
2089 * @tim_len: length of the TIM IE 2154 * @tim_len: length of the TIM IE
2090 * @aid: the AID to look for 2155 * @aid: the AID to look for
2091 */ 2156 */
2092static inline bool ieee80211_check_tim(struct ieee80211_tim_ie *tim, 2157static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
2093 u8 tim_len, u16 aid) 2158 u8 tim_len, u16 aid)
2094{ 2159{
2095 u8 mask; 2160 u8 mask;
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index f65e8d250f7e..84dde1dd1da4 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -52,6 +52,9 @@ struct macvlan_pcpu_stats {
52 */ 52 */
53#define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16) 53#define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16)
54 54
55#define MACVLAN_MC_FILTER_BITS 8
56#define MACVLAN_MC_FILTER_SZ (1 << MACVLAN_MC_FILTER_BITS)
57
55struct macvlan_dev { 58struct macvlan_dev {
56 struct net_device *dev; 59 struct net_device *dev;
57 struct list_head list; 60 struct list_head list;
@@ -59,6 +62,9 @@ struct macvlan_dev {
59 struct macvlan_port *port; 62 struct macvlan_port *port;
60 struct net_device *lowerdev; 63 struct net_device *lowerdev;
61 struct macvlan_pcpu_stats __percpu *pcpu_stats; 64 struct macvlan_pcpu_stats __percpu *pcpu_stats;
65
66 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ);
67
62 enum macvlan_mode mode; 68 enum macvlan_mode mode;
63 u16 flags; 69 u16 flags;
64 int (*receive)(struct sk_buff *skb); 70 int (*receive)(struct sk_buff *skb);
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 0245def2aa93..4648d8021244 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -186,6 +186,7 @@ struct team {
186 186
187 const struct team_mode *mode; 187 const struct team_mode *mode;
188 struct team_mode_ops ops; 188 struct team_mode_ops ops;
189 bool user_carrier_enabled;
189 bool queue_override_enabled; 190 bool queue_override_enabled;
190 struct list_head *qom_lists; /* array of queue override mapping lists */ 191 struct list_head *qom_lists; /* array of queue override mapping lists */
191 long mode_priv[TEAM_MODE_PRIV_LONGS]; 192 long mode_priv[TEAM_MODE_PRIV_LONGS];
diff --git a/include/linux/in6.h b/include/linux/in6.h
index 9e2ae26fb598..34edf1f6c9a3 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -22,6 +22,10 @@
22 22
23#include <uapi/linux/in6.h> 23#include <uapi/linux/in6.h>
24 24
25/* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
26 * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
27 * in network byte order, not in host byte order as are the IPv4 equivalents
28 */
25extern const struct in6_addr in6addr_any; 29extern const struct in6_addr in6addr_any;
26#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } 30#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
27extern const struct in6_addr in6addr_loopback; 31extern const struct in6_addr in6addr_loopback;
@@ -32,4 +36,13 @@ extern const struct in6_addr in6addr_linklocal_allnodes;
32extern const struct in6_addr in6addr_linklocal_allrouters; 36extern const struct in6_addr in6addr_linklocal_allrouters;
33#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ 37#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
34 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } 38 { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
39extern const struct in6_addr in6addr_interfacelocal_allnodes;
40#define IN6ADDR_INTERFACELOCAL_ALLNODES_INIT \
41 { { { 0xff,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
42extern const struct in6_addr in6addr_interfacelocal_allrouters;
43#define IN6ADDR_INTERFACELOCAL_ALLROUTERS_INIT \
44 { { { 0xff,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
45extern const struct in6_addr in6addr_sitelocal_allrouters;
46#define IN6ADDR_SITELOCAL_ALLROUTERS_INIT \
47 { { { 0xff,5,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } }
35#endif 48#endif
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index a9d828976a77..ea1e3b863890 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -166,6 +166,12 @@ struct in_ifaddr {
166 unsigned char ifa_flags; 166 unsigned char ifa_flags;
167 unsigned char ifa_prefixlen; 167 unsigned char ifa_prefixlen;
168 char ifa_label[IFNAMSIZ]; 168 char ifa_label[IFNAMSIZ];
169
170 /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */
171 __u32 ifa_valid_lft;
172 __u32 ifa_preferred_lft;
173 unsigned long ifa_cstamp; /* created timestamp */
174 unsigned long ifa_tstamp; /* updated timestamp */
169}; 175};
170 176
171extern int register_inetaddr_notifier(struct notifier_block *nb); 177extern int register_inetaddr_notifier(struct notifier_block *nb);
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index faed1e357dd6..850e95bc766c 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -77,11 +77,6 @@ static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
77 return (struct ipv6hdr *)skb_transport_header(skb); 77 return (struct ipv6hdr *)skb_transport_header(skb);
78} 78}
79 79
80static inline __u8 ipv6_tclass(const struct ipv6hdr *iph)
81{
82 return (ntohl(*(__be32 *)iph) >> 20) & 0xff;
83}
84
85/* 80/*
86 This structure contains results of exthdrs parsing 81 This structure contains results of exthdrs parsing
87 as offsets from skb->nh. 82 as offsets from skb->nh.
@@ -89,7 +84,7 @@ static inline __u8 ipv6_tclass(const struct ipv6hdr *iph)
89 84
90struct inet6_skb_parm { 85struct inet6_skb_parm {
91 int iif; 86 int iif;
92 __u16 ra; 87 __be16 ra;
93 __u16 hop; 88 __u16 hop;
94 __u16 dst0; 89 __u16 dst0;
95 __u16 srcrt; 90 __u16 srcrt;
@@ -105,6 +100,7 @@ struct inet6_skb_parm {
105#define IP6SKB_XFRM_TRANSFORMED 1 100#define IP6SKB_XFRM_TRANSFORMED 1
106#define IP6SKB_FORWARDED 2 101#define IP6SKB_FORWARDED 2
107#define IP6SKB_REROUTED 4 102#define IP6SKB_REROUTED 4
103#define IP6SKB_ROUTERALERT 8
108}; 104};
109 105
110#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) 106#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
@@ -218,7 +214,7 @@ struct ipv6_pinfo {
218 214
219 struct ipv6_mc_socklist __rcu *ipv6_mc_list; 215 struct ipv6_mc_socklist __rcu *ipv6_mc_list;
220 struct ipv6_ac_socklist *ipv6_ac_list; 216 struct ipv6_ac_socklist *ipv6_ac_list;
221 struct ipv6_fl_socklist *ipv6_fl_list; 217 struct ipv6_fl_socklist __rcu *ipv6_fl_list;
222 218
223 struct ipv6_txoptions *opt; 219 struct ipv6_txoptions *opt;
224 struct sk_buff *pktoptions; 220 struct sk_buff *pktoptions;
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index adfe8c058f29..9dbb41a4e250 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -21,8 +21,15 @@
21#define PHY_ID_KSZ8021 0x00221555 21#define PHY_ID_KSZ8021 0x00221555
22#define PHY_ID_KSZ8041 0x00221510 22#define PHY_ID_KSZ8041 0x00221510
23#define PHY_ID_KSZ8051 0x00221550 23#define PHY_ID_KSZ8051 0x00221550
24/* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */ 24/* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */
25#define PHY_ID_KSZ8001 0x0022161A 25#define PHY_ID_KSZ8001 0x0022161A
26/* same id: KS8081, KS8091 */
27#define PHY_ID_KSZ8081 0x00221560
28#define PHY_ID_KSZ8061 0x00221570
29#define PHY_ID_KSZ9031 0x00221620
30
31#define PHY_ID_KSZ886X 0x00221430
32#define PHY_ID_KSZ8863 0x00221435
26 33
27/* struct phy_device dev_flags definitions */ 34/* struct phy_device dev_flags definitions */
28#define MICREL_PHY_50MHZ_CLK 0x00000001 35#define MICREL_PHY_50MHZ_CLK 0x00000001
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 20ea939c22a6..6d48fce06b4a 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -150,7 +150,8 @@ enum {
150 MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0, 150 MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0,
151 MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, 151 MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1,
152 MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2, 152 MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2,
153 MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3 153 MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3,
154 MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN = 1LL << 4
154}; 155};
155 156
156enum { 157enum {
@@ -955,9 +956,8 @@ int mlx4_SET_MCAST_FLTR(struct mlx4_dev *dev, u8 port, u64 mac, u64 clear, u8 mo
955 956
956int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac); 957int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac);
957void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); 958void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac);
958int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); 959int mlx4_get_base_qpn(struct mlx4_dev *dev, u8 port);
959int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn); 960int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac);
960void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn);
961void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap); 961void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap);
962int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, 962int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
963 u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx); 963 u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx);
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index ea00d9162ee5..79aaa9fc1a15 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -9,7 +9,7 @@
9#ifdef CONFIG_IP_MROUTE 9#ifdef CONFIG_IP_MROUTE
10static inline int ip_mroute_opt(int opt) 10static inline int ip_mroute_opt(int opt)
11{ 11{
12 return (opt >= MRT_BASE) && (opt <= MRT_BASE + 10); 12 return (opt >= MRT_BASE) && (opt <= MRT_MAX);
13} 13}
14#else 14#else
15static inline int ip_mroute_opt(int opt) 15static inline int ip_mroute_opt(int opt)
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index a223561ba12e..66982e764051 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -10,7 +10,7 @@
10#ifdef CONFIG_IPV6_MROUTE 10#ifdef CONFIG_IPV6_MROUTE
11static inline int ip6_mroute_opt(int opt) 11static inline int ip6_mroute_opt(int opt)
12{ 12{
13 return (opt >= MRT6_BASE) && (opt <= MRT6_BASE + 10); 13 return (opt >= MRT6_BASE) && (opt <= MRT6_MAX);
14} 14}
15#else 15#else
16static inline int ip6_mroute_opt(int opt) 16static inline int ip6_mroute_opt(int opt)
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 5ac32123035a..3dd39340430e 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -41,7 +41,7 @@ enum {
41 NETIF_F_TSO_ECN_BIT, /* ... TCP ECN support */ 41 NETIF_F_TSO_ECN_BIT, /* ... TCP ECN support */
42 NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ 42 NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */
43 NETIF_F_FSO_BIT, /* ... FCoE segmentation */ 43 NETIF_F_FSO_BIT, /* ... FCoE segmentation */
44 NETIF_F_GSO_RESERVED1, /* ... free (fill GSO_MASK to 8 bits) */ 44 NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */
45 /**/NETIF_F_GSO_LAST, /* [can't be last bit, see GSO_MASK] */ 45 /**/NETIF_F_GSO_LAST, /* [can't be last bit, see GSO_MASK] */
46 NETIF_F_GSO_RESERVED2 /* ... free (fill GSO_MASK to 8 bits) */ 46 NETIF_F_GSO_RESERVED2 /* ... free (fill GSO_MASK to 8 bits) */
47 = NETIF_F_GSO_LAST, 47 = NETIF_F_GSO_LAST,
@@ -102,6 +102,7 @@ enum {
102#define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED) 102#define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED)
103#define NETIF_F_RXFCS __NETIF_F(RXFCS) 103#define NETIF_F_RXFCS __NETIF_F(RXFCS)
104#define NETIF_F_RXALL __NETIF_F(RXALL) 104#define NETIF_F_RXALL __NETIF_F(RXALL)
105#define NETIF_F_GRE_GSO __NETIF_F(GSO_GRE)
105 106
106/* Features valid for ethtool to change */ 107/* Features valid for ethtool to change */
107/* = all defined minus driver/device-class-related */ 108/* = all defined minus driver/device-class-related */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9ef07d0868b6..b3d00fa4b314 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -67,6 +67,8 @@ extern void netdev_set_default_ethtool_ops(struct net_device *dev,
67#define NET_ADDR_PERM 0 /* address is permanent (default) */ 67#define NET_ADDR_PERM 0 /* address is permanent (default) */
68#define NET_ADDR_RANDOM 1 /* address is generated randomly */ 68#define NET_ADDR_RANDOM 1 /* address is generated randomly */
69#define NET_ADDR_STOLEN 2 /* address is stolen from other device */ 69#define NET_ADDR_STOLEN 2 /* address is stolen from other device */
70#define NET_ADDR_SET 3 /* address is set using
71 * dev_set_mac_address() */
70 72
71/* Backlog congestion levels */ 73/* Backlog congestion levels */
72#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ 74#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
@@ -859,8 +861,7 @@ struct netdev_fcoe_hbainfo {
859 * flow_id is a flow ID to be passed to rps_may_expire_flow() later. 861 * flow_id is a flow ID to be passed to rps_may_expire_flow() later.
860 * Return the filter ID on success, or a negative error code. 862 * Return the filter ID on success, or a negative error code.
861 * 863 *
862 * Slave management functions (for bridge, bonding, etc). User should 864 * Slave management functions (for bridge, bonding, etc).
863 * call netdev_set_master() to set dev->master properly.
864 * int (*ndo_add_slave)(struct net_device *dev, struct net_device *slave_dev); 865 * int (*ndo_add_slave)(struct net_device *dev, struct net_device *slave_dev);
865 * Called to make another netdev an underling. 866 * Called to make another netdev an underling.
866 * 867 *
@@ -883,7 +884,8 @@ struct netdev_fcoe_hbainfo {
883 * struct net_device *dev, 884 * struct net_device *dev,
884 * const unsigned char *addr, u16 flags) 885 * const unsigned char *addr, u16 flags)
885 * Adds an FDB entry to dev for addr. 886 * Adds an FDB entry to dev for addr.
886 * int (*ndo_fdb_del)(struct ndmsg *ndm, struct net_device *dev, 887 * int (*ndo_fdb_del)(struct ndmsg *ndm, struct nlattr *tb[],
888 * struct net_device *dev,
887 * const unsigned char *addr) 889 * const unsigned char *addr)
888 * Deletes the FDB entry from dev coresponding to addr. 890 * Deletes the FDB entry from dev coresponding to addr.
889 * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, 891 * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb,
@@ -894,6 +896,14 @@ struct netdev_fcoe_hbainfo {
894 * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh) 896 * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh)
895 * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, 897 * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq,
896 * struct net_device *dev) 898 * struct net_device *dev)
899 *
900 * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier);
901 * Called to change device carrier. Soft-devices (like dummy, team, etc)
902 * which do not represent real hardware may define this to allow their
903 * userspace components to manage their virtual carrier state. Devices
904 * that determine carrier state from physical hardware properties (eg
905 * network cables) or protocol-dependent mechanisms (eg
906 * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function.
897 */ 907 */
898struct net_device_ops { 908struct net_device_ops {
899 int (*ndo_init)(struct net_device *dev); 909 int (*ndo_init)(struct net_device *dev);
@@ -999,6 +1009,7 @@ struct net_device_ops {
999 const unsigned char *addr, 1009 const unsigned char *addr,
1000 u16 flags); 1010 u16 flags);
1001 int (*ndo_fdb_del)(struct ndmsg *ndm, 1011 int (*ndo_fdb_del)(struct ndmsg *ndm,
1012 struct nlattr *tb[],
1002 struct net_device *dev, 1013 struct net_device *dev,
1003 const unsigned char *addr); 1014 const unsigned char *addr);
1004 int (*ndo_fdb_dump)(struct sk_buff *skb, 1015 int (*ndo_fdb_dump)(struct sk_buff *skb,
@@ -1010,7 +1021,12 @@ struct net_device_ops {
1010 struct nlmsghdr *nlh); 1021 struct nlmsghdr *nlh);
1011 int (*ndo_bridge_getlink)(struct sk_buff *skb, 1022 int (*ndo_bridge_getlink)(struct sk_buff *skb,
1012 u32 pid, u32 seq, 1023 u32 pid, u32 seq,
1013 struct net_device *dev); 1024 struct net_device *dev,
1025 u32 filter_mask);
1026 int (*ndo_bridge_dellink)(struct net_device *dev,
1027 struct nlmsghdr *nlh);
1028 int (*ndo_change_carrier)(struct net_device *dev,
1029 bool new_carrier);
1014}; 1030};
1015 1031
1016/* 1032/*
@@ -1161,9 +1177,7 @@ struct net_device {
1161 * avoid dirtying this cache line. 1177 * avoid dirtying this cache line.
1162 */ 1178 */
1163 1179
1164 struct net_device *master; /* Pointer to master device of a group, 1180 struct list_head upper_dev_list; /* List of upper devices */
1165 * which this device is member of.
1166 */
1167 1181
1168 /* Interface address info used in eth_type_trans() */ 1182 /* Interface address info used in eth_type_trans() */
1169 unsigned char *dev_addr; /* hw address, (before bcast 1183 unsigned char *dev_addr; /* hw address, (before bcast
@@ -1263,7 +1277,7 @@ struct net_device {
1263 void (*destructor)(struct net_device *dev); 1277 void (*destructor)(struct net_device *dev);
1264 1278
1265#ifdef CONFIG_NETPOLL 1279#ifdef CONFIG_NETPOLL
1266 struct netpoll_info *npinfo; 1280 struct netpoll_info __rcu *npinfo;
1267#endif 1281#endif
1268 1282
1269#ifdef CONFIG_NET_NS 1283#ifdef CONFIG_NET_NS
@@ -1277,9 +1291,12 @@ struct net_device {
1277 struct pcpu_lstats __percpu *lstats; /* loopback stats */ 1291 struct pcpu_lstats __percpu *lstats; /* loopback stats */
1278 struct pcpu_tstats __percpu *tstats; /* tunnel stats */ 1292 struct pcpu_tstats __percpu *tstats; /* tunnel stats */
1279 struct pcpu_dstats __percpu *dstats; /* dummy stats */ 1293 struct pcpu_dstats __percpu *dstats; /* dummy stats */
1294 struct pcpu_vstats __percpu *vstats; /* veth stats */
1280 }; 1295 };
1281 /* GARP */ 1296 /* GARP */
1282 struct garp_port __rcu *garp_port; 1297 struct garp_port __rcu *garp_port;
1298 /* MRP */
1299 struct mrp_port __rcu *mrp_port;
1283 1300
1284 /* class/net/name entry */ 1301 /* class/net/name entry */
1285 struct device dev; 1302 struct device dev;
@@ -1396,6 +1413,7 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev,
1396 1413
1397extern struct netdev_queue *netdev_pick_tx(struct net_device *dev, 1414extern struct netdev_queue *netdev_pick_tx(struct net_device *dev,
1398 struct sk_buff *skb); 1415 struct sk_buff *skb);
1416extern u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb);
1399 1417
1400/* 1418/*
1401 * Net namespace inlines 1419 * Net namespace inlines
@@ -2095,6 +2113,18 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
2095 __netif_schedule(txq->qdisc); 2113 __netif_schedule(txq->qdisc);
2096} 2114}
2097 2115
2116#ifdef CONFIG_XPS
2117extern int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask,
2118 u16 index);
2119#else
2120static inline int netif_set_xps_queue(struct net_device *dev,
2121 struct cpumask *mask,
2122 u16 index)
2123{
2124 return 0;
2125}
2126#endif
2127
2098/* 2128/*
2099 * Returns a Tx hash for the given packet when dev->real_num_tx_queues is used 2129 * Returns a Tx hash for the given packet when dev->real_num_tx_queues is used
2100 * as a distribution range limit for the returned value. 2130 * as a distribution range limit for the returned value.
@@ -2197,6 +2227,8 @@ extern int dev_set_mtu(struct net_device *, int);
2197extern void dev_set_group(struct net_device *, int); 2227extern void dev_set_group(struct net_device *, int);
2198extern int dev_set_mac_address(struct net_device *, 2228extern int dev_set_mac_address(struct net_device *,
2199 struct sockaddr *); 2229 struct sockaddr *);
2230extern int dev_change_carrier(struct net_device *,
2231 bool new_carrier);
2200extern int dev_hard_start_xmit(struct sk_buff *skb, 2232extern int dev_hard_start_xmit(struct sk_buff *skb,
2201 struct net_device *dev, 2233 struct net_device *dev,
2202 struct netdev_queue *txq); 2234 struct netdev_queue *txq);
@@ -2614,7 +2646,6 @@ extern void netdev_notify_peers(struct net_device *dev);
2614extern void netdev_features_change(struct net_device *dev); 2646extern void netdev_features_change(struct net_device *dev);
2615/* Load a device via the kmod */ 2647/* Load a device via the kmod */
2616extern void dev_load(struct net *net, const char *name); 2648extern void dev_load(struct net *net, const char *name);
2617extern void dev_mcast_init(void);
2618extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, 2649extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
2619 struct rtnl_link_stats64 *storage); 2650 struct rtnl_link_stats64 *storage);
2620extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64, 2651extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
@@ -2624,12 +2655,30 @@ extern int netdev_max_backlog;
2624extern int netdev_tstamp_prequeue; 2655extern int netdev_tstamp_prequeue;
2625extern int weight_p; 2656extern int weight_p;
2626extern int bpf_jit_enable; 2657extern int bpf_jit_enable;
2627extern int netdev_set_master(struct net_device *dev, struct net_device *master); 2658
2628extern int netdev_set_bond_master(struct net_device *dev, 2659extern bool netdev_has_upper_dev(struct net_device *dev,
2629 struct net_device *master); 2660 struct net_device *upper_dev);
2661extern bool netdev_has_any_upper_dev(struct net_device *dev);
2662extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2663extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2664extern int netdev_upper_dev_link(struct net_device *dev,
2665 struct net_device *upper_dev);
2666extern int netdev_master_upper_dev_link(struct net_device *dev,
2667 struct net_device *upper_dev);
2668extern void netdev_upper_dev_unlink(struct net_device *dev,
2669 struct net_device *upper_dev);
2630extern int skb_checksum_help(struct sk_buff *skb); 2670extern int skb_checksum_help(struct sk_buff *skb);
2631extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, 2671extern struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
2632 netdev_features_t features); 2672 netdev_features_t features, bool tx_path);
2673extern struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
2674 netdev_features_t features);
2675
2676static inline
2677struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features)
2678{
2679 return __skb_gso_segment(skb, features, true);
2680}
2681
2633#ifdef CONFIG_BUG 2682#ifdef CONFIG_BUG
2634extern void netdev_rx_csum_fault(struct net_device *dev); 2683extern void netdev_rx_csum_fault(struct net_device *dev);
2635#else 2684#else
@@ -2642,9 +2691,9 @@ extern void net_enable_timestamp(void);
2642extern void net_disable_timestamp(void); 2691extern void net_disable_timestamp(void);
2643 2692
2644#ifdef CONFIG_PROC_FS 2693#ifdef CONFIG_PROC_FS
2645extern void *dev_seq_start(struct seq_file *seq, loff_t *pos); 2694extern int __init dev_proc_init(void);
2646extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); 2695#else
2647extern void dev_seq_stop(struct seq_file *seq, void *v); 2696#define dev_proc_init() 0
2648#endif 2697#endif
2649 2698
2650extern int netdev_class_create_file(struct class_attribute *class_attr); 2699extern int netdev_class_create_file(struct class_attribute *class_attr);
@@ -2846,4 +2895,34 @@ do { \
2846}) 2895})
2847#endif 2896#endif
2848 2897
2898/*
2899 * The list of packet types we will receive (as opposed to discard)
2900 * and the routines to invoke.
2901 *
2902 * Why 16. Because with 16 the only overlap we get on a hash of the
2903 * low nibble of the protocol value is RARP/SNAP/X.25.
2904 *
2905 * NOTE: That is no longer true with the addition of VLAN tags. Not
2906 * sure which should go first, but I bet it won't make much
2907 * difference if we are running VLANs. The good news is that
2908 * this protocol won't be in the list unless compiled in, so
2909 * the average user (w/out VLANs) will not be adversely affected.
2910 * --BLG
2911 *
2912 * 0800 IP
2913 * 8100 802.1Q VLAN
2914 * 0001 802.3
2915 * 0002 AX.25
2916 * 0004 802.2
2917 * 8035 RARP
2918 * 0005 SNAP
2919 * 0805 X.25
2920 * 0806 ARP
2921 * 8137 IPX
2922 * 0009 Localtalk
2923 * 86DD IPv6
2924 */
2925#define PTYPE_HASH_SIZE (16)
2926#define PTYPE_HASH_MASK (PTYPE_HASH_SIZE - 1)
2927
2849#endif /* _LINUX_NETDEVICE_H */ 2928#endif /* _LINUX_NETDEVICE_H */
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index 387bdd02945d..ba7f571a2b1c 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -4,12 +4,15 @@
4 4
5#include <net/netfilter/nf_conntrack_expect.h> 5#include <net/netfilter/nf_conntrack_expect.h>
6 6
7#include <linux/types.h>
8
7#define SIP_PORT 5060 9#define SIP_PORT 5060
8#define SIP_TIMEOUT 3600 10#define SIP_TIMEOUT 3600
9 11
10struct nf_ct_sip_master { 12struct nf_ct_sip_master {
11 unsigned int register_cseq; 13 unsigned int register_cseq;
12 unsigned int invite_cseq; 14 unsigned int invite_cseq;
15 __be16 forced_dport;
13}; 16};
14 17
15enum sip_expectation_classes { 18enum sip_expectation_classes {
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 4966ddec039b..ecbb8e495912 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -34,8 +34,8 @@ extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigne
34extern int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); 34extern int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error);
35extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); 35extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags);
36 36
37extern void nfnl_lock(void); 37extern void nfnl_lock(__u8 subsys_id);
38extern void nfnl_unlock(void); 38extern void nfnl_unlock(__u8 subsys_id);
39 39
40#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ 40#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
41 MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) 41 MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 66d5379c305e..9d7d8c64f7c8 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -12,28 +12,38 @@
12#include <linux/rcupdate.h> 12#include <linux/rcupdate.h>
13#include <linux/list.h> 13#include <linux/list.h>
14 14
15union inet_addr {
16 __u32 all[4];
17 __be32 ip;
18 __be32 ip6[4];
19 struct in_addr in;
20 struct in6_addr in6;
21};
22
15struct netpoll { 23struct netpoll {
16 struct net_device *dev; 24 struct net_device *dev;
17 char dev_name[IFNAMSIZ]; 25 char dev_name[IFNAMSIZ];
18 const char *name; 26 const char *name;
19 void (*rx_hook)(struct netpoll *, int, char *, int); 27 void (*rx_hook)(struct netpoll *, int, char *, int);
20 28
21 __be32 local_ip, remote_ip; 29 union inet_addr local_ip, remote_ip;
30 bool ipv6;
22 u16 local_port, remote_port; 31 u16 local_port, remote_port;
23 u8 remote_mac[ETH_ALEN]; 32 u8 remote_mac[ETH_ALEN];
24 33
25 struct list_head rx; /* rx_np list element */ 34 struct list_head rx; /* rx_np list element */
26 struct rcu_head rcu; 35 struct work_struct cleanup_work;
27}; 36};
28 37
29struct netpoll_info { 38struct netpoll_info {
30 atomic_t refcnt; 39 atomic_t refcnt;
31 40
32 int rx_flags; 41 unsigned long rx_flags;
33 spinlock_t rx_lock; 42 spinlock_t rx_lock;
43 struct mutex dev_lock;
34 struct list_head rx_np; /* netpolls that registered an rx_hook */ 44 struct list_head rx_np; /* netpolls that registered an rx_hook */
35 45
36 struct sk_buff_head arp_tx; /* list of arp requests to reply to */ 46 struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */
37 struct sk_buff_head txq; 47 struct sk_buff_head txq;
38 48
39 struct delayed_work tx_work; 49 struct delayed_work tx_work;
@@ -42,6 +52,14 @@ struct netpoll_info {
42 struct rcu_head rcu; 52 struct rcu_head rcu;
43}; 53};
44 54
55#ifdef CONFIG_NETPOLL
56extern int netpoll_rx_disable(struct net_device *dev);
57extern void netpoll_rx_enable(struct net_device *dev);
58#else
59static inline int netpoll_rx_disable(struct net_device *dev) { return 0; }
60static inline void netpoll_rx_enable(struct net_device *dev) { return; }
61#endif
62
45void netpoll_send_udp(struct netpoll *np, const char *msg, int len); 63void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
46void netpoll_print_options(struct netpoll *np); 64void netpoll_print_options(struct netpoll *np);
47int netpoll_parse_options(struct netpoll *np, char *opt); 65int netpoll_parse_options(struct netpoll *np, char *opt);
@@ -50,7 +68,7 @@ int netpoll_setup(struct netpoll *np);
50int netpoll_trap(void); 68int netpoll_trap(void);
51void netpoll_set_trap(int trap); 69void netpoll_set_trap(int trap);
52void __netpoll_cleanup(struct netpoll *np); 70void __netpoll_cleanup(struct netpoll *np);
53void __netpoll_free_rcu(struct netpoll *np); 71void __netpoll_free_async(struct netpoll *np);
54void netpoll_cleanup(struct netpoll *np); 72void netpoll_cleanup(struct netpoll *np);
55int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo); 73int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo);
56void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, 74void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 0eb65796bcb9..907e7e56fa4b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2127,6 +2127,7 @@
2127#define PCI_DEVICE_ID_TIGON3_5754M 0x1672 2127#define PCI_DEVICE_ID_TIGON3_5754M 0x1672
2128#define PCI_DEVICE_ID_TIGON3_5755M 0x1673 2128#define PCI_DEVICE_ID_TIGON3_5755M 0x1673
2129#define PCI_DEVICE_ID_TIGON3_5756 0x1674 2129#define PCI_DEVICE_ID_TIGON3_5756 0x1674
2130#define PCI_DEVICE_ID_TIGON3_5750 0x1676
2130#define PCI_DEVICE_ID_TIGON3_5751 0x1677 2131#define PCI_DEVICE_ID_TIGON3_5751 0x1677
2131#define PCI_DEVICE_ID_TIGON3_5715 0x1678 2132#define PCI_DEVICE_ID_TIGON3_5715 0x1678
2132#define PCI_DEVICE_ID_TIGON3_5715S 0x1679 2133#define PCI_DEVICE_ID_TIGON3_5715S 0x1679
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 93b3cf77f564..33999adbf8c8 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -506,13 +506,13 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
506int phy_device_register(struct phy_device *phy); 506int phy_device_register(struct phy_device *phy);
507int phy_init_hw(struct phy_device *phydev); 507int phy_init_hw(struct phy_device *phydev);
508struct phy_device * phy_attach(struct net_device *dev, 508struct phy_device * phy_attach(struct net_device *dev,
509 const char *bus_id, u32 flags, phy_interface_t interface); 509 const char *bus_id, phy_interface_t interface);
510struct phy_device *phy_find_first(struct mii_bus *bus); 510struct phy_device *phy_find_first(struct mii_bus *bus);
511int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, 511int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
512 void (*handler)(struct net_device *), u32 flags, 512 void (*handler)(struct net_device *),
513 phy_interface_t interface); 513 phy_interface_t interface);
514struct phy_device * phy_connect(struct net_device *dev, const char *bus_id, 514struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
515 void (*handler)(struct net_device *), u32 flags, 515 void (*handler)(struct net_device *),
516 phy_interface_t interface); 516 phy_interface_t interface);
517void phy_disconnect(struct phy_device *phydev); 517void phy_disconnect(struct phy_device *phydev);
518void phy_detach(struct phy_device *phydev); 518void phy_detach(struct phy_device *phydev);
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h
index 24368a2e8b87..798fb80b024b 100644
--- a/include/linux/platform_data/cpsw.h
+++ b/include/linux/platform_data/cpsw.h
@@ -21,6 +21,8 @@ struct cpsw_slave_data {
21 char phy_id[MII_BUS_ID_SIZE]; 21 char phy_id[MII_BUS_ID_SIZE];
22 int phy_if; 22 int phy_if;
23 u8 mac_addr[ETH_ALEN]; 23 u8 mac_addr[ETH_ALEN];
24 u16 dual_emac_res_vlan; /* Reserved VLAN for DualEMAC */
25
24}; 26};
25 27
26struct cpsw_platform_data { 28struct cpsw_platform_data {
@@ -35,6 +37,8 @@ struct cpsw_platform_data {
35 u32 bd_ram_size; /*buffer descriptor ram size */ 37 u32 bd_ram_size; /*buffer descriptor ram size */
36 u32 rx_descs; /* Number of Rx Descriptios */ 38 u32 rx_descs; /* Number of Rx Descriptios */
37 u32 mac_control; /* Mac control register */ 39 u32 mac_control; /* Mac control register */
40 u16 default_vlan; /* Def VLAN for ALE lookup in VLAN aware mode*/
41 bool dual_emac; /* Enable Dual EMAC mode */
38}; 42};
39 43
40#endif /* __CPSW_H__ */ 44#endif /* __CPSW_H__ */
diff --git a/include/linux/platform_data/microread.h b/include/linux/platform_data/microread.h
new file mode 100644
index 000000000000..cfda59b226ee
--- /dev/null
+++ b/include/linux/platform_data/microread.h
@@ -0,0 +1,35 @@
1/*
2 * Driver include for the PN544 NFC chip.
3 *
4 * Copyright (C) 2011 Tieto Poland
5 * Copyright (C) 2012 Intel Corporation. All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _MICROREAD_H
22#define _MICROREAD_H
23
24#include <linux/i2c.h>
25
26#define MICROREAD_DRIVER_NAME "microread"
27
28/* board config platform data for microread */
29struct microread_nfc_platform_data {
30 unsigned int rst_gpio;
31 unsigned int irq_gpio;
32 unsigned int ioh_gpio;
33};
34
35#endif /* _MICROREAD_H */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 32676b35d2f5..d0a1f2ca1c3f 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -171,9 +171,6 @@ static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
171 return res; 171 return res;
172} 172}
173 173
174extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
175 const char *name, umode_t mode, const struct file_operations *fops);
176extern void proc_net_remove(struct net *net, const char *name);
177extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, 174extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
178 struct proc_dir_entry *parent); 175 struct proc_dir_entry *parent);
179 176
@@ -184,21 +181,15 @@ extern int proc_alloc_inum(unsigned int *pino);
184extern void proc_free_inum(unsigned int inum); 181extern void proc_free_inum(unsigned int inum);
185#else 182#else
186 183
187#define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; })
188static inline void proc_net_remove(struct net *net, const char *name) {}
189
190static inline void proc_flush_task(struct task_struct *task) 184static inline void proc_flush_task(struct task_struct *task)
191{ 185{
192} 186}
193 187
194static inline struct proc_dir_entry *create_proc_entry(const char *name, 188static inline struct proc_dir_entry *create_proc_entry(const char *name,
195 umode_t mode, struct proc_dir_entry *parent) { return NULL; } 189 umode_t mode, struct proc_dir_entry *parent) { return NULL; }
196static inline struct proc_dir_entry *proc_create(const char *name, 190
197 umode_t mode, struct proc_dir_entry *parent, 191#define proc_create(name, mode, parent, fops) ({ (void)(mode), NULL; })
198 const struct file_operations *proc_fops) 192
199{
200 return NULL;
201}
202static inline struct proc_dir_entry *proc_create_data(const char *name, 193static inline struct proc_dir_entry *proc_create_data(const char *name,
203 umode_t mode, struct proc_dir_entry *parent, 194 umode_t mode, struct proc_dir_entry *parent,
204 const struct file_operations *proc_fops, void *data) 195 const struct file_operations *proc_fops, void *data)
diff --git a/include/linux/random.h b/include/linux/random.h
index d9846088c2c5..347ce553a306 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -74,4 +74,10 @@ static inline int arch_get_random_int(unsigned int *v)
74} 74}
75#endif 75#endif
76 76
77/* Pseudo random number generator from numerical recipes. */
78static inline u32 next_pseudo_random32(u32 seed)
79{
80 return seed * 1664525 + 1013904223;
81}
82
77#endif /* _LINUX_RANDOM_H */ 83#endif /* _LINUX_RANDOM_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 320e976d5ab8..821c7f45d2a7 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -230,6 +230,13 @@ enum {
230 230
231 /* generate wifi status information (where possible) */ 231 /* generate wifi status information (where possible) */
232 SKBTX_WIFI_STATUS = 1 << 4, 232 SKBTX_WIFI_STATUS = 1 << 4,
233
234 /* This indicates at least one fragment might be overwritten
235 * (as in vmsplice(), sendfile() ...)
236 * If we need to compute a TX checksum, we'll need to copy
237 * all frags to avoid possible bad checksum
238 */
239 SKBTX_SHARED_FRAG = 1 << 5,
233}; 240};
234 241
235/* 242/*
@@ -307,6 +314,8 @@ enum {
307 SKB_GSO_TCPV6 = 1 << 4, 314 SKB_GSO_TCPV6 = 1 << 4,
308 315
309 SKB_GSO_FCOE = 1 << 5, 316 SKB_GSO_FCOE = 1 << 5,
317
318 SKB_GSO_GRE = 1 << 6,
310}; 319};
311 320
312#if BITS_PER_LONG > 32 321#if BITS_PER_LONG > 32
@@ -797,6 +806,16 @@ static inline int skb_cloned(const struct sk_buff *skb)
797 (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1; 806 (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1;
798} 807}
799 808
809static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
810{
811 might_sleep_if(pri & __GFP_WAIT);
812
813 if (skb_cloned(skb))
814 return pskb_expand_head(skb, 0, 0, pri);
815
816 return 0;
817}
818
800/** 819/**
801 * skb_header_cloned - is the header a clone 820 * skb_header_cloned - is the header a clone
802 * @skb: buffer to check 821 * @skb: buffer to check
@@ -1492,6 +1511,11 @@ static inline void skb_set_inner_network_header(struct sk_buff *skb,
1492 skb->inner_network_header += offset; 1511 skb->inner_network_header += offset;
1493} 1512}
1494 1513
1514static inline bool skb_transport_header_was_set(const struct sk_buff *skb)
1515{
1516 return skb->transport_header != ~0U;
1517}
1518
1495static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1519static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1496{ 1520{
1497 return skb->head + skb->transport_header; 1521 return skb->head + skb->transport_header;
@@ -1580,6 +1604,11 @@ static inline void skb_set_inner_network_header(struct sk_buff *skb,
1580 skb->inner_network_header = skb->data + offset; 1604 skb->inner_network_header = skb->data + offset;
1581} 1605}
1582 1606
1607static inline bool skb_transport_header_was_set(const struct sk_buff *skb)
1608{
1609 return skb->transport_header != NULL;
1610}
1611
1583static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1612static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1584{ 1613{
1585 return skb->transport_header; 1614 return skb->transport_header;
@@ -1815,6 +1844,10 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
1815 kfree_skb(skb); 1844 kfree_skb(skb);
1816} 1845}
1817 1846
1847#define NETDEV_FRAG_PAGE_MAX_ORDER get_order(32768)
1848#define NETDEV_FRAG_PAGE_MAX_SIZE (PAGE_SIZE << NETDEV_FRAG_PAGE_MAX_ORDER)
1849#define NETDEV_PAGECNT_MAX_BIAS NETDEV_FRAG_PAGE_MAX_SIZE
1850
1818extern void *netdev_alloc_frag(unsigned int fragsz); 1851extern void *netdev_alloc_frag(unsigned int fragsz);
1819 1852
1820extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, 1853extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
@@ -2191,6 +2224,19 @@ static inline int skb_linearize(struct sk_buff *skb)
2191} 2224}
2192 2225
2193/** 2226/**
2227 * skb_has_shared_frag - can any frag be overwritten
2228 * @skb: buffer to test
2229 *
2230 * Return true if the skb has at least one frag that might be modified
2231 * by an external entity (as in vmsplice()/sendfile())
2232 */
2233static inline bool skb_has_shared_frag(const struct sk_buff *skb)
2234{
2235 return skb_is_nonlinear(skb) &&
2236 skb_shinfo(skb)->tx_flags & SKBTX_SHARED_FRAG;
2237}
2238
2239/**
2194 * skb_linearize_cow - make sure skb is linear and writable 2240 * skb_linearize_cow - make sure skb is linear and writable
2195 * @skb: buffer to process 2241 * @skb: buffer to process
2196 * 2242 *
@@ -2688,6 +2734,21 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
2688} 2734}
2689#endif 2735#endif
2690 2736
2737/* Keeps track of mac header offset relative to skb->head.
2738 * It is useful for TSO of Tunneling protocol. e.g. GRE.
2739 * For non-tunnel skb it points to skb_mac_header() and for
2740 * tunnel skb it points to outer mac header. */
2741struct skb_gso_cb {
2742 int mac_offset;
2743};
2744#define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb)
2745
2746static inline int skb_tnl_header_len(const struct sk_buff *inner_skb)
2747{
2748 return (skb_mac_header(inner_skb) - inner_skb->head) -
2749 SKB_GSO_CB(inner_skb)->mac_offset;
2750}
2751
2691static inline bool skb_is_gso(const struct sk_buff *skb) 2752static inline bool skb_is_gso(const struct sk_buff *skb)
2692{ 2753{
2693 return skb_shinfo(skb)->gso_size; 2754 return skb_shinfo(skb)->gso_size;
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 9a546ff853dc..2b9f74b0ffea 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -178,7 +178,8 @@ struct ucred {
178#define AF_CAIF 37 /* CAIF sockets */ 178#define AF_CAIF 37 /* CAIF sockets */
179#define AF_ALG 38 /* Algorithm sockets */ 179#define AF_ALG 38 /* Algorithm sockets */
180#define AF_NFC 39 /* NFC sockets */ 180#define AF_NFC 39 /* NFC sockets */
181#define AF_MAX 40 /* For now.. */ 181#define AF_VSOCK 40 /* vSockets */
182#define AF_MAX 41 /* For now.. */
182 183
183/* Protocol families, same as address families. */ 184/* Protocol families, same as address families. */
184#define PF_UNSPEC AF_UNSPEC 185#define PF_UNSPEC AF_UNSPEC
@@ -221,6 +222,7 @@ struct ucred {
221#define PF_CAIF AF_CAIF 222#define PF_CAIF AF_CAIF
222#define PF_ALG AF_ALG 223#define PF_ALG AF_ALG
223#define PF_NFC AF_NFC 224#define PF_NFC AF_NFC
225#define PF_VSOCK AF_VSOCK
224#define PF_MAX AF_MAX 226#define PF_MAX AF_MAX
225 227
226/* Maximum queue length specifiable by listen. */ 228/* Maximum queue length specifiable by listen. */
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h
index 6b05dcd927ff..86a12b0cb239 100644
--- a/include/linux/ssb/ssb_driver_gige.h
+++ b/include/linux/ssb/ssb_driver_gige.h
@@ -97,21 +97,16 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
97 return 0; 97 return 0;
98} 98}
99 99
100#ifdef CONFIG_BCM47XX
101#include <asm/mach-bcm47xx/nvram.h>
102/* Get the device MAC address */ 100/* Get the device MAC address */
103static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) 101static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
104{
105 char buf[20];
106 if (nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0)
107 return;
108 nvram_parse_macaddr(buf, macaddr);
109}
110#else
111static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
112{ 102{
103 struct ssb_gige *dev = pdev_to_ssb_gige(pdev);
104 if (!dev)
105 return -ENODEV;
106
107 memcpy(macaddr, dev->dev->bus->sprom.et0mac, 6);
108 return 0;
113} 109}
114#endif
115 110
116extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev, 111extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev,
117 struct pci_dev *pdev); 112 struct pci_dev *pdev);
@@ -175,6 +170,10 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev)
175{ 170{
176 return 0; 171 return 0;
177} 172}
173static inline int ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
174{
175 return -ENODEV;
176}
178 177
179#endif /* CONFIG_SSB_DRIVER_GIGE */ 178#endif /* CONFIG_SSB_DRIVER_GIGE */
180#endif /* LINUX_SSB_DRIVER_GIGE_H_ */ 179#endif /* LINUX_SSB_DRIVER_GIGE_H_ */
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h
index 07a9c7a2e088..afe79d40a99e 100644
--- a/include/linux/ssb/ssb_driver_mips.h
+++ b/include/linux/ssb/ssb_driver_mips.h
@@ -45,6 +45,11 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore)
45{ 45{
46} 46}
47 47
48static inline unsigned int ssb_mips_irq(struct ssb_device *dev)
49{
50 return 0;
51}
52
48#endif /* CONFIG_SSB_DRIVER_MIPS */ 53#endif /* CONFIG_SSB_DRIVER_MIPS */
49 54
50#endif /* LINUX_SSB_MIPSCORE_H_ */ 55#endif /* LINUX_SSB_MIPSCORE_H_ */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 4e1d2283e3cc..f28408c07dc2 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -162,6 +162,8 @@ struct tcp_sock {
162 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ 162 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
163 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ 163 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */
164 164
165 u32 tsoffset; /* timestamp offset */
166
165 struct list_head tsq_node; /* anchor in tsq_tasklet.head list */ 167 struct list_head tsq_node; /* anchor in tsq_tasklet.head list */
166 unsigned long tsq_flags; 168 unsigned long tsq_flags;
167 169
@@ -246,7 +248,6 @@ struct tcp_sock {
246 u32 sacked_out; /* SACK'd packets */ 248 u32 sacked_out; /* SACK'd packets */
247 u32 fackets_out; /* FACK'd packets */ 249 u32 fackets_out; /* FACK'd packets */
248 u32 tso_deferred; 250 u32 tso_deferred;
249 u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */
250 251
251 /* from STCP, retrans queue hinting */ 252 /* from STCP, retrans queue hinting */
252 struct sk_buff* lost_skb_hint; 253 struct sk_buff* lost_skb_hint;
@@ -354,6 +355,7 @@ struct tcp_timewait_sock {
354 u32 tw_rcv_nxt; 355 u32 tw_rcv_nxt;
355 u32 tw_snd_nxt; 356 u32 tw_snd_nxt;
356 u32 tw_rcv_wnd; 357 u32 tw_rcv_wnd;
358 u32 tw_ts_offset;
357 u32 tw_ts_recent; 359 u32 tw_ts_recent;
358 long tw_ts_recent_stamp; 360 long tw_ts_recent_stamp;
359#ifdef CONFIG_TCP_MD5SIG 361#ifdef CONFIG_TCP_MD5SIG
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index cec4b4159767..8198a63cf459 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -1,129 +1,10 @@
1/***************************************************************************** 1/*
2* wanrouter.h Definitions for the WAN Multiprotocol Router Module. 2 * wanrouter.h Legacy declarations kept around until X25 is removed
3* This module provides API and common services for WAN Link 3 */
4* Drivers and is completely hardware-independent. 4
5*
6* Author: Nenad Corbic <ncorbic@sangoma.com>
7* Gideon Hack
8* Additions: Arnaldo Melo
9*
10* Copyright: (c) 1995-2000 Sangoma Technologies Inc.
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version
15* 2 of the License, or (at your option) any later version.
16* ============================================================================
17* Jul 21, 2000 Nenad Corbic Added WAN_FT1_READY State
18* Feb 24, 2000 Nenad Corbic Added support for socket based x25api
19* Jan 28, 2000 Nenad Corbic Added support for the ASYNC protocol.
20* Oct 04, 1999 Nenad Corbic Updated for 2.1.0 release
21* Jun 02, 1999 Gideon Hack Added support for the S514 adapter.
22* May 23, 1999 Arnaldo Melo Added local_addr to wanif_conf_t
23* WAN_DISCONNECTING state added
24* Jul 20, 1998 David Fong Added Inverse ARP options to 'wanif_conf_t'
25* Jun 12, 1998 David Fong Added Cisco HDLC support.
26* Dec 16, 1997 Jaspreet Singh Moved 'enable_IPX' and 'network_number' to
27* 'wanif_conf_t'
28* Dec 05, 1997 Jaspreet Singh Added 'pap', 'chap' to 'wanif_conf_t'
29* Added 'authenticator' to 'wan_ppp_conf_t'
30* Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0
31* Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t'
32* Added 'enable_IPX' and 'network_number' to
33* 'wan_device_t'. Also added defines for
34* UDP PACKET TYPE, Interrupt test, critical values
35* for RACE conditions.
36* Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to
37* 'wan_fr_conf_t' to configure a list of dlci(s)
38* for a NODE
39* Jul 07, 1997 Jaspreet Singh Added 'ttl' to 'wandev_conf_t' & 'wan_device_t'
40* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' to 'wan_device_t'
41* May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t'
42* Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t'
43* Jan 16, 1997 Gene Kozin router_devlist made public
44* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
45*****************************************************************************/
46#ifndef _ROUTER_H 5#ifndef _ROUTER_H
47#define _ROUTER_H 6#define _ROUTER_H
48 7
49#include <uapi/linux/wanrouter.h> 8#include <uapi/linux/wanrouter.h>
50 9
51/****** Kernel Interface ****************************************************/
52
53#include <linux/fs.h> /* support for device drivers */
54#include <linux/proc_fs.h> /* proc filesystem pragmatics */
55#include <linux/netdevice.h> /* support for network drivers */
56#include <linux/spinlock.h> /* Support for SMP Locking */
57
58/*----------------------------------------------------------------------------
59 * WAN device data space.
60 */
61struct wan_device {
62 unsigned magic; /* magic number */
63 char* name; /* -> WAN device name (ASCIIZ) */
64 void* private; /* -> driver private data */
65 unsigned config_id; /* Configuration ID */
66 /****** hardware configuration ******/
67 unsigned ioport; /* adapter I/O port base #1 */
68 char S514_cpu_no[1]; /* PCI CPU Number */
69 unsigned char S514_slot_no; /* PCI Slot Number */
70 unsigned long maddr; /* dual-port memory address */
71 unsigned msize; /* dual-port memory size */
72 int irq; /* interrupt request level */
73 int dma; /* DMA request level */
74 unsigned bps; /* data transfer rate */
75 unsigned mtu; /* max physical transmit unit size */
76 unsigned udp_port; /* UDP port for management */
77 unsigned char ttl; /* Time To Live for UDP security */
78 unsigned enable_tx_int; /* Transmit Interrupt enabled or not */
79 char interface; /* RS-232/V.35, etc. */
80 char clocking; /* external/internal */
81 char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */
82 char station; /* DTE/DCE, primary/secondary, etc. */
83 char connection; /* permanent/switched/on-demand */
84 char signalling; /* Signalling RS232 or V35 */
85 char read_mode; /* read mode: Polling or interrupt */
86 char new_if_cnt; /* Number of interfaces per wanpipe */
87 char del_if_cnt; /* Number of times del_if() gets called */
88 unsigned char piggyback; /* Piggibacking a port */
89 unsigned hw_opt[4]; /* other hardware options */
90 /****** status and statistics *******/
91 char state; /* device state */
92 char api_status; /* device api status */
93 struct net_device_stats stats; /* interface statistics */
94 unsigned reserved[16]; /* reserved for future use */
95 unsigned long critical; /* critical section flag */
96 spinlock_t lock; /* Support for SMP Locking */
97
98 /****** device management methods ***/
99 int (*setup) (struct wan_device *wandev, wandev_conf_t *conf);
100 int (*shutdown) (struct wan_device *wandev);
101 int (*update) (struct wan_device *wandev);
102 int (*ioctl) (struct wan_device *wandev, unsigned cmd,
103 unsigned long arg);
104 int (*new_if)(struct wan_device *wandev, struct net_device *dev,
105 wanif_conf_t *conf);
106 int (*del_if)(struct wan_device *wandev, struct net_device *dev);
107 /****** maintained by the router ****/
108 struct wan_device* next; /* -> next device */
109 struct net_device* dev; /* list of network interfaces */
110 unsigned ndev; /* number of interfaces */
111 struct proc_dir_entry *dent; /* proc filesystem entry */
112};
113
114/* Public functions available for device drivers */
115extern int register_wan_device(struct wan_device *wandev);
116extern int unregister_wan_device(char *name);
117
118/* Proc interface functions. These must not be called by the drivers! */
119extern int wanrouter_proc_init(void);
120extern void wanrouter_proc_cleanup(void);
121extern int wanrouter_proc_add(struct wan_device *wandev);
122extern int wanrouter_proc_delete(struct wan_device *wandev);
123extern long wanrouter_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
124
125/* Public Data */
126/* list of registered devices */
127extern struct wan_device *wanrouter_router_devlist;
128
129#endif /* _ROUTER_H */ 10#endif /* _ROUTER_H */
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index 0d6373195d32..a54fe82e704b 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -24,6 +24,8 @@
24#ifndef _LINUX_WL12XX_H 24#ifndef _LINUX_WL12XX_H
25#define _LINUX_WL12XX_H 25#define _LINUX_WL12XX_H
26 26
27#include <linux/err.h>
28
27/* Reference clock values */ 29/* Reference clock values */
28enum { 30enum {
29 WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ 31 WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */
@@ -55,17 +57,17 @@ struct wl12xx_platform_data {
55 int board_tcxo_clock; 57 int board_tcxo_clock;
56 unsigned long platform_quirks; 58 unsigned long platform_quirks;
57 bool pwr_in_suspend; 59 bool pwr_in_suspend;
58
59 struct wl1271_if_operations *ops;
60}; 60};
61 61
62/* Platform does not support level trigger interrupts */ 62/* Platform does not support level trigger interrupts */
63#define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0) 63#define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0)
64 64
65#ifdef CONFIG_WL12XX_PLATFORM_DATA 65#ifdef CONFIG_WILINK_PLATFORM_DATA
66 66
67int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); 67int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
68 68
69struct wl12xx_platform_data *wl12xx_get_platform_data(void);
70
69#else 71#else
70 72
71static inline 73static inline
@@ -74,8 +76,12 @@ int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
74 return -ENOSYS; 76 return -ENOSYS;
75} 77}
76 78
77#endif 79static inline
80struct wl12xx_platform_data *wl12xx_get_platform_data(void)
81{
82 return ERR_PTR(-ENODATA);
83}
78 84
79struct wl12xx_platform_data *wl12xx_get_platform_data(void); 85#endif
80 86
81#endif 87#endif
diff --git a/include/net/act_api.h b/include/net/act_api.h
index c739531e1564..06ef7e926a66 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -35,21 +35,6 @@ struct tcf_common {
35#define tcf_lock common.tcfc_lock 35#define tcf_lock common.tcfc_lock
36#define tcf_rcu common.tcfc_rcu 36#define tcf_rcu common.tcfc_rcu
37 37
38struct tcf_police {
39 struct tcf_common common;
40 int tcfp_result;
41 u32 tcfp_ewma_rate;
42 u32 tcfp_burst;
43 u32 tcfp_mtu;
44 u32 tcfp_toks;
45 u32 tcfp_ptoks;
46 psched_time_t tcfp_t_c;
47 struct qdisc_rate_table *tcfp_R_tab;
48 struct qdisc_rate_table *tcfp_P_tab;
49};
50#define to_police(pc) \
51 container_of(pc, struct tcf_police, common)
52
53struct tcf_hashinfo { 38struct tcf_hashinfo {
54 struct tcf_common **htab; 39 struct tcf_common **htab;
55 unsigned int hmask; 40 unsigned int hmask;
@@ -91,7 +76,9 @@ struct tc_action_ops {
91 int (*dump)(struct sk_buff *, struct tc_action *, int, int); 76 int (*dump)(struct sk_buff *, struct tc_action *, int, int);
92 int (*cleanup)(struct tc_action *, int bind); 77 int (*cleanup)(struct tc_action *, int bind);
93 int (*lookup)(struct tc_action *, u32); 78 int (*lookup)(struct tc_action *, u32);
94 int (*init)(struct nlattr *, struct nlattr *, struct tc_action *, int , int); 79 int (*init)(struct net *net, struct nlattr *nla,
80 struct nlattr *est, struct tc_action *act, int ovr,
81 int bind);
95 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); 82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *);
96}; 83};
97 84
@@ -116,8 +103,12 @@ extern int tcf_register_action(struct tc_action_ops *a);
116extern int tcf_unregister_action(struct tc_action_ops *a); 103extern int tcf_unregister_action(struct tc_action_ops *a);
117extern void tcf_action_destroy(struct tc_action *a, int bind); 104extern void tcf_action_destroy(struct tc_action *a, int bind);
118extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res); 105extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res);
119extern struct tc_action *tcf_action_init(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); 106extern struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla,
120extern struct tc_action *tcf_action_init_1(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); 107 struct nlattr *est, char *n, int ovr,
108 int bind);
109extern struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
110 struct nlattr *est, char *n, int ovr,
111 int bind);
121extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 112extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
122extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); 113extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
123extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 114extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index df4ef9453384..40be2a0d8ae1 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -15,6 +15,10 @@
15 15
16#define IPV6_MAX_ADDRESSES 16 16#define IPV6_MAX_ADDRESSES 16
17 17
18#define ADDRCONF_TIMER_FUZZ_MINUS (HZ > 50 ? HZ / 50 : 1)
19#define ADDRCONF_TIMER_FUZZ (HZ / 4)
20#define ADDRCONF_TIMER_FUZZ_MAX (HZ)
21
18#include <linux/in.h> 22#include <linux/in.h>
19#include <linux/in6.h> 23#include <linux/in6.h>
20 24
@@ -150,7 +154,31 @@ extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
150extern bool ipv6_chk_mcast_addr(struct net_device *dev, 154extern bool ipv6_chk_mcast_addr(struct net_device *dev,
151 const struct in6_addr *group, 155 const struct in6_addr *group,
152 const struct in6_addr *src_addr); 156 const struct in6_addr *src_addr);
153extern bool ipv6_is_mld(struct sk_buff *skb, int nexthdr); 157
158/*
159 * identify MLD packets for MLD filter exceptions
160 */
161static inline bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset)
162{
163 struct icmp6hdr *hdr;
164
165 if (nexthdr != IPPROTO_ICMPV6 ||
166 !pskb_network_may_pull(skb, offset + sizeof(struct icmp6hdr)))
167 return false;
168
169 hdr = (struct icmp6hdr *)(skb_network_header(skb) + offset);
170
171 switch (hdr->icmp6_type) {
172 case ICMPV6_MGM_QUERY:
173 case ICMPV6_MGM_REPORT:
174 case ICMPV6_MGM_REDUCTION:
175 case ICMPV6_MLD2_REPORT:
176 return true;
177 default:
178 break;
179 }
180 return false;
181}
154 182
155extern void addrconf_prefix_rcv(struct net_device *dev, 183extern void addrconf_prefix_rcv(struct net_device *dev,
156 u8 *opt, int len, bool sllao); 184 u8 *opt, int len, bool sllao);
@@ -257,30 +285,55 @@ static inline void addrconf_addr_solict_mult(const struct in6_addr *addr,
257 htonl(0xFF000000) | addr->s6_addr32[3]); 285 htonl(0xFF000000) | addr->s6_addr32[3]);
258} 286}
259 287
260static inline int ipv6_addr_is_multicast(const struct in6_addr *addr) 288static inline bool ipv6_addr_is_multicast(const struct in6_addr *addr)
261{ 289{
262 return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000); 290 return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000);
263} 291}
264 292
265static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) 293static inline bool ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr)
266{ 294{
295#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
296 __u64 *p = (__u64 *)addr;
297 return ((p[0] ^ cpu_to_be64(0xff02000000000000UL)) | (p[1] ^ cpu_to_be64(1))) == 0UL;
298#else
267 return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | 299 return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
268 addr->s6_addr32[1] | addr->s6_addr32[2] | 300 addr->s6_addr32[1] | addr->s6_addr32[2] |
269 (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0; 301 (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0;
302#endif
270} 303}
271 304
272static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) 305static inline bool ipv6_addr_is_ll_all_routers(const struct in6_addr *addr)
273{ 306{
307#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
308 __u64 *p = (__u64 *)addr;
309 return ((p[0] ^ cpu_to_be64(0xff02000000000000UL)) | (p[1] ^ cpu_to_be64(2))) == 0UL;
310#else
274 return ((addr->s6_addr32[0] ^ htonl(0xff020000)) | 311 return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
275 addr->s6_addr32[1] | addr->s6_addr32[2] | 312 addr->s6_addr32[1] | addr->s6_addr32[2] |
276 (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0; 313 (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0;
314#endif
277} 315}
278 316
279static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) 317static inline bool ipv6_addr_is_isatap(const struct in6_addr *addr)
280{ 318{
281 return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE); 319 return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE);
282} 320}
283 321
322static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr)
323{
324#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
325 __u64 *p = (__u64 *)addr;
326 return ((p[0] ^ cpu_to_be64(0xff02000000000000UL)) |
327 ((p[1] ^ cpu_to_be64(0x00000001ff000000UL)) &
328 cpu_to_be64(0xffffffffff000000UL))) == 0UL;
329#else
330 return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
331 addr->s6_addr32[1] |
332 (addr->s6_addr32[2] ^ htonl(0x00000001)) |
333 (addr->s6_addr[12] ^ 0xff)) == 0;
334#endif
335}
336
284#ifdef CONFIG_PROC_FS 337#ifdef CONFIG_PROC_FS
285extern int if6_proc_init(void); 338extern int if6_proc_init(void);
286extern void if6_proc_exit(void); 339extern void if6_proc_exit(void);
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h
index 42f21766c538..487b54c1308f 100644
--- a/include/net/bluetooth/a2mp.h
+++ b/include/net/bluetooth/a2mp.h
@@ -23,6 +23,7 @@ enum amp_mgr_state {
23 READ_LOC_AMP_INFO, 23 READ_LOC_AMP_INFO,
24 READ_LOC_AMP_ASSOC, 24 READ_LOC_AMP_ASSOC,
25 READ_LOC_AMP_ASSOC_FINAL, 25 READ_LOC_AMP_ASSOC_FINAL,
26 WRITE_REMOTE_AMP_ASSOC,
26}; 27};
27 28
28struct amp_mgr { 29struct amp_mgr {
@@ -33,7 +34,7 @@ struct amp_mgr {
33 struct kref kref; 34 struct kref kref;
34 __u8 ident; 35 __u8 ident;
35 __u8 handle; 36 __u8 handle;
36 enum amp_mgr_state state; 37 unsigned long state;
37 unsigned long flags; 38 unsigned long flags;
38 39
39 struct list_head amp_ctrls; 40 struct list_head amp_ctrls;
@@ -144,5 +145,6 @@ void a2mp_discover_amp(struct l2cap_chan *chan);
144void a2mp_send_getinfo_rsp(struct hci_dev *hdev); 145void a2mp_send_getinfo_rsp(struct hci_dev *hdev);
145void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); 146void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status);
146void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); 147void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status);
148void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status);
147 149
148#endif /* __A2MP_H */ 150#endif /* __A2MP_H */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 2554b3f5222a..9531beee09b5 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -166,6 +166,29 @@ typedef struct {
166#define BDADDR_LE_PUBLIC 0x01 166#define BDADDR_LE_PUBLIC 0x01
167#define BDADDR_LE_RANDOM 0x02 167#define BDADDR_LE_RANDOM 0x02
168 168
169static inline bool bdaddr_type_is_valid(__u8 type)
170{
171 switch (type) {
172 case BDADDR_BREDR:
173 case BDADDR_LE_PUBLIC:
174 case BDADDR_LE_RANDOM:
175 return true;
176 }
177
178 return false;
179}
180
181static inline bool bdaddr_type_is_le(__u8 type)
182{
183 switch (type) {
184 case BDADDR_LE_PUBLIC:
185 case BDADDR_LE_RANDOM:
186 return true;
187 }
188
189 return false;
190}
191
169#define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0} }) 192#define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0} })
170#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) 193#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} })
171 194
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 45eee08157bb..7f12c25f1fca 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -943,6 +943,12 @@ struct hci_rp_le_read_buffer_size {
943 __u8 le_max_pkt; 943 __u8 le_max_pkt;
944} __packed; 944} __packed;
945 945
946#define HCI_OP_LE_READ_LOCAL_FEATURES 0x2003
947struct hci_rp_le_read_local_features {
948 __u8 status;
949 __u8 features[8];
950} __packed;
951
946#define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 952#define HCI_OP_LE_READ_ADV_TX_POWER 0x2007
947struct hci_rp_le_read_adv_tx_power { 953struct hci_rp_le_read_adv_tx_power {
948 __u8 status; 954 __u8 status;
@@ -995,6 +1001,12 @@ struct hci_cp_le_create_conn {
995 1001
996#define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e 1002#define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e
997 1003
1004#define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f
1005struct hci_rp_le_read_white_list_size {
1006 __u8 status;
1007 __u8 size;
1008} __packed;
1009
998#define HCI_OP_LE_CONN_UPDATE 0x2013 1010#define HCI_OP_LE_CONN_UPDATE 0x2013
999struct hci_cp_le_conn_update { 1011struct hci_cp_le_conn_update {
1000 __le16 handle; 1012 __le16 handle;
@@ -1033,6 +1045,12 @@ struct hci_rp_le_ltk_neg_reply {
1033 __le16 handle; 1045 __le16 handle;
1034} __packed; 1046} __packed;
1035 1047
1048#define HCI_OP_LE_READ_SUPPORTED_STATES 0x201c
1049struct hci_rp_le_read_supported_states {
1050 __u8 status;
1051 __u8 le_states[8];
1052} __packed;
1053
1036/* ---- HCI Events ---- */ 1054/* ---- HCI Events ---- */
1037#define HCI_EV_INQUIRY_COMPLETE 0x01 1055#define HCI_EV_INQUIRY_COMPLETE 0x01
1038 1056
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 014a2eaa5389..90cf75afcb02 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -86,6 +86,7 @@ struct bdaddr_list {
86struct bt_uuid { 86struct bt_uuid {
87 struct list_head list; 87 struct list_head list;
88 u8 uuid[16]; 88 u8 uuid[16];
89 u8 size;
89 u8 svc_hint; 90 u8 svc_hint;
90}; 91};
91 92
@@ -152,6 +153,9 @@ struct hci_dev {
152 __u8 minor_class; 153 __u8 minor_class;
153 __u8 features[8]; 154 __u8 features[8];
154 __u8 host_features[8]; 155 __u8 host_features[8];
156 __u8 le_features[8];
157 __u8 le_white_list_size;
158 __u8 le_states[8];
155 __u8 commands[64]; 159 __u8 commands[64];
156 __u8 hci_ver; 160 __u8 hci_ver;
157 __u16 hci_rev; 161 __u16 hci_rev;
@@ -216,6 +220,7 @@ struct hci_dev {
216 unsigned long le_last_tx; 220 unsigned long le_last_tx;
217 221
218 struct workqueue_struct *workqueue; 222 struct workqueue_struct *workqueue;
223 struct workqueue_struct *req_workqueue;
219 224
220 struct work_struct power_on; 225 struct work_struct power_on;
221 struct delayed_work power_off; 226 struct delayed_work power_off;
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7588ef44ebaf..cdd33021f831 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -496,7 +496,6 @@ struct l2cap_chan {
496 __u16 frames_sent; 496 __u16 frames_sent;
497 __u16 unacked_frames; 497 __u16 unacked_frames;
498 __u8 retry_count; 498 __u8 retry_count;
499 __u16 srej_queue_next;
500 __u16 sdu_len; 499 __u16 sdu_len;
501 struct sk_buff *sdu; 500 struct sk_buff *sdu;
502 struct sk_buff *sdu_last_frag; 501 struct sk_buff *sdu_last_frag;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8e6a6b73b9c9..d581c6de5d64 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -19,6 +19,7 @@
19#include <linux/nl80211.h> 19#include <linux/nl80211.h>
20#include <linux/if_ether.h> 20#include <linux/if_ether.h>
21#include <linux/ieee80211.h> 21#include <linux/ieee80211.h>
22#include <linux/net.h>
22#include <net/regulatory.h> 23#include <net/regulatory.h>
23 24
24/** 25/**
@@ -99,6 +100,16 @@ enum ieee80211_band {
99 * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel 100 * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel
100 * is not permitted. 101 * is not permitted.
101 * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel. 102 * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel.
103 * @IEEE80211_CHAN_NO_80MHZ: If the driver supports 80 MHz on the band,
104 * this flag indicates that an 80 MHz channel cannot use this
105 * channel as the control or any of the secondary channels.
106 * This may be due to the driver or due to regulatory bandwidth
107 * restrictions.
108 * @IEEE80211_CHAN_NO_160MHZ: If the driver supports 160 MHz on the band,
109 * this flag indicates that an 160 MHz channel cannot use this
110 * channel as the control or any of the secondary channels.
111 * This may be due to the driver or due to regulatory bandwidth
112 * restrictions.
102 */ 113 */
103enum ieee80211_channel_flags { 114enum ieee80211_channel_flags {
104 IEEE80211_CHAN_DISABLED = 1<<0, 115 IEEE80211_CHAN_DISABLED = 1<<0,
@@ -108,11 +119,16 @@ enum ieee80211_channel_flags {
108 IEEE80211_CHAN_NO_HT40PLUS = 1<<4, 119 IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
109 IEEE80211_CHAN_NO_HT40MINUS = 1<<5, 120 IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
110 IEEE80211_CHAN_NO_OFDM = 1<<6, 121 IEEE80211_CHAN_NO_OFDM = 1<<6,
122 IEEE80211_CHAN_NO_80MHZ = 1<<7,
123 IEEE80211_CHAN_NO_160MHZ = 1<<8,
111}; 124};
112 125
113#define IEEE80211_CHAN_NO_HT40 \ 126#define IEEE80211_CHAN_NO_HT40 \
114 (IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS) 127 (IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS)
115 128
129#define IEEE80211_DFS_MIN_CAC_TIME_MS 60000
130#define IEEE80211_DFS_MIN_NOP_TIME_MS (30 * 60 * 1000)
131
116/** 132/**
117 * struct ieee80211_channel - channel definition 133 * struct ieee80211_channel - channel definition
118 * 134 *
@@ -133,6 +149,9 @@ enum ieee80211_channel_flags {
133 * to enable this, this is useful only on 5 GHz band. 149 * to enable this, this is useful only on 5 GHz band.
134 * @orig_mag: internal use 150 * @orig_mag: internal use
135 * @orig_mpwr: internal use 151 * @orig_mpwr: internal use
152 * @dfs_state: current state of this channel. Only relevant if radar is required
153 * on this channel.
154 * @dfs_state_entered: timestamp (jiffies) when the dfs state was entered.
136 */ 155 */
137struct ieee80211_channel { 156struct ieee80211_channel {
138 enum ieee80211_band band; 157 enum ieee80211_band band;
@@ -145,6 +164,8 @@ struct ieee80211_channel {
145 bool beacon_found; 164 bool beacon_found;
146 u32 orig_flags; 165 u32 orig_flags;
147 int orig_mag, orig_mpwr; 166 int orig_mag, orig_mpwr;
167 enum nl80211_dfs_state dfs_state;
168 unsigned long dfs_state_entered;
148}; 169};
149 170
150/** 171/**
@@ -281,9 +302,13 @@ struct ieee80211_supported_band {
281/** 302/**
282 * struct vif_params - describes virtual interface parameters 303 * struct vif_params - describes virtual interface parameters
283 * @use_4addr: use 4-address frames 304 * @use_4addr: use 4-address frames
305 * @macaddr: address to use for this virtual interface. This will only
306 * be used for non-netdevice interfaces. If this parameter is set
307 * to zero address the driver may determine the address as needed.
284 */ 308 */
285struct vif_params { 309struct vif_params {
286 int use_4addr; 310 int use_4addr;
311 u8 macaddr[ETH_ALEN];
287}; 312};
288 313
289/** 314/**
@@ -326,7 +351,7 @@ struct cfg80211_chan_def {
326 * cfg80211_get_chandef_type - return old channel type from chandef 351 * cfg80211_get_chandef_type - return old channel type from chandef
327 * @chandef: the channel definition 352 * @chandef: the channel definition
328 * 353 *
329 * Returns the old channel type (NOHT, HT20, HT40+/-) from a given 354 * Return: The old channel type (NOHT, HT20, HT40+/-) from a given
330 * chandef, which must have a bandwidth allowing this conversion. 355 * chandef, which must have a bandwidth allowing this conversion.
331 */ 356 */
332static inline enum nl80211_channel_type 357static inline enum nl80211_channel_type
@@ -364,7 +389,7 @@ void cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
364 * @chandef1: first channel definition 389 * @chandef1: first channel definition
365 * @chandef2: second channel definition 390 * @chandef2: second channel definition
366 * 391 *
367 * Returns %true if the channels defined by the channel definitions are 392 * Return: %true if the channels defined by the channel definitions are
368 * identical, %false otherwise. 393 * identical, %false otherwise.
369 */ 394 */
370static inline bool 395static inline bool
@@ -382,7 +407,7 @@ cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1,
382 * @chandef1: first channel definition 407 * @chandef1: first channel definition
383 * @chandef2: second channel definition 408 * @chandef2: second channel definition
384 * 409 *
385 * Returns %NULL if the given channel definitions are incompatible, 410 * Return: %NULL if the given channel definitions are incompatible,
386 * chandef1 or chandef2 otherwise. 411 * chandef1 or chandef2 otherwise.
387 */ 412 */
388const struct cfg80211_chan_def * 413const struct cfg80211_chan_def *
@@ -392,6 +417,7 @@ cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1,
392/** 417/**
393 * cfg80211_chandef_valid - check if a channel definition is valid 418 * cfg80211_chandef_valid - check if a channel definition is valid
394 * @chandef: the channel definition to check 419 * @chandef: the channel definition to check
420 * Return: %true if the channel definition is valid. %false otherwise.
395 */ 421 */
396bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef); 422bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef);
397 423
@@ -399,7 +425,8 @@ bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef);
399 * cfg80211_chandef_usable - check if secondary channels can be used 425 * cfg80211_chandef_usable - check if secondary channels can be used
400 * @wiphy: the wiphy to validate against 426 * @wiphy: the wiphy to validate against
401 * @chandef: the channel definition to check 427 * @chandef: the channel definition to check
402 * @prohibited_flags: the regulatory chanenl flags that must not be set 428 * @prohibited_flags: the regulatory channel flags that must not be set
429 * Return: %true if secondary channels are usable. %false otherwise.
403 */ 430 */
404bool cfg80211_chandef_usable(struct wiphy *wiphy, 431bool cfg80211_chandef_usable(struct wiphy *wiphy,
405 const struct cfg80211_chan_def *chandef, 432 const struct cfg80211_chan_def *chandef,
@@ -521,6 +548,26 @@ struct cfg80211_beacon_data {
521 size_t probe_resp_len; 548 size_t probe_resp_len;
522}; 549};
523 550
551struct mac_address {
552 u8 addr[ETH_ALEN];
553};
554
555/**
556 * struct cfg80211_acl_data - Access control list data
557 *
558 * @acl_policy: ACL policy to be applied on the station's
559 * entry specified by mac_addr
560 * @n_acl_entries: Number of MAC address entries passed
561 * @mac_addrs: List of MAC addresses of stations to be used for ACL
562 */
563struct cfg80211_acl_data {
564 enum nl80211_acl_policy acl_policy;
565 int n_acl_entries;
566
567 /* Keep it last */
568 struct mac_address mac_addrs[];
569};
570
524/** 571/**
525 * struct cfg80211_ap_settings - AP configuration 572 * struct cfg80211_ap_settings - AP configuration
526 * 573 *
@@ -540,6 +587,9 @@ struct cfg80211_beacon_data {
540 * @inactivity_timeout: time in seconds to determine station's inactivity. 587 * @inactivity_timeout: time in seconds to determine station's inactivity.
541 * @p2p_ctwindow: P2P CT Window 588 * @p2p_ctwindow: P2P CT Window
542 * @p2p_opp_ps: P2P opportunistic PS 589 * @p2p_opp_ps: P2P opportunistic PS
590 * @acl: ACL configuration used by the drivers which has support for
591 * MAC address based access control
592 * @radar_required: set if radar detection is required
543 */ 593 */
544struct cfg80211_ap_settings { 594struct cfg80211_ap_settings {
545 struct cfg80211_chan_def chandef; 595 struct cfg80211_chan_def chandef;
@@ -556,6 +606,8 @@ struct cfg80211_ap_settings {
556 int inactivity_timeout; 606 int inactivity_timeout;
557 u8 p2p_ctwindow; 607 u8 p2p_ctwindow;
558 bool p2p_opp_ps; 608 bool p2p_opp_ps;
609 const struct cfg80211_acl_data *acl;
610 bool radar_required;
559}; 611};
560 612
561/** 613/**
@@ -574,12 +626,14 @@ enum plink_actions {
574/** 626/**
575 * enum station_parameters_apply_mask - station parameter values to apply 627 * enum station_parameters_apply_mask - station parameter values to apply
576 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) 628 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
629 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability
577 * 630 *
578 * Not all station parameters have in-band "no change" signalling, 631 * Not all station parameters have in-band "no change" signalling,
579 * for those that don't these flags will are used. 632 * for those that don't these flags will are used.
580 */ 633 */
581enum station_parameters_apply_mask { 634enum station_parameters_apply_mask {
582 STATION_PARAM_APPLY_UAPSD = BIT(0), 635 STATION_PARAM_APPLY_UAPSD = BIT(0),
636 STATION_PARAM_APPLY_CAPABILITY = BIT(1),
583}; 637};
584 638
585/** 639/**
@@ -608,6 +662,11 @@ enum station_parameters_apply_mask {
608 * @sta_modify_mask: bitmap indicating which parameters changed 662 * @sta_modify_mask: bitmap indicating which parameters changed
609 * (for those that don't have a natural "no change" value), 663 * (for those that don't have a natural "no change" value),
610 * see &enum station_parameters_apply_mask 664 * see &enum station_parameters_apply_mask
665 * @local_pm: local link-specific mesh power save mode (no change when set
666 * to unknown)
667 * @capability: station capability
668 * @ext_capab: extended capabilities of the station
669 * @ext_capab_len: number of extended capabilities
611 */ 670 */
612struct station_parameters { 671struct station_parameters {
613 u8 *supported_rates; 672 u8 *supported_rates;
@@ -623,6 +682,10 @@ struct station_parameters {
623 struct ieee80211_vht_cap *vht_capa; 682 struct ieee80211_vht_cap *vht_capa;
624 u8 uapsd_queues; 683 u8 uapsd_queues;
625 u8 max_sp; 684 u8 max_sp;
685 enum nl80211_mesh_power_mode local_pm;
686 u16 capability;
687 u8 *ext_capab;
688 u8 ext_capab_len;
626}; 689};
627 690
628/** 691/**
@@ -634,14 +697,16 @@ struct station_parameters {
634 * @STATION_INFO_INACTIVE_TIME: @inactive_time filled 697 * @STATION_INFO_INACTIVE_TIME: @inactive_time filled
635 * @STATION_INFO_RX_BYTES: @rx_bytes filled 698 * @STATION_INFO_RX_BYTES: @rx_bytes filled
636 * @STATION_INFO_TX_BYTES: @tx_bytes filled 699 * @STATION_INFO_TX_BYTES: @tx_bytes filled
700 * @STATION_INFO_RX_BYTES64: @rx_bytes filled with 64-bit value
701 * @STATION_INFO_TX_BYTES64: @tx_bytes filled with 64-bit value
637 * @STATION_INFO_LLID: @llid filled 702 * @STATION_INFO_LLID: @llid filled
638 * @STATION_INFO_PLID: @plid filled 703 * @STATION_INFO_PLID: @plid filled
639 * @STATION_INFO_PLINK_STATE: @plink_state filled 704 * @STATION_INFO_PLINK_STATE: @plink_state filled
640 * @STATION_INFO_SIGNAL: @signal filled 705 * @STATION_INFO_SIGNAL: @signal filled
641 * @STATION_INFO_TX_BITRATE: @txrate fields are filled 706 * @STATION_INFO_TX_BITRATE: @txrate fields are filled
642 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) 707 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
643 * @STATION_INFO_RX_PACKETS: @rx_packets filled 708 * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value
644 * @STATION_INFO_TX_PACKETS: @tx_packets filled 709 * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value
645 * @STATION_INFO_TX_RETRIES: @tx_retries filled 710 * @STATION_INFO_TX_RETRIES: @tx_retries filled
646 * @STATION_INFO_TX_FAILED: @tx_failed filled 711 * @STATION_INFO_TX_FAILED: @tx_failed filled
647 * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled 712 * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled
@@ -653,6 +718,9 @@ struct station_parameters {
653 * @STATION_INFO_STA_FLAGS: @sta_flags filled 718 * @STATION_INFO_STA_FLAGS: @sta_flags filled
654 * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled 719 * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled
655 * @STATION_INFO_T_OFFSET: @t_offset filled 720 * @STATION_INFO_T_OFFSET: @t_offset filled
721 * @STATION_INFO_LOCAL_PM: @local_pm filled
722 * @STATION_INFO_PEER_PM: @peer_pm filled
723 * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled
656 */ 724 */
657enum station_info_flags { 725enum station_info_flags {
658 STATION_INFO_INACTIVE_TIME = 1<<0, 726 STATION_INFO_INACTIVE_TIME = 1<<0,
@@ -676,6 +744,11 @@ enum station_info_flags {
676 STATION_INFO_STA_FLAGS = 1<<18, 744 STATION_INFO_STA_FLAGS = 1<<18,
677 STATION_INFO_BEACON_LOSS_COUNT = 1<<19, 745 STATION_INFO_BEACON_LOSS_COUNT = 1<<19,
678 STATION_INFO_T_OFFSET = 1<<20, 746 STATION_INFO_T_OFFSET = 1<<20,
747 STATION_INFO_LOCAL_PM = 1<<21,
748 STATION_INFO_PEER_PM = 1<<22,
749 STATION_INFO_NONPEER_PM = 1<<23,
750 STATION_INFO_RX_BYTES64 = 1<<24,
751 STATION_INFO_TX_BYTES64 = 1<<25,
679}; 752};
680 753
681/** 754/**
@@ -789,13 +862,16 @@ struct sta_bss_parameters {
789 * @sta_flags: station flags mask & values 862 * @sta_flags: station flags mask & values
790 * @beacon_loss_count: Number of times beacon loss event has triggered. 863 * @beacon_loss_count: Number of times beacon loss event has triggered.
791 * @t_offset: Time offset of the station relative to this host. 864 * @t_offset: Time offset of the station relative to this host.
865 * @local_pm: local mesh STA power save mode
866 * @peer_pm: peer mesh STA power save mode
867 * @nonpeer_pm: non-peer mesh STA power save mode
792 */ 868 */
793struct station_info { 869struct station_info {
794 u32 filled; 870 u32 filled;
795 u32 connected_time; 871 u32 connected_time;
796 u32 inactive_time; 872 u32 inactive_time;
797 u32 rx_bytes; 873 u64 rx_bytes;
798 u32 tx_bytes; 874 u64 tx_bytes;
799 u16 llid; 875 u16 llid;
800 u16 plid; 876 u16 plid;
801 u8 plink_state; 877 u8 plink_state;
@@ -818,6 +894,9 @@ struct station_info {
818 894
819 u32 beacon_loss_count; 895 u32 beacon_loss_count;
820 s64 t_offset; 896 s64 t_offset;
897 enum nl80211_mesh_power_mode local_pm;
898 enum nl80211_mesh_power_mode peer_pm;
899 enum nl80211_mesh_power_mode nonpeer_pm;
821 900
822 /* 901 /*
823 * Note: Add a new enum station_info_flags value for each new field and 902 * Note: Add a new enum station_info_flags value for each new field and
@@ -993,6 +1072,10 @@ struct bss_parameters {
993 * @dot11MeshHWMPconfirmationInterval: The minimum interval of time (in TUs) 1072 * @dot11MeshHWMPconfirmationInterval: The minimum interval of time (in TUs)
994 * during which a mesh STA can send only one Action frame containing 1073 * during which a mesh STA can send only one Action frame containing
995 * a PREQ element for root path confirmation. 1074 * a PREQ element for root path confirmation.
1075 * @power_mode: The default mesh power save mode which will be the initial
1076 * setting for new peer links.
1077 * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake
1078 * after transmitting its beacon.
996 */ 1079 */
997struct mesh_config { 1080struct mesh_config {
998 u16 dot11MeshRetryTimeout; 1081 u16 dot11MeshRetryTimeout;
@@ -1020,6 +1103,8 @@ struct mesh_config {
1020 u32 dot11MeshHWMPactivePathToRootTimeout; 1103 u32 dot11MeshHWMPactivePathToRootTimeout;
1021 u16 dot11MeshHWMProotInterval; 1104 u16 dot11MeshHWMProotInterval;
1022 u16 dot11MeshHWMPconfirmationInterval; 1105 u16 dot11MeshHWMPconfirmationInterval;
1106 enum nl80211_mesh_power_mode power_mode;
1107 u16 dot11MeshAwakeWindowDuration;
1023}; 1108};
1024 1109
1025/** 1110/**
@@ -1034,6 +1119,8 @@ struct mesh_config {
1034 * @ie_len: length of vendor information elements 1119 * @ie_len: length of vendor information elements
1035 * @is_authenticated: this mesh requires authentication 1120 * @is_authenticated: this mesh requires authentication
1036 * @is_secure: this mesh uses security 1121 * @is_secure: this mesh uses security
1122 * @dtim_period: DTIM period to use
1123 * @beacon_interval: beacon interval to use
1037 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] 1124 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
1038 * 1125 *
1039 * These parameters are fixed when the mesh is created. 1126 * These parameters are fixed when the mesh is created.
@@ -1049,6 +1136,8 @@ struct mesh_setup {
1049 u8 ie_len; 1136 u8 ie_len;
1050 bool is_authenticated; 1137 bool is_authenticated;
1051 bool is_secure; 1138 bool is_secure;
1139 u8 dtim_period;
1140 u16 beacon_interval;
1052 int mcast_rate[IEEE80211_NUM_BANDS]; 1141 int mcast_rate[IEEE80211_NUM_BANDS];
1053}; 1142};
1054 1143
@@ -1168,6 +1257,7 @@ struct cfg80211_match_set {
1168 * @n_match_sets: number of match sets 1257 * @n_match_sets: number of match sets
1169 * @wiphy: the wiphy this was for 1258 * @wiphy: the wiphy this was for
1170 * @dev: the interface 1259 * @dev: the interface
1260 * @scan_start: start time of the scheduled scan
1171 * @channels: channels to scan 1261 * @channels: channels to scan
1172 * @rssi_thold: don't report scan results below this threshold (in s32 dBm) 1262 * @rssi_thold: don't report scan results below this threshold (in s32 dBm)
1173 */ 1263 */
@@ -1207,11 +1297,13 @@ enum cfg80211_signal_type {
1207 1297
1208/** 1298/**
1209 * struct cfg80211_bss_ie_data - BSS entry IE data 1299 * struct cfg80211_bss_ie_data - BSS entry IE data
1300 * @tsf: TSF contained in the frame that carried these IEs
1210 * @rcu_head: internal use, for freeing 1301 * @rcu_head: internal use, for freeing
1211 * @len: length of the IEs 1302 * @len: length of the IEs
1212 * @data: IE data 1303 * @data: IE data
1213 */ 1304 */
1214struct cfg80211_bss_ies { 1305struct cfg80211_bss_ies {
1306 u64 tsf;
1215 struct rcu_head rcu_head; 1307 struct rcu_head rcu_head;
1216 int len; 1308 int len;
1217 u8 data[]; 1309 u8 data[];
@@ -1225,29 +1317,32 @@ struct cfg80211_bss_ies {
1225 * 1317 *
1226 * @channel: channel this BSS is on 1318 * @channel: channel this BSS is on
1227 * @bssid: BSSID of the BSS 1319 * @bssid: BSSID of the BSS
1228 * @tsf: timestamp of last received update
1229 * @beacon_interval: the beacon interval as from the frame 1320 * @beacon_interval: the beacon interval as from the frame
1230 * @capability: the capability field in host byte order 1321 * @capability: the capability field in host byte order
1231 * @ies: the information elements (Note that there 1322 * @ies: the information elements (Note that there is no guarantee that these
1232 * is no guarantee that these are well-formed!); this is a pointer to 1323 * are well-formed!); this is a pointer to either the beacon_ies or
1233 * either the beacon_ies or proberesp_ies depending on whether Probe 1324 * proberesp_ies depending on whether Probe Response frame has been
1234 * Response frame has been received 1325 * received. It is always non-%NULL.
1235 * @beacon_ies: the information elements from the last Beacon frame 1326 * @beacon_ies: the information elements from the last Beacon frame
1327 * (implementation note: if @hidden_beacon_bss is set this struct doesn't
1328 * own the beacon_ies, but they're just pointers to the ones from the
1329 * @hidden_beacon_bss struct)
1236 * @proberesp_ies: the information elements from the last Probe Response frame 1330 * @proberesp_ies: the information elements from the last Probe Response frame
1331 * @hidden_beacon_bss: in case this BSS struct represents a probe response from
1332 * a BSS that hides the SSID in its beacon, this points to the BSS struct
1333 * that holds the beacon data. @beacon_ies is still valid, of course, and
1334 * points to the same data as hidden_beacon_bss->beacon_ies in that case.
1237 * @signal: signal strength value (type depends on the wiphy's signal_type) 1335 * @signal: signal strength value (type depends on the wiphy's signal_type)
1238 * @free_priv: function pointer to free private data
1239 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes 1336 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
1240 */ 1337 */
1241struct cfg80211_bss { 1338struct cfg80211_bss {
1242 u64 tsf;
1243
1244 struct ieee80211_channel *channel; 1339 struct ieee80211_channel *channel;
1245 1340
1246 const struct cfg80211_bss_ies __rcu *ies; 1341 const struct cfg80211_bss_ies __rcu *ies;
1247 const struct cfg80211_bss_ies __rcu *beacon_ies; 1342 const struct cfg80211_bss_ies __rcu *beacon_ies;
1248 const struct cfg80211_bss_ies __rcu *proberesp_ies; 1343 const struct cfg80211_bss_ies __rcu *proberesp_ies;
1249 1344
1250 void (*free_priv)(struct cfg80211_bss *bss); 1345 struct cfg80211_bss *hidden_beacon_bss;
1251 1346
1252 s32 signal; 1347 s32 signal;
1253 1348
@@ -1256,7 +1351,7 @@ struct cfg80211_bss {
1256 1351
1257 u8 bssid[ETH_ALEN]; 1352 u8 bssid[ETH_ALEN];
1258 1353
1259 u8 priv[0] __attribute__((__aligned__(sizeof(void *)))); 1354 u8 priv[0] __aligned(sizeof(void *));
1260}; 1355};
1261 1356
1262/** 1357/**
@@ -1266,7 +1361,7 @@ struct cfg80211_bss {
1266 * 1361 *
1267 * Note that the return value is an RCU-protected pointer, so 1362 * Note that the return value is an RCU-protected pointer, so
1268 * rcu_read_lock() must be held when calling this function. 1363 * rcu_read_lock() must be held when calling this function.
1269 * Returns %NULL if not found. 1364 * Return: %NULL if not found.
1270 */ 1365 */
1271const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); 1366const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
1272 1367
@@ -1349,6 +1444,8 @@ struct cfg80211_assoc_request {
1349 * @ie: Extra IEs to add to Deauthentication frame or %NULL 1444 * @ie: Extra IEs to add to Deauthentication frame or %NULL
1350 * @ie_len: Length of ie buffer in octets 1445 * @ie_len: Length of ie buffer in octets
1351 * @reason_code: The reason code for the deauthentication 1446 * @reason_code: The reason code for the deauthentication
1447 * @local_state_change: if set, change local state only and
1448 * do not set a deauth frame
1352 */ 1449 */
1353struct cfg80211_deauth_request { 1450struct cfg80211_deauth_request {
1354 const u8 *bssid; 1451 const u8 *bssid;
@@ -1434,6 +1531,7 @@ struct cfg80211_ibss_params {
1434 * @ie: IEs for association request 1531 * @ie: IEs for association request
1435 * @ie_len: Length of assoc_ie in octets 1532 * @ie_len: Length of assoc_ie in octets
1436 * @privacy: indicates whether privacy-enabled APs should be used 1533 * @privacy: indicates whether privacy-enabled APs should be used
1534 * @mfp: indicate whether management frame protection is used
1437 * @crypto: crypto settings 1535 * @crypto: crypto settings
1438 * @key_len: length of WEP key for shared key authentication 1536 * @key_len: length of WEP key for shared key authentication
1439 * @key_idx: index of WEP key for shared key authentication 1537 * @key_idx: index of WEP key for shared key authentication
@@ -1454,6 +1552,7 @@ struct cfg80211_connect_params {
1454 u8 *ie; 1552 u8 *ie;
1455 size_t ie_len; 1553 size_t ie_len;
1456 bool privacy; 1554 bool privacy;
1555 enum nl80211_mfp mfp;
1457 struct cfg80211_crypto_settings crypto; 1556 struct cfg80211_crypto_settings crypto;
1458 const u8 *key; 1557 const u8 *key;
1459 u8 key_len, key_idx; 1558 u8 key_len, key_idx;
@@ -1508,6 +1607,7 @@ struct cfg80211_pmksa {
1508 * one bit per byte, in same format as nl80211 1607 * one bit per byte, in same format as nl80211
1509 * @pattern: bytes to match where bitmask is 1 1608 * @pattern: bytes to match where bitmask is 1
1510 * @pattern_len: length of pattern (in bytes) 1609 * @pattern_len: length of pattern (in bytes)
1610 * @pkt_offset: packet offset (in bytes)
1511 * 1611 *
1512 * Internal note: @mask and @pattern are allocated in one chunk of 1612 * Internal note: @mask and @pattern are allocated in one chunk of
1513 * memory, free @mask only! 1613 * memory, free @mask only!
@@ -1515,6 +1615,42 @@ struct cfg80211_pmksa {
1515struct cfg80211_wowlan_trig_pkt_pattern { 1615struct cfg80211_wowlan_trig_pkt_pattern {
1516 u8 *mask, *pattern; 1616 u8 *mask, *pattern;
1517 int pattern_len; 1617 int pattern_len;
1618 int pkt_offset;
1619};
1620
1621/**
1622 * struct cfg80211_wowlan_tcp - TCP connection parameters
1623 *
1624 * @sock: (internal) socket for source port allocation
1625 * @src: source IP address
1626 * @dst: destination IP address
1627 * @dst_mac: destination MAC address
1628 * @src_port: source port
1629 * @dst_port: destination port
1630 * @payload_len: data payload length
1631 * @payload: data payload buffer
1632 * @payload_seq: payload sequence stamping configuration
1633 * @data_interval: interval at which to send data packets
1634 * @wake_len: wakeup payload match length
1635 * @wake_data: wakeup payload match data
1636 * @wake_mask: wakeup payload match mask
1637 * @tokens_size: length of the tokens buffer
1638 * @payload_tok: payload token usage configuration
1639 */
1640struct cfg80211_wowlan_tcp {
1641 struct socket *sock;
1642 __be32 src, dst;
1643 u16 src_port, dst_port;
1644 u8 dst_mac[ETH_ALEN];
1645 int payload_len;
1646 const u8 *payload;
1647 struct nl80211_wowlan_tcp_data_seq payload_seq;
1648 u32 data_interval;
1649 u32 wake_len;
1650 const u8 *wake_data, *wake_mask;
1651 u32 tokens_size;
1652 /* must be last, variable member */
1653 struct nl80211_wowlan_tcp_data_token payload_tok;
1518}; 1654};
1519 1655
1520/** 1656/**
@@ -1531,16 +1667,49 @@ struct cfg80211_wowlan_trig_pkt_pattern {
1531 * @eap_identity_req: wake up on EAP identity request packet 1667 * @eap_identity_req: wake up on EAP identity request packet
1532 * @four_way_handshake: wake up on 4-way handshake 1668 * @four_way_handshake: wake up on 4-way handshake
1533 * @rfkill_release: wake up when rfkill is released 1669 * @rfkill_release: wake up when rfkill is released
1670 * @tcp: TCP connection establishment/wakeup parameters, see nl80211.h.
1671 * NULL if not configured.
1534 */ 1672 */
1535struct cfg80211_wowlan { 1673struct cfg80211_wowlan {
1536 bool any, disconnect, magic_pkt, gtk_rekey_failure, 1674 bool any, disconnect, magic_pkt, gtk_rekey_failure,
1537 eap_identity_req, four_way_handshake, 1675 eap_identity_req, four_way_handshake,
1538 rfkill_release; 1676 rfkill_release;
1539 struct cfg80211_wowlan_trig_pkt_pattern *patterns; 1677 struct cfg80211_wowlan_trig_pkt_pattern *patterns;
1678 struct cfg80211_wowlan_tcp *tcp;
1540 int n_patterns; 1679 int n_patterns;
1541}; 1680};
1542 1681
1543/** 1682/**
1683 * struct cfg80211_wowlan_wakeup - wakeup report
1684 * @disconnect: woke up by getting disconnected
1685 * @magic_pkt: woke up by receiving magic packet
1686 * @gtk_rekey_failure: woke up by GTK rekey failure
1687 * @eap_identity_req: woke up by EAP identity request packet
1688 * @four_way_handshake: woke up by 4-way handshake
1689 * @rfkill_release: woke up by rfkill being released
1690 * @pattern_idx: pattern that caused wakeup, -1 if not due to pattern
1691 * @packet_present_len: copied wakeup packet data
1692 * @packet_len: original wakeup packet length
1693 * @packet: The packet causing the wakeup, if any.
1694 * @packet_80211: For pattern match, magic packet and other data
1695 * frame triggers an 802.3 frame should be reported, for
1696 * disconnect due to deauth 802.11 frame. This indicates which
1697 * it is.
1698 * @tcp_match: TCP wakeup packet received
1699 * @tcp_connlost: TCP connection lost or failed to establish
1700 * @tcp_nomoretokens: TCP data ran out of tokens
1701 */
1702struct cfg80211_wowlan_wakeup {
1703 bool disconnect, magic_pkt, gtk_rekey_failure,
1704 eap_identity_req, four_way_handshake,
1705 rfkill_release, packet_80211,
1706 tcp_match, tcp_connlost, tcp_nomoretokens;
1707 s32 pattern_idx;
1708 u32 packet_present_len, packet_len;
1709 const void *packet;
1710};
1711
1712/**
1544 * struct cfg80211_gtk_rekey_data - rekey data 1713 * struct cfg80211_gtk_rekey_data - rekey data
1545 * @kek: key encryption key 1714 * @kek: key encryption key
1546 * @kck: key confirmation key 1715 * @kck: key confirmation key
@@ -1763,6 +1932,15 @@ struct cfg80211_gtk_rekey_data {
1763 * 1932 *
1764 * @start_p2p_device: Start the given P2P device. 1933 * @start_p2p_device: Start the given P2P device.
1765 * @stop_p2p_device: Stop the given P2P device. 1934 * @stop_p2p_device: Stop the given P2P device.
1935 *
1936 * @set_mac_acl: Sets MAC address control list in AP and P2P GO mode.
1937 * Parameters include ACL policy, an array of MAC address of stations
1938 * and the number of MAC addresses. If there is already a list in driver
1939 * this new list replaces the existing one. Driver has to clear its ACL
1940 * when number of MAC addresses entries is passed as 0. Drivers which
1941 * advertise the support for MAC based ACL have to implement this callback.
1942 *
1943 * @start_radar_detection: Start radar detection in the driver.
1766 */ 1944 */
1767struct cfg80211_ops { 1945struct cfg80211_ops {
1768 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 1946 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -1983,6 +2161,13 @@ struct cfg80211_ops {
1983 struct wireless_dev *wdev); 2161 struct wireless_dev *wdev);
1984 void (*stop_p2p_device)(struct wiphy *wiphy, 2162 void (*stop_p2p_device)(struct wiphy *wiphy,
1985 struct wireless_dev *wdev); 2163 struct wireless_dev *wdev);
2164
2165 int (*set_mac_acl)(struct wiphy *wiphy, struct net_device *dev,
2166 const struct cfg80211_acl_data *params);
2167
2168 int (*start_radar_detection)(struct wiphy *wiphy,
2169 struct net_device *dev,
2170 struct cfg80211_chan_def *chandef);
1986}; 2171};
1987 2172
1988/* 2173/*
@@ -2092,6 +2277,7 @@ struct ieee80211_iface_limit {
2092 * @beacon_int_infra_match: In this combination, the beacon intervals 2277 * @beacon_int_infra_match: In this combination, the beacon intervals
2093 * between infrastructure and AP types must match. This is required 2278 * between infrastructure and AP types must match. This is required
2094 * only in special cases. 2279 * only in special cases.
2280 * @radar_detect_widths: bitmap of channel widths supported for radar detection
2095 * 2281 *
2096 * These examples can be expressed as follows: 2282 * These examples can be expressed as follows:
2097 * 2283 *
@@ -2144,10 +2330,7 @@ struct ieee80211_iface_combination {
2144 u16 max_interfaces; 2330 u16 max_interfaces;
2145 u8 n_limits; 2331 u8 n_limits;
2146 bool beacon_int_infra_match; 2332 bool beacon_int_infra_match;
2147}; 2333 u8 radar_detect_widths;
2148
2149struct mac_address {
2150 u8 addr[ETH_ALEN];
2151}; 2334};
2152 2335
2153struct ieee80211_txrx_stypes { 2336struct ieee80211_txrx_stypes {
@@ -2181,6 +2364,14 @@ enum wiphy_wowlan_support_flags {
2181 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7), 2364 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7),
2182}; 2365};
2183 2366
2367struct wiphy_wowlan_tcp_support {
2368 const struct nl80211_wowlan_tcp_data_token_feature *tok;
2369 u32 data_payload_max;
2370 u32 data_interval_max;
2371 u32 wake_payload_max;
2372 bool seq;
2373};
2374
2184/** 2375/**
2185 * struct wiphy_wowlan_support - WoWLAN support data 2376 * struct wiphy_wowlan_support - WoWLAN support data
2186 * @flags: see &enum wiphy_wowlan_support_flags 2377 * @flags: see &enum wiphy_wowlan_support_flags
@@ -2188,12 +2379,16 @@ enum wiphy_wowlan_support_flags {
2188 * (see nl80211.h for the pattern definition) 2379 * (see nl80211.h for the pattern definition)
2189 * @pattern_max_len: maximum length of each pattern 2380 * @pattern_max_len: maximum length of each pattern
2190 * @pattern_min_len: minimum length of each pattern 2381 * @pattern_min_len: minimum length of each pattern
2382 * @max_pkt_offset: maximum Rx packet offset
2383 * @tcp: TCP wakeup support information
2191 */ 2384 */
2192struct wiphy_wowlan_support { 2385struct wiphy_wowlan_support {
2193 u32 flags; 2386 u32 flags;
2194 int n_patterns; 2387 int n_patterns;
2195 int pattern_max_len; 2388 int pattern_max_len;
2196 int pattern_min_len; 2389 int pattern_min_len;
2390 int max_pkt_offset;
2391 const struct wiphy_wowlan_tcp_support *tcp;
2197}; 2392};
2198 2393
2199/** 2394/**
@@ -2290,6 +2485,17 @@ struct wiphy_wowlan_support {
2290 * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features. 2485 * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features.
2291 * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden. 2486 * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden.
2292 * If null, then none can be over-ridden. 2487 * If null, then none can be over-ridden.
2488 *
2489 * @max_acl_mac_addrs: Maximum number of MAC addresses that the device
2490 * supports for ACL.
2491 *
2492 * @extended_capabilities: extended capabilities supported by the driver,
2493 * additional capabilities might be supported by userspace; these are
2494 * the 802.11 extended capabilities ("Extended Capabilities element")
2495 * and are in the same format as in the information element. See
2496 * 802.11-2012 8.4.2.29 for the defined fields.
2497 * @extended_capabilities_mask: mask of the valid values
2498 * @extended_capabilities_len: length of the extended capabilities
2293 */ 2499 */
2294struct wiphy { 2500struct wiphy {
2295 /* assign these fields before you register the wiphy */ 2501 /* assign these fields before you register the wiphy */
@@ -2311,6 +2517,8 @@ struct wiphy {
2311 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 2517 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
2312 u16 interface_modes; 2518 u16 interface_modes;
2313 2519
2520 u16 max_acl_mac_addrs;
2521
2314 u32 flags, features; 2522 u32 flags, features;
2315 2523
2316 u32 ap_sme_capa; 2524 u32 ap_sme_capa;
@@ -2333,7 +2541,7 @@ struct wiphy {
2333 u32 rts_threshold; 2541 u32 rts_threshold;
2334 u8 coverage_class; 2542 u8 coverage_class;
2335 2543
2336 char fw_version[ETHTOOL_BUSINFO_LEN]; 2544 char fw_version[ETHTOOL_FWVERS_LEN];
2337 u32 hw_version; 2545 u32 hw_version;
2338 2546
2339#ifdef CONFIG_PM 2547#ifdef CONFIG_PM
@@ -2354,6 +2562,9 @@ struct wiphy {
2354 */ 2562 */
2355 u32 probe_resp_offload; 2563 u32 probe_resp_offload;
2356 2564
2565 const u8 *extended_capabilities, *extended_capabilities_mask;
2566 u8 extended_capabilities_len;
2567
2357 /* If multiple wiphys are registered and you're handed e.g. 2568 /* If multiple wiphys are registered and you're handed e.g.
2358 * a regular netdev with assigned ieee80211_ptr, you won't 2569 * a regular netdev with assigned ieee80211_ptr, you won't
2359 * know whether it points to a wiphy your driver has registered 2570 * know whether it points to a wiphy your driver has registered
@@ -2364,12 +2575,12 @@ struct wiphy {
2364 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; 2575 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
2365 2576
2366 /* Lets us get back the wiphy on the callback */ 2577 /* Lets us get back the wiphy on the callback */
2367 int (*reg_notifier)(struct wiphy *wiphy, 2578 void (*reg_notifier)(struct wiphy *wiphy,
2368 struct regulatory_request *request); 2579 struct regulatory_request *request);
2369 2580
2370 /* fields below are read-only, assigned by cfg80211 */ 2581 /* fields below are read-only, assigned by cfg80211 */
2371 2582
2372 const struct ieee80211_regdomain *regd; 2583 const struct ieee80211_regdomain __rcu *regd;
2373 2584
2374 /* the item in /sys/class/ieee80211/ points to this, 2585 /* the item in /sys/class/ieee80211/ points to this,
2375 * you need use set_wiphy_dev() (see below) */ 2586 * you need use set_wiphy_dev() (see below) */
@@ -2392,7 +2603,7 @@ struct wiphy {
2392 const struct iw_handler_def *wext; 2603 const struct iw_handler_def *wext;
2393#endif 2604#endif
2394 2605
2395 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); 2606 char priv[0] __aligned(NETDEV_ALIGN);
2396}; 2607};
2397 2608
2398static inline struct net *wiphy_net(struct wiphy *wiphy) 2609static inline struct net *wiphy_net(struct wiphy *wiphy)
@@ -2409,6 +2620,7 @@ static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
2409 * wiphy_priv - return priv from wiphy 2620 * wiphy_priv - return priv from wiphy
2410 * 2621 *
2411 * @wiphy: the wiphy whose priv pointer to return 2622 * @wiphy: the wiphy whose priv pointer to return
2623 * Return: The priv of @wiphy.
2412 */ 2624 */
2413static inline void *wiphy_priv(struct wiphy *wiphy) 2625static inline void *wiphy_priv(struct wiphy *wiphy)
2414{ 2626{
@@ -2420,6 +2632,7 @@ static inline void *wiphy_priv(struct wiphy *wiphy)
2420 * priv_to_wiphy - return the wiphy containing the priv 2632 * priv_to_wiphy - return the wiphy containing the priv
2421 * 2633 *
2422 * @priv: a pointer previously returned by wiphy_priv 2634 * @priv: a pointer previously returned by wiphy_priv
2635 * Return: The wiphy of @priv.
2423 */ 2636 */
2424static inline struct wiphy *priv_to_wiphy(void *priv) 2637static inline struct wiphy *priv_to_wiphy(void *priv)
2425{ 2638{
@@ -2442,6 +2655,7 @@ static inline void set_wiphy_dev(struct wiphy *wiphy, struct device *dev)
2442 * wiphy_dev - get wiphy dev pointer 2655 * wiphy_dev - get wiphy dev pointer
2443 * 2656 *
2444 * @wiphy: The wiphy whose device struct to look up 2657 * @wiphy: The wiphy whose device struct to look up
2658 * Return: The dev of @wiphy.
2445 */ 2659 */
2446static inline struct device *wiphy_dev(struct wiphy *wiphy) 2660static inline struct device *wiphy_dev(struct wiphy *wiphy)
2447{ 2661{
@@ -2452,6 +2666,7 @@ static inline struct device *wiphy_dev(struct wiphy *wiphy)
2452 * wiphy_name - get wiphy name 2666 * wiphy_name - get wiphy name
2453 * 2667 *
2454 * @wiphy: The wiphy whose name to return 2668 * @wiphy: The wiphy whose name to return
2669 * Return: The name of @wiphy.
2455 */ 2670 */
2456static inline const char *wiphy_name(const struct wiphy *wiphy) 2671static inline const char *wiphy_name(const struct wiphy *wiphy)
2457{ 2672{
@@ -2467,8 +2682,8 @@ static inline const char *wiphy_name(const struct wiphy *wiphy)
2467 * Create a new wiphy and associate the given operations with it. 2682 * Create a new wiphy and associate the given operations with it.
2468 * @sizeof_priv bytes are allocated for private use. 2683 * @sizeof_priv bytes are allocated for private use.
2469 * 2684 *
2470 * The returned pointer must be assigned to each netdev's 2685 * Return: A pointer to the new wiphy. This pointer must be
2471 * ieee80211_ptr for proper operation. 2686 * assigned to each netdev's ieee80211_ptr for proper operation.
2472 */ 2687 */
2473struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv); 2688struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv);
2474 2689
@@ -2477,7 +2692,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv);
2477 * 2692 *
2478 * @wiphy: The wiphy to register. 2693 * @wiphy: The wiphy to register.
2479 * 2694 *
2480 * Returns a non-negative wiphy index or a negative error code. 2695 * Return: A non-negative wiphy index or a negative error code.
2481 */ 2696 */
2482extern int wiphy_register(struct wiphy *wiphy); 2697extern int wiphy_register(struct wiphy *wiphy);
2483 2698
@@ -2529,7 +2744,6 @@ struct cfg80211_cached_keys;
2529 * the user-set AP, monitor and WDS channel 2744 * the user-set AP, monitor and WDS channel
2530 * @preset_chan: (private) Used by the internal configuration code to 2745 * @preset_chan: (private) Used by the internal configuration code to
2531 * track the channel to be used for AP later 2746 * track the channel to be used for AP later
2532 * @preset_chantype: (private) the corresponding channel type
2533 * @bssid: (private) Used by the internal configuration code 2747 * @bssid: (private) Used by the internal configuration code
2534 * @ssid: (private) Used by the internal configuration code 2748 * @ssid: (private) Used by the internal configuration code
2535 * @ssid_len: (private) Used by the internal configuration code 2749 * @ssid_len: (private) Used by the internal configuration code
@@ -2548,6 +2762,8 @@ struct cfg80211_cached_keys;
2548 * beacons, 0 when not valid 2762 * beacons, 0 when not valid
2549 * @address: The address for this device, valid only if @netdev is %NULL 2763 * @address: The address for this device, valid only if @netdev is %NULL
2550 * @p2p_started: true if this is a P2P Device that has been started 2764 * @p2p_started: true if this is a P2P Device that has been started
2765 * @cac_started: true if DFS channel availability check has been started
2766 * @cac_start_time: timestamp (jiffies) when the dfs state was entered.
2551 */ 2767 */
2552struct wireless_dev { 2768struct wireless_dev {
2553 struct wiphy *wiphy; 2769 struct wiphy *wiphy;
@@ -2599,6 +2815,9 @@ struct wireless_dev {
2599 2815
2600 u32 ap_unexpected_nlportid; 2816 u32 ap_unexpected_nlportid;
2601 2817
2818 bool cac_started;
2819 unsigned long cac_start_time;
2820
2602#ifdef CONFIG_CFG80211_WEXT 2821#ifdef CONFIG_CFG80211_WEXT
2603 /* wext data */ 2822 /* wext data */
2604 struct { 2823 struct {
@@ -2626,6 +2845,7 @@ static inline u8 *wdev_address(struct wireless_dev *wdev)
2626 * wdev_priv - return wiphy priv from wireless_dev 2845 * wdev_priv - return wiphy priv from wireless_dev
2627 * 2846 *
2628 * @wdev: The wireless device whose wiphy's priv pointer to return 2847 * @wdev: The wireless device whose wiphy's priv pointer to return
2848 * Return: The wiphy priv of @wdev.
2629 */ 2849 */
2630static inline void *wdev_priv(struct wireless_dev *wdev) 2850static inline void *wdev_priv(struct wireless_dev *wdev)
2631{ 2851{
@@ -2643,12 +2863,14 @@ static inline void *wdev_priv(struct wireless_dev *wdev)
2643 * ieee80211_channel_to_frequency - convert channel number to frequency 2863 * ieee80211_channel_to_frequency - convert channel number to frequency
2644 * @chan: channel number 2864 * @chan: channel number
2645 * @band: band, necessary due to channel number overlap 2865 * @band: band, necessary due to channel number overlap
2866 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed.
2646 */ 2867 */
2647extern int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band); 2868extern int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band);
2648 2869
2649/** 2870/**
2650 * ieee80211_frequency_to_channel - convert frequency to channel number 2871 * ieee80211_frequency_to_channel - convert frequency to channel number
2651 * @freq: center frequency 2872 * @freq: center frequency
2873 * Return: The corresponding channel, or 0 if the conversion failed.
2652 */ 2874 */
2653extern int ieee80211_frequency_to_channel(int freq); 2875extern int ieee80211_frequency_to_channel(int freq);
2654 2876
@@ -2665,6 +2887,7 @@ extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
2665 * ieee80211_get_channel - get channel struct from wiphy for specified frequency 2887 * ieee80211_get_channel - get channel struct from wiphy for specified frequency
2666 * @wiphy: the struct wiphy to get the channel for 2888 * @wiphy: the struct wiphy to get the channel for
2667 * @freq: the center frequency of the channel 2889 * @freq: the center frequency of the channel
2890 * Return: The channel struct from @wiphy at @freq.
2668 */ 2891 */
2669static inline struct ieee80211_channel * 2892static inline struct ieee80211_channel *
2670ieee80211_get_channel(struct wiphy *wiphy, int freq) 2893ieee80211_get_channel(struct wiphy *wiphy, int freq)
@@ -2679,10 +2902,10 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
2679 * @basic_rates: bitmap of basic rates 2902 * @basic_rates: bitmap of basic rates
2680 * @bitrate: the bitrate for which to find the basic rate 2903 * @bitrate: the bitrate for which to find the basic rate
2681 * 2904 *
2682 * This function returns the basic rate corresponding to a given 2905 * Return: The basic rate corresponding to a given bitrate, that
2683 * bitrate, that is the next lower bitrate contained in the basic 2906 * is the next lower bitrate contained in the basic rate map,
2684 * rate map, which is, for this function, given as a bitmap of 2907 * which is, for this function, given as a bitmap of indices of
2685 * indices of rates in the band's bitrate table. 2908 * rates in the band's bitrate table.
2686 */ 2909 */
2687struct ieee80211_rate * 2910struct ieee80211_rate *
2688ieee80211_get_response_rate(struct ieee80211_supported_band *sband, 2911ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
@@ -2775,18 +2998,21 @@ extern const unsigned char bridge_tunnel_header[6];
2775/** 2998/**
2776 * ieee80211_get_hdrlen_from_skb - get header length from data 2999 * ieee80211_get_hdrlen_from_skb - get header length from data
2777 * 3000 *
3001 * @skb: the frame
3002 *
2778 * Given an skb with a raw 802.11 header at the data pointer this function 3003 * Given an skb with a raw 802.11 header at the data pointer this function
2779 * returns the 802.11 header length in bytes (not including encryption 3004 * returns the 802.11 header length.
2780 * headers). If the data in the sk_buff is too short to contain a valid 802.11
2781 * header the function returns 0.
2782 * 3005 *
2783 * @skb: the frame 3006 * Return: The 802.11 header length in bytes (not including encryption
3007 * headers). Or 0 if the data in the sk_buff is too short to contain a valid
3008 * 802.11 header.
2784 */ 3009 */
2785unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); 3010unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
2786 3011
2787/** 3012/**
2788 * ieee80211_hdrlen - get header length in bytes from frame control 3013 * ieee80211_hdrlen - get header length in bytes from frame control
2789 * @fc: frame control field in little-endian format 3014 * @fc: frame control field in little-endian format
3015 * Return: The header length in bytes.
2790 */ 3016 */
2791unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); 3017unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc);
2792 3018
@@ -2794,7 +3020,7 @@ unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc);
2794 * ieee80211_get_mesh_hdrlen - get mesh extension header length 3020 * ieee80211_get_mesh_hdrlen - get mesh extension header length
2795 * @meshhdr: the mesh extension header, only the flags field 3021 * @meshhdr: the mesh extension header, only the flags field
2796 * (first byte) will be accessed 3022 * (first byte) will be accessed
2797 * Returns the length of the extension header, which is always at 3023 * Return: The length of the extension header, which is always at
2798 * least 6 bytes and at most 18 if address 5 and 6 are present. 3024 * least 6 bytes and at most 18 if address 5 and 6 are present.
2799 */ 3025 */
2800unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr); 3026unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr);
@@ -2812,6 +3038,7 @@ unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr);
2812 * @skb: the 802.11 data frame 3038 * @skb: the 802.11 data frame
2813 * @addr: the device MAC address 3039 * @addr: the device MAC address
2814 * @iftype: the virtual interface type 3040 * @iftype: the virtual interface type
3041 * Return: 0 on success. Non-zero on error.
2815 */ 3042 */
2816int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, 3043int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
2817 enum nl80211_iftype iftype); 3044 enum nl80211_iftype iftype);
@@ -2823,6 +3050,7 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
2823 * @iftype: the virtual interface type 3050 * @iftype: the virtual interface type
2824 * @bssid: the network bssid (used only for iftype STATION and ADHOC) 3051 * @bssid: the network bssid (used only for iftype STATION and ADHOC)
2825 * @qos: build 802.11 QoS data frame 3052 * @qos: build 802.11 QoS data frame
3053 * Return: 0 on success, or a negative error code.
2826 */ 3054 */
2827int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr, 3055int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
2828 enum nl80211_iftype iftype, u8 *bssid, bool qos); 3056 enum nl80211_iftype iftype, u8 *bssid, bool qos);
@@ -2850,6 +3078,7 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
2850/** 3078/**
2851 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame 3079 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
2852 * @skb: the data frame 3080 * @skb: the data frame
3081 * Return: The 802.1p/1d tag.
2853 */ 3082 */
2854unsigned int cfg80211_classify8021d(struct sk_buff *skb); 3083unsigned int cfg80211_classify8021d(struct sk_buff *skb);
2855 3084
@@ -2860,12 +3089,13 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb);
2860 * @ies: data consisting of IEs 3089 * @ies: data consisting of IEs
2861 * @len: length of data 3090 * @len: length of data
2862 * 3091 *
2863 * This function will return %NULL if the element ID could 3092 * Return: %NULL if the element ID could not be found or if
2864 * not be found or if the element is invalid (claims to be 3093 * the element is invalid (claims to be longer than the given
2865 * longer than the given data), or a pointer to the first byte 3094 * data), or a pointer to the first byte of the requested
2866 * of the requested element, that is the byte containing the 3095 * element, that is the byte containing the element ID.
2867 * element ID. There are no checks on the element length 3096 *
2868 * other than having to fit into the given data. 3097 * Note: There are no checks on the element length other than
3098 * having to fit into the given data.
2869 */ 3099 */
2870const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); 3100const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len);
2871 3101
@@ -2877,12 +3107,13 @@ const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len);
2877 * @ies: data consisting of IEs 3107 * @ies: data consisting of IEs
2878 * @len: length of data 3108 * @len: length of data
2879 * 3109 *
2880 * This function will return %NULL if the vendor specific element ID 3110 * Return: %NULL if the vendor specific element ID could not be found or if the
2881 * could not be found or if the element is invalid (claims to be 3111 * element is invalid (claims to be longer than the given data), or a pointer to
2882 * longer than the given data), or a pointer to the first byte 3112 * the first byte of the requested element, that is the byte containing the
2883 * of the requested element, that is the byte containing the 3113 * element ID.
2884 * element ID. There are no checks on the element length 3114 *
2885 * other than having to fit into the given data. 3115 * Note: There are no checks on the element length other than having to fit into
3116 * the given data.
2886 */ 3117 */
2887const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type, 3118const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
2888 const u8 *ies, int len); 3119 const u8 *ies, int len);
@@ -2915,6 +3146,8 @@ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
2915 * 3146 *
2916 * Drivers should check the return value, its possible you can get 3147 * Drivers should check the return value, its possible you can get
2917 * an -ENOMEM. 3148 * an -ENOMEM.
3149 *
3150 * Return: 0 on success. -ENOMEM.
2918 */ 3151 */
2919extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); 3152extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
2920 3153
@@ -2938,28 +3171,22 @@ extern void wiphy_apply_custom_regulatory(
2938 * freq_reg_info - get regulatory information for the given frequency 3171 * freq_reg_info - get regulatory information for the given frequency
2939 * @wiphy: the wiphy for which we want to process this rule for 3172 * @wiphy: the wiphy for which we want to process this rule for
2940 * @center_freq: Frequency in KHz for which we want regulatory information for 3173 * @center_freq: Frequency in KHz for which we want regulatory information for
2941 * @desired_bw_khz: the desired max bandwidth you want to use per
2942 * channel. Note that this is still 20 MHz if you want to use HT40
2943 * as HT40 makes use of two channels for its 40 MHz width bandwidth.
2944 * If set to 0 we'll assume you want the standard 20 MHz.
2945 * @reg_rule: the regulatory rule which we have for this frequency
2946 * 3174 *
2947 * Use this function to get the regulatory rule for a specific frequency on 3175 * Use this function to get the regulatory rule for a specific frequency on
2948 * a given wireless device. If the device has a specific regulatory domain 3176 * a given wireless device. If the device has a specific regulatory domain
2949 * it wants to follow we respect that unless a country IE has been received 3177 * it wants to follow we respect that unless a country IE has been received
2950 * and processed already. 3178 * and processed already.
2951 * 3179 *
2952 * Returns 0 if it was able to find a valid regulatory rule which does 3180 * Return: A valid pointer, or, when an error occurs, for example if no rule
2953 * apply to the given center_freq otherwise it returns non-zero. It will 3181 * can be found, the return value is encoded using ERR_PTR(). Use IS_ERR() to
2954 * also return -ERANGE if we determine the given center_freq does not even have 3182 * check and PTR_ERR() to obtain the numeric return value. The numeric return
2955 * a regulatory rule for a frequency range in the center_freq's band. See 3183 * value will be -ERANGE if we determine the given center_freq does not even
2956 * freq_in_rule_band() for our current definition of a band -- this is purely 3184 * have a regulatory rule for a frequency range in the center_freq's band.
2957 * subjective and right now its 802.11 specific. 3185 * See freq_in_rule_band() for our current definition of a band -- this is
3186 * purely subjective and right now it's 802.11 specific.
2958 */ 3187 */
2959extern int freq_reg_info(struct wiphy *wiphy, 3188const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,
2960 u32 center_freq, 3189 u32 center_freq);
2961 u32 desired_bw_khz,
2962 const struct ieee80211_reg_rule **reg_rule);
2963 3190
2964/* 3191/*
2965 * callbacks for asynchronous cfg80211 methods, notification 3192 * callbacks for asynchronous cfg80211 methods, notification
@@ -3006,7 +3233,8 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
3006 * This informs cfg80211 that BSS information was found and 3233 * This informs cfg80211 that BSS information was found and
3007 * the BSS should be updated/added. 3234 * the BSS should be updated/added.
3008 * 3235 *
3009 * NOTE: Returns a referenced struct, must be released with cfg80211_put_bss()! 3236 * Return: A referenced struct, must be released with cfg80211_put_bss()!
3237 * Or %NULL on error.
3010 */ 3238 */
3011struct cfg80211_bss * __must_check 3239struct cfg80211_bss * __must_check
3012cfg80211_inform_bss_frame(struct wiphy *wiphy, 3240cfg80211_inform_bss_frame(struct wiphy *wiphy,
@@ -3031,7 +3259,8 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
3031 * This informs cfg80211 that BSS information was found and 3259 * This informs cfg80211 that BSS information was found and
3032 * the BSS should be updated/added. 3260 * the BSS should be updated/added.
3033 * 3261 *
3034 * NOTE: Returns a referenced struct, must be released with cfg80211_put_bss()! 3262 * Return: A referenced struct, must be released with cfg80211_put_bss()!
3263 * Or %NULL on error.
3035 */ 3264 */
3036struct cfg80211_bss * __must_check 3265struct cfg80211_bss * __must_check
3037cfg80211_inform_bss(struct wiphy *wiphy, 3266cfg80211_inform_bss(struct wiphy *wiphy,
@@ -3054,25 +3283,23 @@ cfg80211_get_ibss(struct wiphy *wiphy,
3054 WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS); 3283 WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
3055} 3284}
3056 3285
3057struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
3058 struct ieee80211_channel *channel,
3059 const u8 *meshid, size_t meshidlen,
3060 const u8 *meshcfg);
3061/** 3286/**
3062 * cfg80211_ref_bss - reference BSS struct 3287 * cfg80211_ref_bss - reference BSS struct
3288 * @wiphy: the wiphy this BSS struct belongs to
3063 * @bss: the BSS struct to reference 3289 * @bss: the BSS struct to reference
3064 * 3290 *
3065 * Increments the refcount of the given BSS struct. 3291 * Increments the refcount of the given BSS struct.
3066 */ 3292 */
3067void cfg80211_ref_bss(struct cfg80211_bss *bss); 3293void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3068 3294
3069/** 3295/**
3070 * cfg80211_put_bss - unref BSS struct 3296 * cfg80211_put_bss - unref BSS struct
3297 * @wiphy: the wiphy this BSS struct belongs to
3071 * @bss: the BSS struct 3298 * @bss: the BSS struct
3072 * 3299 *
3073 * Decrements the refcount of the given BSS struct. 3300 * Decrements the refcount of the given BSS struct.
3074 */ 3301 */
3075void cfg80211_put_bss(struct cfg80211_bss *bss); 3302void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3076 3303
3077/** 3304/**
3078 * cfg80211_unlink_bss - unlink BSS from internal data structures 3305 * cfg80211_unlink_bss - unlink BSS from internal data structures
@@ -3308,16 +3535,18 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
3308 * the testmode command. Since it is intended for a reply, calling 3535 * the testmode command. Since it is intended for a reply, calling
3309 * it outside of the @testmode_cmd operation is invalid. 3536 * it outside of the @testmode_cmd operation is invalid.
3310 * 3537 *
3311 * The returned skb (or %NULL if any errors happen) is pre-filled 3538 * The returned skb is pre-filled with the wiphy index and set up in
3312 * with the wiphy index and set up in a way that any data that is 3539 * a way that any data that is put into the skb (with skb_put(),
3313 * put into the skb (with skb_put(), nla_put() or similar) will end 3540 * nla_put() or similar) will end up being within the
3314 * up being within the %NL80211_ATTR_TESTDATA attribute, so all that 3541 * %NL80211_ATTR_TESTDATA attribute, so all that needs to be done
3315 * needs to be done with the skb is adding data for the corresponding 3542 * with the skb is adding data for the corresponding userspace tool
3316 * userspace tool which can then read that data out of the testdata 3543 * which can then read that data out of the testdata attribute. You
3317 * attribute. You must not modify the skb in any other way. 3544 * must not modify the skb in any other way.
3318 * 3545 *
3319 * When done, call cfg80211_testmode_reply() with the skb and return 3546 * When done, call cfg80211_testmode_reply() with the skb and return
3320 * its error code as the result of the @testmode_cmd operation. 3547 * its error code as the result of the @testmode_cmd operation.
3548 *
3549 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3321 */ 3550 */
3322struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, 3551struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy,
3323 int approxlen); 3552 int approxlen);
@@ -3327,11 +3556,12 @@ struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy,
3327 * @skb: The skb, must have been allocated with 3556 * @skb: The skb, must have been allocated with
3328 * cfg80211_testmode_alloc_reply_skb() 3557 * cfg80211_testmode_alloc_reply_skb()
3329 * 3558 *
3330 * Returns an error code or 0 on success, since calling this 3559 * Since calling this function will usually be the last thing
3331 * function will usually be the last thing before returning 3560 * before returning from the @testmode_cmd you should return
3332 * from the @testmode_cmd you should return the error code. 3561 * the error code. Note that this function consumes the skb
3333 * Note that this function consumes the skb regardless of the 3562 * regardless of the return value.
3334 * return value. 3563 *
3564 * Return: An error code or 0 on success.
3335 */ 3565 */
3336int cfg80211_testmode_reply(struct sk_buff *skb); 3566int cfg80211_testmode_reply(struct sk_buff *skb);
3337 3567
@@ -3345,14 +3575,16 @@ int cfg80211_testmode_reply(struct sk_buff *skb);
3345 * This function allocates and pre-fills an skb for an event on the 3575 * This function allocates and pre-fills an skb for an event on the
3346 * testmode multicast group. 3576 * testmode multicast group.
3347 * 3577 *
3348 * The returned skb (or %NULL if any errors happen) is set up in the 3578 * The returned skb is set up in the same way as with
3349 * same way as with cfg80211_testmode_alloc_reply_skb() but prepared 3579 * cfg80211_testmode_alloc_reply_skb() but prepared for an event. As
3350 * for an event. As there, you should simply add data to it that will 3580 * there, you should simply add data to it that will then end up in the
3351 * then end up in the %NL80211_ATTR_TESTDATA attribute. Again, you must 3581 * %NL80211_ATTR_TESTDATA attribute. Again, you must not modify the skb
3352 * not modify the skb in any other way. 3582 * in any other way.
3353 * 3583 *
3354 * When done filling the skb, call cfg80211_testmode_event() with the 3584 * When done filling the skb, call cfg80211_testmode_event() with the
3355 * skb to send the event. 3585 * skb to send the event.
3586 *
3587 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3356 */ 3588 */
3357struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, 3589struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
3358 int approxlen, gfp_t gfp); 3590 int approxlen, gfp_t gfp);
@@ -3533,13 +3765,13 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
3533 * @len: length of the frame data 3765 * @len: length of the frame data
3534 * @gfp: context flags 3766 * @gfp: context flags
3535 * 3767 *
3536 * Returns %true if a user space application has registered for this frame. 3768 * This function is called whenever an Action frame is received for a station
3769 * mode interface, but is not processed in kernel.
3770 *
3771 * Return: %true if a user space application has registered for this frame.
3537 * For action frames, that makes it responsible for rejecting unrecognized 3772 * For action frames, that makes it responsible for rejecting unrecognized
3538 * action frames; %false otherwise, in which case for action frames the 3773 * action frames; %false otherwise, in which case for action frames the
3539 * driver is responsible for rejecting the frame. 3774 * driver is responsible for rejecting the frame.
3540 *
3541 * This function is called whenever an Action frame is received for a station
3542 * mode interface, but is not processed in kernel.
3543 */ 3775 */
3544bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, 3776bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
3545 const u8 *buf, size_t len, gfp_t gfp); 3777 const u8 *buf, size_t len, gfp_t gfp);
@@ -3575,6 +3807,31 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
3575 gfp_t gfp); 3807 gfp_t gfp);
3576 3808
3577/** 3809/**
3810 * cfg80211_radar_event - radar detection event
3811 * @wiphy: the wiphy
3812 * @chandef: chandef for the current channel
3813 * @gfp: context flags
3814 *
3815 * This function is called when a radar is detected on the current chanenl.
3816 */
3817void cfg80211_radar_event(struct wiphy *wiphy,
3818 struct cfg80211_chan_def *chandef, gfp_t gfp);
3819
3820/**
3821 * cfg80211_cac_event - Channel availability check (CAC) event
3822 * @netdev: network device
3823 * @event: type of event
3824 * @gfp: context flags
3825 *
3826 * This function is called when a Channel availability check (CAC) is finished
3827 * or aborted. This must be called to notify the completion of a CAC process,
3828 * also by full-MAC drivers.
3829 */
3830void cfg80211_cac_event(struct net_device *netdev,
3831 enum nl80211_radar_event event, gfp_t gfp);
3832
3833
3834/**
3578 * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer 3835 * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer
3579 * @dev: network device 3836 * @dev: network device
3580 * @peer: peer's MAC address 3837 * @peer: peer's MAC address
@@ -3631,7 +3888,7 @@ void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index,
3631 * This function is used in AP mode (only!) to inform userspace that 3888 * This function is used in AP mode (only!) to inform userspace that
3632 * a spurious class 3 frame was received, to be able to deauth the 3889 * a spurious class 3 frame was received, to be able to deauth the
3633 * sender. 3890 * sender.
3634 * Returns %true if the frame was passed to userspace (or this failed 3891 * Return: %true if the frame was passed to userspace (or this failed
3635 * for a reason other than not having a subscription.) 3892 * for a reason other than not having a subscription.)
3636 */ 3893 */
3637bool cfg80211_rx_spurious_frame(struct net_device *dev, 3894bool cfg80211_rx_spurious_frame(struct net_device *dev,
@@ -3647,7 +3904,7 @@ bool cfg80211_rx_spurious_frame(struct net_device *dev,
3647 * an associated station sent a 4addr frame but that wasn't expected. 3904 * an associated station sent a 4addr frame but that wasn't expected.
3648 * It is allowed and desirable to send this event only once for each 3905 * It is allowed and desirable to send this event only once for each
3649 * station to avoid event flooding. 3906 * station to avoid event flooding.
3650 * Returns %true if the frame was passed to userspace (or this failed 3907 * Return: %true if the frame was passed to userspace (or this failed
3651 * for a reason other than not having a subscription.) 3908 * for a reason other than not having a subscription.)
3652 */ 3909 */
3653bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev, 3910bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev,
@@ -3685,8 +3942,8 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
3685 * @wiphy: the wiphy 3942 * @wiphy: the wiphy
3686 * @chandef: the channel definition 3943 * @chandef: the channel definition
3687 * 3944 *
3688 * This function returns true if there is no secondary channel or the secondary 3945 * Return: %true if there is no secondary channel or the secondary channel(s)
3689 * channel(s) can be used for beaconing (i.e. is not a radar channel etc.) 3946 * can be used for beaconing (i.e. is not a radar channel etc.)
3690 */ 3947 */
3691bool cfg80211_reg_can_beacon(struct wiphy *wiphy, 3948bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
3692 struct cfg80211_chan_def *chandef); 3949 struct cfg80211_chan_def *chandef);
@@ -3756,14 +4013,29 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev);
3756 * The function finds a given P2P attribute in the (vendor) IEs and 4013 * The function finds a given P2P attribute in the (vendor) IEs and
3757 * copies its contents to the given buffer. 4014 * copies its contents to the given buffer.
3758 * 4015 *
3759 * The return value is a negative error code (-%EILSEQ or -%ENOENT) if 4016 * Return: A negative error code (-%EILSEQ or -%ENOENT) if the data is
3760 * the data is malformed or the attribute can't be found (respectively), 4017 * malformed or the attribute can't be found (respectively), or the
3761 * or the length of the found attribute (which can be zero). 4018 * length of the found attribute (which can be zero).
3762 */ 4019 */
3763int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, 4020int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len,
3764 enum ieee80211_p2p_attr_id attr, 4021 enum ieee80211_p2p_attr_id attr,
3765 u8 *buf, unsigned int bufsize); 4022 u8 *buf, unsigned int bufsize);
3766 4023
4024/**
4025 * cfg80211_report_wowlan_wakeup - report wakeup from WoWLAN
4026 * @wdev: the wireless device reporting the wakeup
4027 * @wakeup: the wakeup report
4028 * @gfp: allocation flags
4029 *
4030 * This function reports that the given device woke up. If it
4031 * caused the wakeup, report the reason(s), otherwise you may
4032 * pass %NULL as the @wakeup parameter to advertise that something
4033 * else caused the wakeup.
4034 */
4035void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
4036 struct cfg80211_wowlan_wakeup *wakeup,
4037 gfp_t gfp);
4038
3767/* Logging, debugging and troubleshooting/diagnostic helpers. */ 4039/* Logging, debugging and troubleshooting/diagnostic helpers. */
3768 4040
3769/* wiphy_printk helpers, similar to dev_printk */ 4041/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/dn_route.h b/include/net/dn_route.h
index 4f7d6a182381..2e9d317c82dc 100644
--- a/include/net/dn_route.h
+++ b/include/net/dn_route.h
@@ -16,7 +16,7 @@
16*******************************************************************************/ 16*******************************************************************************/
17 17
18extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri); 18extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri);
19extern int dn_route_output_sock(struct dst_entry **pprt, struct flowidn *, struct sock *sk, int flags); 19extern int dn_route_output_sock(struct dst_entry __rcu **pprt, struct flowidn *, struct sock *sk, int flags);
20extern int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb); 20extern int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb);
21extern void dn_rt_cache_flush(int delay); 21extern void dn_rt_cache_flush(int delay);
22 22
diff --git a/include/net/dsfield.h b/include/net/dsfield.h
index 8a8d4e06900d..e1ad903a8d6a 100644
--- a/include/net/dsfield.h
+++ b/include/net/dsfield.h
@@ -43,11 +43,9 @@ static inline void ipv4_change_dsfield(struct iphdr *iph,__u8 mask,
43static inline void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask, 43static inline void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask,
44 __u8 value) 44 __u8 value)
45{ 45{
46 __u16 tmp; 46 __be16 *p = (__force __be16 *)ipv6h;
47 47
48 tmp = ntohs(*(__be16 *) ipv6h); 48 *p = (*p & htons((((u16)mask << 4) | 0xf00f))) | htons((u16)value << 4);
49 tmp = (tmp & ((mask << 4) | 0xf00f)) | (value << 4);
50 *(__be16 *) ipv6h = htons(tmp);
51} 49}
52 50
53 51
diff --git a/include/net/dst.h b/include/net/dst.h
index 9a7881066fb3..853cda11e518 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -36,13 +36,9 @@ struct dst_entry {
36 struct net_device *dev; 36 struct net_device *dev;
37 struct dst_ops *ops; 37 struct dst_ops *ops;
38 unsigned long _metrics; 38 unsigned long _metrics;
39 union { 39 unsigned long expires;
40 unsigned long expires;
41 /* point to where the dst_entry copied from */
42 struct dst_entry *from;
43 };
44 struct dst_entry *path; 40 struct dst_entry *path;
45 void *__pad0; 41 struct dst_entry *from;
46#ifdef CONFIG_XFRM 42#ifdef CONFIG_XFRM
47 struct xfrm_state *xfrm; 43 struct xfrm_state *xfrm;
48#else 44#else
@@ -61,6 +57,7 @@ struct dst_entry {
61#define DST_NOPEER 0x0040 57#define DST_NOPEER 0x0040
62#define DST_FAKE_RTABLE 0x0080 58#define DST_FAKE_RTABLE 0x0080
63#define DST_XFRM_TUNNEL 0x0100 59#define DST_XFRM_TUNNEL 0x0100
60#define DST_XFRM_QUEUE 0x0200
64 61
65 unsigned short pending_confirm; 62 unsigned short pending_confirm;
66 63
diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h
index e5062c955ea6..734d9b5f577a 100644
--- a/include/net/gro_cells.h
+++ b/include/net/gro_cells.h
@@ -73,8 +73,8 @@ static inline int gro_cells_init(struct gro_cells *gcells, struct net_device *de
73 int i; 73 int i;
74 74
75 gcells->gro_cells_mask = roundup_pow_of_two(netif_get_num_default_rss_queues()) - 1; 75 gcells->gro_cells_mask = roundup_pow_of_two(netif_get_num_default_rss_queues()) - 1;
76 gcells->cells = kcalloc(sizeof(struct gro_cell), 76 gcells->cells = kcalloc(gcells->gro_cells_mask + 1,
77 gcells->gro_cells_mask + 1, 77 sizeof(struct gro_cell),
78 GFP_KERNEL); 78 GFP_KERNEL);
79 if (!gcells->cells) 79 if (!gcells->cells)
80 return -ENOMEM; 80 return -ENOMEM;
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 9e34c877a770..7ca75cbbf75e 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -71,6 +71,8 @@ extern struct sock *__inet6_lookup_established(struct net *net,
71 71
72extern struct sock *inet6_lookup_listener(struct net *net, 72extern struct sock *inet6_lookup_listener(struct net *net,
73 struct inet_hashinfo *hashinfo, 73 struct inet_hashinfo *hashinfo,
74 const struct in6_addr *saddr,
75 const __be16 sport,
74 const struct in6_addr *daddr, 76 const struct in6_addr *daddr,
75 const unsigned short hnum, 77 const unsigned short hnum,
76 const int dif); 78 const int dif);
@@ -88,7 +90,8 @@ static inline struct sock *__inet6_lookup(struct net *net,
88 if (sk) 90 if (sk)
89 return sk; 91 return sk;
90 92
91 return inet6_lookup_listener(net, hashinfo, daddr, hnum, dif); 93 return inet6_lookup_listener(net, hashinfo, saddr, sport,
94 daddr, hnum, dif);
92} 95}
93 96
94static inline struct sock *__inet6_lookup_skb(struct inet_hashinfo *hashinfo, 97static inline struct sock *__inet6_lookup_skb(struct inet_hashinfo *hashinfo,
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 32786a044718..3f237db0a426 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -1,10 +1,17 @@
1#ifndef __NET_FRAG_H__ 1#ifndef __NET_FRAG_H__
2#define __NET_FRAG_H__ 2#define __NET_FRAG_H__
3 3
4#include <linux/percpu_counter.h>
5
4struct netns_frags { 6struct netns_frags {
5 int nqueues; 7 int nqueues;
6 atomic_t mem;
7 struct list_head lru_list; 8 struct list_head lru_list;
9 spinlock_t lru_lock;
10
11 /* The percpu_counter "mem" need to be cacheline aligned.
12 * mem.count must not share cacheline with other writers
13 */
14 struct percpu_counter mem ____cacheline_aligned_in_smp;
8 15
9 /* sysctls */ 16 /* sysctls */
10 int timeout; 17 int timeout;
@@ -13,12 +20,11 @@ struct netns_frags {
13}; 20};
14 21
15struct inet_frag_queue { 22struct inet_frag_queue {
16 struct hlist_node list;
17 struct netns_frags *net;
18 struct list_head lru_list; /* lru list member */
19 spinlock_t lock; 23 spinlock_t lock;
20 atomic_t refcnt;
21 struct timer_list timer; /* when will this queue expire? */ 24 struct timer_list timer; /* when will this queue expire? */
25 struct list_head lru_list; /* lru list member */
26 struct hlist_node list;
27 atomic_t refcnt;
22 struct sk_buff *fragments; /* list of received fragments */ 28 struct sk_buff *fragments; /* list of received fragments */
23 struct sk_buff *fragments_tail; 29 struct sk_buff *fragments_tail;
24 ktime_t stamp; 30 ktime_t stamp;
@@ -31,24 +37,29 @@ struct inet_frag_queue {
31#define INET_FRAG_LAST_IN 1 37#define INET_FRAG_LAST_IN 1
32 38
33 u16 max_size; 39 u16 max_size;
40
41 struct netns_frags *net;
34}; 42};
35 43
36#define INETFRAGS_HASHSZ 64 44#define INETFRAGS_HASHSZ 64
37 45
38struct inet_frags { 46struct inet_frags {
39 struct hlist_head hash[INETFRAGS_HASHSZ]; 47 struct hlist_head hash[INETFRAGS_HASHSZ];
40 rwlock_t lock; 48 /* This rwlock is a global lock (seperate per IPv4, IPv6 and
41 u32 rnd; 49 * netfilter). Important to keep this on a seperate cacheline.
42 int qsize; 50 */
51 rwlock_t lock ____cacheline_aligned_in_smp;
43 int secret_interval; 52 int secret_interval;
44 struct timer_list secret_timer; 53 struct timer_list secret_timer;
54 u32 rnd;
55 int qsize;
45 56
46 unsigned int (*hashfn)(struct inet_frag_queue *); 57 unsigned int (*hashfn)(struct inet_frag_queue *);
58 bool (*match)(struct inet_frag_queue *q, void *arg);
47 void (*constructor)(struct inet_frag_queue *q, 59 void (*constructor)(struct inet_frag_queue *q,
48 void *arg); 60 void *arg);
49 void (*destructor)(struct inet_frag_queue *); 61 void (*destructor)(struct inet_frag_queue *);
50 void (*skb_free)(struct sk_buff *); 62 void (*skb_free)(struct sk_buff *);
51 bool (*match)(struct inet_frag_queue *q, void *arg);
52 void (*frag_expire)(unsigned long data); 63 void (*frag_expire)(unsigned long data);
53}; 64};
54 65
@@ -72,4 +83,59 @@ static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f
72 inet_frag_destroy(q, f, NULL); 83 inet_frag_destroy(q, f, NULL);
73} 84}
74 85
86/* Memory Tracking Functions. */
87
88/* The default percpu_counter batch size is not big enough to scale to
89 * fragmentation mem acct sizes.
90 * The mem size of a 64K fragment is approx:
91 * (44 fragments * 2944 truesize) + frag_queue struct(200) = 129736 bytes
92 */
93static unsigned int frag_percpu_counter_batch = 130000;
94
95static inline int frag_mem_limit(struct netns_frags *nf)
96{
97 return percpu_counter_read(&nf->mem);
98}
99
100static inline void sub_frag_mem_limit(struct inet_frag_queue *q, int i)
101{
102 __percpu_counter_add(&q->net->mem, -i, frag_percpu_counter_batch);
103}
104
105static inline void add_frag_mem_limit(struct inet_frag_queue *q, int i)
106{
107 __percpu_counter_add(&q->net->mem, i, frag_percpu_counter_batch);
108}
109
110static inline void init_frag_mem_limit(struct netns_frags *nf)
111{
112 percpu_counter_init(&nf->mem, 0);
113}
114
115static inline int sum_frag_mem_limit(struct netns_frags *nf)
116{
117 return percpu_counter_sum_positive(&nf->mem);
118}
119
120static inline void inet_frag_lru_move(struct inet_frag_queue *q)
121{
122 spin_lock(&q->net->lru_lock);
123 list_move_tail(&q->lru_list, &q->net->lru_list);
124 spin_unlock(&q->net->lru_lock);
125}
126
127static inline void inet_frag_lru_del(struct inet_frag_queue *q)
128{
129 spin_lock(&q->net->lru_lock);
130 list_del(&q->lru_list);
131 spin_unlock(&q->net->lru_lock);
132}
133
134static inline void inet_frag_lru_add(struct netns_frags *nf,
135 struct inet_frag_queue *q)
136{
137 spin_lock(&nf->lru_lock);
138 list_add_tail(&q->lru_list, &nf->lru_list);
139 spin_unlock(&nf->lru_lock);
140}
75#endif 141#endif
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 67a8fa098e3a..7b2ae9d37076 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -81,7 +81,9 @@ struct inet_bind_bucket {
81 struct net *ib_net; 81 struct net *ib_net;
82#endif 82#endif
83 unsigned short port; 83 unsigned short port;
84 signed short fastreuse; 84 signed char fastreuse;
85 signed char fastreuseport;
86 kuid_t fastuid;
85 int num_owners; 87 int num_owners;
86 struct hlist_node node; 88 struct hlist_node node;
87 struct hlist_head owners; 89 struct hlist_head owners;
@@ -257,15 +259,19 @@ extern void inet_unhash(struct sock *sk);
257 259
258extern struct sock *__inet_lookup_listener(struct net *net, 260extern struct sock *__inet_lookup_listener(struct net *net,
259 struct inet_hashinfo *hashinfo, 261 struct inet_hashinfo *hashinfo,
262 const __be32 saddr,
263 const __be16 sport,
260 const __be32 daddr, 264 const __be32 daddr,
261 const unsigned short hnum, 265 const unsigned short hnum,
262 const int dif); 266 const int dif);
263 267
264static inline struct sock *inet_lookup_listener(struct net *net, 268static inline struct sock *inet_lookup_listener(struct net *net,
265 struct inet_hashinfo *hashinfo, 269 struct inet_hashinfo *hashinfo,
270 __be32 saddr, __be16 sport,
266 __be32 daddr, __be16 dport, int dif) 271 __be32 daddr, __be16 dport, int dif)
267{ 272{
268 return __inet_lookup_listener(net, hashinfo, daddr, ntohs(dport), dif); 273 return __inet_lookup_listener(net, hashinfo, saddr, sport,
274 daddr, ntohs(dport), dif);
269} 275}
270 276
271/* Socket demux engine toys. */ 277/* Socket demux engine toys. */
@@ -358,7 +364,8 @@ static inline struct sock *__inet_lookup(struct net *net,
358 struct sock *sk = __inet_lookup_established(net, hashinfo, 364 struct sock *sk = __inet_lookup_established(net, hashinfo,
359 saddr, sport, daddr, hnum, dif); 365 saddr, sport, daddr, hnum, dif);
360 366
361 return sk ? : __inet_lookup_listener(net, hashinfo, daddr, hnum, dif); 367 return sk ? : __inet_lookup_listener(net, hashinfo, saddr, sport,
368 daddr, hnum, dif);
362} 369}
363 370
364static inline struct sock *inet_lookup(struct net *net, 371static inline struct sock *inet_lookup(struct net *net,
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
index 652d3d309357..7686e3f5033d 100644
--- a/include/net/ip6_checksum.h
+++ b/include/net/ip6_checksum.h
@@ -35,63 +35,10 @@
35#include <linux/ipv6.h> 35#include <linux/ipv6.h>
36 36
37#ifndef _HAVE_ARCH_IPV6_CSUM 37#ifndef _HAVE_ARCH_IPV6_CSUM
38 38__sum16 csum_ipv6_magic(const struct in6_addr *saddr,
39static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, 39 const struct in6_addr *daddr,
40 const struct in6_addr *daddr, 40 __u32 len, unsigned short proto,
41 __u32 len, unsigned short proto, 41 __wsum csum);
42 __wsum csum)
43{
44
45 int carry;
46 __u32 ulen;
47 __u32 uproto;
48 __u32 sum = (__force u32)csum;
49
50 sum += (__force u32)saddr->s6_addr32[0];
51 carry = (sum < (__force u32)saddr->s6_addr32[0]);
52 sum += carry;
53
54 sum += (__force u32)saddr->s6_addr32[1];
55 carry = (sum < (__force u32)saddr->s6_addr32[1]);
56 sum += carry;
57
58 sum += (__force u32)saddr->s6_addr32[2];
59 carry = (sum < (__force u32)saddr->s6_addr32[2]);
60 sum += carry;
61
62 sum += (__force u32)saddr->s6_addr32[3];
63 carry = (sum < (__force u32)saddr->s6_addr32[3]);
64 sum += carry;
65
66 sum += (__force u32)daddr->s6_addr32[0];
67 carry = (sum < (__force u32)daddr->s6_addr32[0]);
68 sum += carry;
69
70 sum += (__force u32)daddr->s6_addr32[1];
71 carry = (sum < (__force u32)daddr->s6_addr32[1]);
72 sum += carry;
73
74 sum += (__force u32)daddr->s6_addr32[2];
75 carry = (sum < (__force u32)daddr->s6_addr32[2]);
76 sum += carry;
77
78 sum += (__force u32)daddr->s6_addr32[3];
79 carry = (sum < (__force u32)daddr->s6_addr32[3]);
80 sum += carry;
81
82 ulen = (__force u32)htonl((__u32) len);
83 sum += ulen;
84 carry = (sum < ulen);
85 sum += carry;
86
87 uproto = (__force u32)htonl(proto);
88 sum += uproto;
89 carry = (sum < uproto);
90 sum += carry;
91
92 return csum_fold((__force __wsum)sum);
93}
94
95#endif 42#endif
96 43
97static __inline__ __sum16 tcp_v6_check(int len, 44static __inline__ __sum16 tcp_v6_check(int len,
@@ -126,4 +73,5 @@ static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
126 __tcp_v6_send_check(skb, &np->saddr, &np->daddr); 73 __tcp_v6_send_check(skb, &np->saddr, &np->daddr);
127} 74}
128 75
76int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto);
129#endif 77#endif
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index fdc48a94a063..2a601e7da1bf 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -89,8 +89,6 @@ struct fib6_table;
89struct rt6_info { 89struct rt6_info {
90 struct dst_entry dst; 90 struct dst_entry dst;
91 91
92 struct neighbour *n;
93
94 /* 92 /*
95 * Tail elements of dst_entry (__refcnt etc.) 93 * Tail elements of dst_entry (__refcnt etc.)
96 * and these elements (rarely used in hot path) are in 94 * and these elements (rarely used in hot path) are in
@@ -166,50 +164,35 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
166 164
167static inline void rt6_clean_expires(struct rt6_info *rt) 165static inline void rt6_clean_expires(struct rt6_info *rt)
168{ 166{
169 if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from)
170 dst_release(rt->dst.from);
171
172 rt->rt6i_flags &= ~RTF_EXPIRES; 167 rt->rt6i_flags &= ~RTF_EXPIRES;
173 rt->dst.from = NULL;
174} 168}
175 169
176static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires) 170static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
177{ 171{
178 if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from)
179 dst_release(rt->dst.from);
180
181 rt->rt6i_flags |= RTF_EXPIRES;
182 rt->dst.expires = expires; 172 rt->dst.expires = expires;
173 rt->rt6i_flags |= RTF_EXPIRES;
183} 174}
184 175
185static inline void rt6_update_expires(struct rt6_info *rt, int timeout) 176static inline void rt6_update_expires(struct rt6_info *rt0, int timeout)
186{ 177{
187 if (!(rt->rt6i_flags & RTF_EXPIRES)) { 178 struct rt6_info *rt;
188 if (rt->dst.from) 179
189 dst_release(rt->dst.from); 180 for (rt = rt0; rt && !(rt->rt6i_flags & RTF_EXPIRES);
190 /* dst_set_expires relies on expires == 0 181 rt = (struct rt6_info *)rt->dst.from);
191 * if it has not been set previously. 182 if (rt && rt != rt0)
192 */ 183 rt0->dst.expires = rt->dst.expires;
193 rt->dst.expires = 0; 184
194 } 185 dst_set_expires(&rt0->dst, timeout);
195 186 rt0->rt6i_flags |= RTF_EXPIRES;
196 dst_set_expires(&rt->dst, timeout);
197 rt->rt6i_flags |= RTF_EXPIRES;
198} 187}
199 188
200static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from) 189static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from)
201{ 190{
202 struct dst_entry *new = (struct dst_entry *) from; 191 struct dst_entry *new = (struct dst_entry *) from;
203 192
204 if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) {
205 if (new == rt->dst.from)
206 return;
207 dst_release(rt->dst.from);
208 }
209
210 rt->rt6i_flags &= ~RTF_EXPIRES; 193 rt->rt6i_flags &= ~RTF_EXPIRES;
211 rt->dst.from = new;
212 dst_hold(new); 194 dst_hold(new);
195 rt->dst.from = new;
213} 196}
214 197
215static inline void ip6_rt_put(struct rt6_info *rt) 198static inline void ip6_rt_put(struct rt6_info *rt)
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 27d83183e615..260f83f16bcf 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -23,6 +23,7 @@ struct route_info {
23#include <net/sock.h> 23#include <net/sock.h>
24#include <linux/ip.h> 24#include <linux/ip.h>
25#include <linux/ipv6.h> 25#include <linux/ipv6.h>
26#include <linux/route.h>
26 27
27#define RT6_LOOKUP_F_IFACE 0x00000001 28#define RT6_LOOKUP_F_IFACE 0x00000001
28#define RT6_LOOKUP_F_REACHABLE 0x00000002 29#define RT6_LOOKUP_F_REACHABLE 0x00000002
@@ -102,7 +103,6 @@ extern struct rt6_info *rt6_lookup(struct net *net,
102 int oif, int flags); 103 int oif, int flags);
103 104
104extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev, 105extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
105 struct neighbour *neigh,
106 struct flowi6 *fl6); 106 struct flowi6 *fl6);
107extern int icmp6_dst_gc(void); 107extern int icmp6_dst_gc(void);
108 108
@@ -194,4 +194,11 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
194 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); 194 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
195} 195}
196 196
197static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *dest)
198{
199 if (rt->rt6i_flags & RTF_GATEWAY)
200 return &rt->rt6i_gateway;
201 return dest;
202}
203
197#endif 204#endif
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 5af66b26ebdd..851d5412a299 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -222,6 +222,7 @@ struct ip6_flowlabel {
222 struct in6_addr dst; 222 struct in6_addr dst;
223 struct ipv6_txoptions *opt; 223 struct ipv6_txoptions *opt;
224 unsigned long linger; 224 unsigned long linger;
225 struct rcu_head rcu;
225 u8 share; 226 u8 share;
226 union { 227 union {
227 struct pid *pid; 228 struct pid *pid;
@@ -238,6 +239,7 @@ struct ip6_flowlabel {
238struct ipv6_fl_socklist { 239struct ipv6_fl_socklist {
239 struct ipv6_fl_socklist *next; 240 struct ipv6_fl_socklist *next;
240 struct ip6_flowlabel *fl; 241 struct ip6_flowlabel *fl;
242 struct rcu_head rcu;
241}; 243};
242 244
243extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label); 245extern struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label);
@@ -288,12 +290,12 @@ static inline int ip6_frag_nqueues(struct net *net)
288 290
289static inline int ip6_frag_mem(struct net *net) 291static inline int ip6_frag_mem(struct net *net)
290{ 292{
291 return atomic_read(&net->ipv6.frags.mem); 293 return sum_frag_mem_limit(&net->ipv6.frags);
292} 294}
293#endif 295#endif
294 296
295#define IPV6_FRAG_HIGH_THRESH (256 * 1024) /* 262144 */ 297#define IPV6_FRAG_HIGH_THRESH (4 * 1024*1024) /* 4194304 */
296#define IPV6_FRAG_LOW_THRESH (192 * 1024) /* 196608 */ 298#define IPV6_FRAG_LOW_THRESH (3 * 1024*1024) /* 3145728 */
297#define IPV6_FRAG_TIMEOUT (60 * HZ) /* 60 seconds */ 299#define IPV6_FRAG_TIMEOUT (60 * HZ) /* 60 seconds */
298 300
299extern int __ipv6_addr_type(const struct in6_addr *addr); 301extern int __ipv6_addr_type(const struct in6_addr *addr);
@@ -355,14 +357,32 @@ static inline void ipv6_addr_prefix(struct in6_addr *pfx,
355 pfx->s6_addr[o] = addr->s6_addr[o] & (0xff00 >> b); 357 pfx->s6_addr[o] = addr->s6_addr[o] & (0xff00 >> b);
356} 358}
357 359
360static inline void __ipv6_addr_set_half(__be32 *addr,
361 __be32 wh, __be32 wl)
362{
363#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
364#if defined(__BIG_ENDIAN)
365 if (__builtin_constant_p(wh) && __builtin_constant_p(wl)) {
366 *(__force u64 *)addr = ((__force u64)(wh) << 32 | (__force u64)(wl));
367 return;
368 }
369#elif defined(__LITTLE_ENDIAN)
370 if (__builtin_constant_p(wl) && __builtin_constant_p(wh)) {
371 *(__force u64 *)addr = ((__force u64)(wl) << 32 | (__force u64)(wh));
372 return;
373 }
374#endif
375#endif
376 addr[0] = wh;
377 addr[1] = wl;
378}
379
358static inline void ipv6_addr_set(struct in6_addr *addr, 380static inline void ipv6_addr_set(struct in6_addr *addr,
359 __be32 w1, __be32 w2, 381 __be32 w1, __be32 w2,
360 __be32 w3, __be32 w4) 382 __be32 w3, __be32 w4)
361{ 383{
362 addr->s6_addr32[0] = w1; 384 __ipv6_addr_set_half(&addr->s6_addr32[0], w1, w2);
363 addr->s6_addr32[1] = w2; 385 __ipv6_addr_set_half(&addr->s6_addr32[2], w3, w4);
364 addr->s6_addr32[2] = w3;
365 addr->s6_addr32[3] = w4;
366} 386}
367 387
368static inline bool ipv6_addr_equal(const struct in6_addr *a1, 388static inline bool ipv6_addr_equal(const struct in6_addr *a1,
@@ -381,9 +401,37 @@ static inline bool ipv6_addr_equal(const struct in6_addr *a1,
381#endif 401#endif
382} 402}
383 403
384static inline bool __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, 404#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
385 unsigned int prefixlen) 405static inline bool __ipv6_prefix_equal64_half(const __be64 *a1,
406 const __be64 *a2,
407 unsigned int len)
408{
409 if (len && ((*a1 ^ *a2) & cpu_to_be64((~0UL) << (64 - len))))
410 return false;
411 return true;
412}
413
414static inline bool ipv6_prefix_equal(const struct in6_addr *addr1,
415 const struct in6_addr *addr2,
416 unsigned int prefixlen)
417{
418 const __be64 *a1 = (const __be64 *)addr1;
419 const __be64 *a2 = (const __be64 *)addr2;
420
421 if (prefixlen >= 64) {
422 if (a1[0] ^ a2[0])
423 return false;
424 return __ipv6_prefix_equal64_half(a1 + 1, a2 + 1, prefixlen - 64);
425 }
426 return __ipv6_prefix_equal64_half(a1, a2, prefixlen);
427}
428#else
429static inline bool ipv6_prefix_equal(const struct in6_addr *addr1,
430 const struct in6_addr *addr2,
431 unsigned int prefixlen)
386{ 432{
433 const __be32 *a1 = addr1->s6_addr32;
434 const __be32 *a2 = addr2->s6_addr32;
387 unsigned int pdw, pbi; 435 unsigned int pdw, pbi;
388 436
389 /* check complete u32 in prefix */ 437 /* check complete u32 in prefix */
@@ -398,14 +446,7 @@ static inline bool __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2,
398 446
399 return true; 447 return true;
400} 448}
401 449#endif
402static inline bool ipv6_prefix_equal(const struct in6_addr *a1,
403 const struct in6_addr *a2,
404 unsigned int prefixlen)
405{
406 return __ipv6_prefix_equal(a1->s6_addr32, a2->s6_addr32,
407 prefixlen);
408}
409 450
410struct inet_frag_queue; 451struct inet_frag_queue;
411 452
@@ -475,14 +516,25 @@ static inline u32 ipv6_addr_hash(const struct in6_addr *a)
475 516
476static inline bool ipv6_addr_loopback(const struct in6_addr *a) 517static inline bool ipv6_addr_loopback(const struct in6_addr *a)
477{ 518{
519#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
520 const unsigned long *ul = (const unsigned long *)a;
521
522 return (ul[0] | (ul[1] ^ cpu_to_be64(1))) == 0UL;
523#else
478 return (a->s6_addr32[0] | a->s6_addr32[1] | 524 return (a->s6_addr32[0] | a->s6_addr32[1] |
479 a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0; 525 a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0;
526#endif
480} 527}
481 528
482static inline bool ipv6_addr_v4mapped(const struct in6_addr *a) 529static inline bool ipv6_addr_v4mapped(const struct in6_addr *a)
483{ 530{
484 return (a->s6_addr32[0] | a->s6_addr32[1] | 531 return (
485 (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0; 532#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
533 *(__be64 *)a |
534#else
535 (a->s6_addr32[0] | a->s6_addr32[1]) |
536#endif
537 (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0UL;
486} 538}
487 539
488/* 540/*
@@ -507,7 +559,7 @@ static inline void ipv6_addr_set_v4mapped(const __be32 addr,
507 * find the first different bit between two addresses 559 * find the first different bit between two addresses
508 * length of address must be a multiple of 32bits 560 * length of address must be a multiple of 32bits
509 */ 561 */
510static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen) 562static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen)
511{ 563{
512 const __be32 *a1 = token1, *a2 = token2; 564 const __be32 *a1 = token1, *a2 = token2;
513 int i; 565 int i;
@@ -539,6 +591,33 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a
539 return addrlen << 5; 591 return addrlen << 5;
540} 592}
541 593
594#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
595static inline int __ipv6_addr_diff64(const void *token1, const void *token2, int addrlen)
596{
597 const __be64 *a1 = token1, *a2 = token2;
598 int i;
599
600 addrlen >>= 3;
601
602 for (i = 0; i < addrlen; i++) {
603 __be64 xb = a1[i] ^ a2[i];
604 if (xb)
605 return i * 64 + 63 - __fls(be64_to_cpu(xb));
606 }
607
608 return addrlen << 6;
609}
610#endif
611
612static inline int __ipv6_addr_diff(const void *token1, const void *token2, int addrlen)
613{
614#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
615 if (__builtin_constant_p(addrlen) && !(addrlen & 7))
616 return __ipv6_addr_diff64(token1, token2, addrlen);
617#endif
618 return __ipv6_addr_diff32(token1, token2, addrlen);
619}
620
542static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2) 621static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2)
543{ 622{
544 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); 623 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
@@ -547,6 +626,20 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
547extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); 626extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
548 627
549/* 628/*
629 * Header manipulation
630 */
631static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
632 __be32 flowlabel)
633{
634 *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | flowlabel;
635}
636
637static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr)
638{
639 return *(__be32 *)hdr & IPV6_FLOWINFO_MASK;
640}
641
642/*
550 * Prototypes exported by ipv6 643 * Prototypes exported by ipv6
551 */ 644 */
552 645
@@ -570,13 +663,6 @@ extern int ip6_xmit(struct sock *sk,
570 struct ipv6_txoptions *opt, 663 struct ipv6_txoptions *opt,
571 int tclass); 664 int tclass);
572 665
573extern int ip6_nd_hdr(struct sock *sk,
574 struct sk_buff *skb,
575 struct net_device *dev,
576 const struct in6_addr *saddr,
577 const struct in6_addr *daddr,
578 int proto, int len);
579
580extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr); 666extern int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr);
581 667
582extern int ip6_append_data(struct sock *sk, 668extern int ip6_append_data(struct sock *sk,
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ee50c5eba50c..f7eba1300d82 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -147,10 +147,12 @@ struct ieee80211_low_level_stats {
147 * enum ieee80211_chanctx_change - change flag for channel context 147 * enum ieee80211_chanctx_change - change flag for channel context
148 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed 148 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
149 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed 149 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
150 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
150 */ 151 */
151enum ieee80211_chanctx_change { 152enum ieee80211_chanctx_change {
152 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 153 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
153 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 154 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
155 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
154}; 156};
155 157
156/** 158/**
@@ -165,6 +167,7 @@ enum ieee80211_chanctx_change {
165 * @rx_chains_dynamic: The number of RX chains that must be enabled 167 * @rx_chains_dynamic: The number of RX chains that must be enabled
166 * after RTS/CTS handshake to receive SMPS MIMO transmissions; 168 * after RTS/CTS handshake to receive SMPS MIMO transmissions;
167 * this will always be >= @rx_chains_static. 169 * this will always be >= @rx_chains_static.
170 * @radar_enabled: whether radar detection is enabled on this channel.
168 * @drv_priv: data area for driver use, will always be aligned to 171 * @drv_priv: data area for driver use, will always be aligned to
169 * sizeof(void *), size is determined in hw information. 172 * sizeof(void *), size is determined in hw information.
170 */ 173 */
@@ -173,7 +176,9 @@ struct ieee80211_chanctx_conf {
173 176
174 u8 rx_chains_static, rx_chains_dynamic; 177 u8 rx_chains_static, rx_chains_dynamic;
175 178
176 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 179 bool radar_enabled;
180
181 u8 drv_priv[0] __aligned(sizeof(void *));
177}; 182};
178 183
179/** 184/**
@@ -208,6 +213,11 @@ struct ieee80211_chanctx_conf {
208 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface 213 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface
209 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) 214 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS)
210 * changed (currently only in P2P client mode, GO mode will be later) 215 * changed (currently only in P2P client mode, GO mode will be later)
216 * @BSS_CHANGED_DTIM_PERIOD: the DTIM period value was changed (set when
217 * it becomes valid, managed mode only)
218 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed,
219 * note that this is only called when it changes after the channel
220 * context had been assigned.
211 */ 221 */
212enum ieee80211_bss_change { 222enum ieee80211_bss_change {
213 BSS_CHANGED_ASSOC = 1<<0, 223 BSS_CHANGED_ASSOC = 1<<0,
@@ -230,6 +240,8 @@ enum ieee80211_bss_change {
230 BSS_CHANGED_PS = 1<<17, 240 BSS_CHANGED_PS = 1<<17,
231 BSS_CHANGED_TXPOWER = 1<<18, 241 BSS_CHANGED_TXPOWER = 1<<18,
232 BSS_CHANGED_P2P_PS = 1<<19, 242 BSS_CHANGED_P2P_PS = 1<<19,
243 BSS_CHANGED_DTIM_PERIOD = 1<<20,
244 BSS_CHANGED_BANDWIDTH = 1<<21,
233 245
234 /* when adding here, make sure to change ieee80211_reconfig */ 246 /* when adding here, make sure to change ieee80211_reconfig */
235}; 247};
@@ -271,13 +283,19 @@ enum ieee80211_rssi_event {
271 * if the hardware cannot handle this it must set the 283 * if the hardware cannot handle this it must set the
272 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag 284 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag
273 * @dtim_period: num of beacons before the next DTIM, for beaconing, 285 * @dtim_period: num of beacons before the next DTIM, for beaconing,
274 * valid in station mode only while @assoc is true and if also 286 * valid in station mode only if after the driver was notified
275 * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf 287 * with the %BSS_CHANGED_DTIM_PERIOD flag, will be non-zero then.
276 * @ps_dtim_period)
277 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old 288 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old
278 * as it may have been received during scanning long ago) 289 * as it may have been received during scanning long ago). If the
290 * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can
291 * only come from a beacon, but might not become valid until after
292 * association when a beacon is received (which is notified with the
293 * %BSS_CHANGED_DTIM flag.)
279 * @sync_device_ts: the device timestamp corresponding to the sync_tsf, 294 * @sync_device_ts: the device timestamp corresponding to the sync_tsf,
280 * the driver/device can use this to calculate synchronisation 295 * the driver/device can use this to calculate synchronisation
296 * (see @sync_tsf)
297 * @sync_dtim_count: Only valid when %IEEE80211_HW_TIMING_BEACON_ONLY
298 * is requested, see @sync_tsf/@sync_device_ts.
281 * @beacon_int: beacon interval 299 * @beacon_int: beacon interval
282 * @assoc_capability: capabilities taken from assoc resp 300 * @assoc_capability: capabilities taken from assoc resp
283 * @basic_rates: bitmap of basic rates, each bit stands for an 301 * @basic_rates: bitmap of basic rates, each bit stands for an
@@ -297,11 +315,9 @@ enum ieee80211_rssi_event {
297 * may filter ARP queries targeted for other addresses than listed here. 315 * may filter ARP queries targeted for other addresses than listed here.
298 * The driver must allow ARP queries targeted for all address listed here 316 * The driver must allow ARP queries targeted for all address listed here
299 * to pass through. An empty list implies no ARP queries need to pass. 317 * to pass through. An empty list implies no ARP queries need to pass.
300 * @arp_addr_cnt: Number of addresses currently on the list. 318 * @arp_addr_cnt: Number of addresses currently on the list. Note that this
301 * @arp_filter_enabled: Enable ARP filtering - if enabled, the hardware may 319 * may be larger than %IEEE80211_BSS_ARP_ADDR_LIST_LEN (the arp_addr_list
302 * filter ARP queries based on the @arp_addr_list, if disabled, the 320 * array size), it's up to the driver what to do in that case.
303 * hardware must not perform any ARP filtering. Note, that the filter will
304 * be enabled also in promiscuous mode.
305 * @qos: This is a QoS-enabled BSS. 321 * @qos: This is a QoS-enabled BSS.
306 * @idle: This interface is idle. There's also a global idle flag in the 322 * @idle: This interface is idle. There's also a global idle flag in the
307 * hardware config which may be more appropriate depending on what 323 * hardware config which may be more appropriate depending on what
@@ -331,6 +347,7 @@ struct ieee80211_bss_conf {
331 u16 assoc_capability; 347 u16 assoc_capability;
332 u64 sync_tsf; 348 u64 sync_tsf;
333 u32 sync_device_ts; 349 u32 sync_device_ts;
350 u8 sync_dtim_count;
334 u32 basic_rates; 351 u32 basic_rates;
335 int mcast_rate[IEEE80211_NUM_BANDS]; 352 int mcast_rate[IEEE80211_NUM_BANDS];
336 u16 ht_operation_mode; 353 u16 ht_operation_mode;
@@ -338,8 +355,7 @@ struct ieee80211_bss_conf {
338 u32 cqm_rssi_hyst; 355 u32 cqm_rssi_hyst;
339 struct cfg80211_chan_def chandef; 356 struct cfg80211_chan_def chandef;
340 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; 357 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN];
341 u8 arp_addr_cnt; 358 int arp_addr_cnt;
342 bool arp_filter_enabled;
343 bool qos; 359 bool qos;
344 bool idle; 360 bool idle;
345 bool ps; 361 bool ps;
@@ -392,6 +408,9 @@ struct ieee80211_bss_conf {
392 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be 408 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be
393 * set by rate control algorithms to indicate probe rate, will 409 * set by rate control algorithms to indicate probe rate, will
394 * be cleared for fragmented frames (except on the last fragment) 410 * be cleared for fragmented frames (except on the last fragment)
411 * @IEEE80211_TX_INTFL_OFFCHAN_TX_OK: Internal to mac80211. Used to indicate
412 * that a frame can be transmitted while the queues are stopped for
413 * off-channel operation.
395 * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, 414 * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211,
396 * used to indicate that a pending frame requires TX processing before 415 * used to indicate that a pending frame requires TX processing before
397 * it can be sent out. 416 * it can be sent out.
@@ -409,6 +428,9 @@ struct ieee80211_bss_conf {
409 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted 428 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted
410 * after TX status because the destination was asleep, it must not 429 * after TX status because the destination was asleep, it must not
411 * be modified again (no seqno assignment, crypto, etc.) 430 * be modified again (no seqno assignment, crypto, etc.)
431 * @IEEE80211_TX_INTFL_MLME_CONN_TX: This frame was transmitted by the MLME
432 * code for connection establishment, this indicates that its status
433 * should kick the MLME state machine.
412 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 434 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211
413 * MLME command (internal to mac80211 to figure out whether to send TX 435 * MLME command (internal to mac80211 to figure out whether to send TX
414 * status to user space) 436 * status to user space)
@@ -454,13 +476,14 @@ enum mac80211_tx_control_flags {
454 IEEE80211_TX_STAT_AMPDU = BIT(10), 476 IEEE80211_TX_STAT_AMPDU = BIT(10),
455 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), 477 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11),
456 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), 478 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
479 IEEE80211_TX_INTFL_OFFCHAN_TX_OK = BIT(13),
457 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 480 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
458 IEEE80211_TX_INTFL_RETRIED = BIT(15), 481 IEEE80211_TX_INTFL_RETRIED = BIT(15),
459 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), 482 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
460 IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17), 483 IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17),
461 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), 484 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
462 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), 485 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19),
463 /* hole at 20, use later */ 486 IEEE80211_TX_INTFL_MLME_CONN_TX = BIT(20),
464 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), 487 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
465 IEEE80211_TX_CTL_LDPC = BIT(22), 488 IEEE80211_TX_CTL_LDPC = BIT(22),
466 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), 489 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24),
@@ -953,6 +976,7 @@ enum ieee80211_smps_mode {
953 * 976 *
954 * @channel: the channel to tune to 977 * @channel: the channel to tune to
955 * @channel_type: the channel (HT) type 978 * @channel_type: the channel (HT) type
979 * @radar_enabled: whether radar detection is enabled
956 * 980 *
957 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame 981 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
958 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 982 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
@@ -979,6 +1003,7 @@ struct ieee80211_conf {
979 1003
980 struct ieee80211_channel *channel; 1004 struct ieee80211_channel *channel;
981 enum nl80211_channel_type channel_type; 1005 enum nl80211_channel_type channel_type;
1006 bool radar_enabled;
982 enum ieee80211_smps_mode smps_mode; 1007 enum ieee80211_smps_mode smps_mode;
983}; 1008};
984 1009
@@ -1059,7 +1084,7 @@ struct ieee80211_vif {
1059 u32 driver_flags; 1084 u32 driver_flags;
1060 1085
1061 /* must be last */ 1086 /* must be last */
1062 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 1087 u8 drv_priv[0] __aligned(sizeof(void *));
1063}; 1088};
1064 1089
1065static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) 1090static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
@@ -1176,6 +1201,24 @@ enum ieee80211_sta_state {
1176}; 1201};
1177 1202
1178/** 1203/**
1204 * enum ieee80211_sta_rx_bandwidth - station RX bandwidth
1205 * @IEEE80211_STA_RX_BW_20: station can only receive 20 MHz
1206 * @IEEE80211_STA_RX_BW_40: station can receive up to 40 MHz
1207 * @IEEE80211_STA_RX_BW_80: station can receive up to 80 MHz
1208 * @IEEE80211_STA_RX_BW_160: station can receive up to 160 MHz
1209 * (including 80+80 MHz)
1210 *
1211 * Implementation note: 20 must be zero to be initialized
1212 * correctly, the values must be sorted.
1213 */
1214enum ieee80211_sta_rx_bandwidth {
1215 IEEE80211_STA_RX_BW_20 = 0,
1216 IEEE80211_STA_RX_BW_40,
1217 IEEE80211_STA_RX_BW_80,
1218 IEEE80211_STA_RX_BW_160,
1219};
1220
1221/**
1179 * struct ieee80211_sta - station table entry 1222 * struct ieee80211_sta - station table entry
1180 * 1223 *
1181 * A station table entry represents a station we are possibly 1224 * A station table entry represents a station we are possibly
@@ -1197,6 +1240,12 @@ enum ieee80211_sta_state {
1197 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid 1240 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
1198 * if wme is supported. 1241 * if wme is supported.
1199 * @max_sp: max Service Period. Only valid if wme is supported. 1242 * @max_sp: max Service Period. Only valid if wme is supported.
1243 * @bandwidth: current bandwidth the station can receive with
1244 * @rx_nss: in HT/VHT, the maximum number of spatial streams the
1245 * station can receive at the moment, changed by operating mode
1246 * notifications and capabilities. The value is only valid after
1247 * the station moves to associated state.
1248 * @smps_mode: current SMPS mode (off, static or dynamic)
1200 */ 1249 */
1201struct ieee80211_sta { 1250struct ieee80211_sta {
1202 u32 supp_rates[IEEE80211_NUM_BANDS]; 1251 u32 supp_rates[IEEE80211_NUM_BANDS];
@@ -1207,9 +1256,12 @@ struct ieee80211_sta {
1207 bool wme; 1256 bool wme;
1208 u8 uapsd_queues; 1257 u8 uapsd_queues;
1209 u8 max_sp; 1258 u8 max_sp;
1259 u8 rx_nss;
1260 enum ieee80211_sta_rx_bandwidth bandwidth;
1261 enum ieee80211_smps_mode smps_mode;
1210 1262
1211 /* must be last */ 1263 /* must be last */
1212 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 1264 u8 drv_priv[0] __aligned(sizeof(void *));
1213}; 1265};
1214 1266
1215/** 1267/**
@@ -1331,9 +1383,9 @@ struct ieee80211_tx_control {
1331 * When this flag is set, signaling beacon-loss will cause an immediate 1383 * When this flag is set, signaling beacon-loss will cause an immediate
1332 * change to disassociated state. 1384 * change to disassociated state.
1333 * 1385 *
1334 * @IEEE80211_HW_NEED_DTIM_PERIOD: 1386 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC:
1335 * This device needs to know the DTIM period for the BSS before 1387 * This device needs to get data from beacon before association (i.e.
1336 * associating. 1388 * dtim_period).
1337 * 1389 *
1338 * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports 1390 * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports
1339 * per-station GTKs as used by IBSS RSN or during fast transition. If 1391 * per-station GTKs as used by IBSS RSN or during fast transition. If
@@ -1353,10 +1405,6 @@ struct ieee80211_tx_control {
1353 * setup strictly in HW. mac80211 should not attempt to do this in 1405 * setup strictly in HW. mac80211 should not attempt to do this in
1354 * software. 1406 * software.
1355 * 1407 *
1356 * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while
1357 * being idle (i.e. mac80211 doesn't have to go idle-off during the
1358 * the scan).
1359 *
1360 * @IEEE80211_HW_WANT_MONITOR_VIF: The driver would like to be informed of 1408 * @IEEE80211_HW_WANT_MONITOR_VIF: The driver would like to be informed of
1361 * a virtual monitor interface when monitor interfaces are the only 1409 * a virtual monitor interface when monitor interfaces are the only
1362 * active interfaces. 1410 * active interfaces.
@@ -1370,9 +1418,8 @@ struct ieee80211_tx_control {
1370 * P2P Interface. This will be honoured even if more than one interface 1418 * P2P Interface. This will be honoured even if more than one interface
1371 * is supported. 1419 * is supported.
1372 * 1420 *
1373 * @IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL: On this hardware TX BA session 1421 * @IEEE80211_HW_TIMING_BEACON_ONLY: Use sync timing from beacon frames
1374 * should be tear down once BAR frame will not be acked. 1422 * only, to allow getting TBTT of a DTIM beacon.
1375 *
1376 */ 1423 */
1377enum ieee80211_hw_flags { 1424enum ieee80211_hw_flags {
1378 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1425 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1382,7 +1429,7 @@ enum ieee80211_hw_flags {
1382 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, 1429 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
1383 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, 1430 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5,
1384 IEEE80211_HW_SIGNAL_DBM = 1<<6, 1431 IEEE80211_HW_SIGNAL_DBM = 1<<6,
1385 IEEE80211_HW_NEED_DTIM_PERIOD = 1<<7, 1432 IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC = 1<<7,
1386 IEEE80211_HW_SPECTRUM_MGMT = 1<<8, 1433 IEEE80211_HW_SPECTRUM_MGMT = 1<<8,
1387 IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, 1434 IEEE80211_HW_AMPDU_AGGREGATION = 1<<9,
1388 IEEE80211_HW_SUPPORTS_PS = 1<<10, 1435 IEEE80211_HW_SUPPORTS_PS = 1<<10,
@@ -1399,9 +1446,8 @@ enum ieee80211_hw_flags {
1399 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, 1446 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1400 IEEE80211_HW_AP_LINK_PS = 1<<22, 1447 IEEE80211_HW_AP_LINK_PS = 1<<22,
1401 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, 1448 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
1402 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24,
1403 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, 1449 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25,
1404 IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL = 1<<26, 1450 IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26,
1405}; 1451};
1406 1452
1407/** 1453/**
@@ -1522,6 +1568,8 @@ struct ieee80211_hw {
1522 * structure can then access it via hw->priv. Note that mac802111 drivers should 1568 * structure can then access it via hw->priv. Note that mac802111 drivers should
1523 * not use wiphy_priv() to try to get their private driver structure as this 1569 * not use wiphy_priv() to try to get their private driver structure as this
1524 * is already used internally by mac80211. 1570 * is already used internally by mac80211.
1571 *
1572 * Return: The mac80211 driver hw struct of @wiphy.
1525 */ 1573 */
1526struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy); 1574struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy);
1527 1575
@@ -1628,6 +1676,10 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1628 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is 1676 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is
1629 * provided by update_tkip_key only. The trigger that makes mac80211 call this 1677 * provided by update_tkip_key only. The trigger that makes mac80211 call this
1630 * handler is software decryption with wrap around of iv16. 1678 * handler is software decryption with wrap around of iv16.
1679 *
1680 * The set_default_unicast_key() call updates the default WEP key index
1681 * configured to the hardware for WEP encryption type. This is required
1682 * for devices that support offload of data packets (e.g. ARP responses).
1631 */ 1683 */
1632 1684
1633/** 1685/**
@@ -1680,15 +1732,6 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1680 * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS 1732 * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS
1681 * enabled whenever user has enabled powersave. 1733 * enabled whenever user has enabled powersave.
1682 * 1734 *
1683 * Some hardware need to toggle a single shared antenna between WLAN and
1684 * Bluetooth to facilitate co-existence. These types of hardware set
1685 * limitations on the use of host controlled dynamic powersave whenever there
1686 * is simultaneous WLAN and Bluetooth traffic. For these types of hardware, the
1687 * driver may request temporarily going into full power save, in order to
1688 * enable toggling the antenna between BT and WLAN. If the driver requests
1689 * disabling dynamic powersave, the @dynamic_ps_timeout value will be
1690 * temporarily set to zero until the driver re-enables dynamic powersave.
1691 *
1692 * Driver informs U-APSD client support by enabling 1735 * Driver informs U-APSD client support by enabling
1693 * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the 1736 * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the
1694 * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS 1737 * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS
@@ -2033,17 +2076,29 @@ enum ieee80211_filter_flags {
2033 * calling ieee80211_start_tx_ba_cb_irqsafe, because the peer 2076 * calling ieee80211_start_tx_ba_cb_irqsafe, because the peer
2034 * might receive the addBA frame and send a delBA right away! 2077 * might receive the addBA frame and send a delBA right away!
2035 * 2078 *
2036 * @IEEE80211_AMPDU_RX_START: start Rx aggregation 2079 * @IEEE80211_AMPDU_RX_START: start RX aggregation
2037 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation 2080 * @IEEE80211_AMPDU_RX_STOP: stop RX aggregation
2038 * @IEEE80211_AMPDU_TX_START: start Tx aggregation 2081 * @IEEE80211_AMPDU_TX_START: start TX aggregation
2039 * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation
2040 * @IEEE80211_AMPDU_TX_OPERATIONAL: TX aggregation has become operational 2082 * @IEEE80211_AMPDU_TX_OPERATIONAL: TX aggregation has become operational
2083 * @IEEE80211_AMPDU_TX_STOP_CONT: stop TX aggregation but continue transmitting
2084 * queued packets, now unaggregated. After all packets are transmitted the
2085 * driver has to call ieee80211_stop_tx_ba_cb_irqsafe().
2086 * @IEEE80211_AMPDU_TX_STOP_FLUSH: stop TX aggregation and flush all packets,
2087 * called when the station is removed. There's no need or reason to call
2088 * ieee80211_stop_tx_ba_cb_irqsafe() in this case as mac80211 assumes the
2089 * session is gone and removes the station.
2090 * @IEEE80211_AMPDU_TX_STOP_FLUSH_CONT: called when TX aggregation is stopped
2091 * but the driver hasn't called ieee80211_stop_tx_ba_cb_irqsafe() yet and
2092 * now the connection is dropped and the station will be removed. Drivers
2093 * should clean up and drop remaining packets when this is called.
2041 */ 2094 */
2042enum ieee80211_ampdu_mlme_action { 2095enum ieee80211_ampdu_mlme_action {
2043 IEEE80211_AMPDU_RX_START, 2096 IEEE80211_AMPDU_RX_START,
2044 IEEE80211_AMPDU_RX_STOP, 2097 IEEE80211_AMPDU_RX_STOP,
2045 IEEE80211_AMPDU_TX_START, 2098 IEEE80211_AMPDU_TX_START,
2046 IEEE80211_AMPDU_TX_STOP, 2099 IEEE80211_AMPDU_TX_STOP_CONT,
2100 IEEE80211_AMPDU_TX_STOP_FLUSH,
2101 IEEE80211_AMPDU_TX_STOP_FLUSH_CONT,
2047 IEEE80211_AMPDU_TX_OPERATIONAL, 2102 IEEE80211_AMPDU_TX_OPERATIONAL,
2048}; 2103};
2049 2104
@@ -2062,16 +2117,21 @@ enum ieee80211_frame_release_type {
2062 * enum ieee80211_rate_control_changed - flags to indicate what changed 2117 * enum ieee80211_rate_control_changed - flags to indicate what changed
2063 * 2118 *
2064 * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit 2119 * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit
2065 * to this station changed. 2120 * to this station changed. The actual bandwidth is in the station
2121 * information -- for HT20/40 the IEEE80211_HT_CAP_SUP_WIDTH_20_40
2122 * flag changes, for HT and VHT the bandwidth field changes.
2066 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed. 2123 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed.
2067 * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer 2124 * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer
2068 * changed (in IBSS mode) due to discovering more information about 2125 * changed (in IBSS mode) due to discovering more information about
2069 * the peer. 2126 * the peer.
2127 * @IEEE80211_RC_NSS_CHANGED: N_SS (number of spatial streams) was changed
2128 * by the peer
2070 */ 2129 */
2071enum ieee80211_rate_control_changed { 2130enum ieee80211_rate_control_changed {
2072 IEEE80211_RC_BW_CHANGED = BIT(0), 2131 IEEE80211_RC_BW_CHANGED = BIT(0),
2073 IEEE80211_RC_SMPS_CHANGED = BIT(1), 2132 IEEE80211_RC_SMPS_CHANGED = BIT(1),
2074 IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2), 2133 IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2),
2134 IEEE80211_RC_NSS_CHANGED = BIT(3),
2075}; 2135};
2076 2136
2077/** 2137/**
@@ -2152,6 +2212,18 @@ enum ieee80211_rate_control_changed {
2152 * MAC address of the device going away. 2212 * MAC address of the device going away.
2153 * Hence, this callback must be implemented. It can sleep. 2213 * Hence, this callback must be implemented. It can sleep.
2154 * 2214 *
2215 * @add_interface_debugfs: Drivers can use this callback to add debugfs files
2216 * when a vif is added to mac80211. This callback and
2217 * @remove_interface_debugfs should be within a CONFIG_MAC80211_DEBUGFS
2218 * conditional. @remove_interface_debugfs must be provided for cleanup.
2219 * This callback can sleep.
2220 *
2221 * @remove_interface_debugfs: Remove the debugfs files which were added using
2222 * @add_interface_debugfs. This callback must remove all debugfs entries
2223 * that were added because mac80211 only removes interface debugfs when the
2224 * interface is destroyed, not when it is removed from the driver.
2225 * This callback can sleep.
2226 *
2155 * @config: Handler for configuration requests. IEEE 802.11 code calls this 2227 * @config: Handler for configuration requests. IEEE 802.11 code calls this
2156 * function to change hardware configuration, e.g., channel. 2228 * function to change hardware configuration, e.g., channel.
2157 * This function should never fail but returns a negative error code 2229 * This function should never fail but returns a negative error code
@@ -2194,6 +2266,10 @@ enum ieee80211_rate_control_changed {
2194 * After rekeying was done it should (for example during resume) notify 2266 * After rekeying was done it should (for example during resume) notify
2195 * userspace of the new replay counter using ieee80211_gtk_rekey_notify(). 2267 * userspace of the new replay counter using ieee80211_gtk_rekey_notify().
2196 * 2268 *
2269 * @set_default_unicast_key: Set the default (unicast) key index, useful for
2270 * WEP when the device sends data packets autonomously, e.g. for ARP
2271 * offloading. The index can be 0-3, or -1 for unsetting it.
2272 *
2197 * @hw_scan: Ask the hardware to service the scan request, no need to start 2273 * @hw_scan: Ask the hardware to service the scan request, no need to start
2198 * the scan state machine in stack. The scan must honour the channel 2274 * the scan state machine in stack. The scan must honour the channel
2199 * configuration done by the regulatory agent in the wiphy's 2275 * configuration done by the regulatory agent in the wiphy's
@@ -2474,7 +2550,13 @@ enum ieee80211_rate_control_changed {
2474 * 2550 *
2475 * @restart_complete: Called after a call to ieee80211_restart_hw(), when the 2551 * @restart_complete: Called after a call to ieee80211_restart_hw(), when the
2476 * reconfiguration has completed. This can help the driver implement the 2552 * reconfiguration has completed. This can help the driver implement the
2477 * reconfiguration step. This callback may sleep. 2553 * reconfiguration step. Also called when reconfiguring because the
2554 * driver's resume function returned 1, as this is just like an "inline"
2555 * hardware restart. This callback may sleep.
2556 *
2557 * @ipv6_addr_change: IPv6 address assignment on the given interface changed.
2558 * Currently, this is only called for managed or P2P client interfaces.
2559 * This callback is optional; it must not sleep.
2478 */ 2560 */
2479struct ieee80211_ops { 2561struct ieee80211_ops {
2480 void (*tx)(struct ieee80211_hw *hw, 2562 void (*tx)(struct ieee80211_hw *hw,
@@ -2522,6 +2604,8 @@ struct ieee80211_ops {
2522 void (*set_rekey_data)(struct ieee80211_hw *hw, 2604 void (*set_rekey_data)(struct ieee80211_hw *hw,
2523 struct ieee80211_vif *vif, 2605 struct ieee80211_vif *vif,
2524 struct cfg80211_gtk_rekey_data *data); 2606 struct cfg80211_gtk_rekey_data *data);
2607 void (*set_default_unicast_key)(struct ieee80211_hw *hw,
2608 struct ieee80211_vif *vif, int idx);
2525 int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2609 int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2526 struct cfg80211_scan_request *req); 2610 struct cfg80211_scan_request *req);
2527 void (*cancel_hw_scan)(struct ieee80211_hw *hw, 2611 void (*cancel_hw_scan)(struct ieee80211_hw *hw,
@@ -2553,6 +2637,12 @@ struct ieee80211_ops {
2553 struct ieee80211_vif *vif, 2637 struct ieee80211_vif *vif,
2554 struct ieee80211_sta *sta, 2638 struct ieee80211_sta *sta,
2555 struct dentry *dir); 2639 struct dentry *dir);
2640 void (*add_interface_debugfs)(struct ieee80211_hw *hw,
2641 struct ieee80211_vif *vif,
2642 struct dentry *dir);
2643 void (*remove_interface_debugfs)(struct ieee80211_hw *hw,
2644 struct ieee80211_vif *vif,
2645 struct dentry *dir);
2556#endif 2646#endif
2557 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2647 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2558 enum sta_notify_cmd, struct ieee80211_sta *sta); 2648 enum sta_notify_cmd, struct ieee80211_sta *sta);
@@ -2606,6 +2696,7 @@ struct ieee80211_ops {
2606 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2696 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2607 const struct cfg80211_bitrate_mask *mask); 2697 const struct cfg80211_bitrate_mask *mask);
2608 void (*rssi_callback)(struct ieee80211_hw *hw, 2698 void (*rssi_callback)(struct ieee80211_hw *hw,
2699 struct ieee80211_vif *vif,
2609 enum ieee80211_rssi_event rssi_event); 2700 enum ieee80211_rssi_event rssi_event);
2610 2701
2611 void (*allow_buffered_frames)(struct ieee80211_hw *hw, 2702 void (*allow_buffered_frames)(struct ieee80211_hw *hw,
@@ -2648,6 +2739,12 @@ struct ieee80211_ops {
2648 struct ieee80211_chanctx_conf *ctx); 2739 struct ieee80211_chanctx_conf *ctx);
2649 2740
2650 void (*restart_complete)(struct ieee80211_hw *hw); 2741 void (*restart_complete)(struct ieee80211_hw *hw);
2742
2743#if IS_ENABLED(CONFIG_IPV6)
2744 void (*ipv6_addr_change)(struct ieee80211_hw *hw,
2745 struct ieee80211_vif *vif,
2746 struct inet6_dev *idev);
2747#endif
2651}; 2748};
2652 2749
2653/** 2750/**
@@ -2661,6 +2758,8 @@ struct ieee80211_ops {
2661 * 2758 *
2662 * @priv_data_len: length of private data 2759 * @priv_data_len: length of private data
2663 * @ops: callbacks for this device 2760 * @ops: callbacks for this device
2761 *
2762 * Return: A pointer to the new hardware device, or %NULL on error.
2664 */ 2763 */
2665struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, 2764struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
2666 const struct ieee80211_ops *ops); 2765 const struct ieee80211_ops *ops);
@@ -2673,6 +2772,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
2673 * need to fill the contained wiphy's information. 2772 * need to fill the contained wiphy's information.
2674 * 2773 *
2675 * @hw: the device to register as returned by ieee80211_alloc_hw() 2774 * @hw: the device to register as returned by ieee80211_alloc_hw()
2775 *
2776 * Return: 0 on success. An error code otherwise.
2676 */ 2777 */
2677int ieee80211_register_hw(struct ieee80211_hw *hw); 2778int ieee80211_register_hw(struct ieee80211_hw *hw);
2678 2779
@@ -2719,6 +2820,8 @@ extern char *__ieee80211_create_tpt_led_trigger(
2719 * of the trigger so you can automatically link the LED device. 2820 * of the trigger so you can automatically link the LED device.
2720 * 2821 *
2721 * @hw: the hardware to get the LED trigger name for 2822 * @hw: the hardware to get the LED trigger name for
2823 *
2824 * Return: The name of the LED trigger. %NULL if not configured for LEDs.
2722 */ 2825 */
2723static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw) 2826static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw)
2724{ 2827{
@@ -2738,6 +2841,8 @@ static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw)
2738 * of the trigger so you can automatically link the LED device. 2841 * of the trigger so you can automatically link the LED device.
2739 * 2842 *
2740 * @hw: the hardware to get the LED trigger name for 2843 * @hw: the hardware to get the LED trigger name for
2844 *
2845 * Return: The name of the LED trigger. %NULL if not configured for LEDs.
2741 */ 2846 */
2742static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw) 2847static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw)
2743{ 2848{
@@ -2757,6 +2862,8 @@ static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw)
2757 * of the trigger so you can automatically link the LED device. 2862 * of the trigger so you can automatically link the LED device.
2758 * 2863 *
2759 * @hw: the hardware to get the LED trigger name for 2864 * @hw: the hardware to get the LED trigger name for
2865 *
2866 * Return: The name of the LED trigger. %NULL if not configured for LEDs.
2760 */ 2867 */
2761static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw) 2868static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw)
2762{ 2869{
@@ -2776,6 +2883,8 @@ static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw)
2776 * of the trigger so you can automatically link the LED device. 2883 * of the trigger so you can automatically link the LED device.
2777 * 2884 *
2778 * @hw: the hardware to get the LED trigger name for 2885 * @hw: the hardware to get the LED trigger name for
2886 *
2887 * Return: The name of the LED trigger. %NULL if not configured for LEDs.
2779 */ 2888 */
2780static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) 2889static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
2781{ 2890{
@@ -2793,9 +2902,10 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
2793 * @blink_table: the blink table -- needs to be ordered by throughput 2902 * @blink_table: the blink table -- needs to be ordered by throughput
2794 * @blink_table_len: size of the blink table 2903 * @blink_table_len: size of the blink table
2795 * 2904 *
2796 * This function returns %NULL (in case of error, or if no LED 2905 * Return: %NULL (in case of error, or if no LED triggers are
2797 * triggers are configured) or the name of the new trigger. 2906 * configured) or the name of the new trigger.
2798 * This function must be called before ieee80211_register_hw(). 2907 *
2908 * Note: This function must be called before ieee80211_register_hw().
2799 */ 2909 */
2800static inline char * 2910static inline char *
2801ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags, 2911ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags,
@@ -2928,10 +3038,10 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw,
2928 * Calls to this function for a single hardware must be synchronized against 3038 * Calls to this function for a single hardware must be synchronized against
2929 * each other. 3039 * each other.
2930 * 3040 *
2931 * The function returns -EINVAL when the requested PS mode is already set.
2932 *
2933 * @sta: currently connected sta 3041 * @sta: currently connected sta
2934 * @start: start or stop PS 3042 * @start: start or stop PS
3043 *
3044 * Return: 0 on success. -EINVAL when the requested PS mode is already set.
2935 */ 3045 */
2936int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start); 3046int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start);
2937 3047
@@ -2945,6 +3055,8 @@ int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start);
2945 * 3055 *
2946 * @sta: currently connected sta 3056 * @sta: currently connected sta
2947 * @start: start or stop PS 3057 * @start: start or stop PS
3058 *
3059 * Return: Like ieee80211_sta_ps_transition().
2948 */ 3060 */
2949static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta, 3061static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta,
2950 bool start) 3062 bool start)
@@ -3082,6 +3194,8 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets);
3082 * according to the current DTIM parameters/TIM bitmap. 3194 * according to the current DTIM parameters/TIM bitmap.
3083 * 3195 *
3084 * The driver is responsible for freeing the returned skb. 3196 * The driver is responsible for freeing the returned skb.
3197 *
3198 * Return: The beacon template. %NULL on error.
3085 */ 3199 */
3086struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, 3200struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
3087 struct ieee80211_vif *vif, 3201 struct ieee80211_vif *vif,
@@ -3093,6 +3207,8 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
3093 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3207 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3094 * 3208 *
3095 * See ieee80211_beacon_get_tim(). 3209 * See ieee80211_beacon_get_tim().
3210 *
3211 * Return: See ieee80211_beacon_get_tim().
3096 */ 3212 */
3097static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 3213static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3098 struct ieee80211_vif *vif) 3214 struct ieee80211_vif *vif)
@@ -3109,6 +3225,8 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3109 * hardware. The destination address should be set by the caller. 3225 * hardware. The destination address should be set by the caller.
3110 * 3226 *
3111 * Can only be called in AP mode. 3227 * Can only be called in AP mode.
3228 *
3229 * Return: The Probe Response template. %NULL on error.
3112 */ 3230 */
3113struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw, 3231struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw,
3114 struct ieee80211_vif *vif); 3232 struct ieee80211_vif *vif);
@@ -3124,6 +3242,8 @@ struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw,
3124 * 3242 *
3125 * Note: Caller (or hardware) is responsible for setting the 3243 * Note: Caller (or hardware) is responsible for setting the
3126 * &IEEE80211_FCTL_PM bit. 3244 * &IEEE80211_FCTL_PM bit.
3245 *
3246 * Return: The PS Poll template. %NULL on error.
3127 */ 3247 */
3128struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw, 3248struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
3129 struct ieee80211_vif *vif); 3249 struct ieee80211_vif *vif);
@@ -3139,6 +3259,8 @@ struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
3139 * 3259 *
3140 * Note: Caller (or hardware) is responsible for setting the 3260 * Note: Caller (or hardware) is responsible for setting the
3141 * &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields. 3261 * &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields.
3262 *
3263 * Return: The nullfunc template. %NULL on error.
3142 */ 3264 */
3143struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw, 3265struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
3144 struct ieee80211_vif *vif); 3266 struct ieee80211_vif *vif);
@@ -3153,6 +3275,8 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
3153 * 3275 *
3154 * Creates a Probe Request template which can, for example, be uploaded to 3276 * Creates a Probe Request template which can, for example, be uploaded to
3155 * hardware. 3277 * hardware.
3278 *
3279 * Return: The Probe Request template. %NULL on error.
3156 */ 3280 */
3157struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw, 3281struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw,
3158 struct ieee80211_vif *vif, 3282 struct ieee80211_vif *vif,
@@ -3188,6 +3312,8 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3188 * If the RTS is generated in firmware, but the host system must provide 3312 * If the RTS is generated in firmware, but the host system must provide
3189 * the duration field, the low-level driver uses this function to receive 3313 * the duration field, the low-level driver uses this function to receive
3190 * the duration field value in little-endian byteorder. 3314 * the duration field value in little-endian byteorder.
3315 *
3316 * Return: The duration.
3191 */ 3317 */
3192__le16 ieee80211_rts_duration(struct ieee80211_hw *hw, 3318__le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
3193 struct ieee80211_vif *vif, size_t frame_len, 3319 struct ieee80211_vif *vif, size_t frame_len,
@@ -3223,6 +3349,8 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
3223 * If the CTS-to-self is generated in firmware, but the host system must provide 3349 * If the CTS-to-self is generated in firmware, but the host system must provide
3224 * the duration field, the low-level driver uses this function to receive 3350 * the duration field, the low-level driver uses this function to receive
3225 * the duration field value in little-endian byteorder. 3351 * the duration field value in little-endian byteorder.
3352 *
3353 * Return: The duration.
3226 */ 3354 */
3227__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, 3355__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
3228 struct ieee80211_vif *vif, 3356 struct ieee80211_vif *vif,
@@ -3239,6 +3367,8 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
3239 * 3367 *
3240 * Calculate the duration field of some generic frame, given its 3368 * Calculate the duration field of some generic frame, given its
3241 * length and transmission rate (in 100kbps). 3369 * length and transmission rate (in 100kbps).
3370 *
3371 * Return: The duration.
3242 */ 3372 */
3243__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, 3373__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
3244 struct ieee80211_vif *vif, 3374 struct ieee80211_vif *vif,
@@ -3255,9 +3385,10 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
3255 * hardware/firmware does not implement buffering of broadcast/multicast 3385 * hardware/firmware does not implement buffering of broadcast/multicast
3256 * frames when power saving is used, 802.11 code buffers them in the host 3386 * frames when power saving is used, 802.11 code buffers them in the host
3257 * memory. The low-level driver uses this function to fetch next buffered 3387 * memory. The low-level driver uses this function to fetch next buffered
3258 * frame. In most cases, this is used when generating beacon frame. This 3388 * frame. In most cases, this is used when generating beacon frame.
3259 * function returns a pointer to the next buffered skb or NULL if no more 3389 *
3260 * buffered frames are available. 3390 * Return: A pointer to the next buffered skb or NULL if no more buffered
3391 * frames are available.
3261 * 3392 *
3262 * Note: buffered frames are returned only after DTIM beacon frame was 3393 * Note: buffered frames are returned only after DTIM beacon frame was
3263 * generated with ieee80211_beacon_get() and the low-level driver must thus 3394 * generated with ieee80211_beacon_get() and the low-level driver must thus
@@ -3437,6 +3568,8 @@ void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue);
3437 * @queue: queue number (counted from zero). 3568 * @queue: queue number (counted from zero).
3438 * 3569 *
3439 * Drivers should use this function instead of netif_stop_queue. 3570 * Drivers should use this function instead of netif_stop_queue.
3571 *
3572 * Return: %true if the queue is stopped. %false otherwise.
3440 */ 3573 */
3441 3574
3442int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue); 3575int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue);
@@ -3634,7 +3767,9 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra,
3634 * @vif: virtual interface to look for station on 3767 * @vif: virtual interface to look for station on
3635 * @addr: station's address 3768 * @addr: station's address
3636 * 3769 *
3637 * This function must be called under RCU lock and the 3770 * Return: The station, if found. %NULL otherwise.
3771 *
3772 * Note: This function must be called under RCU lock and the
3638 * resulting pointer is only valid under RCU lock as well. 3773 * resulting pointer is only valid under RCU lock as well.
3639 */ 3774 */
3640struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, 3775struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
@@ -3647,7 +3782,9 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
3647 * @addr: remote station's address 3782 * @addr: remote station's address
3648 * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'. 3783 * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'.
3649 * 3784 *
3650 * This function must be called under RCU lock and the 3785 * Return: The station, if found. %NULL otherwise.
3786 *
3787 * Note: This function must be called under RCU lock and the
3651 * resulting pointer is only valid under RCU lock as well. 3788 * resulting pointer is only valid under RCU lock as well.
3652 * 3789 *
3653 * NOTE: You may pass NULL for localaddr, but then you will just get 3790 * NOTE: You may pass NULL for localaddr, but then you will just get
@@ -3754,6 +3891,11 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,
3754 * The iterator will not find a context that's being added (during 3891 * 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 3892 * the driver callback to add it) but will find it while it's being
3756 * removed. 3893 * removed.
3894 *
3895 * Note that during hardware restart, all contexts that existed
3896 * before the restart are considered already present so will be
3897 * found while iterating, whether they've been re-added already
3898 * or not.
3757 */ 3899 */
3758void ieee80211_iter_chan_contexts_atomic( 3900void ieee80211_iter_chan_contexts_atomic(
3759 struct ieee80211_hw *hw, 3901 struct ieee80211_hw *hw,
@@ -3772,7 +3914,9 @@ void ieee80211_iter_chan_contexts_atomic(
3772 * information. This function must only be called from within the 3914 * information. This function must only be called from within the
3773 * .bss_info_changed callback function and only in managed mode. The function 3915 * .bss_info_changed callback function and only in managed mode. The function
3774 * is only useful when the interface is associated, otherwise it will return 3916 * is only useful when the interface is associated, otherwise it will return
3775 * NULL. 3917 * %NULL.
3918 *
3919 * Return: The Probe Request template. %NULL on error.
3776 */ 3920 */
3777struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, 3921struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
3778 struct ieee80211_vif *vif); 3922 struct ieee80211_vif *vif);
@@ -3796,6 +3940,8 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
3796 * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and 3940 * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and
3797 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver 3941 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver
3798 * needs to inform if the connection to the AP has been lost. 3942 * needs to inform if the connection to the AP has been lost.
3943 * The function may also be called if the connection needs to be terminated
3944 * for some other reason, even if %IEEE80211_HW_CONNECTION_MONITOR isn't set.
3799 * 3945 *
3800 * This function will cause immediate change to disassociated state, 3946 * This function will cause immediate change to disassociated state,
3801 * without connection recovery attempts. 3947 * without connection recovery attempts.
@@ -3826,36 +3972,6 @@ void ieee80211_connection_loss(struct ieee80211_vif *vif);
3826void ieee80211_resume_disconnect(struct ieee80211_vif *vif); 3972void ieee80211_resume_disconnect(struct ieee80211_vif *vif);
3827 3973
3828/** 3974/**
3829 * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm
3830 *
3831 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3832 *
3833 * Some hardware require full power save to manage simultaneous BT traffic
3834 * on the WLAN frequency. Full PSM is required periodically, whenever there are
3835 * burst of BT traffic. The hardware gets information of BT traffic via
3836 * hardware co-existence lines, and consequentially requests mac80211 to
3837 * (temporarily) enter full psm.
3838 * This function will only temporarily disable dynamic PS, not enable PSM if
3839 * it was not already enabled.
3840 * The driver must make sure to re-enable dynamic PS using
3841 * ieee80211_enable_dyn_ps() if the driver has disabled it.
3842 *
3843 */
3844void ieee80211_disable_dyn_ps(struct ieee80211_vif *vif);
3845
3846/**
3847 * ieee80211_enable_dyn_ps - restore dynamic psm after being disabled
3848 *
3849 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3850 *
3851 * This function restores dynamic PS after being temporarily disabled via
3852 * ieee80211_disable_dyn_ps(). Each ieee80211_disable_dyn_ps() call must
3853 * be coupled with an eventual call to this function.
3854 *
3855 */
3856void ieee80211_enable_dyn_ps(struct ieee80211_vif *vif);
3857
3858/**
3859 * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring 3975 * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring
3860 * rssi threshold triggered 3976 * rssi threshold triggered
3861 * 3977 *
@@ -3872,6 +3988,13 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
3872 gfp_t gfp); 3988 gfp_t gfp);
3873 3989
3874/** 3990/**
3991 * ieee80211_radar_detected - inform that a radar was detected
3992 *
3993 * @hw: pointer as obtained from ieee80211_alloc_hw()
3994 */
3995void ieee80211_radar_detected(struct ieee80211_hw *hw);
3996
3997/**
3875 * ieee80211_chswitch_done - Complete channel switch process 3998 * ieee80211_chswitch_done - Complete channel switch process
3876 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3999 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3877 * @success: make the channel switch successful or not 4000 * @success: make the channel switch successful or not
@@ -4119,13 +4242,27 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
4119void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); 4242void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
4120 4243
4121/** 4244/**
4122 * ieee80211_ave_rssi - report the average rssi for the specified interface 4245 * ieee80211_ave_rssi - report the average RSSI for the specified interface
4123 * 4246 *
4124 * @vif: the specified virtual interface 4247 * @vif: the specified virtual interface
4125 * 4248 *
4126 * This function return the average rssi value for the requested interface. 4249 * Note: This function assumes that the given vif is valid.
4127 * It assumes that the given vif is valid. 4250 *
4251 * Return: The average RSSI value for the requested interface, or 0 if not
4252 * applicable.
4128 */ 4253 */
4129int ieee80211_ave_rssi(struct ieee80211_vif *vif); 4254int ieee80211_ave_rssi(struct ieee80211_vif *vif);
4130 4255
4256/**
4257 * ieee80211_report_wowlan_wakeup - report WoWLAN wakeup
4258 * @vif: virtual interface
4259 * @wakeup: wakeup reason(s)
4260 * @gfp: allocation flags
4261 *
4262 * See cfg80211_report_wowlan_wakeup().
4263 */
4264void ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif,
4265 struct cfg80211_wowlan_wakeup *wakeup,
4266 gfp_t gfp);
4267
4131#endif /* MAC80211_H */ 4268#endif /* MAC80211_H */
diff --git a/include/net/mrp.h b/include/net/mrp.h
new file mode 100644
index 000000000000..4fbf02aa2ec1
--- /dev/null
+++ b/include/net/mrp.h
@@ -0,0 +1,143 @@
1#ifndef _NET_MRP_H
2#define _NET_MRP_H
3
4#define MRP_END_MARK 0x0
5
6struct mrp_pdu_hdr {
7 u8 version;
8};
9
10struct mrp_msg_hdr {
11 u8 attrtype;
12 u8 attrlen;
13};
14
15struct mrp_vecattr_hdr {
16 __be16 lenflags;
17 unsigned char firstattrvalue[];
18#define MRP_VECATTR_HDR_LEN_MASK cpu_to_be16(0x1FFF)
19#define MRP_VECATTR_HDR_FLAG_LA cpu_to_be16(0x2000)
20};
21
22enum mrp_vecattr_event {
23 MRP_VECATTR_EVENT_NEW,
24 MRP_VECATTR_EVENT_JOIN_IN,
25 MRP_VECATTR_EVENT_IN,
26 MRP_VECATTR_EVENT_JOIN_MT,
27 MRP_VECATTR_EVENT_MT,
28 MRP_VECATTR_EVENT_LV,
29 __MRP_VECATTR_EVENT_MAX
30};
31
32struct mrp_skb_cb {
33 struct mrp_msg_hdr *mh;
34 struct mrp_vecattr_hdr *vah;
35 unsigned char attrvalue[];
36};
37
38static inline struct mrp_skb_cb *mrp_cb(struct sk_buff *skb)
39{
40 BUILD_BUG_ON(sizeof(struct mrp_skb_cb) >
41 FIELD_SIZEOF(struct sk_buff, cb));
42 return (struct mrp_skb_cb *)skb->cb;
43}
44
45enum mrp_applicant_state {
46 MRP_APPLICANT_INVALID,
47 MRP_APPLICANT_VO,
48 MRP_APPLICANT_VP,
49 MRP_APPLICANT_VN,
50 MRP_APPLICANT_AN,
51 MRP_APPLICANT_AA,
52 MRP_APPLICANT_QA,
53 MRP_APPLICANT_LA,
54 MRP_APPLICANT_AO,
55 MRP_APPLICANT_QO,
56 MRP_APPLICANT_AP,
57 MRP_APPLICANT_QP,
58 __MRP_APPLICANT_MAX
59};
60#define MRP_APPLICANT_MAX (__MRP_APPLICANT_MAX - 1)
61
62enum mrp_event {
63 MRP_EVENT_NEW,
64 MRP_EVENT_JOIN,
65 MRP_EVENT_LV,
66 MRP_EVENT_TX,
67 MRP_EVENT_R_NEW,
68 MRP_EVENT_R_JOIN_IN,
69 MRP_EVENT_R_IN,
70 MRP_EVENT_R_JOIN_MT,
71 MRP_EVENT_R_MT,
72 MRP_EVENT_R_LV,
73 MRP_EVENT_R_LA,
74 MRP_EVENT_REDECLARE,
75 MRP_EVENT_PERIODIC,
76 __MRP_EVENT_MAX
77};
78#define MRP_EVENT_MAX (__MRP_EVENT_MAX - 1)
79
80enum mrp_tx_action {
81 MRP_TX_ACTION_NONE,
82 MRP_TX_ACTION_S_NEW,
83 MRP_TX_ACTION_S_JOIN_IN,
84 MRP_TX_ACTION_S_JOIN_IN_OPTIONAL,
85 MRP_TX_ACTION_S_IN_OPTIONAL,
86 MRP_TX_ACTION_S_LV,
87};
88
89struct mrp_attr {
90 struct rb_node node;
91 enum mrp_applicant_state state;
92 u8 type;
93 u8 len;
94 unsigned char value[];
95};
96
97enum mrp_applications {
98 MRP_APPLICATION_MVRP,
99 __MRP_APPLICATION_MAX
100};
101#define MRP_APPLICATION_MAX (__MRP_APPLICATION_MAX - 1)
102
103struct mrp_application {
104 enum mrp_applications type;
105 unsigned int maxattr;
106 struct packet_type pkttype;
107 unsigned char group_address[ETH_ALEN];
108 u8 version;
109};
110
111struct mrp_applicant {
112 struct mrp_application *app;
113 struct net_device *dev;
114 struct timer_list join_timer;
115
116 spinlock_t lock;
117 struct sk_buff_head queue;
118 struct sk_buff *pdu;
119 struct rb_root mad;
120 struct rcu_head rcu;
121};
122
123struct mrp_port {
124 struct mrp_applicant __rcu *applicants[MRP_APPLICATION_MAX + 1];
125 struct rcu_head rcu;
126};
127
128extern int mrp_register_application(struct mrp_application *app);
129extern void mrp_unregister_application(struct mrp_application *app);
130
131extern int mrp_init_applicant(struct net_device *dev,
132 struct mrp_application *app);
133extern void mrp_uninit_applicant(struct net_device *dev,
134 struct mrp_application *app);
135
136extern int mrp_request_join(const struct net_device *dev,
137 const struct mrp_application *app,
138 const void *value, u8 len, u8 type);
139extern void mrp_request_leave(const struct net_device *dev,
140 const struct mrp_application *app,
141 const void *value, u8 len, u8 type);
142
143#endif /* _NET_MRP_H */
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 23b3a7c58783..745bf741e029 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -127,13 +127,19 @@ static int ndisc_addr_option_pad(unsigned short type)
127 } 127 }
128} 128}
129 129
130static inline int ndisc_opt_addr_space(struct net_device *dev)
131{
132 return NDISC_OPT_SPACE(dev->addr_len +
133 ndisc_addr_option_pad(dev->type));
134}
135
130static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p, 136static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,
131 struct net_device *dev) 137 struct net_device *dev)
132{ 138{
133 u8 *lladdr = (u8 *)(p + 1); 139 u8 *lladdr = (u8 *)(p + 1);
134 int lladdrlen = p->nd_opt_len << 3; 140 int lladdrlen = p->nd_opt_len << 3;
135 int prepad = ndisc_addr_option_pad(dev->type); 141 int prepad = ndisc_addr_option_pad(dev->type);
136 if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len + prepad)) 142 if (lladdrlen != ndisc_opt_addr_space(dev))
137 return NULL; 143 return NULL;
138 return lladdr + prepad; 144 return lladdr + prepad;
139} 145}
@@ -148,15 +154,14 @@ static inline u32 ndisc_hashfn(const void *pkey, const struct net_device *dev, _
148 (p32[3] * hash_rnd[3])); 154 (p32[3] * hash_rnd[3]));
149} 155}
150 156
151static inline struct neighbour *__ipv6_neigh_lookup(struct neigh_table *tbl, struct net_device *dev, const void *pkey) 157static inline struct neighbour *__ipv6_neigh_lookup_noref(struct net_device *dev, const void *pkey)
152{ 158{
153 struct neigh_hash_table *nht; 159 struct neigh_hash_table *nht;
154 const u32 *p32 = pkey; 160 const u32 *p32 = pkey;
155 struct neighbour *n; 161 struct neighbour *n;
156 u32 hash_val; 162 u32 hash_val;
157 163
158 rcu_read_lock_bh(); 164 nht = rcu_dereference_bh(nd_tbl.nht);
159 nht = rcu_dereference_bh(tbl->nht);
160 hash_val = ndisc_hashfn(pkey, dev, nht->hash_rnd) >> (32 - nht->hash_shift); 165 hash_val = ndisc_hashfn(pkey, dev, nht->hash_rnd) >> (32 - nht->hash_shift);
161 for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]); 166 for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]);
162 n != NULL; 167 n != NULL;
@@ -164,12 +169,21 @@ static inline struct neighbour *__ipv6_neigh_lookup(struct neigh_table *tbl, str
164 u32 *n32 = (u32 *) n->primary_key; 169 u32 *n32 = (u32 *) n->primary_key;
165 if (n->dev == dev && 170 if (n->dev == dev &&
166 ((n32[0] ^ p32[0]) | (n32[1] ^ p32[1]) | 171 ((n32[0] ^ p32[0]) | (n32[1] ^ p32[1]) |
167 (n32[2] ^ p32[2]) | (n32[3] ^ p32[3])) == 0) { 172 (n32[2] ^ p32[2]) | (n32[3] ^ p32[3])) == 0)
168 if (!atomic_inc_not_zero(&n->refcnt)) 173 return n;
169 n = NULL;
170 break;
171 }
172 } 174 }
175
176 return NULL;
177}
178
179static inline struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, const void *pkey)
180{
181 struct neighbour *n;
182
183 rcu_read_lock_bh();
184 n = __ipv6_neigh_lookup_noref(dev, pkey);
185 if (n && !atomic_inc_not_zero(&n->refcnt))
186 n = NULL;
173 rcu_read_unlock_bh(); 187 rcu_read_unlock_bh();
174 188
175 return n; 189 return n;
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 0dab173e27da..7e748ad8b50c 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -181,10 +181,11 @@ struct neigh_table {
181}; 181};
182 182
183#define NEIGH_PRIV_ALIGN sizeof(long long) 183#define NEIGH_PRIV_ALIGN sizeof(long long)
184#define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN)
184 185
185static inline void *neighbour_priv(const struct neighbour *n) 186static inline void *neighbour_priv(const struct neighbour *n)
186{ 187{
187 return (char *)n + ALIGN(sizeof(*n) + n->tbl->key_len, NEIGH_PRIV_ALIGN); 188 return (char *)n + n->tbl->entry_size;
188} 189}
189 190
190/* flags for neigh_update() */ 191/* flags for neigh_update() */
diff --git a/include/net/netevent.h b/include/net/netevent.h
index 3ce4988c9c08..fe630dde35c3 100644
--- a/include/net/netevent.h
+++ b/include/net/netevent.h
@@ -16,9 +16,8 @@ struct neighbour;
16 16
17struct netevent_redirect { 17struct netevent_redirect {
18 struct dst_entry *old; 18 struct dst_entry *old;
19 struct neighbour *old_neigh;
20 struct dst_entry *new; 19 struct dst_entry *new;
21 struct neighbour *new_neigh; 20 struct neighbour *neigh;
22 const void *daddr; 21 const void *daddr;
23}; 22};
24 23
diff --git a/include/net/netfilter/nf_conntrack_acct.h b/include/net/netfilter/nf_conntrack_acct.h
index 463ae8e16696..2bdb7a15fe06 100644
--- a/include/net/netfilter/nf_conntrack_acct.h
+++ b/include/net/netfilter/nf_conntrack_acct.h
@@ -57,7 +57,9 @@ static inline void nf_ct_set_acct(struct net *net, bool enable)
57 net->ct.sysctl_acct = enable; 57 net->ct.sysctl_acct = enable;
58} 58}
59 59
60extern int nf_conntrack_acct_init(struct net *net); 60extern int nf_conntrack_acct_pernet_init(struct net *net);
61extern void nf_conntrack_acct_fini(struct net *net); 61extern void nf_conntrack_acct_pernet_fini(struct net *net);
62 62
63extern int nf_conntrack_acct_init(void);
64extern void nf_conntrack_acct_fini(void);
63#endif /* _NF_CONNTRACK_ACCT_H */ 65#endif /* _NF_CONNTRACK_ACCT_H */
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index e98aeb3da033..930275fa2ea6 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -25,12 +25,19 @@ extern unsigned int nf_conntrack_in(struct net *net,
25 unsigned int hooknum, 25 unsigned int hooknum,
26 struct sk_buff *skb); 26 struct sk_buff *skb);
27 27
28extern int nf_conntrack_init(struct net *net); 28extern int nf_conntrack_init_net(struct net *net);
29extern void nf_conntrack_cleanup(struct net *net); 29extern void nf_conntrack_cleanup_net(struct net *net);
30 30
31extern int nf_conntrack_proto_init(struct net *net); 31extern int nf_conntrack_proto_pernet_init(struct net *net);
32extern void nf_conntrack_proto_fini(struct net *net); 32extern void nf_conntrack_proto_pernet_fini(struct net *net);
33 33
34extern int nf_conntrack_proto_init(void);
35extern void nf_conntrack_proto_fini(void);
36
37extern int nf_conntrack_init_start(void);
38extern void nf_conntrack_cleanup_start(void);
39
40extern void nf_conntrack_init_end(void);
34extern void nf_conntrack_cleanup_end(void); 41extern void nf_conntrack_cleanup_end(void);
35 42
36extern bool 43extern bool
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h
index 5654d292efd4..092dc651689f 100644
--- a/include/net/netfilter/nf_conntrack_ecache.h
+++ b/include/net/netfilter/nf_conntrack_ecache.h
@@ -207,9 +207,11 @@ nf_ct_expect_event(enum ip_conntrack_expect_events event,
207 nf_ct_expect_event_report(event, exp, 0, 0); 207 nf_ct_expect_event_report(event, exp, 0, 0);
208} 208}
209 209
210extern int nf_conntrack_ecache_init(struct net *net); 210extern int nf_conntrack_ecache_pernet_init(struct net *net);
211extern void nf_conntrack_ecache_fini(struct net *net); 211extern void nf_conntrack_ecache_pernet_fini(struct net *net);
212 212
213extern int nf_conntrack_ecache_init(void);
214extern void nf_conntrack_ecache_fini(void);
213#else /* CONFIG_NF_CONNTRACK_EVENTS */ 215#else /* CONFIG_NF_CONNTRACK_EVENTS */
214 216
215static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, 217static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
@@ -232,12 +234,21 @@ static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e,
232 u32 portid, 234 u32 portid,
233 int report) {} 235 int report) {}
234 236
235static inline int nf_conntrack_ecache_init(struct net *net) 237static inline int nf_conntrack_ecache_pernet_init(struct net *net)
236{ 238{
237 return 0; 239 return 0;
238} 240}
239 241
240static inline void nf_conntrack_ecache_fini(struct net *net) 242static inline void nf_conntrack_ecache_pernet_fini(struct net *net)
243{
244}
245
246static inline int nf_conntrack_ecache_init(void)
247{
248 return 0;
249}
250
251static inline void nf_conntrack_ecache_fini(void)
241{ 252{
242} 253}
243#endif /* CONFIG_NF_CONNTRACK_EVENTS */ 254#endif /* CONFIG_NF_CONNTRACK_EVENTS */
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index cc13f377a705..cbbae7621e22 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -69,8 +69,11 @@ struct nf_conntrack_expect_policy {
69 69
70#define NF_CT_EXPECT_CLASS_DEFAULT 0 70#define NF_CT_EXPECT_CLASS_DEFAULT 0
71 71
72int nf_conntrack_expect_init(struct net *net); 72int nf_conntrack_expect_pernet_init(struct net *net);
73void nf_conntrack_expect_fini(struct net *net); 73void nf_conntrack_expect_pernet_fini(struct net *net);
74
75int nf_conntrack_expect_init(void);
76void nf_conntrack_expect_fini(void);
74 77
75struct nf_conntrack_expect * 78struct nf_conntrack_expect *
76__nf_ct_expect_find(struct net *net, u16 zone, 79__nf_ct_expect_find(struct net *net, u16 zone,
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 8b4d1fc29096..977bc8a46444 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -23,6 +23,9 @@ enum nf_ct_ext_id {
23#ifdef CONFIG_NF_CONNTRACK_TIMEOUT 23#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
24 NF_CT_EXT_TIMEOUT, 24 NF_CT_EXT_TIMEOUT,
25#endif 25#endif
26#ifdef CONFIG_NF_CONNTRACK_LABELS
27 NF_CT_EXT_LABELS,
28#endif
26 NF_CT_EXT_NUM, 29 NF_CT_EXT_NUM,
27}; 30};
28 31
@@ -33,6 +36,7 @@ enum nf_ct_ext_id {
33#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone 36#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone
34#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp 37#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp
35#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout 38#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout
39#define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels
36 40
37/* Extensions: optional stuff which isn't permanently in struct. */ 41/* Extensions: optional stuff which isn't permanently in struct. */
38struct nf_ct_ext { 42struct nf_ct_ext {
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index 9aad956d1008..26c4ae5bfbb8 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -82,8 +82,11 @@ static inline void *nfct_help_data(const struct nf_conn *ct)
82 return (void *)help->data; 82 return (void *)help->data;
83} 83}
84 84
85extern int nf_conntrack_helper_init(struct net *net); 85extern int nf_conntrack_helper_pernet_init(struct net *net);
86extern void nf_conntrack_helper_fini(struct net *net); 86extern void nf_conntrack_helper_pernet_fini(struct net *net);
87
88extern int nf_conntrack_helper_init(void);
89extern void nf_conntrack_helper_fini(void);
87 90
88extern int nf_conntrack_broadcast_help(struct sk_buff *skb, 91extern int nf_conntrack_broadcast_help(struct sk_buff *skb,
89 unsigned int protoff, 92 unsigned int protoff,
@@ -97,6 +100,10 @@ struct nf_ct_helper_expectfn {
97 void (*expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp); 100 void (*expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp);
98}; 101};
99 102
103__printf(3,4)
104void nf_ct_helper_log(struct sk_buff *skb, const struct nf_conn *ct,
105 const char *fmt, ...);
106
100void nf_ct_helper_expectfn_register(struct nf_ct_helper_expectfn *n); 107void nf_ct_helper_expectfn_register(struct nf_ct_helper_expectfn *n);
101void nf_ct_helper_expectfn_unregister(struct nf_ct_helper_expectfn *n); 108void nf_ct_helper_expectfn_unregister(struct nf_ct_helper_expectfn *n);
102struct nf_ct_helper_expectfn * 109struct nf_ct_helper_expectfn *
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 6f7c13f4ac03..3bb89eac3fa1 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -76,11 +76,16 @@ struct nf_conntrack_l3proto {
76 76
77extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; 77extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX];
78 78
79/* Protocol registration. */ 79/* Protocol pernet registration. */
80extern int nf_conntrack_l3proto_register(struct net *net, 80extern int nf_ct_l3proto_pernet_register(struct net *net,
81 struct nf_conntrack_l3proto *proto); 81 struct nf_conntrack_l3proto *proto);
82extern void nf_conntrack_l3proto_unregister(struct net *net, 82extern void nf_ct_l3proto_pernet_unregister(struct net *net,
83 struct nf_conntrack_l3proto *proto); 83 struct nf_conntrack_l3proto *proto);
84
85/* Protocol global registration. */
86extern int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto);
87extern void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto);
88
84extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); 89extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto);
85extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); 90extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
86 91
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index c3be4aef6bf7..914d8d900798 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -121,12 +121,16 @@ extern struct nf_conntrack_l4proto *
121nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t l4proto); 121nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t l4proto);
122extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); 122extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p);
123 123
124/* Protocol registration. */ 124/* Protocol pernet registration. */
125extern int nf_conntrack_l4proto_register(struct net *net, 125extern int nf_ct_l4proto_pernet_register(struct net *net,
126 struct nf_conntrack_l4proto *proto); 126 struct nf_conntrack_l4proto *proto);
127extern void nf_conntrack_l4proto_unregister(struct net *net, 127extern void nf_ct_l4proto_pernet_unregister(struct net *net,
128 struct nf_conntrack_l4proto *proto); 128 struct nf_conntrack_l4proto *proto);
129 129
130/* Protocol global registration. */
131extern int nf_ct_l4proto_register(struct nf_conntrack_l4proto *proto);
132extern void nf_ct_l4proto_unregister(struct nf_conntrack_l4proto *proto);
133
130static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn) 134static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn)
131{ 135{
132#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) 136#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
diff --git a/include/net/netfilter/nf_conntrack_labels.h b/include/net/netfilter/nf_conntrack_labels.h
new file mode 100644
index 000000000000..c985695283b3
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_labels.h
@@ -0,0 +1,58 @@
1#include <linux/types.h>
2#include <net/net_namespace.h>
3#include <linux/netfilter/nf_conntrack_common.h>
4#include <linux/netfilter/nf_conntrack_tuple_common.h>
5#include <net/netfilter/nf_conntrack.h>
6#include <net/netfilter/nf_conntrack_extend.h>
7
8#include <uapi/linux/netfilter/xt_connlabel.h>
9
10struct nf_conn_labels {
11 u8 words;
12 unsigned long bits[];
13};
14
15static inline struct nf_conn_labels *nf_ct_labels_find(const struct nf_conn *ct)
16{
17#ifdef CONFIG_NF_CONNTRACK_LABELS
18 return nf_ct_ext_find(ct, NF_CT_EXT_LABELS);
19#else
20 return NULL;
21#endif
22}
23
24static inline struct nf_conn_labels *nf_ct_labels_ext_add(struct nf_conn *ct)
25{
26#ifdef CONFIG_NF_CONNTRACK_LABELS
27 struct nf_conn_labels *cl_ext;
28 struct net *net = nf_ct_net(ct);
29 u8 words;
30
31 words = ACCESS_ONCE(net->ct.label_words);
32 if (words == 0 || WARN_ON_ONCE(words > 8))
33 return NULL;
34
35 cl_ext = nf_ct_ext_add_length(ct, NF_CT_EXT_LABELS,
36 words * sizeof(long), GFP_ATOMIC);
37 if (cl_ext != NULL)
38 cl_ext->words = words;
39
40 return cl_ext;
41#else
42 return NULL;
43#endif
44}
45
46bool nf_connlabel_match(const struct nf_conn *ct, u16 bit);
47int nf_connlabel_set(struct nf_conn *ct, u16 bit);
48
49int nf_connlabels_replace(struct nf_conn *ct,
50 const u32 *data, const u32 *mask, unsigned int words);
51
52#ifdef CONFIG_NF_CONNTRACK_LABELS
53int nf_conntrack_labels_init(void);
54void nf_conntrack_labels_fini(void);
55#else
56static inline int nf_conntrack_labels_init(void) { return 0; }
57static inline void nf_conntrack_labels_fini(void) {}
58#endif
diff --git a/include/net/netfilter/nf_conntrack_timeout.h b/include/net/netfilter/nf_conntrack_timeout.h
index e41e472d08f2..d23aceb16d94 100644
--- a/include/net/netfilter/nf_conntrack_timeout.h
+++ b/include/net/netfilter/nf_conntrack_timeout.h
@@ -76,15 +76,15 @@ nf_ct_timeout_lookup(struct net *net, struct nf_conn *ct,
76} 76}
77 77
78#ifdef CONFIG_NF_CONNTRACK_TIMEOUT 78#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
79extern int nf_conntrack_timeout_init(struct net *net); 79extern int nf_conntrack_timeout_init(void);
80extern void nf_conntrack_timeout_fini(struct net *net); 80extern void nf_conntrack_timeout_fini(void);
81#else 81#else
82static inline int nf_conntrack_timeout_init(struct net *net) 82static inline int nf_conntrack_timeout_init(void)
83{ 83{
84 return 0; 84 return 0;
85} 85}
86 86
87static inline void nf_conntrack_timeout_fini(struct net *net) 87static inline void nf_conntrack_timeout_fini(void)
88{ 88{
89 return; 89 return;
90} 90}
diff --git a/include/net/netfilter/nf_conntrack_timestamp.h b/include/net/netfilter/nf_conntrack_timestamp.h
index fc9c82b1f06b..b00461413efd 100644
--- a/include/net/netfilter/nf_conntrack_timestamp.h
+++ b/include/net/netfilter/nf_conntrack_timestamp.h
@@ -48,15 +48,28 @@ static inline void nf_ct_set_tstamp(struct net *net, bool enable)
48} 48}
49 49
50#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP 50#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
51extern int nf_conntrack_tstamp_init(struct net *net); 51extern int nf_conntrack_tstamp_pernet_init(struct net *net);
52extern void nf_conntrack_tstamp_fini(struct net *net); 52extern void nf_conntrack_tstamp_pernet_fini(struct net *net);
53
54extern int nf_conntrack_tstamp_init(void);
55extern void nf_conntrack_tstamp_fini(void);
53#else 56#else
54static inline int nf_conntrack_tstamp_init(struct net *net) 57static inline int nf_conntrack_tstamp_pernet_init(struct net *net)
58{
59 return 0;
60}
61
62static inline void nf_conntrack_tstamp_pernet_fini(struct net *net)
63{
64 return;
65}
66
67static inline int nf_conntrack_tstamp_init(void)
55{ 68{
56 return 0; 69 return 0;
57} 70}
58 71
59static inline void nf_conntrack_tstamp_fini(struct net *net) 72static inline void nf_conntrack_tstamp_fini(void)
60{ 73{
61 return; 74 return;
62} 75}
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h
index 75ca9291cf2c..36d9379d4c4b 100644
--- a/include/net/netfilter/nf_tproxy_core.h
+++ b/include/net/netfilter/nf_tproxy_core.h
@@ -82,6 +82,7 @@ nf_tproxy_get_sock_v4(struct net *net, const u8 protocol,
82 break; 82 break;
83 case NFT_LOOKUP_LISTENER: 83 case NFT_LOOKUP_LISTENER:
84 sk = inet_lookup_listener(net, &tcp_hashinfo, 84 sk = inet_lookup_listener(net, &tcp_hashinfo,
85 saddr, sport,
85 daddr, dport, 86 daddr, dport,
86 in->ifindex); 87 in->ifindex);
87 88
@@ -151,6 +152,7 @@ nf_tproxy_get_sock_v6(struct net *net, const u8 protocol,
151 break; 152 break;
152 case NFT_LOOKUP_LISTENER: 153 case NFT_LOOKUP_LISTENER:
153 sk = inet6_lookup_listener(net, &tcp_hashinfo, 154 sk = inet6_lookup_listener(net, &tcp_hashinfo,
155 saddr, sport,
154 daddr, ntohs(dport), 156 daddr, ntohs(dport),
155 in->ifindex); 157 in->ifindex);
156 158
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index 923cb20051ed..c9c0c538b68b 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -84,6 +84,10 @@ struct netns_ct {
84 int sysctl_auto_assign_helper; 84 int sysctl_auto_assign_helper;
85 bool auto_assign_helper_warned; 85 bool auto_assign_helper_warned;
86 struct nf_ip_net nf_ct_proto; 86 struct nf_ip_net nf_ct_proto;
87#if defined(CONFIG_NF_CONNTRACK_LABELS)
88 unsigned int labels_used;
89 u8 label_words;
90#endif
87#ifdef CONFIG_NF_NAT_NEEDED 91#ifdef CONFIG_NF_NAT_NEEDED
88 struct hlist_head *nat_bysource; 92 struct hlist_head *nat_bysource;
89 unsigned int nat_htable_size; 93 unsigned int nat_htable_size;
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 2ae2b8372cfd..2ba9de89e8ec 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -22,6 +22,7 @@ struct netns_ipv4 {
22 struct ctl_table_header *frags_hdr; 22 struct ctl_table_header *frags_hdr;
23 struct ctl_table_header *ipv4_hdr; 23 struct ctl_table_header *ipv4_hdr;
24 struct ctl_table_header *route_hdr; 24 struct ctl_table_header *route_hdr;
25 struct ctl_table_header *xfrm4_hdr;
25#endif 26#endif
26 struct ipv4_devconf *devconf_all; 27 struct ipv4_devconf *devconf_all;
27 struct ipv4_devconf *devconf_dflt; 28 struct ipv4_devconf *devconf_dflt;
@@ -61,6 +62,8 @@ struct netns_ipv4 {
61 int sysctl_icmp_ratemask; 62 int sysctl_icmp_ratemask;
62 int sysctl_icmp_errors_use_inbound_ifaddr; 63 int sysctl_icmp_errors_use_inbound_ifaddr;
63 64
65 int sysctl_tcp_ecn;
66
64 kgid_t sysctl_ping_group_range[2]; 67 kgid_t sysctl_ping_group_range[2];
65 long sysctl_tcp_mem[3]; 68 long sysctl_tcp_mem[3];
66 69
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 214cb0a53359..1242f371718b 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -16,6 +16,7 @@ struct netns_sysctl_ipv6 {
16 struct ctl_table_header *route_hdr; 16 struct ctl_table_header *route_hdr;
17 struct ctl_table_header *icmp_hdr; 17 struct ctl_table_header *icmp_hdr;
18 struct ctl_table_header *frags_hdr; 18 struct ctl_table_header *frags_hdr;
19 struct ctl_table_header *xfrm6_hdr;
19#endif 20#endif
20 int bindv6only; 21 int bindv6only;
21 int flush_delay; 22 int flush_delay;
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index 671953e11575..b87a1692b086 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -57,8 +57,10 @@ struct nfc_hci_ops {
57 int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); 57 int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb);
58 int (*check_presence)(struct nfc_hci_dev *hdev, 58 int (*check_presence)(struct nfc_hci_dev *hdev,
59 struct nfc_target *target); 59 struct nfc_target *target);
60 void (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, 60 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event,
61 struct sk_buff *skb); 61 struct sk_buff *skb);
62 int (*enable_se)(struct nfc_dev *dev, u32 secure_element);
63 int (*disable_se)(struct nfc_dev *dev, u32 secure_element);
62}; 64};
63 65
64/* Pipes */ 66/* Pipes */
@@ -82,11 +84,23 @@ typedef int (*xmit) (struct sk_buff *skb, void *cb_data);
82 84
83#define NFC_HCI_MAX_GATES 256 85#define NFC_HCI_MAX_GATES 256
84 86
87/*
88 * These values can be specified by a driver to indicate it requires some
89 * adaptation of the HCI standard.
90 *
91 * NFC_HCI_QUIRK_SHORT_CLEAR - send HCI_ADM_CLEAR_ALL_PIPE cmd with no params
92 */
93enum {
94 NFC_HCI_QUIRK_SHORT_CLEAR = 0,
95};
96
85struct nfc_hci_dev { 97struct nfc_hci_dev {
86 struct nfc_dev *ndev; 98 struct nfc_dev *ndev;
87 99
88 u32 max_data_link_payload; 100 u32 max_data_link_payload;
89 101
102 bool shutting_down;
103
90 struct mutex msg_tx_mutex; 104 struct mutex msg_tx_mutex;
91 105
92 struct list_head msg_tx_queue; 106 struct list_head msg_tx_queue;
@@ -129,12 +143,16 @@ struct nfc_hci_dev {
129 143
130 u8 *gb; 144 u8 *gb;
131 size_t gb_len; 145 size_t gb_len;
146
147 unsigned long quirks;
132}; 148};
133 149
134/* hci device allocation */ 150/* hci device allocation */
135struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops, 151struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
136 struct nfc_hci_init_data *init_data, 152 struct nfc_hci_init_data *init_data,
153 unsigned long quirks,
137 u32 protocols, 154 u32 protocols,
155 u32 supported_se,
138 const char *llc_name, 156 const char *llc_name,
139 int tx_headroom, 157 int tx_headroom,
140 int tx_tailroom, 158 int tx_tailroom,
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index d705d8674949..5bc0c460edc0 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -147,6 +147,7 @@ struct nci_dev {
147/* ----- NCI Devices ----- */ 147/* ----- NCI Devices ----- */
148struct nci_dev *nci_allocate_device(struct nci_ops *ops, 148struct nci_dev *nci_allocate_device(struct nci_ops *ops,
149 __u32 supported_protocols, 149 __u32 supported_protocols,
150 __u32 supported_se,
150 int tx_headroom, 151 int tx_headroom,
151 int tx_tailroom); 152 int tx_tailroom);
152void nci_free_device(struct nci_dev *ndev); 153void nci_free_device(struct nci_dev *ndev);
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index fce80b2f9be7..87a6417fc934 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -68,6 +68,8 @@ struct nfc_ops {
68 void *cb_context); 68 void *cb_context);
69 int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); 69 int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb);
70 int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); 70 int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target);
71 int (*enable_se)(struct nfc_dev *dev, u32 secure_element);
72 int (*disable_se)(struct nfc_dev *dev, u32 secure_element);
71}; 73};
72 74
73#define NFC_TARGET_IDX_ANY -1 75#define NFC_TARGET_IDX_ANY -1
@@ -109,12 +111,17 @@ struct nfc_dev {
109 struct nfc_genl_data genl_data; 111 struct nfc_genl_data genl_data;
110 u32 supported_protocols; 112 u32 supported_protocols;
111 113
114 u32 supported_se;
115 u32 active_se;
116
112 int tx_headroom; 117 int tx_headroom;
113 int tx_tailroom; 118 int tx_tailroom;
114 119
115 struct timer_list check_pres_timer; 120 struct timer_list check_pres_timer;
116 struct work_struct check_pres_work; 121 struct work_struct check_pres_work;
117 122
123 bool shutting_down;
124
118 struct nfc_ops *ops; 125 struct nfc_ops *ops;
119}; 126};
120#define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) 127#define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev)
@@ -123,6 +130,7 @@ extern struct class nfc_class;
123 130
124struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, 131struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
125 u32 supported_protocols, 132 u32 supported_protocols,
133 u32 supported_se,
126 int tx_headroom, 134 int tx_headroom,
127 int tx_tailroom); 135 int tx_tailroom);
128 136
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 9fcc680ab6b9..13174509cdfd 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -126,9 +126,10 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
126 return 0; 126 return 0;
127} 127}
128 128
129extern int tcf_exts_validate(struct tcf_proto *tp, struct nlattr **tb, 129extern int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
130 struct nlattr *rate_tlv, struct tcf_exts *exts, 130 struct nlattr **tb, struct nlattr *rate_tlv,
131 const struct tcf_ext_map *map); 131 struct tcf_exts *exts,
132 const struct tcf_ext_map *map);
132extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); 133extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
133extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, 134extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
134 struct tcf_exts *src); 135 struct tcf_exts *src);
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 66f5ac370f92..388bf8b6d060 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -65,8 +65,14 @@ struct qdisc_watchdog {
65}; 65};
66 66
67extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc); 67extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
68extern void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, 68extern void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires);
69 psched_time_t expires); 69
70static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
71 psched_time_t expires)
72{
73 qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires));
74}
75
70extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd); 76extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
71 77
72extern struct Qdisc_ops pfifo_qdisc_ops; 78extern struct Qdisc_ops pfifo_qdisc_ops;
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index 7dcaa2794fde..f17ed590d64a 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -18,6 +18,7 @@
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 */ 19 */
20 20
21#include <linux/rcupdate.h>
21 22
22/** 23/**
23 * enum environment_cap - Environment parsed from country IE 24 * enum environment_cap - Environment parsed from country IE
@@ -35,6 +36,7 @@ enum environment_cap {
35/** 36/**
36 * struct regulatory_request - used to keep track of regulatory requests 37 * struct regulatory_request - used to keep track of regulatory requests
37 * 38 *
39 * @rcu_head: RCU head struct used to free the request
38 * @wiphy_idx: this is set if this request's initiator is 40 * @wiphy_idx: this is set if this request's initiator is
39 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This 41 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
40 * can be used by the wireless core to deal with conflicts 42 * can be used by the wireless core to deal with conflicts
@@ -72,6 +74,7 @@ enum environment_cap {
72 * @list: used to insert into the reg_requests_list linked list 74 * @list: used to insert into the reg_requests_list linked list
73 */ 75 */
74struct regulatory_request { 76struct regulatory_request {
77 struct rcu_head rcu_head;
75 int wiphy_idx; 78 int wiphy_idx;
76 enum nl80211_reg_initiator initiator; 79 enum nl80211_reg_initiator initiator;
77 enum nl80211_user_reg_hint_type user_reg_hint_type; 80 enum nl80211_user_reg_hint_type user_reg_hint_type;
@@ -101,6 +104,7 @@ struct ieee80211_reg_rule {
101}; 104};
102 105
103struct ieee80211_regdomain { 106struct ieee80211_regdomain {
107 struct rcu_head rcu_head;
104 u32 n_reg_rules; 108 u32 n_reg_rules;
105 char alpha2[2]; 109 char alpha2[2];
106 u8 dfs_region; 110 u8 dfs_region;
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 1540f9c2fcf4..2761c905504e 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -195,7 +195,7 @@ struct tcf_proto_ops {
195 195
196 unsigned long (*get)(struct tcf_proto*, u32 handle); 196 unsigned long (*get)(struct tcf_proto*, u32 handle);
197 void (*put)(struct tcf_proto*, unsigned long); 197 void (*put)(struct tcf_proto*, unsigned long);
198 int (*change)(struct sk_buff *, 198 int (*change)(struct net *net, struct sk_buff *,
199 struct tcf_proto*, unsigned long, 199 struct tcf_proto*, unsigned long,
200 u32 handle, struct nlattr **, 200 u32 handle, struct nlattr **,
201 unsigned long *); 201 unsigned long *);
@@ -679,4 +679,23 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask,
679} 679}
680#endif 680#endif
681 681
682struct psched_ratecfg {
683 u64 rate_bps;
684 u32 mult;
685 u32 shift;
686};
687
688static inline u64 psched_l2t_ns(const struct psched_ratecfg *r,
689 unsigned int len)
690{
691 return ((u64)len * r->mult) >> r->shift;
692}
693
694extern void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate);
695
696static inline u32 psched_ratecfg_getrate(const struct psched_ratecfg *r)
697{
698 return r->rate_bps >> 3;
699}
700
682#endif 701#endif
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index c29707d654c0..a7dd5c50df79 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -303,7 +303,7 @@ enum { SCTP_MAX_GABS = 16 };
303 * to which we will raise the P-MTU. 303 * to which we will raise the P-MTU.
304 */ 304 */
305#define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ 305#define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */
306#define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */ 306
307#define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ 307#define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */
308 308
309#define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ 309#define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index fdeb85a970fc..0e0f9d2322e3 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1236,10 +1236,7 @@ struct sctp_endpoint {
1236 * Discussion in [RFC1750] can be helpful in 1236 * Discussion in [RFC1750] can be helpful in
1237 * selection of the key. 1237 * selection of the key.
1238 */ 1238 */
1239 __u8 secret_key[SCTP_HOW_MANY_SECRETS][SCTP_SECRET_SIZE]; 1239 __u8 secret_key[SCTP_SECRET_SIZE];
1240 int current_key;
1241 int last_key;
1242 int key_changed_at;
1243 1240
1244 /* digest: This is a digest of the sctp cookie. This field is 1241 /* digest: This is a digest of the sctp cookie. This field is
1245 * only used on the receive path when we try to validate 1242 * only used on the receive path when we try to validate
diff --git a/include/net/sock.h b/include/net/sock.h
index 182ca99405ad..a66caa223d18 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -140,6 +140,7 @@ typedef __u64 __bitwise __addrpair;
140 * @skc_family: network address family 140 * @skc_family: network address family
141 * @skc_state: Connection state 141 * @skc_state: Connection state
142 * @skc_reuse: %SO_REUSEADDR setting 142 * @skc_reuse: %SO_REUSEADDR setting
143 * @skc_reuseport: %SO_REUSEPORT setting
143 * @skc_bound_dev_if: bound device index if != 0 144 * @skc_bound_dev_if: bound device index if != 0
144 * @skc_bind_node: bind hash linkage for various protocol lookup tables 145 * @skc_bind_node: bind hash linkage for various protocol lookup tables
145 * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol 146 * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol
@@ -179,7 +180,8 @@ struct sock_common {
179 180
180 unsigned short skc_family; 181 unsigned short skc_family;
181 volatile unsigned char skc_state; 182 volatile unsigned char skc_state;
182 unsigned char skc_reuse; 183 unsigned char skc_reuse:4;
184 unsigned char skc_reuseport:4;
183 int skc_bound_dev_if; 185 int skc_bound_dev_if;
184 union { 186 union {
185 struct hlist_node skc_bind_node; 187 struct hlist_node skc_bind_node;
@@ -297,6 +299,7 @@ struct sock {
297#define sk_family __sk_common.skc_family 299#define sk_family __sk_common.skc_family
298#define sk_state __sk_common.skc_state 300#define sk_state __sk_common.skc_state
299#define sk_reuse __sk_common.skc_reuse 301#define sk_reuse __sk_common.skc_reuse
302#define sk_reuseport __sk_common.skc_reuseport
300#define sk_bound_dev_if __sk_common.skc_bound_dev_if 303#define sk_bound_dev_if __sk_common.skc_bound_dev_if
301#define sk_bind_node __sk_common.skc_bind_node 304#define sk_bind_node __sk_common.skc_bind_node
302#define sk_prot __sk_common.skc_prot 305#define sk_prot __sk_common.skc_prot
@@ -337,7 +340,7 @@ struct sock {
337#endif 340#endif
338 unsigned long sk_flags; 341 unsigned long sk_flags;
339 struct dst_entry *sk_rx_dst; 342 struct dst_entry *sk_rx_dst;
340 struct dst_entry *sk_dst_cache; 343 struct dst_entry __rcu *sk_dst_cache;
341 spinlock_t sk_dst_lock; 344 spinlock_t sk_dst_lock;
342 atomic_t sk_wmem_alloc; 345 atomic_t sk_wmem_alloc;
343 atomic_t sk_omem_alloc; 346 atomic_t sk_omem_alloc;
@@ -664,6 +667,7 @@ enum sock_flags {
664 * Will use last 4 bytes of packet sent from 667 * Will use last 4 bytes of packet sent from
665 * user-space instead. 668 * user-space instead.
666 */ 669 */
670 SOCK_FILTER_LOCKED, /* Filter cannot be changed anymore */
667}; 671};
668 672
669static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) 673static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
@@ -1037,7 +1041,7 @@ static inline void sk_refcnt_debug_dec(struct sock *sk)
1037 sk->sk_prot->name, sk, atomic_read(&sk->sk_prot->socks)); 1041 sk->sk_prot->name, sk, atomic_read(&sk->sk_prot->socks));
1038} 1042}
1039 1043
1040inline void sk_refcnt_debug_release(const struct sock *sk) 1044static inline void sk_refcnt_debug_release(const struct sock *sk)
1041{ 1045{
1042 if (atomic_read(&sk->sk_refcnt) != 1) 1046 if (atomic_read(&sk->sk_refcnt) != 1)
1043 printk(KERN_DEBUG "Destruction of the %s socket %p delayed, refcnt=%d\n", 1047 printk(KERN_DEBUG "Destruction of the %s socket %p delayed, refcnt=%d\n",
diff --git a/include/net/tcp.h b/include/net/tcp.h
index aed42c785153..23f2e98d4b65 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -266,7 +266,6 @@ extern int sysctl_tcp_abort_on_overflow;
266extern int sysctl_tcp_max_orphans; 266extern int sysctl_tcp_max_orphans;
267extern int sysctl_tcp_fack; 267extern int sysctl_tcp_fack;
268extern int sysctl_tcp_reordering; 268extern int sysctl_tcp_reordering;
269extern int sysctl_tcp_ecn;
270extern int sysctl_tcp_dsack; 269extern int sysctl_tcp_dsack;
271extern int sysctl_tcp_wmem[3]; 270extern int sysctl_tcp_wmem[3];
272extern int sysctl_tcp_rmem[3]; 271extern int sysctl_tcp_rmem[3];
@@ -280,7 +279,6 @@ extern int sysctl_tcp_dma_copybreak;
280extern int sysctl_tcp_nometrics_save; 279extern int sysctl_tcp_nometrics_save;
281extern int sysctl_tcp_moderate_rcvbuf; 280extern int sysctl_tcp_moderate_rcvbuf;
282extern int sysctl_tcp_tso_win_divisor; 281extern int sysctl_tcp_tso_win_divisor;
283extern int sysctl_tcp_abc;
284extern int sysctl_tcp_mtu_probing; 282extern int sysctl_tcp_mtu_probing;
285extern int sysctl_tcp_base_mss; 283extern int sysctl_tcp_base_mss;
286extern int sysctl_tcp_workaround_signed_windows; 284extern int sysctl_tcp_workaround_signed_windows;
@@ -504,7 +502,8 @@ static inline __u32 cookie_v4_init_sequence(struct sock *sk,
504#endif 502#endif
505 503
506extern __u32 cookie_init_timestamp(struct request_sock *req); 504extern __u32 cookie_init_timestamp(struct request_sock *req);
507extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); 505extern bool cookie_check_timestamp(struct tcp_options_received *opt,
506 struct net *net, bool *ecn_ok);
508 507
509/* From net/ipv6/syncookies.c */ 508/* From net/ipv6/syncookies.c */
510extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); 509extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
@@ -728,11 +727,12 @@ struct tcp_skb_cb {
728 * notifications, we disable TCP ECN negociation. 727 * notifications, we disable TCP ECN negociation.
729 */ 728 */
730static inline void 729static inline void
731TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb) 730TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb,
731 struct net *net)
732{ 732{
733 const struct tcphdr *th = tcp_hdr(skb); 733 const struct tcphdr *th = tcp_hdr(skb);
734 734
735 if (sysctl_tcp_ecn && th->ece && th->cwr && 735 if (net->ipv4.sysctl_tcp_ecn && th->ece && th->cwr &&
736 INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield)) 736 INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield))
737 inet_rsk(req)->ecn_ok = 1; 737 inet_rsk(req)->ecn_ok = 1;
738} 738}
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 63445ede48bb..24c8886fd969 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -501,6 +501,12 @@ struct xfrm_policy_walk {
501 u32 seq; 501 u32 seq;
502}; 502};
503 503
504struct xfrm_policy_queue {
505 struct sk_buff_head hold_queue;
506 struct timer_list hold_timer;
507 unsigned long timeout;
508};
509
504struct xfrm_policy { 510struct xfrm_policy {
505#ifdef CONFIG_NET_NS 511#ifdef CONFIG_NET_NS
506 struct net *xp_net; 512 struct net *xp_net;
@@ -522,6 +528,7 @@ struct xfrm_policy {
522 struct xfrm_lifetime_cfg lft; 528 struct xfrm_lifetime_cfg lft;
523 struct xfrm_lifetime_cur curlft; 529 struct xfrm_lifetime_cur curlft;
524 struct xfrm_policy_walk_entry walk; 530 struct xfrm_policy_walk_entry walk;
531 struct xfrm_policy_queue polq;
525 u8 type; 532 u8 type;
526 u8 action; 533 u8 action;
527 u8 flags; 534 u8 flags;
@@ -557,10 +564,6 @@ struct xfrm_migrate {
557}; 564};
558 565
559#define XFRM_KM_TIMEOUT 30 566#define XFRM_KM_TIMEOUT 30
560/* which seqno */
561#define XFRM_REPLAY_SEQ 1
562#define XFRM_REPLAY_OSEQ 2
563#define XFRM_REPLAY_SEQ_MASK 3
564/* what happened */ 567/* what happened */
565#define XFRM_REPLAY_UPDATE XFRM_AE_CR 568#define XFRM_REPLAY_UPDATE XFRM_AE_CR
566#define XFRM_REPLAY_TIMEOUT XFRM_AE_CE 569#define XFRM_REPLAY_TIMEOUT XFRM_AE_CE
@@ -1036,7 +1039,7 @@ static inline int
1036__xfrm6_state_addr_cmp(const struct xfrm_tmpl *tmpl, const struct xfrm_state *x) 1039__xfrm6_state_addr_cmp(const struct xfrm_tmpl *tmpl, const struct xfrm_state *x)
1037{ 1040{
1038 return (!ipv6_addr_any((struct in6_addr*)&tmpl->saddr) && 1041 return (!ipv6_addr_any((struct in6_addr*)&tmpl->saddr) &&
1039 ipv6_addr_cmp((struct in6_addr *)&tmpl->saddr, (struct in6_addr*)&x->props.saddr)); 1042 !ipv6_addr_equal((struct in6_addr *)&tmpl->saddr, (struct in6_addr*)&x->props.saddr));
1040} 1043}
1041 1044
1042static inline int 1045static inline int
@@ -1247,8 +1250,8 @@ static __inline__ int
1247__xfrm6_state_addr_check(const struct xfrm_state *x, 1250__xfrm6_state_addr_check(const struct xfrm_state *x,
1248 const xfrm_address_t *daddr, const xfrm_address_t *saddr) 1251 const xfrm_address_t *daddr, const xfrm_address_t *saddr)
1249{ 1252{
1250 if (!ipv6_addr_cmp((struct in6_addr *)daddr, (struct in6_addr *)&x->id.daddr) && 1253 if (ipv6_addr_equal((struct in6_addr *)daddr, (struct in6_addr *)&x->id.daddr) &&
1251 (!ipv6_addr_cmp((struct in6_addr *)saddr, (struct in6_addr *)&x->props.saddr)|| 1254 (ipv6_addr_equal((struct in6_addr *)saddr, (struct in6_addr *)&x->props.saddr) ||
1252 ipv6_addr_any((struct in6_addr *)saddr) || 1255 ipv6_addr_any((struct in6_addr *)saddr) ||
1253 ipv6_addr_any((struct in6_addr *)&x->props.saddr))) 1256 ipv6_addr_any((struct in6_addr *)&x->props.saddr)))
1254 return 1; 1257 return 1;
@@ -1324,6 +1327,7 @@ struct xfrm_algo_desc {
1324 char *name; 1327 char *name;
1325 char *compat; 1328 char *compat;
1326 u8 available:1; 1329 u8 available:1;
1330 u8 pfkey_supported:1;
1327 union { 1331 union {
1328 struct xfrm_algo_aead_info aead; 1332 struct xfrm_algo_aead_info aead;
1329 struct xfrm_algo_auth_info auth; 1333 struct xfrm_algo_auth_info auth;
@@ -1565,8 +1569,8 @@ extern void xfrm_input_init(void);
1565extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); 1569extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq);
1566 1570
1567extern void xfrm_probe_algs(void); 1571extern void xfrm_probe_algs(void);
1568extern int xfrm_count_auth_supported(void); 1572extern int xfrm_count_pfkey_auth_supported(void);
1569extern int xfrm_count_enc_supported(void); 1573extern int xfrm_count_pfkey_enc_supported(void);
1570extern struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx); 1574extern struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx);
1571extern struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx); 1575extern struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx);
1572extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); 1576extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id);
@@ -1578,17 +1582,23 @@ extern struct xfrm_algo_desc *xfrm_calg_get_byname(const char *name, int probe);
1578extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len, 1582extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len,
1579 int probe); 1583 int probe);
1580 1584
1581static inline int xfrm_addr_cmp(const xfrm_address_t *a, 1585static inline bool xfrm6_addr_equal(const xfrm_address_t *a,
1582 const xfrm_address_t *b, 1586 const xfrm_address_t *b)
1583 int family) 1587{
1588 return ipv6_addr_equal((const struct in6_addr *)a,
1589 (const struct in6_addr *)b);
1590}
1591
1592static inline bool xfrm_addr_equal(const xfrm_address_t *a,
1593 const xfrm_address_t *b,
1594 sa_family_t family)
1584{ 1595{
1585 switch (family) { 1596 switch (family) {
1586 default: 1597 default:
1587 case AF_INET: 1598 case AF_INET:
1588 return (__force u32)a->a4 - (__force u32)b->a4; 1599 return ((__force u32)a->a4 ^ (__force u32)b->a4) == 0;
1589 case AF_INET6: 1600 case AF_INET6:
1590 return ipv6_addr_cmp((const struct in6_addr *)a, 1601 return xfrm6_addr_equal(a, b);
1591 (const struct in6_addr *)b);
1592 } 1602 }
1593} 1603}
1594 1604
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index 2d32d073a6f9..4ef3acbba5da 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -22,8 +22,7 @@
22#define SO_PRIORITY 12 22#define SO_PRIORITY 12
23#define SO_LINGER 13 23#define SO_LINGER 13
24#define SO_BSDCOMPAT 14 24#define SO_BSDCOMPAT 14
25/* To add :#define SO_REUSEPORT 15 */ 25#define SO_REUSEPORT 15
26
27#ifndef SO_PASSCRED /* powerpc only differs in these */ 26#ifndef SO_PASSCRED /* powerpc only differs in these */
28#define SO_PASSCRED 16 27#define SO_PASSCRED 16
29#define SO_PEERCRED 17 28#define SO_PEERCRED 17
@@ -73,4 +72,6 @@
73/* Instruct lower device to use last 4-bytes of skb data as FCS */ 72/* Instruct lower device to use last 4-bytes of skb data as FCS */
74#define SO_NOFCS 43 73#define SO_NOFCS 43
75 74
75#define SO_LOCK_FILTER 44
76
76#endif /* __ASM_GENERIC_SOCKET_H */ 77#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/include/uapi/linux/can/gw.h b/include/uapi/linux/can/gw.h
index 8e1db18c3cb6..ae07bec74f4b 100644
--- a/include/uapi/linux/can/gw.h
+++ b/include/uapi/linux/can/gw.h
@@ -44,6 +44,7 @@ enum {
44 CGW_SRC_IF, /* ifindex of source network interface */ 44 CGW_SRC_IF, /* ifindex of source network interface */
45 CGW_DST_IF, /* ifindex of destination network interface */ 45 CGW_DST_IF, /* ifindex of destination network interface */
46 CGW_FILTER, /* specify struct can_filter on source CAN device */ 46 CGW_FILTER, /* specify struct can_filter on source CAN device */
47 CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */
47 __CGW_MAX 48 __CGW_MAX
48}; 49};
49 50
@@ -51,6 +52,7 @@ enum {
51 52
52#define CGW_FLAGS_CAN_ECHO 0x01 53#define CGW_FLAGS_CAN_ECHO 0x01
53#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02 54#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
55#define CGW_FLAGS_CAN_IIF_TX_OK 0x04
54 56
55#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */ 57#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
56 58
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index 5db297514aec..2d70d79ce2fd 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -108,15 +108,26 @@ struct __fdb_entry {
108 * [IFLA_AF_SPEC] = { 108 * [IFLA_AF_SPEC] = {
109 * [IFLA_BRIDGE_FLAGS] 109 * [IFLA_BRIDGE_FLAGS]
110 * [IFLA_BRIDGE_MODE] 110 * [IFLA_BRIDGE_MODE]
111 * [IFLA_BRIDGE_VLAN_INFO]
111 * } 112 * }
112 */ 113 */
113enum { 114enum {
114 IFLA_BRIDGE_FLAGS, 115 IFLA_BRIDGE_FLAGS,
115 IFLA_BRIDGE_MODE, 116 IFLA_BRIDGE_MODE,
117 IFLA_BRIDGE_VLAN_INFO,
116 __IFLA_BRIDGE_MAX, 118 __IFLA_BRIDGE_MAX,
117}; 119};
118#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) 120#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
119 121
122#define BRIDGE_VLAN_INFO_MASTER (1<<0) /* Operate on Bridge device as well */
123#define BRIDGE_VLAN_INFO_PVID (1<<1) /* VLAN is PVID, ingress untagged */
124#define BRIDGE_VLAN_INFO_UNTAGGED (1<<2) /* VLAN egresses untagged */
125
126struct bridge_vlan_info {
127 __u16 flags;
128 __u16 vid;
129};
130
120/* Bridge multicast database attributes 131/* Bridge multicast database attributes
121 * [MDBA_MDB] = { 132 * [MDBA_MDB] = {
122 * [MDBA_MDB_ENTRY] = { 133 * [MDBA_MDB_ENTRY] = {
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 67fb87ca1094..798032d01112 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -83,6 +83,7 @@
83#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */ 83#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
84#define ETH_P_TIPC 0x88CA /* TIPC */ 84#define ETH_P_TIPC 0x88CA /* TIPC */
85#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ 85#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
86#define ETH_P_MVRP 0x88F5 /* 802.1Q MVRP */
86#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ 87#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
87#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ 88#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
88#define ETH_P_TDLS 0x890D /* TDLS */ 89#define ETH_P_TDLS 0x890D /* TDLS */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 60f3b6b90602..c4edfe11f1f7 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -142,6 +142,7 @@ enum {
142#define IFLA_PROMISCUITY IFLA_PROMISCUITY 142#define IFLA_PROMISCUITY IFLA_PROMISCUITY
143 IFLA_NUM_TX_QUEUES, 143 IFLA_NUM_TX_QUEUES,
144 IFLA_NUM_RX_QUEUES, 144 IFLA_NUM_RX_QUEUES,
145 IFLA_CARRIER,
145 __IFLA_MAX 146 __IFLA_MAX
146}; 147};
147 148
diff --git a/include/uapi/linux/if_vlan.h b/include/uapi/linux/if_vlan.h
index 0744f8e65d15..7e5e6b397332 100644
--- a/include/uapi/linux/if_vlan.h
+++ b/include/uapi/linux/if_vlan.h
@@ -34,6 +34,7 @@ enum vlan_flags {
34 VLAN_FLAG_REORDER_HDR = 0x1, 34 VLAN_FLAG_REORDER_HDR = 0x1,
35 VLAN_FLAG_GVRP = 0x2, 35 VLAN_FLAG_GVRP = 0x2,
36 VLAN_FLAG_LOOSE_BINDING = 0x4, 36 VLAN_FLAG_LOOSE_BINDING = 0x4,
37 VLAN_FLAG_MVRP = 0x8,
37}; 38};
38 39
39enum vlan_name_types { 40enum vlan_name_types {
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index f79c3721da6e..53b1d56a6e7f 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -38,11 +38,6 @@ struct in6_addr {
38#define s6_addr32 in6_u.u6_addr32 38#define s6_addr32 in6_u.u6_addr32
39}; 39};
40 40
41/* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
42 * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined
43 * in network byte order, not in host byte order as are the IPv4 equivalents
44 */
45
46struct sockaddr_in6 { 41struct sockaddr_in6 {
47 unsigned short int sin6_family; /* AF_INET6 */ 42 unsigned short int sin6_family; /* AF_INET6 */
48 __be16 sin6_port; /* Transport layer port # */ 43 __be16 sin6_port; /* Transport layer port # */
@@ -264,17 +259,10 @@ struct in6_flowlabel_req {
264 259
265/* 260/*
266 * Multicast Routing: 261 * Multicast Routing:
267 * see include/linux/mroute6.h. 262 * see include/uapi/linux/mroute6.h.
268 * 263 *
269 * MRT6_INIT 200 264 * MRT6_BASE 200
270 * MRT6_DONE 201 265 * ...
271 * MRT6_ADD_MIF 202 266 * MRT6_MAX
272 * MRT6_DEL_MIF 203
273 * MRT6_ADD_MFC 204
274 * MRT6_DEL_MFC 205
275 * MRT6_VERSION 206
276 * MRT6_ASSERT 207
277 * MRT6_PIM 208
278 * (reserved) 209
279 */ 267 */
280#endif /* _UAPI_LINUX_IN6_H */ 268#endif /* _UAPI_LINUX_IN6_H */
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index 5a2991cf0251..4bda4cf5b0f5 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -63,6 +63,8 @@ struct ipv6_opt_hdr {
63#define ipv6_destopt_hdr ipv6_opt_hdr 63#define ipv6_destopt_hdr ipv6_opt_hdr
64#define ipv6_hopopt_hdr ipv6_opt_hdr 64#define ipv6_hopopt_hdr ipv6_opt_hdr
65 65
66/* Router Alert option values (RFC2711) */
67#define IPV6_OPT_ROUTERALERT_MLD 0x0000 /* MLD(RFC2710) */
66 68
67/* 69/*
68 * routing header type 0 (used in cmsghdr struct) 70 * routing header type 0 (used in cmsghdr struct)
diff --git a/include/uapi/linux/mroute.h b/include/uapi/linux/mroute.h
index 16929993acc4..a382d2c04a42 100644
--- a/include/uapi/linux/mroute.h
+++ b/include/uapi/linux/mroute.h
@@ -26,6 +26,9 @@
26#define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */ 26#define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */
27#define MRT_PIM (MRT_BASE+8) /* enable PIM code */ 27#define MRT_PIM (MRT_BASE+8) /* enable PIM code */
28#define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */ 28#define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */
29#define MRT_ADD_MFC_PROXY (MRT_BASE+10) /* Add a (*,*|G) mfc entry */
30#define MRT_DEL_MFC_PROXY (MRT_BASE+11) /* Del a (*,*|G) mfc entry */
31#define MRT_MAX (MRT_BASE+11)
29 32
30#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */ 33#define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */
31#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1) 34#define SIOCGETSGCNT (SIOCPROTOPRIVATE+1)
diff --git a/include/uapi/linux/mroute6.h b/include/uapi/linux/mroute6.h
index 3e89b5e7f9e3..ce91215cf7e6 100644
--- a/include/uapi/linux/mroute6.h
+++ b/include/uapi/linux/mroute6.h
@@ -26,6 +26,9 @@
26#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */ 26#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */
27#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */ 27#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */
28#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */ 28#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */
29#define MRT6_ADD_MFC_PROXY (MRT6_BASE+10) /* Add a (*,*|G) mfc entry */
30#define MRT6_DEL_MFC_PROXY (MRT6_BASE+11) /* Del a (*,*|G) mfc entry */
31#define MRT6_MAX (MRT6_BASE+11)
29 32
30#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */ 33#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */
31#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) 34#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h
index 275e5d65dcb2..adb068c53c4e 100644
--- a/include/uapi/linux/neighbour.h
+++ b/include/uapi/linux/neighbour.h
@@ -20,6 +20,7 @@ enum {
20 NDA_LLADDR, 20 NDA_LLADDR,
21 NDA_CACHEINFO, 21 NDA_CACHEINFO,
22 NDA_PROBES, 22 NDA_PROBES,
23 NDA_VLAN,
23 __NDA_MAX 24 __NDA_MAX
24}; 25};
25 26
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index 08f555fef13f..41115776d76f 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -35,9 +35,11 @@ header-y += xt_TCPOPTSTRIP.h
35header-y += xt_TEE.h 35header-y += xt_TEE.h
36header-y += xt_TPROXY.h 36header-y += xt_TPROXY.h
37header-y += xt_addrtype.h 37header-y += xt_addrtype.h
38header-y += xt_bpf.h
38header-y += xt_cluster.h 39header-y += xt_cluster.h
39header-y += xt_comment.h 40header-y += xt_comment.h
40header-y += xt_connbytes.h 41header-y += xt_connbytes.h
42header-y += xt_connlabel.h
41header-y += xt_connlimit.h 43header-y += xt_connlimit.h
42header-y += xt_connmark.h 44header-y += xt_connmark.h
43header-y += xt_conntrack.h 45header-y += xt_conntrack.h
diff --git a/include/uapi/linux/netfilter/nf_conntrack_common.h b/include/uapi/linux/netfilter/nf_conntrack_common.h
index 1644cdd8be91..d69483fb3825 100644
--- a/include/uapi/linux/netfilter/nf_conntrack_common.h
+++ b/include/uapi/linux/netfilter/nf_conntrack_common.h
@@ -101,6 +101,7 @@ enum ip_conntrack_events {
101 IPCT_MARK, /* new mark has been set */ 101 IPCT_MARK, /* new mark has been set */
102 IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */ 102 IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */
103 IPCT_SECMARK, /* new security mark has been set */ 103 IPCT_SECMARK, /* new security mark has been set */
104 IPCT_LABEL, /* new connlabel has been set */
104}; 105};
105 106
106enum ip_conntrack_expect_events { 107enum ip_conntrack_expect_events {
diff --git a/include/uapi/linux/netfilter/nfnetlink_conntrack.h b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
index 86e930cf3dfb..08fabc6c93f3 100644
--- a/include/uapi/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
@@ -49,6 +49,8 @@ enum ctattr_type {
49 CTA_SECCTX, 49 CTA_SECCTX,
50 CTA_TIMESTAMP, 50 CTA_TIMESTAMP,
51 CTA_MARK_MASK, 51 CTA_MARK_MASK,
52 CTA_LABELS,
53 CTA_LABELS_MASK,
52 __CTA_MAX 54 __CTA_MAX
53}; 55};
54#define CTA_MAX (__CTA_MAX - 1) 56#define CTA_MAX (__CTA_MAX - 1)
diff --git a/include/uapi/linux/netfilter/xt_CT.h b/include/uapi/linux/netfilter/xt_CT.h
index a064b8af360c..5a688c1ca4d7 100644
--- a/include/uapi/linux/netfilter/xt_CT.h
+++ b/include/uapi/linux/netfilter/xt_CT.h
@@ -3,7 +3,11 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#define XT_CT_NOTRACK 0x1 6enum {
7 XT_CT_NOTRACK = 1 << 0,
8 XT_CT_NOTRACK_ALIAS = 1 << 1,
9 XT_CT_MASK = XT_CT_NOTRACK | XT_CT_NOTRACK_ALIAS,
10};
7 11
8struct xt_ct_target_info { 12struct xt_ct_target_info {
9 __u16 flags; 13 __u16 flags;
diff --git a/include/uapi/linux/netfilter/xt_bpf.h b/include/uapi/linux/netfilter/xt_bpf.h
new file mode 100644
index 000000000000..5dda450eb55b
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_bpf.h
@@ -0,0 +1,17 @@
1#ifndef _XT_BPF_H
2#define _XT_BPF_H
3
4#include <linux/filter.h>
5#include <linux/types.h>
6
7#define XT_BPF_MAX_NUM_INSTR 64
8
9struct xt_bpf_info {
10 __u16 bpf_program_num_elem;
11 struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR];
12
13 /* only used in the kernel */
14 struct sk_filter *filter __attribute__((aligned(8)));
15};
16
17#endif /*_XT_BPF_H */
diff --git a/include/uapi/linux/netfilter/xt_connlabel.h b/include/uapi/linux/netfilter/xt_connlabel.h
new file mode 100644
index 000000000000..c4bc9ee9b330
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_connlabel.h
@@ -0,0 +1,12 @@
1#include <linux/types.h>
2
3#define XT_CONNLABEL_MAXBIT 127
4enum xt_connlabel_mtopts {
5 XT_CONNLABEL_OP_INVERT = 1 << 0,
6 XT_CONNLABEL_OP_SET = 1 << 1,
7};
8
9struct xt_connlabel_mtinfo {
10 __u16 bit;
11 __u16 options;
12};
diff --git a/include/uapi/linux/netfilter/xt_conntrack.h b/include/uapi/linux/netfilter/xt_conntrack.h
index e3c041d54020..e5bd3083a843 100644
--- a/include/uapi/linux/netfilter/xt_conntrack.h
+++ b/include/uapi/linux/netfilter/xt_conntrack.h
@@ -31,6 +31,7 @@ enum {
31 XT_CONNTRACK_REPLSRC_PORT = 1 << 10, 31 XT_CONNTRACK_REPLSRC_PORT = 1 << 10,
32 XT_CONNTRACK_REPLDST_PORT = 1 << 11, 32 XT_CONNTRACK_REPLDST_PORT = 1 << 11,
33 XT_CONNTRACK_DIRECTION = 1 << 12, 33 XT_CONNTRACK_DIRECTION = 1 << 12,
34 XT_CONNTRACK_STATE_ALIAS = 1 << 13,
34}; 35};
35 36
36struct xt_conntrack_mtinfo1 { 37struct xt_conntrack_mtinfo1 {
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index 0e63cee8d810..7969f46f1bb3 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -5,20 +5,17 @@
5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org> 5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org>
6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org> 6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * Permission to use, copy, modify, and/or distribute this software for any
9 * it under the terms of the GNU General Public License as published by 9 * purpose with or without fee is hereby granted, provided that the above
10 * the Free Software Foundation; either version 2 of the License, or 10 * copyright notice and this permission notice appear in all copies.
11 * (at your option) any later version.
12 * 11 *
13 * This program is distributed in the hope that it will be useful, 12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16 * GNU General Public License for more details. 15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * You should have received a copy of the GNU General Public License 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 * along with this program; if not, write to the 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */ 19 */
23 20
24#ifndef __LINUX_NFC_H 21#ifndef __LINUX_NFC_H
@@ -67,6 +64,11 @@
67 * subsequent CONNECT and CC messages. 64 * subsequent CONNECT and CC messages.
68 * If one of the passed parameters is wrong none is set and -EINVAL is 65 * If one of the passed parameters is wrong none is set and -EINVAL is
69 * returned. 66 * returned.
67 * @NFC_CMD_ENABLE_SE: Enable the physical link to a specific secure element.
68 * Once enabled a secure element will handle card emulation mode, i.e.
69 * starting a poll from a device which has a secure element enabled means
70 * we want to do SE based card emulation.
71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element.
70 */ 72 */
71enum nfc_commands { 73enum nfc_commands {
72 NFC_CMD_UNSPEC, 74 NFC_CMD_UNSPEC,
@@ -86,6 +88,8 @@ enum nfc_commands {
86 NFC_EVENT_TM_DEACTIVATED, 88 NFC_EVENT_TM_DEACTIVATED,
87 NFC_CMD_LLC_GET_PARAMS, 89 NFC_CMD_LLC_GET_PARAMS,
88 NFC_CMD_LLC_SET_PARAMS, 90 NFC_CMD_LLC_SET_PARAMS,
91 NFC_CMD_ENABLE_SE,
92 NFC_CMD_DISABLE_SE,
89/* private: internal use only */ 93/* private: internal use only */
90 __NFC_CMD_AFTER_LAST 94 __NFC_CMD_AFTER_LAST
91}; 95};
@@ -114,6 +118,7 @@ enum nfc_commands {
114 * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter 118 * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter
115 * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter 119 * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter
116 * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter 120 * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter
121 * @NFC_ATTR_SE: Available Secure Elements
117 */ 122 */
118enum nfc_attrs { 123enum nfc_attrs {
119 NFC_ATTR_UNSPEC, 124 NFC_ATTR_UNSPEC,
@@ -134,6 +139,7 @@ enum nfc_attrs {
134 NFC_ATTR_LLC_PARAM_LTO, 139 NFC_ATTR_LLC_PARAM_LTO,
135 NFC_ATTR_LLC_PARAM_RW, 140 NFC_ATTR_LLC_PARAM_RW,
136 NFC_ATTR_LLC_PARAM_MIUX, 141 NFC_ATTR_LLC_PARAM_MIUX,
142 NFC_ATTR_SE,
137/* private: internal use only */ 143/* private: internal use only */
138 __NFC_ATTR_AFTER_LAST 144 __NFC_ATTR_AFTER_LAST
139}; 145};
@@ -172,6 +178,11 @@ enum nfc_attrs {
172#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) 178#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
173#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B) 179#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
174 180
181/* NFC Secure Elements */
182#define NFC_SE_NONE 0x0
183#define NFC_SE_UICC 0x1
184#define NFC_SE_EMBEDDED 0x2
185
175struct sockaddr_nfc { 186struct sockaddr_nfc {
176 sa_family_t sa_family; 187 sa_family_t sa_family;
177 __u32 dev_idx; 188 __u32 dev_idx;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index e3e19f8b16f2..c46bb016f4e4 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -170,7 +170,8 @@
170 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, 170 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
171 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, 171 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
172 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, 172 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
173 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. 173 * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
174 * %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
174 * The channel to use can be set on the interface or be given using the 175 * The channel to use can be set on the interface or be given using the
175 * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width. 176 * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
176 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP 177 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
@@ -374,8 +375,8 @@
374 * requests to connect to a specified network but without separating 375 * requests to connect to a specified network but without separating
375 * auth and assoc steps. For this, you need to specify the SSID in a 376 * auth and assoc steps. For this, you need to specify the SSID in a
376 * %NL80211_ATTR_SSID attribute, and can optionally specify the association 377 * %NL80211_ATTR_SSID attribute, and can optionally specify the association
377 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC, 378 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP,
378 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, 379 * %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
379 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and 380 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
380 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT. 381 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
381 * Background scan period can optionally be 382 * Background scan period can optionally be
@@ -512,6 +513,12 @@
512 * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For 513 * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
513 * more background information, see 514 * more background information, see
514 * http://wireless.kernel.org/en/users/Documentation/WoWLAN. 515 * http://wireless.kernel.org/en/users/Documentation/WoWLAN.
516 * The @NL80211_CMD_SET_WOWLAN command can also be used as a notification
517 * from the driver reporting the wakeup reason. In this case, the
518 * @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason
519 * for the wakeup, if it was caused by wireless. If it is not present
520 * in the wakeup notification, the wireless device didn't cause the
521 * wakeup but reports that it was woken up.
515 * 522 *
516 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver 523 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
517 * the necessary information for supporting GTK rekey offload. This 524 * the necessary information for supporting GTK rekey offload. This
@@ -586,6 +593,24 @@
586 * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames 593 * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
587 * for IBSS or MESH vif. 594 * for IBSS or MESH vif.
588 * 595 *
596 * @NL80211_CMD_SET_MAC_ACL: sets ACL for MAC address based access control.
597 * This is to be used with the drivers advertising the support of MAC
598 * address based access control. List of MAC addresses is passed in
599 * %NL80211_ATTR_MAC_ADDRS and ACL policy is passed in
600 * %NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it
601 * is not already done. The new list will replace any existing list. Driver
602 * will clear its ACL when the list of MAC addresses passed is empty. This
603 * command is used in AP/P2P GO mode. Driver has to make sure to clear its
604 * ACL list during %NL80211_CMD_STOP_AP.
605 *
606 * @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once
607 * a radar is detected or the channel availability scan (CAC) has finished
608 * or was aborted, or a radar was detected, usermode will be notified with
609 * this event. This command is also used to notify userspace about radars
610 * while operating on this channel.
611 * %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
612 * event.
613 *
589 * @NL80211_CMD_MAX: highest used command number 614 * @NL80211_CMD_MAX: highest used command number
590 * @__NL80211_CMD_AFTER_LAST: internal use 615 * @__NL80211_CMD_AFTER_LAST: internal use
591 */ 616 */
@@ -736,6 +761,10 @@ enum nl80211_commands {
736 761
737 NL80211_CMD_SET_MCAST_RATE, 762 NL80211_CMD_SET_MCAST_RATE,
738 763
764 NL80211_CMD_SET_MAC_ACL,
765
766 NL80211_CMD_RADAR_DETECT,
767
739 /* add new commands above here */ 768 /* add new commands above here */
740 769
741 /* used to define NL80211_CMD_MAX below */ 770 /* used to define NL80211_CMD_MAX below */
@@ -958,7 +987,7 @@ enum nl80211_commands {
958 * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is 987 * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is
959 * used for the association (&enum nl80211_mfp, represented as a u32); 988 * used for the association (&enum nl80211_mfp, represented as a u32);
960 * this attribute can be used 989 * this attribute can be used
961 * with %NL80211_CMD_ASSOCIATE request 990 * with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests
962 * 991 *
963 * @NL80211_ATTR_STA_FLAGS2: Attribute containing a 992 * @NL80211_ATTR_STA_FLAGS2: Attribute containing a
964 * &struct nl80211_sta_flag_update. 993 * &struct nl80211_sta_flag_update.
@@ -1310,6 +1339,35 @@ enum nl80211_commands {
1310 * if not given in START_AP 0 is assumed, if not given in SET_BSS 1339 * if not given in START_AP 0 is assumed, if not given in SET_BSS
1311 * no change is made. 1340 * no change is made.
1312 * 1341 *
1342 * @NL80211_ATTR_LOCAL_MESH_POWER_MODE: local mesh STA link-specific power mode
1343 * defined in &enum nl80211_mesh_power_mode.
1344 *
1345 * @NL80211_ATTR_ACL_POLICY: ACL policy, see &enum nl80211_acl_policy,
1346 * carried in a u32 attribute
1347 *
1348 * @NL80211_ATTR_MAC_ADDRS: Array of nested MAC addresses, used for
1349 * MAC ACL.
1350 *
1351 * @NL80211_ATTR_MAC_ACL_MAX: u32 attribute to advertise the maximum
1352 * number of MAC addresses that a device can support for MAC
1353 * ACL.
1354 *
1355 * @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace,
1356 * contains a value of enum nl80211_radar_event (u32).
1357 *
1358 * @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver
1359 * has and handles. The format is the same as the IE contents. See
1360 * 802.11-2012 8.4.2.29 for more information.
1361 * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver
1362 * has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields.
1363 *
1364 * @NL80211_ATTR_STA_CAPABILITY: Station capabilities (u16) are advertised to
1365 * the driver, e.g., to enable TDLS power save (PU-APSD).
1366 *
1367 * @NL80211_ATTR_STA_EXT_CAPABILITY: Station extended capabilities are
1368 * advertised to the driver, e.g., to enable TDLS off channel operations
1369 * and PU-APSD.
1370 *
1313 * @NL80211_ATTR_MAX: highest attribute number currently defined 1371 * @NL80211_ATTR_MAX: highest attribute number currently defined
1314 * @__NL80211_ATTR_AFTER_LAST: internal use 1372 * @__NL80211_ATTR_AFTER_LAST: internal use
1315 */ 1373 */
@@ -1580,6 +1638,22 @@ enum nl80211_attrs {
1580 NL80211_ATTR_P2P_CTWINDOW, 1638 NL80211_ATTR_P2P_CTWINDOW,
1581 NL80211_ATTR_P2P_OPPPS, 1639 NL80211_ATTR_P2P_OPPPS,
1582 1640
1641 NL80211_ATTR_LOCAL_MESH_POWER_MODE,
1642
1643 NL80211_ATTR_ACL_POLICY,
1644
1645 NL80211_ATTR_MAC_ADDRS,
1646
1647 NL80211_ATTR_MAC_ACL_MAX,
1648
1649 NL80211_ATTR_RADAR_EVENT,
1650
1651 NL80211_ATTR_EXT_CAPA,
1652 NL80211_ATTR_EXT_CAPA_MASK,
1653
1654 NL80211_ATTR_STA_CAPABILITY,
1655 NL80211_ATTR_STA_EXT_CAPABILITY,
1656
1583 /* add attributes here, update the policy in nl80211.c */ 1657 /* add attributes here, update the policy in nl80211.c */
1584 1658
1585 __NL80211_ATTR_AFTER_LAST, 1659 __NL80211_ATTR_AFTER_LAST,
@@ -1697,6 +1771,9 @@ enum nl80211_iftype {
1697 * flag can't be changed, it is only valid while adding a station, and 1771 * flag can't be changed, it is only valid while adding a station, and
1698 * attempts to change it will silently be ignored (rather than rejected 1772 * attempts to change it will silently be ignored (rather than rejected
1699 * as errors.) 1773 * as errors.)
1774 * @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers
1775 * that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a
1776 * previously added station into associated state
1700 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined 1777 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
1701 * @__NL80211_STA_FLAG_AFTER_LAST: internal use 1778 * @__NL80211_STA_FLAG_AFTER_LAST: internal use
1702 */ 1779 */
@@ -1708,6 +1785,7 @@ enum nl80211_sta_flags {
1708 NL80211_STA_FLAG_MFP, 1785 NL80211_STA_FLAG_MFP,
1709 NL80211_STA_FLAG_AUTHENTICATED, 1786 NL80211_STA_FLAG_AUTHENTICATED,
1710 NL80211_STA_FLAG_TDLS_PEER, 1787 NL80211_STA_FLAG_TDLS_PEER,
1788 NL80211_STA_FLAG_ASSOCIATED,
1711 1789
1712 /* keep last */ 1790 /* keep last */
1713 __NL80211_STA_FLAG_AFTER_LAST, 1791 __NL80211_STA_FLAG_AFTER_LAST,
@@ -1813,6 +1891,8 @@ enum nl80211_sta_bss_param {
1813 * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) 1891 * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
1814 * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) 1892 * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
1815 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) 1893 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
1894 * @NL80211_STA_INFO_RX_BYTES64: total received bytes (u64, from this station)
1895 * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (u64, to this station)
1816 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) 1896 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
1817 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute 1897 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
1818 * containing info as possible, see &enum nl80211_rate_info 1898 * containing info as possible, see &enum nl80211_rate_info
@@ -1834,6 +1914,10 @@ enum nl80211_sta_bss_param {
1834 * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. 1914 * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
1835 * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32) 1915 * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32)
1836 * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64) 1916 * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64)
1917 * @NL80211_STA_INFO_LOCAL_PM: local mesh STA link-specific power mode
1918 * @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode
1919 * @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards
1920 * non-peer STA
1837 * @__NL80211_STA_INFO_AFTER_LAST: internal 1921 * @__NL80211_STA_INFO_AFTER_LAST: internal
1838 * @NL80211_STA_INFO_MAX: highest possible station info attribute 1922 * @NL80211_STA_INFO_MAX: highest possible station info attribute
1839 */ 1923 */
@@ -1858,6 +1942,11 @@ enum nl80211_sta_info {
1858 NL80211_STA_INFO_STA_FLAGS, 1942 NL80211_STA_INFO_STA_FLAGS,
1859 NL80211_STA_INFO_BEACON_LOSS, 1943 NL80211_STA_INFO_BEACON_LOSS,
1860 NL80211_STA_INFO_T_OFFSET, 1944 NL80211_STA_INFO_T_OFFSET,
1945 NL80211_STA_INFO_LOCAL_PM,
1946 NL80211_STA_INFO_PEER_PM,
1947 NL80211_STA_INFO_NONPEER_PM,
1948 NL80211_STA_INFO_RX_BYTES64,
1949 NL80211_STA_INFO_TX_BYTES64,
1861 1950
1862 /* keep last */ 1951 /* keep last */
1863 __NL80211_STA_INFO_AFTER_LAST, 1952 __NL80211_STA_INFO_AFTER_LAST,
@@ -1967,6 +2056,20 @@ enum nl80211_band_attr {
1967 * on this channel in current regulatory domain. 2056 * on this channel in current regulatory domain.
1968 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm 2057 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
1969 * (100 * dBm). 2058 * (100 * dBm).
2059 * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
2060 * (enum nl80211_dfs_state)
2061 * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long
2062 * this channel is in this DFS state.
2063 * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
2064 * channel as the control channel
2065 * @NL80211_FREQUENCY_ATTR_NO_HT40_PLUS: HT40+ isn't possible with this
2066 * channel as the control channel
2067 * @NL80211_FREQUENCY_ATTR_NO_80MHZ: any 80 MHz channel using this channel
2068 * as the primary or any of the secondary channels isn't possible,
2069 * this includes 80+80 channels
2070 * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
2071 * using this channel as the primary or any of the secondary channels
2072 * isn't possible
1970 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number 2073 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
1971 * currently defined 2074 * currently defined
1972 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use 2075 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -1979,6 +2082,12 @@ enum nl80211_frequency_attr {
1979 NL80211_FREQUENCY_ATTR_NO_IBSS, 2082 NL80211_FREQUENCY_ATTR_NO_IBSS,
1980 NL80211_FREQUENCY_ATTR_RADAR, 2083 NL80211_FREQUENCY_ATTR_RADAR,
1981 NL80211_FREQUENCY_ATTR_MAX_TX_POWER, 2084 NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
2085 NL80211_FREQUENCY_ATTR_DFS_STATE,
2086 NL80211_FREQUENCY_ATTR_DFS_TIME,
2087 NL80211_FREQUENCY_ATTR_NO_HT40_MINUS,
2088 NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
2089 NL80211_FREQUENCY_ATTR_NO_80MHZ,
2090 NL80211_FREQUENCY_ATTR_NO_160MHZ,
1982 2091
1983 /* keep last */ 2092 /* keep last */
1984 __NL80211_FREQUENCY_ATTR_AFTER_LAST, 2093 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -2249,6 +2358,34 @@ enum nl80211_mntr_flags {
2249}; 2358};
2250 2359
2251/** 2360/**
2361 * enum nl80211_mesh_power_mode - mesh power save modes
2362 *
2363 * @NL80211_MESH_POWER_UNKNOWN: The mesh power mode of the mesh STA is
2364 * not known or has not been set yet.
2365 * @NL80211_MESH_POWER_ACTIVE: Active mesh power mode. The mesh STA is
2366 * in Awake state all the time.
2367 * @NL80211_MESH_POWER_LIGHT_SLEEP: Light sleep mode. The mesh STA will
2368 * alternate between Active and Doze states, but will wake up for
2369 * neighbor's beacons.
2370 * @NL80211_MESH_POWER_DEEP_SLEEP: Deep sleep mode. The mesh STA will
2371 * alternate between Active and Doze states, but may not wake up
2372 * for neighbor's beacons.
2373 *
2374 * @__NL80211_MESH_POWER_AFTER_LAST - internal use
2375 * @NL80211_MESH_POWER_MAX - highest possible power save level
2376 */
2377
2378enum nl80211_mesh_power_mode {
2379 NL80211_MESH_POWER_UNKNOWN,
2380 NL80211_MESH_POWER_ACTIVE,
2381 NL80211_MESH_POWER_LIGHT_SLEEP,
2382 NL80211_MESH_POWER_DEEP_SLEEP,
2383
2384 __NL80211_MESH_POWER_AFTER_LAST,
2385 NL80211_MESH_POWER_MAX = __NL80211_MESH_POWER_AFTER_LAST - 1
2386};
2387
2388/**
2252 * enum nl80211_meshconf_params - mesh configuration parameters 2389 * enum nl80211_meshconf_params - mesh configuration parameters
2253 * 2390 *
2254 * Mesh configuration parameters. These can be changed while the mesh is 2391 * Mesh configuration parameters. These can be changed while the mesh is
@@ -2342,6 +2479,11 @@ enum nl80211_mntr_flags {
2342 * (in TUs) during which a mesh STA can send only one Action frame 2479 * (in TUs) during which a mesh STA can send only one Action frame
2343 * containing a PREQ element for root path confirmation. 2480 * containing a PREQ element for root path confirmation.
2344 * 2481 *
2482 * @NL80211_MESHCONF_POWER_MODE: Default mesh power mode for new peer links.
2483 * type &enum nl80211_mesh_power_mode (u32)
2484 *
2485 * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)
2486 *
2345 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2487 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
2346 */ 2488 */
2347enum nl80211_meshconf_params { 2489enum nl80211_meshconf_params {
@@ -2371,6 +2513,8 @@ enum nl80211_meshconf_params {
2371 NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, 2513 NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
2372 NL80211_MESHCONF_HWMP_ROOT_INTERVAL, 2514 NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
2373 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, 2515 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
2516 NL80211_MESHCONF_POWER_MODE,
2517 NL80211_MESHCONF_AWAKE_WINDOW,
2374 2518
2375 /* keep last */ 2519 /* keep last */
2376 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2520 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -2816,10 +2960,12 @@ enum nl80211_tx_power_setting {
2816 * corresponds to the lowest-order bit in the second byte of the mask. 2960 * corresponds to the lowest-order bit in the second byte of the mask.
2817 * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where 2961 * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where
2818 * xx indicates "don't care") would be represented by a pattern of 2962 * xx indicates "don't care") would be represented by a pattern of
2819 * twelve zero bytes, and a mask of "0xed,0x07". 2963 * twelve zero bytes, and a mask of "0xed,0x01".
2820 * Note that the pattern matching is done as though frames were not 2964 * Note that the pattern matching is done as though frames were not
2821 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked 2965 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
2822 * first (including SNAP header unpacking) and then matched. 2966 * first (including SNAP header unpacking) and then matched.
2967 * @NL80211_WOWLAN_PKTPAT_OFFSET: packet offset, pattern is matched after
2968 * these fixed number of bytes of received packet
2823 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes 2969 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes
2824 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number 2970 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number
2825 */ 2971 */
@@ -2827,6 +2973,7 @@ enum nl80211_wowlan_packet_pattern_attr {
2827 __NL80211_WOWLAN_PKTPAT_INVALID, 2973 __NL80211_WOWLAN_PKTPAT_INVALID,
2828 NL80211_WOWLAN_PKTPAT_MASK, 2974 NL80211_WOWLAN_PKTPAT_MASK,
2829 NL80211_WOWLAN_PKTPAT_PATTERN, 2975 NL80211_WOWLAN_PKTPAT_PATTERN,
2976 NL80211_WOWLAN_PKTPAT_OFFSET,
2830 2977
2831 NUM_NL80211_WOWLAN_PKTPAT, 2978 NUM_NL80211_WOWLAN_PKTPAT,
2832 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1, 2979 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
@@ -2837,6 +2984,7 @@ enum nl80211_wowlan_packet_pattern_attr {
2837 * @max_patterns: maximum number of patterns supported 2984 * @max_patterns: maximum number of patterns supported
2838 * @min_pattern_len: minimum length of each pattern 2985 * @min_pattern_len: minimum length of each pattern
2839 * @max_pattern_len: maximum length of each pattern 2986 * @max_pattern_len: maximum length of each pattern
2987 * @max_pkt_offset: maximum Rx packet offset
2840 * 2988 *
2841 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when 2989 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
2842 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the 2990 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
@@ -2846,6 +2994,7 @@ struct nl80211_wowlan_pattern_support {
2846 __u32 max_patterns; 2994 __u32 max_patterns;
2847 __u32 min_pattern_len; 2995 __u32 min_pattern_len;
2848 __u32 max_pattern_len; 2996 __u32 max_pattern_len;
2997 __u32 max_pkt_offset;
2849} __attribute__((packed)); 2998} __attribute__((packed));
2850 2999
2851/** 3000/**
@@ -2861,12 +3010,17 @@ struct nl80211_wowlan_pattern_support {
2861 * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns 3010 * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns
2862 * which are passed in an array of nested attributes, each nested attribute 3011 * which are passed in an array of nested attributes, each nested attribute
2863 * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern. 3012 * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
2864 * Each pattern defines a wakeup packet. The matching is done on the MSDU, 3013 * Each pattern defines a wakeup packet. Packet offset is associated with
2865 * i.e. as though the packet was an 802.3 packet, so the pattern matching 3014 * each pattern which is used while matching the pattern. The matching is
2866 * is done after the packet is converted to the MSDU. 3015 * done on the MSDU, i.e. as though the packet was an 802.3 packet, so the
3016 * pattern matching is done after the packet is converted to the MSDU.
2867 * 3017 *
2868 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute 3018 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
2869 * carrying a &struct nl80211_wowlan_pattern_support. 3019 * carrying a &struct nl80211_wowlan_pattern_support.
3020 *
3021 * When reporting wakeup. it is a u32 attribute containing the 0-based
3022 * index of the pattern that caused the wakeup, in the patterns passed
3023 * to the kernel when configuring.
2870 * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be 3024 * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
2871 * used when setting, used only to indicate that GTK rekeying is supported 3025 * used when setting, used only to indicate that GTK rekeying is supported
2872 * by the device (flag) 3026 * by the device (flag)
@@ -2877,8 +3031,36 @@ struct nl80211_wowlan_pattern_support {
2877 * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag) 3031 * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
2878 * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released 3032 * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
2879 * (on devices that have rfkill in the device) (flag) 3033 * (on devices that have rfkill in the device) (flag)
3034 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211: For wakeup reporting only, contains
3035 * the 802.11 packet that caused the wakeup, e.g. a deauth frame. The frame
3036 * may be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN
3037 * attribute contains the original length.
3038 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN: Original length of the 802.11
3039 * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211
3040 * attribute if the packet was truncated somewhere.
3041 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023: For wakeup reporting only, contains the
3042 * 802.11 packet that caused the wakeup, e.g. a magic packet. The frame may
3043 * be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN attribute
3044 * contains the original length.
3045 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3
3046 * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023
3047 * attribute if the packet was truncated somewhere.
3048 * @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section
3049 * "TCP connection wakeup" for more details. This is a nested attribute
3050 * containing the exact information for establishing and keeping alive
3051 * the TCP connection.
3052 * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the
3053 * wakeup packet was received on the TCP connection
3054 * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the
3055 * TCP connection was lost or failed to be established
3056 * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only,
3057 * the TCP connection ran out of tokens to use for data to send to the
3058 * service
2880 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers 3059 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
2881 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number 3060 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
3061 *
3062 * These nested attributes are used to configure the wakeup triggers and
3063 * to report the wakeup reason(s).
2882 */ 3064 */
2883enum nl80211_wowlan_triggers { 3065enum nl80211_wowlan_triggers {
2884 __NL80211_WOWLAN_TRIG_INVALID, 3066 __NL80211_WOWLAN_TRIG_INVALID,
@@ -2891,6 +3073,14 @@ enum nl80211_wowlan_triggers {
2891 NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST, 3073 NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
2892 NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE, 3074 NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
2893 NL80211_WOWLAN_TRIG_RFKILL_RELEASE, 3075 NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
3076 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211,
3077 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN,
3078 NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023,
3079 NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN,
3080 NL80211_WOWLAN_TRIG_TCP_CONNECTION,
3081 NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH,
3082 NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST,
3083 NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
2894 3084
2895 /* keep last */ 3085 /* keep last */
2896 NUM_NL80211_WOWLAN_TRIG, 3086 NUM_NL80211_WOWLAN_TRIG,
@@ -2898,6 +3088,116 @@ enum nl80211_wowlan_triggers {
2898}; 3088};
2899 3089
2900/** 3090/**
3091 * DOC: TCP connection wakeup
3092 *
3093 * Some devices can establish a TCP connection in order to be woken up by a
3094 * packet coming in from outside their network segment, or behind NAT. If
3095 * configured, the device will establish a TCP connection to the given
3096 * service, and periodically send data to that service. The first data
3097 * packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK.
3098 * The data packets can optionally include a (little endian) sequence
3099 * number (in the TCP payload!) that is generated by the device, and, also
3100 * optionally, a token from a list of tokens. This serves as a keep-alive
3101 * with the service, and for NATed connections, etc.
3102 *
3103 * During this keep-alive period, the server doesn't send any data to the
3104 * client. When receiving data, it is compared against the wakeup pattern
3105 * (and mask) and if it matches, the host is woken up. Similarly, if the
3106 * connection breaks or cannot be established to start with, the host is
3107 * also woken up.
3108 *
3109 * Developer's note: ARP offload is required for this, otherwise TCP
3110 * response packets might not go through correctly.
3111 */
3112
3113/**
3114 * struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence
3115 * @start: starting value
3116 * @offset: offset of sequence number in packet
3117 * @len: length of the sequence value to write, 1 through 4
3118 *
3119 * Note: don't confuse with the TCP sequence number(s), this is for the
3120 * keepalive packet payload. The actual value is written into the packet
3121 * in little endian.
3122 */
3123struct nl80211_wowlan_tcp_data_seq {
3124 __u32 start, offset, len;
3125};
3126
3127/**
3128 * struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config
3129 * @offset: offset of token in packet
3130 * @len: length of each token
3131 * @token_stream: stream of data to be used for the tokens, the length must
3132 * be a multiple of @len for this to make sense
3133 */
3134struct nl80211_wowlan_tcp_data_token {
3135 __u32 offset, len;
3136 __u8 token_stream[];
3137};
3138
3139/**
3140 * struct nl80211_wowlan_tcp_data_token_feature - data token features
3141 * @min_len: minimum token length
3142 * @max_len: maximum token length
3143 * @bufsize: total available token buffer size (max size of @token_stream)
3144 */
3145struct nl80211_wowlan_tcp_data_token_feature {
3146 __u32 min_len, max_len, bufsize;
3147};
3148
3149/**
3150 * enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters
3151 * @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes
3152 * @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order)
3153 * @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address
3154 * (in network byte order)
3155 * @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because
3156 * route lookup when configured might be invalid by the time we suspend,
3157 * and doing a route lookup when suspending is no longer possible as it
3158 * might require ARP querying.
3159 * @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a
3160 * socket and port will be allocated
3161 * @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16)
3162 * @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte.
3163 * For feature advertising, a u32 attribute holding the maximum length
3164 * of the data payload.
3165 * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration
3166 * (if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature
3167 * advertising it is just a flag
3168 * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration,
3169 * see &struct nl80211_wowlan_tcp_data_token and for advertising see
3170 * &struct nl80211_wowlan_tcp_data_token_feature.
3171 * @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum
3172 * interval in feature advertising (u32)
3173 * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
3174 * u32 attribute holding the maximum length
3175 * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
3176 * feature advertising. The mask works like @NL80211_WOWLAN_PKTPAT_MASK
3177 * but on the TCP payload only.
3178 * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
3179 * @MAX_NL80211_WOWLAN_TCP: highest attribute number
3180 */
3181enum nl80211_wowlan_tcp_attrs {
3182 __NL80211_WOWLAN_TCP_INVALID,
3183 NL80211_WOWLAN_TCP_SRC_IPV4,
3184 NL80211_WOWLAN_TCP_DST_IPV4,
3185 NL80211_WOWLAN_TCP_DST_MAC,
3186 NL80211_WOWLAN_TCP_SRC_PORT,
3187 NL80211_WOWLAN_TCP_DST_PORT,
3188 NL80211_WOWLAN_TCP_DATA_PAYLOAD,
3189 NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ,
3190 NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN,
3191 NL80211_WOWLAN_TCP_DATA_INTERVAL,
3192 NL80211_WOWLAN_TCP_WAKE_PAYLOAD,
3193 NL80211_WOWLAN_TCP_WAKE_MASK,
3194
3195 /* keep last */
3196 NUM_NL80211_WOWLAN_TCP,
3197 MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1
3198};
3199
3200/**
2901 * enum nl80211_iface_limit_attrs - limit attributes 3201 * enum nl80211_iface_limit_attrs - limit attributes
2902 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) 3202 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
2903 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that 3203 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
@@ -2933,6 +3233,8 @@ enum nl80211_iface_limit_attrs {
2933 * the infrastructure network's beacon interval. 3233 * the infrastructure network's beacon interval.
2934 * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many 3234 * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many
2935 * different channels may be used within this group. 3235 * different channels may be used within this group.
3236 * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap
3237 * of supported channel widths for radar detection.
2936 * @NUM_NL80211_IFACE_COMB: number of attributes 3238 * @NUM_NL80211_IFACE_COMB: number of attributes
2937 * @MAX_NL80211_IFACE_COMB: highest attribute number 3239 * @MAX_NL80211_IFACE_COMB: highest attribute number
2938 * 3240 *
@@ -2965,6 +3267,7 @@ enum nl80211_if_combination_attrs {
2965 NL80211_IFACE_COMB_MAXNUM, 3267 NL80211_IFACE_COMB_MAXNUM,
2966 NL80211_IFACE_COMB_STA_AP_BI_MATCH, 3268 NL80211_IFACE_COMB_STA_AP_BI_MATCH,
2967 NL80211_IFACE_COMB_NUM_CHANNELS, 3269 NL80211_IFACE_COMB_NUM_CHANNELS,
3270 NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
2968 3271
2969 /* keep last */ 3272 /* keep last */
2970 NUM_NL80211_IFACE_COMB, 3273 NUM_NL80211_IFACE_COMB,
@@ -3140,6 +3443,19 @@ enum nl80211_ap_sme_features {
3140 * setting 3443 * setting
3141 * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic 3444 * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic
3142 * powersave 3445 * powersave
3446 * @NL80211_FEATURE_FULL_AP_CLIENT_STATE: The driver supports full state
3447 * transitions for AP clients. Without this flag (and if the driver
3448 * doesn't have the AP SME in the device) the driver supports adding
3449 * stations only when they're associated and adds them in associated
3450 * state (to later be transitioned into authorized), with this flag
3451 * they should be added before even sending the authentication reply
3452 * and then transitioned into authenticated, associated and authorized
3453 * states using station flags.
3454 * Note that even for drivers that support this, the default is to add
3455 * stations in authenticated/associated state, so to add unauthenticated
3456 * stations the authenticated/associated bits have to be set in the mask.
3457 * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits
3458 * (HT40, VHT 80/160 MHz) if this flag is set
3143 */ 3459 */
3144enum nl80211_feature_flags { 3460enum nl80211_feature_flags {
3145 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3461 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3155,6 +3471,9 @@ enum nl80211_feature_flags {
3155 NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, 3471 NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
3156 NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11, 3472 NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
3157 NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12, 3473 NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
3474 /* bit 13 is reserved */
3475 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
3476 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
3158}; 3477};
3159 3478
3160/** 3479/**
@@ -3182,7 +3501,7 @@ enum nl80211_probe_resp_offload_support_attr {
3182 * enum nl80211_connect_failed_reason - connection request failed reasons 3501 * enum nl80211_connect_failed_reason - connection request failed reasons
3183 * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be 3502 * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
3184 * handled by the AP is reached. 3503 * handled by the AP is reached.
3185 * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Client's MAC is in the AP's blocklist. 3504 * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Connection request is rejected due to ACL.
3186 */ 3505 */
3187enum nl80211_connect_failed_reason { 3506enum nl80211_connect_failed_reason {
3188 NL80211_CONN_FAIL_MAX_CLIENTS, 3507 NL80211_CONN_FAIL_MAX_CLIENTS,
@@ -3210,4 +3529,62 @@ enum nl80211_scan_flags {
3210 NL80211_SCAN_FLAG_AP = 1<<2, 3529 NL80211_SCAN_FLAG_AP = 1<<2,
3211}; 3530};
3212 3531
3532/**
3533 * enum nl80211_acl_policy - access control policy
3534 *
3535 * Access control policy is applied on a MAC list set by
3536 * %NL80211_CMD_START_AP and %NL80211_CMD_SET_MAC_ACL, to
3537 * be used with %NL80211_ATTR_ACL_POLICY.
3538 *
3539 * @NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED: Deny stations which are
3540 * listed in ACL, i.e. allow all the stations which are not listed
3541 * in ACL to authenticate.
3542 * @NL80211_ACL_POLICY_DENY_UNLESS_LISTED: Allow the stations which are listed
3543 * in ACL, i.e. deny all the stations which are not listed in ACL.
3544 */
3545enum nl80211_acl_policy {
3546 NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED,
3547 NL80211_ACL_POLICY_DENY_UNLESS_LISTED,
3548};
3549
3550/**
3551 * enum nl80211_radar_event - type of radar event for DFS operation
3552 *
3553 * Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace
3554 * about detected radars or success of the channel available check (CAC)
3555 *
3556 * @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is
3557 * now unusable.
3558 * @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished,
3559 * the channel is now available.
3560 * @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no
3561 * change to the channel status.
3562 * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is
3563 * over, channel becomes usable.
3564 */
3565enum nl80211_radar_event {
3566 NL80211_RADAR_DETECTED,
3567 NL80211_RADAR_CAC_FINISHED,
3568 NL80211_RADAR_CAC_ABORTED,
3569 NL80211_RADAR_NOP_FINISHED,
3570};
3571
3572/**
3573 * enum nl80211_dfs_state - DFS states for channels
3574 *
3575 * Channel states used by the DFS code.
3576 *
3577 * @IEEE80211_DFS_USABLE: The channel can be used, but channel availability
3578 * check (CAC) must be performed before using it for AP or IBSS.
3579 * @IEEE80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it
3580 * is therefore marked as not available.
3581 * @IEEE80211_DFS_AVAILABLE: The channel has been CAC checked and is available.
3582 */
3583
3584enum nl80211_dfs_state {
3585 NL80211_DFS_USABLE,
3586 NL80211_DFS_UNAVAILABLE,
3587 NL80211_DFS_AVAILABLE,
3588};
3589
3213#endif /* __LINUX_NL80211_H */ 3590#endif /* __LINUX_NL80211_H */
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 7a5eb196ade9..7a2144e1afae 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -630,6 +630,7 @@ struct tcamsg {
630 630
631/* New extended info filters for IFLA_EXT_MASK */ 631/* New extended info filters for IFLA_EXT_MASK */
632#define RTEXT_FILTER_VF (1 << 0) 632#define RTEXT_FILTER_VF (1 << 0)
633#define RTEXT_FILTER_BRVLAN (1 << 1)
633 634
634/* End of information exported to user level */ 635/* End of information exported to user level */
635 636
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index fdfba235f9f1..b49eab89c9fd 100644
--- a/include/uapi/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
@@ -278,6 +278,7 @@ enum
278 LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ 278 LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */
279 LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ 279 LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */
280 LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/ 280 LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/
281 LINUX_MIB_XFRMOUTSTATEINVALID, /* XfrmOutStateInvalid */
281 __LINUX_MIB_XFRMMAX 282 __LINUX_MIB_XFRMMAX
282}; 283};
283 284
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
index e962faa5ab0d..6b1ead0b0c9d 100644
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -111,6 +111,7 @@ enum {
111#define TCP_QUEUE_SEQ 21 111#define TCP_QUEUE_SEQ 21
112#define TCP_REPAIR_OPTIONS 22 112#define TCP_REPAIR_OPTIONS 22
113#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ 113#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */
114#define TCP_TIMESTAMP 24
114 115
115struct tcp_repair_opt { 116struct tcp_repair_opt {
116 __u32 opt_code; 117 __u32 opt_code;
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index 848e3584d7c8..a5a8c88753b9 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -53,6 +53,7 @@
53 * network */ 53 * network */
54#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow 54#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow
55 * Steering */ 55 * Steering */
56#define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */
56 57
57#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ 58#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
58#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ 59#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
@@ -127,7 +128,7 @@ typedef __u8 virtio_net_ctrl_ack;
127 #define VIRTIO_NET_CTRL_RX_NOBCAST 5 128 #define VIRTIO_NET_CTRL_RX_NOBCAST 5
128 129
129/* 130/*
130 * Control the MAC filter table. 131 * Control the MAC
131 * 132 *
132 * The MAC filter table is managed by the hypervisor, the guest should 133 * The MAC filter table is managed by the hypervisor, the guest should
133 * assume the size is infinite. Filtering should be considered 134 * assume the size is infinite. Filtering should be considered
@@ -140,6 +141,10 @@ typedef __u8 virtio_net_ctrl_ack;
140 * first sg list contains unicast addresses, the second is for multicast. 141 * first sg list contains unicast addresses, the second is for multicast.
141 * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature 142 * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature
142 * is available. 143 * is available.
144 *
145 * The ADDR_SET command requests one out scatterlist, it contains a
146 * 6 bytes MAC address. This functionality is present if the
147 * VIRTIO_NET_F_CTRL_MAC_ADDR feature is available.
143 */ 148 */
144struct virtio_net_ctrl_mac { 149struct virtio_net_ctrl_mac {
145 __u32 entries; 150 __u32 entries;
@@ -148,6 +153,7 @@ struct virtio_net_ctrl_mac {
148 153
149#define VIRTIO_NET_CTRL_MAC 1 154#define VIRTIO_NET_CTRL_MAC 1
150 #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0 155 #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0
156 #define VIRTIO_NET_CTRL_MAC_ADDR_SET 1
151 157
152/* 158/*
153 * Control VLAN filtering 159 * Control VLAN filtering
diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/vm_sockets.h
new file mode 100644
index 000000000000..df91301847ec
--- /dev/null
+++ b/include/uapi/linux/vm_sockets.h
@@ -0,0 +1,163 @@
1/*
2 * VMware vSockets Driver
3 *
4 * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation version 2 and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef _VM_SOCKETS_H_
17#define _VM_SOCKETS_H_
18
19#if !defined(__KERNEL__)
20#include <sys/socket.h>
21#endif
22
23/* Option name for STREAM socket buffer size. Use as the option name in
24 * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
25 * specifies the size of the buffer underlying a vSockets STREAM socket.
26 * Value is clamped to the MIN and MAX.
27 */
28
29#define SO_VM_SOCKETS_BUFFER_SIZE 0
30
31/* Option name for STREAM socket minimum buffer size. Use as the option name
32 * in setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
33 * specifies the minimum size allowed for the buffer underlying a vSockets
34 * STREAM socket.
35 */
36
37#define SO_VM_SOCKETS_BUFFER_MIN_SIZE 1
38
39/* Option name for STREAM socket maximum buffer size. Use as the option name
40 * in setsockopt(3) or getsockopt(3) to set or get an unsigned long long
41 * that specifies the maximum size allowed for the buffer underlying a
42 * vSockets STREAM socket.
43 */
44
45#define SO_VM_SOCKETS_BUFFER_MAX_SIZE 2
46
47/* Option name for socket peer's host-specific VM ID. Use as the option name
48 * in getsockopt(3) to get a host-specific identifier for the peer endpoint's
49 * VM. The identifier is a signed integer.
50 * Only available for hypervisor endpoints.
51 */
52
53#define SO_VM_SOCKETS_PEER_HOST_VM_ID 3
54
55/* Option name for determining if a socket is trusted. Use as the option name
56 * in getsockopt(3) to determine if a socket is trusted. The value is a
57 * signed integer.
58 */
59
60#define SO_VM_SOCKETS_TRUSTED 5
61
62/* Option name for STREAM socket connection timeout. Use as the option name
63 * in setsockopt(3) or getsockopt(3) to set or get the connection
64 * timeout for a STREAM socket.
65 */
66
67#define SO_VM_SOCKETS_CONNECT_TIMEOUT 6
68
69/* Option name for using non-blocking send/receive. Use as the option name
70 * for setsockopt(3) or getsockopt(3) to set or get the non-blocking
71 * transmit/receive flag for a STREAM socket. This flag determines whether
72 * send() and recv() can be called in non-blocking contexts for the given
73 * socket. The value is a signed integer.
74 *
75 * This option is only relevant to kernel endpoints, where descheduling the
76 * thread of execution is not allowed, for example, while holding a spinlock.
77 * It is not to be confused with conventional non-blocking socket operations.
78 *
79 * Only available for hypervisor endpoints.
80 */
81
82#define SO_VM_SOCKETS_NONBLOCK_TXRX 7
83
84/* The vSocket equivalent of INADDR_ANY. This works for the svm_cid field of
85 * sockaddr_vm and indicates the context ID of the current endpoint.
86 */
87
88#define VMADDR_CID_ANY -1U
89
90/* Bind to any available port. Works for the svm_port field of
91 * sockaddr_vm.
92 */
93
94#define VMADDR_PORT_ANY -1U
95
96/* Use this as the destination CID in an address when referring to the
97 * hypervisor. VMCI relies on it being 0, but this would be useful for other
98 * transports too.
99 */
100
101#define VMADDR_CID_HYPERVISOR 0
102
103/* This CID is specific to VMCI and can be considered reserved (even VMCI
104 * doesn't use it anymore, it's a legacy value from an older release).
105 */
106
107#define VMADDR_CID_RESERVED 1
108
109/* Use this as the destination CID in an address when referring to the host
110 * (any process other than the hypervisor). VMCI relies on it being 2, but
111 * this would be useful for other transports too.
112 */
113
114#define VMADDR_CID_HOST 2
115
116/* Invalid vSockets version. */
117
118#define VM_SOCKETS_INVALID_VERSION -1U
119
120/* The epoch (first) component of the vSockets version. A single byte
121 * representing the epoch component of the vSockets version.
122 */
123
124#define VM_SOCKETS_VERSION_EPOCH(_v) (((_v) & 0xFF000000) >> 24)
125
126/* The major (second) component of the vSockets version. A single byte
127 * representing the major component of the vSockets version. Typically
128 * changes for every major release of a product.
129 */
130
131#define VM_SOCKETS_VERSION_MAJOR(_v) (((_v) & 0x00FF0000) >> 16)
132
133/* The minor (third) component of the vSockets version. Two bytes representing
134 * the minor component of the vSockets version.
135 */
136
137#define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF))
138
139/* Address structure for vSockets. The address family should be set to
140 * whatever vmci_sock_get_af_value_fd() returns. The structure members should
141 * all align on their natural boundaries without resorting to compiler packing
142 * directives. The total size of this structure should be exactly the same as
143 * that of struct sockaddr.
144 */
145
146struct sockaddr_vm {
147 sa_family_t svm_family;
148 unsigned short svm_reserved1;
149 unsigned int svm_port;
150 unsigned int svm_cid;
151 unsigned char svm_zero[sizeof(struct sockaddr) -
152 sizeof(sa_family_t) -
153 sizeof(unsigned short) -
154 sizeof(unsigned int) - sizeof(unsigned int)];
155};
156
157#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)
158
159#if defined(__KERNEL__)
160int vm_sockets_get_local_cid(void);
161#endif
162
163#endif
diff --git a/include/uapi/linux/wanrouter.h b/include/uapi/linux/wanrouter.h
index 7617df2833d5..498d6c12c666 100644
--- a/include/uapi/linux/wanrouter.h
+++ b/include/uapi/linux/wanrouter.h
@@ -1,363 +1,9 @@
1/*****************************************************************************
2* wanrouter.h Definitions for the WAN Multiprotocol Router Module.
3* This module provides API and common services for WAN Link
4* Drivers and is completely hardware-independent.
5*
6* Author: Nenad Corbic <ncorbic@sangoma.com>
7* Gideon Hack
8* Additions: Arnaldo Melo
9*
10* Copyright: (c) 1995-2000 Sangoma Technologies Inc.
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version
15* 2 of the License, or (at your option) any later version.
16* ============================================================================
17* Jul 21, 2000 Nenad Corbic Added WAN_FT1_READY State
18* Feb 24, 2000 Nenad Corbic Added support for socket based x25api
19* Jan 28, 2000 Nenad Corbic Added support for the ASYNC protocol.
20* Oct 04, 1999 Nenad Corbic Updated for 2.1.0 release
21* Jun 02, 1999 Gideon Hack Added support for the S514 adapter.
22* May 23, 1999 Arnaldo Melo Added local_addr to wanif_conf_t
23* WAN_DISCONNECTING state added
24* Jul 20, 1998 David Fong Added Inverse ARP options to 'wanif_conf_t'
25* Jun 12, 1998 David Fong Added Cisco HDLC support.
26* Dec 16, 1997 Jaspreet Singh Moved 'enable_IPX' and 'network_number' to
27* 'wanif_conf_t'
28* Dec 05, 1997 Jaspreet Singh Added 'pap', 'chap' to 'wanif_conf_t'
29* Added 'authenticator' to 'wan_ppp_conf_t'
30* Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0
31* Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t'
32* Added 'enable_IPX' and 'network_number' to
33* 'wan_device_t'. Also added defines for
34* UDP PACKET TYPE, Interrupt test, critical values
35* for RACE conditions.
36* Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to
37* 'wan_fr_conf_t' to configure a list of dlci(s)
38* for a NODE
39* Jul 07, 1997 Jaspreet Singh Added 'ttl' to 'wandev_conf_t' & 'wan_device_t'
40* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' to 'wan_device_t'
41* May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t'
42* Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t'
43* Jan 16, 1997 Gene Kozin router_devlist made public
44* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
45*****************************************************************************/
46
47#ifndef _UAPI_ROUTER_H
48#define _UAPI_ROUTER_H
49
50#define ROUTER_NAME "wanrouter" /* in case we ever change it */
51#define ROUTER_VERSION 1 /* version number */
52#define ROUTER_RELEASE 1 /* release (minor version) number */
53#define ROUTER_IOCTL 'W' /* for IOCTL calls */
54#define ROUTER_MAGIC 0x524D4157L /* signature: 'WANR' reversed */
55
56/* IOCTL codes for /proc/router/<device> entries (up to 255) */
57enum router_ioctls
58{
59 ROUTER_SETUP = ROUTER_IOCTL<<8, /* configure device */
60 ROUTER_DOWN, /* shut down device */
61 ROUTER_STAT, /* get device status */
62 ROUTER_IFNEW, /* add interface */
63 ROUTER_IFDEL, /* delete interface */
64 ROUTER_IFSTAT, /* get interface status */
65 ROUTER_USER = (ROUTER_IOCTL<<8)+16, /* driver-specific calls */
66 ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31
67};
68
69/* identifiers for displaying proc file data for dual port adapters */
70#define PROC_DATA_PORT_0 0x8000 /* the data is for port 0 */
71#define PROC_DATA_PORT_1 0x8001 /* the data is for port 1 */
72
73/* NLPID for packet encapsulation (ISO/IEC TR 9577) */
74#define NLPID_IP 0xCC /* Internet Protocol Datagram */
75#define NLPID_SNAP 0x80 /* IEEE Subnetwork Access Protocol */
76#define NLPID_CLNP 0x81 /* ISO/IEC 8473 */
77#define NLPID_ESIS 0x82 /* ISO/IEC 9542 */
78#define NLPID_ISIS 0x83 /* ISO/IEC ISIS */
79#define NLPID_Q933 0x08 /* CCITT Q.933 */
80
81/* Miscellaneous */
82#define WAN_IFNAME_SZ 15 /* max length of the interface name */
83#define WAN_DRVNAME_SZ 15 /* max length of the link driver name */
84#define WAN_ADDRESS_SZ 31 /* max length of the WAN media address */
85#define USED_BY_FIELD 8 /* max length of the used by field */
86
87/* Defines for UDP PACKET TYPE */
88#define UDP_PTPIPE_TYPE 0x01
89#define UDP_FPIPE_TYPE 0x02
90#define UDP_CPIPE_TYPE 0x03
91#define UDP_DRVSTATS_TYPE 0x04
92#define UDP_INVALID_TYPE 0x05
93
94/* Command return code */
95#define CMD_OK 0 /* normal firmware return code */
96#define CMD_TIMEOUT 0xFF /* firmware command timed out */
97
98/* UDP Packet Management */
99#define UDP_PKT_FRM_STACK 0x00
100#define UDP_PKT_FRM_NETWORK 0x01
101
102/* Maximum interrupt test counter */
103#define MAX_INTR_TEST_COUNTER 100
104
105/* Critical Values for RACE conditions*/
106#define CRITICAL_IN_ISR 0xA1
107#define CRITICAL_INTR_HANDLED 0xB1
108
109/****** Data Types **********************************************************/
110
111/*----------------------------------------------------------------------------
112 * X.25-specific link-level configuration.
113 */
114typedef struct wan_x25_conf
115{
116 unsigned lo_pvc; /* lowest permanent circuit number */
117 unsigned hi_pvc; /* highest permanent circuit number */
118 unsigned lo_svc; /* lowest switched circuit number */
119 unsigned hi_svc; /* highest switched circuit number */
120 unsigned hdlc_window; /* HDLC window size (1..7) */
121 unsigned pkt_window; /* X.25 packet window size (1..7) */
122 unsigned t1; /* HDLC timer T1, sec (1..30) */
123 unsigned t2; /* HDLC timer T2, sec (0..29) */
124 unsigned t4; /* HDLC supervisory frame timer = T4 * T1 */
125 unsigned n2; /* HDLC retransmission limit (1..30) */
126 unsigned t10_t20; /* X.25 RESTART timeout, sec (1..255) */
127 unsigned t11_t21; /* X.25 CALL timeout, sec (1..255) */
128 unsigned t12_t22; /* X.25 RESET timeout, sec (1..255) */
129 unsigned t13_t23; /* X.25 CLEAR timeout, sec (1..255) */
130 unsigned t16_t26; /* X.25 INTERRUPT timeout, sec (1..255) */
131 unsigned t28; /* X.25 REGISTRATION timeout, sec (1..255) */
132 unsigned r10_r20; /* RESTART retransmission limit (0..250) */
133 unsigned r12_r22; /* RESET retransmission limit (0..250) */
134 unsigned r13_r23; /* CLEAR retransmission limit (0..250) */
135 unsigned ccitt_compat; /* compatibility mode: 1988/1984/1980 */
136 unsigned x25_conf_opt; /* User defined x25 config optoins */
137 unsigned char LAPB_hdlc_only; /* Run in HDLC only mode */
138 unsigned char logging; /* Control connection logging */
139 unsigned char oob_on_modem; /* Whether to send modem status to the user app */
140} wan_x25_conf_t;
141
142/*----------------------------------------------------------------------------
143 * Frame relay specific link-level configuration.
144 */
145typedef struct wan_fr_conf
146{
147 unsigned signalling; /* local in-channel signalling type */
148 unsigned t391; /* link integrity verification timer */
149 unsigned t392; /* polling verification timer */
150 unsigned n391; /* full status polling cycle counter */
151 unsigned n392; /* error threshold counter */
152 unsigned n393; /* monitored events counter */
153 unsigned dlci_num; /* number of DLCs (access node) */
154 unsigned dlci[100]; /* List of all DLCIs */
155} wan_fr_conf_t;
156
157/*----------------------------------------------------------------------------
158 * PPP-specific link-level configuration.
159 */
160typedef struct wan_ppp_conf
161{
162 unsigned restart_tmr; /* restart timer */
163 unsigned auth_rsrt_tmr; /* authentication timer */
164 unsigned auth_wait_tmr; /* authentication timer */
165 unsigned mdm_fail_tmr; /* modem failure timer */
166 unsigned dtr_drop_tmr; /* DTR drop timer */
167 unsigned connect_tmout; /* connection timeout */
168 unsigned conf_retry; /* max. retry */
169 unsigned term_retry; /* max. retry */
170 unsigned fail_retry; /* max. retry */
171 unsigned auth_retry; /* max. retry */
172 unsigned auth_options; /* authentication opt. */
173 unsigned ip_options; /* IP options */
174 char authenticator; /* AUTHENTICATOR or not */
175 char ip_mode; /* Static/Host/Peer */
176} wan_ppp_conf_t;
177
178/*----------------------------------------------------------------------------
179 * CHDLC-specific link-level configuration.
180 */
181typedef struct wan_chdlc_conf
182{
183 unsigned char ignore_dcd; /* Protocol options: */
184 unsigned char ignore_cts; /* Ignore these to determine */
185 unsigned char ignore_keepalive; /* link status (Yes or No) */
186 unsigned char hdlc_streaming; /* hdlc_streaming mode (Y/N) */
187 unsigned char receive_only; /* no transmit buffering (Y/N) */
188 unsigned keepalive_tx_tmr; /* transmit keepalive timer */
189 unsigned keepalive_rx_tmr; /* receive keepalive timer */
190 unsigned keepalive_err_margin; /* keepalive_error_tolerance */
191 unsigned slarp_timer; /* SLARP request timer */
192} wan_chdlc_conf_t;
193
194
195/*----------------------------------------------------------------------------
196 * WAN device configuration. Passed to ROUTER_SETUP IOCTL.
197 */
198typedef struct wandev_conf
199{
200 unsigned magic; /* magic number (for verification) */
201 unsigned config_id; /* configuration structure identifier */
202 /****** hardware configuration ******/
203 unsigned ioport; /* adapter I/O port base */
204 unsigned long maddr; /* dual-port memory address */
205 unsigned msize; /* dual-port memory size */
206 int irq; /* interrupt request level */
207 int dma; /* DMA request level */
208 char S514_CPU_no[1]; /* S514 PCI adapter CPU number ('A' or 'B') */
209 unsigned PCI_slot_no; /* S514 PCI adapter slot number */
210 char auto_pci_cfg; /* S515 PCI automatic slot detection */
211 char comm_port; /* Communication Port (PRI=0, SEC=1) */
212 unsigned bps; /* data transfer rate */
213 unsigned mtu; /* maximum transmit unit size */
214 unsigned udp_port; /* UDP port for management */
215 unsigned char ttl; /* Time To Live for UDP security */
216 unsigned char ft1; /* FT1 Configurator Option */
217 char interface; /* RS-232/V.35, etc. */
218 char clocking; /* external/internal */
219 char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */
220 char station; /* DTE/DCE, primary/secondary, etc. */
221 char connection; /* permanent/switched/on-demand */
222 char read_mode; /* read mode: Polling or interrupt */
223 char receive_only; /* disable tx buffers */
224 char tty; /* Create a fake tty device */
225 unsigned tty_major; /* Major number for wanpipe tty device */
226 unsigned tty_minor; /* Minor number for wanpipe tty device */
227 unsigned tty_mode; /* TTY operation mode SYNC or ASYNC */
228 char backup; /* Backup Mode */
229 unsigned hw_opt[4]; /* other hardware options */
230 unsigned reserved[4];
231 /****** arbitrary data ***************/
232 unsigned data_size; /* data buffer size */
233 void* data; /* data buffer, e.g. firmware */
234 union /****** protocol-specific ************/
235 {
236 wan_x25_conf_t x25; /* X.25 configuration */
237 wan_ppp_conf_t ppp; /* PPP configuration */
238 wan_fr_conf_t fr; /* frame relay configuration */
239 wan_chdlc_conf_t chdlc; /* Cisco HDLC configuration */
240 } u;
241} wandev_conf_t;
242
243/* 'config_id' definitions */
244#define WANCONFIG_X25 101 /* X.25 link */
245#define WANCONFIG_FR 102 /* frame relay link */
246#define WANCONFIG_PPP 103 /* synchronous PPP link */
247#define WANCONFIG_CHDLC 104 /* Cisco HDLC Link */
248#define WANCONFIG_BSC 105 /* BiSync Streaming */
249#define WANCONFIG_HDLC 106 /* HDLC Support */
250#define WANCONFIG_MPPP 107 /* Multi Port PPP over RAW CHDLC */
251
252/* 1/*
253 * Configuration options defines. 2 * wanrouter.h Legacy declarations kept around until X25 is removed
254 */ 3 */
255/* general options */
256#define WANOPT_OFF 0
257#define WANOPT_ON 1
258#define WANOPT_NO 0
259#define WANOPT_YES 1
260
261/* intercace options */
262#define WANOPT_RS232 0
263#define WANOPT_V35 1
264
265/* data encoding options */
266#define WANOPT_NRZ 0
267#define WANOPT_NRZI 1
268#define WANOPT_FM0 2
269#define WANOPT_FM1 3
270
271/* link type options */
272#define WANOPT_POINTTOPOINT 0 /* RTS always active */
273#define WANOPT_MULTIDROP 1 /* RTS is active when transmitting */
274
275/* clocking options */
276#define WANOPT_EXTERNAL 0
277#define WANOPT_INTERNAL 1
278
279/* station options */
280#define WANOPT_DTE 0
281#define WANOPT_DCE 1
282#define WANOPT_CPE 0
283#define WANOPT_NODE 1
284#define WANOPT_SECONDARY 0
285#define WANOPT_PRIMARY 1
286
287/* connection options */
288#define WANOPT_PERMANENT 0 /* DTR always active */
289#define WANOPT_SWITCHED 1 /* use DTR to setup link (dial-up) */
290#define WANOPT_ONDEMAND 2 /* activate DTR only before sending */
291
292/* frame relay in-channel signalling */
293#define WANOPT_FR_ANSI 1 /* ANSI T1.617 Annex D */
294#define WANOPT_FR_Q933 2 /* ITU Q.933A */
295#define WANOPT_FR_LMI 3 /* LMI */
296
297/* PPP IP Mode Options */
298#define WANOPT_PPP_STATIC 0
299#define WANOPT_PPP_HOST 1
300#define WANOPT_PPP_PEER 2
301
302/* ASY Mode Options */
303#define WANOPT_ONE 1
304#define WANOPT_TWO 2
305#define WANOPT_ONE_AND_HALF 3
306
307#define WANOPT_NONE 0
308#define WANOPT_ODD 1
309#define WANOPT_EVEN 2
310
311/* CHDLC Protocol Options */
312/* DF Commented out for now.
313
314#define WANOPT_CHDLC_NO_DCD IGNORE_DCD_FOR_LINK_STAT
315#define WANOPT_CHDLC_NO_CTS IGNORE_CTS_FOR_LINK_STAT
316#define WANOPT_CHDLC_NO_KEEPALIVE IGNORE_KPALV_FOR_LINK_STAT
317*/
318
319/* Port options */
320#define WANOPT_PRI 0
321#define WANOPT_SEC 1
322/* read mode */
323#define WANOPT_INTR 0
324#define WANOPT_POLL 1
325 4
326 5#ifndef _UAPI_ROUTER_H
327#define WANOPT_TTY_SYNC 0 6#define _UAPI_ROUTER_H
328#define WANOPT_TTY_ASYNC 1
329/*----------------------------------------------------------------------------
330 * WAN Link Status Info (for ROUTER_STAT IOCTL).
331 */
332typedef struct wandev_stat
333{
334 unsigned state; /* link state */
335 unsigned ndev; /* number of configured interfaces */
336
337 /* link/interface configuration */
338 unsigned connection; /* permanent/switched/on-demand */
339 unsigned media_type; /* Frame relay/PPP/X.25/SDLC, etc. */
340 unsigned mtu; /* max. transmit unit for this device */
341
342 /* physical level statistics */
343 unsigned modem_status; /* modem status */
344 unsigned rx_frames; /* received frames count */
345 unsigned rx_overruns; /* receiver overrun error count */
346 unsigned rx_crc_err; /* receive CRC error count */
347 unsigned rx_aborts; /* received aborted frames count */
348 unsigned rx_bad_length; /* unexpetedly long/short frames count */
349 unsigned rx_dropped; /* frames discarded at device level */
350 unsigned tx_frames; /* transmitted frames count */
351 unsigned tx_underruns; /* aborted transmissions (underruns) count */
352 unsigned tx_timeouts; /* transmission timeouts */
353 unsigned tx_rejects; /* other transmit errors */
354
355 /* media level statistics */
356 unsigned rx_bad_format; /* frames with invalid format */
357 unsigned rx_bad_addr; /* frames with invalid media address */
358 unsigned tx_retries; /* frames re-transmitted */
359 unsigned reserved[16]; /* reserved for future use */
360} wandev_stat_t;
361 7
362/* 'state' defines */ 8/* 'state' defines */
363enum wan_states 9enum wan_states
@@ -365,88 +11,7 @@ enum wan_states
365 WAN_UNCONFIGURED, /* link/channel is not configured */ 11 WAN_UNCONFIGURED, /* link/channel is not configured */
366 WAN_DISCONNECTED, /* link/channel is disconnected */ 12 WAN_DISCONNECTED, /* link/channel is disconnected */
367 WAN_CONNECTING, /* connection is in progress */ 13 WAN_CONNECTING, /* connection is in progress */
368 WAN_CONNECTED, /* link/channel is operational */ 14 WAN_CONNECTED /* link/channel is operational */
369 WAN_LIMIT, /* for verification only */
370 WAN_DUALPORT, /* for Dual Port cards */
371 WAN_DISCONNECTING,
372 WAN_FT1_READY /* FT1 Configurator Ready */
373}; 15};
374 16
375enum {
376 WAN_LOCAL_IP,
377 WAN_POINTOPOINT_IP,
378 WAN_NETMASK_IP,
379 WAN_BROADCAST_IP
380};
381
382/* 'modem_status' masks */
383#define WAN_MODEM_CTS 0x0001 /* CTS line active */
384#define WAN_MODEM_DCD 0x0002 /* DCD line active */
385#define WAN_MODEM_DTR 0x0010 /* DTR line active */
386#define WAN_MODEM_RTS 0x0020 /* RTS line active */
387
388/*----------------------------------------------------------------------------
389 * WAN interface (logical channel) configuration (for ROUTER_IFNEW IOCTL).
390 */
391typedef struct wanif_conf
392{
393 unsigned magic; /* magic number */
394 unsigned config_id; /* configuration identifier */
395 char name[WAN_IFNAME_SZ+1]; /* interface name, ASCIIZ */
396 char addr[WAN_ADDRESS_SZ+1]; /* media address, ASCIIZ */
397 char usedby[USED_BY_FIELD]; /* used by API or WANPIPE */
398 unsigned idle_timeout; /* sec, before disconnecting */
399 unsigned hold_timeout; /* sec, before re-connecting */
400 unsigned cir; /* Committed Information Rate fwd,bwd*/
401 unsigned bc; /* Committed Burst Size fwd, bwd */
402 unsigned be; /* Excess Burst Size fwd, bwd */
403 unsigned char enable_IPX; /* Enable or Disable IPX */
404 unsigned char inarp; /* Send Inverse ARP requests Y/N */
405 unsigned inarp_interval; /* sec, between InARP requests */
406 unsigned long network_number; /* Network Number for IPX */
407 char mc; /* Multicast on or off */
408 char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */
409 unsigned char port; /* board port */
410 unsigned char protocol; /* prococol used in this channel (TCPOX25 or X25) */
411 char pap; /* PAP enabled or disabled */
412 char chap; /* CHAP enabled or disabled */
413 unsigned char userid[511]; /* List of User Id */
414 unsigned char passwd[511]; /* List of passwords */
415 unsigned char sysname[31]; /* Name of the system */
416 unsigned char ignore_dcd; /* Protocol options: */
417 unsigned char ignore_cts; /* Ignore these to determine */
418 unsigned char ignore_keepalive; /* link status (Yes or No) */
419 unsigned char hdlc_streaming; /* Hdlc streaming mode (Y/N) */
420 unsigned keepalive_tx_tmr; /* transmit keepalive timer */
421 unsigned keepalive_rx_tmr; /* receive keepalive timer */
422 unsigned keepalive_err_margin; /* keepalive_error_tolerance */
423 unsigned slarp_timer; /* SLARP request timer */
424 unsigned char ttl; /* Time To Live for UDP security */
425 char interface; /* RS-232/V.35, etc. */
426 char clocking; /* external/internal */
427 unsigned bps; /* data transfer rate */
428 unsigned mtu; /* maximum transmit unit size */
429 unsigned char if_down; /* brind down interface when disconnected */
430 unsigned char gateway; /* Is this interface a gateway */
431 unsigned char true_if_encoding; /* Set the dev->type to true board protocol */
432
433 unsigned char asy_data_trans; /* async API options */
434 unsigned char rts_hs_for_receive; /* async Protocol options */
435 unsigned char xon_xoff_hs_for_receive;
436 unsigned char xon_xoff_hs_for_transmit;
437 unsigned char dcd_hs_for_transmit;
438 unsigned char cts_hs_for_transmit;
439 unsigned char async_mode;
440 unsigned tx_bits_per_char;
441 unsigned rx_bits_per_char;
442 unsigned stop_bits;
443 unsigned char parity;
444 unsigned break_timer;
445 unsigned inter_char_timer;
446 unsigned rx_complete_length;
447 unsigned xon_char;
448 unsigned xoff_char;
449 unsigned char receive_only; /* no transmit buffering (Y/N) */
450} wanif_conf_t;
451
452#endif /* _UAPI_ROUTER_H */ 17#endif /* _UAPI_ROUTER_H */