aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 00:04:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 00:04:47 -0400
commit3b59bf081622b6446db77ad06c93fe23677bc533 (patch)
tree3f4bb5a27c90cc86994a1f6d3c53fbf9208003cb /include
parente45836fafe157df137a837093037f741ad8f4c90 (diff)
parentbbdb32cb5b73597386913d052165423b9d736145 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking merge from David Miller: "1) Move ixgbe driver over to purely page based buffering on receive. From Alexander Duyck. 2) Add receive packet steering support to e1000e, from Bruce Allan. 3) Convert TCP MD5 support over to RCU, from Eric Dumazet. 4) Reduce cpu usage in handling out-of-order TCP packets on modern systems, also from Eric Dumazet. 5) Support the IP{,V6}_UNICAST_IF socket options, making the wine folks happy, from Erich Hoover. 6) Support VLAN trunking from guests in hyperv driver, from Haiyang Zhang. 7) Support byte-queue-limtis in r8169, from Igor Maravic. 8) Outline code intended for IP_RECVTOS in IP_PKTOPTIONS existed but was never properly implemented, Jiri Benc fixed that. 9) 64-bit statistics support in r8169 and 8139too, from Junchang Wang. 10) Support kernel side dump filtering by ctmark in netfilter ctnetlink, from Pablo Neira Ayuso. 11) Support byte-queue-limits in gianfar driver, from Paul Gortmaker. 12) Add new peek socket options to assist with socket migration, from Pavel Emelyanov. 13) Add sch_plug packet scheduler whose queue is controlled by userland daemons using explicit freeze and release commands. From Shriram Rajagopalan. 14) Fix FCOE checksum offload handling on transmit, from Yi Zou." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1846 commits) Fix pppol2tp getsockname() Remove printk from rds_sendmsg ipv6: fix incorrent ipv6 ipsec packet fragment cpsw: Hook up default ndo_change_mtu. net: qmi_wwan: fix build error due to cdc-wdm dependecy netdev: driver: ethernet: Add TI CPSW driver netdev: driver: ethernet: add cpsw address lookup engine support phy: add am79c874 PHY support mlx4_core: fix race on comm channel bonding: send igmp report for its master fs_enet: Add MPC5125 FEC support and PHY interface selection net: bpf_jit: fix BPF_S_LDX_B_MSH compilation net: update the usage of CHECKSUM_UNNECESSARY fcoe: use CHECKSUM_UNNECESSARY instead of CHECKSUM_PARTIAL on tx net: do not do gso for CHECKSUM_UNNECESSARY in netif_needs_gso ixgbe: Fix issues with SR-IOV loopback when flow control is disabled net/hyperv: Fix the code handling tx busy ixgbe: fix namespace issues when FCoE/DCB is not enabled rtlwifi: Remove unused ETH_ADDR_LEN defines igbvf: Use ETH_ALEN ... Fix up fairly trivial conflicts in drivers/isdn/gigaset/interface.c and drivers/net/usb/{Kconfig,qmi_wwan.c} as per David.
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/socket.h5
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/bcma/bcma.h9
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h26
-rw-r--r--include/linux/bcma/bcma_driver_pci.h125
-rw-r--r--include/linux/bcma/bcma_regs.h27
-rw-r--r--include/linux/can/dev.h2
-rw-r--r--include/linux/dccp.h8
-rw-r--r--include/linux/etherdevice.h13
-rw-r--r--include/linux/ethtool.h23
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_ppp.h174
-rw-r--r--include/linux/if_vlan.h7
-rw-r--r--include/linux/in.h1
-rw-r--r--include/linux/in6.h1
-rw-r--r--include/linux/inetdevice.h1
-rw-r--r--include/linux/ipv6.h8
-rw-r--r--include/linux/isdn.h2
-rw-r--r--include/linux/mdio.h10
-rw-r--r--include/linux/mlx4/device.h5
-rw-r--r--include/linux/mlx4/qp.h5
-rw-r--r--include/linux/net.h1
-rw-r--r--include/linux/netdev_features.h4
-rw-r--r--include/linux/netdevice.h117
-rw-r--r--include/linux/netfilter/Kbuild2
-rw-r--r--include/linux/netfilter/ipset/ip_set.h35
-rw-r--r--include/linux/netfilter/ipset/ip_set_ahash.h119
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h5
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h12
-rw-r--r--include/linux/netfilter/nfnetlink_cttimeout.h114
-rw-r--r--include/linux/netfilter/xt_CT.h12
-rw-r--r--include/linux/netfilter/xt_LOG.h19
-rw-r--r--include/linux/netfilter_ipv4/Kbuild2
-rw-r--r--include/linux/netfilter_ipv4/ipt_LOG.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_SAME.h20
-rw-r--r--include/linux/netfilter_ipv4/ipt_realm.h7
-rw-r--r--include/linux/netfilter_ipv6/ip6t_LOG.h2
-rw-r--r--include/linux/netlink.h30
-rw-r--r--include/linux/nfc.h8
-rw-r--r--include/linux/nl80211.h72
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/pkt_sched.h21
-rw-r--r--include/linux/platform_data/cpsw.h55
-rw-r--r--include/linux/ppp-comp.h38
-rw-r--r--include/linux/ppp-ioctl.h119
-rw-r--r--include/linux/ppp_defs.h38
-rw-r--r--include/linux/sh_eth.h1
-rw-r--r--include/linux/skbuff.h46
-rw-r--r--include/linux/snmp.h2
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/ssb/ssb.h108
-rw-r--r--include/linux/ssb/ssb_regs.h34
-rw-r--r--include/linux/tcp.h5
-rw-r--r--include/net/addrconf.h1
-rw-r--r--include/net/arp.h4
-rw-r--r--include/net/bluetooth/bluetooth.h40
-rw-r--r--include/net/bluetooth/hci.h76
-rw-r--r--include/net/bluetooth/hci_core.h301
-rw-r--r--include/net/bluetooth/hci_mon.h51
-rw-r--r--include/net/bluetooth/l2cap.h87
-rw-r--r--include/net/bluetooth/mgmt.h338
-rw-r--r--include/net/bluetooth/smp.h2
-rw-r--r--include/net/caif/caif_hsi.h1
-rw-r--r--include/net/cfg80211.h179
-rw-r--r--include/net/compat.h2
-rw-r--r--include/net/dcbnl.h4
-rw-r--r--include/net/dn.h1
-rw-r--r--include/net/genetlink.h31
-rw-r--r--include/net/inet_sock.h3
-rw-r--r--include/net/ip.h2
-rw-r--r--include/net/iucv/af_iucv.h3
-rw-r--r--include/net/mac80211.h154
-rw-r--r--include/net/ndisc.h1
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h4
-rw-r--r--include/net/netfilter/nf_conntrack_helper.h13
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h19
-rw-r--r--include/net/netfilter/nf_conntrack_timeout.h78
-rw-r--r--include/net/netfilter/xt_log.h2
-rw-r--r--include/net/netlink.h35
-rw-r--r--include/net/nfc/nci.h53
-rw-r--r--include/net/nfc/nci_core.h36
-rw-r--r--include/net/nfc/nfc.h39
-rw-r--r--include/net/sctp/sctp.h1
-rw-r--r--include/net/sock.h29
-rw-r--r--include/net/tcp.h66
-rw-r--r--include/net/udplite.h4
-rw-r--r--include/net/xfrm.h5
88 files changed, 2151 insertions, 1028 deletions
diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h
index 49c1704173e7..b1bea03274d5 100644
--- a/include/asm-generic/socket.h
+++ b/include/asm-generic/socket.h
@@ -67,4 +67,9 @@
67 67
68#define SO_WIFI_STATUS 41 68#define SO_WIFI_STATUS 41
69#define SCM_WIFI_STATUS SO_WIFI_STATUS 69#define SCM_WIFI_STATUS SO_WIFI_STATUS
70#define SO_PEEK_OFF 42
71
72/* Instruct lower device to use last 4-bytes of skb data as FCS */
73#define SO_NOFCS 43
74
70#endif /* __ASM_GENERIC_SOCKET_H */ 75#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index c94e71781b79..a25555381097 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -238,6 +238,7 @@ header-y += magic.h
238header-y += major.h 238header-y += major.h
239header-y += map_to_7segment.h 239header-y += map_to_7segment.h
240header-y += matroxfb.h 240header-y += matroxfb.h
241header-y += mdio.h
241header-y += media.h 242header-y += media.h
242header-y += mempolicy.h 243header-y += mempolicy.h
243header-y += meye.h 244header-y += meye.h
@@ -304,6 +305,7 @@ header-y += poll.h
304header-y += posix_types.h 305header-y += posix_types.h
305header-y += ppdev.h 306header-y += ppdev.h
306header-y += ppp-comp.h 307header-y += ppp-comp.h
308header-y += ppp-ioctl.h
307header-y += ppp_defs.h 309header-y += ppp_defs.h
308header-y += pps.h 310header-y += pps.h
309header-y += prctl.h 311header-y += prctl.h
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 83c209f39493..5af9a075498f 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -136,6 +136,7 @@ struct bcma_device {
136 bool dev_registered; 136 bool dev_registered;
137 137
138 u8 core_index; 138 u8 core_index;
139 u8 core_unit;
139 140
140 u32 addr; 141 u32 addr;
141 u32 wrap; 142 u32 wrap;
@@ -175,6 +176,12 @@ int __bcma_driver_register(struct bcma_driver *drv, struct module *owner);
175 176
176extern void bcma_driver_unregister(struct bcma_driver *drv); 177extern void bcma_driver_unregister(struct bcma_driver *drv);
177 178
179/* Set a fallback SPROM.
180 * See kdoc at the function definition for complete documentation. */
181extern int bcma_arch_register_fallback_sprom(
182 int (*sprom_callback)(struct bcma_bus *bus,
183 struct ssb_sprom *out));
184
178struct bcma_bus { 185struct bcma_bus {
179 /* The MMIO area. */ 186 /* The MMIO area. */
180 void __iomem *mmio; 187 void __iomem *mmio;
@@ -195,6 +202,7 @@ struct bcma_bus {
195 struct list_head cores; 202 struct list_head cores;
196 u8 nr_cores; 203 u8 nr_cores;
197 u8 init_done:1; 204 u8 init_done:1;
205 u8 num;
198 206
199 struct bcma_drv_cc drv_cc; 207 struct bcma_drv_cc drv_cc;
200 struct bcma_drv_pci drv_pci; 208 struct bcma_drv_pci drv_pci;
@@ -282,6 +290,7 @@ static inline void bcma_maskset16(struct bcma_device *cc,
282 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set); 290 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set);
283} 291}
284 292
293extern struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid);
285extern bool bcma_core_is_enabled(struct bcma_device *core); 294extern bool bcma_core_is_enabled(struct bcma_device *core);
286extern void bcma_core_disable(struct bcma_device *core, u32 flags); 295extern void bcma_core_disable(struct bcma_device *core, u32 flags);
287extern int bcma_core_enable(struct bcma_device *core, u32 flags); 296extern int bcma_core_enable(struct bcma_device *core, u32 flags);
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index a33086a7530b..8bbfe31fbac8 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -56,6 +56,9 @@
56#define BCMA_CC_OTPS_HW_PROTECT 0x00000001 56#define BCMA_CC_OTPS_HW_PROTECT 0x00000001
57#define BCMA_CC_OTPS_SW_PROTECT 0x00000002 57#define BCMA_CC_OTPS_SW_PROTECT 0x00000002
58#define BCMA_CC_OTPS_CID_PROTECT 0x00000004 58#define BCMA_CC_OTPS_CID_PROTECT 0x00000004
59#define BCMA_CC_OTPS_GU_PROG_IND 0x00000F00 /* General Use programmed indication */
60#define BCMA_CC_OTPS_GU_PROG_IND_SHIFT 8
61#define BCMA_CC_OTPS_GU_PROG_HW 0x00000100 /* HW region programmed */
59#define BCMA_CC_OTPC 0x0014 /* OTP control */ 62#define BCMA_CC_OTPC 0x0014 /* OTP control */
60#define BCMA_CC_OTPC_RECWAIT 0xFF000000 63#define BCMA_CC_OTPC_RECWAIT 0xFF000000
61#define BCMA_CC_OTPC_PROGWAIT 0x00FFFF00 64#define BCMA_CC_OTPC_PROGWAIT 0x00FFFF00
@@ -72,6 +75,8 @@
72#define BCMA_CC_OTPP_READ 0x40000000 75#define BCMA_CC_OTPP_READ 0x40000000
73#define BCMA_CC_OTPP_START 0x80000000 76#define BCMA_CC_OTPP_START 0x80000000
74#define BCMA_CC_OTPP_BUSY 0x80000000 77#define BCMA_CC_OTPP_BUSY 0x80000000
78#define BCMA_CC_OTPL 0x001C /* OTP layout */
79#define BCMA_CC_OTPL_GURGN_OFFSET 0x00000FFF /* offset of general use region */
75#define BCMA_CC_IRQSTAT 0x0020 80#define BCMA_CC_IRQSTAT 0x0020
76#define BCMA_CC_IRQMASK 0x0024 81#define BCMA_CC_IRQMASK 0x0024
77#define BCMA_CC_IRQ_GPIO 0x00000001 /* gpio intr */ 82#define BCMA_CC_IRQ_GPIO 0x00000001 /* gpio intr */
@@ -79,6 +84,10 @@
79#define BCMA_CC_IRQ_WDRESET 0x80000000 /* watchdog reset occurred */ 84#define BCMA_CC_IRQ_WDRESET 0x80000000 /* watchdog reset occurred */
80#define BCMA_CC_CHIPCTL 0x0028 /* Rev >= 11 only */ 85#define BCMA_CC_CHIPCTL 0x0028 /* Rev >= 11 only */
81#define BCMA_CC_CHIPSTAT 0x002C /* Rev >= 11 only */ 86#define BCMA_CC_CHIPSTAT 0x002C /* Rev >= 11 only */
87#define BCMA_CC_CHIPST_4313_SPROM_PRESENT 1
88#define BCMA_CC_CHIPST_4313_OTP_PRESENT 2
89#define BCMA_CC_CHIPST_4331_SPROM_PRESENT 2
90#define BCMA_CC_CHIPST_4331_OTP_PRESENT 4
82#define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ 91#define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */
83#define BCMA_CC_JCMD_START 0x80000000 92#define BCMA_CC_JCMD_START 0x80000000
84#define BCMA_CC_JCMD_BUSY 0x80000000 93#define BCMA_CC_JCMD_BUSY 0x80000000
@@ -181,6 +190,22 @@
181#define BCMA_CC_FLASH_CFG 0x0128 190#define BCMA_CC_FLASH_CFG 0x0128
182#define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */ 191#define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */
183#define BCMA_CC_FLASH_WAITCNT 0x012C 192#define BCMA_CC_FLASH_WAITCNT 0x012C
193#define BCMA_CC_SROM_CONTROL 0x0190
194#define BCMA_CC_SROM_CONTROL_START 0x80000000
195#define BCMA_CC_SROM_CONTROL_BUSY 0x80000000
196#define BCMA_CC_SROM_CONTROL_OPCODE 0x60000000
197#define BCMA_CC_SROM_CONTROL_OP_READ 0x00000000
198#define BCMA_CC_SROM_CONTROL_OP_WRITE 0x20000000
199#define BCMA_CC_SROM_CONTROL_OP_WRDIS 0x40000000
200#define BCMA_CC_SROM_CONTROL_OP_WREN 0x60000000
201#define BCMA_CC_SROM_CONTROL_OTPSEL 0x00000010
202#define BCMA_CC_SROM_CONTROL_LOCK 0x00000008
203#define BCMA_CC_SROM_CONTROL_SIZE_MASK 0x00000006
204#define BCMA_CC_SROM_CONTROL_SIZE_1K 0x00000000
205#define BCMA_CC_SROM_CONTROL_SIZE_4K 0x00000002
206#define BCMA_CC_SROM_CONTROL_SIZE_16K 0x00000004
207#define BCMA_CC_SROM_CONTROL_SIZE_SHIFT 1
208#define BCMA_CC_SROM_CONTROL_PRESENT 0x00000001
184/* 0x1E0 is defined as shared BCMA_CLKCTLST */ 209/* 0x1E0 is defined as shared BCMA_CLKCTLST */
185#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ 210#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */
186#define BCMA_CC_UART0_DATA 0x0300 211#define BCMA_CC_UART0_DATA 0x0300
@@ -240,7 +265,6 @@
240#define BCMA_CC_PLLCTL_ADDR 0x0660 265#define BCMA_CC_PLLCTL_ADDR 0x0660
241#define BCMA_CC_PLLCTL_DATA 0x0664 266#define BCMA_CC_PLLCTL_DATA 0x0664
242#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ 267#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */
243#define BCMA_CC_SPROM_PCIE6 0x0830 /* SPROM beginning on PCIe rev >= 6 */
244 268
245/* Divider allocation in 4716/47162/5356 */ 269/* Divider allocation in 4716/47162/5356 */
246#define BCMA_CC_PMU5_MAINPLL_CPU 1 270#define BCMA_CC_PMU5_MAINPLL_CPU 1
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 3871b668caf9..46c71e27d31f 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -53,6 +53,35 @@ struct pci_dev;
53#define BCMA_CORE_PCI_SBTOPCI1_MASK 0xFC000000 53#define BCMA_CORE_PCI_SBTOPCI1_MASK 0xFC000000
54#define BCMA_CORE_PCI_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */ 54#define BCMA_CORE_PCI_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */
55#define BCMA_CORE_PCI_SBTOPCI2_MASK 0xC0000000 55#define BCMA_CORE_PCI_SBTOPCI2_MASK 0xC0000000
56#define BCMA_CORE_PCI_CONFIG_ADDR 0x0120 /* pcie config space access */
57#define BCMA_CORE_PCI_CONFIG_DATA 0x0124 /* pcie config space access */
58#define BCMA_CORE_PCI_MDIO_CONTROL 0x0128 /* controls the mdio access */
59#define BCMA_CORE_PCI_MDIOCTL_DIVISOR_MASK 0x7f /* clock to be used on MDIO */
60#define BCMA_CORE_PCI_MDIOCTL_DIVISOR_VAL 0x2
61#define BCMA_CORE_PCI_MDIOCTL_PREAM_EN 0x80 /* Enable preamble sequnce */
62#define BCMA_CORE_PCI_MDIOCTL_ACCESS_DONE 0x100 /* Tranaction complete */
63#define BCMA_CORE_PCI_MDIO_DATA 0x012c /* Data to the mdio access */
64#define BCMA_CORE_PCI_MDIODATA_MASK 0x0000ffff /* data 2 bytes */
65#define BCMA_CORE_PCI_MDIODATA_TA 0x00020000 /* Turnaround */
66#define BCMA_CORE_PCI_MDIODATA_REGADDR_SHF_OLD 18 /* Regaddr shift (rev < 10) */
67#define BCMA_CORE_PCI_MDIODATA_REGADDR_MASK_OLD 0x003c0000 /* Regaddr Mask (rev < 10) */
68#define BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF_OLD 22 /* Physmedia devaddr shift (rev < 10) */
69#define BCMA_CORE_PCI_MDIODATA_DEVADDR_MASK_OLD 0x0fc00000 /* Physmedia devaddr Mask (rev < 10) */
70#define BCMA_CORE_PCI_MDIODATA_REGADDR_SHF 18 /* Regaddr shift */
71#define BCMA_CORE_PCI_MDIODATA_REGADDR_MASK 0x007c0000 /* Regaddr Mask */
72#define BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF 23 /* Physmedia devaddr shift */
73#define BCMA_CORE_PCI_MDIODATA_DEVADDR_MASK 0x0f800000 /* Physmedia devaddr Mask */
74#define BCMA_CORE_PCI_MDIODATA_WRITE 0x10000000 /* write Transaction */
75#define BCMA_CORE_PCI_MDIODATA_READ 0x20000000 /* Read Transaction */
76#define BCMA_CORE_PCI_MDIODATA_START 0x40000000 /* start of Transaction */
77#define BCMA_CORE_PCI_MDIODATA_DEV_ADDR 0x0 /* dev address for serdes */
78#define BCMA_CORE_PCI_MDIODATA_BLK_ADDR 0x1F /* blk address for serdes */
79#define BCMA_CORE_PCI_MDIODATA_DEV_PLL 0x1d /* SERDES PLL Dev */
80#define BCMA_CORE_PCI_MDIODATA_DEV_TX 0x1e /* SERDES TX Dev */
81#define BCMA_CORE_PCI_MDIODATA_DEV_RX 0x1f /* SERDES RX Dev */
82#define BCMA_CORE_PCI_PCIEIND_ADDR 0x0130 /* indirect access to the internal register */
83#define BCMA_CORE_PCI_PCIEIND_DATA 0x0134 /* Data to/from the internal regsiter */
84#define BCMA_CORE_PCI_CLKREQENCTRL 0x0138 /* >= rev 6, Clkreq rdma control */
56#define BCMA_CORE_PCI_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */ 85#define BCMA_CORE_PCI_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */
57#define BCMA_CORE_PCI_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */ 86#define BCMA_CORE_PCI_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */
58#define BCMA_CORE_PCI_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */ 87#define BCMA_CORE_PCI_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */
@@ -72,20 +101,114 @@ struct pci_dev;
72#define BCMA_CORE_PCI_SBTOPCI_RC_READL 0x00000010 /* Memory read line */ 101#define BCMA_CORE_PCI_SBTOPCI_RC_READL 0x00000010 /* Memory read line */
73#define BCMA_CORE_PCI_SBTOPCI_RC_READM 0x00000020 /* Memory read multiple */ 102#define BCMA_CORE_PCI_SBTOPCI_RC_READM 0x00000020 /* Memory read multiple */
74 103
104/* PCIE protocol PHY diagnostic registers */
105#define BCMA_CORE_PCI_PLP_MODEREG 0x200 /* Mode */
106#define BCMA_CORE_PCI_PLP_STATUSREG 0x204 /* Status */
107#define BCMA_CORE_PCI_PLP_POLARITYINV_STAT 0x10 /* Status reg PCIE_PLP_STATUSREG */
108#define BCMA_CORE_PCI_PLP_LTSSMCTRLREG 0x208 /* LTSSM control */
109#define BCMA_CORE_PCI_PLP_LTLINKNUMREG 0x20c /* Link Training Link number */
110#define BCMA_CORE_PCI_PLP_LTLANENUMREG 0x210 /* Link Training Lane number */
111#define BCMA_CORE_PCI_PLP_LTNFTSREG 0x214 /* Link Training N_FTS */
112#define BCMA_CORE_PCI_PLP_ATTNREG 0x218 /* Attention */
113#define BCMA_CORE_PCI_PLP_ATTNMASKREG 0x21C /* Attention Mask */
114#define BCMA_CORE_PCI_PLP_RXERRCTR 0x220 /* Rx Error */
115#define BCMA_CORE_PCI_PLP_RXFRMERRCTR 0x224 /* Rx Framing Error */
116#define BCMA_CORE_PCI_PLP_RXERRTHRESHREG 0x228 /* Rx Error threshold */
117#define BCMA_CORE_PCI_PLP_TESTCTRLREG 0x22C /* Test Control reg */
118#define BCMA_CORE_PCI_PLP_SERDESCTRLOVRDREG 0x230 /* SERDES Control Override */
119#define BCMA_CORE_PCI_PLP_TIMINGOVRDREG 0x234 /* Timing param override */
120#define BCMA_CORE_PCI_PLP_RXTXSMDIAGREG 0x238 /* RXTX State Machine Diag */
121#define BCMA_CORE_PCI_PLP_LTSSMDIAGREG 0x23C /* LTSSM State Machine Diag */
122
123/* PCIE protocol DLLP diagnostic registers */
124#define BCMA_CORE_PCI_DLLP_LCREG 0x100 /* Link Control */
125#define BCMA_CORE_PCI_DLLP_LSREG 0x104 /* Link Status */
126#define BCMA_CORE_PCI_DLLP_LAREG 0x108 /* Link Attention */
127#define BCMA_CORE_PCI_DLLP_LSREG_LINKUP (1 << 16)
128#define BCMA_CORE_PCI_DLLP_LAMASKREG 0x10C /* Link Attention Mask */
129#define BCMA_CORE_PCI_DLLP_NEXTTXSEQNUMREG 0x110 /* Next Tx Seq Num */
130#define BCMA_CORE_PCI_DLLP_ACKEDTXSEQNUMREG 0x114 /* Acked Tx Seq Num */
131#define BCMA_CORE_PCI_DLLP_PURGEDTXSEQNUMREG 0x118 /* Purged Tx Seq Num */
132#define BCMA_CORE_PCI_DLLP_RXSEQNUMREG 0x11C /* Rx Sequence Number */
133#define BCMA_CORE_PCI_DLLP_LRREG 0x120 /* Link Replay */
134#define BCMA_CORE_PCI_DLLP_LACKTOREG 0x124 /* Link Ack Timeout */
135#define BCMA_CORE_PCI_DLLP_PMTHRESHREG 0x128 /* Power Management Threshold */
136#define BCMA_CORE_PCI_DLLP_RTRYWPREG 0x12C /* Retry buffer write ptr */
137#define BCMA_CORE_PCI_DLLP_RTRYRPREG 0x130 /* Retry buffer Read ptr */
138#define BCMA_CORE_PCI_DLLP_RTRYPPREG 0x134 /* Retry buffer Purged ptr */
139#define BCMA_CORE_PCI_DLLP_RTRRWREG 0x138 /* Retry buffer Read/Write */
140#define BCMA_CORE_PCI_DLLP_ECTHRESHREG 0x13C /* Error Count Threshold */
141#define BCMA_CORE_PCI_DLLP_TLPERRCTRREG 0x140 /* TLP Error Counter */
142#define BCMA_CORE_PCI_DLLP_ERRCTRREG 0x144 /* Error Counter */
143#define BCMA_CORE_PCI_DLLP_NAKRXCTRREG 0x148 /* NAK Received Counter */
144#define BCMA_CORE_PCI_DLLP_TESTREG 0x14C /* Test */
145#define BCMA_CORE_PCI_DLLP_PKTBIST 0x150 /* Packet BIST */
146#define BCMA_CORE_PCI_DLLP_PCIE11 0x154 /* DLLP PCIE 1.1 reg */
147
148/* SERDES RX registers */
149#define BCMA_CORE_PCI_SERDES_RX_CTRL 1 /* Rx cntrl */
150#define BCMA_CORE_PCI_SERDES_RX_CTRL_FORCE 0x80 /* rxpolarity_force */
151#define BCMA_CORE_PCI_SERDES_RX_CTRL_POLARITY 0x40 /* rxpolarity_value */
152#define BCMA_CORE_PCI_SERDES_RX_TIMER1 2 /* Rx Timer1 */
153#define BCMA_CORE_PCI_SERDES_RX_CDR 6 /* CDR */
154#define BCMA_CORE_PCI_SERDES_RX_CDRBW 7 /* CDR BW */
155
156/* SERDES PLL registers */
157#define BCMA_CORE_PCI_SERDES_PLL_CTRL 1 /* PLL control reg */
158#define BCMA_CORE_PCI_PLL_CTRL_FREQDET_EN 0x4000 /* bit 14 is FREQDET on */
159
75/* PCIcore specific boardflags */ 160/* PCIcore specific boardflags */
76#define BCMA_CORE_PCI_BFL_NOPCI 0x00000400 /* Board leaves PCI floating */ 161#define BCMA_CORE_PCI_BFL_NOPCI 0x00000400 /* Board leaves PCI floating */
77 162
163/* PCIE Config space accessing MACROS */
164#define BCMA_CORE_PCI_CFG_BUS_SHIFT 24 /* Bus shift */
165#define BCMA_CORE_PCI_CFG_SLOT_SHIFT 19 /* Slot/Device shift */
166#define BCMA_CORE_PCI_CFG_FUN_SHIFT 16 /* Function shift */
167#define BCMA_CORE_PCI_CFG_OFF_SHIFT 0 /* Register shift */
168
169#define BCMA_CORE_PCI_CFG_BUS_MASK 0xff /* Bus mask */
170#define BCMA_CORE_PCI_CFG_SLOT_MASK 0x1f /* Slot/Device mask */
171#define BCMA_CORE_PCI_CFG_FUN_MASK 7 /* Function mask */
172#define BCMA_CORE_PCI_CFG_OFF_MASK 0xfff /* Register mask */
173
174/* PCIE Root Capability Register bits (Host mode only) */
175#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
176
177struct bcma_drv_pci;
178
179#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
180struct bcma_drv_pci_host {
181 struct bcma_drv_pci *pdev;
182
183 u32 host_cfg_addr;
184 spinlock_t cfgspace_lock;
185
186 struct pci_controller pci_controller;
187 struct pci_ops pci_ops;
188 struct resource mem_resource;
189 struct resource io_resource;
190};
191#endif
192
78struct bcma_drv_pci { 193struct bcma_drv_pci {
79 struct bcma_device *core; 194 struct bcma_device *core;
80 u8 setup_done:1; 195 u8 setup_done:1;
196 u8 hostmode:1;
197
198#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
199 struct bcma_drv_pci_host *host_controller;
200#endif
81}; 201};
82 202
83/* Register access */ 203/* Register access */
84#define pcicore_read32(pc, offset) bcma_read32((pc)->core, offset) 204#define pcicore_read32(pc, offset) bcma_read32((pc)->core, offset)
85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) 205#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
86 206
87extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 207extern void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc);
88extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, 208extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
89 struct bcma_device *core, bool enable); 209 struct bcma_device *core, bool enable);
90 210
211extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
212extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
213
91#endif /* LINUX_BCMA_DRIVER_PCI_H_ */ 214#endif /* LINUX_BCMA_DRIVER_PCI_H_ */
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index 9faae2ae02e8..5a71d5719640 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -56,4 +56,31 @@
56#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ 56#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */
57#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ 57#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */
58 58
59/* SiliconBackplane Address Map.
60 * All regions may not exist on all chips.
61 */
62#define BCMA_SOC_SDRAM_BASE 0x00000000U /* Physical SDRAM */
63#define BCMA_SOC_PCI_MEM 0x08000000U /* Host Mode sb2pcitranslation0 (64 MB) */
64#define BCMA_SOC_PCI_MEM_SZ (64 * 1024 * 1024)
65#define BCMA_SOC_PCI_CFG 0x0c000000U /* Host Mode sb2pcitranslation1 (64 MB) */
66#define BCMA_SOC_SDRAM_SWAPPED 0x10000000U /* Byteswapped Physical SDRAM */
67#define BCMA_SOC_SDRAM_R2 0x80000000U /* Region 2 for sdram (512 MB) */
68
69
70#define BCMA_SOC_PCI_DMA 0x40000000U /* Client Mode sb2pcitranslation2 (1 GB) */
71#define BCMA_SOC_PCI_DMA2 0x80000000U /* Client Mode sb2pcitranslation2 (1 GB) */
72#define BCMA_SOC_PCI_DMA_SZ 0x40000000U /* Client Mode sb2pcitranslation2 size in bytes */
73#define BCMA_SOC_PCIE_DMA_L32 0x00000000U /* PCIE Client Mode sb2pcitranslation2
74 * (2 ZettaBytes), low 32 bits
75 */
76#define BCMA_SOC_PCIE_DMA_H32 0x80000000U /* PCIE Client Mode sb2pcitranslation2
77 * (2 ZettaBytes), high 32 bits
78 */
79
80#define BCMA_SOC_PCI1_MEM 0x40000000U /* Host Mode sb2pcitranslation0 (64 MB) */
81#define BCMA_SOC_PCI1_CFG 0x44000000U /* Host Mode sb2pcitranslation1 (64 MB) */
82#define BCMA_SOC_PCIE1_DMA_H32 0xc0000000U /* PCIE Client Mode sb2pcitranslation2
83 * (2 ZettaBytes), high 32 bits
84 */
85
59#endif /* LINUX_BCMA_REGS_H_ */ 86#endif /* LINUX_BCMA_REGS_H_ */
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index a0969fcb72b9..5d2efe7e3f1b 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -92,7 +92,7 @@ void can_bus_off(struct net_device *dev);
92 92
93void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, 93void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
94 unsigned int idx); 94 unsigned int idx);
95void can_get_echo_skb(struct net_device *dev, unsigned int idx); 95unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);
96void can_free_echo_skb(struct net_device *dev, unsigned int idx); 96void can_free_echo_skb(struct net_device *dev, unsigned int idx);
97 97
98struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf); 98struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf);
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 710c04302a15..eaf95a023af4 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -376,8 +376,10 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
376/** 376/**
377 * struct dccp_request_sock - represent DCCP-specific connection request 377 * struct dccp_request_sock - represent DCCP-specific connection request
378 * @dreq_inet_rsk: structure inherited from 378 * @dreq_inet_rsk: structure inherited from
379 * @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1) 379 * @dreq_iss: initial sequence number, sent on the first Response (RFC 4340, 7.1)
380 * @dreq_isr: initial sequence number received on the Request 380 * @dreq_gss: greatest sequence number sent (for retransmitted Responses)
381 * @dreq_isr: initial sequence number received in the first Request
382 * @dreq_gsr: greatest sequence number received (for retransmitted Request(s))
381 * @dreq_service: service code present on the Request (there is just one) 383 * @dreq_service: service code present on the Request (there is just one)
382 * @dreq_featneg: feature negotiation options for this connection 384 * @dreq_featneg: feature negotiation options for this connection
383 * The following two fields are analogous to the ones in dccp_sock: 385 * The following two fields are analogous to the ones in dccp_sock:
@@ -387,7 +389,9 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
387struct dccp_request_sock { 389struct dccp_request_sock {
388 struct inet_request_sock dreq_inet_rsk; 390 struct inet_request_sock dreq_inet_rsk;
389 __u64 dreq_iss; 391 __u64 dreq_iss;
392 __u64 dreq_gss;
390 __u64 dreq_isr; 393 __u64 dreq_isr;
394 __u64 dreq_gsr;
391 __be32 dreq_service; 395 __be32 dreq_service;
392 struct list_head dreq_featneg; 396 struct list_head dreq_featneg;
393 __u32 dreq_timestamp_echo; 397 __u32 dreq_timestamp_echo;
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 05955cf09937..8a1835855faa 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -140,17 +140,18 @@ static inline void random_ether_addr(u8 *addr)
140} 140}
141 141
142/** 142/**
143 * dev_hw_addr_random - Create random MAC and set device flag 143 * eth_hw_addr_random - Generate software assigned random Ethernet and
144 * set device flag
144 * @dev: pointer to net_device structure 145 * @dev: pointer to net_device structure
145 * @hwaddr: Pointer to a six-byte array containing the Ethernet address
146 * 146 *
147 * Generate random MAC to be used by a device and set addr_assign_type 147 * Generate a random Ethernet address (MAC) to be used by a net device
148 * so the state can be read by sysfs and be used by udev. 148 * and set addr_assign_type so the state can be read by sysfs and be
149 * used by userspace.
149 */ 150 */
150static inline void dev_hw_addr_random(struct net_device *dev, u8 *hwaddr) 151static inline void eth_hw_addr_random(struct net_device *dev)
151{ 152{
152 dev->addr_assign_type |= NET_ADDR_RANDOM; 153 dev->addr_assign_type |= NET_ADDR_RANDOM;
153 random_ether_addr(hwaddr); 154 random_ether_addr(dev->dev_addr);
154} 155}
155 156
156/** 157/**
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index da5b2de99ae4..e1d9e0ede309 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -30,10 +30,15 @@ struct ethtool_cmd {
30 * access it */ 30 * access it */
31 __u8 duplex; /* Duplex, half or full */ 31 __u8 duplex; /* Duplex, half or full */
32 __u8 port; /* Which connector port */ 32 __u8 port; /* Which connector port */
33 __u8 phy_address; 33 __u8 phy_address; /* MDIO PHY address (PRTAD for clause 45).
34 * May be read-only or read-write
35 * depending on the driver.
36 */
34 __u8 transceiver; /* Which transceiver to use */ 37 __u8 transceiver; /* Which transceiver to use */
35 __u8 autoneg; /* Enable or disable autonegotiation */ 38 __u8 autoneg; /* Enable or disable autonegotiation */
36 __u8 mdio_support; 39 __u8 mdio_support; /* MDIO protocols supported. Read-only.
40 * Not set by all drivers.
41 */
37 __u32 maxtxpkt; /* Tx pkts before generating tx int */ 42 __u32 maxtxpkt; /* Tx pkts before generating tx int */
38 __u32 maxrxpkt; /* Rx pkts before generating rx int */ 43 __u32 maxrxpkt; /* Rx pkts before generating rx int */
39 __u16 speed_hi; /* The forced speed (upper 44 __u16 speed_hi; /* The forced speed (upper
@@ -59,6 +64,20 @@ static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
59 return (ep->speed_hi << 16) | ep->speed; 64 return (ep->speed_hi << 16) | ep->speed;
60} 65}
61 66
67/* Device supports clause 22 register access to PHY or peripherals
68 * using the interface defined in <linux/mii.h>. This should not be
69 * set if there are known to be no such peripherals present or if
70 * the driver only emulates clause 22 registers for compatibility.
71 */
72#define ETH_MDIO_SUPPORTS_C22 1
73
74/* Device supports clause 45 register access to PHY or peripherals
75 * using the interface defined in <linux/mii.h> and <linux/mdio.h>.
76 * This should not be set if there are known to be no such peripherals
77 * present.
78 */
79#define ETH_MDIO_SUPPORTS_C45 2
80
62#define ETHTOOL_FWVERS_LEN 32 81#define ETHTOOL_FWVERS_LEN 32
63#define ETHTOOL_BUSINFO_LEN 32 82#define ETHTOOL_BUSINFO_LEN 32
64/* these strings are set to whatever the driver author decides... */ 83/* these strings are set to whatever the driver author decides... */
diff --git a/include/linux/if.h b/include/linux/if.h
index 06b6ef60c821..f995c663c493 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -80,6 +80,8 @@
80 * skbs on transmit */ 80 * skbs on transmit */
81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */ 81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
82#define IFF_TEAM_PORT 0x40000 /* device used as team port */ 82#define IFF_TEAM_PORT 0x40000 /* device used as team port */
83#define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */
84
83 85
84#define IF_GET_IFACE 0x0001 /* for querying only */ 86#define IF_GET_IFACE 0x0001 /* for querying only */
85#define IF_GET_PROTO 0x0002 87#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
index c9ad38322576..9048fabb7a4e 100644
--- a/include/linux/if_ppp.h
+++ b/include/linux/if_ppp.h
@@ -1,173 +1 @@
1/* #include <linux/ppp-ioctl.h>
2 * if_ppp.h - Point-to-Point Protocol definitions.
3 *
4 * Copyright (c) 1989 Carnegie Mellon University.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms are permitted
8 * provided that the above copyright notice and this paragraph are
9 * duplicated in all such forms and that any documentation,
10 * advertising materials, and other materials related to such
11 * distribution and use acknowledge that the software was developed
12 * by Carnegie Mellon University. The name of the
13 * University may not be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 *
19 */
20
21/*
22 * ==FILEVERSION 20050812==
23 *
24 * NOTE TO MAINTAINERS:
25 * If you modify this file at all, please set the above date.
26 * if_ppp.h is shipped with a PPP distribution as well as with the kernel;
27 * if everyone increases the FILEVERSION number above, then scripts
28 * can do the right thing when deciding whether to install a new if_ppp.h
29 * file. Don't change the format of that line otherwise, so the
30 * installation script can recognize it.
31 */
32
33#ifndef _IF_PPP_H_
34#define _IF_PPP_H_
35
36#include <linux/types.h>
37#include <linux/compiler.h>
38
39/*
40 * Packet sizes
41 */
42
43#define PPP_MTU 1500 /* Default MTU (size of Info field) */
44#define PPP_MAXMRU 65000 /* Largest MRU we allow */
45#define PROTO_IPX 0x002b /* protocol numbers */
46#define PROTO_DNA_RT 0x0027 /* DNA Routing */
47
48
49/*
50 * Bit definitions for flags.
51 */
52
53#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
54#define SC_COMP_AC 0x00000002 /* header compression (output) */
55#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
56#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
57#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
58#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
59#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
60#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
61#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
62#define SC_LOOP_TRAFFIC 0x00000200 /* send traffic to pppd */
63#define SC_MULTILINK 0x00000400 /* do multilink encapsulation */
64#define SC_MP_SHORTSEQ 0x00000800 /* use short MP sequence numbers */
65#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
66#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
67#define SC_MP_XSHORTSEQ 0x00004000 /* transmit short MP seq numbers */
68#define SC_DEBUG 0x00010000 /* enable debug messages */
69#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
70#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
71#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
72#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
73#define SC_SYNC 0x00200000 /* synchronous serial mode */
74#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
75#define SC_MASK 0x0f600fff /* bits that user can change */
76
77/* state bits */
78#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
79#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
80#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
81#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
82#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
83#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
84#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
85
86/*
87 * Ioctl definitions.
88 */
89
90struct npioctl {
91 int protocol; /* PPP protocol, e.g. PPP_IP */
92 enum NPmode mode;
93};
94
95/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
96struct ppp_option_data {
97 __u8 __user *ptr;
98 __u32 length;
99 int transmit;
100};
101
102struct ifpppstatsreq {
103 struct ifreq b;
104 struct ppp_stats stats; /* statistic information */
105};
106
107struct ifpppcstatsreq {
108 struct ifreq b;
109 struct ppp_comp_stats stats;
110};
111
112/* For PPPIOCGL2TPSTATS */
113struct pppol2tp_ioc_stats {
114 __u16 tunnel_id; /* redundant */
115 __u16 session_id; /* if zero, get tunnel stats */
116 __u32 using_ipsec:1; /* valid only for session_id == 0 */
117 __aligned_u64 tx_packets;
118 __aligned_u64 tx_bytes;
119 __aligned_u64 tx_errors;
120 __aligned_u64 rx_packets;
121 __aligned_u64 rx_bytes;
122 __aligned_u64 rx_seq_discards;
123 __aligned_u64 rx_oos_packets;
124 __aligned_u64 rx_errors;
125};
126
127#define ifr__name b.ifr_ifrn.ifrn_name
128#define stats_ptr b.ifr_ifru.ifru_data
129
130/*
131 * Ioctl definitions.
132 */
133
134#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
135#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
136#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
137#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
138#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
139#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
140#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
141#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
142#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
143#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
144#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
145#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
146#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
147#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
148#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
149#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
150#define PPPIOCSPASS _IOW('t', 71, struct sock_fprog) /* set pass filter */
151#define PPPIOCSACTIVE _IOW('t', 70, struct sock_fprog) /* set active filt */
152#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
153#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
154#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
155#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */
156#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */
157#define PPPIOCDETACH _IOW('t', 60, int) /* detach from ppp unit/chan */
158#define PPPIOCSMRRU _IOW('t', 59, int) /* set multilink MRU */
159#define PPPIOCCONNECT _IOW('t', 58, int) /* connect channel to unit */
160#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
161#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
162#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
163#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
164
165#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
166#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
167#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
168
169#if !defined(ifr_mtu)
170#define ifr_mtu ifr_ifru.ifru_metric
171#endif
172
173#endif /* _IF_PPP_H_ */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 13aff1e2183b..33a6e1951d4d 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -18,10 +18,9 @@
18#include <linux/etherdevice.h> 18#include <linux/etherdevice.h>
19#include <linux/rtnetlink.h> 19#include <linux/rtnetlink.h>
20 20
21#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) 21#define VLAN_HLEN 4 /* The additional bytes required by VLAN
22 * that VLAN requires. 22 * (in addition to the Ethernet header)
23 */ 23 */
24#define VLAN_ETH_ALEN 6 /* Octets in one ethernet addr */
25#define VLAN_ETH_HLEN 18 /* Total octets in header. */ 24#define VLAN_ETH_HLEN 18 /* Total octets in header. */
26#define VLAN_ETH_ZLEN 64 /* Min. octets in frame sans FCS */ 25#define VLAN_ETH_ZLEN 64 /* Min. octets in frame sans FCS */
27 26
@@ -177,7 +176,7 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci)
177 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); 176 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
178 177
179 /* Move the mac addresses to the beginning of the new header. */ 178 /* Move the mac addresses to the beginning of the new header. */
180 memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN); 179 memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN);
181 skb->mac_header -= VLAN_HLEN; 180 skb->mac_header -= VLAN_HLEN;
182 181
183 /* first, the ethernet type */ 182 /* first, the ethernet type */
diff --git a/include/linux/in.h b/include/linux/in.h
index 01129c0ea87c..e0337f11d92e 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -111,6 +111,7 @@ struct in_addr {
111#define MCAST_LEAVE_SOURCE_GROUP 47 111#define MCAST_LEAVE_SOURCE_GROUP 47
112#define MCAST_MSFILTER 48 112#define MCAST_MSFILTER 48
113#define IP_MULTICAST_ALL 49 113#define IP_MULTICAST_ALL 49
114#define IP_UNICAST_IF 50
114 115
115#define MCAST_EXCLUDE 0 116#define MCAST_EXCLUDE 0
116#define MCAST_INCLUDE 1 117#define MCAST_INCLUDE 1
diff --git a/include/linux/in6.h b/include/linux/in6.h
index 097a34b55560..5c83d9e3eb8f 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -271,6 +271,7 @@ struct in6_flowlabel_req {
271#define IPV6_ORIGDSTADDR 74 271#define IPV6_ORIGDSTADDR 74
272#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR 272#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
273#define IPV6_TRANSPARENT 75 273#define IPV6_TRANSPARENT 75
274#define IPV6_UNICAST_IF 76
274 275
275/* 276/*
276 * Multicast Routing: 277 * Multicast Routing:
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 5f8146695b7f..597f4a9f3240 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -139,6 +139,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
139 IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS))) 139 IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS)))
140 140
141#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER) 141#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER)
142#define IN_DEV_ARP_ACCEPT(in_dev) IN_DEV_ORCONF((in_dev), ARP_ACCEPT)
142#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE) 143#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE)
143#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) 144#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
144#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) 145#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 6318268dcaf5..8260ef779762 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -233,6 +233,11 @@ static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
233 return (struct ipv6hdr *)skb_transport_header(skb); 233 return (struct ipv6hdr *)skb_transport_header(skb);
234} 234}
235 235
236static inline __u8 ipv6_tclass(const struct ipv6hdr *iph)
237{
238 return (ntohl(*(__be32 *)iph) >> 20) & 0xff;
239}
240
236/* 241/*
237 This structure contains results of exthdrs parsing 242 This structure contains results of exthdrs parsing
238 as offsets from skb->nh. 243 as offsets from skb->nh.
@@ -324,6 +329,7 @@ struct ipv6_pinfo {
324 __unused_2:6; 329 __unused_2:6;
325 __s16 mcast_hops:9; 330 __s16 mcast_hops:9;
326#endif 331#endif
332 int ucast_oif;
327 int mcast_oif; 333 int mcast_oif;
328 334
329 /* pktoption flags */ 335 /* pktoption flags */
@@ -360,7 +366,7 @@ struct ipv6_pinfo {
360 dontfrag:1; 366 dontfrag:1;
361 __u8 min_hopcount; 367 __u8 min_hopcount;
362 __u8 tclass; 368 __u8 tclass;
363 __u8 padding; 369 __u8 rcv_tclass;
364 370
365 __u32 dst_cookie; 371 __u32 dst_cookie;
366 372
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 4ccf95d681b4..292f27a793d4 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -187,7 +187,7 @@ typedef struct {
187#endif 187#endif
188 188
189#include <linux/ppp_defs.h> 189#include <linux/ppp_defs.h>
190#include <linux/if_ppp.h> 190#include <linux/ppp-ioctl.h>
191 191
192#include <linux/isdn_ppp.h> 192#include <linux/isdn_ppp.h>
193#endif 193#endif
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index b1494aced217..dfb947959ec9 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -10,6 +10,7 @@
10#ifndef __LINUX_MDIO_H__ 10#ifndef __LINUX_MDIO_H__
11#define __LINUX_MDIO_H__ 11#define __LINUX_MDIO_H__
12 12
13#include <linux/types.h>
13#include <linux/mii.h> 14#include <linux/mii.h>
14 15
15/* MDIO Manageable Devices (MMDs). */ 16/* MDIO Manageable Devices (MMDs). */
@@ -273,6 +274,8 @@ static inline __u16 mdio_phy_id_c45(int prtad, int devad)
273 return MDIO_PHY_ID_C45 | (prtad << 5) | devad; 274 return MDIO_PHY_ID_C45 | (prtad << 5) | devad;
274} 275}
275 276
277#ifdef __KERNEL__
278
276static inline bool mdio_phy_id_is_c45(int phy_id) 279static inline bool mdio_phy_id_is_c45(int phy_id)
277{ 280{
278 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK); 281 return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK);
@@ -288,11 +291,6 @@ static inline __u16 mdio_phy_id_devad(int phy_id)
288 return phy_id & MDIO_PHY_ID_DEVAD; 291 return phy_id & MDIO_PHY_ID_DEVAD;
289} 292}
290 293
291#define MDIO_SUPPORTS_C22 1
292#define MDIO_SUPPORTS_C45 2
293
294#ifdef __KERNEL__
295
296/** 294/**
297 * struct mdio_if_info - Ethernet controller MDIO interface 295 * struct mdio_if_info - Ethernet controller MDIO interface
298 * @prtad: PRTAD of the PHY (%MDIO_PRTAD_NONE if not present/unknown) 296 * @prtad: PRTAD of the PHY (%MDIO_PRTAD_NONE if not present/unknown)
@@ -321,6 +319,8 @@ struct mdio_if_info {
321 319
322#define MDIO_PRTAD_NONE (-1) 320#define MDIO_PRTAD_NONE (-1)
323#define MDIO_DEVAD_NONE (-1) 321#define MDIO_DEVAD_NONE (-1)
322#define MDIO_SUPPORTS_C22 1
323#define MDIO_SUPPORTS_C45 2
324#define MDIO_EMULATE_C22 4 324#define MDIO_EMULATE_C22 4
325 325
326struct ethtool_cmd; 326struct ethtool_cmd;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index aea61905499b..44d8144e9ae8 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -622,7 +622,10 @@ int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac);
622int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn); 622int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn);
623void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn); 623void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn);
624void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap); 624void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap);
625 625int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
626 u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx);
627int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
628 u8 promisc);
626int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); 629int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
627int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 630int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
628void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); 631void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index bee8fa231276..091f9e7dc8b9 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -212,7 +212,10 @@ struct mlx4_wqe_ctrl_seg {
212 * [1] SE (solicited event) 212 * [1] SE (solicited event)
213 * [0] FL (force loopback) 213 * [0] FL (force loopback)
214 */ 214 */
215 __be32 srcrb_flags; 215 union {
216 __be32 srcrb_flags;
217 __be16 srcrb_flags16[2];
218 };
216 /* 219 /*
217 * imm is immediate data for send/RDMA write w/ immediate; 220 * imm is immediate data for send/RDMA write w/ immediate;
218 * also invalidation key for send with invalidate; input 221 * also invalidation key for send with invalidate; input
diff --git a/include/linux/net.h b/include/linux/net.h
index b29923006b11..be60c7f5e145 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -206,6 +206,7 @@ struct proto_ops {
206 int offset, size_t size, int flags); 206 int offset, size_t size, int flags);
207 ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, 207 ssize_t (*splice_read)(struct socket *sock, loff_t *ppos,
208 struct pipe_inode_info *pipe, size_t len, unsigned int flags); 208 struct pipe_inode_info *pipe, size_t len, unsigned int flags);
209 void (*set_peek_off)(struct sock *sk, int val);
209}; 210};
210 211
211#define DECLARE_SOCKADDR(type, dst, src) \ 212#define DECLARE_SOCKADDR(type, dst, src) \
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 77f5202977ce..5ac32123035a 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -54,6 +54,8 @@ enum {
54 NETIF_F_RXCSUM_BIT, /* Receive checksumming offload */ 54 NETIF_F_RXCSUM_BIT, /* Receive checksumming offload */
55 NETIF_F_NOCACHE_COPY_BIT, /* Use no-cache copyfromuser */ 55 NETIF_F_NOCACHE_COPY_BIT, /* Use no-cache copyfromuser */
56 NETIF_F_LOOPBACK_BIT, /* Enable loopback */ 56 NETIF_F_LOOPBACK_BIT, /* Enable loopback */
57 NETIF_F_RXFCS_BIT, /* Append FCS to skb pkt data */
58 NETIF_F_RXALL_BIT, /* Receive errored frames too */
57 59
58 /* 60 /*
59 * Add your fresh new feature above and remember to update 61 * Add your fresh new feature above and remember to update
@@ -98,6 +100,8 @@ enum {
98#define NETIF_F_TSO __NETIF_F(TSO) 100#define NETIF_F_TSO __NETIF_F(TSO)
99#define NETIF_F_UFO __NETIF_F(UFO) 101#define NETIF_F_UFO __NETIF_F(UFO)
100#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)
104#define NETIF_F_RXALL __NETIF_F(RXALL)
101 105
102/* Features valid for ethtool to change */ 106/* Features valid for ethtool to change */
103/* = all defined minus driver/device-class-related */ 107/* = all defined minus driver/device-class-related */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3e5cb2546e4f..8debe299676d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -417,7 +417,7 @@ typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **pskb);
417 417
418extern void __napi_schedule(struct napi_struct *n); 418extern void __napi_schedule(struct napi_struct *n);
419 419
420static inline int napi_disable_pending(struct napi_struct *n) 420static inline bool napi_disable_pending(struct napi_struct *n)
421{ 421{
422 return test_bit(NAPI_STATE_DISABLE, &n->state); 422 return test_bit(NAPI_STATE_DISABLE, &n->state);
423} 423}
@@ -431,7 +431,7 @@ static inline int napi_disable_pending(struct napi_struct *n)
431 * insure only one NAPI poll instance runs. We also make 431 * insure only one NAPI poll instance runs. We also make
432 * sure there is no pending NAPI disable. 432 * sure there is no pending NAPI disable.
433 */ 433 */
434static inline int napi_schedule_prep(struct napi_struct *n) 434static inline bool napi_schedule_prep(struct napi_struct *n)
435{ 435{
436 return !napi_disable_pending(n) && 436 return !napi_disable_pending(n) &&
437 !test_and_set_bit(NAPI_STATE_SCHED, &n->state); 437 !test_and_set_bit(NAPI_STATE_SCHED, &n->state);
@@ -451,13 +451,13 @@ static inline void napi_schedule(struct napi_struct *n)
451} 451}
452 452
453/* Try to reschedule poll. Called by dev->poll() after napi_complete(). */ 453/* Try to reschedule poll. Called by dev->poll() after napi_complete(). */
454static inline int napi_reschedule(struct napi_struct *napi) 454static inline bool napi_reschedule(struct napi_struct *napi)
455{ 455{
456 if (napi_schedule_prep(napi)) { 456 if (napi_schedule_prep(napi)) {
457 __napi_schedule(napi); 457 __napi_schedule(napi);
458 return 1; 458 return true;
459 } 459 }
460 return 0; 460 return false;
461} 461}
462 462
463/** 463/**
@@ -1082,7 +1082,8 @@ struct net_device {
1082 const struct header_ops *header_ops; 1082 const struct header_ops *header_ops;
1083 1083
1084 unsigned int flags; /* interface flags (a la BSD) */ 1084 unsigned int flags; /* interface flags (a la BSD) */
1085 unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */ 1085 unsigned int priv_flags; /* Like 'flags' but invisible to userspace.
1086 * See if.h for definitions. */
1086 unsigned short gflags; 1087 unsigned short gflags;
1087 unsigned short padded; /* How much padding added by alloc_netdev() */ 1088 unsigned short padded; /* How much padding added by alloc_netdev() */
1088 1089
@@ -1867,7 +1868,7 @@ static inline void netif_tx_stop_all_queues(struct net_device *dev)
1867 } 1868 }
1868} 1869}
1869 1870
1870static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue) 1871static inline bool netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
1871{ 1872{
1872 return test_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state); 1873 return test_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state);
1873} 1874}
@@ -1878,17 +1879,17 @@ static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
1878 * 1879 *
1879 * Test if transmit queue on device is currently unable to send. 1880 * Test if transmit queue on device is currently unable to send.
1880 */ 1881 */
1881static inline int netif_queue_stopped(const struct net_device *dev) 1882static inline bool netif_queue_stopped(const struct net_device *dev)
1882{ 1883{
1883 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); 1884 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0));
1884} 1885}
1885 1886
1886static inline int netif_xmit_stopped(const struct netdev_queue *dev_queue) 1887static inline bool netif_xmit_stopped(const struct netdev_queue *dev_queue)
1887{ 1888{
1888 return dev_queue->state & QUEUE_STATE_ANY_XOFF; 1889 return dev_queue->state & QUEUE_STATE_ANY_XOFF;
1889} 1890}
1890 1891
1891static inline int netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_queue) 1892static inline bool netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_queue)
1892{ 1893{
1893 return dev_queue->state & QUEUE_STATE_ANY_XOFF_OR_FROZEN; 1894 return dev_queue->state & QUEUE_STATE_ANY_XOFF_OR_FROZEN;
1894} 1895}
@@ -1898,12 +1899,22 @@ static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
1898{ 1899{
1899#ifdef CONFIG_BQL 1900#ifdef CONFIG_BQL
1900 dql_queued(&dev_queue->dql, bytes); 1901 dql_queued(&dev_queue->dql, bytes);
1901 if (unlikely(dql_avail(&dev_queue->dql) < 0)) { 1902
1902 set_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state); 1903 if (likely(dql_avail(&dev_queue->dql) >= 0))
1903 if (unlikely(dql_avail(&dev_queue->dql) >= 0)) 1904 return;
1904 clear_bit(__QUEUE_STATE_STACK_XOFF, 1905
1905 &dev_queue->state); 1906 set_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state);
1906 } 1907
1908 /*
1909 * The XOFF flag must be set before checking the dql_avail below,
1910 * because in netdev_tx_completed_queue we update the dql_completed
1911 * before checking the XOFF flag.
1912 */
1913 smp_mb();
1914
1915 /* check again in case another CPU has just made room avail */
1916 if (unlikely(dql_avail(&dev_queue->dql) >= 0))
1917 clear_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state);
1907#endif 1918#endif
1908} 1919}
1909 1920
@@ -1916,16 +1927,23 @@ static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
1916 unsigned pkts, unsigned bytes) 1927 unsigned pkts, unsigned bytes)
1917{ 1928{
1918#ifdef CONFIG_BQL 1929#ifdef CONFIG_BQL
1919 if (likely(bytes)) { 1930 if (unlikely(!bytes))
1920 dql_completed(&dev_queue->dql, bytes); 1931 return;
1921 if (unlikely(test_bit(__QUEUE_STATE_STACK_XOFF, 1932
1922 &dev_queue->state) && 1933 dql_completed(&dev_queue->dql, bytes);
1923 dql_avail(&dev_queue->dql) >= 0)) { 1934
1924 if (test_and_clear_bit(__QUEUE_STATE_STACK_XOFF, 1935 /*
1925 &dev_queue->state)) 1936 * Without the memory barrier there is a small possiblity that
1926 netif_schedule_queue(dev_queue); 1937 * netdev_tx_sent_queue will miss the update and cause the queue to
1927 } 1938 * be stopped forever
1928 } 1939 */
1940 smp_mb();
1941
1942 if (dql_avail(&dev_queue->dql) < 0)
1943 return;
1944
1945 if (test_and_clear_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state))
1946 netif_schedule_queue(dev_queue);
1929#endif 1947#endif
1930} 1948}
1931 1949
@@ -1938,6 +1956,7 @@ static inline void netdev_completed_queue(struct net_device *dev,
1938static inline void netdev_tx_reset_queue(struct netdev_queue *q) 1956static inline void netdev_tx_reset_queue(struct netdev_queue *q)
1939{ 1957{
1940#ifdef CONFIG_BQL 1958#ifdef CONFIG_BQL
1959 clear_bit(__QUEUE_STATE_STACK_XOFF, &q->state);
1941 dql_reset(&q->dql); 1960 dql_reset(&q->dql);
1942#endif 1961#endif
1943} 1962}
@@ -1953,7 +1972,7 @@ static inline void netdev_reset_queue(struct net_device *dev_queue)
1953 * 1972 *
1954 * Test if the device has been brought up. 1973 * Test if the device has been brought up.
1955 */ 1974 */
1956static inline int netif_running(const struct net_device *dev) 1975static inline bool netif_running(const struct net_device *dev)
1957{ 1976{
1958 return test_bit(__LINK_STATE_START, &dev->state); 1977 return test_bit(__LINK_STATE_START, &dev->state);
1959} 1978}
@@ -2003,16 +2022,16 @@ static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
2003 * 2022 *
2004 * Check individual transmit queue of a device with multiple transmit queues. 2023 * Check individual transmit queue of a device with multiple transmit queues.
2005 */ 2024 */
2006static inline int __netif_subqueue_stopped(const struct net_device *dev, 2025static inline bool __netif_subqueue_stopped(const struct net_device *dev,
2007 u16 queue_index) 2026 u16 queue_index)
2008{ 2027{
2009 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); 2028 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
2010 2029
2011 return netif_tx_queue_stopped(txq); 2030 return netif_tx_queue_stopped(txq);
2012} 2031}
2013 2032
2014static inline int netif_subqueue_stopped(const struct net_device *dev, 2033static inline bool netif_subqueue_stopped(const struct net_device *dev,
2015 struct sk_buff *skb) 2034 struct sk_buff *skb)
2016{ 2035{
2017 return __netif_subqueue_stopped(dev, skb_get_queue_mapping(skb)); 2036 return __netif_subqueue_stopped(dev, skb_get_queue_mapping(skb));
2018} 2037}
@@ -2051,7 +2070,7 @@ static inline u16 skb_tx_hash(const struct net_device *dev,
2051 * 2070 *
2052 * Check if device has multiple transmit queues 2071 * Check if device has multiple transmit queues
2053 */ 2072 */
2054static inline int netif_is_multiqueue(const struct net_device *dev) 2073static inline bool netif_is_multiqueue(const struct net_device *dev)
2055{ 2074{
2056 return dev->num_tx_queues > 1; 2075 return dev->num_tx_queues > 1;
2057} 2076}
@@ -2121,7 +2140,7 @@ extern int netdev_rx_handler_register(struct net_device *dev,
2121 void *rx_handler_data); 2140 void *rx_handler_data);
2122extern void netdev_rx_handler_unregister(struct net_device *dev); 2141extern void netdev_rx_handler_unregister(struct net_device *dev);
2123 2142
2124extern int dev_valid_name(const char *name); 2143extern bool dev_valid_name(const char *name);
2125extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 2144extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
2126extern int dev_ethtool(struct net *net, struct ifreq *); 2145extern int dev_ethtool(struct net *net, struct ifreq *);
2127extern unsigned dev_get_flags(const struct net_device *); 2146extern unsigned dev_get_flags(const struct net_device *);
@@ -2187,7 +2206,7 @@ extern void linkwatch_forget_dev(struct net_device *dev);
2187 * 2206 *
2188 * Check if carrier is present on device 2207 * Check if carrier is present on device
2189 */ 2208 */
2190static inline int netif_carrier_ok(const struct net_device *dev) 2209static inline bool netif_carrier_ok(const struct net_device *dev)
2191{ 2210{
2192 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); 2211 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
2193} 2212}
@@ -2239,7 +2258,7 @@ static inline void netif_dormant_off(struct net_device *dev)
2239 * 2258 *
2240 * Check if carrier is present on device 2259 * Check if carrier is present on device
2241 */ 2260 */
2242static inline int netif_dormant(const struct net_device *dev) 2261static inline bool netif_dormant(const struct net_device *dev)
2243{ 2262{
2244 return test_bit(__LINK_STATE_DORMANT, &dev->state); 2263 return test_bit(__LINK_STATE_DORMANT, &dev->state);
2245} 2264}
@@ -2251,7 +2270,7 @@ static inline int netif_dormant(const struct net_device *dev)
2251 * 2270 *
2252 * Check if carrier is operational 2271 * Check if carrier is operational
2253 */ 2272 */
2254static inline int netif_oper_up(const struct net_device *dev) 2273static inline bool netif_oper_up(const struct net_device *dev)
2255{ 2274{
2256 return (dev->operstate == IF_OPER_UP || 2275 return (dev->operstate == IF_OPER_UP ||
2257 dev->operstate == IF_OPER_UNKNOWN /* backward compat */); 2276 dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
@@ -2263,7 +2282,7 @@ static inline int netif_oper_up(const struct net_device *dev)
2263 * 2282 *
2264 * Check if device has not been removed from system. 2283 * Check if device has not been removed from system.
2265 */ 2284 */
2266static inline int netif_device_present(struct net_device *dev) 2285static inline bool netif_device_present(struct net_device *dev)
2267{ 2286{
2268 return test_bit(__LINK_STATE_PRESENT, &dev->state); 2287 return test_bit(__LINK_STATE_PRESENT, &dev->state);
2269} 2288}
@@ -2333,9 +2352,9 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
2333 txq->xmit_lock_owner = smp_processor_id(); 2352 txq->xmit_lock_owner = smp_processor_id();
2334} 2353}
2335 2354
2336static inline int __netif_tx_trylock(struct netdev_queue *txq) 2355static inline bool __netif_tx_trylock(struct netdev_queue *txq)
2337{ 2356{
2338 int ok = spin_trylock(&txq->_xmit_lock); 2357 bool ok = spin_trylock(&txq->_xmit_lock);
2339 if (likely(ok)) 2358 if (likely(ok))
2340 txq->xmit_lock_owner = smp_processor_id(); 2359 txq->xmit_lock_owner = smp_processor_id();
2341 return ok; 2360 return ok;
@@ -2556,6 +2575,8 @@ extern void dev_load(struct net *net, const char *name);
2556extern void dev_mcast_init(void); 2575extern void dev_mcast_init(void);
2557extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, 2576extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
2558 struct rtnl_link_stats64 *storage); 2577 struct rtnl_link_stats64 *storage);
2578extern void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,
2579 const struct net_device_stats *netdev_stats);
2559 2580
2560extern int netdev_max_backlog; 2581extern int netdev_max_backlog;
2561extern int netdev_tstamp_prequeue; 2582extern int netdev_tstamp_prequeue;
@@ -2611,7 +2632,7 @@ void netif_stacked_transfer_operstate(const struct net_device *rootdev,
2611 2632
2612netdev_features_t netif_skb_features(struct sk_buff *skb); 2633netdev_features_t netif_skb_features(struct sk_buff *skb);
2613 2634
2614static inline int net_gso_ok(netdev_features_t features, int gso_type) 2635static inline bool net_gso_ok(netdev_features_t features, int gso_type)
2615{ 2636{
2616 netdev_features_t feature = gso_type << NETIF_F_GSO_SHIFT; 2637 netdev_features_t feature = gso_type << NETIF_F_GSO_SHIFT;
2617 2638
@@ -2626,17 +2647,18 @@ static inline int net_gso_ok(netdev_features_t features, int gso_type)
2626 return (features & feature) == feature; 2647 return (features & feature) == feature;
2627} 2648}
2628 2649
2629static inline int skb_gso_ok(struct sk_buff *skb, netdev_features_t features) 2650static inline bool skb_gso_ok(struct sk_buff *skb, netdev_features_t features)
2630{ 2651{
2631 return net_gso_ok(features, skb_shinfo(skb)->gso_type) && 2652 return net_gso_ok(features, skb_shinfo(skb)->gso_type) &&
2632 (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST)); 2653 (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST));
2633} 2654}
2634 2655
2635static inline int netif_needs_gso(struct sk_buff *skb, 2656static inline bool netif_needs_gso(struct sk_buff *skb,
2636 netdev_features_t features) 2657 netdev_features_t features)
2637{ 2658{
2638 return skb_is_gso(skb) && (!skb_gso_ok(skb, features) || 2659 return skb_is_gso(skb) && (!skb_gso_ok(skb, features) ||
2639 unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); 2660 unlikely((skb->ip_summed != CHECKSUM_PARTIAL) &&
2661 (skb->ip_summed != CHECKSUM_UNNECESSARY)));
2640} 2662}
2641 2663
2642static inline void netif_set_gso_max_size(struct net_device *dev, 2664static inline void netif_set_gso_max_size(struct net_device *dev,
@@ -2645,11 +2667,16 @@ static inline void netif_set_gso_max_size(struct net_device *dev,
2645 dev->gso_max_size = size; 2667 dev->gso_max_size = size;
2646} 2668}
2647 2669
2648static inline int netif_is_bond_slave(struct net_device *dev) 2670static inline bool netif_is_bond_slave(struct net_device *dev)
2649{ 2671{
2650 return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING; 2672 return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING;
2651} 2673}
2652 2674
2675static inline bool netif_supports_nofcs(struct net_device *dev)
2676{
2677 return dev->priv_flags & IFF_SUPP_NOFCS;
2678}
2679
2653extern struct pernet_operations __net_initdata loopback_net_ops; 2680extern struct pernet_operations __net_initdata loopback_net_ops;
2654 2681
2655/* Logging, debugging and troubleshooting/diagnostic helpers. */ 2682/* Logging, debugging and troubleshooting/diagnostic helpers. */
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index e144f54185c0..1697036336b6 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -10,6 +10,7 @@ header-y += nfnetlink.h
10header-y += nfnetlink_acct.h 10header-y += nfnetlink_acct.h
11header-y += nfnetlink_compat.h 11header-y += nfnetlink_compat.h
12header-y += nfnetlink_conntrack.h 12header-y += nfnetlink_conntrack.h
13header-y += nfnetlink_cttimeout.h
13header-y += nfnetlink_log.h 14header-y += nfnetlink_log.h
14header-y += nfnetlink_queue.h 15header-y += nfnetlink_queue.h
15header-y += x_tables.h 16header-y += x_tables.h
@@ -22,6 +23,7 @@ header-y += xt_CT.h
22header-y += xt_DSCP.h 23header-y += xt_DSCP.h
23header-y += xt_IDLETIMER.h 24header-y += xt_IDLETIMER.h
24header-y += xt_LED.h 25header-y += xt_LED.h
26header-y += xt_LOG.h
25header-y += xt_MARK.h 27header-y += xt_MARK.h
26header-y += xt_nfacct.h 28header-y += xt_nfacct.h
27header-y += xt_NFLOG.h 29header-y += xt_NFLOG.h
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 3540c6e262f7..2f8e18a23227 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -11,6 +11,8 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14#include <linux/types.h>
15
14/* The protocol version */ 16/* The protocol version */
15#define IPSET_PROTOCOL 6 17#define IPSET_PROTOCOL 6
16 18
@@ -148,6 +150,7 @@ enum ipset_cmd_flags {
148 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME), 150 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
149 IPSET_FLAG_BIT_LIST_HEADER = 2, 151 IPSET_FLAG_BIT_LIST_HEADER = 2,
150 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER), 152 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
153 IPSET_FLAG_CMD_MAX = 15, /* Lower half */
151}; 154};
152 155
153/* Flags at CADT attribute level */ 156/* Flags at CADT attribute level */
@@ -156,6 +159,9 @@ enum ipset_cadt_flags {
156 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE), 159 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
157 IPSET_FLAG_BIT_PHYSDEV = 1, 160 IPSET_FLAG_BIT_PHYSDEV = 1,
158 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV), 161 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
162 IPSET_FLAG_BIT_NOMATCH = 2,
163 IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
164 IPSET_FLAG_CADT_MAX = 15, /* Upper half */
159}; 165};
160 166
161/* Commands with settype-specific attributes */ 167/* Commands with settype-specific attributes */
@@ -168,19 +174,10 @@ enum ipset_adt {
168 IPSET_CADT_MAX, 174 IPSET_CADT_MAX,
169}; 175};
170 176
171#ifdef __KERNEL__
172#include <linux/ip.h>
173#include <linux/ipv6.h>
174#include <linux/netlink.h>
175#include <linux/netfilter.h>
176#include <linux/netfilter/x_tables.h>
177#include <linux/vmalloc.h>
178#include <net/netlink.h>
179
180/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t 177/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t
181 * and IPSET_INVALID_ID if you want to increase the max number of sets. 178 * and IPSET_INVALID_ID if you want to increase the max number of sets.
182 */ 179 */
183typedef u16 ip_set_id_t; 180typedef __u16 ip_set_id_t;
184 181
185#define IPSET_INVALID_ID 65535 182#define IPSET_INVALID_ID 65535
186 183
@@ -203,6 +200,15 @@ enum ip_set_kopt {
203 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE), 200 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
204}; 201};
205 202
203#ifdef __KERNEL__
204#include <linux/ip.h>
205#include <linux/ipv6.h>
206#include <linux/netlink.h>
207#include <linux/netfilter.h>
208#include <linux/netfilter/x_tables.h>
209#include <linux/vmalloc.h>
210#include <net/netlink.h>
211
206/* Set features */ 212/* Set features */
207enum ip_set_feature { 213enum ip_set_feature {
208 IPSET_TYPE_IP_FLAG = 0, 214 IPSET_TYPE_IP_FLAG = 0,
@@ -288,7 +294,10 @@ struct ip_set_type {
288 u8 features; 294 u8 features;
289 /* Set type dimension */ 295 /* Set type dimension */
290 u8 dimension; 296 u8 dimension;
291 /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */ 297 /*
298 * Supported family: may be NFPROTO_UNSPEC for both
299 * NFPROTO_IPV4/NFPROTO_IPV6.
300 */
292 u8 family; 301 u8 family;
293 /* Type revisions */ 302 /* Type revisions */
294 u8 revision_min, revision_max; 303 u8 revision_min, revision_max;
@@ -450,6 +459,8 @@ bitmap_bytes(u32 a, u32 b)
450 return 4 * ((((b - a + 8) / 8) + 3) / 4); 459 return 4 * ((((b - a + 8) / 8) + 3) / 4);
451} 460}
452 461
462#endif /* __KERNEL__ */
463
453/* Interface to iptables/ip6tables */ 464/* Interface to iptables/ip6tables */
454 465
455#define SO_IP_SET 83 466#define SO_IP_SET 83
@@ -475,6 +486,4 @@ struct ip_set_req_version {
475 unsigned version; 486 unsigned version;
476}; 487};
477 488
478#endif /* __KERNEL__ */
479
480#endif /*_IP_SET_H */ 489#endif /*_IP_SET_H */
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index b89fb79cb44f..05a5d72680be 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -113,6 +113,12 @@ htable_bits(u32 hashsize)
113} 113}
114 114
115#ifdef IP_SET_HASH_WITH_NETS 115#ifdef IP_SET_HASH_WITH_NETS
116#ifdef IP_SET_HASH_WITH_NETS_PACKED
117/* When cidr is packed with nomatch, cidr - 1 is stored in the entry */
118#define CIDR(cidr) (cidr + 1)
119#else
120#define CIDR(cidr) (cidr)
121#endif
116 122
117#define SET_HOST_MASK(family) (family == AF_INET ? 32 : 128) 123#define SET_HOST_MASK(family) (family == AF_INET ? 32 : 128)
118 124
@@ -262,6 +268,12 @@ ip_set_hash_destroy(struct ip_set *set)
262#define type_pf_data_list TOKEN(TYPE, PF, _data_list) 268#define type_pf_data_list TOKEN(TYPE, PF, _data_list)
263#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) 269#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist)
264#define type_pf_data_next TOKEN(TYPE, PF, _data_next) 270#define type_pf_data_next TOKEN(TYPE, PF, _data_next)
271#define type_pf_data_flags TOKEN(TYPE, PF, _data_flags)
272#ifdef IP_SET_HASH_WITH_NETS
273#define type_pf_data_match TOKEN(TYPE, PF, _data_match)
274#else
275#define type_pf_data_match(d) 1
276#endif
265 277
266#define type_pf_elem TOKEN(TYPE, PF, _elem) 278#define type_pf_elem TOKEN(TYPE, PF, _elem)
267#define type_pf_telem TOKEN(TYPE, PF, _telem) 279#define type_pf_telem TOKEN(TYPE, PF, _telem)
@@ -308,8 +320,10 @@ ip_set_hash_destroy(struct ip_set *set)
308 * we spare the maintenance of the internal counters. */ 320 * we spare the maintenance of the internal counters. */
309static int 321static int
310type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value, 322type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value,
311 u8 ahash_max) 323 u8 ahash_max, u32 cadt_flags)
312{ 324{
325 struct type_pf_elem *data;
326
313 if (n->pos >= n->size) { 327 if (n->pos >= n->size) {
314 void *tmp; 328 void *tmp;
315 329
@@ -330,7 +344,13 @@ type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value,
330 n->value = tmp; 344 n->value = tmp;
331 n->size += AHASH_INIT_SIZE; 345 n->size += AHASH_INIT_SIZE;
332 } 346 }
333 type_pf_data_copy(ahash_data(n, n->pos++), value); 347 data = ahash_data(n, n->pos++);
348 type_pf_data_copy(data, value);
349#ifdef IP_SET_HASH_WITH_NETS
350 /* Resizing won't overwrite stored flags */
351 if (cadt_flags)
352 type_pf_data_flags(data, cadt_flags);
353#endif
334 return 0; 354 return 0;
335} 355}
336 356
@@ -353,9 +373,12 @@ retry:
353 htable_bits++; 373 htable_bits++;
354 pr_debug("attempt to resize set %s from %u to %u, t %p\n", 374 pr_debug("attempt to resize set %s from %u to %u, t %p\n",
355 set->name, orig->htable_bits, htable_bits, orig); 375 set->name, orig->htable_bits, htable_bits, orig);
356 if (!htable_bits) 376 if (!htable_bits) {
357 /* In case we have plenty of memory :-) */ 377 /* In case we have plenty of memory :-) */
378 pr_warning("Cannot increase the hashsize of set %s further\n",
379 set->name);
358 return -IPSET_ERR_HASH_FULL; 380 return -IPSET_ERR_HASH_FULL;
381 }
359 t = ip_set_alloc(sizeof(*t) 382 t = ip_set_alloc(sizeof(*t)
360 + jhash_size(htable_bits) * sizeof(struct hbucket)); 383 + jhash_size(htable_bits) * sizeof(struct hbucket));
361 if (!t) 384 if (!t)
@@ -368,7 +391,7 @@ retry:
368 for (j = 0; j < n->pos; j++) { 391 for (j = 0; j < n->pos; j++) {
369 data = ahash_data(n, j); 392 data = ahash_data(n, j);
370 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 393 m = hbucket(t, HKEY(data, h->initval, htable_bits));
371 ret = type_pf_elem_add(m, data, AHASH_MAX(h)); 394 ret = type_pf_elem_add(m, data, AHASH_MAX(h), 0);
372 if (ret < 0) { 395 if (ret < 0) {
373 read_unlock_bh(&set->lock); 396 read_unlock_bh(&set->lock);
374 ahash_destroy(t); 397 ahash_destroy(t);
@@ -406,9 +429,14 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
406 struct hbucket *n; 429 struct hbucket *n;
407 int i, ret = 0; 430 int i, ret = 0;
408 u32 key, multi = 0; 431 u32 key, multi = 0;
432 u32 cadt_flags = flags >> 16;
409 433
410 if (h->elements >= h->maxelem) 434 if (h->elements >= h->maxelem) {
435 if (net_ratelimit())
436 pr_warning("Set %s is full, maxelem %u reached\n",
437 set->name, h->maxelem);
411 return -IPSET_ERR_HASH_FULL; 438 return -IPSET_ERR_HASH_FULL;
439 }
412 440
413 rcu_read_lock_bh(); 441 rcu_read_lock_bh();
414 t = rcu_dereference_bh(h->table); 442 t = rcu_dereference_bh(h->table);
@@ -416,11 +444,17 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
416 n = hbucket(t, key); 444 n = hbucket(t, key);
417 for (i = 0; i < n->pos; i++) 445 for (i = 0; i < n->pos; i++)
418 if (type_pf_data_equal(ahash_data(n, i), d, &multi)) { 446 if (type_pf_data_equal(ahash_data(n, i), d, &multi)) {
447#ifdef IP_SET_HASH_WITH_NETS
448 if (flags & IPSET_FLAG_EXIST)
449 /* Support overwriting just the flags */
450 type_pf_data_flags(ahash_data(n, i),
451 cadt_flags);
452#endif
419 ret = -IPSET_ERR_EXIST; 453 ret = -IPSET_ERR_EXIST;
420 goto out; 454 goto out;
421 } 455 }
422 TUNE_AHASH_MAX(h, multi); 456 TUNE_AHASH_MAX(h, multi);
423 ret = type_pf_elem_add(n, value, AHASH_MAX(h)); 457 ret = type_pf_elem_add(n, value, AHASH_MAX(h), cadt_flags);
424 if (ret != 0) { 458 if (ret != 0) {
425 if (ret == -EAGAIN) 459 if (ret == -EAGAIN)
426 type_pf_data_next(h, d); 460 type_pf_data_next(h, d);
@@ -428,7 +462,7 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
428 } 462 }
429 463
430#ifdef IP_SET_HASH_WITH_NETS 464#ifdef IP_SET_HASH_WITH_NETS
431 add_cidr(h, d->cidr, HOST_MASK); 465 add_cidr(h, CIDR(d->cidr), HOST_MASK);
432#endif 466#endif
433 h->elements++; 467 h->elements++;
434out: 468out:
@@ -463,7 +497,7 @@ type_pf_del(struct ip_set *set, void *value, u32 timeout, u32 flags)
463 n->pos--; 497 n->pos--;
464 h->elements--; 498 h->elements--;
465#ifdef IP_SET_HASH_WITH_NETS 499#ifdef IP_SET_HASH_WITH_NETS
466 del_cidr(h, d->cidr, HOST_MASK); 500 del_cidr(h, CIDR(d->cidr), HOST_MASK);
467#endif 501#endif
468 if (n->pos + AHASH_INIT_SIZE < n->size) { 502 if (n->pos + AHASH_INIT_SIZE < n->size) {
469 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) 503 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE)
@@ -506,7 +540,7 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
506 for (i = 0; i < n->pos; i++) { 540 for (i = 0; i < n->pos; i++) {
507 data = ahash_data(n, i); 541 data = ahash_data(n, i);
508 if (type_pf_data_equal(data, d, &multi)) 542 if (type_pf_data_equal(data, d, &multi))
509 return 1; 543 return type_pf_data_match(data);
510 } 544 }
511 } 545 }
512 return 0; 546 return 0;
@@ -528,7 +562,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout, u32 flags)
528#ifdef IP_SET_HASH_WITH_NETS 562#ifdef IP_SET_HASH_WITH_NETS
529 /* If we test an IP address and not a network address, 563 /* If we test an IP address and not a network address,
530 * try all possible network sizes */ 564 * try all possible network sizes */
531 if (d->cidr == SET_HOST_MASK(set->family)) 565 if (CIDR(d->cidr) == SET_HOST_MASK(set->family))
532 return type_pf_test_cidrs(set, d, timeout); 566 return type_pf_test_cidrs(set, d, timeout);
533#endif 567#endif
534 568
@@ -537,7 +571,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout, u32 flags)
537 for (i = 0; i < n->pos; i++) { 571 for (i = 0; i < n->pos; i++) {
538 data = ahash_data(n, i); 572 data = ahash_data(n, i);
539 if (type_pf_data_equal(data, d, &multi)) 573 if (type_pf_data_equal(data, d, &multi))
540 return 1; 574 return type_pf_data_match(data);
541 } 575 }
542 return 0; 576 return 0;
543} 577}
@@ -693,7 +727,7 @@ type_pf_data_timeout_set(struct type_pf_elem *data, u32 timeout)
693 727
694static int 728static int
695type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value, 729type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value,
696 u8 ahash_max, u32 timeout) 730 u8 ahash_max, u32 cadt_flags, u32 timeout)
697{ 731{
698 struct type_pf_elem *data; 732 struct type_pf_elem *data;
699 733
@@ -720,6 +754,11 @@ type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value,
720 data = ahash_tdata(n, n->pos++); 754 data = ahash_tdata(n, n->pos++);
721 type_pf_data_copy(data, value); 755 type_pf_data_copy(data, value);
722 type_pf_data_timeout_set(data, timeout); 756 type_pf_data_timeout_set(data, timeout);
757#ifdef IP_SET_HASH_WITH_NETS
758 /* Resizing won't overwrite stored flags */
759 if (cadt_flags)
760 type_pf_data_flags(data, cadt_flags);
761#endif
723 return 0; 762 return 0;
724} 763}
725 764
@@ -740,7 +779,7 @@ type_pf_expire(struct ip_set_hash *h)
740 if (type_pf_data_expired(data)) { 779 if (type_pf_data_expired(data)) {
741 pr_debug("expired %u/%u\n", i, j); 780 pr_debug("expired %u/%u\n", i, j);
742#ifdef IP_SET_HASH_WITH_NETS 781#ifdef IP_SET_HASH_WITH_NETS
743 del_cidr(h, data->cidr, HOST_MASK); 782 del_cidr(h, CIDR(data->cidr), HOST_MASK);
744#endif 783#endif
745 if (j != n->pos - 1) 784 if (j != n->pos - 1)
746 /* Not last one */ 785 /* Not last one */
@@ -790,9 +829,12 @@ type_pf_tresize(struct ip_set *set, bool retried)
790retry: 829retry:
791 ret = 0; 830 ret = 0;
792 htable_bits++; 831 htable_bits++;
793 if (!htable_bits) 832 if (!htable_bits) {
794 /* In case we have plenty of memory :-) */ 833 /* In case we have plenty of memory :-) */
834 pr_warning("Cannot increase the hashsize of set %s further\n",
835 set->name);
795 return -IPSET_ERR_HASH_FULL; 836 return -IPSET_ERR_HASH_FULL;
837 }
796 t = ip_set_alloc(sizeof(*t) 838 t = ip_set_alloc(sizeof(*t)
797 + jhash_size(htable_bits) * sizeof(struct hbucket)); 839 + jhash_size(htable_bits) * sizeof(struct hbucket));
798 if (!t) 840 if (!t)
@@ -805,7 +847,7 @@ retry:
805 for (j = 0; j < n->pos; j++) { 847 for (j = 0; j < n->pos; j++) {
806 data = ahash_tdata(n, j); 848 data = ahash_tdata(n, j);
807 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 849 m = hbucket(t, HKEY(data, h->initval, htable_bits));
808 ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 850 ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0,
809 type_pf_data_timeout(data)); 851 type_pf_data_timeout(data));
810 if (ret < 0) { 852 if (ret < 0) {
811 read_unlock_bh(&set->lock); 853 read_unlock_bh(&set->lock);
@@ -839,12 +881,17 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
839 int ret = 0, i, j = AHASH_MAX(h) + 1; 881 int ret = 0, i, j = AHASH_MAX(h) + 1;
840 bool flag_exist = flags & IPSET_FLAG_EXIST; 882 bool flag_exist = flags & IPSET_FLAG_EXIST;
841 u32 key, multi = 0; 883 u32 key, multi = 0;
884 u32 cadt_flags = flags >> 16;
842 885
843 if (h->elements >= h->maxelem) 886 if (h->elements >= h->maxelem)
844 /* FIXME: when set is full, we slow down here */ 887 /* FIXME: when set is full, we slow down here */
845 type_pf_expire(h); 888 type_pf_expire(h);
846 if (h->elements >= h->maxelem) 889 if (h->elements >= h->maxelem) {
890 if (net_ratelimit())
891 pr_warning("Set %s is full, maxelem %u reached\n",
892 set->name, h->maxelem);
847 return -IPSET_ERR_HASH_FULL; 893 return -IPSET_ERR_HASH_FULL;
894 }
848 895
849 rcu_read_lock_bh(); 896 rcu_read_lock_bh();
850 t = rcu_dereference_bh(h->table); 897 t = rcu_dereference_bh(h->table);
@@ -854,6 +901,7 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
854 data = ahash_tdata(n, i); 901 data = ahash_tdata(n, i);
855 if (type_pf_data_equal(data, d, &multi)) { 902 if (type_pf_data_equal(data, d, &multi)) {
856 if (type_pf_data_expired(data) || flag_exist) 903 if (type_pf_data_expired(data) || flag_exist)
904 /* Just timeout value may be updated */
857 j = i; 905 j = i;
858 else { 906 else {
859 ret = -IPSET_ERR_EXIST; 907 ret = -IPSET_ERR_EXIST;
@@ -866,15 +914,18 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
866 if (j != AHASH_MAX(h) + 1) { 914 if (j != AHASH_MAX(h) + 1) {
867 data = ahash_tdata(n, j); 915 data = ahash_tdata(n, j);
868#ifdef IP_SET_HASH_WITH_NETS 916#ifdef IP_SET_HASH_WITH_NETS
869 del_cidr(h, data->cidr, HOST_MASK); 917 del_cidr(h, CIDR(data->cidr), HOST_MASK);
870 add_cidr(h, d->cidr, HOST_MASK); 918 add_cidr(h, CIDR(d->cidr), HOST_MASK);
871#endif 919#endif
872 type_pf_data_copy(data, d); 920 type_pf_data_copy(data, d);
873 type_pf_data_timeout_set(data, timeout); 921 type_pf_data_timeout_set(data, timeout);
922#ifdef IP_SET_HASH_WITH_NETS
923 type_pf_data_flags(data, cadt_flags);
924#endif
874 goto out; 925 goto out;
875 } 926 }
876 TUNE_AHASH_MAX(h, multi); 927 TUNE_AHASH_MAX(h, multi);
877 ret = type_pf_elem_tadd(n, d, AHASH_MAX(h), timeout); 928 ret = type_pf_elem_tadd(n, d, AHASH_MAX(h), cadt_flags, timeout);
878 if (ret != 0) { 929 if (ret != 0) {
879 if (ret == -EAGAIN) 930 if (ret == -EAGAIN)
880 type_pf_data_next(h, d); 931 type_pf_data_next(h, d);
@@ -882,7 +933,7 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
882 } 933 }
883 934
884#ifdef IP_SET_HASH_WITH_NETS 935#ifdef IP_SET_HASH_WITH_NETS
885 add_cidr(h, d->cidr, HOST_MASK); 936 add_cidr(h, CIDR(d->cidr), HOST_MASK);
886#endif 937#endif
887 h->elements++; 938 h->elements++;
888out: 939out:
@@ -916,7 +967,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout, u32 flags)
916 n->pos--; 967 n->pos--;
917 h->elements--; 968 h->elements--;
918#ifdef IP_SET_HASH_WITH_NETS 969#ifdef IP_SET_HASH_WITH_NETS
919 del_cidr(h, d->cidr, HOST_MASK); 970 del_cidr(h, CIDR(d->cidr), HOST_MASK);
920#endif 971#endif
921 if (n->pos + AHASH_INIT_SIZE < n->size) { 972 if (n->pos + AHASH_INIT_SIZE < n->size) {
922 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE) 973 void *tmp = kzalloc((n->size - AHASH_INIT_SIZE)
@@ -954,8 +1005,17 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
954 n = hbucket(t, key); 1005 n = hbucket(t, key);
955 for (i = 0; i < n->pos; i++) { 1006 for (i = 0; i < n->pos; i++) {
956 data = ahash_tdata(n, i); 1007 data = ahash_tdata(n, i);
957 if (type_pf_data_equal(data, d, &multi)) 1008#ifdef IP_SET_HASH_WITH_MULTI
958 return !type_pf_data_expired(data); 1009 if (type_pf_data_equal(data, d, &multi)) {
1010 if (!type_pf_data_expired(data))
1011 return type_pf_data_match(data);
1012 multi = 0;
1013 }
1014#else
1015 if (type_pf_data_equal(data, d, &multi) &&
1016 !type_pf_data_expired(data))
1017 return type_pf_data_match(data);
1018#endif
959 } 1019 }
960 } 1020 }
961 return 0; 1021 return 0;
@@ -973,15 +1033,16 @@ type_pf_ttest(struct ip_set *set, void *value, u32 timeout, u32 flags)
973 u32 key, multi = 0; 1033 u32 key, multi = 0;
974 1034
975#ifdef IP_SET_HASH_WITH_NETS 1035#ifdef IP_SET_HASH_WITH_NETS
976 if (d->cidr == SET_HOST_MASK(set->family)) 1036 if (CIDR(d->cidr) == SET_HOST_MASK(set->family))
977 return type_pf_ttest_cidrs(set, d, timeout); 1037 return type_pf_ttest_cidrs(set, d, timeout);
978#endif 1038#endif
979 key = HKEY(d, h->initval, t->htable_bits); 1039 key = HKEY(d, h->initval, t->htable_bits);
980 n = hbucket(t, key); 1040 n = hbucket(t, key);
981 for (i = 0; i < n->pos; i++) { 1041 for (i = 0; i < n->pos; i++) {
982 data = ahash_tdata(n, i); 1042 data = ahash_tdata(n, i);
983 if (type_pf_data_equal(data, d, &multi)) 1043 if (type_pf_data_equal(data, d, &multi) &&
984 return !type_pf_data_expired(data); 1044 !type_pf_data_expired(data))
1045 return type_pf_data_match(data);
985 } 1046 }
986 return 0; 1047 return 0;
987} 1048}
@@ -1094,14 +1155,17 @@ type_pf_gc_init(struct ip_set *set)
1094#undef type_pf_data_isnull 1155#undef type_pf_data_isnull
1095#undef type_pf_data_copy 1156#undef type_pf_data_copy
1096#undef type_pf_data_zero_out 1157#undef type_pf_data_zero_out
1158#undef type_pf_data_netmask
1097#undef type_pf_data_list 1159#undef type_pf_data_list
1098#undef type_pf_data_tlist 1160#undef type_pf_data_tlist
1161#undef type_pf_data_next
1162#undef type_pf_data_flags
1163#undef type_pf_data_match
1099 1164
1100#undef type_pf_elem 1165#undef type_pf_elem
1101#undef type_pf_telem 1166#undef type_pf_telem
1102#undef type_pf_data_timeout 1167#undef type_pf_data_timeout
1103#undef type_pf_data_expired 1168#undef type_pf_data_expired
1104#undef type_pf_data_netmask
1105#undef type_pf_data_timeout_set 1169#undef type_pf_data_timeout_set
1106 1170
1107#undef type_pf_elem_add 1171#undef type_pf_elem_add
@@ -1111,6 +1175,7 @@ type_pf_gc_init(struct ip_set *set)
1111#undef type_pf_test 1175#undef type_pf_test
1112 1176
1113#undef type_pf_elem_tadd 1177#undef type_pf_elem_tadd
1178#undef type_pf_del_telem
1114#undef type_pf_expire 1179#undef type_pf_expire
1115#undef type_pf_tadd 1180#undef type_pf_tadd
1116#undef type_pf_tdel 1181#undef type_pf_tdel
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 6e135f97e59a..e59868ae12d4 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -18,7 +18,10 @@ enum tcp_conntrack {
18 TCP_CONNTRACK_LISTEN, /* obsolete */ 18 TCP_CONNTRACK_LISTEN, /* obsolete */
19#define TCP_CONNTRACK_SYN_SENT2 TCP_CONNTRACK_LISTEN 19#define TCP_CONNTRACK_SYN_SENT2 TCP_CONNTRACK_LISTEN
20 TCP_CONNTRACK_MAX, 20 TCP_CONNTRACK_MAX,
21 TCP_CONNTRACK_IGNORE 21 TCP_CONNTRACK_IGNORE,
22 TCP_CONNTRACK_RETRANS,
23 TCP_CONNTRACK_UNACK,
24 TCP_CONNTRACK_TIMEOUT_MAX
22}; 25};
23 26
24/* Window scaling is advertised by the sender */ 27/* Window scaling is advertised by the sender */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index b64454c2f79f..6fd1f0d07e64 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -49,7 +49,8 @@ struct nfgenmsg {
49#define NFNL_SUBSYS_OSF 5 49#define NFNL_SUBSYS_OSF 5
50#define NFNL_SUBSYS_IPSET 6 50#define NFNL_SUBSYS_IPSET 6
51#define NFNL_SUBSYS_ACCT 7 51#define NFNL_SUBSYS_ACCT 7
52#define NFNL_SUBSYS_COUNT 8 52#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
53#define NFNL_SUBSYS_COUNT 9
53 54
54#ifdef __KERNEL__ 55#ifdef __KERNEL__
55 56
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index debf1aefd753..e58e4b93c108 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -43,6 +43,7 @@ enum ctattr_type {
43 CTA_ZONE, 43 CTA_ZONE,
44 CTA_SECCTX, 44 CTA_SECCTX,
45 CTA_TIMESTAMP, 45 CTA_TIMESTAMP,
46 CTA_MARK_MASK,
46 __CTA_MAX 47 __CTA_MAX
47}; 48};
48#define CTA_MAX (__CTA_MAX - 1) 49#define CTA_MAX (__CTA_MAX - 1)
@@ -172,10 +173,21 @@ enum ctattr_expect {
172 CTA_EXPECT_HELP_NAME, 173 CTA_EXPECT_HELP_NAME,
173 CTA_EXPECT_ZONE, 174 CTA_EXPECT_ZONE,
174 CTA_EXPECT_FLAGS, 175 CTA_EXPECT_FLAGS,
176 CTA_EXPECT_CLASS,
177 CTA_EXPECT_NAT,
178 CTA_EXPECT_FN,
175 __CTA_EXPECT_MAX 179 __CTA_EXPECT_MAX
176}; 180};
177#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) 181#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1)
178 182
183enum ctattr_expect_nat {
184 CTA_EXPECT_NAT_UNSPEC,
185 CTA_EXPECT_NAT_DIR,
186 CTA_EXPECT_NAT_TUPLE,
187 __CTA_EXPECT_NAT_MAX
188};
189#define CTA_EXPECT_NAT_MAX (__CTA_EXPECT_NAT_MAX - 1)
190
179enum ctattr_help { 191enum ctattr_help {
180 CTA_HELP_UNSPEC, 192 CTA_HELP_UNSPEC,
181 CTA_HELP_NAME, 193 CTA_HELP_NAME,
diff --git a/include/linux/netfilter/nfnetlink_cttimeout.h b/include/linux/netfilter/nfnetlink_cttimeout.h
new file mode 100644
index 000000000000..a2810a7c5e30
--- /dev/null
+++ b/include/linux/netfilter/nfnetlink_cttimeout.h
@@ -0,0 +1,114 @@
1#ifndef _CTTIMEOUT_NETLINK_H
2#define _CTTIMEOUT_NETLINK_H
3#include <linux/netfilter/nfnetlink.h>
4
5enum ctnl_timeout_msg_types {
6 IPCTNL_MSG_TIMEOUT_NEW,
7 IPCTNL_MSG_TIMEOUT_GET,
8 IPCTNL_MSG_TIMEOUT_DELETE,
9
10 IPCTNL_MSG_TIMEOUT_MAX
11};
12
13enum ctattr_timeout {
14 CTA_TIMEOUT_UNSPEC,
15 CTA_TIMEOUT_NAME,
16 CTA_TIMEOUT_L3PROTO,
17 CTA_TIMEOUT_L4PROTO,
18 CTA_TIMEOUT_DATA,
19 CTA_TIMEOUT_USE,
20 __CTA_TIMEOUT_MAX
21};
22#define CTA_TIMEOUT_MAX (__CTA_TIMEOUT_MAX - 1)
23
24enum ctattr_timeout_generic {
25 CTA_TIMEOUT_GENERIC_UNSPEC,
26 CTA_TIMEOUT_GENERIC_TIMEOUT,
27 __CTA_TIMEOUT_GENERIC_MAX
28};
29#define CTA_TIMEOUT_GENERIC_MAX (__CTA_TIMEOUT_GENERIC_MAX - 1)
30
31enum ctattr_timeout_tcp {
32 CTA_TIMEOUT_TCP_UNSPEC,
33 CTA_TIMEOUT_TCP_SYN_SENT,
34 CTA_TIMEOUT_TCP_SYN_RECV,
35 CTA_TIMEOUT_TCP_ESTABLISHED,
36 CTA_TIMEOUT_TCP_FIN_WAIT,
37 CTA_TIMEOUT_TCP_CLOSE_WAIT,
38 CTA_TIMEOUT_TCP_LAST_ACK,
39 CTA_TIMEOUT_TCP_TIME_WAIT,
40 CTA_TIMEOUT_TCP_CLOSE,
41 CTA_TIMEOUT_TCP_SYN_SENT2,
42 CTA_TIMEOUT_TCP_RETRANS,
43 CTA_TIMEOUT_TCP_UNACK,
44 __CTA_TIMEOUT_TCP_MAX
45};
46#define CTA_TIMEOUT_TCP_MAX (__CTA_TIMEOUT_TCP_MAX - 1)
47
48enum ctattr_timeout_udp {
49 CTA_TIMEOUT_UDP_UNSPEC,
50 CTA_TIMEOUT_UDP_UNREPLIED,
51 CTA_TIMEOUT_UDP_REPLIED,
52 __CTA_TIMEOUT_UDP_MAX
53};
54#define CTA_TIMEOUT_UDP_MAX (__CTA_TIMEOUT_UDP_MAX - 1)
55
56enum ctattr_timeout_udplite {
57 CTA_TIMEOUT_UDPLITE_UNSPEC,
58 CTA_TIMEOUT_UDPLITE_UNREPLIED,
59 CTA_TIMEOUT_UDPLITE_REPLIED,
60 __CTA_TIMEOUT_UDPLITE_MAX
61};
62#define CTA_TIMEOUT_UDPLITE_MAX (__CTA_TIMEOUT_UDPLITE_MAX - 1)
63
64enum ctattr_timeout_icmp {
65 CTA_TIMEOUT_ICMP_UNSPEC,
66 CTA_TIMEOUT_ICMP_TIMEOUT,
67 __CTA_TIMEOUT_ICMP_MAX
68};
69#define CTA_TIMEOUT_ICMP_MAX (__CTA_TIMEOUT_ICMP_MAX - 1)
70
71enum ctattr_timeout_dccp {
72 CTA_TIMEOUT_DCCP_UNSPEC,
73 CTA_TIMEOUT_DCCP_REQUEST,
74 CTA_TIMEOUT_DCCP_RESPOND,
75 CTA_TIMEOUT_DCCP_PARTOPEN,
76 CTA_TIMEOUT_DCCP_OPEN,
77 CTA_TIMEOUT_DCCP_CLOSEREQ,
78 CTA_TIMEOUT_DCCP_CLOSING,
79 CTA_TIMEOUT_DCCP_TIMEWAIT,
80 __CTA_TIMEOUT_DCCP_MAX
81};
82#define CTA_TIMEOUT_DCCP_MAX (__CTA_TIMEOUT_DCCP_MAX - 1)
83
84enum ctattr_timeout_sctp {
85 CTA_TIMEOUT_SCTP_UNSPEC,
86 CTA_TIMEOUT_SCTP_CLOSED,
87 CTA_TIMEOUT_SCTP_COOKIE_WAIT,
88 CTA_TIMEOUT_SCTP_COOKIE_ECHOED,
89 CTA_TIMEOUT_SCTP_ESTABLISHED,
90 CTA_TIMEOUT_SCTP_SHUTDOWN_SENT,
91 CTA_TIMEOUT_SCTP_SHUTDOWN_RECD,
92 CTA_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT,
93 __CTA_TIMEOUT_SCTP_MAX
94};
95#define CTA_TIMEOUT_SCTP_MAX (__CTA_TIMEOUT_SCTP_MAX - 1)
96
97enum ctattr_timeout_icmpv6 {
98 CTA_TIMEOUT_ICMPV6_UNSPEC,
99 CTA_TIMEOUT_ICMPV6_TIMEOUT,
100 __CTA_TIMEOUT_ICMPV6_MAX
101};
102#define CTA_TIMEOUT_ICMPV6_MAX (__CTA_TIMEOUT_ICMPV6_MAX - 1)
103
104enum ctattr_timeout_gre {
105 CTA_TIMEOUT_GRE_UNSPEC,
106 CTA_TIMEOUT_GRE_UNREPLIED,
107 CTA_TIMEOUT_GRE_REPLIED,
108 __CTA_TIMEOUT_GRE_MAX
109};
110#define CTA_TIMEOUT_GRE_MAX (__CTA_TIMEOUT_GRE_MAX - 1)
111
112#define CTNL_TIMEOUT_NAME_MAX 32
113
114#endif
diff --git a/include/linux/netfilter/xt_CT.h b/include/linux/netfilter/xt_CT.h
index b56e76811c04..a064b8af360c 100644
--- a/include/linux/netfilter/xt_CT.h
+++ b/include/linux/netfilter/xt_CT.h
@@ -16,4 +16,16 @@ struct xt_ct_target_info {
16 struct nf_conn *ct __attribute__((aligned(8))); 16 struct nf_conn *ct __attribute__((aligned(8)));
17}; 17};
18 18
19struct xt_ct_target_info_v1 {
20 __u16 flags;
21 __u16 zone;
22 __u32 ct_events;
23 __u32 exp_events;
24 char helper[16];
25 char timeout[32];
26
27 /* Used internally by the kernel */
28 struct nf_conn *ct __attribute__((aligned(8)));
29};
30
19#endif /* _XT_CT_H */ 31#endif /* _XT_CT_H */
diff --git a/include/linux/netfilter/xt_LOG.h b/include/linux/netfilter/xt_LOG.h
new file mode 100644
index 000000000000..cac079095305
--- /dev/null
+++ b/include/linux/netfilter/xt_LOG.h
@@ -0,0 +1,19 @@
1#ifndef _XT_LOG_H
2#define _XT_LOG_H
3
4/* make sure not to change this without changing nf_log.h:NF_LOG_* (!) */
5#define XT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
6#define XT_LOG_TCPOPT 0x02 /* Log TCP options */
7#define XT_LOG_IPOPT 0x04 /* Log IP options */
8#define XT_LOG_UID 0x08 /* Log UID owning local socket */
9#define XT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */
10#define XT_LOG_MACDECODE 0x20 /* Decode MAC header */
11#define XT_LOG_MASK 0x2f
12
13struct xt_log_info {
14 unsigned char level;
15 unsigned char logflags;
16 char prefix[30];
17};
18
19#endif /* _XT_LOG_H */
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index f9930c87fff3..31f8bec95650 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -4,11 +4,9 @@ header-y += ipt_CLUSTERIP.h
4header-y += ipt_ECN.h 4header-y += ipt_ECN.h
5header-y += ipt_LOG.h 5header-y += ipt_LOG.h
6header-y += ipt_REJECT.h 6header-y += ipt_REJECT.h
7header-y += ipt_SAME.h
8header-y += ipt_TTL.h 7header-y += ipt_TTL.h
9header-y += ipt_ULOG.h 8header-y += ipt_ULOG.h
10header-y += ipt_addrtype.h 9header-y += ipt_addrtype.h
11header-y += ipt_ah.h 10header-y += ipt_ah.h
12header-y += ipt_ecn.h 11header-y += ipt_ecn.h
13header-y += ipt_realm.h
14header-y += ipt_ttl.h 12header-y += ipt_ttl.h
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h
index dcdbadf9fd4a..5d8152077d71 100644
--- a/include/linux/netfilter_ipv4/ipt_LOG.h
+++ b/include/linux/netfilter_ipv4/ipt_LOG.h
@@ -1,6 +1,8 @@
1#ifndef _IPT_LOG_H 1#ifndef _IPT_LOG_H
2#define _IPT_LOG_H 2#define _IPT_LOG_H
3 3
4#warning "Please update iptables, this file will be removed soon!"
5
4/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */ 6/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
5#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ 7#define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
6#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ 8#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */
diff --git a/include/linux/netfilter_ipv4/ipt_SAME.h b/include/linux/netfilter_ipv4/ipt_SAME.h
deleted file mode 100644
index 5bca78267afd..000000000000
--- a/include/linux/netfilter_ipv4/ipt_SAME.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _IPT_SAME_H
2#define _IPT_SAME_H
3
4#include <linux/types.h>
5
6#define IPT_SAME_MAX_RANGE 10
7
8#define IPT_SAME_NODST 0x01
9
10struct ipt_same_info {
11 unsigned char info;
12 __u32 rangesize;
13 __u32 ipnum;
14 __u32 *iparray;
15
16 /* hangs off end. */
17 struct nf_nat_range range[IPT_SAME_MAX_RANGE];
18};
19
20#endif /*_IPT_SAME_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_realm.h b/include/linux/netfilter_ipv4/ipt_realm.h
deleted file mode 100644
index b3996eaa0188..000000000000
--- a/include/linux/netfilter_ipv4/ipt_realm.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IPT_REALM_H
2#define _IPT_REALM_H
3
4#include <linux/netfilter/xt_realm.h>
5#define ipt_realm_info xt_realm_info
6
7#endif /* _IPT_REALM_H */
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h
index 9dd5579e02ec..3dd0bc4e0735 100644
--- a/include/linux/netfilter_ipv6/ip6t_LOG.h
+++ b/include/linux/netfilter_ipv6/ip6t_LOG.h
@@ -1,6 +1,8 @@
1#ifndef _IP6T_LOG_H 1#ifndef _IP6T_LOG_H
2#define _IP6T_LOG_H 2#define _IP6T_LOG_H
3 3
4#warning "Please update iptables, this file will be removed soon!"
5
4/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */ 6/* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */
5#define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ 7#define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */
6#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ 8#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 52e48959cfa1..a2092f582a78 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -225,6 +225,7 @@ struct netlink_callback {
225 int (*dump)(struct sk_buff * skb, 225 int (*dump)(struct sk_buff * skb,
226 struct netlink_callback *cb); 226 struct netlink_callback *cb);
227 int (*done)(struct netlink_callback *cb); 227 int (*done)(struct netlink_callback *cb);
228 void *data;
228 u16 family; 229 u16 family;
229 u16 min_dump_alloc; 230 u16 min_dump_alloc;
230 unsigned int prev_seq, seq; 231 unsigned int prev_seq, seq;
@@ -237,22 +238,8 @@ struct netlink_notify {
237 int protocol; 238 int protocol;
238}; 239};
239 240
240static __inline__ struct nlmsghdr * 241struct nlmsghdr *
241__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) 242__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags);
242{
243 struct nlmsghdr *nlh;
244 int size = NLMSG_LENGTH(len);
245
246 nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size));
247 nlh->nlmsg_type = type;
248 nlh->nlmsg_len = size;
249 nlh->nlmsg_flags = flags;
250 nlh->nlmsg_pid = pid;
251 nlh->nlmsg_seq = seq;
252 if (!__builtin_constant_p(size) || NLMSG_ALIGN(size) - size != 0)
253 memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size);
254 return nlh;
255}
256 243
257#define NLMSG_NEW(skb, pid, seq, type, len, flags) \ 244#define NLMSG_NEW(skb, pid, seq, type, len, flags) \
258({ if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \ 245({ if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \
@@ -262,11 +249,16 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
262#define NLMSG_PUT(skb, pid, seq, type, len) \ 249#define NLMSG_PUT(skb, pid, seq, type, len) \
263 NLMSG_NEW(skb, pid, seq, type, len, 0) 250 NLMSG_NEW(skb, pid, seq, type, len, 0)
264 251
252struct netlink_dump_control {
253 int (*dump)(struct sk_buff *skb, struct netlink_callback *);
254 int (*done)(struct netlink_callback*);
255 void *data;
256 u16 min_dump_alloc;
257};
258
265extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, 259extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
266 const struct nlmsghdr *nlh, 260 const struct nlmsghdr *nlh,
267 int (*dump)(struct sk_buff *skb, struct netlink_callback*), 261 struct netlink_dump_control *control);
268 int (*done)(struct netlink_callback*),
269 u16 min_dump_alloc);
270 262
271 263
272#define NL_NONROOT_RECV 0x1 264#define NL_NONROOT_RECV 0x1
diff --git a/include/linux/nfc.h b/include/linux/nfc.h
index 01d4e5d60325..39c1fcf089c0 100644
--- a/include/linux/nfc.h
+++ b/include/linux/nfc.h
@@ -89,6 +89,8 @@ enum nfc_commands {
89 * @NFC_ATTR_TARGET_SEL_RES: NFC-A targets extra information (useful if the 89 * @NFC_ATTR_TARGET_SEL_RES: NFC-A targets extra information (useful if the
90 * target is not NFC-Forum compliant) 90 * target is not NFC-Forum compliant)
91 * @NFC_ATTR_TARGET_NFCID1: NFC-A targets identifier, max 10 bytes 91 * @NFC_ATTR_TARGET_NFCID1: NFC-A targets identifier, max 10 bytes
92 * @NFC_ATTR_TARGET_SENSB_RES: NFC-B targets extra information, max 12 bytes
93 * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes
92 * @NFC_ATTR_COMM_MODE: Passive or active mode 94 * @NFC_ATTR_COMM_MODE: Passive or active mode
93 * @NFC_ATTR_RF_MODE: Initiator or target 95 * @NFC_ATTR_RF_MODE: Initiator or target
94 */ 96 */
@@ -101,14 +103,20 @@ enum nfc_attrs {
101 NFC_ATTR_TARGET_SENS_RES, 103 NFC_ATTR_TARGET_SENS_RES,
102 NFC_ATTR_TARGET_SEL_RES, 104 NFC_ATTR_TARGET_SEL_RES,
103 NFC_ATTR_TARGET_NFCID1, 105 NFC_ATTR_TARGET_NFCID1,
106 NFC_ATTR_TARGET_SENSB_RES,
107 NFC_ATTR_TARGET_SENSF_RES,
104 NFC_ATTR_COMM_MODE, 108 NFC_ATTR_COMM_MODE,
105 NFC_ATTR_RF_MODE, 109 NFC_ATTR_RF_MODE,
110 NFC_ATTR_DEVICE_POWERED,
106/* private: internal use only */ 111/* private: internal use only */
107 __NFC_ATTR_AFTER_LAST 112 __NFC_ATTR_AFTER_LAST
108}; 113};
109#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1) 114#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
110 115
111#define NFC_DEVICE_NAME_MAXSIZE 8 116#define NFC_DEVICE_NAME_MAXSIZE 8
117#define NFC_NFCID1_MAXSIZE 10
118#define NFC_SENSB_RES_MAXSIZE 12
119#define NFC_SENSF_RES_MAXSIZE 18
112 120
113/* NFC protocols */ 121/* NFC protocols */
114#define NFC_PROTO_JEWEL 1 122#define NFC_PROTO_JEWEL 1
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 0f5ff3739820..e474f6e780cc 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -156,21 +156,23 @@
156 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX 156 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
157 * or %NL80211_ATTR_MAC. 157 * or %NL80211_ATTR_MAC.
158 * 158 *
159 * @NL80211_CMD_GET_BEACON: retrieve beacon information (returned in a 159 * @NL80211_CMD_GET_BEACON: (not used)
160 * %NL80222_CMD_NEW_BEACON message) 160 * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
161 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface 161 * using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL
162 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, 162 * attributes. For drivers that generate the beacon and probe responses
163 * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes. 163 * internally, the following attributes must be provided: %NL80211_ATTR_IE,
164 * Following attributes are provided for drivers that generate full Beacon 164 * %NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP.
165 * and Probe Response frames internally: %NL80211_ATTR_SSID, 165 * @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters
166 * are like for %NL80211_CMD_SET_BEACON, and additionally parameters that
167 * do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL,
168 * %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID,
166 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, 169 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
167 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, 170 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
168 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, 171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
169 * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_IE, %NL80211_ATTR_IE_PROBE_RESP, 172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
170 * %NL80211_ATTR_IE_ASSOC_RESP. 173 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
171 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, 174 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
172 * parameters are like for %NL80211_CMD_SET_BEACON. 175 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
173 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
174 * 176 *
175 * @NL80211_CMD_GET_STATION: Get station attributes for station identified by 177 * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
176 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. 178 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
@@ -367,6 +369,11 @@
367 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, 369 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
368 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and 370 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
369 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT. 371 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
372 * Background scan period can optionally be
373 * specified in %NL80211_ATTR_BG_SCAN_PERIOD,
374 * if not specified default background scan configuration
375 * in driver is used and if period value is 0, bg scan will be disabled.
376 * This attribute is ignored if driver does not support roam scan.
370 * It is also sent as an event, with the BSSID and response IEs when the 377 * It is also sent as an event, with the BSSID and response IEs when the
371 * connection is established or failed to be established. This can be 378 * connection is established or failed to be established. This can be
372 * determined by the STATUS_CODE attribute. 379 * determined by the STATUS_CODE attribute.
@@ -565,8 +572,10 @@ enum nl80211_commands {
565 572
566 NL80211_CMD_GET_BEACON, 573 NL80211_CMD_GET_BEACON,
567 NL80211_CMD_SET_BEACON, 574 NL80211_CMD_SET_BEACON,
568 NL80211_CMD_NEW_BEACON, 575 NL80211_CMD_START_AP,
569 NL80211_CMD_DEL_BEACON, 576 NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP,
577 NL80211_CMD_STOP_AP,
578 NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP,
570 579
571 NL80211_CMD_GET_STATION, 580 NL80211_CMD_GET_STATION,
572 NL80211_CMD_SET_STATION, 581 NL80211_CMD_SET_STATION,
@@ -1193,6 +1202,19 @@ enum nl80211_commands {
1193 * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of 1202 * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of
1194 * up to 16 TIDs. 1203 * up to 16 TIDs.
1195 * 1204 *
1205 * @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be
1206 * used by the drivers which has MLME in firmware and does not have support
1207 * to report per station tx/rx activity to free up the staion entry from
1208 * the list. This needs to be used when the driver advertises the
1209 * capability to timeout the stations.
1210 *
1211 * @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int);
1212 * this attribute is (depending on the driver capabilities) added to
1213 * received frames indicated with %NL80211_CMD_FRAME.
1214 *
1215 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
1216 * or 0 to disable background scan.
1217 *
1196 * @NL80211_ATTR_MAX: highest attribute number currently defined 1218 * @NL80211_ATTR_MAX: highest attribute number currently defined
1197 * @__NL80211_ATTR_AFTER_LAST: internal use 1219 * @__NL80211_ATTR_AFTER_LAST: internal use
1198 */ 1220 */
@@ -1438,6 +1460,12 @@ enum nl80211_attrs {
1438 1460
1439 NL80211_ATTR_NOACK_MAP, 1461 NL80211_ATTR_NOACK_MAP,
1440 1462
1463 NL80211_ATTR_INACTIVITY_TIMEOUT,
1464
1465 NL80211_ATTR_RX_SIGNAL_DBM,
1466
1467 NL80211_ATTR_BG_SCAN_PERIOD,
1468
1441 /* add attributes here, update the policy in nl80211.c */ 1469 /* add attributes here, update the policy in nl80211.c */
1442 1470
1443 __NL80211_ATTR_AFTER_LAST, 1471 __NL80211_ATTR_AFTER_LAST,
@@ -1475,6 +1503,7 @@ enum nl80211_attrs {
1475#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS 1503#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
1476 1504
1477#define NL80211_MAX_SUPP_RATES 32 1505#define NL80211_MAX_SUPP_RATES 32
1506#define NL80211_MAX_SUPP_HT_RATES 77
1478#define NL80211_MAX_SUPP_REG_RULES 32 1507#define NL80211_MAX_SUPP_REG_RULES 32
1479#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 1508#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
1480#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 1509#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
@@ -2104,6 +2133,13 @@ enum nl80211_mntr_flags {
2104 * TUs) during which a mesh STA can send only one Action frame containing a 2133 * TUs) during which a mesh STA can send only one Action frame containing a
2105 * PERR element. 2134 * PERR element.
2106 * 2135 *
2136 * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding
2137 * or forwarding entity (default is TRUE - forwarding entity)
2138 *
2139 * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the
2140 * threshold for average signal strength of candidate station to establish
2141 * a peer link.
2142 *
2107 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute 2143 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
2108 * 2144 *
2109 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2145 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
@@ -2128,6 +2164,8 @@ enum nl80211_meshconf_params {
2128 NL80211_MESHCONF_HWMP_RANN_INTERVAL, 2164 NL80211_MESHCONF_HWMP_RANN_INTERVAL,
2129 NL80211_MESHCONF_GATE_ANNOUNCEMENTS, 2165 NL80211_MESHCONF_GATE_ANNOUNCEMENTS,
2130 NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL, 2166 NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
2167 NL80211_MESHCONF_FORWARDING,
2168 NL80211_MESHCONF_RSSI_THRESHOLD,
2131 2169
2132 /* keep last */ 2170 /* keep last */
2133 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2171 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -2401,12 +2439,15 @@ enum nl80211_key_attributes {
2401 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with 2439 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
2402 * 1 = 500 kbps) but without the IE length restriction (at most 2440 * 1 = 500 kbps) but without the IE length restriction (at most
2403 * %NL80211_MAX_SUPP_RATES in a single array). 2441 * %NL80211_MAX_SUPP_RATES in a single array).
2442 * @NL80211_TXRATE_MCS: HT (MCS) rates allowed for TX rate selection
2443 * in an array of MCS numbers.
2404 * @__NL80211_TXRATE_AFTER_LAST: internal 2444 * @__NL80211_TXRATE_AFTER_LAST: internal
2405 * @NL80211_TXRATE_MAX: highest TX rate attribute 2445 * @NL80211_TXRATE_MAX: highest TX rate attribute
2406 */ 2446 */
2407enum nl80211_tx_rate_attributes { 2447enum nl80211_tx_rate_attributes {
2408 __NL80211_TXRATE_INVALID, 2448 __NL80211_TXRATE_INVALID,
2409 NL80211_TXRATE_LEGACY, 2449 NL80211_TXRATE_LEGACY,
2450 NL80211_TXRATE_MCS,
2410 2451
2411 /* keep last */ 2452 /* keep last */
2412 __NL80211_TXRATE_AFTER_LAST, 2453 __NL80211_TXRATE_AFTER_LAST,
@@ -2792,10 +2833,13 @@ enum nl80211_ap_sme_features {
2792 * TX status to the socket error queue when requested with the 2833 * TX status to the socket error queue when requested with the
2793 * socket option. 2834 * socket option.
2794 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. 2835 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
2836 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
2837 * the connected inactive stations in AP mode.
2795 */ 2838 */
2796enum nl80211_feature_flags { 2839enum nl80211_feature_flags {
2797 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 2840 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
2798 NL80211_FEATURE_HT_IBSS = 1 << 1, 2841 NL80211_FEATURE_HT_IBSS = 1 << 1,
2842 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
2799}; 2843};
2800 2844
2801/** 2845/**
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 31d77af2ef42..3329965ed63f 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2105,6 +2105,7 @@
2105#define PCI_DEVICE_ID_NX2_57711E 0x1650 2105#define PCI_DEVICE_ID_NX2_57711E 0x1650
2106#define PCI_DEVICE_ID_TIGON3_5705 0x1653 2106#define PCI_DEVICE_ID_TIGON3_5705 0x1653
2107#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 2107#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
2108#define PCI_DEVICE_ID_TIGON3_5719 0x1657
2108#define PCI_DEVICE_ID_TIGON3_5721 0x1659 2109#define PCI_DEVICE_ID_TIGON3_5721 0x1659
2109#define PCI_DEVICE_ID_TIGON3_5722 0x165a 2110#define PCI_DEVICE_ID_TIGON3_5722 0x165a
2110#define PCI_DEVICE_ID_TIGON3_5723 0x165b 2111#define PCI_DEVICE_ID_TIGON3_5723 0x165b
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 0d5b79365d03..410b33d014d2 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -127,6 +127,27 @@ struct tc_multiq_qopt {
127 __u16 max_bands; /* Maximum number of queues */ 127 __u16 max_bands; /* Maximum number of queues */
128}; 128};
129 129
130/* PLUG section */
131
132#define TCQ_PLUG_BUFFER 0
133#define TCQ_PLUG_RELEASE_ONE 1
134#define TCQ_PLUG_RELEASE_INDEFINITE 2
135#define TCQ_PLUG_LIMIT 3
136
137struct tc_plug_qopt {
138 /* TCQ_PLUG_BUFFER: Inset a plug into the queue and
139 * buffer any incoming packets
140 * TCQ_PLUG_RELEASE_ONE: Dequeue packets from queue head
141 * to beginning of the next plug.
142 * TCQ_PLUG_RELEASE_INDEFINITE: Dequeue all packets from queue.
143 * Stop buffering packets until the next TCQ_PLUG_BUFFER
144 * command is received (just act as a pass-thru queue).
145 * TCQ_PLUG_LIMIT: Increase/decrease queue size
146 */
147 int action;
148 __u32 limit;
149};
150
130/* TBF section */ 151/* TBF section */
131 152
132struct tc_tbf_qopt { 153struct tc_tbf_qopt {
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h
new file mode 100644
index 000000000000..c4e23d029498
--- /dev/null
+++ b/include/linux/platform_data/cpsw.h
@@ -0,0 +1,55 @@
1/*
2 * Texas Instruments Ethernet Switch Driver
3 *
4 * Copyright (C) 2012 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#ifndef __CPSW_H__
16#define __CPSW_H__
17
18#include <linux/if_ether.h>
19
20struct cpsw_slave_data {
21 u32 slave_reg_ofs;
22 u32 sliver_reg_ofs;
23 const char *phy_id;
24 int phy_if;
25 u8 mac_addr[ETH_ALEN];
26};
27
28struct cpsw_platform_data {
29 u32 ss_reg_ofs; /* Subsystem control register offset */
30 u32 channels; /* number of cpdma channels (symmetric) */
31 u32 cpdma_reg_ofs; /* cpdma register offset */
32 u32 cpdma_sram_ofs; /* cpdma sram offset */
33
34 u32 slaves; /* number of slave cpgmac ports */
35 struct cpsw_slave_data *slave_data;
36
37 u32 ale_reg_ofs; /* address lookup engine reg offset */
38 u32 ale_entries; /* ale table size */
39
40 u32 host_port_reg_ofs; /* cpsw cpdma host port registers */
41 u32 host_port_num; /* The port number for the host port */
42
43 u32 hw_stats_reg_ofs; /* cpsw hardware statistics counters */
44
45 u32 bd_ram_ofs; /* embedded buffer descriptor RAM offset*/
46 u32 bd_ram_size; /*buffer descriptor ram size */
47 u32 hw_ram_addr; /*if the HW address for BD RAM is different */
48 bool no_bd_ram; /* no embedded BD ram*/
49
50 u32 rx_descs; /* Number of Rx Descriptios */
51
52 u32 mac_control; /* Mac control register */
53};
54
55#endif /* __CPSW_H__ */
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h
index b8d4ddd22736..e53ff65935dd 100644
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
@@ -1,42 +1,12 @@
1/* 1/*
2 * ppp-comp.h - Definitions for doing PPP packet compression. 2 * ppp-comp.h - Definitions for doing PPP packet compression.
3 * 3 *
4 * Copyright (c) 1994 The Australian National University. 4 * Copyright 1994-1998 Paul Mackerras.
5 * All rights reserved.
6 * 5 *
7 * Permission to use, copy, modify, and distribute this software and its 6 * This program is free software; you can redistribute it and/or
8 * documentation is hereby granted, provided that the above copyright 7 * modify it under the terms of the GNU General Public License
9 * notice appears in all copies. This software is provided without any 8 * version 2 as published by the Free Software Foundation.
10 * warranty, express or implied. The Australian National University
11 * makes no representations about the suitability of this software for
12 * any purpose.
13 *
14 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
15 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
17 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
18 * OF SUCH DAMAGE.
19 *
20 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
21 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
23 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
24 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
25 * OR MODIFICATIONS.
26 */ 9 */
27
28/*
29 * ==FILEVERSION 980319==
30 *
31 * NOTE TO MAINTAINERS:
32 * If you modify this file at all, please set the above date.
33 * ppp-comp.h is shipped with a PPP distribution as well as with the kernel;
34 * if everyone increases the FILEVERSION number above, then scripts
35 * can do the right thing when deciding whether to install a new ppp-comp.h
36 * file. Don't change the format of that line otherwise, so the
37 * installation script can recognize it.
38 */
39
40#ifndef _NET_PPP_COMP_H 10#ifndef _NET_PPP_COMP_H
41#define _NET_PPP_COMP_H 11#define _NET_PPP_COMP_H
42 12
diff --git a/include/linux/ppp-ioctl.h b/include/linux/ppp-ioctl.h
new file mode 100644
index 000000000000..2d9a8859550a
--- /dev/null
+++ b/include/linux/ppp-ioctl.h
@@ -0,0 +1,119 @@
1/*
2 * ppp-ioctl.h - PPP ioctl definitions.
3 *
4 * Copyright 1999-2002 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 */
10#ifndef _PPP_IOCTL_H
11#define _PPP_IOCTL_H
12
13#include <linux/types.h>
14#include <linux/compiler.h>
15
16/*
17 * Bit definitions for flags argument to PPPIOCGFLAGS/PPPIOCSFLAGS.
18 */
19#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
20#define SC_COMP_AC 0x00000002 /* header compression (output) */
21#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
22#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
23#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
24#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
25#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
26#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
27#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
28#define SC_LOOP_TRAFFIC 0x00000200 /* send traffic to pppd */
29#define SC_MULTILINK 0x00000400 /* do multilink encapsulation */
30#define SC_MP_SHORTSEQ 0x00000800 /* use short MP sequence numbers */
31#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
32#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
33#define SC_MP_XSHORTSEQ 0x00004000 /* transmit short MP seq numbers */
34#define SC_DEBUG 0x00010000 /* enable debug messages */
35#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
36#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
37#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
38#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
39#define SC_SYNC 0x00200000 /* synchronous serial mode */
40#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
41#define SC_MASK 0x0f600fff /* bits that user can change */
42
43/* state bits */
44#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
45#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
46#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
47#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
48#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
49#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
50#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
51
52/* Used with PPPIOCGNPMODE/PPPIOCSNPMODE */
53struct npioctl {
54 int protocol; /* PPP protocol, e.g. PPP_IP */
55 enum NPmode mode;
56};
57
58/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
59struct ppp_option_data {
60 __u8 __user *ptr;
61 __u32 length;
62 int transmit;
63};
64
65/* For PPPIOCGL2TPSTATS */
66struct pppol2tp_ioc_stats {
67 __u16 tunnel_id; /* redundant */
68 __u16 session_id; /* if zero, get tunnel stats */
69 __u32 using_ipsec:1; /* valid only for session_id == 0 */
70 __aligned_u64 tx_packets;
71 __aligned_u64 tx_bytes;
72 __aligned_u64 tx_errors;
73 __aligned_u64 rx_packets;
74 __aligned_u64 rx_bytes;
75 __aligned_u64 rx_seq_discards;
76 __aligned_u64 rx_oos_packets;
77 __aligned_u64 rx_errors;
78};
79
80/*
81 * Ioctl definitions.
82 */
83
84#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
85#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
86#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
87#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
88#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
89#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
90#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
91#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
92#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
93#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
94#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
95#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
96#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
97#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
98#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
99#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
100#define PPPIOCSPASS _IOW('t', 71, struct sock_fprog) /* set pass filter */
101#define PPPIOCSACTIVE _IOW('t', 70, struct sock_fprog) /* set active filt */
102#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
103#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
104#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
105#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */
106#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */
107#define PPPIOCDETACH _IOW('t', 60, int) /* detach from ppp unit/chan */
108#define PPPIOCSMRRU _IOW('t', 59, int) /* set multilink MRU */
109#define PPPIOCCONNECT _IOW('t', 58, int) /* connect channel to unit */
110#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
111#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
112#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
113#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
114
115#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
116#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
117#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
118
119#endif /* _PPP_IOCTL_H */
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
index 0f93ed6b4a88..ba416f67eb62 100644
--- a/include/linux/ppp_defs.h
+++ b/include/linux/ppp_defs.h
@@ -1,44 +1,14 @@
1/* 1/*
2 * ppp_defs.h - PPP definitions. 2 * ppp_defs.h - PPP definitions.
3 * 3 *
4 * Copyright (c) 1994 The Australian National University. 4 * Copyright 1994-2000 Paul Mackerras.
5 * All rights reserved.
6 * 5 *
7 * Permission to use, copy, modify, and distribute this software and its 6 * This program is free software; you can redistribute it and/or
8 * documentation is hereby granted, provided that the above copyright 7 * modify it under the terms of the GNU General Public License
9 * notice appears in all copies. This software is provided without any 8 * version 2 as published by the Free Software Foundation.
10 * warranty, express or implied. The Australian National University
11 * makes no representations about the suitability of this software for
12 * any purpose.
13 *
14 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
15 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
17 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
18 * OF SUCH DAMAGE.
19 *
20 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
21 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
23 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
24 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
25 * OR MODIFICATIONS.
26 */ 9 */
27
28#include <linux/types.h> 10#include <linux/types.h>
29 11
30/*
31 * ==FILEVERSION 20000114==
32 *
33 * NOTE TO MAINTAINERS:
34 * If you modify this file at all, please set the above date.
35 * ppp_defs.h is shipped with a PPP distribution as well as with the kernel;
36 * if everyone increases the FILEVERSION number above, then scripts
37 * can do the right thing when deciding whether to install a new ppp_defs.h
38 * file. Don't change the format of that line otherwise, so the
39 * installation script can recognize it.
40 */
41
42#ifndef _PPP_DEFS_H_ 12#ifndef _PPP_DEFS_H_
43#define _PPP_DEFS_H_ 13#define _PPP_DEFS_H_
44 14
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index 2076acf8294d..b17d765ded84 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -20,6 +20,7 @@ struct sh_eth_plat_data {
20 unsigned char mac_addr[6]; 20 unsigned char mac_addr[6];
21 unsigned no_ether_link:1; 21 unsigned no_ether_link:1;
22 unsigned ether_link_active_low:1; 22 unsigned ether_link_active_low:1;
23 unsigned needs_init:1;
23}; 24};
24 25
25#endif 26#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ae86adee3746..a2b9953b582d 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -94,6 +94,13 @@
94 * about CHECKSUM_UNNECESSARY. 8) 94 * about CHECKSUM_UNNECESSARY. 8)
95 * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead. 95 * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
96 * 96 *
97 * UNNECESSARY: device will do per protocol specific csum. Protocol drivers
98 * that do not want net to perform the checksum calculation should use
99 * this flag in their outgoing skbs.
100 * NETIF_F_FCOE_CRC this indicates the device can do FCoE FC CRC
101 * offload. Correspondingly, the FCoE protocol driver
102 * stack should use CHECKSUM_UNNECESSARY.
103 *
97 * Any questions? No questions, good. --ANK 104 * Any questions? No questions, good. --ANK
98 */ 105 */
99 106
@@ -361,6 +368,7 @@ typedef unsigned char *sk_buff_data_t;
361 * ports. 368 * ports.
362 * @wifi_acked_valid: wifi_acked was set 369 * @wifi_acked_valid: wifi_acked was set
363 * @wifi_acked: whether frame was acked on wifi or not 370 * @wifi_acked: whether frame was acked on wifi or not
371 * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS
364 * @dma_cookie: a cookie to one of several possible DMA operations 372 * @dma_cookie: a cookie to one of several possible DMA operations
365 * done by skb DMA functions 373 * done by skb DMA functions
366 * @secmark: security marking 374 * @secmark: security marking
@@ -438,6 +446,11 @@ struct sk_buff {
438#endif 446#endif
439 447
440 int skb_iif; 448 int skb_iif;
449
450 __u32 rxhash;
451
452 __u16 vlan_tci;
453
441#ifdef CONFIG_NET_SCHED 454#ifdef CONFIG_NET_SCHED
442 __u16 tc_index; /* traffic control index */ 455 __u16 tc_index; /* traffic control index */
443#ifdef CONFIG_NET_CLS_ACT 456#ifdef CONFIG_NET_CLS_ACT
@@ -445,8 +458,6 @@ struct sk_buff {
445#endif 458#endif
446#endif 459#endif
447 460
448 __u32 rxhash;
449
450 __u16 queue_mapping; 461 __u16 queue_mapping;
451 kmemcheck_bitfield_begin(flags2); 462 kmemcheck_bitfield_begin(flags2);
452#ifdef CONFIG_IPV6_NDISC_NODETYPE 463#ifdef CONFIG_IPV6_NDISC_NODETYPE
@@ -456,7 +467,8 @@ struct sk_buff {
456 __u8 l4_rxhash:1; 467 __u8 l4_rxhash:1;
457 __u8 wifi_acked_valid:1; 468 __u8 wifi_acked_valid:1;
458 __u8 wifi_acked:1; 469 __u8 wifi_acked:1;
459 /* 10/12 bit hole (depending on ndisc_nodetype presence) */ 470 __u8 no_fcs:1;
471 /* 9/11 bit hole (depending on ndisc_nodetype presence) */
460 kmemcheck_bitfield_end(flags2); 472 kmemcheck_bitfield_end(flags2);
461 473
462#ifdef CONFIG_NET_DMA 474#ifdef CONFIG_NET_DMA
@@ -470,8 +482,6 @@ struct sk_buff {
470 __u32 dropcount; 482 __u32 dropcount;
471 }; 483 };
472 484
473 __u16 vlan_tci;
474
475 sk_buff_data_t transport_header; 485 sk_buff_data_t transport_header;
476 sk_buff_data_t network_header; 486 sk_buff_data_t network_header;
477 sk_buff_data_t mac_header; 487 sk_buff_data_t mac_header;
@@ -876,6 +886,24 @@ static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_)
876} 886}
877 887
878/** 888/**
889 * skb_peek_next - peek skb following the given one from a queue
890 * @skb: skb to start from
891 * @list_: list to peek at
892 *
893 * Returns %NULL when the end of the list is met or a pointer to the
894 * next element. The reference count is not incremented and the
895 * reference is therefore volatile. Use with caution.
896 */
897static inline struct sk_buff *skb_peek_next(struct sk_buff *skb,
898 const struct sk_buff_head *list_)
899{
900 struct sk_buff *next = skb->next;
901 if (next == (struct sk_buff *)list_)
902 next = NULL;
903 return next;
904}
905
906/**
879 * skb_peek_tail - peek at the tail of an &sk_buff_head 907 * skb_peek_tail - peek at the tail of an &sk_buff_head
880 * @list_: list to peek at 908 * @list_: list to peek at
881 * 909 *
@@ -1152,7 +1180,7 @@ static inline struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list)
1152} 1180}
1153 1181
1154 1182
1155static inline int skb_is_nonlinear(const struct sk_buff *skb) 1183static inline bool skb_is_nonlinear(const struct sk_buff *skb)
1156{ 1184{
1157 return skb->data_len; 1185 return skb->data_len;
1158} 1186}
@@ -2055,7 +2083,7 @@ static inline void skb_frag_add_head(struct sk_buff *skb, struct sk_buff *frag)
2055 for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next) 2083 for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)
2056 2084
2057extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, 2085extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
2058 int *peeked, int *err); 2086 int *peeked, int *off, int *err);
2059extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, 2087extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
2060 int noblock, int *err); 2088 int noblock, int *err);
2061extern unsigned int datagram_poll(struct file *file, struct socket *sock, 2089extern unsigned int datagram_poll(struct file *file, struct socket *sock,
@@ -2448,12 +2476,12 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
2448} 2476}
2449#endif 2477#endif
2450 2478
2451static inline int skb_is_gso(const struct sk_buff *skb) 2479static inline bool skb_is_gso(const struct sk_buff *skb)
2452{ 2480{
2453 return skb_shinfo(skb)->gso_size; 2481 return skb_shinfo(skb)->gso_size;
2454} 2482}
2455 2483
2456static inline int skb_is_gso_v6(const struct sk_buff *skb) 2484static inline bool skb_is_gso_v6(const struct sk_buff *skb)
2457{ 2485{
2458 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; 2486 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6;
2459} 2487}
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index c1241c428179..2e68f5ba0389 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -232,6 +232,8 @@ enum
232 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */ 232 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */
233 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */ 233 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
234 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */ 234 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
235 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */
236 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */
235 __LINUX_MIB_MAX 237 __LINUX_MIB_MAX
236}; 238};
237 239
diff --git a/include/linux/socket.h b/include/linux/socket.h
index d0e77f607a79..da2d3e2543f3 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -326,11 +326,11 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
326 int offset, 326 int offset,
327 unsigned int len, __wsum *csump); 327 unsigned int len, __wsum *csump);
328 328
329extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); 329extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *address, int mode);
330extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 330extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
331extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, 331extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
332 int offset, int len); 332 int offset, int len);
333extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); 333extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr);
334extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); 334extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
335 335
336struct timespec; 336struct timespec;
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index dcf35b0f303a..d27683180025 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -16,6 +16,12 @@ struct pcmcia_device;
16struct ssb_bus; 16struct ssb_bus;
17struct ssb_driver; 17struct ssb_driver;
18 18
19struct ssb_sprom_core_pwr_info {
20 u8 itssi_2g, itssi_5g;
21 u8 maxpwr_2g, maxpwr_5gl, maxpwr_5g, maxpwr_5gh;
22 u16 pa_2g[4], pa_5gl[4], pa_5g[4], pa_5gh[4];
23};
24
19struct ssb_sprom { 25struct ssb_sprom {
20 u8 revision; 26 u8 revision;
21 u8 il0mac[6]; /* MAC address for 802.11b/g */ 27 u8 il0mac[6]; /* MAC address for 802.11b/g */
@@ -26,9 +32,12 @@ struct ssb_sprom {
26 u8 et0mdcport; /* MDIO for enet0 */ 32 u8 et0mdcport; /* MDIO for enet0 */
27 u8 et1mdcport; /* MDIO for enet1 */ 33 u8 et1mdcport; /* MDIO for enet1 */
28 u16 board_rev; /* Board revision number from SPROM. */ 34 u16 board_rev; /* Board revision number from SPROM. */
35 u16 board_num; /* Board number from SPROM. */
36 u16 board_type; /* Board type from SPROM. */
29 u8 country_code; /* Country Code */ 37 u8 country_code; /* Country Code */
30 u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */ 38 char alpha2[2]; /* Country Code as two chars like EU or US */
31 u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */ 39 u8 leddc_on_time; /* LED Powersave Duty Cycle On Count */
40 u8 leddc_off_time; /* LED Powersave Duty Cycle Off Count */
32 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */ 41 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */
33 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */ 42 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */
34 u16 pa0b0; 43 u16 pa0b0;
@@ -47,10 +56,10 @@ struct ssb_sprom {
47 u8 gpio1; /* GPIO pin 1 */ 56 u8 gpio1; /* GPIO pin 1 */
48 u8 gpio2; /* GPIO pin 2 */ 57 u8 gpio2; /* GPIO pin 2 */
49 u8 gpio3; /* GPIO pin 3 */ 58 u8 gpio3; /* GPIO pin 3 */
50 u16 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */ 59 u8 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */
51 u16 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */ 60 u8 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */
52 u16 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */ 61 u8 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */
53 u16 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */ 62 u8 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */
54 u8 itssi_a; /* Idle TSSI Target for A-PHY */ 63 u8 itssi_a; /* Idle TSSI Target for A-PHY */
55 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ 64 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */
56 u8 tri2g; /* 2.4GHz TX isolation */ 65 u8 tri2g; /* 2.4GHz TX isolation */
@@ -61,8 +70,8 @@ struct ssb_sprom {
61 u8 txpid5gl[4]; /* 4.9 - 5.1GHz TX power index */ 70 u8 txpid5gl[4]; /* 4.9 - 5.1GHz TX power index */
62 u8 txpid5g[4]; /* 5.1 - 5.5GHz TX power index */ 71 u8 txpid5g[4]; /* 5.1 - 5.5GHz TX power index */
63 u8 txpid5gh[4]; /* 5.5 - ...GHz TX power index */ 72 u8 txpid5gh[4]; /* 5.5 - ...GHz TX power index */
64 u8 rxpo2g; /* 2GHz RX power offset */ 73 s8 rxpo2g; /* 2GHz RX power offset */
65 u8 rxpo5g; /* 5GHz RX power offset */ 74 s8 rxpo5g; /* 5GHz RX power offset */
66 u8 rssisav2g; /* 2GHz RSSI params */ 75 u8 rssisav2g; /* 2GHz RSSI params */
67 u8 rssismc2g; 76 u8 rssismc2g;
68 u8 rssismf2g; 77 u8 rssismf2g;
@@ -82,16 +91,13 @@ struct ssb_sprom {
82 u16 boardflags2_hi; /* Board flags (bits 48-63) */ 91 u16 boardflags2_hi; /* Board flags (bits 48-63) */
83 /* TODO store board flags in a single u64 */ 92 /* TODO store board flags in a single u64 */
84 93
94 struct ssb_sprom_core_pwr_info core_pwr_info[4];
95
85 /* Antenna gain values for up to 4 antennas 96 /* Antenna gain values for up to 4 antennas
86 * on each band. Values in dBm/4 (Q5.2). Negative gain means the 97 * on each band. Values in dBm/4 (Q5.2). Negative gain means the
87 * loss in the connectors is bigger than the gain. */ 98 * loss in the connectors is bigger than the gain. */
88 struct { 99 struct {
89 struct { 100 s8 a0, a1, a2, a3;
90 s8 a0, a1, a2, a3;
91 } ghz24; /* 2.4GHz band */
92 struct {
93 s8 a0, a1, a2, a3;
94 } ghz5; /* 5GHz band */
95 } antenna_gain; 101 } antenna_gain;
96 102
97 struct { 103 struct {
@@ -103,7 +109,79 @@ struct ssb_sprom {
103 } ghz5; 109 } ghz5;
104 } fem; 110 } fem;
105 111
106 /* TODO - add any parameters needed from rev 2, 3, 4, 5 or 8 SPROMs */ 112 u16 mcs2gpo[8];
113 u16 mcs5gpo[8];
114 u16 mcs5glpo[8];
115 u16 mcs5ghpo[8];
116 u8 opo;
117
118 u8 rxgainerr2ga[3];
119 u8 rxgainerr5gla[3];
120 u8 rxgainerr5gma[3];
121 u8 rxgainerr5gha[3];
122 u8 rxgainerr5gua[3];
123
124 u8 noiselvl2ga[3];
125 u8 noiselvl5gla[3];
126 u8 noiselvl5gma[3];
127 u8 noiselvl5gha[3];
128 u8 noiselvl5gua[3];
129
130 u8 regrev;
131 u8 txchain;
132 u8 rxchain;
133 u8 antswitch;
134 u16 cddpo;
135 u16 stbcpo;
136 u16 bw40po;
137 u16 bwduppo;
138
139 u8 tempthresh;
140 u8 tempoffset;
141 u16 rawtempsense;
142 u8 measpower;
143 u8 tempsense_slope;
144 u8 tempcorrx;
145 u8 tempsense_option;
146 u8 freqoffset_corr;
147 u8 iqcal_swp_dis;
148 u8 hw_iqcal_en;
149 u8 elna2g;
150 u8 elna5g;
151 u8 phycal_tempdelta;
152 u8 temps_period;
153 u8 temps_hysteresis;
154 u8 measpower1;
155 u8 measpower2;
156 u8 pcieingress_war;
157
158 /* power per rate from sromrev 9 */
159 u16 cckbw202gpo;
160 u16 cckbw20ul2gpo;
161 u32 legofdmbw202gpo;
162 u32 legofdmbw20ul2gpo;
163 u32 legofdmbw205glpo;
164 u32 legofdmbw20ul5glpo;
165 u32 legofdmbw205gmpo;
166 u32 legofdmbw20ul5gmpo;
167 u32 legofdmbw205ghpo;
168 u32 legofdmbw20ul5ghpo;
169 u32 mcsbw202gpo;
170 u32 mcsbw20ul2gpo;
171 u32 mcsbw402gpo;
172 u32 mcsbw205glpo;
173 u32 mcsbw20ul5glpo;
174 u32 mcsbw405glpo;
175 u32 mcsbw205gmpo;
176 u32 mcsbw20ul5gmpo;
177 u32 mcsbw405gmpo;
178 u32 mcsbw205ghpo;
179 u32 mcsbw20ul5ghpo;
180 u32 mcsbw405ghpo;
181 u16 mcs32po;
182 u16 legofdm40duppo;
183 u8 sar2g;
184 u8 sar5g;
107}; 185};
108 186
109/* Information about the PCB the circuitry is soldered on. */ 187/* Information about the PCB the circuitry is soldered on. */
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index c814ae6eeb22..40b1ef8595ee 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -449,6 +449,39 @@
449#define SSB_SPROM8_TS_SLP_OPT_CORRX 0x00B6 449#define SSB_SPROM8_TS_SLP_OPT_CORRX 0x00B6
450#define SSB_SPROM8_FOC_HWIQ_IQSWP 0x00B8 450#define SSB_SPROM8_FOC_HWIQ_IQSWP 0x00B8
451#define SSB_SPROM8_PHYCAL_TEMPDELTA 0x00BA 451#define SSB_SPROM8_PHYCAL_TEMPDELTA 0x00BA
452
453/* There are 4 blocks with power info sharing the same layout */
454#define SSB_SROM8_PWR_INFO_CORE0 0x00C0
455#define SSB_SROM8_PWR_INFO_CORE1 0x00E0
456#define SSB_SROM8_PWR_INFO_CORE2 0x0100
457#define SSB_SROM8_PWR_INFO_CORE3 0x0120
458
459#define SSB_SROM8_2G_MAXP_ITSSI 0x00
460#define SSB_SPROM8_2G_MAXP 0x00FF
461#define SSB_SPROM8_2G_ITSSI 0xFF00
462#define SSB_SPROM8_2G_ITSSI_SHIFT 8
463#define SSB_SROM8_2G_PA_0 0x02 /* 2GHz power amp settings */
464#define SSB_SROM8_2G_PA_1 0x04
465#define SSB_SROM8_2G_PA_2 0x06
466#define SSB_SROM8_5G_MAXP_ITSSI 0x08 /* 5GHz ITSSI and 5.3GHz Max Power */
467#define SSB_SPROM8_5G_MAXP 0x00FF
468#define SSB_SPROM8_5G_ITSSI 0xFF00
469#define SSB_SPROM8_5G_ITSSI_SHIFT 8
470#define SSB_SPROM8_5GHL_MAXP 0x0A /* 5.2GHz and 5.8GHz Max Power */
471#define SSB_SPROM8_5GH_MAXP 0x00FF
472#define SSB_SPROM8_5GL_MAXP 0xFF00
473#define SSB_SPROM8_5GL_MAXP_SHIFT 8
474#define SSB_SROM8_5G_PA_0 0x0C /* 5.3GHz power amp settings */
475#define SSB_SROM8_5G_PA_1 0x0E
476#define SSB_SROM8_5G_PA_2 0x10
477#define SSB_SROM8_5GL_PA_0 0x12 /* 5.2GHz power amp settings */
478#define SSB_SROM8_5GL_PA_1 0x14
479#define SSB_SROM8_5GL_PA_2 0x16
480#define SSB_SROM8_5GH_PA_0 0x18 /* 5.8GHz power amp settings */
481#define SSB_SROM8_5GH_PA_1 0x1A
482#define SSB_SROM8_5GH_PA_2 0x1C
483
484/* TODO: Make it deprecated */
452#define SSB_SPROM8_MAXP_BG 0x00C0 /* Max Power 2GHz in path 1 */ 485#define SSB_SPROM8_MAXP_BG 0x00C0 /* Max Power 2GHz in path 1 */
453#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */ 486#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */
454#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ 487#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */
@@ -473,6 +506,7 @@
473#define SSB_SPROM8_PA1HIB0 0x00D8 /* 5.8GHz power amp settings */ 506#define SSB_SPROM8_PA1HIB0 0x00D8 /* 5.8GHz power amp settings */
474#define SSB_SPROM8_PA1HIB1 0x00DA 507#define SSB_SPROM8_PA1HIB1 0x00DA
475#define SSB_SPROM8_PA1HIB2 0x00DC 508#define SSB_SPROM8_PA1HIB2 0x00DC
509
476#define SSB_SPROM8_CCK2GPO 0x0140 /* CCK power offset */ 510#define SSB_SPROM8_CCK2GPO 0x0140 /* CCK power offset */
477#define SSB_SPROM8_OFDM2GPO 0x0142 /* 2.4GHz OFDM power offset */ 511#define SSB_SPROM8_OFDM2GPO 0x0142 /* 2.4GHz OFDM power offset */
478#define SSB_SPROM8_OFDM5GPO 0x0146 /* 5.3GHz OFDM power offset */ 512#define SSB_SPROM8_OFDM5GPO 0x0146 /* 5.3GHz OFDM power offset */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 3c7ffdb40dc6..b6c62d294380 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -464,7 +464,7 @@ struct tcp_sock {
464 const struct tcp_sock_af_ops *af_specific; 464 const struct tcp_sock_af_ops *af_specific;
465 465
466/* TCP MD5 Signature Option information */ 466/* TCP MD5 Signature Option information */
467 struct tcp_md5sig_info *md5sig_info; 467 struct tcp_md5sig_info __rcu *md5sig_info;
468#endif 468#endif
469 469
470 /* When the cookie options are generated and exchanged, then this 470 /* When the cookie options are generated and exchanged, then this
@@ -487,8 +487,7 @@ struct tcp_timewait_sock {
487 u32 tw_ts_recent; 487 u32 tw_ts_recent;
488 long tw_ts_recent_stamp; 488 long tw_ts_recent_stamp;
489#ifdef CONFIG_TCP_MD5SIG 489#ifdef CONFIG_TCP_MD5SIG
490 u16 tw_md5_keylen; 490 struct tcp_md5sig_key *tw_md5_key;
491 u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN];
492#endif 491#endif
493 /* Few sockets in timewait have cookies; in that case, then this 492 /* Few sockets in timewait have cookies; in that case, then this
494 * object holds a reference to them (tw_cookie_values->kref). 493 * object holds a reference to them (tw_cookie_values->kref).
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index f68dce2d8d88..757a17638b1b 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -160,7 +160,6 @@ extern void addrconf_prefix_rcv(struct net_device *dev,
160extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr); 160extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr);
161extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr); 161extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr);
162extern void ipv6_sock_ac_close(struct sock *sk); 162extern void ipv6_sock_ac_close(struct sock *sk);
163extern int inet6_ac_check(struct sock *sk, const struct in6_addr *addr, int ifindex);
164 163
165extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); 164extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
166extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); 165extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
diff --git a/include/net/arp.h b/include/net/arp.h
index 0013dc87940b..4a1f3fb562eb 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -15,14 +15,14 @@ static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd
15 return val * hash_rnd; 15 return val * hash_rnd;
16} 16}
17 17
18static inline struct neighbour *__ipv4_neigh_lookup(struct neigh_table *tbl, struct net_device *dev, u32 key) 18static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32 key)
19{ 19{
20 struct neigh_hash_table *nht; 20 struct neigh_hash_table *nht;
21 struct neighbour *n; 21 struct neighbour *n;
22 u32 hash_val; 22 u32 hash_val;
23 23
24 rcu_read_lock_bh(); 24 rcu_read_lock_bh();
25 nht = rcu_dereference_bh(tbl->nht); 25 nht = rcu_dereference_bh(arp_tbl.nht);
26 hash_val = arp_hashfn(key, dev, nht->hash_rnd[0]) >> (32 - nht->hash_shift); 26 hash_val = arp_hashfn(key, dev, nht->hash_rnd[0]) >> (32 - nht->hash_shift);
27 for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]); 27 for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]);
28 n != NULL; 28 n != NULL;
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 4a82ca0bb0b2..262ebd1747d4 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -109,12 +109,14 @@ struct bt_power {
109 */ 109 */
110#define BT_CHANNEL_POLICY_AMP_PREFERRED 2 110#define BT_CHANNEL_POLICY_AMP_PREFERRED 2
111 111
112__printf(2, 3) 112__printf(1, 2)
113int bt_printk(const char *level, const char *fmt, ...); 113int bt_info(const char *fmt, ...);
114__printf(1, 2)
115int bt_err(const char *fmt, ...);
114 116
115#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg) 117#define BT_INFO(fmt, ...) bt_info(fmt "\n", ##__VA_ARGS__)
116#define BT_ERR(fmt, arg...) bt_printk(KERN_ERR, pr_fmt(fmt), ##arg) 118#define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__)
117#define BT_DBG(fmt, arg...) pr_debug(fmt "\n", ##arg) 119#define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__)
118 120
119/* Connection and socket states */ 121/* Connection and socket states */
120enum { 122enum {
@@ -129,6 +131,33 @@ enum {
129 BT_CLOSED 131 BT_CLOSED
130}; 132};
131 133
134/* If unused will be removed by compiler */
135static inline const char *state_to_string(int state)
136{
137 switch (state) {
138 case BT_CONNECTED:
139 return "BT_CONNECTED";
140 case BT_OPEN:
141 return "BT_OPEN";
142 case BT_BOUND:
143 return "BT_BOUND";
144 case BT_LISTEN:
145 return "BT_LISTEN";
146 case BT_CONNECT:
147 return "BT_CONNECT";
148 case BT_CONNECT2:
149 return "BT_CONNECT2";
150 case BT_CONFIG:
151 return "BT_CONFIG";
152 case BT_DISCONN:
153 return "BT_DISCONN";
154 case BT_CLOSED:
155 return "BT_CLOSED";
156 }
157
158 return "invalid state";
159}
160
132/* BD Address */ 161/* BD Address */
133typedef struct { 162typedef struct {
134 __u8 b[6]; 163 __u8 b[6];
@@ -193,7 +222,6 @@ struct bt_skb_cb {
193 __u16 tx_seq; 222 __u16 tx_seq;
194 __u8 retries; 223 __u8 retries;
195 __u8 sar; 224 __u8 sar;
196 unsigned short channel;
197 __u8 force_active; 225 __u8 force_active;
198}; 226};
199#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) 227#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 00596e816b4d..344b0f972828 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -77,14 +77,6 @@ enum {
77 77
78 HCI_RAW, 78 HCI_RAW,
79 79
80 HCI_SETUP,
81 HCI_AUTO_OFF,
82 HCI_MGMT,
83 HCI_PAIRABLE,
84 HCI_SERVICE_CACHE,
85 HCI_LINK_KEYS,
86 HCI_DEBUG_KEYS,
87
88 HCI_RESET, 80 HCI_RESET,
89}; 81};
90 82
@@ -93,7 +85,22 @@ enum {
93 * states from the controller. 85 * states from the controller.
94 */ 86 */
95enum { 87enum {
88 HCI_SETUP,
89 HCI_AUTO_OFF,
90 HCI_MGMT,
91 HCI_PAIRABLE,
92 HCI_SERVICE_CACHE,
93 HCI_LINK_KEYS,
94 HCI_DEBUG_KEYS,
95
96 HCI_LE_SCAN, 96 HCI_LE_SCAN,
97 HCI_SSP_ENABLED,
98 HCI_HS_ENABLED,
99 HCI_LE_ENABLED,
100 HCI_CONNECTABLE,
101 HCI_DISCOVERABLE,
102 HCI_LINK_SECURITY,
103 HCI_PENDING_CLASS,
97}; 104};
98 105
99/* HCI ioctl defines */ 106/* HCI ioctl defines */
@@ -130,6 +137,7 @@ enum {
130#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ 137#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */
131#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ 138#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */
132#define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ 139#define HCI_CMD_TIMEOUT (1000) /* 1 seconds */
140#define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */
133 141
134/* HCI data types */ 142/* HCI data types */
135#define HCI_COMMAND_PKT 0x01 143#define HCI_COMMAND_PKT 0x01
@@ -229,7 +237,9 @@ enum {
229#define LMP_EXTFEATURES 0x80 237#define LMP_EXTFEATURES 0x80
230 238
231/* Extended LMP features */ 239/* Extended LMP features */
232#define LMP_HOST_LE 0x02 240#define LMP_HOST_SSP 0x01
241#define LMP_HOST_LE 0x02
242#define LMP_HOST_LE_BREDR 0x04
233 243
234/* Connection modes */ 244/* Connection modes */
235#define HCI_CM_ACTIVE 0x0000 245#define HCI_CM_ACTIVE 0x0000
@@ -268,10 +278,11 @@ enum {
268#define HCI_LK_UNAUTH_COMBINATION 0x04 278#define HCI_LK_UNAUTH_COMBINATION 0x04
269#define HCI_LK_AUTH_COMBINATION 0x05 279#define HCI_LK_AUTH_COMBINATION 0x05
270#define HCI_LK_CHANGED_COMBINATION 0x06 280#define HCI_LK_CHANGED_COMBINATION 0x06
271/* The spec doesn't define types for SMP keys */ 281/* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */
272#define HCI_LK_SMP_LTK 0x81 282#define HCI_SMP_STK 0x80
273#define HCI_LK_SMP_IRK 0x82 283#define HCI_SMP_STK_SLAVE 0x81
274#define HCI_LK_SMP_CSRK 0x83 284#define HCI_SMP_LTK 0x82
285#define HCI_SMP_LTK_SLAVE 0x83
275 286
276/* ---- HCI Error Codes ---- */ 287/* ---- HCI Error Codes ---- */
277#define HCI_ERROR_AUTH_FAILURE 0x05 288#define HCI_ERROR_AUTH_FAILURE 0x05
@@ -284,6 +295,22 @@ enum {
284#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 295#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00
285#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 296#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01
286 297
298/* Extended Inquiry Response field types */
299#define EIR_FLAGS 0x01 /* flags */
300#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */
301#define EIR_UUID16_ALL 0x03 /* 16-bit UUID, all listed */
302#define EIR_UUID32_SOME 0x04 /* 32-bit UUID, more available */
303#define EIR_UUID32_ALL 0x05 /* 32-bit UUID, all listed */
304#define EIR_UUID128_SOME 0x06 /* 128-bit UUID, more available */
305#define EIR_UUID128_ALL 0x07 /* 128-bit UUID, all listed */
306#define EIR_NAME_SHORT 0x08 /* shortened local name */
307#define EIR_NAME_COMPLETE 0x09 /* complete local name */
308#define EIR_TX_POWER 0x0A /* transmit power level */
309#define EIR_CLASS_OF_DEV 0x0D /* Class of Device */
310#define EIR_SSP_HASH_C 0x0E /* Simple Pairing Hash C */
311#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */
312#define EIR_DEVICE_ID 0x10 /* device ID */
313
287/* ----- HCI Commands ---- */ 314/* ----- HCI Commands ---- */
288#define HCI_OP_NOP 0x0000 315#define HCI_OP_NOP 0x0000
289 316
@@ -666,8 +693,8 @@ struct hci_cp_host_buffer_size {
666 693
667#define HCI_OP_WRITE_EIR 0x0c52 694#define HCI_OP_WRITE_EIR 0x0c52
668struct hci_cp_write_eir { 695struct hci_cp_write_eir {
669 uint8_t fec; 696 __u8 fec;
670 uint8_t data[HCI_MAX_EIR_LENGTH]; 697 __u8 data[HCI_MAX_EIR_LENGTH];
671} __packed; 698} __packed;
672 699
673#define HCI_OP_READ_SSP_MODE 0x0c55 700#define HCI_OP_READ_SSP_MODE 0x0c55
@@ -698,8 +725,8 @@ struct hci_rp_read_flow_control_mode {
698 725
699#define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d 726#define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d
700struct hci_cp_write_le_host_supported { 727struct hci_cp_write_le_host_supported {
701 __u8 le; 728 __u8 le;
702 __u8 simul; 729 __u8 simul;
703} __packed; 730} __packed;
704 731
705#define HCI_OP_READ_LOCAL_VERSION 0x1001 732#define HCI_OP_READ_LOCAL_VERSION 0x1001
@@ -1155,6 +1182,19 @@ struct hci_ev_le_meta {
1155 __u8 subevent; 1182 __u8 subevent;
1156} __packed; 1183} __packed;
1157 1184
1185#define HCI_EV_NUM_COMP_BLOCKS 0x48
1186struct hci_comp_blocks_info {
1187 __le16 handle;
1188 __le16 pkts;
1189 __le16 blocks;
1190} __packed;
1191
1192struct hci_ev_num_comp_blocks {
1193 __le16 num_blocks;
1194 __u8 num_hndl;
1195 struct hci_comp_blocks_info handles[0];
1196} __packed;
1197
1158/* Low energy meta events */ 1198/* Low energy meta events */
1159#define HCI_EV_LE_CONN_COMPLETE 0x01 1199#define HCI_EV_LE_CONN_COMPLETE 0x01
1160struct hci_ev_le_conn_complete { 1200struct hci_ev_le_conn_complete {
@@ -1288,6 +1328,7 @@ struct sockaddr_hci {
1288 1328
1289#define HCI_CHANNEL_RAW 0 1329#define HCI_CHANNEL_RAW 0
1290#define HCI_CHANNEL_CONTROL 1 1330#define HCI_CHANNEL_CONTROL 1
1331#define HCI_CHANNEL_MONITOR 2
1291 1332
1292struct hci_filter { 1333struct hci_filter {
1293 unsigned long type_mask; 1334 unsigned long type_mask;
@@ -1389,5 +1430,6 @@ struct hci_inquiry_req {
1389#define IREQ_CACHE_FLUSH 0x0001 1430#define IREQ_CACHE_FLUSH 0x0001
1390 1431
1391extern bool enable_hs; 1432extern bool enable_hs;
1433extern bool enable_le;
1392 1434
1393#endif /* __HCI_H */ 1435#endif /* __HCI_H */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 453893b3120e..daefaac51131 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -44,14 +44,31 @@ struct inquiry_data {
44}; 44};
45 45
46struct inquiry_entry { 46struct inquiry_entry {
47 struct inquiry_entry *next; 47 struct list_head all; /* inq_cache.all */
48 struct list_head list; /* unknown or resolve */
49 enum {
50 NAME_NOT_KNOWN,
51 NAME_NEEDED,
52 NAME_PENDING,
53 NAME_KNOWN,
54 } name_state;
48 __u32 timestamp; 55 __u32 timestamp;
49 struct inquiry_data data; 56 struct inquiry_data data;
50}; 57};
51 58
52struct inquiry_cache { 59struct discovery_state {
60 int type;
61 enum {
62 DISCOVERY_STOPPED,
63 DISCOVERY_STARTING,
64 DISCOVERY_FINDING,
65 DISCOVERY_RESOLVING,
66 DISCOVERY_STOPPING,
67 } state;
68 struct list_head all; /* All devices found during inquiry */
69 struct list_head unknown; /* Name state not known */
70 struct list_head resolve; /* Name needs to be resolved */
53 __u32 timestamp; 71 __u32 timestamp;
54 struct inquiry_entry *list;
55}; 72};
56 73
57struct hci_conn_hash { 74struct hci_conn_hash {
@@ -72,18 +89,16 @@ struct bt_uuid {
72 u8 svc_hint; 89 u8 svc_hint;
73}; 90};
74 91
75struct key_master_id { 92struct smp_ltk {
76 __le16 ediv; 93 struct list_head list;
77 u8 rand[8];
78} __packed;
79
80struct link_key_data {
81 bdaddr_t bdaddr; 94 bdaddr_t bdaddr;
95 u8 bdaddr_type;
96 u8 authenticated;
82 u8 type; 97 u8 type;
98 u8 enc_size;
99 __le16 ediv;
100 u8 rand[8];
83 u8 val[16]; 101 u8 val[16];
84 u8 pin_len;
85 u8 dlen;
86 u8 data[0];
87} __packed; 102} __packed;
88 103
89struct link_key { 104struct link_key {
@@ -92,8 +107,6 @@ struct link_key {
92 u8 type; 107 u8 type;
93 u8 val[16]; 108 u8 val[16];
94 u8 pin_len; 109 u8 pin_len;
95 u8 dlen;
96 u8 data[0];
97}; 110};
98 111
99struct oob_data { 112struct oob_data {
@@ -109,11 +122,19 @@ struct adv_entry {
109 u8 bdaddr_type; 122 u8 bdaddr_type;
110}; 123};
111 124
125struct le_scan_params {
126 u8 type;
127 u16 interval;
128 u16 window;
129 int timeout;
130};
131
132#define HCI_MAX_SHORT_NAME_LENGTH 10
133
112#define NUM_REASSEMBLY 4 134#define NUM_REASSEMBLY 4
113struct hci_dev { 135struct hci_dev {
114 struct list_head list; 136 struct list_head list;
115 struct mutex lock; 137 struct mutex lock;
116 atomic_t refcnt;
117 138
118 char name[8]; 139 char name[8];
119 unsigned long flags; 140 unsigned long flags;
@@ -122,6 +143,7 @@ struct hci_dev {
122 __u8 dev_type; 143 __u8 dev_type;
123 bdaddr_t bdaddr; 144 bdaddr_t bdaddr;
124 __u8 dev_name[HCI_MAX_NAME_LENGTH]; 145 __u8 dev_name[HCI_MAX_NAME_LENGTH];
146 __u8 short_name[HCI_MAX_SHORT_NAME_LENGTH];
125 __u8 eir[HCI_MAX_EIR_LENGTH]; 147 __u8 eir[HCI_MAX_EIR_LENGTH];
126 __u8 dev_class[3]; 148 __u8 dev_class[3];
127 __u8 major_class; 149 __u8 major_class;
@@ -129,7 +151,6 @@ struct hci_dev {
129 __u8 features[8]; 151 __u8 features[8];
130 __u8 host_features[8]; 152 __u8 host_features[8];
131 __u8 commands[64]; 153 __u8 commands[64];
132 __u8 ssp_mode;
133 __u8 hci_ver; 154 __u8 hci_ver;
134 __u16 hci_rev; 155 __u16 hci_rev;
135 __u8 lmp_ver; 156 __u8 lmp_ver;
@@ -217,7 +238,7 @@ struct hci_dev {
217 238
218 struct list_head mgmt_pending; 239 struct list_head mgmt_pending;
219 240
220 struct inquiry_cache inq_cache; 241 struct discovery_state discovery;
221 struct hci_conn_hash conn_hash; 242 struct hci_conn_hash conn_hash;
222 struct list_head blacklist; 243 struct list_head blacklist;
223 244
@@ -225,6 +246,8 @@ struct hci_dev {
225 246
226 struct list_head link_keys; 247 struct list_head link_keys;
227 248
249 struct list_head long_term_keys;
250
228 struct list_head remote_oob_data; 251 struct list_head remote_oob_data;
229 252
230 struct list_head adv_entries; 253 struct list_head adv_entries;
@@ -234,7 +257,6 @@ struct hci_dev {
234 257
235 struct sk_buff_head driver_init; 258 struct sk_buff_head driver_init;
236 259
237 void *driver_data;
238 void *core_data; 260 void *core_data;
239 261
240 atomic_t promisc; 262 atomic_t promisc;
@@ -246,15 +268,17 @@ struct hci_dev {
246 268
247 struct rfkill *rfkill; 269 struct rfkill *rfkill;
248 270
249 struct module *owner;
250
251 unsigned long dev_flags; 271 unsigned long dev_flags;
252 272
273 struct delayed_work le_scan_disable;
274
275 struct work_struct le_scan;
276 struct le_scan_params le_scan_params;
277
253 int (*open)(struct hci_dev *hdev); 278 int (*open)(struct hci_dev *hdev);
254 int (*close)(struct hci_dev *hdev); 279 int (*close)(struct hci_dev *hdev);
255 int (*flush)(struct hci_dev *hdev); 280 int (*flush)(struct hci_dev *hdev);
256 int (*send)(struct sk_buff *skb); 281 int (*send)(struct sk_buff *skb);
257 void (*destruct)(struct hci_dev *hdev);
258 void (*notify)(struct hci_dev *hdev, unsigned int evt); 282 void (*notify)(struct hci_dev *hdev, unsigned int evt);
259 int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); 283 int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
260}; 284};
@@ -270,11 +294,10 @@ struct hci_conn {
270 __u16 state; 294 __u16 state;
271 __u8 mode; 295 __u8 mode;
272 __u8 type; 296 __u8 type;
273 __u8 out; 297 bool out;
274 __u8 attempt; 298 __u8 attempt;
275 __u8 dev_class[3]; 299 __u8 dev_class[3];
276 __u8 features[8]; 300 __u8 features[8];
277 __u8 ssp_mode;
278 __u16 interval; 301 __u16 interval;
279 __u16 pkt_type; 302 __u16 pkt_type;
280 __u16 link_policy; 303 __u16 link_policy;
@@ -286,12 +309,10 @@ struct hci_conn {
286 __u8 pin_length; 309 __u8 pin_length;
287 __u8 enc_key_size; 310 __u8 enc_key_size;
288 __u8 io_capability; 311 __u8 io_capability;
289 __u8 power_save;
290 __u16 disc_timeout; 312 __u16 disc_timeout;
291 unsigned long pend; 313 unsigned long flags;
292 314
293 __u8 remote_cap; 315 __u8 remote_cap;
294 __u8 remote_oob;
295 __u8 remote_auth; 316 __u8 remote_auth;
296 317
297 unsigned int sent; 318 unsigned int sent;
@@ -348,21 +369,26 @@ extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb);
348#define INQUIRY_CACHE_AGE_MAX (HZ*30) /* 30 seconds */ 369#define INQUIRY_CACHE_AGE_MAX (HZ*30) /* 30 seconds */
349#define INQUIRY_ENTRY_AGE_MAX (HZ*60) /* 60 seconds */ 370#define INQUIRY_ENTRY_AGE_MAX (HZ*60) /* 60 seconds */
350 371
351static inline void inquiry_cache_init(struct hci_dev *hdev) 372static inline void discovery_init(struct hci_dev *hdev)
352{ 373{
353 struct inquiry_cache *c = &hdev->inq_cache; 374 hdev->discovery.state = DISCOVERY_STOPPED;
354 c->list = NULL; 375 INIT_LIST_HEAD(&hdev->discovery.all);
376 INIT_LIST_HEAD(&hdev->discovery.unknown);
377 INIT_LIST_HEAD(&hdev->discovery.resolve);
355} 378}
356 379
380bool hci_discovery_active(struct hci_dev *hdev);
381
382void hci_discovery_set_state(struct hci_dev *hdev, int state);
383
357static inline int inquiry_cache_empty(struct hci_dev *hdev) 384static inline int inquiry_cache_empty(struct hci_dev *hdev)
358{ 385{
359 struct inquiry_cache *c = &hdev->inq_cache; 386 return list_empty(&hdev->discovery.all);
360 return c->list == NULL;
361} 387}
362 388
363static inline long inquiry_cache_age(struct hci_dev *hdev) 389static inline long inquiry_cache_age(struct hci_dev *hdev)
364{ 390{
365 struct inquiry_cache *c = &hdev->inq_cache; 391 struct discovery_state *c = &hdev->discovery;
366 return jiffies - c->timestamp; 392 return jiffies - c->timestamp;
367} 393}
368 394
@@ -372,8 +398,16 @@ static inline long inquiry_entry_age(struct inquiry_entry *e)
372} 398}
373 399
374struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, 400struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev,
375 bdaddr_t *bdaddr); 401 bdaddr_t *bdaddr);
376void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data); 402struct inquiry_entry *hci_inquiry_cache_lookup_unknown(struct hci_dev *hdev,
403 bdaddr_t *bdaddr);
404struct inquiry_entry *hci_inquiry_cache_lookup_resolve(struct hci_dev *hdev,
405 bdaddr_t *bdaddr,
406 int state);
407void hci_inquiry_cache_update_resolve(struct hci_dev *hdev,
408 struct inquiry_entry *ie);
409bool hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data,
410 bool name_known, bool *ssp);
377 411
378/* ----- HCI Connections ----- */ 412/* ----- HCI Connections ----- */
379enum { 413enum {
@@ -384,8 +418,19 @@ enum {
384 HCI_CONN_MODE_CHANGE_PEND, 418 HCI_CONN_MODE_CHANGE_PEND,
385 HCI_CONN_SCO_SETUP_PEND, 419 HCI_CONN_SCO_SETUP_PEND,
386 HCI_CONN_LE_SMP_PEND, 420 HCI_CONN_LE_SMP_PEND,
421 HCI_CONN_MGMT_CONNECTED,
422 HCI_CONN_SSP_ENABLED,
423 HCI_CONN_POWER_SAVE,
424 HCI_CONN_REMOTE_OOB,
387}; 425};
388 426
427static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
428{
429 struct hci_dev *hdev = conn->hdev;
430 return (test_bit(HCI_SSP_ENABLED, &hdev->flags) &&
431 test_bit(HCI_CONN_SSP_ENABLED, &conn->flags));
432}
433
389static inline void hci_conn_hash_init(struct hci_dev *hdev) 434static inline void hci_conn_hash_init(struct hci_dev *hdev)
390{ 435{
391 struct hci_conn_hash *h = &hdev->conn_hash; 436 struct hci_conn_hash *h = &hdev->conn_hash;
@@ -566,36 +611,33 @@ static inline void hci_conn_put(struct hci_conn *conn)
566} 611}
567 612
568/* ----- HCI Devices ----- */ 613/* ----- HCI Devices ----- */
569static inline void __hci_dev_put(struct hci_dev *d) 614static inline void hci_dev_put(struct hci_dev *d)
570{ 615{
571 if (atomic_dec_and_test(&d->refcnt)) 616 put_device(&d->dev);
572 d->destruct(d);
573} 617}
574 618
575/* 619static inline struct hci_dev *hci_dev_hold(struct hci_dev *d)
576 * hci_dev_put and hci_dev_hold are macros to avoid dragging all the
577 * overhead of all the modular infrastructure into this header.
578 */
579#define hci_dev_put(d) \
580do { \
581 __hci_dev_put(d); \
582 module_put(d->owner); \
583} while (0)
584
585static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
586{ 620{
587 atomic_inc(&d->refcnt); 621 get_device(&d->dev);
588 return d; 622 return d;
589} 623}
590 624
591#define hci_dev_hold(d) \
592({ \
593 try_module_get(d->owner) ? __hci_dev_hold(d) : NULL; \
594})
595
596#define hci_dev_lock(d) mutex_lock(&d->lock) 625#define hci_dev_lock(d) mutex_lock(&d->lock)
597#define hci_dev_unlock(d) mutex_unlock(&d->lock) 626#define hci_dev_unlock(d) mutex_unlock(&d->lock)
598 627
628#define to_hci_dev(d) container_of(d, struct hci_dev, dev)
629#define to_hci_conn(c) container_of(c, struct hci_conn, dev)
630
631static inline void *hci_get_drvdata(struct hci_dev *hdev)
632{
633 return dev_get_drvdata(&hdev->dev);
634}
635
636static inline void hci_set_drvdata(struct hci_dev *hdev, void *data)
637{
638 dev_set_drvdata(&hdev->dev, data);
639}
640
599struct hci_dev *hci_dev_get(int index); 641struct hci_dev *hci_dev_get(int index);
600struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); 642struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst);
601 643
@@ -619,20 +661,23 @@ int hci_inquiry(void __user *arg);
619 661
620struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); 662struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
621int hci_blacklist_clear(struct hci_dev *hdev); 663int hci_blacklist_clear(struct hci_dev *hdev);
622int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr); 664int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
623int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr); 665int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
624 666
625int hci_uuids_clear(struct hci_dev *hdev); 667int hci_uuids_clear(struct hci_dev *hdev);
626 668
627int hci_link_keys_clear(struct hci_dev *hdev); 669int hci_link_keys_clear(struct hci_dev *hdev);
628struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 670struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
629int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, 671int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
630 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); 672 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len);
631struct link_key *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]); 673struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]);
632struct link_key *hci_find_link_key_type(struct hci_dev *hdev, 674int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type,
633 bdaddr_t *bdaddr, u8 type); 675 int new_key, u8 authenticated, u8 tk[16], u8 enc_size, u16 ediv,
634int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr, 676 u8 rand[8]);
635 u8 key_size, __le16 ediv, u8 rand[8], u8 ltk[16]); 677struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
678 u8 addr_type);
679int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr);
680int hci_smp_ltks_clear(struct hci_dev *hdev);
636int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 681int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
637 682
638int hci_remote_oob_data_clear(struct hci_dev *hdev); 683int hci_remote_oob_data_clear(struct hci_dev *hdev);
@@ -674,6 +719,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
674#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) 719#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR)
675#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) 720#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
676#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) 721#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
722#define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR))
677 723
678/* ----- Extended LMP capabilities ----- */ 724/* ----- Extended LMP capabilities ----- */
679#define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) 725#define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE)
@@ -755,7 +801,7 @@ static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status)
755 if (conn->type != ACL_LINK && conn->type != LE_LINK) 801 if (conn->type != ACL_LINK && conn->type != LE_LINK)
756 return; 802 return;
757 803
758 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 804 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags))
759 return; 805 return;
760 806
761 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; 807 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00;
@@ -796,7 +842,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
796 842
797 hci_proto_auth_cfm(conn, status); 843 hci_proto_auth_cfm(conn, status);
798 844
799 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) 845 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags))
800 return; 846 return;
801 847
802 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; 848 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00;
@@ -859,25 +905,71 @@ static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
859 read_unlock(&hci_cb_list_lock); 905 read_unlock(&hci_cb_list_lock);
860} 906}
861 907
908static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type)
909{
910 u8 field_len;
911 size_t parsed;
912
913 for (parsed = 0; parsed < data_len - 1; parsed += field_len) {
914 field_len = data[0];
915
916 if (field_len == 0)
917 break;
918
919 parsed += field_len + 1;
920
921 if (parsed > data_len)
922 break;
923
924 if (data[1] == type)
925 return true;
926
927 data += field_len + 1;
928 }
929
930 return false;
931}
932
933static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data,
934 u8 data_len)
935{
936 eir[eir_len++] = sizeof(type) + data_len;
937 eir[eir_len++] = type;
938 memcpy(&eir[eir_len], data, data_len);
939 eir_len += data_len;
940
941 return eir_len;
942}
943
862int hci_register_cb(struct hci_cb *hcb); 944int hci_register_cb(struct hci_cb *hcb);
863int hci_unregister_cb(struct hci_cb *hcb); 945int hci_unregister_cb(struct hci_cb *hcb);
864 946
865int hci_register_notifier(struct notifier_block *nb);
866int hci_unregister_notifier(struct notifier_block *nb);
867
868int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); 947int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param);
869void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags); 948void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags);
870void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb); 949void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb);
871 950
872void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); 951void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode);
873 952
874void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data);
875
876/* ----- HCI Sockets ----- */ 953/* ----- HCI Sockets ----- */
877void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb, 954void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb);
878 struct sock *skip_sk); 955void hci_send_to_control(struct sk_buff *skb, struct sock *skip_sk);
956void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb);
957
958void hci_sock_dev_event(struct hci_dev *hdev, int event);
879 959
880/* Management interface */ 960/* Management interface */
961#define MGMT_ADDR_BREDR 0x00
962#define MGMT_ADDR_LE_PUBLIC 0x01
963#define MGMT_ADDR_LE_RANDOM 0x02
964#define MGMT_ADDR_INVALID 0xff
965
966#define DISCOV_TYPE_BREDR (BIT(MGMT_ADDR_BREDR))
967#define DISCOV_TYPE_LE (BIT(MGMT_ADDR_LE_PUBLIC) | \
968 BIT(MGMT_ADDR_LE_RANDOM))
969#define DISCOV_TYPE_INTERLEAVED (BIT(MGMT_ADDR_BREDR) | \
970 BIT(MGMT_ADDR_LE_PUBLIC) | \
971 BIT(MGMT_ADDR_LE_RANDOM))
972
881int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); 973int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len);
882int mgmt_index_added(struct hci_dev *hdev); 974int mgmt_index_added(struct hci_dev *hdev);
883int mgmt_index_removed(struct hci_dev *hdev); 975int mgmt_index_removed(struct hci_dev *hdev);
@@ -886,56 +978,67 @@ int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable);
886int mgmt_connectable(struct hci_dev *hdev, u8 connectable); 978int mgmt_connectable(struct hci_dev *hdev, u8 connectable);
887int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); 979int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status);
888int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, 980int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
889 u8 persistent); 981 u8 persistent);
890int mgmt_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 982int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
891 u8 addr_type); 983 u8 addr_type, u32 flags, u8 *name, u8 name_len,
892int mgmt_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 984 u8 *dev_class);
893 u8 addr_type); 985int mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
894int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 status); 986 u8 link_type, u8 addr_type);
987int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr,
988 u8 link_type, u8 addr_type, u8 status);
895int mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 989int mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
896 u8 addr_type, u8 status); 990 u8 addr_type, u8 status);
897int mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure); 991int mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure);
898int mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, 992int mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
899 u8 status); 993 u8 status);
900int mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, 994int mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
901 u8 status); 995 u8 status);
902int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, 996int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr,
903 __le32 value, u8 confirm_hint); 997 u8 link_type, u8 addr_type, __le32 value,
998 u8 confirm_hint);
904int mgmt_user_confirm_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, 999int mgmt_user_confirm_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
905 u8 status); 1000 u8 link_type, u8 addr_type, u8 status);
906int mgmt_user_confirm_neg_reply_complete(struct hci_dev *hdev, 1001int mgmt_user_confirm_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
907 bdaddr_t *bdaddr, u8 status); 1002 u8 link_type, u8 addr_type, u8 status);
908int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr); 1003int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr,
1004 u8 link_type, u8 addr_type);
909int mgmt_user_passkey_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, 1005int mgmt_user_passkey_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
910 u8 status); 1006 u8 link_type, u8 addr_type, u8 status);
911int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, 1007int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
912 bdaddr_t *bdaddr, u8 status); 1008 u8 link_type, u8 addr_type, u8 status);
913int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 status); 1009int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1010 u8 addr_type, u8 status);
1011int mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status);
1012int mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status);
1013int mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class,
1014 u8 status);
914int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); 1015int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status);
915int mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash, 1016int mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash,
916 u8 *randomizer, u8 status); 1017 u8 *randomizer, u8 status);
1018int mgmt_le_enable_complete(struct hci_dev *hdev, u8 enable, u8 status);
917int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1019int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
918 u8 addr_type, u8 *dev_class, s8 rssi, u8 *eir); 1020 u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name,
919int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *name); 1021 u8 ssp, u8 *eir, u16 eir_len);
1022int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1023 u8 addr_type, s8 rssi, u8 *name, u8 name_len);
920int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status); 1024int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status);
921int mgmt_stop_discovery_failed(struct hci_dev *hdev, u8 status); 1025int mgmt_stop_discovery_failed(struct hci_dev *hdev, u8 status);
922int mgmt_discovering(struct hci_dev *hdev, u8 discovering); 1026int mgmt_discovering(struct hci_dev *hdev, u8 discovering);
923int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr); 1027int mgmt_interleaved_discovery(struct hci_dev *hdev);
924int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr); 1028int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
1029int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
1030
1031int mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent);
925 1032
926/* HCI info for socket */ 1033/* HCI info for socket */
927#define hci_pi(sk) ((struct hci_pinfo *) sk) 1034#define hci_pi(sk) ((struct hci_pinfo *) sk)
928 1035
929/* HCI socket flags */
930#define HCI_PI_MGMT_INIT 0
931
932struct hci_pinfo { 1036struct hci_pinfo {
933 struct bt_sock bt; 1037 struct bt_sock bt;
934 struct hci_dev *hdev; 1038 struct hci_dev *hdev;
935 struct hci_filter filter; 1039 struct hci_filter filter;
936 __u32 cmsg_mask; 1040 __u32 cmsg_mask;
937 unsigned short channel; 1041 unsigned short channel;
938 unsigned long flags;
939}; 1042};
940 1043
941/* HCI security filter */ 1044/* HCI security filter */
@@ -966,5 +1069,7 @@ void hci_le_ltk_neg_reply(struct hci_conn *conn);
966 1069
967int hci_do_inquiry(struct hci_dev *hdev, u8 length); 1070int hci_do_inquiry(struct hci_dev *hdev, u8 length);
968int hci_cancel_inquiry(struct hci_dev *hdev); 1071int hci_cancel_inquiry(struct hci_dev *hdev);
1072int hci_le_scan(struct hci_dev *hdev, u8 type, u16 interval, u16 window,
1073 int timeout);
969 1074
970#endif /* __HCI_CORE_H */ 1075#endif /* __HCI_CORE_H */
diff --git a/include/net/bluetooth/hci_mon.h b/include/net/bluetooth/hci_mon.h
new file mode 100644
index 000000000000..77d1e5764185
--- /dev/null
+++ b/include/net/bluetooth/hci_mon.h
@@ -0,0 +1,51 @@
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3
4 Copyright (C) 2011-2012 Intel Corporation
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation;
9
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
13 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
14 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
19 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
20 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
21 SOFTWARE IS DISCLAIMED.
22*/
23
24#ifndef __HCI_MON_H
25#define __HCI_MON_H
26
27struct hci_mon_hdr {
28 __le16 opcode;
29 __le16 index;
30 __le16 len;
31} __packed;
32#define HCI_MON_HDR_SIZE 6
33
34#define HCI_MON_NEW_INDEX 0
35#define HCI_MON_DEL_INDEX 1
36#define HCI_MON_COMMAND_PKT 2
37#define HCI_MON_EVENT_PKT 3
38#define HCI_MON_ACL_TX_PKT 4
39#define HCI_MON_ACL_RX_PKT 5
40#define HCI_MON_SCO_TX_PKT 6
41#define HCI_MON_SCO_RX_PKT 7
42
43struct hci_mon_new_index {
44 __u8 type;
45 __u8 bus;
46 bdaddr_t bdaddr;
47 char name[8];
48} __packed;
49#define HCI_MON_NEW_INDEX_SIZE 16
50
51#endif /* __HCI_MON_H */
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index b1664ed884e6..9b242c6bf55b 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -45,11 +45,11 @@
45#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF 45#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF
46#define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF 46#define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF
47 47
48#define L2CAP_DISC_TIMEOUT (100) 48#define L2CAP_DISC_TIMEOUT msecs_to_jiffies(100)
49#define L2CAP_DISC_REJ_TIMEOUT (5000) /* 5 seconds */ 49#define L2CAP_DISC_REJ_TIMEOUT msecs_to_jiffies(5000)
50#define L2CAP_ENC_TIMEOUT (5000) /* 5 seconds */ 50#define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000)
51#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ 51#define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000)
52#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ 52#define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000)
53 53
54/* L2CAP socket address */ 54/* L2CAP socket address */
55struct sockaddr_l2 { 55struct sockaddr_l2 {
@@ -492,51 +492,56 @@ struct l2cap_chan {
492 struct sk_buff_head srej_q; 492 struct sk_buff_head srej_q;
493 struct list_head srej_l; 493 struct list_head srej_l;
494 494
495 struct list_head list; 495 struct list_head list;
496 struct list_head global_l; 496 struct list_head global_l;
497 497
498 void *data; 498 void *data;
499 struct l2cap_ops *ops; 499 struct l2cap_ops *ops;
500 struct mutex lock;
500}; 501};
501 502
502struct l2cap_ops { 503struct l2cap_ops {
503 char *name; 504 char *name;
504 505
505 struct l2cap_chan *(*new_connection) (void *data); 506 struct l2cap_chan *(*new_connection) (void *data);
506 int (*recv) (void *data, struct sk_buff *skb); 507 int (*recv) (void *data, struct sk_buff *skb);
507 void (*close) (void *data); 508 void (*close) (void *data);
508 void (*state_change) (void *data, int state); 509 void (*state_change) (void *data, int state);
510 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
511 unsigned long len, int nb, int *err);
512
509}; 513};
510 514
511struct l2cap_conn { 515struct l2cap_conn {
512 struct hci_conn *hcon; 516 struct hci_conn *hcon;
513 struct hci_chan *hchan; 517 struct hci_chan *hchan;
514 518
515 bdaddr_t *dst; 519 bdaddr_t *dst;
516 bdaddr_t *src; 520 bdaddr_t *src;
517 521
518 unsigned int mtu; 522 unsigned int mtu;
519 523
520 __u32 feat_mask; 524 __u32 feat_mask;
525 __u8 fixed_chan_mask;
521 526
522 __u8 info_state; 527 __u8 info_state;
523 __u8 info_ident; 528 __u8 info_ident;
524 529
525 struct delayed_work info_timer; 530 struct delayed_work info_timer;
526 531
527 spinlock_t lock; 532 spinlock_t lock;
528 533
529 struct sk_buff *rx_skb; 534 struct sk_buff *rx_skb;
530 __u32 rx_len; 535 __u32 rx_len;
531 __u8 tx_ident; 536 __u8 tx_ident;
532 537
533 __u8 disc_reason; 538 __u8 disc_reason;
534 539
535 struct delayed_work security_timer; 540 struct delayed_work security_timer;
536 struct smp_chan *smp_chan; 541 struct smp_chan *smp_chan;
537 542
538 struct list_head chan_l; 543 struct list_head chan_l;
539 struct mutex chan_lock; 544 struct mutex chan_lock;
540}; 545};
541 546
542#define L2CAP_INFO_CL_MTU_REQ_SENT 0x01 547#define L2CAP_INFO_CL_MTU_REQ_SENT 0x01
@@ -551,9 +556,9 @@ struct l2cap_conn {
551#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) 556#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk)
552 557
553struct l2cap_pinfo { 558struct l2cap_pinfo {
554 struct bt_sock bt; 559 struct bt_sock bt;
555 struct l2cap_chan *chan; 560 struct l2cap_chan *chan;
556 struct sk_buff *rx_busy_skb; 561 struct sk_buff *rx_busy_skb;
557}; 562};
558 563
559enum { 564enum {
@@ -606,21 +611,37 @@ static inline void l2cap_chan_put(struct l2cap_chan *c)
606 kfree(c); 611 kfree(c);
607} 612}
608 613
614static inline void l2cap_chan_lock(struct l2cap_chan *chan)
615{
616 mutex_lock(&chan->lock);
617}
618
619static inline void l2cap_chan_unlock(struct l2cap_chan *chan)
620{
621 mutex_unlock(&chan->lock);
622}
623
609static inline void l2cap_set_timer(struct l2cap_chan *chan, 624static inline void l2cap_set_timer(struct l2cap_chan *chan,
610 struct delayed_work *work, long timeout) 625 struct delayed_work *work, long timeout)
611{ 626{
612 BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout); 627 BT_DBG("chan %p state %s timeout %ld", chan,
628 state_to_string(chan->state), timeout);
613 629
614 if (!cancel_delayed_work(work)) 630 if (!cancel_delayed_work(work))
615 l2cap_chan_hold(chan); 631 l2cap_chan_hold(chan);
616 schedule_delayed_work(work, timeout); 632 schedule_delayed_work(work, timeout);
617} 633}
618 634
619static inline void l2cap_clear_timer(struct l2cap_chan *chan, 635static inline bool l2cap_clear_timer(struct l2cap_chan *chan,
620 struct delayed_work *work) 636 struct delayed_work *work)
621{ 637{
622 if (cancel_delayed_work(work)) 638 bool ret;
639
640 ret = cancel_delayed_work(work);
641 if (ret)
623 l2cap_chan_put(chan); 642 l2cap_chan_put(chan);
643
644 return ret;
624} 645}
625 646
626#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) 647#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index be65d3417883..ffc1377e092e 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -2,6 +2,7 @@
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 3
4 Copyright (C) 2010 Nokia Corporation 4 Copyright (C) 2010 Nokia Corporation
5 Copyright (C) 2011-2012 Intel Corporation
5 6
6 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as 8 it under the terms of the GNU General Public License version 2 as
@@ -39,29 +40,47 @@
39#define MGMT_STATUS_INVALID_PARAMS 0x0d 40#define MGMT_STATUS_INVALID_PARAMS 0x0d
40#define MGMT_STATUS_DISCONNECTED 0x0e 41#define MGMT_STATUS_DISCONNECTED 0x0e
41#define MGMT_STATUS_NOT_POWERED 0x0f 42#define MGMT_STATUS_NOT_POWERED 0x0f
43#define MGMT_STATUS_CANCELLED 0x10
44#define MGMT_STATUS_INVALID_INDEX 0x11
42 45
43struct mgmt_hdr { 46struct mgmt_hdr {
44 __le16 opcode; 47 __le16 opcode;
45 __le16 index; 48 __le16 index;
46 __le16 len; 49 __le16 len;
47} __packed; 50} __packed;
48 51
52struct mgmt_addr_info {
53 bdaddr_t bdaddr;
54 __u8 type;
55} __packed;
56#define MGMT_ADDR_INFO_SIZE 7
57
49#define MGMT_OP_READ_VERSION 0x0001 58#define MGMT_OP_READ_VERSION 0x0001
59#define MGMT_READ_VERSION_SIZE 0
50struct mgmt_rp_read_version { 60struct mgmt_rp_read_version {
51 __u8 version; 61 __u8 version;
52 __le16 revision; 62 __le16 revision;
63} __packed;
64
65#define MGMT_OP_READ_COMMANDS 0x0002
66#define MGMT_READ_COMMANDS_SIZE 0
67struct mgmt_rp_read_commands {
68 __le16 num_commands;
69 __le16 num_events;
70 __le16 opcodes[0];
53} __packed; 71} __packed;
54 72
55#define MGMT_OP_READ_INDEX_LIST 0x0003 73#define MGMT_OP_READ_INDEX_LIST 0x0003
74#define MGMT_READ_INDEX_LIST_SIZE 0
56struct mgmt_rp_read_index_list { 75struct mgmt_rp_read_index_list {
57 __le16 num_controllers; 76 __le16 num_controllers;
58 __le16 index[0]; 77 __le16 index[0];
59} __packed; 78} __packed;
60 79
61/* Reserve one extra byte for names in management messages so that they 80/* Reserve one extra byte for names in management messages so that they
62 * are always guaranteed to be nul-terminated */ 81 * are always guaranteed to be nul-terminated */
63#define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1) 82#define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1)
64#define MGMT_MAX_SHORT_NAME_LENGTH (10 + 1) 83#define MGMT_MAX_SHORT_NAME_LENGTH (HCI_MAX_SHORT_NAME_LENGTH + 1)
65 84
66#define MGMT_SETTING_POWERED 0x00000001 85#define MGMT_SETTING_POWERED 0x00000001
67#define MGMT_SETTING_CONNECTABLE 0x00000002 86#define MGMT_SETTING_CONNECTABLE 0x00000002
@@ -75,28 +94,32 @@ struct mgmt_rp_read_index_list {
75#define MGMT_SETTING_LE 0x00000200 94#define MGMT_SETTING_LE 0x00000200
76 95
77#define MGMT_OP_READ_INFO 0x0004 96#define MGMT_OP_READ_INFO 0x0004
97#define MGMT_READ_INFO_SIZE 0
78struct mgmt_rp_read_info { 98struct mgmt_rp_read_info {
79 bdaddr_t bdaddr; 99 bdaddr_t bdaddr;
80 __u8 version; 100 __u8 version;
81 __le16 manufacturer; 101 __le16 manufacturer;
82 __le32 supported_settings; 102 __le32 supported_settings;
83 __le32 current_settings; 103 __le32 current_settings;
84 __u8 dev_class[3]; 104 __u8 dev_class[3];
85 __u8 name[MGMT_MAX_NAME_LENGTH]; 105 __u8 name[MGMT_MAX_NAME_LENGTH];
86 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH]; 106 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
87} __packed; 107} __packed;
88 108
89struct mgmt_mode { 109struct mgmt_mode {
90 __u8 val; 110 __u8 val;
91} __packed; 111} __packed;
92 112
113#define MGMT_SETTING_SIZE 1
114
93#define MGMT_OP_SET_POWERED 0x0005 115#define MGMT_OP_SET_POWERED 0x0005
94 116
95#define MGMT_OP_SET_DISCOVERABLE 0x0006 117#define MGMT_OP_SET_DISCOVERABLE 0x0006
96struct mgmt_cp_set_discoverable { 118struct mgmt_cp_set_discoverable {
97 __u8 val; 119 __u8 val;
98 __u16 timeout; 120 __u16 timeout;
99} __packed; 121} __packed;
122#define MGMT_SET_DISCOVERABLE_SIZE 3
100 123
101#define MGMT_OP_SET_CONNECTABLE 0x0007 124#define MGMT_OP_SET_CONNECTABLE 0x0007
102 125
@@ -111,73 +134,76 @@ struct mgmt_cp_set_discoverable {
111#define MGMT_OP_SET_HS 0x000C 134#define MGMT_OP_SET_HS 0x000C
112 135
113#define MGMT_OP_SET_LE 0x000D 136#define MGMT_OP_SET_LE 0x000D
114
115#define MGMT_OP_SET_DEV_CLASS 0x000E 137#define MGMT_OP_SET_DEV_CLASS 0x000E
116struct mgmt_cp_set_dev_class { 138struct mgmt_cp_set_dev_class {
117 __u8 major; 139 __u8 major;
118 __u8 minor; 140 __u8 minor;
119} __packed; 141} __packed;
142#define MGMT_SET_DEV_CLASS_SIZE 2
120 143
121#define MGMT_OP_SET_LOCAL_NAME 0x000F 144#define MGMT_OP_SET_LOCAL_NAME 0x000F
122struct mgmt_cp_set_local_name { 145struct mgmt_cp_set_local_name {
123 __u8 name[MGMT_MAX_NAME_LENGTH]; 146 __u8 name[MGMT_MAX_NAME_LENGTH];
147 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
124} __packed; 148} __packed;
149#define MGMT_SET_LOCAL_NAME_SIZE 260
125 150
126#define MGMT_OP_ADD_UUID 0x0010 151#define MGMT_OP_ADD_UUID 0x0010
127struct mgmt_cp_add_uuid { 152struct mgmt_cp_add_uuid {
128 __u8 uuid[16]; 153 __u8 uuid[16];
129 __u8 svc_hint; 154 __u8 svc_hint;
130} __packed; 155} __packed;
156#define MGMT_ADD_UUID_SIZE 17
131 157
132#define MGMT_OP_REMOVE_UUID 0x0011 158#define MGMT_OP_REMOVE_UUID 0x0011
133struct mgmt_cp_remove_uuid { 159struct mgmt_cp_remove_uuid {
134 __u8 uuid[16]; 160 __u8 uuid[16];
135} __packed; 161} __packed;
162#define MGMT_REMOVE_UUID_SIZE 16
136 163
137struct mgmt_link_key_info { 164struct mgmt_link_key_info {
138 bdaddr_t bdaddr; 165 struct mgmt_addr_info addr;
139 u8 type; 166 __u8 type;
140 u8 val[16]; 167 __u8 val[16];
141 u8 pin_len; 168 __u8 pin_len;
142} __packed; 169} __packed;
143 170
144#define MGMT_OP_LOAD_LINK_KEYS 0x0012 171#define MGMT_OP_LOAD_LINK_KEYS 0x0012
145struct mgmt_cp_load_link_keys { 172struct mgmt_cp_load_link_keys {
146 __u8 debug_keys; 173 __u8 debug_keys;
147 __le16 key_count; 174 __le16 key_count;
148 struct mgmt_link_key_info keys[0]; 175 struct mgmt_link_key_info keys[0];
149} __packed; 176} __packed;
177#define MGMT_LOAD_LINK_KEYS_SIZE 3
150 178
151#define MGMT_OP_REMOVE_KEYS 0x0013 179struct mgmt_ltk_info {
152struct mgmt_cp_remove_keys { 180 struct mgmt_addr_info addr;
153 bdaddr_t bdaddr; 181 __u8 authenticated;
154 __u8 disconnect; 182 __u8 master;
183 __u8 enc_size;
184 __le16 ediv;
185 __u8 rand[8];
186 __u8 val[16];
155} __packed; 187} __packed;
156struct mgmt_rp_remove_keys { 188
157 bdaddr_t bdaddr; 189#define MGMT_OP_LOAD_LONG_TERM_KEYS 0x0013
158 __u8 status; 190struct mgmt_cp_load_long_term_keys {
159}; 191 __le16 key_count;
192 struct mgmt_ltk_info keys[0];
193} __packed;
194#define MGMT_LOAD_LONG_TERM_KEYS_SIZE 2
160 195
161#define MGMT_OP_DISCONNECT 0x0014 196#define MGMT_OP_DISCONNECT 0x0014
162struct mgmt_cp_disconnect { 197struct mgmt_cp_disconnect {
163 bdaddr_t bdaddr; 198 struct mgmt_addr_info addr;
164} __packed; 199} __packed;
200#define MGMT_DISCONNECT_SIZE MGMT_ADDR_INFO_SIZE
165struct mgmt_rp_disconnect { 201struct mgmt_rp_disconnect {
166 bdaddr_t bdaddr; 202 struct mgmt_addr_info addr;
167 __u8 status;
168} __packed;
169
170#define MGMT_ADDR_BREDR 0x00
171#define MGMT_ADDR_LE_PUBLIC 0x01
172#define MGMT_ADDR_LE_RANDOM 0x02
173#define MGMT_ADDR_INVALID 0xff
174
175struct mgmt_addr_info {
176 bdaddr_t bdaddr;
177 __u8 type;
178} __packed; 203} __packed;
179 204
180#define MGMT_OP_GET_CONNECTIONS 0x0015 205#define MGMT_OP_GET_CONNECTIONS 0x0015
206#define MGMT_GET_CONNECTIONS_SIZE 0
181struct mgmt_rp_get_connections { 207struct mgmt_rp_get_connections {
182 __le16 conn_count; 208 __le16 conn_count;
183 struct mgmt_addr_info addr[0]; 209 struct mgmt_addr_info addr[0];
@@ -185,124 +211,152 @@ struct mgmt_rp_get_connections {
185 211
186#define MGMT_OP_PIN_CODE_REPLY 0x0016 212#define MGMT_OP_PIN_CODE_REPLY 0x0016
187struct mgmt_cp_pin_code_reply { 213struct mgmt_cp_pin_code_reply {
188 bdaddr_t bdaddr; 214 struct mgmt_addr_info addr;
189 __u8 pin_len; 215 __u8 pin_len;
190 __u8 pin_code[16]; 216 __u8 pin_code[16];
191} __packed; 217} __packed;
218#define MGMT_PIN_CODE_REPLY_SIZE (MGMT_ADDR_INFO_SIZE + 17)
192struct mgmt_rp_pin_code_reply { 219struct mgmt_rp_pin_code_reply {
193 bdaddr_t bdaddr; 220 struct mgmt_addr_info addr;
194 uint8_t status;
195} __packed; 221} __packed;
196 222
197#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0017 223#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0017
198struct mgmt_cp_pin_code_neg_reply { 224struct mgmt_cp_pin_code_neg_reply {
199 bdaddr_t bdaddr; 225 struct mgmt_addr_info addr;
200} __packed; 226} __packed;
227#define MGMT_PIN_CODE_NEG_REPLY_SIZE MGMT_ADDR_INFO_SIZE
201 228
202#define MGMT_OP_SET_IO_CAPABILITY 0x0018 229#define MGMT_OP_SET_IO_CAPABILITY 0x0018
203struct mgmt_cp_set_io_capability { 230struct mgmt_cp_set_io_capability {
204 __u8 io_capability; 231 __u8 io_capability;
205} __packed; 232} __packed;
233#define MGMT_SET_IO_CAPABILITY_SIZE 1
206 234
207#define MGMT_OP_PAIR_DEVICE 0x0019 235#define MGMT_OP_PAIR_DEVICE 0x0019
208struct mgmt_cp_pair_device { 236struct mgmt_cp_pair_device {
209 struct mgmt_addr_info addr; 237 struct mgmt_addr_info addr;
210 __u8 io_cap; 238 __u8 io_cap;
211} __packed; 239} __packed;
240#define MGMT_PAIR_DEVICE_SIZE (MGMT_ADDR_INFO_SIZE + 1)
212struct mgmt_rp_pair_device { 241struct mgmt_rp_pair_device {
213 struct mgmt_addr_info addr; 242 struct mgmt_addr_info addr;
214 __u8 status;
215} __packed; 243} __packed;
216 244
217#define MGMT_OP_USER_CONFIRM_REPLY 0x001A 245#define MGMT_OP_CANCEL_PAIR_DEVICE 0x001A
246#define MGMT_CANCEL_PAIR_DEVICE_SIZE MGMT_ADDR_INFO_SIZE
247
248#define MGMT_OP_UNPAIR_DEVICE 0x001B
249struct mgmt_cp_unpair_device {
250 struct mgmt_addr_info addr;
251 __u8 disconnect;
252} __packed;
253#define MGMT_UNPAIR_DEVICE_SIZE (MGMT_ADDR_INFO_SIZE + 1)
254struct mgmt_rp_unpair_device {
255 struct mgmt_addr_info addr;
256};
257
258#define MGMT_OP_USER_CONFIRM_REPLY 0x001C
218struct mgmt_cp_user_confirm_reply { 259struct mgmt_cp_user_confirm_reply {
219 bdaddr_t bdaddr; 260 struct mgmt_addr_info addr;
220} __packed; 261} __packed;
262#define MGMT_USER_CONFIRM_REPLY_SIZE MGMT_ADDR_INFO_SIZE
221struct mgmt_rp_user_confirm_reply { 263struct mgmt_rp_user_confirm_reply {
222 bdaddr_t bdaddr; 264 struct mgmt_addr_info addr;
223 __u8 status;
224} __packed; 265} __packed;
225 266
226#define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x001B 267#define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x001D
227struct mgmt_cp_user_confirm_neg_reply { 268struct mgmt_cp_user_confirm_neg_reply {
228 bdaddr_t bdaddr; 269 struct mgmt_addr_info addr;
229} __packed; 270} __packed;
271#define MGMT_USER_CONFIRM_NEG_REPLY_SIZE MGMT_ADDR_INFO_SIZE
230 272
231#define MGMT_OP_USER_PASSKEY_REPLY 0x001C 273#define MGMT_OP_USER_PASSKEY_REPLY 0x001E
232struct mgmt_cp_user_passkey_reply { 274struct mgmt_cp_user_passkey_reply {
233 bdaddr_t bdaddr; 275 struct mgmt_addr_info addr;
234 __le32 passkey; 276 __le32 passkey;
235} __packed; 277} __packed;
278#define MGMT_USER_PASSKEY_REPLY_SIZE (MGMT_ADDR_INFO_SIZE + 4)
236struct mgmt_rp_user_passkey_reply { 279struct mgmt_rp_user_passkey_reply {
237 bdaddr_t bdaddr; 280 struct mgmt_addr_info addr;
238 __u8 status;
239} __packed; 281} __packed;
240 282
241#define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x001D 283#define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x001F
242struct mgmt_cp_user_passkey_neg_reply { 284struct mgmt_cp_user_passkey_neg_reply {
243 bdaddr_t bdaddr; 285 struct mgmt_addr_info addr;
244} __packed; 286} __packed;
287#define MGMT_USER_PASSKEY_NEG_REPLY_SIZE MGMT_ADDR_INFO_SIZE
245 288
246#define MGMT_OP_READ_LOCAL_OOB_DATA 0x001E 289#define MGMT_OP_READ_LOCAL_OOB_DATA 0x0020
290#define MGMT_READ_LOCAL_OOB_DATA_SIZE 0
247struct mgmt_rp_read_local_oob_data { 291struct mgmt_rp_read_local_oob_data {
248 __u8 hash[16]; 292 __u8 hash[16];
249 __u8 randomizer[16]; 293 __u8 randomizer[16];
250} __packed; 294} __packed;
251 295
252#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x001F 296#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0021
253struct mgmt_cp_add_remote_oob_data { 297struct mgmt_cp_add_remote_oob_data {
254 bdaddr_t bdaddr; 298 struct mgmt_addr_info addr;
255 __u8 hash[16]; 299 __u8 hash[16];
256 __u8 randomizer[16]; 300 __u8 randomizer[16];
257} __packed; 301} __packed;
302#define MGMT_ADD_REMOTE_OOB_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 32)
258 303
259#define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x0020 304#define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x0022
260struct mgmt_cp_remove_remote_oob_data { 305struct mgmt_cp_remove_remote_oob_data {
261 bdaddr_t bdaddr; 306 struct mgmt_addr_info addr;
262} __packed; 307} __packed;
308#define MGMT_REMOVE_REMOTE_OOB_DATA_SIZE MGMT_ADDR_INFO_SIZE
263 309
264#define MGMT_OP_START_DISCOVERY 0x0021 310#define MGMT_OP_START_DISCOVERY 0x0023
265struct mgmt_cp_start_discovery { 311struct mgmt_cp_start_discovery {
266 __u8 type; 312 __u8 type;
267} __packed; 313} __packed;
314#define MGMT_START_DISCOVERY_SIZE 1
268 315
269#define MGMT_OP_STOP_DISCOVERY 0x0022 316#define MGMT_OP_STOP_DISCOVERY 0x0024
317struct mgmt_cp_stop_discovery {
318 __u8 type;
319} __packed;
320#define MGMT_STOP_DISCOVERY_SIZE 1
270 321
271#define MGMT_OP_CONFIRM_NAME 0x0023 322#define MGMT_OP_CONFIRM_NAME 0x0025
272struct mgmt_cp_confirm_name { 323struct mgmt_cp_confirm_name {
273 bdaddr_t bdaddr; 324 struct mgmt_addr_info addr;
274 __u8 name_known; 325 __u8 name_known;
275} __packed; 326} __packed;
327#define MGMT_CONFIRM_NAME_SIZE (MGMT_ADDR_INFO_SIZE + 1)
276struct mgmt_rp_confirm_name { 328struct mgmt_rp_confirm_name {
277 bdaddr_t bdaddr; 329 struct mgmt_addr_info addr;
278 __u8 status;
279} __packed; 330} __packed;
280 331
281#define MGMT_OP_BLOCK_DEVICE 0x0024 332#define MGMT_OP_BLOCK_DEVICE 0x0026
282struct mgmt_cp_block_device { 333struct mgmt_cp_block_device {
283 bdaddr_t bdaddr; 334 struct mgmt_addr_info addr;
284} __packed; 335} __packed;
336#define MGMT_BLOCK_DEVICE_SIZE MGMT_ADDR_INFO_SIZE
285 337
286#define MGMT_OP_UNBLOCK_DEVICE 0x0025 338#define MGMT_OP_UNBLOCK_DEVICE 0x0027
287struct mgmt_cp_unblock_device { 339struct mgmt_cp_unblock_device {
288 bdaddr_t bdaddr; 340 struct mgmt_addr_info addr;
289} __packed; 341} __packed;
342#define MGMT_UNBLOCK_DEVICE_SIZE MGMT_ADDR_INFO_SIZE
290 343
291#define MGMT_EV_CMD_COMPLETE 0x0001 344#define MGMT_EV_CMD_COMPLETE 0x0001
292struct mgmt_ev_cmd_complete { 345struct mgmt_ev_cmd_complete {
293 __le16 opcode; 346 __le16 opcode;
294 __u8 data[0]; 347 __u8 status;
348 __u8 data[0];
295} __packed; 349} __packed;
296 350
297#define MGMT_EV_CMD_STATUS 0x0002 351#define MGMT_EV_CMD_STATUS 0x0002
298struct mgmt_ev_cmd_status { 352struct mgmt_ev_cmd_status {
299 __u8 status; 353 __le16 opcode;
300 __le16 opcode; 354 __u8 status;
301} __packed; 355} __packed;
302 356
303#define MGMT_EV_CONTROLLER_ERROR 0x0003 357#define MGMT_EV_CONTROLLER_ERROR 0x0003
304struct mgmt_ev_controller_error { 358struct mgmt_ev_controller_error {
305 __u8 error_code; 359 __u8 error_code;
306} __packed; 360} __packed;
307 361
308#define MGMT_EV_INDEX_ADDED 0x0004 362#define MGMT_EV_INDEX_ADDED 0x0004
@@ -313,78 +367,96 @@ struct mgmt_ev_controller_error {
313 367
314#define MGMT_EV_CLASS_OF_DEV_CHANGED 0x0007 368#define MGMT_EV_CLASS_OF_DEV_CHANGED 0x0007
315struct mgmt_ev_class_of_dev_changed { 369struct mgmt_ev_class_of_dev_changed {
316 __u8 dev_class[3]; 370 __u8 dev_class[3];
317}; 371};
318 372
319#define MGMT_EV_LOCAL_NAME_CHANGED 0x0008 373#define MGMT_EV_LOCAL_NAME_CHANGED 0x0008
320struct mgmt_ev_local_name_changed { 374struct mgmt_ev_local_name_changed {
321 __u8 name[MGMT_MAX_NAME_LENGTH]; 375 __u8 name[MGMT_MAX_NAME_LENGTH];
322 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH]; 376 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
323} __packed; 377} __packed;
324 378
325#define MGMT_EV_NEW_LINK_KEY 0x0009 379#define MGMT_EV_NEW_LINK_KEY 0x0009
326struct mgmt_ev_new_link_key { 380struct mgmt_ev_new_link_key {
327 __u8 store_hint; 381 __u8 store_hint;
328 struct mgmt_link_key_info key; 382 struct mgmt_link_key_info key;
329} __packed; 383} __packed;
330 384
331#define MGMT_EV_CONNECTED 0x000A 385#define MGMT_EV_NEW_LONG_TERM_KEY 0x000A
386struct mgmt_ev_new_long_term_key {
387 __u8 store_hint;
388 struct mgmt_ltk_info key;
389} __packed;
332 390
333#define MGMT_EV_DISCONNECTED 0x000B 391#define MGMT_EV_DEVICE_CONNECTED 0x000B
392struct mgmt_ev_device_connected {
393 struct mgmt_addr_info addr;
394 __le32 flags;
395 __le16 eir_len;
396 __u8 eir[0];
397} __packed;
398
399#define MGMT_EV_DEVICE_DISCONNECTED 0x000C
334 400
335#define MGMT_EV_CONNECT_FAILED 0x000C 401#define MGMT_EV_CONNECT_FAILED 0x000D
336struct mgmt_ev_connect_failed { 402struct mgmt_ev_connect_failed {
337 struct mgmt_addr_info addr; 403 struct mgmt_addr_info addr;
338 __u8 status; 404 __u8 status;
339} __packed; 405} __packed;
340 406
341#define MGMT_EV_PIN_CODE_REQUEST 0x000D 407#define MGMT_EV_PIN_CODE_REQUEST 0x000E
342struct mgmt_ev_pin_code_request { 408struct mgmt_ev_pin_code_request {
343 bdaddr_t bdaddr; 409 struct mgmt_addr_info addr;
344 __u8 secure; 410 __u8 secure;
345} __packed; 411} __packed;
346 412
347#define MGMT_EV_USER_CONFIRM_REQUEST 0x000E 413#define MGMT_EV_USER_CONFIRM_REQUEST 0x000F
348struct mgmt_ev_user_confirm_request { 414struct mgmt_ev_user_confirm_request {
349 bdaddr_t bdaddr; 415 struct mgmt_addr_info addr;
350 __u8 confirm_hint; 416 __u8 confirm_hint;
351 __le32 value; 417 __le32 value;
352} __packed; 418} __packed;
353 419
354#define MGMT_EV_USER_PASSKEY_REQUEST 0x000F 420#define MGMT_EV_USER_PASSKEY_REQUEST 0x0010
355struct mgmt_ev_user_passkey_request { 421struct mgmt_ev_user_passkey_request {
356 bdaddr_t bdaddr; 422 struct mgmt_addr_info addr;
357} __packed; 423} __packed;
358 424
359#define MGMT_EV_AUTH_FAILED 0x0010 425#define MGMT_EV_AUTH_FAILED 0x0011
360struct mgmt_ev_auth_failed { 426struct mgmt_ev_auth_failed {
361 bdaddr_t bdaddr; 427 struct mgmt_addr_info addr;
362 __u8 status; 428 __u8 status;
363} __packed; 429} __packed;
364 430
365#define MGMT_EV_DEVICE_FOUND 0x0011 431#define MGMT_DEV_FOUND_CONFIRM_NAME 0x01
432#define MGMT_DEV_FOUND_LEGACY_PAIRING 0x02
433
434#define MGMT_EV_DEVICE_FOUND 0x0012
366struct mgmt_ev_device_found { 435struct mgmt_ev_device_found {
367 struct mgmt_addr_info addr; 436 struct mgmt_addr_info addr;
368 __u8 dev_class[3]; 437 __s8 rssi;
369 __s8 rssi; 438 __u8 flags[4];
370 __u8 confirm_name; 439 __le16 eir_len;
371 __u8 eir[HCI_MAX_EIR_LENGTH]; 440 __u8 eir[0];
372} __packed;
373
374#define MGMT_EV_REMOTE_NAME 0x0012
375struct mgmt_ev_remote_name {
376 bdaddr_t bdaddr;
377 __u8 name[MGMT_MAX_NAME_LENGTH];
378} __packed; 441} __packed;
379 442
380#define MGMT_EV_DISCOVERING 0x0013 443#define MGMT_EV_DISCOVERING 0x0013
444struct mgmt_ev_discovering {
445 __u8 type;
446 __u8 discovering;
447} __packed;
381 448
382#define MGMT_EV_DEVICE_BLOCKED 0x0014 449#define MGMT_EV_DEVICE_BLOCKED 0x0014
383struct mgmt_ev_device_blocked { 450struct mgmt_ev_device_blocked {
384 bdaddr_t bdaddr; 451 struct mgmt_addr_info addr;
385} __packed; 452} __packed;
386 453
387#define MGMT_EV_DEVICE_UNBLOCKED 0x0015 454#define MGMT_EV_DEVICE_UNBLOCKED 0x0015
388struct mgmt_ev_device_unblocked { 455struct mgmt_ev_device_unblocked {
389 bdaddr_t bdaddr; 456 struct mgmt_addr_info addr;
457} __packed;
458
459#define MGMT_EV_DEVICE_UNPAIRED 0x0016
460struct mgmt_ev_device_unpaired {
461 struct mgmt_addr_info addr;
390} __packed; 462} __packed;
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h
index aeaf5fa2b9f1..7b3acdd29134 100644
--- a/include/net/bluetooth/smp.h
+++ b/include/net/bluetooth/smp.h
@@ -127,7 +127,7 @@ struct smp_chan {
127 u8 rrnd[16]; /* SMP Pairing Random (remote) */ 127 u8 rrnd[16]; /* SMP Pairing Random (remote) */
128 u8 pcnf[16]; /* SMP Pairing Confirm */ 128 u8 pcnf[16]; /* SMP Pairing Confirm */
129 u8 tk[16]; /* SMP Temporary Key */ 129 u8 tk[16]; /* SMP Temporary Key */
130 u8 smp_key_size; 130 u8 enc_key_size;
131 unsigned long smp_flags; 131 unsigned long smp_flags;
132 struct crypto_blkcipher *tfm; 132 struct crypto_blkcipher *tfm;
133 struct work_struct confirm; 133 struct work_struct confirm;
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h
index 8d552519ff67..6db8ecf52aa2 100644
--- a/include/net/caif/caif_hsi.h
+++ b/include/net/caif/caif_hsi.h
@@ -138,6 +138,7 @@ struct cfhsi {
138 u8 *rx_ptr; 138 u8 *rx_ptr;
139 u8 *tx_buf; 139 u8 *tx_buf;
140 u8 *rx_buf; 140 u8 *rx_buf;
141 u8 *rx_flip_buf;
141 spinlock_t lock; 142 spinlock_t lock;
142 int flow_off_sent; 143 int flow_off_sent;
143 u32 q_low_mark; 144 u32 q_low_mark;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index a067d30ce73e..69b7ad3a9925 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -120,6 +120,7 @@ enum ieee80211_channel_flags {
120 * @band: band this channel belongs to. 120 * @band: band this channel belongs to.
121 * @max_antenna_gain: maximum antenna gain in dBi 121 * @max_antenna_gain: maximum antenna gain in dBi
122 * @max_power: maximum transmission power (in dBm) 122 * @max_power: maximum transmission power (in dBm)
123 * @max_reg_power: maximum regulatory transmission power (in dBm)
123 * @beacon_found: helper to regulatory code to indicate when a beacon 124 * @beacon_found: helper to regulatory code to indicate when a beacon
124 * has been found on this channel. Use regulatory_hint_found_beacon() 125 * has been found on this channel. Use regulatory_hint_found_beacon()
125 * to enable this, this is useful only on 5 GHz band. 126 * to enable this, this is useful only on 5 GHz band.
@@ -133,6 +134,7 @@ struct ieee80211_channel {
133 u32 flags; 134 u32 flags;
134 int max_antenna_gain; 135 int max_antenna_gain;
135 int max_power; 136 int max_power;
137 int max_reg_power;
136 bool beacon_found; 138 bool beacon_found;
137 u32 orig_flags; 139 u32 orig_flags;
138 int orig_mag, orig_mpwr; 140 int orig_mag, orig_mpwr;
@@ -364,25 +366,13 @@ struct cfg80211_crypto_settings {
364}; 366};
365 367
366/** 368/**
367 * struct beacon_parameters - beacon parameters 369 * struct cfg80211_beacon_data - beacon data
368 *
369 * Used to configure the beacon for an interface.
370 *
371 * @head: head portion of beacon (before TIM IE) 370 * @head: head portion of beacon (before TIM IE)
372 * or %NULL if not changed 371 * or %NULL if not changed
373 * @tail: tail portion of beacon (after TIM IE) 372 * @tail: tail portion of beacon (after TIM IE)
374 * or %NULL if not changed 373 * or %NULL if not changed
375 * @interval: beacon interval or zero if not changed
376 * @dtim_period: DTIM period or zero if not changed
377 * @head_len: length of @head 374 * @head_len: length of @head
378 * @tail_len: length of @tail 375 * @tail_len: length of @tail
379 * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from
380 * user space)
381 * @ssid_len: length of @ssid
382 * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames
383 * @crypto: crypto settings
384 * @privacy: the BSS uses privacy
385 * @auth_type: Authentication type (algorithm)
386 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL 376 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
387 * @beacon_ies_len: length of beacon_ies in octets 377 * @beacon_ies_len: length of beacon_ies in octets
388 * @proberesp_ies: extra information element(s) to add into Probe Response 378 * @proberesp_ies: extra information element(s) to add into Probe Response
@@ -394,24 +384,48 @@ struct cfg80211_crypto_settings {
394 * @probe_resp_len: length of probe response template (@probe_resp) 384 * @probe_resp_len: length of probe response template (@probe_resp)
395 * @probe_resp: probe response template (AP mode only) 385 * @probe_resp: probe response template (AP mode only)
396 */ 386 */
397struct beacon_parameters { 387struct cfg80211_beacon_data {
398 u8 *head, *tail; 388 const u8 *head, *tail;
399 int interval, dtim_period; 389 const u8 *beacon_ies;
400 int head_len, tail_len; 390 const u8 *proberesp_ies;
391 const u8 *assocresp_ies;
392 const u8 *probe_resp;
393
394 size_t head_len, tail_len;
395 size_t beacon_ies_len;
396 size_t proberesp_ies_len;
397 size_t assocresp_ies_len;
398 size_t probe_resp_len;
399};
400
401/**
402 * struct cfg80211_ap_settings - AP configuration
403 *
404 * Used to configure an AP interface.
405 *
406 * @beacon: beacon data
407 * @beacon_interval: beacon interval
408 * @dtim_period: DTIM period
409 * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from
410 * user space)
411 * @ssid_len: length of @ssid
412 * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames
413 * @crypto: crypto settings
414 * @privacy: the BSS uses privacy
415 * @auth_type: Authentication type (algorithm)
416 * @inactivity_timeout: time in seconds to determine station's inactivity.
417 */
418struct cfg80211_ap_settings {
419 struct cfg80211_beacon_data beacon;
420
421 int beacon_interval, dtim_period;
401 const u8 *ssid; 422 const u8 *ssid;
402 size_t ssid_len; 423 size_t ssid_len;
403 enum nl80211_hidden_ssid hidden_ssid; 424 enum nl80211_hidden_ssid hidden_ssid;
404 struct cfg80211_crypto_settings crypto; 425 struct cfg80211_crypto_settings crypto;
405 bool privacy; 426 bool privacy;
406 enum nl80211_auth_type auth_type; 427 enum nl80211_auth_type auth_type;
407 const u8 *beacon_ies; 428 int inactivity_timeout;
408 size_t beacon_ies_len;
409 const u8 *proberesp_ies;
410 size_t proberesp_ies_len;
411 const u8 *assocresp_ies;
412 size_t assocresp_ies_len;
413 int probe_resp_len;
414 u8 *probe_resp;
415}; 429};
416 430
417/** 431/**
@@ -796,6 +810,8 @@ struct mesh_config {
796 * mesh gate, but not necessarily using the gate announcement protocol. 810 * mesh gate, but not necessarily using the gate announcement protocol.
797 * Still keeping the same nomenclature to be in sync with the spec. */ 811 * Still keeping the same nomenclature to be in sync with the spec. */
798 bool dot11MeshGateAnnouncementProtocol; 812 bool dot11MeshGateAnnouncementProtocol;
813 bool dot11MeshForwarding;
814 s32 rssi_threshold;
799}; 815};
800 816
801/** 817/**
@@ -1036,10 +1052,6 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
1036 * @key_len: length of WEP key for shared key authentication 1052 * @key_len: length of WEP key for shared key authentication
1037 * @key_idx: index of WEP key for shared key authentication 1053 * @key_idx: index of WEP key for shared key authentication
1038 * @key: WEP key for shared key authentication 1054 * @key: WEP key for shared key authentication
1039 * @local_state_change: This is a request for a local state only, i.e., no
1040 * Authentication frame is to be transmitted and authentication state is
1041 * to be changed without having to wait for a response from the peer STA
1042 * (AP).
1043 */ 1055 */
1044struct cfg80211_auth_request { 1056struct cfg80211_auth_request {
1045 struct cfg80211_bss *bss; 1057 struct cfg80211_bss *bss;
@@ -1048,7 +1060,6 @@ struct cfg80211_auth_request {
1048 enum nl80211_auth_type auth_type; 1060 enum nl80211_auth_type auth_type;
1049 const u8 *key; 1061 const u8 *key;
1050 u8 key_len, key_idx; 1062 u8 key_len, key_idx;
1051 bool local_state_change;
1052}; 1063};
1053 1064
1054/** 1065/**
@@ -1065,7 +1076,11 @@ enum cfg80211_assoc_req_flags {
1065 * 1076 *
1066 * This structure provides information needed to complete IEEE 802.11 1077 * This structure provides information needed to complete IEEE 802.11
1067 * (re)association. 1078 * (re)association.
1068 * @bss: The BSS to associate with. 1079 * @bss: The BSS to associate with. If the call is successful the driver
1080 * is given a reference that it must release, normally via a call to
1081 * cfg80211_send_rx_assoc(), or, if association timed out, with a
1082 * call to cfg80211_put_bss() (in addition to calling
1083 * cfg80211_send_assoc_timeout())
1069 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL 1084 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL
1070 * @ie_len: Length of ie buffer in octets 1085 * @ie_len: Length of ie buffer in octets
1071 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association 1086 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association
@@ -1093,19 +1108,16 @@ struct cfg80211_assoc_request {
1093 * This structure provides information needed to complete IEEE 802.11 1108 * This structure provides information needed to complete IEEE 802.11
1094 * deauthentication. 1109 * deauthentication.
1095 * 1110 *
1096 * @bss: the BSS to deauthenticate from 1111 * @bssid: the BSSID of the BSS to deauthenticate from
1097 * @ie: Extra IEs to add to Deauthentication frame or %NULL 1112 * @ie: Extra IEs to add to Deauthentication frame or %NULL
1098 * @ie_len: Length of ie buffer in octets 1113 * @ie_len: Length of ie buffer in octets
1099 * @reason_code: The reason code for the deauthentication 1114 * @reason_code: The reason code for the deauthentication
1100 * @local_state_change: This is a request for a local state only, i.e., no
1101 * Deauthentication frame is to be transmitted.
1102 */ 1115 */
1103struct cfg80211_deauth_request { 1116struct cfg80211_deauth_request {
1104 struct cfg80211_bss *bss; 1117 const u8 *bssid;
1105 const u8 *ie; 1118 const u8 *ie;
1106 size_t ie_len; 1119 size_t ie_len;
1107 u16 reason_code; 1120 u16 reason_code;
1108 bool local_state_change;
1109}; 1121};
1110 1122
1111/** 1123/**
@@ -1148,6 +1160,10 @@ struct cfg80211_disassoc_request {
1148 * @beacon_interval: beacon interval to use 1160 * @beacon_interval: beacon interval to use
1149 * @privacy: this is a protected network, keys will be configured 1161 * @privacy: this is a protected network, keys will be configured
1150 * after joining 1162 * after joining
1163 * @control_port: whether user space controls IEEE 802.1X port, i.e.,
1164 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
1165 * required to assume that the port is unauthorized until authorized by
1166 * user space. Otherwise, port is marked authorized by default.
1151 * @basic_rates: bitmap of basic rates to use when creating the IBSS 1167 * @basic_rates: bitmap of basic rates to use when creating the IBSS
1152 * @mcast_rate: per-band multicast rate index + 1 (0: disabled) 1168 * @mcast_rate: per-band multicast rate index + 1 (0: disabled)
1153 */ 1169 */
@@ -1162,6 +1178,7 @@ struct cfg80211_ibss_params {
1162 u32 basic_rates; 1178 u32 basic_rates;
1163 bool channel_fixed; 1179 bool channel_fixed;
1164 bool privacy; 1180 bool privacy;
1181 bool control_port;
1165 int mcast_rate[IEEE80211_NUM_BANDS]; 1182 int mcast_rate[IEEE80211_NUM_BANDS];
1166}; 1183};
1167 1184
@@ -1186,6 +1203,8 @@ struct cfg80211_ibss_params {
1186 * @key_idx: index of WEP key for shared key authentication 1203 * @key_idx: index of WEP key for shared key authentication
1187 * @key: WEP key for shared key authentication 1204 * @key: WEP key for shared key authentication
1188 * @flags: See &enum cfg80211_assoc_req_flags 1205 * @flags: See &enum cfg80211_assoc_req_flags
1206 * @bg_scan_period: Background scan period in seconds
1207 * or -1 to indicate that default value is to be used.
1189 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1208 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1190 * will be used in ht_capa. Un-supported values will be ignored. 1209 * will be used in ht_capa. Un-supported values will be ignored.
1191 * @ht_capa_mask: The bits of ht_capa which are to be used. 1210 * @ht_capa_mask: The bits of ht_capa which are to be used.
@@ -1203,6 +1222,7 @@ struct cfg80211_connect_params {
1203 const u8 *key; 1222 const u8 *key;
1204 u8 key_len, key_idx; 1223 u8 key_len, key_idx;
1205 u32 flags; 1224 u32 flags;
1225 int bg_scan_period;
1206 struct ieee80211_ht_cap ht_capa; 1226 struct ieee80211_ht_cap ht_capa;
1207 struct ieee80211_ht_cap ht_capa_mask; 1227 struct ieee80211_ht_cap ht_capa_mask;
1208}; 1228};
@@ -1229,8 +1249,7 @@ enum wiphy_params_flags {
1229struct cfg80211_bitrate_mask { 1249struct cfg80211_bitrate_mask {
1230 struct { 1250 struct {
1231 u32 legacy; 1251 u32 legacy;
1232 /* TODO: add support for masking MCS rates; e.g.: */ 1252 u8 mcs[IEEE80211_HT_MCS_MASK_LEN];
1233 /* u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; */
1234 } control[IEEE80211_NUM_BANDS]; 1253 } control[IEEE80211_NUM_BANDS];
1235}; 1254};
1236/** 1255/**
@@ -1343,12 +1362,10 @@ struct cfg80211_gtk_rekey_data {
1343 * 1362 *
1344 * @set_rekey_data: give the data necessary for GTK rekeying to the driver 1363 * @set_rekey_data: give the data necessary for GTK rekeying to the driver
1345 * 1364 *
1346 * @add_beacon: Add a beacon with given parameters, @head, @interval 1365 * @start_ap: Start acting in AP mode defined by the parameters.
1347 * and @dtim_period will be valid, @tail is optional. 1366 * @change_beacon: Change the beacon parameters for an access point mode
1348 * @set_beacon: Change the beacon parameters for an access point mode 1367 * interface. This should reject the call when AP mode wasn't started.
1349 * interface. This should reject the call when no beacon has been 1368 * @stop_ap: Stop being an AP, including stopping beaconing.
1350 * configured.
1351 * @del_beacon: Remove beacon configuration and stop sending the beacon.
1352 * 1369 *
1353 * @add_station: Add a new station. 1370 * @add_station: Add a new station.
1354 * @del_station: Remove a station; @mac may be NULL to remove all stations. 1371 * @del_station: Remove a station; @mac may be NULL to remove all stations.
@@ -1515,11 +1532,11 @@ struct cfg80211_ops {
1515 struct net_device *netdev, 1532 struct net_device *netdev,
1516 u8 key_index); 1533 u8 key_index);
1517 1534
1518 int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev, 1535 int (*start_ap)(struct wiphy *wiphy, struct net_device *dev,
1519 struct beacon_parameters *info); 1536 struct cfg80211_ap_settings *settings);
1520 int (*set_beacon)(struct wiphy *wiphy, struct net_device *dev, 1537 int (*change_beacon)(struct wiphy *wiphy, struct net_device *dev,
1521 struct beacon_parameters *info); 1538 struct cfg80211_beacon_data *info);
1522 int (*del_beacon)(struct wiphy *wiphy, struct net_device *dev); 1539 int (*stop_ap)(struct wiphy *wiphy, struct net_device *dev);
1523 1540
1524 1541
1525 int (*add_station)(struct wiphy *wiphy, struct net_device *dev, 1542 int (*add_station)(struct wiphy *wiphy, struct net_device *dev,
@@ -1574,11 +1591,9 @@ struct cfg80211_ops {
1574 int (*assoc)(struct wiphy *wiphy, struct net_device *dev, 1591 int (*assoc)(struct wiphy *wiphy, struct net_device *dev,
1575 struct cfg80211_assoc_request *req); 1592 struct cfg80211_assoc_request *req);
1576 int (*deauth)(struct wiphy *wiphy, struct net_device *dev, 1593 int (*deauth)(struct wiphy *wiphy, struct net_device *dev,
1577 struct cfg80211_deauth_request *req, 1594 struct cfg80211_deauth_request *req);
1578 void *cookie);
1579 int (*disassoc)(struct wiphy *wiphy, struct net_device *dev, 1595 int (*disassoc)(struct wiphy *wiphy, struct net_device *dev,
1580 struct cfg80211_disassoc_request *req, 1596 struct cfg80211_disassoc_request *req);
1581 void *cookie);
1582 1597
1583 int (*connect)(struct wiphy *wiphy, struct net_device *dev, 1598 int (*connect)(struct wiphy *wiphy, struct net_device *dev,
1584 struct cfg80211_connect_params *sme); 1599 struct cfg80211_connect_params *sme);
@@ -2204,8 +2219,6 @@ struct cfg80211_conn;
2204struct cfg80211_internal_bss; 2219struct cfg80211_internal_bss;
2205struct cfg80211_cached_keys; 2220struct cfg80211_cached_keys;
2206 2221
2207#define MAX_AUTH_BSSES 4
2208
2209/** 2222/**
2210 * struct wireless_dev - wireless per-netdev state 2223 * struct wireless_dev - wireless per-netdev state
2211 * 2224 *
@@ -2269,8 +2282,6 @@ struct wireless_dev {
2269 struct list_head event_list; 2282 struct list_head event_list;
2270 spinlock_t event_lock; 2283 spinlock_t event_lock;
2271 2284
2272 struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES];
2273 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
2274 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 2285 struct cfg80211_internal_bss *current_bss; /* associated / joined */
2275 struct ieee80211_channel *channel; 2286 struct ieee80211_channel *channel;
2276 2287
@@ -2686,7 +2697,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
2686 * @wiphy: the wiphy reporting the BSS 2697 * @wiphy: the wiphy reporting the BSS
2687 * @channel: The channel the frame was received on 2698 * @channel: The channel the frame was received on
2688 * @bssid: the BSSID of the BSS 2699 * @bssid: the BSSID of the BSS
2689 * @timestamp: the TSF timestamp sent by the peer 2700 * @tsf: the TSF sent by the peer in the beacon/probe response (or 0)
2690 * @capability: the capability field sent by the peer 2701 * @capability: the capability field sent by the peer
2691 * @beacon_interval: the beacon interval announced by the peer 2702 * @beacon_interval: the beacon interval announced by the peer
2692 * @ie: additional IEs sent by the peer 2703 * @ie: additional IEs sent by the peer
@@ -2702,9 +2713,8 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
2702struct cfg80211_bss * __must_check 2713struct cfg80211_bss * __must_check
2703cfg80211_inform_bss(struct wiphy *wiphy, 2714cfg80211_inform_bss(struct wiphy *wiphy,
2704 struct ieee80211_channel *channel, 2715 struct ieee80211_channel *channel,
2705 const u8 *bssid, 2716 const u8 *bssid, u64 tsf, u16 capability,
2706 u64 timestamp, u16 capability, u16 beacon_interval, 2717 u16 beacon_interval, const u8 *ie, size_t ielen,
2707 const u8 *ie, size_t ielen,
2708 s32 signal, gfp_t gfp); 2718 s32 signal, gfp_t gfp);
2709 2719
2710struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, 2720struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
@@ -2725,6 +2735,20 @@ struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
2725 struct ieee80211_channel *channel, 2735 struct ieee80211_channel *channel,
2726 const u8 *meshid, size_t meshidlen, 2736 const u8 *meshid, size_t meshidlen,
2727 const u8 *meshcfg); 2737 const u8 *meshcfg);
2738/**
2739 * cfg80211_ref_bss - reference BSS struct
2740 * @bss: the BSS struct to reference
2741 *
2742 * Increments the refcount of the given BSS struct.
2743 */
2744void cfg80211_ref_bss(struct cfg80211_bss *bss);
2745
2746/**
2747 * cfg80211_put_bss - unref BSS struct
2748 * @bss: the BSS struct
2749 *
2750 * Decrements the refcount of the given BSS struct.
2751 */
2728void cfg80211_put_bss(struct cfg80211_bss *bss); 2752void cfg80211_put_bss(struct cfg80211_bss *bss);
2729 2753
2730/** 2754/**
@@ -2762,20 +2786,10 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
2762void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); 2786void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
2763 2787
2764/** 2788/**
2765 * __cfg80211_auth_canceled - notify cfg80211 that authentication was canceled
2766 * @dev: network device
2767 * @addr: The MAC address of the device with which the authentication timed out
2768 *
2769 * When a pending authentication had no action yet, the driver may decide
2770 * to not send a deauth frame, but in that case must calls this function
2771 * to tell cfg80211 about this decision. It is only valid to call this
2772 * function within the deauth() callback.
2773 */
2774void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr);
2775
2776/**
2777 * cfg80211_send_rx_assoc - notification of processed association 2789 * cfg80211_send_rx_assoc - notification of processed association
2778 * @dev: network device 2790 * @dev: network device
2791 * @bss: the BSS struct association was requested for, the struct reference
2792 * is owned by cfg80211 after this call
2779 * @buf: (re)association response frame (header + body) 2793 * @buf: (re)association response frame (header + body)
2780 * @len: length of the frame data 2794 * @len: length of the frame data
2781 * 2795 *
@@ -2784,7 +2798,8 @@ void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr);
2784 * function or cfg80211_send_assoc_timeout() to indicate the result of 2798 * function or cfg80211_send_assoc_timeout() to indicate the result of
2785 * cfg80211_ops::assoc() call. This function may sleep. 2799 * cfg80211_ops::assoc() call. This function may sleep.
2786 */ 2800 */
2787void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); 2801void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss,
2802 const u8 *buf, size_t len);
2788 2803
2789/** 2804/**
2790 * cfg80211_send_assoc_timeout - notification of timed out association 2805 * cfg80211_send_assoc_timeout - notification of timed out association
@@ -3176,6 +3191,7 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp);
3176 * cfg80211_rx_mgmt - notification of received, unprocessed management frame 3191 * cfg80211_rx_mgmt - notification of received, unprocessed management frame
3177 * @dev: network device 3192 * @dev: network device
3178 * @freq: Frequency on which the frame was received in MHz 3193 * @freq: Frequency on which the frame was received in MHz
3194 * @sig_dbm: signal strength in mBm, or 0 if unknown
3179 * @buf: Management frame (header + body) 3195 * @buf: Management frame (header + body)
3180 * @len: length of the frame data 3196 * @len: length of the frame data
3181 * @gfp: context flags 3197 * @gfp: context flags
@@ -3188,8 +3204,8 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp);
3188 * This function is called whenever an Action frame is received for a station 3204 * This function is called whenever an Action frame is received for a station
3189 * mode interface, but is not processed in kernel. 3205 * mode interface, but is not processed in kernel.
3190 */ 3206 */
3191bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf, 3207bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm,
3192 size_t len, gfp_t gfp); 3208 const u8 *buf, size_t len, gfp_t gfp);
3193 3209
3194/** 3210/**
3195 * cfg80211_mgmt_tx_status - notification of TX status for management frame 3211 * cfg80211_mgmt_tx_status - notification of TX status for management frame
@@ -3302,6 +3318,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
3302 * @frame: the frame 3318 * @frame: the frame
3303 * @len: length of the frame 3319 * @len: length of the frame
3304 * @freq: frequency the frame was received on 3320 * @freq: frequency the frame was received on
3321 * @sig_dbm: signal strength in mBm, or 0 if unknown
3305 * @gfp: allocation flags 3322 * @gfp: allocation flags
3306 * 3323 *
3307 * Use this function to report to userspace when a beacon was 3324 * Use this function to report to userspace when a beacon was
@@ -3310,7 +3327,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
3310 */ 3327 */
3311void cfg80211_report_obss_beacon(struct wiphy *wiphy, 3328void cfg80211_report_obss_beacon(struct wiphy *wiphy,
3312 const u8 *frame, size_t len, 3329 const u8 *frame, size_t len,
3313 int freq, gfp_t gfp); 3330 int freq, int sig_dbm, gfp_t gfp);
3314 3331
3315/* 3332/*
3316 * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used 3333 * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used
@@ -3322,6 +3339,14 @@ int cfg80211_can_beacon_sec_chan(struct wiphy *wiphy,
3322 struct ieee80211_channel *chan, 3339 struct ieee80211_channel *chan,
3323 enum nl80211_channel_type channel_type); 3340 enum nl80211_channel_type channel_type);
3324 3341
3342/*
3343 * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units)
3344 * @rate: given rate_info to calculate bitrate from
3345 *
3346 * return 0 if MCS index >= 32
3347 */
3348u16 cfg80211_calculate_bitrate(struct rate_info *rate);
3349
3325/* Logging, debugging and troubleshooting/diagnostic helpers. */ 3350/* Logging, debugging and troubleshooting/diagnostic helpers. */
3326 3351
3327/* wiphy_printk helpers, similar to dev_printk */ 3352/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/compat.h b/include/net/compat.h
index 9ee75edcc295..a974ae92d182 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -41,7 +41,7 @@ extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *);
41#endif /* defined(CONFIG_COMPAT) */ 41#endif /* defined(CONFIG_COMPAT) */
42 42
43extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); 43extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *);
44extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int); 44extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr_storage *, int);
45extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); 45extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned);
46extern asmlinkage long compat_sys_sendmmsg(int, struct compat_mmsghdr __user *, 46extern asmlinkage long compat_sys_sendmmsg(int, struct compat_mmsghdr __user *,
47 unsigned, unsigned); 47 unsigned, unsigned);
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index 2cd66d0be348..f55c980d8e23 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -72,8 +72,8 @@ struct dcbnl_rtnl_ops {
72 void (*getpfccfg)(struct net_device *, int, u8 *); 72 void (*getpfccfg)(struct net_device *, int, u8 *);
73 u8 (*setall)(struct net_device *); 73 u8 (*setall)(struct net_device *);
74 u8 (*getcap)(struct net_device *, int, u8 *); 74 u8 (*getcap)(struct net_device *, int, u8 *);
75 u8 (*getnumtcs)(struct net_device *, int, u8 *); 75 int (*getnumtcs)(struct net_device *, int, u8 *);
76 u8 (*setnumtcs)(struct net_device *, int, u8); 76 int (*setnumtcs)(struct net_device *, int, u8);
77 u8 (*getpfcstate)(struct net_device *); 77 u8 (*getpfcstate)(struct net_device *);
78 void (*setpfcstate)(struct net_device *, u8); 78 void (*setpfcstate)(struct net_device *, u8);
79 void (*getbcncfg)(struct net_device *, int, u32 *); 79 void (*getbcncfg)(struct net_device *, int, u32 *);
diff --git a/include/net/dn.h b/include/net/dn.h
index 298521e0d8a2..814af0b9387d 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/dn.h> 4#include <linux/dn.h>
5#include <net/sock.h> 5#include <net/sock.h>
6#include <net/flow.h>
6#include <asm/byteorder.h> 7#include <asm/byteorder.h>
7#include <asm/unaligned.h> 8#include <asm/unaligned.h>
8 9
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 7db32995ccd3..ccb68880abf5 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -131,35 +131,8 @@ extern void genl_unregister_mc_group(struct genl_family *family,
131extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, 131extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid,
132 u32 group, struct nlmsghdr *nlh, gfp_t flags); 132 u32 group, struct nlmsghdr *nlh, gfp_t flags);
133 133
134/** 134void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq,
135 * genlmsg_put - Add generic netlink header to netlink message 135 struct genl_family *family, int flags, u8 cmd);
136 * @skb: socket buffer holding the message
137 * @pid: netlink pid the message is addressed to
138 * @seq: sequence number (usually the one of the sender)
139 * @family: generic netlink family
140 * @flags netlink message flags
141 * @cmd: generic netlink command
142 *
143 * Returns pointer to user specific header
144 */
145static inline void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq,
146 struct genl_family *family, int flags, u8 cmd)
147{
148 struct nlmsghdr *nlh;
149 struct genlmsghdr *hdr;
150
151 nlh = nlmsg_put(skb, pid, seq, family->id, GENL_HDRLEN +
152 family->hdrsize, flags);
153 if (nlh == NULL)
154 return NULL;
155
156 hdr = nlmsg_data(nlh);
157 hdr->cmd = cmd;
158 hdr->version = family->version;
159 hdr->reserved = 0;
160
161 return (char *) hdr + GENL_HDRLEN;
162}
163 136
164/** 137/**
165 * genlmsg_nlhdr - Obtain netlink header from user specified header 138 * genlmsg_nlhdr - Obtain netlink header from user specified header
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index e3e405106afe..ae17e1352d7e 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -132,6 +132,7 @@ struct rtable;
132 * @tos - TOS 132 * @tos - TOS
133 * @mc_ttl - Multicasting TTL 133 * @mc_ttl - Multicasting TTL
134 * @is_icsk - is this an inet_connection_sock? 134 * @is_icsk - is this an inet_connection_sock?
135 * @uc_index - Unicast outgoing device index
135 * @mc_index - Multicast device index 136 * @mc_index - Multicast device index
136 * @mc_list - Group array 137 * @mc_list - Group array
137 * @cork - info to build ip hdr on each ip frag while socket is corked 138 * @cork - info to build ip hdr on each ip frag while socket is corked
@@ -167,6 +168,8 @@ struct inet_sock {
167 transparent:1, 168 transparent:1,
168 mc_all:1, 169 mc_all:1,
169 nodefrag:1; 170 nodefrag:1;
171 __u8 rcv_tos;
172 int uc_index;
170 int mc_index; 173 int mc_index;
171 __be32 mc_addr; 174 __be32 mc_addr;
172 struct ip_mc_socklist __rcu *mc_list; 175 struct ip_mc_socklist __rcu *mc_list;
diff --git a/include/net/ip.h b/include/net/ip.h
index 775009f9eaba..b53d65f24f7b 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -388,7 +388,7 @@ static inline int sk_mc_loop(struct sock *sk)
388 return 1; 388 return 1;
389} 389}
390 390
391extern int ip_call_ra_chain(struct sk_buff *skb); 391extern bool ip_call_ra_chain(struct sk_buff *skb);
392 392
393/* 393/*
394 * Functions provided by ip_fragment.c 394 * Functions provided by ip_fragment.c
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
index 0954ec959159..cc7c19732389 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
@@ -62,6 +62,7 @@ struct sock_msg_q {
62#define AF_IUCV_FLAG_SYN 0x2 62#define AF_IUCV_FLAG_SYN 0x2
63#define AF_IUCV_FLAG_FIN 0x4 63#define AF_IUCV_FLAG_FIN 0x4
64#define AF_IUCV_FLAG_WIN 0x8 64#define AF_IUCV_FLAG_WIN 0x8
65#define AF_IUCV_FLAG_SHT 0x10
65 66
66struct af_iucv_trans_hdr { 67struct af_iucv_trans_hdr {
67 u16 magic; 68 u16 magic;
@@ -113,6 +114,7 @@ struct iucv_sock {
113 spinlock_t accept_q_lock; 114 spinlock_t accept_q_lock;
114 struct sock *parent; 115 struct sock *parent;
115 struct iucv_path *path; 116 struct iucv_path *path;
117 struct net_device *hs_dev;
116 struct sk_buff_head send_skb_q; 118 struct sk_buff_head send_skb_q;
117 struct sk_buff_head backlog_skb_q; 119 struct sk_buff_head backlog_skb_q;
118 struct sock_msg_q message_q; 120 struct sock_msg_q message_q;
@@ -131,6 +133,7 @@ struct iucv_sock {
131/* iucv socket options (SOL_IUCV) */ 133/* iucv socket options (SOL_IUCV) */
132#define SO_IPRMDATA_MSG 0x0080 /* send/recv IPRM_DATA msgs */ 134#define SO_IPRMDATA_MSG 0x0080 /* send/recv IPRM_DATA msgs */
133#define SO_MSGLIMIT 0x1000 /* get/set IUCV MSGLIMIT */ 135#define SO_MSGLIMIT 0x1000 /* get/set IUCV MSGLIMIT */
136#define SO_MSGSIZE 0x0800 /* get maximum msgsize */
134 137
135/* iucv related control messages (scm) */ 138/* iucv related control messages (scm) */
136#define SCM_IUCV_TRGCLS 0x0001 /* target class control message */ 139#define SCM_IUCV_TRGCLS 0x0001 /* target class control message */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d49928ba5d09..9a012be615ff 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -229,7 +229,8 @@ enum ieee80211_rssi_event {
229 * valid in station mode only while @assoc is true and if also 229 * valid in station mode only while @assoc is true and if also
230 * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf 230 * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf
231 * @ps_dtim_period) 231 * @ps_dtim_period)
232 * @timestamp: beacon timestamp 232 * @last_tsf: last beacon's/probe response's TSF timestamp (could be old
233 * as it may have been received during scanning long ago)
233 * @beacon_int: beacon interval 234 * @beacon_int: beacon interval
234 * @assoc_capability: capabilities taken from assoc resp 235 * @assoc_capability: capabilities taken from assoc resp
235 * @basic_rates: bitmap of basic rates, each bit stands for an 236 * @basic_rates: bitmap of basic rates, each bit stands for an
@@ -276,7 +277,7 @@ struct ieee80211_bss_conf {
276 u8 dtim_period; 277 u8 dtim_period;
277 u16 beacon_int; 278 u16 beacon_int;
278 u16 assoc_capability; 279 u16 assoc_capability;
279 u64 timestamp; 280 u64 last_tsf;
280 u32 basic_rates; 281 u32 basic_rates;
281 int mcast_rate[IEEE80211_NUM_BANDS]; 282 int mcast_rate[IEEE80211_NUM_BANDS];
282 u16 ht_operation_mode; 283 u16 ht_operation_mode;
@@ -341,9 +342,9 @@ struct ieee80211_bss_conf {
341 * used to indicate that a frame was already retried due to PS 342 * used to indicate that a frame was already retried due to PS
342 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211, 343 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
343 * used to indicate frame should not be encrypted 344 * used to indicate frame should not be encrypted
344 * @IEEE80211_TX_CTL_POLL_RESPONSE: This frame is a response to a poll 345 * @IEEE80211_TX_CTL_NO_PS_BUFFER: This frame is a response to a poll
345 * frame (PS-Poll or uAPSD) and should be sent although the station 346 * frame (PS-Poll or uAPSD) or a non-bufferable MMPDU and must
346 * is in powersave mode. 347 * be sent although the station is in powersave mode.
347 * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the 348 * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the
348 * transmit function after the current frame, this can be used 349 * transmit function after the current frame, this can be used
349 * by drivers to kick the DMA queue only if unset or when the 350 * by drivers to kick the DMA queue only if unset or when the
@@ -399,7 +400,7 @@ enum mac80211_tx_control_flags {
399 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 400 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
400 IEEE80211_TX_INTFL_RETRIED = BIT(15), 401 IEEE80211_TX_INTFL_RETRIED = BIT(15),
401 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), 402 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
402 IEEE80211_TX_CTL_POLL_RESPONSE = BIT(17), 403 IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17),
403 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), 404 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
404 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), 405 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19),
405 /* hole at 20, use later */ 406 /* hole at 20, use later */
@@ -425,7 +426,7 @@ enum mac80211_tx_control_flags {
425 IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ 426 IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \
426 IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ 427 IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \
427 IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ 428 IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \
428 IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_POLL_RESPONSE | \ 429 IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_NO_PS_BUFFER | \
429 IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ 430 IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \
430 IEEE80211_TX_CTL_STBC | IEEE80211_TX_STATUS_EOSP) 431 IEEE80211_TX_CTL_STBC | IEEE80211_TX_STATUS_EOSP)
431 432
@@ -659,6 +660,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
659 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index 660 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index
660 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used 661 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used
661 * @RX_FLAG_SHORT_GI: Short guard interval was used 662 * @RX_FLAG_SHORT_GI: Short guard interval was used
663 * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present.
664 * Valid only for data frames (mainly A-MPDU)
662 */ 665 */
663enum mac80211_rx_flags { 666enum mac80211_rx_flags {
664 RX_FLAG_MMIC_ERROR = 1<<0, 667 RX_FLAG_MMIC_ERROR = 1<<0,
@@ -672,6 +675,7 @@ enum mac80211_rx_flags {
672 RX_FLAG_HT = 1<<9, 675 RX_FLAG_HT = 1<<9,
673 RX_FLAG_40MHZ = 1<<10, 676 RX_FLAG_40MHZ = 1<<10,
674 RX_FLAG_SHORT_GI = 1<<11, 677 RX_FLAG_SHORT_GI = 1<<11,
678 RX_FLAG_NO_SIGNAL_VAL = 1<<12,
675}; 679};
676 680
677/** 681/**
@@ -852,6 +856,21 @@ struct ieee80211_channel_switch {
852}; 856};
853 857
854/** 858/**
859 * enum ieee80211_vif_flags - virtual interface flags
860 *
861 * @IEEE80211_VIF_BEACON_FILTER: the device performs beacon filtering
862 * on this virtual interface to avoid unnecessary CPU wakeups
863 * @IEEE80211_VIF_SUPPORTS_CQM_RSSI: the device can do connection quality
864 * monitoring on this virtual interface -- i.e. it can monitor
865 * connection quality related parameters, such as the RSSI level and
866 * provide notifications if configured trigger levels are reached.
867 */
868enum ieee80211_vif_flags {
869 IEEE80211_VIF_BEACON_FILTER = BIT(0),
870 IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1),
871};
872
873/**
855 * struct ieee80211_vif - per-interface data 874 * struct ieee80211_vif - per-interface data
856 * 875 *
857 * Data in this structure is continually present for driver 876 * Data in this structure is continually present for driver
@@ -863,6 +882,10 @@ struct ieee80211_channel_switch {
863 * @addr: address of this interface 882 * @addr: address of this interface
864 * @p2p: indicates whether this AP or STA interface is a p2p 883 * @p2p: indicates whether this AP or STA interface is a p2p
865 * interface, i.e. a GO or p2p-sta respectively 884 * interface, i.e. a GO or p2p-sta respectively
885 * @driver_flags: flags/capabilities the driver has for this interface,
886 * these need to be set (or cleared) when the interface is added
887 * or, if supported by the driver, the interface type is changed
888 * at runtime, mac80211 will never touch this field
866 * @drv_priv: data area for driver use, will always be aligned to 889 * @drv_priv: data area for driver use, will always be aligned to
867 * sizeof(void *). 890 * sizeof(void *).
868 */ 891 */
@@ -871,6 +894,7 @@ struct ieee80211_vif {
871 struct ieee80211_bss_conf bss_conf; 894 struct ieee80211_bss_conf bss_conf;
872 u8 addr[ETH_ALEN]; 895 u8 addr[ETH_ALEN];
873 bool p2p; 896 bool p2p;
897 u32 driver_flags;
874 /* must be last */ 898 /* must be last */
875 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 899 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
876}; 900};
@@ -962,6 +986,25 @@ enum set_key_cmd {
962}; 986};
963 987
964/** 988/**
989 * enum ieee80211_sta_state - station state
990 *
991 * @IEEE80211_STA_NOTEXIST: station doesn't exist at all,
992 * this is a special state for add/remove transitions
993 * @IEEE80211_STA_NONE: station exists without special state
994 * @IEEE80211_STA_AUTH: station is authenticated
995 * @IEEE80211_STA_ASSOC: station is associated
996 * @IEEE80211_STA_AUTHORIZED: station is authorized (802.1X)
997 */
998enum ieee80211_sta_state {
999 /* NOTE: These need to be ordered correctly! */
1000 IEEE80211_STA_NOTEXIST,
1001 IEEE80211_STA_NONE,
1002 IEEE80211_STA_AUTH,
1003 IEEE80211_STA_ASSOC,
1004 IEEE80211_STA_AUTHORIZED,
1005};
1006
1007/**
965 * struct ieee80211_sta - station table entry 1008 * struct ieee80211_sta - station table entry
966 * 1009 *
967 * A station table entry represents a station we are possibly 1010 * A station table entry represents a station we are possibly
@@ -1079,10 +1122,6 @@ enum sta_notify_cmd {
1079 * @IEEE80211_HW_MFP_CAPABLE: 1122 * @IEEE80211_HW_MFP_CAPABLE:
1080 * Hardware supports management frame protection (MFP, IEEE 802.11w). 1123 * Hardware supports management frame protection (MFP, IEEE 802.11w).
1081 * 1124 *
1082 * @IEEE80211_HW_BEACON_FILTER:
1083 * Hardware supports dropping of irrelevant beacon frames to
1084 * avoid waking up cpu.
1085 *
1086 * @IEEE80211_HW_SUPPORTS_STATIC_SMPS: 1125 * @IEEE80211_HW_SUPPORTS_STATIC_SMPS:
1087 * Hardware supports static spatial multiplexing powersave, 1126 * Hardware supports static spatial multiplexing powersave,
1088 * ie. can turn off all but one chain even on HT connections 1127 * ie. can turn off all but one chain even on HT connections
@@ -1108,11 +1147,6 @@ enum sta_notify_cmd {
1108 * When this flag is set, signaling beacon-loss will cause an immediate 1147 * When this flag is set, signaling beacon-loss will cause an immediate
1109 * change to disassociated state. 1148 * change to disassociated state.
1110 * 1149 *
1111 * @IEEE80211_HW_SUPPORTS_CQM_RSSI:
1112 * Hardware can do connection quality monitoring - i.e. it can monitor
1113 * connection quality related parameters, such as the RSSI level and
1114 * provide notifications if configured trigger levels are reached.
1115 *
1116 * @IEEE80211_HW_NEED_DTIM_PERIOD: 1150 * @IEEE80211_HW_NEED_DTIM_PERIOD:
1117 * This device needs to know the DTIM period for the BSS before 1151 * This device needs to know the DTIM period for the BSS before
1118 * associating. 1152 * associating.
@@ -1134,6 +1168,10 @@ enum sta_notify_cmd {
1134 * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session 1168 * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session
1135 * setup strictly in HW. mac80211 should not attempt to do this in 1169 * setup strictly in HW. mac80211 should not attempt to do this in
1136 * software. 1170 * software.
1171 *
1172 * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while
1173 * being idle (i.e. mac80211 doesn't have to go idle-off during the
1174 * the scan).
1137 */ 1175 */
1138enum ieee80211_hw_flags { 1176enum ieee80211_hw_flags {
1139 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1177 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1150,16 +1188,17 @@ enum ieee80211_hw_flags {
1150 IEEE80211_HW_PS_NULLFUNC_STACK = 1<<11, 1188 IEEE80211_HW_PS_NULLFUNC_STACK = 1<<11,
1151 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, 1189 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12,
1152 IEEE80211_HW_MFP_CAPABLE = 1<<13, 1190 IEEE80211_HW_MFP_CAPABLE = 1<<13,
1153 IEEE80211_HW_BEACON_FILTER = 1<<14, 1191 /* reuse bit 14 */
1154 IEEE80211_HW_SUPPORTS_STATIC_SMPS = 1<<15, 1192 IEEE80211_HW_SUPPORTS_STATIC_SMPS = 1<<15,
1155 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16, 1193 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16,
1156 IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, 1194 IEEE80211_HW_SUPPORTS_UAPSD = 1<<17,
1157 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, 1195 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18,
1158 IEEE80211_HW_CONNECTION_MONITOR = 1<<19, 1196 IEEE80211_HW_CONNECTION_MONITOR = 1<<19,
1159 IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, 1197 /* reuse bit 20 */
1160 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, 1198 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1161 IEEE80211_HW_AP_LINK_PS = 1<<22, 1199 IEEE80211_HW_AP_LINK_PS = 1<<22,
1162 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, 1200 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
1201 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24,
1163}; 1202};
1164 1203
1165/** 1204/**
@@ -1446,8 +1485,8 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1446 * way the host will only receive beacons where some relevant information 1485 * way the host will only receive beacons where some relevant information
1447 * (for example ERP protection or WMM settings) have changed. 1486 * (for example ERP protection or WMM settings) have changed.
1448 * 1487 *
1449 * Beacon filter support is advertised with the %IEEE80211_HW_BEACON_FILTER 1488 * Beacon filter support is advertised with the %IEEE80211_VIF_BEACON_FILTER
1450 * hardware capability. The driver needs to enable beacon filter support 1489 * interface capability. The driver needs to enable beacon filter support
1451 * whenever power save is enabled, that is %IEEE80211_CONF_PS is set. When 1490 * whenever power save is enabled, that is %IEEE80211_CONF_PS is set. When
1452 * power save is enabled, the stack will not check for beacon loss and the 1491 * power save is enabled, the stack will not check for beacon loss and the
1453 * driver needs to notify about loss of beacons with ieee80211_beacon_loss(). 1492 * driver needs to notify about loss of beacons with ieee80211_beacon_loss().
@@ -1599,7 +1638,7 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1599 * the station sends a PS-Poll or a uAPSD trigger frame, mac80211 1638 * the station sends a PS-Poll or a uAPSD trigger frame, mac80211
1600 * will inform the driver of this with the @allow_buffered_frames 1639 * will inform the driver of this with the @allow_buffered_frames
1601 * callback; this callback is optional. mac80211 will then transmit 1640 * callback; this callback is optional. mac80211 will then transmit
1602 * the frames as usual and set the %IEEE80211_TX_CTL_POLL_RESPONSE 1641 * the frames as usual and set the %IEEE80211_TX_CTL_NO_PS_BUFFER
1603 * on each frame. The last frame in the service period (or the only 1642 * on each frame. The last frame in the service period (or the only
1604 * response to a PS-Poll) also has %IEEE80211_TX_STATUS_EOSP set to 1643 * response to a PS-Poll) also has %IEEE80211_TX_STATUS_EOSP set to
1605 * indicate that it ends the service period; as this frame must have 1644 * indicate that it ends the service period; as this frame must have
@@ -1607,6 +1646,9 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1607 * When TX status is reported for this frame, the service period is 1646 * When TX status is reported for this frame, the service period is
1608 * marked has having ended and a new one can be started by the peer. 1647 * marked has having ended and a new one can be started by the peer.
1609 * 1648 *
1649 * Additionally, non-bufferable MMPDUs can also be transmitted by
1650 * mac80211 with the %IEEE80211_TX_CTL_NO_PS_BUFFER set in them.
1651 *
1610 * Another race condition can happen on some devices like iwlwifi 1652 * Another race condition can happen on some devices like iwlwifi
1611 * when there are frames queued for the station and it wakes up 1653 * when there are frames queued for the station and it wakes up
1612 * or polls; the frames that are already queued could end up being 1654 * or polls; the frames that are already queued could end up being
@@ -1725,20 +1767,6 @@ enum ieee80211_ampdu_mlme_action {
1725}; 1767};
1726 1768
1727/** 1769/**
1728 * enum ieee80211_tx_sync_type - TX sync type
1729 * @IEEE80211_TX_SYNC_AUTH: sync TX for authentication
1730 * (and possibly also before direct probe)
1731 * @IEEE80211_TX_SYNC_ASSOC: sync TX for association
1732 * @IEEE80211_TX_SYNC_ACTION: sync TX for action frame
1733 * (not implemented yet)
1734 */
1735enum ieee80211_tx_sync_type {
1736 IEEE80211_TX_SYNC_AUTH,
1737 IEEE80211_TX_SYNC_ASSOC,
1738 IEEE80211_TX_SYNC_ACTION,
1739};
1740
1741/**
1742 * enum ieee80211_frame_release_type - frame release reason 1770 * enum ieee80211_frame_release_type - frame release reason
1743 * @IEEE80211_FRAME_RELEASE_PSPOLL: frame released for PS-Poll 1771 * @IEEE80211_FRAME_RELEASE_PSPOLL: frame released for PS-Poll
1744 * @IEEE80211_FRAME_RELEASE_UAPSD: frame(s) released due to 1772 * @IEEE80211_FRAME_RELEASE_UAPSD: frame(s) released due to
@@ -1848,26 +1876,6 @@ enum ieee80211_frame_release_type {
1848 * of the bss parameters has changed when a call is made. The callback 1876 * of the bss parameters has changed when a call is made. The callback
1849 * can sleep. 1877 * can sleep.
1850 * 1878 *
1851 * @tx_sync: Called before a frame is sent to an AP/GO. In the GO case, the
1852 * driver should sync with the GO's powersaving so the device doesn't
1853 * transmit the frame while the GO is asleep. In the regular AP case
1854 * it may be used by drivers for devices implementing other restrictions
1855 * on talking to APs, e.g. due to regulatory enforcement or just HW
1856 * restrictions.
1857 * This function is called for every authentication, association and
1858 * action frame separately since applications might attempt to auth
1859 * with multiple APs before chosing one to associate to. If it returns
1860 * an error, the corresponding authentication, association or frame
1861 * transmission is aborted and reported as having failed. It is always
1862 * called after tuning to the correct channel.
1863 * The callback might be called multiple times before @finish_tx_sync
1864 * (but @finish_tx_sync will be called once for each) but in practice
1865 * this is unlikely to happen. It can also refuse in that case if the
1866 * driver cannot handle that situation.
1867 * This callback can sleep.
1868 * @finish_tx_sync: Called as a counterpart to @tx_sync, unless that returned
1869 * an error. This callback can sleep.
1870 *
1871 * @prepare_multicast: Prepare for multicast filter configuration. 1879 * @prepare_multicast: Prepare for multicast filter configuration.
1872 * This callback is optional, and its return value is passed 1880 * This callback is optional, and its return value is passed
1873 * to configure_filter(). This callback must be atomic. 1881 * to configure_filter(). This callback must be atomic.
@@ -1963,6 +1971,13 @@ enum ieee80211_frame_release_type {
1963 * in AP mode, this callback will not be called when the flag 1971 * in AP mode, this callback will not be called when the flag
1964 * %IEEE80211_HW_AP_LINK_PS is set. Must be atomic. 1972 * %IEEE80211_HW_AP_LINK_PS is set. Must be atomic.
1965 * 1973 *
1974 * @sta_state: Notifies low level driver about state transition of a
1975 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.)
1976 * This callback is mutually exclusive with @sta_add/@sta_remove.
1977 * It must not fail for down transitions but may fail for transitions
1978 * up the list of states.
1979 * The callback can sleep.
1980 *
1966 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1981 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1967 * bursting) for a hardware TX queue. 1982 * bursting) for a hardware TX queue.
1968 * Returns a negative error code on failure. 1983 * Returns a negative error code on failure.
@@ -2098,7 +2113,7 @@ enum ieee80211_frame_release_type {
2098 * @allow_buffered_frames: Prepare device to allow the given number of frames 2113 * @allow_buffered_frames: Prepare device to allow the given number of frames
2099 * to go out to the given station. The frames will be sent by mac80211 2114 * to go out to the given station. The frames will be sent by mac80211
2100 * via the usual TX path after this call. The TX information for frames 2115 * via the usual TX path after this call. The TX information for frames
2101 * released will also have the %IEEE80211_TX_CTL_POLL_RESPONSE flag set 2116 * released will also have the %IEEE80211_TX_CTL_NO_PS_BUFFER flag set
2102 * and the last one will also have %IEEE80211_TX_STATUS_EOSP set. In case 2117 * and the last one will also have %IEEE80211_TX_STATUS_EOSP set. In case
2103 * frames from multiple TIDs are released and the driver might reorder 2118 * frames from multiple TIDs are released and the driver might reorder
2104 * them between the TIDs, it must set the %IEEE80211_TX_STATUS_EOSP flag 2119 * them between the TIDs, it must set the %IEEE80211_TX_STATUS_EOSP flag
@@ -2132,13 +2147,6 @@ struct ieee80211_ops {
2132 struct ieee80211_bss_conf *info, 2147 struct ieee80211_bss_conf *info,
2133 u32 changed); 2148 u32 changed);
2134 2149
2135 int (*tx_sync)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2136 const u8 *bssid, enum ieee80211_tx_sync_type type);
2137 void (*finish_tx_sync)(struct ieee80211_hw *hw,
2138 struct ieee80211_vif *vif,
2139 const u8 *bssid,
2140 enum ieee80211_tx_sync_type type);
2141
2142 u64 (*prepare_multicast)(struct ieee80211_hw *hw, 2150 u64 (*prepare_multicast)(struct ieee80211_hw *hw,
2143 struct netdev_hw_addr_list *mc_list); 2151 struct netdev_hw_addr_list *mc_list);
2144 void (*configure_filter)(struct ieee80211_hw *hw, 2152 void (*configure_filter)(struct ieee80211_hw *hw,
@@ -2182,6 +2190,10 @@ struct ieee80211_ops {
2182 struct ieee80211_sta *sta); 2190 struct ieee80211_sta *sta);
2183 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2191 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2184 enum sta_notify_cmd, struct ieee80211_sta *sta); 2192 enum sta_notify_cmd, struct ieee80211_sta *sta);
2193 int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2194 struct ieee80211_sta *sta,
2195 enum ieee80211_sta_state old_state,
2196 enum ieee80211_sta_state new_state);
2185 int (*conf_tx)(struct ieee80211_hw *hw, 2197 int (*conf_tx)(struct ieee80211_hw *hw,
2186 struct ieee80211_vif *vif, u16 queue, 2198 struct ieee80211_vif *vif, u16 queue,
2187 const struct ieee80211_tx_queue_params *params); 2199 const struct ieee80211_tx_queue_params *params);
@@ -3316,7 +3328,7 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
3316 * 3328 *
3317 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3329 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3318 * 3330 *
3319 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER and 3331 * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER and
3320 * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the 3332 * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the
3321 * hardware is not receiving beacons with this function. 3333 * hardware is not receiving beacons with this function.
3322 */ 3334 */
@@ -3327,7 +3339,7 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
3327 * 3339 *
3328 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3340 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3329 * 3341 *
3330 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER, and 3342 * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and
3331 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver 3343 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver
3332 * needs to inform if the connection to the AP has been lost. 3344 * needs to inform if the connection to the AP has been lost.
3333 * 3345 *
@@ -3397,7 +3409,7 @@ void ieee80211_enable_dyn_ps(struct ieee80211_vif *vif);
3397 * @rssi_event: the RSSI trigger event type 3409 * @rssi_event: the RSSI trigger event type
3398 * @gfp: context flags 3410 * @gfp: context flags
3399 * 3411 *
3400 * When the %IEEE80211_HW_SUPPORTS_CQM_RSSI is set, and a connection quality 3412 * When the %IEEE80211_VIF_SUPPORTS_CQM_RSSI is set, and a connection quality
3401 * monitoring is configured with an rssi threshold, the driver will inform 3413 * monitoring is configured with an rssi threshold, the driver will inform
3402 * whenever the rssi level reaches the threshold. 3414 * whenever the rssi level reaches the threshold.
3403 */ 3415 */
@@ -3516,6 +3528,8 @@ enum rate_control_changed {
3516 * @hw: The hardware the algorithm is invoked for. 3528 * @hw: The hardware the algorithm is invoked for.
3517 * @sband: The band this frame is being transmitted on. 3529 * @sband: The band this frame is being transmitted on.
3518 * @bss_conf: the current BSS configuration 3530 * @bss_conf: the current BSS configuration
3531 * @skb: the skb that will be transmitted, the control information in it needs
3532 * to be filled in
3519 * @reported_rate: The rate control algorithm can fill this in to indicate 3533 * @reported_rate: The rate control algorithm can fill this in to indicate
3520 * which rate should be reported to userspace as the current rate and 3534 * which rate should be reported to userspace as the current rate and
3521 * used for rate calculations in the mesh network. 3535 * used for rate calculations in the mesh network.
@@ -3523,12 +3537,11 @@ enum rate_control_changed {
3523 * RTS threshold 3537 * RTS threshold
3524 * @short_preamble: whether mac80211 will request short-preamble transmission 3538 * @short_preamble: whether mac80211 will request short-preamble transmission
3525 * if the selected rate supports it 3539 * if the selected rate supports it
3526 * @max_rate_idx: user-requested maximum rate (not MCS for now) 3540 * @max_rate_idx: user-requested maximum (legacy) rate
3527 * (deprecated; this will be removed once drivers get updated to use 3541 * (deprecated; this will be removed once drivers get updated to use
3528 * rate_idx_mask) 3542 * rate_idx_mask)
3529 * @rate_idx_mask: user-requested rate mask (not MCS for now) 3543 * @rate_idx_mask: user-requested (legacy) rate mask
3530 * @skb: the skb that will be transmitted, the control information in it needs 3544 * @rate_idx_mcs_mask: user-requested MCS rate mask
3531 * to be filled in
3532 * @bss: whether this frame is sent out in AP or IBSS mode 3545 * @bss: whether this frame is sent out in AP or IBSS mode
3533 */ 3546 */
3534struct ieee80211_tx_rate_control { 3547struct ieee80211_tx_rate_control {
@@ -3540,6 +3553,7 @@ struct ieee80211_tx_rate_control {
3540 bool rts, short_preamble; 3553 bool rts, short_preamble;
3541 u8 max_rate_idx; 3554 u8 max_rate_idx;
3542 u32 rate_idx_mask; 3555 u32 rate_idx_mask;
3556 u8 rate_idx_mcs_mask[IEEE80211_HT_MCS_MASK_LEN];
3543 bool bss; 3557 bool bss;
3544}; 3558};
3545 3559
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index e3133c23980e..6f9c25a76cd1 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -133,7 +133,6 @@ extern void ndisc_send_rs(struct net_device *dev,
133 const struct in6_addr *daddr); 133 const struct in6_addr *daddr);
134 134
135extern void ndisc_send_redirect(struct sk_buff *skb, 135extern void ndisc_send_redirect(struct sk_buff *skb,
136 struct neighbour *neigh,
137 const struct in6_addr *target); 136 const struct in6_addr *target);
138 137
139extern int ndisc_mc_map(const struct in6_addr *addr, char *buf, 138extern int ndisc_mc_map(const struct in6_addr *addr, char *buf,
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 2dcf31703acb..96755c3798a5 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -20,6 +20,9 @@ enum nf_ct_ext_id {
20#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP 20#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
21 NF_CT_EXT_TSTAMP, 21 NF_CT_EXT_TSTAMP,
22#endif 22#endif
23#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
24 NF_CT_EXT_TIMEOUT,
25#endif
23 NF_CT_EXT_NUM, 26 NF_CT_EXT_NUM,
24}; 27};
25 28
@@ -29,6 +32,7 @@ enum nf_ct_ext_id {
29#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache 32#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache
30#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone 33#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone
31#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp 34#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp
35#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout
32 36
33/* Extensions: optional stuff which isn't permanently in struct. */ 37/* Extensions: optional stuff which isn't permanently in struct. */
34struct nf_ct_ext { 38struct nf_ct_ext {
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index f1c1311adc2c..5767dc242dee 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -69,4 +69,17 @@ extern int nf_conntrack_broadcast_help(struct sk_buff *skb,
69 enum ip_conntrack_info ctinfo, 69 enum ip_conntrack_info ctinfo,
70 unsigned int timeout); 70 unsigned int timeout);
71 71
72struct nf_ct_helper_expectfn {
73 struct list_head head;
74 const char *name;
75 void (*expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp);
76};
77
78void nf_ct_helper_expectfn_register(struct nf_ct_helper_expectfn *n);
79void nf_ct_helper_expectfn_unregister(struct nf_ct_helper_expectfn *n);
80struct nf_ct_helper_expectfn *
81nf_ct_helper_expectfn_find_by_name(const char *name);
82struct nf_ct_helper_expectfn *
83nf_ct_helper_expectfn_find_by_symbol(const void *symbol);
84
72#endif /*_NF_CONNTRACK_HELPER_H*/ 85#endif /*_NF_CONNTRACK_HELPER_H*/
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index e3d3ee3c06a2..90c67c7db7e9 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -39,12 +39,13 @@ struct nf_conntrack_l4proto {
39 unsigned int dataoff, 39 unsigned int dataoff,
40 enum ip_conntrack_info ctinfo, 40 enum ip_conntrack_info ctinfo,
41 u_int8_t pf, 41 u_int8_t pf,
42 unsigned int hooknum); 42 unsigned int hooknum,
43 unsigned int *timeouts);
43 44
44 /* Called when a new connection for this protocol found; 45 /* Called when a new connection for this protocol found;
45 * returns TRUE if it's OK. If so, packet() called next. */ 46 * returns TRUE if it's OK. If so, packet() called next. */
46 bool (*new)(struct nf_conn *ct, const struct sk_buff *skb, 47 bool (*new)(struct nf_conn *ct, const struct sk_buff *skb,
47 unsigned int dataoff); 48 unsigned int dataoff, unsigned int *timeouts);
48 49
49 /* Called when a conntrack entry is destroyed */ 50 /* Called when a conntrack entry is destroyed */
50 void (*destroy)(struct nf_conn *ct); 51 void (*destroy)(struct nf_conn *ct);
@@ -60,6 +61,9 @@ struct nf_conntrack_l4proto {
60 /* Print out the private part of the conntrack. */ 61 /* Print out the private part of the conntrack. */
61 int (*print_conntrack)(struct seq_file *s, struct nf_conn *); 62 int (*print_conntrack)(struct seq_file *s, struct nf_conn *);
62 63
64 /* Return the array of timeouts for this protocol. */
65 unsigned int *(*get_timeouts)(struct net *net);
66
63 /* convert protoinfo to nfnetink attributes */ 67 /* convert protoinfo to nfnetink attributes */
64 int (*to_nlattr)(struct sk_buff *skb, struct nlattr *nla, 68 int (*to_nlattr)(struct sk_buff *skb, struct nlattr *nla,
65 struct nf_conn *ct); 69 struct nf_conn *ct);
@@ -79,6 +83,17 @@ struct nf_conntrack_l4proto {
79 83
80 size_t nla_size; 84 size_t nla_size;
81 85
86#if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT)
87 struct {
88 size_t obj_size;
89 int (*nlattr_to_obj)(struct nlattr *tb[], void *data);
90 int (*obj_to_nlattr)(struct sk_buff *skb, const void *data);
91
92 unsigned int nlattr_max;
93 const struct nla_policy *nla_policy;
94 } ctnl_timeout;
95#endif
96
82#ifdef CONFIG_SYSCTL 97#ifdef CONFIG_SYSCTL
83 struct ctl_table_header **ctl_table_header; 98 struct ctl_table_header **ctl_table_header;
84 struct ctl_table *ctl_table; 99 struct ctl_table *ctl_table;
diff --git a/include/net/netfilter/nf_conntrack_timeout.h b/include/net/netfilter/nf_conntrack_timeout.h
new file mode 100644
index 000000000000..0e04db4a0865
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_timeout.h
@@ -0,0 +1,78 @@
1#ifndef _NF_CONNTRACK_TIMEOUT_H
2#define _NF_CONNTRACK_TIMEOUT_H
3
4#include <net/net_namespace.h>
5#include <linux/netfilter/nf_conntrack_common.h>
6#include <linux/netfilter/nf_conntrack_tuple_common.h>
7#include <net/netfilter/nf_conntrack.h>
8#include <net/netfilter/nf_conntrack_extend.h>
9
10#define CTNL_TIMEOUT_NAME_MAX 32
11
12struct ctnl_timeout {
13 struct list_head head;
14 struct rcu_head rcu_head;
15 atomic_t refcnt;
16 char name[CTNL_TIMEOUT_NAME_MAX];
17 __u16 l3num;
18 __u8 l4num;
19 char data[0];
20};
21
22struct nf_conn_timeout {
23 struct ctnl_timeout *timeout;
24};
25
26#define NF_CT_TIMEOUT_EXT_DATA(__t) (unsigned int *) &((__t)->timeout->data)
27
28static inline
29struct nf_conn_timeout *nf_ct_timeout_find(const struct nf_conn *ct)
30{
31#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
32 return nf_ct_ext_find(ct, NF_CT_EXT_TIMEOUT);
33#else
34 return NULL;
35#endif
36}
37
38static inline
39struct nf_conn_timeout *nf_ct_timeout_ext_add(struct nf_conn *ct,
40 struct ctnl_timeout *timeout,
41 gfp_t gfp)
42{
43#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
44 struct nf_conn_timeout *timeout_ext;
45
46 timeout_ext = nf_ct_ext_add(ct, NF_CT_EXT_TIMEOUT, gfp);
47 if (timeout_ext == NULL)
48 return NULL;
49
50 timeout_ext->timeout = timeout;
51
52 return timeout_ext;
53#else
54 return NULL;
55#endif
56};
57
58#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
59extern int nf_conntrack_timeout_init(struct net *net);
60extern void nf_conntrack_timeout_fini(struct net *net);
61#else
62static inline int nf_conntrack_timeout_init(struct net *net)
63{
64 return 0;
65}
66
67static inline void nf_conntrack_timeout_fini(struct net *net)
68{
69 return;
70}
71#endif /* CONFIG_NF_CONNTRACK_TIMEOUT */
72
73#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
74extern struct ctnl_timeout *(*nf_ct_timeout_find_get_hook)(const char *name);
75extern void (*nf_ct_timeout_put_hook)(struct ctnl_timeout *timeout);
76#endif
77
78#endif /* _NF_CONNTRACK_TIMEOUT_H */
diff --git a/include/net/netfilter/xt_log.h b/include/net/netfilter/xt_log.h
index 0dfb34a5b53c..7e1544e8f70d 100644
--- a/include/net/netfilter/xt_log.h
+++ b/include/net/netfilter/xt_log.h
@@ -6,7 +6,7 @@ struct sbuff {
6}; 6};
7static struct sbuff emergency, *emergency_ptr = &emergency; 7static struct sbuff emergency, *emergency_ptr = &emergency;
8 8
9static int sb_add(struct sbuff *m, const char *f, ...) 9static __printf(2, 3) int sb_add(struct sbuff *m, const char *f, ...)
10{ 10{
11 va_list args; 11 va_list args;
12 int len; 12 int len;
diff --git a/include/net/netlink.h b/include/net/netlink.h
index cb1f3504687f..f394fe5d7641 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -441,41 +441,6 @@ static inline int nlmsg_report(const struct nlmsghdr *nlh)
441 nla_for_each_attr(pos, nlmsg_attrdata(nlh, hdrlen), \ 441 nla_for_each_attr(pos, nlmsg_attrdata(nlh, hdrlen), \
442 nlmsg_attrlen(nlh, hdrlen), rem) 442 nlmsg_attrlen(nlh, hdrlen), rem)
443 443
444#if 0
445/* FIXME: Enable once all users have been converted */
446
447/**
448 * __nlmsg_put - Add a new netlink message to an skb
449 * @skb: socket buffer to store message in
450 * @pid: netlink process id
451 * @seq: sequence number of message
452 * @type: message type
453 * @payload: length of message payload
454 * @flags: message flags
455 *
456 * The caller is responsible to ensure that the skb provides enough
457 * tailroom for both the netlink header and payload.
458 */
459static inline struct nlmsghdr *__nlmsg_put(struct sk_buff *skb, u32 pid,
460 u32 seq, int type, int payload,
461 int flags)
462{
463 struct nlmsghdr *nlh;
464
465 nlh = (struct nlmsghdr *) skb_put(skb, nlmsg_total_size(payload));
466 nlh->nlmsg_type = type;
467 nlh->nlmsg_len = nlmsg_msg_size(payload);
468 nlh->nlmsg_flags = flags;
469 nlh->nlmsg_pid = pid;
470 nlh->nlmsg_seq = seq;
471
472 memset((unsigned char *) nlmsg_data(nlh) + payload, 0,
473 nlmsg_padlen(payload));
474
475 return nlh;
476}
477#endif
478
479/** 444/**
480 * nlmsg_put - Add a new netlink message to an skb 445 * nlmsg_put - Add a new netlink message to an skb
481 * @skb: socket buffer to store message in 446 * @skb: socket buffer to store message in
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index 2be95e2626c0..276094b91d7c 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -116,6 +116,11 @@
116#define NCI_DISC_MAP_MODE_POLL 0x01 116#define NCI_DISC_MAP_MODE_POLL 0x01
117#define NCI_DISC_MAP_MODE_LISTEN 0x02 117#define NCI_DISC_MAP_MODE_LISTEN 0x02
118 118
119/* NCI Discover Notification Type */
120#define NCI_DISCOVER_NTF_TYPE_LAST 0x00
121#define NCI_DISCOVER_NTF_TYPE_LAST_NFCC 0x01
122#define NCI_DISCOVER_NTF_TYPE_MORE 0x02
123
119/* NCI Deactivation Type */ 124/* NCI Deactivation Type */
120#define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00 125#define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00
121#define NCI_DEACTIVATE_TYPE_SLEEP_MODE 0x01 126#define NCI_DEACTIVATE_TYPE_SLEEP_MODE 0x01
@@ -207,6 +212,13 @@ struct nci_rf_disc_cmd {
207 struct disc_config disc_configs[NCI_MAX_NUM_RF_CONFIGS]; 212 struct disc_config disc_configs[NCI_MAX_NUM_RF_CONFIGS];
208} __packed; 213} __packed;
209 214
215#define NCI_OP_RF_DISCOVER_SELECT_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x04)
216struct nci_rf_discover_select_cmd {
217 __u8 rf_discovery_id;
218 __u8 rf_protocol;
219 __u8 rf_interface;
220} __packed;
221
210#define NCI_OP_RF_DEACTIVATE_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) 222#define NCI_OP_RF_DEACTIVATE_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
211struct nci_rf_deactivate_cmd { 223struct nci_rf_deactivate_cmd {
212 __u8 type; 224 __u8 type;
@@ -244,6 +256,8 @@ struct nci_core_init_rsp_2 {
244 256
245#define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) 257#define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
246 258
259#define NCI_OP_RF_DISCOVER_SELECT_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x04)
260
247#define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) 261#define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
248 262
249/* --------------------------- */ 263/* --------------------------- */
@@ -260,13 +274,15 @@ struct nci_core_conn_credit_ntf {
260 struct conn_credit_entry conn_entries[NCI_MAX_NUM_CONN]; 274 struct conn_credit_entry conn_entries[NCI_MAX_NUM_CONN];
261} __packed; 275} __packed;
262 276
277#define NCI_OP_CORE_GENERIC_ERROR_NTF nci_opcode_pack(NCI_GID_CORE, 0x07)
278
263#define NCI_OP_CORE_INTF_ERROR_NTF nci_opcode_pack(NCI_GID_CORE, 0x08) 279#define NCI_OP_CORE_INTF_ERROR_NTF nci_opcode_pack(NCI_GID_CORE, 0x08)
264struct nci_core_intf_error_ntf { 280struct nci_core_intf_error_ntf {
265 __u8 status; 281 __u8 status;
266 __u8 conn_id; 282 __u8 conn_id;
267} __packed; 283} __packed;
268 284
269#define NCI_OP_RF_INTF_ACTIVATED_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05) 285#define NCI_OP_RF_DISCOVER_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
270struct rf_tech_specific_params_nfca_poll { 286struct rf_tech_specific_params_nfca_poll {
271 __u16 sens_res; 287 __u16 sens_res;
272 __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */ 288 __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */
@@ -275,11 +291,43 @@ struct rf_tech_specific_params_nfca_poll {
275 __u8 sel_res; 291 __u8 sel_res;
276} __packed; 292} __packed;
277 293
294struct rf_tech_specific_params_nfcb_poll {
295 __u8 sensb_res_len;
296 __u8 sensb_res[12]; /* 11 or 12 Bytes */
297} __packed;
298
299struct rf_tech_specific_params_nfcf_poll {
300 __u8 bit_rate;
301 __u8 sensf_res_len;
302 __u8 sensf_res[18]; /* 16 or 18 Bytes */
303} __packed;
304
305struct nci_rf_discover_ntf {
306 __u8 rf_discovery_id;
307 __u8 rf_protocol;
308 __u8 rf_tech_and_mode;
309 __u8 rf_tech_specific_params_len;
310
311 union {
312 struct rf_tech_specific_params_nfca_poll nfca_poll;
313 struct rf_tech_specific_params_nfcb_poll nfcb_poll;
314 struct rf_tech_specific_params_nfcf_poll nfcf_poll;
315 } rf_tech_specific_params;
316
317 __u8 ntf_type;
318} __packed;
319
320#define NCI_OP_RF_INTF_ACTIVATED_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
278struct activation_params_nfca_poll_iso_dep { 321struct activation_params_nfca_poll_iso_dep {
279 __u8 rats_res_len; 322 __u8 rats_res_len;
280 __u8 rats_res[20]; 323 __u8 rats_res[20];
281}; 324};
282 325
326struct activation_params_nfcb_poll_iso_dep {
327 __u8 attrib_res_len;
328 __u8 attrib_res[50];
329};
330
283struct nci_rf_intf_activated_ntf { 331struct nci_rf_intf_activated_ntf {
284 __u8 rf_discovery_id; 332 __u8 rf_discovery_id;
285 __u8 rf_interface; 333 __u8 rf_interface;
@@ -291,6 +339,8 @@ struct nci_rf_intf_activated_ntf {
291 339
292 union { 340 union {
293 struct rf_tech_specific_params_nfca_poll nfca_poll; 341 struct rf_tech_specific_params_nfca_poll nfca_poll;
342 struct rf_tech_specific_params_nfcb_poll nfcb_poll;
343 struct rf_tech_specific_params_nfcf_poll nfcf_poll;
294 } rf_tech_specific_params; 344 } rf_tech_specific_params;
295 345
296 __u8 data_exch_rf_tech_and_mode; 346 __u8 data_exch_rf_tech_and_mode;
@@ -300,6 +350,7 @@ struct nci_rf_intf_activated_ntf {
300 350
301 union { 351 union {
302 struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep; 352 struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep;
353 struct activation_params_nfcb_poll_iso_dep nfcb_poll_iso_dep;
303 } activation_params; 354 } activation_params;
304 355
305} __packed; 356} __packed;
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index bccd89e9d4c2..feba74027ff8 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -34,21 +34,31 @@
34#include <net/nfc/nfc.h> 34#include <net/nfc/nfc.h>
35#include <net/nfc/nci.h> 35#include <net/nfc/nci.h>
36 36
37/* NCI device state */ 37/* NCI device flags */
38enum { 38enum nci_flag {
39 NCI_INIT, 39 NCI_INIT,
40 NCI_UP, 40 NCI_UP,
41 NCI_DATA_EXCHANGE,
42 NCI_DATA_EXCHANGE_TO,
43};
44
45/* NCI device states */
46enum nci_state {
47 NCI_IDLE,
41 NCI_DISCOVERY, 48 NCI_DISCOVERY,
49 NCI_W4_ALL_DISCOVERIES,
50 NCI_W4_HOST_SELECT,
42 NCI_POLL_ACTIVE, 51 NCI_POLL_ACTIVE,
43 NCI_DATA_EXCHANGE,
44}; 52};
45 53
46/* NCI timeouts */ 54/* NCI timeouts */
47#define NCI_RESET_TIMEOUT 5000 55#define NCI_RESET_TIMEOUT 5000
48#define NCI_INIT_TIMEOUT 5000 56#define NCI_INIT_TIMEOUT 5000
49#define NCI_RF_DISC_TIMEOUT 5000 57#define NCI_RF_DISC_TIMEOUT 5000
50#define NCI_RF_DEACTIVATE_TIMEOUT 5000 58#define NCI_RF_DISC_SELECT_TIMEOUT 5000
59#define NCI_RF_DEACTIVATE_TIMEOUT 30000
51#define NCI_CMD_TIMEOUT 5000 60#define NCI_CMD_TIMEOUT 5000
61#define NCI_DATA_TIMEOUT 700
52 62
53struct nci_dev; 63struct nci_dev;
54 64
@@ -59,6 +69,7 @@ struct nci_ops {
59}; 69};
60 70
61#define NCI_MAX_SUPPORTED_RF_INTERFACES 4 71#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
72#define NCI_MAX_DISCOVERED_TARGETS 10
62 73
63/* NCI Core structures */ 74/* NCI Core structures */
64struct nci_dev { 75struct nci_dev {
@@ -68,12 +79,14 @@ struct nci_dev {
68 int tx_headroom; 79 int tx_headroom;
69 int tx_tailroom; 80 int tx_tailroom;
70 81
82 atomic_t state;
71 unsigned long flags; 83 unsigned long flags;
72 84
73 atomic_t cmd_cnt; 85 atomic_t cmd_cnt;
74 atomic_t credits_cnt; 86 atomic_t credits_cnt;
75 87
76 struct timer_list cmd_timer; 88 struct timer_list cmd_timer;
89 struct timer_list data_timer;
77 90
78 struct workqueue_struct *cmd_wq; 91 struct workqueue_struct *cmd_wq;
79 struct work_struct cmd_work; 92 struct work_struct cmd_work;
@@ -96,9 +109,11 @@ struct nci_dev {
96 void *driver_data; 109 void *driver_data;
97 110
98 __u32 poll_prots; 111 __u32 poll_prots;
99 __u32 target_available_prots;
100 __u32 target_active_prot; 112 __u32 target_active_prot;
101 113
114 struct nfc_target targets[NCI_MAX_DISCOVERED_TARGETS];
115 int n_targets;
116
102 /* received during NCI_OP_CORE_RESET_RSP */ 117 /* received during NCI_OP_CORE_RESET_RSP */
103 __u8 nci_ver; 118 __u8 nci_ver;
104 119
@@ -126,17 +141,17 @@ struct nci_dev {
126 141
127/* ----- NCI Devices ----- */ 142/* ----- NCI Devices ----- */
128struct nci_dev *nci_allocate_device(struct nci_ops *ops, 143struct nci_dev *nci_allocate_device(struct nci_ops *ops,
129 __u32 supported_protocols, 144 __u32 supported_protocols,
130 int tx_headroom, 145 int tx_headroom,
131 int tx_tailroom); 146 int tx_tailroom);
132void nci_free_device(struct nci_dev *ndev); 147void nci_free_device(struct nci_dev *ndev);
133int nci_register_device(struct nci_dev *ndev); 148int nci_register_device(struct nci_dev *ndev);
134void nci_unregister_device(struct nci_dev *ndev); 149void nci_unregister_device(struct nci_dev *ndev);
135int nci_recv_frame(struct sk_buff *skb); 150int nci_recv_frame(struct sk_buff *skb);
136 151
137static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, 152static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev,
138 unsigned int len, 153 unsigned int len,
139 gfp_t how) 154 gfp_t how)
140{ 155{
141 struct sk_buff *skb; 156 struct sk_buff *skb;
142 157
@@ -169,6 +184,7 @@ int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload);
169int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb); 184int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb);
170void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb, 185void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
171 int err); 186 int err);
187void nci_clear_target_list(struct nci_dev *ndev);
172 188
173/* ----- NCI requests ----- */ 189/* ----- NCI requests ----- */
174#define NCI_REQ_DONE 0 190#define NCI_REQ_DONE 0
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 8696b773a695..bac070bf3514 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -24,6 +24,7 @@
24#ifndef __NET_NFC_H 24#ifndef __NET_NFC_H
25#define __NET_NFC_H 25#define __NET_NFC_H
26 26
27#include <linux/nfc.h>
27#include <linux/device.h> 28#include <linux/device.h>
28#include <linux/skbuff.h> 29#include <linux/skbuff.h>
29 30
@@ -52,20 +53,19 @@ struct nfc_ops {
52 int (*dev_down)(struct nfc_dev *dev); 53 int (*dev_down)(struct nfc_dev *dev);
53 int (*start_poll)(struct nfc_dev *dev, u32 protocols); 54 int (*start_poll)(struct nfc_dev *dev, u32 protocols);
54 void (*stop_poll)(struct nfc_dev *dev); 55 void (*stop_poll)(struct nfc_dev *dev);
55 int (*dep_link_up)(struct nfc_dev *dev, int target_idx, 56 int (*dep_link_up)(struct nfc_dev *dev, int target_idx, u8 comm_mode,
56 u8 comm_mode, u8 rf_mode); 57 u8 *gb, size_t gb_len);
57 int (*dep_link_down)(struct nfc_dev *dev); 58 int (*dep_link_down)(struct nfc_dev *dev);
58 int (*activate_target)(struct nfc_dev *dev, u32 target_idx, 59 int (*activate_target)(struct nfc_dev *dev, u32 target_idx,
59 u32 protocol); 60 u32 protocol);
60 void (*deactivate_target)(struct nfc_dev *dev, u32 target_idx); 61 void (*deactivate_target)(struct nfc_dev *dev, u32 target_idx);
61 int (*data_exchange)(struct nfc_dev *dev, u32 target_idx, 62 int (*data_exchange)(struct nfc_dev *dev, u32 target_idx,
62 struct sk_buff *skb, data_exchange_cb_t cb, 63 struct sk_buff *skb, data_exchange_cb_t cb,
63 void *cb_context); 64 void *cb_context);
64}; 65};
65 66
66#define NFC_TARGET_IDX_ANY -1 67#define NFC_TARGET_IDX_ANY -1
67#define NFC_MAX_GT_LEN 48 68#define NFC_MAX_GT_LEN 48
68#define NFC_MAX_NFCID1_LEN 10
69 69
70struct nfc_target { 70struct nfc_target {
71 u32 idx; 71 u32 idx;
@@ -73,7 +73,11 @@ struct nfc_target {
73 u16 sens_res; 73 u16 sens_res;
74 u8 sel_res; 74 u8 sel_res;
75 u8 nfcid1_len; 75 u8 nfcid1_len;
76 u8 nfcid1[NFC_MAX_NFCID1_LEN]; 76 u8 nfcid1[NFC_NFCID1_MAXSIZE];
77 u8 sensb_res_len;
78 u8 sensb_res[NFC_SENSB_RES_MAXSIZE];
79 u8 sensf_res_len;
80 u8 sensf_res[NFC_SENSF_RES_MAXSIZE];
77}; 81};
78 82
79struct nfc_genl_data { 83struct nfc_genl_data {
@@ -83,7 +87,6 @@ struct nfc_genl_data {
83 87
84struct nfc_dev { 88struct nfc_dev {
85 unsigned idx; 89 unsigned idx;
86 unsigned target_idx;
87 struct nfc_target *targets; 90 struct nfc_target *targets;
88 int n_targets; 91 int n_targets;
89 int targets_generation; 92 int targets_generation;
@@ -107,9 +110,9 @@ struct nfc_dev {
107extern struct class nfc_class; 110extern struct class nfc_class;
108 111
109struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, 112struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
110 u32 supported_protocols, 113 u32 supported_protocols,
111 int tx_headroom, 114 int tx_headroom,
112 int tx_tailroom); 115 int tx_tailroom);
113 116
114/** 117/**
115 * nfc_free_device - free nfc device 118 * nfc_free_device - free nfc device
@@ -132,7 +135,7 @@ void nfc_unregister_device(struct nfc_dev *dev);
132 * @dev: The parent device 135 * @dev: The parent device
133 */ 136 */
134static inline void nfc_set_parent_dev(struct nfc_dev *nfc_dev, 137static inline void nfc_set_parent_dev(struct nfc_dev *nfc_dev,
135 struct device *dev) 138 struct device *dev)
136{ 139{
137 nfc_dev->dev.parent = dev; 140 nfc_dev->dev.parent = dev;
138} 141}
@@ -169,17 +172,15 @@ static inline const char *nfc_device_name(struct nfc_dev *dev)
169} 172}
170 173
171struct sk_buff *nfc_alloc_send_skb(struct nfc_dev *dev, struct sock *sk, 174struct sk_buff *nfc_alloc_send_skb(struct nfc_dev *dev, struct sock *sk,
172 unsigned int flags, unsigned int size, 175 unsigned int flags, unsigned int size,
173 unsigned int *err); 176 unsigned int *err);
174struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp); 177struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp);
175 178
176int nfc_set_remote_general_bytes(struct nfc_dev *dev, 179int nfc_set_remote_general_bytes(struct nfc_dev *dev,
177 u8 *gt, u8 gt_len); 180 u8 *gt, u8 gt_len);
178 181
179u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, u8 *gt_len); 182int nfc_targets_found(struct nfc_dev *dev,
180 183 struct nfc_target *targets, int ntargets);
181int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets,
182 int ntargets);
183 184
184int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, 185int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx,
185 u8 comm_mode, u8 rf_mode); 186 u8 comm_mode, u8 rf_mode);
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index d3685615a8b0..6ee44b24864a 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -413,6 +413,7 @@ static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc)
413/* Look up the association by its id. */ 413/* Look up the association by its id. */
414struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id); 414struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id);
415 415
416int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp);
416 417
417/* A macro to walk a list of skbs. */ 418/* A macro to walk a list of skbs. */
418#define sctp_skb_for_each(pos, head, tmp) \ 419#define sctp_skb_for_each(pos, head, tmp) \
diff --git a/include/net/sock.h b/include/net/sock.h
index 7ef5c58f3f49..f84be9ed6110 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -357,6 +357,7 @@ struct sock {
357 struct page *sk_sndmsg_page; 357 struct page *sk_sndmsg_page;
358 struct sk_buff *sk_send_head; 358 struct sk_buff *sk_send_head;
359 __u32 sk_sndmsg_off; 359 __u32 sk_sndmsg_off;
360 __s32 sk_peek_off;
360 int sk_write_pending; 361 int sk_write_pending;
361#ifdef CONFIG_SECURITY 362#ifdef CONFIG_SECURITY
362 void *sk_security; 363 void *sk_security;
@@ -373,6 +374,30 @@ struct sock {
373 void (*sk_destruct)(struct sock *sk); 374 void (*sk_destruct)(struct sock *sk);
374}; 375};
375 376
377static inline int sk_peek_offset(struct sock *sk, int flags)
378{
379 if ((flags & MSG_PEEK) && (sk->sk_peek_off >= 0))
380 return sk->sk_peek_off;
381 else
382 return 0;
383}
384
385static inline void sk_peek_offset_bwd(struct sock *sk, int val)
386{
387 if (sk->sk_peek_off >= 0) {
388 if (sk->sk_peek_off >= val)
389 sk->sk_peek_off -= val;
390 else
391 sk->sk_peek_off = 0;
392 }
393}
394
395static inline void sk_peek_offset_fwd(struct sock *sk, int val)
396{
397 if (sk->sk_peek_off >= 0)
398 sk->sk_peek_off += val;
399}
400
376/* 401/*
377 * Hashed lists helper routines 402 * Hashed lists helper routines
378 */ 403 */
@@ -590,6 +615,10 @@ enum sock_flags {
590 SOCK_RXQ_OVFL, 615 SOCK_RXQ_OVFL,
591 SOCK_ZEROCOPY, /* buffers from userspace */ 616 SOCK_ZEROCOPY, /* buffers from userspace */
592 SOCK_WIFI_STATUS, /* push wifi status to userspace */ 617 SOCK_WIFI_STATUS, /* push wifi status to userspace */
618 SOCK_NOFCS, /* Tell NIC not to do the Ethernet FCS.
619 * Will use last 4 bytes of packet sent from
620 * user-space instead.
621 */
593}; 622};
594 623
595static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) 624static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 2d80c291fffb..8607e6aad42b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1138,35 +1138,27 @@ static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp)
1138/* MD5 Signature */ 1138/* MD5 Signature */
1139struct crypto_hash; 1139struct crypto_hash;
1140 1140
1141union tcp_md5_addr {
1142 struct in_addr a4;
1143#if IS_ENABLED(CONFIG_IPV6)
1144 struct in6_addr a6;
1145#endif
1146};
1147
1141/* - key database */ 1148/* - key database */
1142struct tcp_md5sig_key { 1149struct tcp_md5sig_key {
1143 u8 *key; 1150 struct hlist_node node;
1144 u8 keylen; 1151 u8 keylen;
1145}; 1152 u8 family; /* AF_INET or AF_INET6 */
1146 1153 union tcp_md5_addr addr;
1147struct tcp4_md5sig_key { 1154 u8 key[TCP_MD5SIG_MAXKEYLEN];
1148 struct tcp_md5sig_key base; 1155 struct rcu_head rcu;
1149 __be32 addr;
1150};
1151
1152struct tcp6_md5sig_key {
1153 struct tcp_md5sig_key base;
1154#if 0
1155 u32 scope_id; /* XXX */
1156#endif
1157 struct in6_addr addr;
1158}; 1156};
1159 1157
1160/* - sock block */ 1158/* - sock block */
1161struct tcp_md5sig_info { 1159struct tcp_md5sig_info {
1162 struct tcp4_md5sig_key *keys4; 1160 struct hlist_head head;
1163#if IS_ENABLED(CONFIG_IPV6) 1161 struct rcu_head rcu;
1164 struct tcp6_md5sig_key *keys6;
1165 u32 entries6;
1166 u32 alloced6;
1167#endif
1168 u32 entries4;
1169 u32 alloced4;
1170}; 1162};
1171 1163
1172/* - pseudo header */ 1164/* - pseudo header */
@@ -1203,19 +1195,25 @@ extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key,
1203 const struct sock *sk, 1195 const struct sock *sk,
1204 const struct request_sock *req, 1196 const struct request_sock *req,
1205 const struct sk_buff *skb); 1197 const struct sk_buff *skb);
1206extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk, 1198extern int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr,
1207 struct sock *addr_sk); 1199 int family, const u8 *newkey,
1208extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey, 1200 u8 newkeylen, gfp_t gfp);
1209 u8 newkeylen); 1201extern int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr,
1210extern int tcp_v4_md5_do_del(struct sock *sk, __be32 addr); 1202 int family);
1203extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
1204 struct sock *addr_sk);
1211 1205
1212#ifdef CONFIG_TCP_MD5SIG 1206#ifdef CONFIG_TCP_MD5SIG
1213#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \ 1207extern struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk,
1214 &(struct tcp_md5sig_key) { \ 1208 const union tcp_md5_addr *addr, int family);
1215 .key = (twsk)->tw_md5_key, \ 1209#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key)
1216 .keylen = (twsk)->tw_md5_keylen, \
1217 } : NULL)
1218#else 1210#else
1211static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk,
1212 const union tcp_md5_addr *addr,
1213 int family)
1214{
1215 return NULL;
1216}
1219#define tcp_twsk_md5_key(twsk) NULL 1217#define tcp_twsk_md5_key(twsk) NULL
1220#endif 1218#endif
1221 1219
@@ -1471,10 +1469,6 @@ struct tcp_sock_af_ops {
1471 const struct sock *sk, 1469 const struct sock *sk,
1472 const struct request_sock *req, 1470 const struct request_sock *req,
1473 const struct sk_buff *skb); 1471 const struct sk_buff *skb);
1474 int (*md5_add) (struct sock *sk,
1475 struct sock *addr_sk,
1476 u8 *newkey,
1477 u8 len);
1478 int (*md5_parse) (struct sock *sk, 1472 int (*md5_parse) (struct sock *sk,
1479 char __user *optval, 1473 char __user *optval,
1480 int optlen); 1474 int optlen);
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 5f097ca7d5c5..71375459a884 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -40,7 +40,7 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
40 * checksum. UDP-Lite (like IPv6) mandates checksums, hence packets 40 * checksum. UDP-Lite (like IPv6) mandates checksums, hence packets
41 * with a zero checksum field are illegal. */ 41 * with a zero checksum field are illegal. */
42 if (uh->check == 0) { 42 if (uh->check == 0) {
43 LIMIT_NETDEBUG(KERN_DEBUG "UDPLITE: zeroed checksum field\n"); 43 LIMIT_NETDEBUG(KERN_DEBUG "UDPLite: zeroed checksum field\n");
44 return 1; 44 return 1;
45 } 45 }
46 46
@@ -52,7 +52,7 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
52 /* 52 /*
53 * Coverage length violates RFC 3828: log and discard silently. 53 * Coverage length violates RFC 3828: log and discard silently.
54 */ 54 */
55 LIMIT_NETDEBUG(KERN_DEBUG "UDPLITE: bad csum coverage %d/%d\n", 55 LIMIT_NETDEBUG(KERN_DEBUG "UDPLite: bad csum coverage %d/%d\n",
56 cscov, skb->len); 56 cscov, skb->len);
57 return 1; 57 return 1;
58 58
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 89174e29dca9..96239e78e621 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1566,11 +1566,6 @@ extern struct xfrm_algo_desc *xfrm_calg_get_byname(const char *name, int probe);
1566extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len, 1566extern struct xfrm_algo_desc *xfrm_aead_get_byname(const char *name, int icv_len,
1567 int probe); 1567 int probe);
1568 1568
1569struct hash_desc;
1570struct scatterlist;
1571typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *,
1572 unsigned int);
1573
1574static inline int xfrm_addr_cmp(const xfrm_address_t *a, 1569static inline int xfrm_addr_cmp(const xfrm_address_t *a,
1575 const xfrm_address_t *b, 1570 const xfrm_address_t *b,
1576 int family) 1571 int family)