aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acexcep.h2
-rw-r--r--include/acpi/acnames.h2
-rw-r--r--include/acpi/acoutput.h2
-rw-r--r--include/acpi/acpi.h2
-rw-r--r--include/acpi/acpi_bus.h6
-rw-r--r--include/acpi/acpiosxf.h6
-rw-r--r--include/acpi/acpixf.h4
-rw-r--r--include/acpi/acrestyp.h4
-rw-r--r--include/acpi/actbl.h2
-rw-r--r--include/acpi/actbl1.h2
-rw-r--r--include/acpi/actbl2.h43
-rw-r--r--include/acpi/actypes.h34
-rw-r--r--include/acpi/platform/acenv.h6
-rw-r--r--include/acpi/platform/acgcc.h2
-rw-r--r--include/acpi/platform/aclinux.h2
-rw-r--r--include/acpi/processor.h44
-rw-r--r--include/asm-generic/local.h19
-rw-r--r--include/asm-generic/percpu.h18
-rw-r--r--include/linux/Kbuild3
-rw-r--r--include/linux/ata.h3
-rw-r--r--include/linux/blkdev.h65
-rw-r--r--include/linux/blktrace_api.h4
-rw-r--r--include/linux/brcmphy.h11
-rw-r--r--include/linux/can/dev.h18
-rw-r--r--include/linux/can/netlink.h17
-rw-r--r--include/linux/can/platform/ti_hecc.h8
-rw-r--r--include/linux/cciss_defs.h130
-rw-r--r--include/linux/cciss_ioctl.h128
-rw-r--r--include/linux/clocksource.h5
-rw-r--r--include/linux/compiler.h2
-rw-r--r--include/linux/davinci_emac.h39
-rw-r--r--include/linux/dmaengine.h2
-rw-r--r--include/linux/ethtool.h51
-rw-r--r--include/linux/gameport.h1
-rw-r--r--include/linux/genhd.h2
-rw-r--r--include/linux/gfs2_ondisk.h30
-rw-r--r--include/linux/gpio_keys.h1
-rw-r--r--include/linux/i2c-pnx.h19
-rw-r--r--include/linux/i2c-smbus.h50
-rw-r--r--include/linux/i2c.h8
-rw-r--r--include/linux/i2c/twl.h4
-rw-r--r--include/linux/i2o.h2
-rw-r--r--include/linux/icmpv6.h3
-rw-r--r--include/linux/ieee80211.h108
-rw-r--r--include/linux/if_link.h30
-rw-r--r--include/linux/if_macvlan.h84
-rw-r--r--include/linux/if_packet.h1
-rw-r--r--include/linux/if_tun.h17
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/in.h2
-rw-r--r--include/linux/inetdevice.h43
-rw-r--r--include/linux/input.h17
-rw-r--r--include/linux/input/sh_keysc.h7
-rw-r--r--include/linux/iocontext.h2
-rw-r--r--include/linux/irq.h2
-rw-r--r--include/linux/isdn/capilli.h8
-rw-r--r--include/linux/kbd_kern.h3
-rw-r--r--include/linux/kernelcapi.h17
-rw-r--r--include/linux/kexec.h2
-rw-r--r--include/linux/libata.h5
-rw-r--r--include/linux/llc.h7
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mm.h4
-rw-r--r--include/linux/mmzone.h12
-rw-r--r--include/linux/module.h37
-rw-r--r--include/linux/mount.h2
-rw-r--r--include/linux/net.h4
-rw-r--r--include/linux/netdevice.h186
-rw-r--r--include/linux/netfilter.h63
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h22
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h19
-rw-r--r--include/linux/netfilter/nfnetlink.h8
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h2
-rw-r--r--include/linux/netfilter/x_tables.h70
-rw-r--r--include/linux/netfilter/xt_CT.h17
-rw-r--r--include/linux/netfilter_arp/arp_tables.h11
-rw-r--r--include/linux/netfilter_bridge/ebtables.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h18
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h17
-rw-r--r--include/linux/netpoll.h11
-rw-r--r--include/linux/nfs_fs_sb.h2
-rw-r--r--include/linux/nl80211.h145
-rw-r--r--include/linux/omapfb.h9
-rw-r--r--include/linux/pci.h99
-rw-r--r--include/linux/percpu-defs.h40
-rw-r--r--include/linux/percpu.h44
-rw-r--r--include/linux/percpu_counter.h2
-rw-r--r--include/linux/phy.h1
-rw-r--r--include/linux/pktcdvd.h10
-rw-r--r--include/linux/rculist.h5
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/sched.h4
-rw-r--r--include/linux/security.h14
-rw-r--r--include/linux/seq_file.h18
-rw-r--r--include/linux/serio.h1
-rw-r--r--include/linux/skbuff.h19
-rw-r--r--include/linux/snmp.h1
-rw-r--r--include/linux/srcu.h2
-rw-r--r--include/linux/stmmac.h53
-rw-r--r--include/linux/sysctl.h4
-rw-r--r--include/linux/syslog.h52
-rw-r--r--include/linux/tcp.h7
-rw-r--r--include/linux/timex.h3
-rw-r--r--include/linux/usb/audio.h120
-rw-r--r--include/linux/usb/musb.h3
-rw-r--r--include/linux/usb/otg.h10
-rw-r--r--include/linux/usb/usbnet.h21
-rw-r--r--include/linux/vhost.h130
-rw-r--r--include/linux/vmstat.h8
-rw-r--r--include/linux/xfrm.h12
-rw-r--r--include/net/bluetooth/hci.h6
-rw-r--r--include/net/bluetooth/hci_core.h5
-rw-r--r--include/net/cfg80211.h287
-rw-r--r--include/net/dst.h2
-rw-r--r--include/net/icmp.h2
-rw-r--r--include/net/ieee80211_radiotap.h4
-rw-r--r--include/net/if_inet6.h2
-rw-r--r--include/net/inet_sock.h4
-rw-r--r--include/net/ip.h9
-rw-r--r--include/net/ip6_fib.h4
-rw-r--r--include/net/ip_vs.h38
-rw-r--r--include/net/ipcomp.h2
-rw-r--r--include/net/ipv6.h8
-rw-r--r--include/net/llc.h39
-rw-r--r--include/net/llc_conn.h2
-rw-r--r--include/net/mac80211.h386
-rw-r--r--include/net/neighbour.h3
-rw-r--r--include/net/net_namespace.h2
-rw-r--r--include/net/netfilter/nf_conntrack.h12
-rw-r--r--include/net/netfilter/nf_conntrack_core.h3
-rw-r--r--include/net/netfilter/nf_conntrack_ecache.h58
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h16
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h2
-rw-r--r--include/net/netfilter/nf_conntrack_helper.h8
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h4
-rw-r--r--include/net/netfilter/nf_conntrack_zones.h25
-rw-r--r--include/net/netfilter/nf_nat_helper.h32
-rw-r--r--include/net/netlink.h2
-rw-r--r--include/net/netns/conntrack.h2
-rw-r--r--include/net/netns/core.h2
-rw-r--r--include/net/netns/ipv4.h2
-rw-r--r--include/net/netns/ipv6.h2
-rw-r--r--include/net/netns/packet.h4
-rw-r--r--include/net/phonet/pep.h3
-rw-r--r--include/net/pkt_sched.h1
-rw-r--r--include/net/regulatory.h1
-rw-r--r--include/net/request_sock.h2
-rw-r--r--include/net/route.h2
-rw-r--r--include/net/rtnetlink.h2
-rw-r--r--include/net/sch_generic.h19
-rw-r--r--include/net/snmp.h14
-rw-r--r--include/net/sock.h17
-rw-r--r--include/net/tcp.h36
-rw-r--r--include/net/xfrm.h82
-rw-r--r--include/pcmcia/device_id.h5
-rw-r--r--include/rdma/ib_pack.h1
-rw-r--r--include/rdma/ib_verbs.h4
-rw-r--r--include/rdma/rdma_cm.h1
-rw-r--r--include/sound/core.h3
-rw-r--r--include/sound/cs46xx_dsp_spos.h6
-rw-r--r--include/sound/pcm.h54
-rw-r--r--include/sound/pcm_oss.h2
-rw-r--r--include/sound/sb.h1
-rw-r--r--include/sound/soc-dai.h2
-rw-r--r--include/sound/soc-dapm.h32
-rw-r--r--include/sound/soc.h26
-rw-r--r--include/sound/tlv320dac33-plat.h1
-rw-r--r--include/sound/tpa6130a2-plat.h6
-rw-r--r--include/sound/version.h2
-rw-r--r--include/sound/wm2000.h26
-rw-r--r--include/sound/wm8904.h57
-rw-r--r--include/sound/wm8955.h26
173 files changed, 3044 insertions, 880 deletions
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 473d584b1d31..5b2e5e80ecb0 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index c1343a9265fa..9cf736ea4691 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index d814da4b5365..d7726685797e 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index 472b7bf0c5d4..a091cabca4b1 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 54508ccea023..7bf83ddf82e0 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -252,8 +252,8 @@ struct acpi_device_wakeup_state {
252 252
253struct acpi_device_wakeup { 253struct acpi_device_wakeup {
254 acpi_handle gpe_device; 254 acpi_handle gpe_device;
255 acpi_integer gpe_number; 255 u64 gpe_number;
256 acpi_integer sleep_state; 256 u64 sleep_state;
257 struct acpi_handle_list resources; 257 struct acpi_handle_list resources;
258 struct acpi_device_wakeup_state state; 258 struct acpi_device_wakeup_state state;
259 struct acpi_device_wakeup_flags flags; 259 struct acpi_device_wakeup_flags flags;
@@ -383,7 +383,7 @@ struct acpi_pci_root {
383}; 383};
384 384
385/* helper */ 385/* helper */
386acpi_handle acpi_get_child(acpi_handle, acpi_integer); 386acpi_handle acpi_get_child(acpi_handle, u64);
387int acpi_is_root_bridge(acpi_handle); 387int acpi_is_root_bridge(acpi_handle);
388acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); 388acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
389struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); 389struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index eb0e7189075f..b396854b83b0 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -8,7 +8,7 @@
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
10/* 10/*
11 * Copyright (C) 2000 - 2008, Intel Corp. 11 * Copyright (C) 2000 - 2010, Intel Corp.
12 * All rights reserved. 12 * All rights reserved.
13 * 13 *
14 * Redistribution and use in source and binary forms, with or without 14 * Redistribution and use in source and binary forms, with or without
@@ -196,7 +196,7 @@ acpi_os_hotplug_execute(acpi_osd_exec_callback function, void *context);
196 196
197void acpi_os_wait_events_complete(void *context); 197void acpi_os_wait_events_complete(void *context);
198 198
199void acpi_os_sleep(acpi_integer milliseconds); 199void acpi_os_sleep(u64 milliseconds);
200 200
201void acpi_os_stall(u32 microseconds); 201void acpi_os_stall(u32 microseconds);
202 202
@@ -227,7 +227,7 @@ acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
227 227
228acpi_status 228acpi_status
229acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, 229acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
230 u32 reg, acpi_integer value, u32 width); 230 u32 reg, u64 value, u32 width);
231 231
232/* 232/*
233 * Interim function needed for PCI IRQ routing 233 * Interim function needed for PCI IRQ routing
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 3988f93b9c66..4447a0461bae 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2008, Intel Corp. 9 * Copyright (C) 2000 - 2010, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
47 47
48/* Current ACPICA subsystem version in YYYYMMDD format */ 48/* Current ACPICA subsystem version in YYYYMMDD format */
49 49
50#define ACPI_CA_VERSION 0x20091214 50#define ACPI_CA_VERSION 0x20100121
51 51
52#include "actypes.h" 52#include "actypes.h"
53#include "actbl.h" 53#include "actbl.h"
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index 9ffe00feada6..e5526354ba5e 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -397,7 +397,7 @@ struct acpi_resource {
397struct acpi_pci_routing_table { 397struct acpi_pci_routing_table {
398 u32 length; 398 u32 length;
399 u32 pin; 399 u32 pin;
400 acpi_integer address; /* here for 64-bit alignment */ 400 u64 address; /* here for 64-bit alignment */
401 u32 source_index; 401 u32 source_index;
402 char source[4]; /* pad to 64 bits so sizeof() works in all cases */ 402 char source[4]; /* pad to 64 bits so sizeof() works in all cases */
403}; 403};
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 1b6587952604..ad2001683ba7 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 0b9b430b092b..c637b75b9f3f 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 6f3dce9991e1..5b02e307bff3 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -1,3 +1,46 @@
1/******************************************************************************
2 *
3 * Name: actbl2.h - ACPI Specification Revision 2.0 Tables
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
1#ifndef __ACTBL2_H__ 44#ifndef __ACTBL2_H__
2#define __ACTBL2_H__ 45#define __ACTBL2_H__
3 46
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 73af40863371..3f08e64962f8 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -385,19 +385,6 @@ union uint64_overlay {
385 struct uint64_struct part; 385 struct uint64_struct part;
386}; 386};
387 387
388struct uint32_struct {
389 u32 lo;
390 u32 hi;
391};
392
393/*
394 * Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI
395 * version 2, integers are 64 bits. Note that this pertains to the ACPI integer
396 * type only, not other integers used in the implementation of the ACPI CA
397 * subsystem.
398 */
399typedef unsigned long long acpi_integer;
400#define ACPI_INTEGER_MAX ACPI_UINT64_MAX
401#define ACPI_INTEGER_BIT_SIZE 64 388#define ACPI_INTEGER_BIT_SIZE 64
402#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ 389#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */
403 390
@@ -421,6 +408,19 @@ typedef unsigned long long acpi_integer;
421#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ 408#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */
422#define ACPI_DO_NOT_WAIT 0 409#define ACPI_DO_NOT_WAIT 0
423 410
411/*
412 * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits.
413 * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this
414 * pertains to the ACPI integer type only, not to other integers used in the
415 * implementation of the ACPICA subsystem.
416 *
417 * 01/2010: This type is obsolete and has been removed from the entire ACPICA
418 * code base. It remains here for compatibility with device drivers that use
419 * the type. However, it will be removed in the future.
420 */
421typedef u64 acpi_integer;
422#define ACPI_INTEGER_MAX ACPI_UINT64_MAX
423
424/******************************************************************************* 424/*******************************************************************************
425 * 425 *
426 * Commonly used macros 426 * Commonly used macros
@@ -793,7 +793,7 @@ union acpi_object {
793 acpi_object_type type; /* See definition of acpi_ns_type for values */ 793 acpi_object_type type; /* See definition of acpi_ns_type for values */
794 struct { 794 struct {
795 acpi_object_type type; /* ACPI_TYPE_INTEGER */ 795 acpi_object_type type; /* ACPI_TYPE_INTEGER */
796 acpi_integer value; /* The actual number */ 796 u64 value; /* The actual number */
797 } integer; 797 } integer;
798 798
799 struct { 799 struct {
@@ -937,7 +937,7 @@ typedef
937acpi_status(*acpi_adr_space_handler) (u32 function, 937acpi_status(*acpi_adr_space_handler) (u32 function,
938 acpi_physical_address address, 938 acpi_physical_address address,
939 u32 bit_width, 939 u32 bit_width,
940 acpi_integer * value, 940 u64 *value,
941 void *handler_context, 941 void *handler_context,
942 void *region_context); 942 void *region_context);
943 943
@@ -997,7 +997,7 @@ struct acpi_device_info {
997 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ 997 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
998 u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */ 998 u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */
999 u32 current_status; /* _STA value */ 999 u32 current_status; /* _STA value */
1000 acpi_integer address; /* _ADR value */ 1000 u64 address; /* _ADR value */
1001 struct acpica_device_id hardware_id; /* _HID value */ 1001 struct acpica_device_id hardware_id; /* _HID value */
1002 struct acpica_device_id unique_id; /* _UID value */ 1002 struct acpica_device_id unique_id; /* _UID value */
1003 struct acpica_device_id_list compatible_id_list; /* _CID list <must be last> */ 1003 struct acpica_device_id_list compatible_id_list; /* _CID list <must be last> */
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index e62f10d9a7d8..c05aeba9e8f0 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -311,8 +311,8 @@ typedef char *va_list;
311#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n)) 311#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n))
312#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) 312#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n))
313#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) 313#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n))
314#define ACPI_TOUPPER acpi_ut_to_upper 314#define ACPI_TOUPPER(c) acpi_ut_to_upper ((int) (c))
315#define ACPI_TOLOWER acpi_ut_to_lower 315#define ACPI_TOLOWER(c) acpi_ut_to_lower ((int) (c))
316 316
317#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 317#endif /* ACPI_USE_SYSTEM_CLIBRARY */
318 318
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 6aadbf84ae71..0cd53e3cd1a3 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2008, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 09469971472f..e5039a2856f8 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2009, Intel Corp. 8 * Copyright (C) 2000 - 2010, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 0ea5ef4eb6a9..1172c27adadf 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -92,11 +92,11 @@ struct acpi_processor_power {
92/* Performance Management */ 92/* Performance Management */
93 93
94struct acpi_psd_package { 94struct acpi_psd_package {
95 acpi_integer num_entries; 95 u64 num_entries;
96 acpi_integer revision; 96 u64 revision;
97 acpi_integer domain; 97 u64 domain;
98 acpi_integer coord_type; 98 u64 coord_type;
99 acpi_integer num_processors; 99 u64 num_processors;
100} __attribute__ ((packed)); 100} __attribute__ ((packed));
101 101
102struct acpi_pct_register { 102struct acpi_pct_register {
@@ -110,12 +110,12 @@ struct acpi_pct_register {
110} __attribute__ ((packed)); 110} __attribute__ ((packed));
111 111
112struct acpi_processor_px { 112struct acpi_processor_px {
113 acpi_integer core_frequency; /* megahertz */ 113 u64 core_frequency; /* megahertz */
114 acpi_integer power; /* milliWatts */ 114 u64 power; /* milliWatts */
115 acpi_integer transition_latency; /* microseconds */ 115 u64 transition_latency; /* microseconds */
116 acpi_integer bus_master_latency; /* microseconds */ 116 u64 bus_master_latency; /* microseconds */
117 acpi_integer control; /* control value */ 117 u64 control; /* control value */
118 acpi_integer status; /* success indicator */ 118 u64 status; /* success indicator */
119}; 119};
120 120
121struct acpi_processor_performance { 121struct acpi_processor_performance {
@@ -133,11 +133,11 @@ struct acpi_processor_performance {
133/* Throttling Control */ 133/* Throttling Control */
134 134
135struct acpi_tsd_package { 135struct acpi_tsd_package {
136 acpi_integer num_entries; 136 u64 num_entries;
137 acpi_integer revision; 137 u64 revision;
138 acpi_integer domain; 138 u64 domain;
139 acpi_integer coord_type; 139 u64 coord_type;
140 acpi_integer num_processors; 140 u64 num_processors;
141} __attribute__ ((packed)); 141} __attribute__ ((packed));
142 142
143struct acpi_ptc_register { 143struct acpi_ptc_register {
@@ -151,11 +151,11 @@ struct acpi_ptc_register {
151} __attribute__ ((packed)); 151} __attribute__ ((packed));
152 152
153struct acpi_processor_tx_tss { 153struct acpi_processor_tx_tss {
154 acpi_integer freqpercentage; /* */ 154 u64 freqpercentage; /* */
155 acpi_integer power; /* milliWatts */ 155 u64 power; /* milliWatts */
156 acpi_integer transition_latency; /* microseconds */ 156 u64 transition_latency; /* microseconds */
157 acpi_integer control; /* control value */ 157 u64 control; /* control value */
158 acpi_integer status; /* success indicator */ 158 u64 status; /* success indicator */
159}; 159};
160struct acpi_processor_tx { 160struct acpi_processor_tx {
161 u16 power; 161 u16 power;
@@ -238,7 +238,7 @@ struct acpi_processor_errata {
238 238
239extern int acpi_processor_preregister_performance(struct 239extern int acpi_processor_preregister_performance(struct
240 acpi_processor_performance 240 acpi_processor_performance
241 *performance); 241 __percpu *performance);
242 242
243extern int acpi_processor_register_performance(struct acpi_processor_performance 243extern int acpi_processor_register_performance(struct acpi_processor_performance
244 *performance, unsigned int cpu); 244 *performance, unsigned int cpu);
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
index fc218444e315..c8a5d68541d7 100644
--- a/include/asm-generic/local.h
+++ b/include/asm-generic/local.h
@@ -52,23 +52,4 @@ typedef struct
52#define __local_add(i,l) local_set((l), local_read(l) + (i)) 52#define __local_add(i,l) local_set((l), local_read(l) + (i))
53#define __local_sub(i,l) local_set((l), local_read(l) - (i)) 53#define __local_sub(i,l) local_set((l), local_read(l) - (i))
54 54
55/* Use these for per-cpu local_t variables: on some archs they are
56 * much more efficient than these naive implementations. Note they take
57 * a variable (eg. mystruct.foo), not an address.
58 */
59#define cpu_local_read(l) local_read(&__get_cpu_var(l))
60#define cpu_local_set(l, i) local_set(&__get_cpu_var(l), (i))
61#define cpu_local_inc(l) local_inc(&__get_cpu_var(l))
62#define cpu_local_dec(l) local_dec(&__get_cpu_var(l))
63#define cpu_local_add(i, l) local_add((i), &__get_cpu_var(l))
64#define cpu_local_sub(i, l) local_sub((i), &__get_cpu_var(l))
65
66/* Non-atomic increments, ie. preemption disabled and won't be touched
67 * in interrupt, etc. Some archs can optimize this case well.
68 */
69#define __cpu_local_inc(l) __local_inc(&__get_cpu_var(l))
70#define __cpu_local_dec(l) __local_dec(&__get_cpu_var(l))
71#define __cpu_local_add(i, l) __local_add((i), &__get_cpu_var(l))
72#define __cpu_local_sub(i, l) __local_sub((i), &__get_cpu_var(l))
73
74#endif /* _ASM_GENERIC_LOCAL_H */ 55#endif /* _ASM_GENERIC_LOCAL_H */
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 8087b90d4673..04f91c2d3f7b 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -41,7 +41,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
41 * Only S390 provides its own means of moving the pointer. 41 * Only S390 provides its own means of moving the pointer.
42 */ 42 */
43#ifndef SHIFT_PERCPU_PTR 43#ifndef SHIFT_PERCPU_PTR
44#define SHIFT_PERCPU_PTR(__p, __offset) RELOC_HIDE((__p), (__offset)) 44/* Weird cast keeps both GCC and sparse happy. */
45#define SHIFT_PERCPU_PTR(__p, __offset) ({ \
46 __verify_pcpu_ptr((__p)); \
47 RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)); \
48})
45#endif 49#endif
46 50
47/* 51/*
@@ -50,11 +54,11 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
50 * offset. 54 * offset.
51 */ 55 */
52#define per_cpu(var, cpu) \ 56#define per_cpu(var, cpu) \
53 (*SHIFT_PERCPU_PTR(&per_cpu_var(var), per_cpu_offset(cpu))) 57 (*SHIFT_PERCPU_PTR(&(var), per_cpu_offset(cpu)))
54#define __get_cpu_var(var) \ 58#define __get_cpu_var(var) \
55 (*SHIFT_PERCPU_PTR(&per_cpu_var(var), my_cpu_offset)) 59 (*SHIFT_PERCPU_PTR(&(var), my_cpu_offset))
56#define __raw_get_cpu_var(var) \ 60#define __raw_get_cpu_var(var) \
57 (*SHIFT_PERCPU_PTR(&per_cpu_var(var), __my_cpu_offset)) 61 (*SHIFT_PERCPU_PTR(&(var), __my_cpu_offset))
58 62
59#define this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, my_cpu_offset) 63#define this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, my_cpu_offset)
60#define __this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset) 64#define __this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
@@ -66,9 +70,9 @@ extern void setup_per_cpu_areas(void);
66 70
67#else /* ! SMP */ 71#else /* ! SMP */
68 72
69#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var))) 73#define per_cpu(var, cpu) (*((void)(cpu), &(var)))
70#define __get_cpu_var(var) per_cpu_var(var) 74#define __get_cpu_var(var) (var)
71#define __raw_get_cpu_var(var) per_cpu_var(var) 75#define __raw_get_cpu_var(var) (var)
72#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) 76#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0)
73#define __this_cpu_ptr(ptr) this_cpu_ptr(ptr) 77#define __this_cpu_ptr(ptr) this_cpu_ptr(ptr)
74 78
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 756f831cbdd5..e2ea0b2159cd 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -43,6 +43,7 @@ header-y += blkpg.h
43header-y += bpqether.h 43header-y += bpqether.h
44header-y += bsg.h 44header-y += bsg.h
45header-y += can.h 45header-y += can.h
46header-y += cciss_defs.h
46header-y += cdk.h 47header-y += cdk.h
47header-y += chio.h 48header-y += chio.h
48header-y += coda_psdev.h 49header-y += coda_psdev.h
@@ -125,6 +126,7 @@ header-y += nfs2.h
125header-y += nfs4_mount.h 126header-y += nfs4_mount.h
126header-y += nfs_mount.h 127header-y += nfs_mount.h
127header-y += nl80211.h 128header-y += nl80211.h
129header-y += omapfb.h
128header-y += param.h 130header-y += param.h
129header-y += pci_regs.h 131header-y += pci_regs.h
130header-y += perf_event.h 132header-y += perf_event.h
@@ -362,6 +364,7 @@ unifdef-y += uio.h
362unifdef-y += unistd.h 364unifdef-y += unistd.h
363unifdef-y += usbdevice_fs.h 365unifdef-y += usbdevice_fs.h
364unifdef-y += utsname.h 366unifdef-y += utsname.h
367unifdef-y += vhost.h
365unifdef-y += videodev2.h 368unifdef-y += videodev2.h
366unifdef-y += videodev.h 369unifdef-y += videodev.h
367unifdef-y += virtio_config.h 370unifdef-y += virtio_config.h
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 20f31567ccee..b4c85e2adef5 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -841,7 +841,8 @@ static inline int ata_id_current_chs_valid(const u16 *id)
841 841
842static inline int ata_id_is_cfa(const u16 *id) 842static inline int ata_id_is_cfa(const u16 *id)
843{ 843{
844 if (id[ATA_ID_CONFIG] == 0x848A) /* Traditional CF */ 844 if ((id[ATA_ID_CONFIG] == 0x848A) || /* Traditional CF */
845 (id[ATA_ID_CONFIG] == 0x844A)) /* Delkin Devices CF */
845 return 1; 846 return 1;
846 /* 847 /*
847 * CF specs don't require specific value in the word 0 anymore and yet 848 * CF specs don't require specific value in the word 0 anymore and yet
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 1896e868854f..ebd22dbed861 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -316,8 +316,7 @@ struct queue_limits {
316 unsigned int discard_alignment; 316 unsigned int discard_alignment;
317 317
318 unsigned short logical_block_size; 318 unsigned short logical_block_size;
319 unsigned short max_hw_segments; 319 unsigned short max_segments;
320 unsigned short max_phys_segments;
321 320
322 unsigned char misaligned; 321 unsigned char misaligned;
323 unsigned char discard_misaligned; 322 unsigned char discard_misaligned;
@@ -462,6 +461,7 @@ struct request_queue
462#define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ 461#define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */
463#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ 462#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */
464#define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ 463#define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */
464#define QUEUE_FLAG_NOXMERGES 17 /* No extended merges */
465 465
466#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ 466#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
467 (1 << QUEUE_FLAG_CLUSTER) | \ 467 (1 << QUEUE_FLAG_CLUSTER) | \
@@ -587,6 +587,8 @@ enum {
587#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) 587#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
588#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 588#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
589#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) 589#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
590#define blk_queue_noxmerges(q) \
591 test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags)
590#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) 592#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags)
591#define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) 593#define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
592#define blk_queue_flushing(q) ((q)->ordseq) 594#define blk_queue_flushing(q) ((q)->ordseq)
@@ -918,10 +920,27 @@ extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
918extern void blk_cleanup_queue(struct request_queue *); 920extern void blk_cleanup_queue(struct request_queue *);
919extern void blk_queue_make_request(struct request_queue *, make_request_fn *); 921extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
920extern void blk_queue_bounce_limit(struct request_queue *, u64); 922extern void blk_queue_bounce_limit(struct request_queue *, u64);
921extern void blk_queue_max_sectors(struct request_queue *, unsigned int);
922extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); 923extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int);
923extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short); 924
924extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short); 925/* Temporary compatibility wrapper */
926static inline void blk_queue_max_sectors(struct request_queue *q, unsigned int max)
927{
928 blk_queue_max_hw_sectors(q, max);
929}
930
931extern void blk_queue_max_segments(struct request_queue *, unsigned short);
932
933static inline void blk_queue_max_phys_segments(struct request_queue *q, unsigned short max)
934{
935 blk_queue_max_segments(q, max);
936}
937
938static inline void blk_queue_max_hw_segments(struct request_queue *q, unsigned short max)
939{
940 blk_queue_max_segments(q, max);
941}
942
943
925extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); 944extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
926extern void blk_queue_max_discard_sectors(struct request_queue *q, 945extern void blk_queue_max_discard_sectors(struct request_queue *q,
927 unsigned int max_discard_sectors); 946 unsigned int max_discard_sectors);
@@ -1014,11 +1033,15 @@ extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
1014#define MAX_PHYS_SEGMENTS 128 1033#define MAX_PHYS_SEGMENTS 128
1015#define MAX_HW_SEGMENTS 128 1034#define MAX_HW_SEGMENTS 128
1016#define SAFE_MAX_SECTORS 255 1035#define SAFE_MAX_SECTORS 255
1017#define BLK_DEF_MAX_SECTORS 1024
1018
1019#define MAX_SEGMENT_SIZE 65536 1036#define MAX_SEGMENT_SIZE 65536
1020 1037
1021#define BLK_SEG_BOUNDARY_MASK 0xFFFFFFFFUL 1038enum blk_default_limits {
1039 BLK_MAX_SEGMENTS = 128,
1040 BLK_SAFE_MAX_SECTORS = 255,
1041 BLK_DEF_MAX_SECTORS = 1024,
1042 BLK_MAX_SEGMENT_SIZE = 65536,
1043 BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL,
1044};
1022 1045
1023#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) 1046#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
1024 1047
@@ -1042,14 +1065,9 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
1042 return q->limits.max_hw_sectors; 1065 return q->limits.max_hw_sectors;
1043} 1066}
1044 1067
1045static inline unsigned short queue_max_hw_segments(struct request_queue *q) 1068static inline unsigned short queue_max_segments(struct request_queue *q)
1046{
1047 return q->limits.max_hw_segments;
1048}
1049
1050static inline unsigned short queue_max_phys_segments(struct request_queue *q)
1051{ 1069{
1052 return q->limits.max_phys_segments; 1070 return q->limits.max_segments;
1053} 1071}
1054 1072
1055static inline unsigned int queue_max_segment_size(struct request_queue *q) 1073static inline unsigned int queue_max_segment_size(struct request_queue *q)
@@ -1110,18 +1128,13 @@ static inline int queue_alignment_offset(struct request_queue *q)
1110 return q->limits.alignment_offset; 1128 return q->limits.alignment_offset;
1111} 1129}
1112 1130
1113static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t offset) 1131static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
1114{ 1132{
1115 unsigned int granularity = max(lim->physical_block_size, lim->io_min); 1133 unsigned int granularity = max(lim->physical_block_size, lim->io_min);
1134 unsigned int alignment = (sector << 9) & (granularity - 1);
1116 1135
1117 offset &= granularity - 1; 1136 return (granularity + lim->alignment_offset - alignment)
1118 return (granularity + lim->alignment_offset - offset) & (granularity - 1); 1137 & (granularity - 1);
1119}
1120
1121static inline int queue_sector_alignment_offset(struct request_queue *q,
1122 sector_t sector)
1123{
1124 return queue_limit_alignment_offset(&q->limits, sector << 9);
1125} 1138}
1126 1139
1127static inline int bdev_alignment_offset(struct block_device *bdev) 1140static inline int bdev_alignment_offset(struct block_device *bdev)
@@ -1145,10 +1158,8 @@ static inline int queue_discard_alignment(struct request_queue *q)
1145 return q->limits.discard_alignment; 1158 return q->limits.discard_alignment;
1146} 1159}
1147 1160
1148static inline int queue_sector_discard_alignment(struct request_queue *q, 1161static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
1149 sector_t sector)
1150{ 1162{
1151 struct queue_limits *lim = &q->limits;
1152 unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); 1163 unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1);
1153 1164
1154 return (lim->discard_granularity + lim->discard_alignment - alignment) 1165 return (lim->discard_granularity + lim->discard_alignment - alignment)
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 3b73b9992b26..416bf62d6d46 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -150,8 +150,8 @@ struct blk_user_trace_setup {
150struct blk_trace { 150struct blk_trace {
151 int trace_state; 151 int trace_state;
152 struct rchan *rchan; 152 struct rchan *rchan;
153 unsigned long *sequence; 153 unsigned long __percpu *sequence;
154 unsigned char *msg_data; 154 unsigned char __percpu *msg_data;
155 u16 act_mask; 155 u16 act_mask;
156 u64 start_lba; 156 u64 start_lba;
157 u64 end_lba; 157 u64 end_lba;
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 2b31b91f5871..7f437ca1ed44 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -1,3 +1,14 @@
1#define PHY_ID_BCM50610 0x0143bd60
2#define PHY_ID_BCM50610M 0x0143bd70
3#define PHY_ID_BCMAC131 0x0143bc70
4#define PHY_ID_BCM57780 0x03625d90
5
6#define PHY_BCM_OUI_MASK 0xfffffc00
7#define PHY_BCM_OUI_1 0x00206000
8#define PHY_BCM_OUI_2 0x0143bc00
9#define PHY_BCM_OUI_3 0x03625c00
10
11
1#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001 12#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001
2#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002 13#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002
3#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010 14#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 3db7767d2a17..6e5a7f00223d 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -38,6 +38,7 @@ struct can_priv {
38 38
39 enum can_state state; 39 enum can_state state;
40 u32 ctrlmode; 40 u32 ctrlmode;
41 u32 ctrlmode_supported;
41 42
42 int restart_ms; 43 int restart_ms;
43 struct timer_list restart_timer; 44 struct timer_list restart_timer;
@@ -46,6 +47,8 @@ struct can_priv {
46 int (*do_set_mode)(struct net_device *dev, enum can_mode mode); 47 int (*do_set_mode)(struct net_device *dev, enum can_mode mode);
47 int (*do_get_state)(const struct net_device *dev, 48 int (*do_get_state)(const struct net_device *dev,
48 enum can_state *state); 49 enum can_state *state);
50 int (*do_get_berr_counter)(const struct net_device *dev,
51 struct can_berr_counter *bec);
49 52
50 unsigned int echo_skb_max; 53 unsigned int echo_skb_max;
51 struct sk_buff **echo_skb; 54 struct sk_buff **echo_skb;
@@ -60,6 +63,21 @@ struct can_priv {
60 */ 63 */
61#define get_can_dlc(i) (min_t(__u8, (i), 8)) 64#define get_can_dlc(i) (min_t(__u8, (i), 8))
62 65
66/* Drop a given socketbuffer if it does not contain a valid CAN frame. */
67static inline int can_dropped_invalid_skb(struct net_device *dev,
68 struct sk_buff *skb)
69{
70 const struct can_frame *cf = (struct can_frame *)skb->data;
71
72 if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) {
73 kfree_skb(skb);
74 dev->stats.tx_dropped++;
75 return 1;
76 }
77
78 return 0;
79}
80
63struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); 81struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
64void free_candev(struct net_device *dev); 82void free_candev(struct net_device *dev);
65 83
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h
index 9ecbb7871c0e..3250de935e1a 100644
--- a/include/linux/can/netlink.h
+++ b/include/linux/can/netlink.h
@@ -70,6 +70,14 @@ enum can_state {
70}; 70};
71 71
72/* 72/*
73 * CAN bus error counters
74 */
75struct can_berr_counter {
76 __u16 txerr;
77 __u16 rxerr;
78};
79
80/*
73 * CAN controller mode 81 * CAN controller mode
74 */ 82 */
75struct can_ctrlmode { 83struct can_ctrlmode {
@@ -77,9 +85,11 @@ struct can_ctrlmode {
77 __u32 flags; 85 __u32 flags;
78}; 86};
79 87
80#define CAN_CTRLMODE_LOOPBACK 0x1 /* Loopback mode */ 88#define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */
81#define CAN_CTRLMODE_LISTENONLY 0x2 /* Listen-only mode */ 89#define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */
82#define CAN_CTRLMODE_3_SAMPLES 0x4 /* Triple sampling mode */ 90#define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */
91#define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */
92#define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */
83 93
84/* 94/*
85 * CAN device statistics 95 * CAN device statistics
@@ -105,6 +115,7 @@ enum {
105 IFLA_CAN_CTRLMODE, 115 IFLA_CAN_CTRLMODE,
106 IFLA_CAN_RESTART_MS, 116 IFLA_CAN_RESTART_MS,
107 IFLA_CAN_RESTART, 117 IFLA_CAN_RESTART,
118 IFLA_CAN_BERR_COUNTER,
108 __IFLA_CAN_MAX 119 __IFLA_CAN_MAX
109}; 120};
110 121
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h
index 4688c7bb1bd1..af17cb3f7a84 100644
--- a/include/linux/can/platform/ti_hecc.h
+++ b/include/linux/can/platform/ti_hecc.h
@@ -1,3 +1,6 @@
1#ifndef __CAN_PLATFORM_TI_HECC_H__
2#define __CAN_PLATFORM_TI_HECC_H__
3
1/* 4/*
2 * TI HECC (High End CAN Controller) driver platform header 5 * TI HECC (High End CAN Controller) driver platform header
3 * 6 *
@@ -23,6 +26,7 @@
23 * @mbx_offset: Mailbox RAM offset 26 * @mbx_offset: Mailbox RAM offset
24 * @int_line: Interrupt line to use - 0 or 1 27 * @int_line: Interrupt line to use - 0 or 1
25 * @version: version for future use 28 * @version: version for future use
29 * @transceiver_switch: platform specific callback fn for transceiver control
26 * 30 *
27 * Platform data structure to get all platform specific settings. 31 * Platform data structure to get all platform specific settings.
28 * this structure also accounts the fact that the IP may have different 32 * this structure also accounts the fact that the IP may have different
@@ -35,6 +39,6 @@ struct ti_hecc_platform_data {
35 u32 mbx_offset; 39 u32 mbx_offset;
36 u32 int_line; 40 u32 int_line;
37 u32 version; 41 u32 version;
42 void (*transceiver_switch) (int);
38}; 43};
39 44#endif
40
diff --git a/include/linux/cciss_defs.h b/include/linux/cciss_defs.h
new file mode 100644
index 000000000000..316b670d4e33
--- /dev/null
+++ b/include/linux/cciss_defs.h
@@ -0,0 +1,130 @@
1#ifndef CCISS_DEFS_H
2#define CCISS_DEFS_H
3
4#include <linux/types.h>
5
6/* general boundary definitions */
7#define SENSEINFOBYTES 32 /* note that this value may vary
8 between host implementations */
9
10/* Command Status value */
11#define CMD_SUCCESS 0x0000
12#define CMD_TARGET_STATUS 0x0001
13#define CMD_DATA_UNDERRUN 0x0002
14#define CMD_DATA_OVERRUN 0x0003
15#define CMD_INVALID 0x0004
16#define CMD_PROTOCOL_ERR 0x0005
17#define CMD_HARDWARE_ERR 0x0006
18#define CMD_CONNECTION_LOST 0x0007
19#define CMD_ABORTED 0x0008
20#define CMD_ABORT_FAILED 0x0009
21#define CMD_UNSOLICITED_ABORT 0x000A
22#define CMD_TIMEOUT 0x000B
23#define CMD_UNABORTABLE 0x000C
24
25/* transfer direction */
26#define XFER_NONE 0x00
27#define XFER_WRITE 0x01
28#define XFER_READ 0x02
29#define XFER_RSVD 0x03
30
31/* task attribute */
32#define ATTR_UNTAGGED 0x00
33#define ATTR_SIMPLE 0x04
34#define ATTR_HEADOFQUEUE 0x05
35#define ATTR_ORDERED 0x06
36#define ATTR_ACA 0x07
37
38/* cdb type */
39#define TYPE_CMD 0x00
40#define TYPE_MSG 0x01
41
42/* Type defs used in the following structs */
43#define BYTE __u8
44#define WORD __u16
45#define HWORD __u16
46#define DWORD __u32
47
48#define CISS_MAX_LUN 1024
49
50#define LEVEL2LUN 1 /* index into Target(x) structure, due to byte swapping */
51#define LEVEL3LUN 0
52
53#pragma pack(1)
54
55/* Command List Structure */
56typedef union _SCSI3Addr_struct {
57 struct {
58 BYTE Dev;
59 BYTE Bus:6;
60 BYTE Mode:2; /* b00 */
61 } PeripDev;
62 struct {
63 BYTE DevLSB;
64 BYTE DevMSB:6;
65 BYTE Mode:2; /* b01 */
66 } LogDev;
67 struct {
68 BYTE Dev:5;
69 BYTE Bus:3;
70 BYTE Targ:6;
71 BYTE Mode:2; /* b10 */
72 } LogUnit;
73} SCSI3Addr_struct;
74
75typedef struct _PhysDevAddr_struct {
76 DWORD TargetId:24;
77 DWORD Bus:6;
78 DWORD Mode:2;
79 SCSI3Addr_struct Target[2]; /* 2 level target device addr */
80} PhysDevAddr_struct;
81
82typedef struct _LogDevAddr_struct {
83 DWORD VolId:30;
84 DWORD Mode:2;
85 BYTE reserved[4];
86} LogDevAddr_struct;
87
88typedef union _LUNAddr_struct {
89 BYTE LunAddrBytes[8];
90 SCSI3Addr_struct SCSI3Lun[4];
91 PhysDevAddr_struct PhysDev;
92 LogDevAddr_struct LogDev;
93} LUNAddr_struct;
94
95typedef struct _RequestBlock_struct {
96 BYTE CDBLen;
97 struct {
98 BYTE Type:3;
99 BYTE Attribute:3;
100 BYTE Direction:2;
101 } Type;
102 HWORD Timeout;
103 BYTE CDB[16];
104} RequestBlock_struct;
105
106typedef union _MoreErrInfo_struct{
107 struct {
108 BYTE Reserved[3];
109 BYTE Type;
110 DWORD ErrorInfo;
111 } Common_Info;
112 struct{
113 BYTE Reserved[2];
114 BYTE offense_size; /* size of offending entry */
115 BYTE offense_num; /* byte # of offense 0-base */
116 DWORD offense_value;
117 } Invalid_Cmd;
118} MoreErrInfo_struct;
119typedef struct _ErrorInfo_struct {
120 BYTE ScsiStatus;
121 BYTE SenseLen;
122 HWORD CommandStatus;
123 DWORD ResidualCnt;
124 MoreErrInfo_struct MoreErrInfo;
125 BYTE SenseInfo[SENSEINFOBYTES];
126} ErrorInfo_struct;
127
128#pragma pack()
129
130#endif /* CCISS_DEFS_H */
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index eb130b4d8e72..986493f5b92b 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/ioctl.h> 5#include <linux/ioctl.h>
6#include <linux/cciss_defs.h>
6 7
7#define CCISS_IOC_MAGIC 'B' 8#define CCISS_IOC_MAGIC 'B'
8 9
@@ -36,133 +37,6 @@ typedef __u32 DriverVer_type;
36 37
37#define MAX_KMALLOC_SIZE 128000 38#define MAX_KMALLOC_SIZE 128000
38 39
39#ifndef CCISS_CMD_H
40// This defines are duplicated in cciss_cmd.h in the driver directory
41
42//general boundary definitions
43#define SENSEINFOBYTES 32//note that this value may vary between host implementations
44
45//Command Status value
46#define CMD_SUCCESS 0x0000
47#define CMD_TARGET_STATUS 0x0001
48#define CMD_DATA_UNDERRUN 0x0002
49#define CMD_DATA_OVERRUN 0x0003
50#define CMD_INVALID 0x0004
51#define CMD_PROTOCOL_ERR 0x0005
52#define CMD_HARDWARE_ERR 0x0006
53#define CMD_CONNECTION_LOST 0x0007
54#define CMD_ABORTED 0x0008
55#define CMD_ABORT_FAILED 0x0009
56#define CMD_UNSOLICITED_ABORT 0x000A
57#define CMD_TIMEOUT 0x000B
58#define CMD_UNABORTABLE 0x000C
59
60//transfer direction
61#define XFER_NONE 0x00
62#define XFER_WRITE 0x01
63#define XFER_READ 0x02
64#define XFER_RSVD 0x03
65
66//task attribute
67#define ATTR_UNTAGGED 0x00
68#define ATTR_SIMPLE 0x04
69#define ATTR_HEADOFQUEUE 0x05
70#define ATTR_ORDERED 0x06
71#define ATTR_ACA 0x07
72
73//cdb type
74#define TYPE_CMD 0x00
75#define TYPE_MSG 0x01
76
77// Type defs used in the following structs
78#define BYTE __u8
79#define WORD __u16
80#define HWORD __u16
81#define DWORD __u32
82
83#define CISS_MAX_LUN 1024
84
85#define LEVEL2LUN 1 // index into Target(x) structure, due to byte swapping
86#define LEVEL3LUN 0
87
88#pragma pack(1)
89
90//Command List Structure
91typedef union _SCSI3Addr_struct {
92 struct {
93 BYTE Dev;
94 BYTE Bus:6;
95 BYTE Mode:2; // b00
96 } PeripDev;
97 struct {
98 BYTE DevLSB;
99 BYTE DevMSB:6;
100 BYTE Mode:2; // b01
101 } LogDev;
102 struct {
103 BYTE Dev:5;
104 BYTE Bus:3;
105 BYTE Targ:6;
106 BYTE Mode:2; // b10
107 } LogUnit;
108} SCSI3Addr_struct;
109
110typedef struct _PhysDevAddr_struct {
111 DWORD TargetId:24;
112 DWORD Bus:6;
113 DWORD Mode:2;
114 SCSI3Addr_struct Target[2]; //2 level target device addr
115} PhysDevAddr_struct;
116
117typedef struct _LogDevAddr_struct {
118 DWORD VolId:30;
119 DWORD Mode:2;
120 BYTE reserved[4];
121} LogDevAddr_struct;
122
123typedef union _LUNAddr_struct {
124 BYTE LunAddrBytes[8];
125 SCSI3Addr_struct SCSI3Lun[4];
126 PhysDevAddr_struct PhysDev;
127 LogDevAddr_struct LogDev;
128} LUNAddr_struct;
129
130typedef struct _RequestBlock_struct {
131 BYTE CDBLen;
132 struct {
133 BYTE Type:3;
134 BYTE Attribute:3;
135 BYTE Direction:2;
136 } Type;
137 HWORD Timeout;
138 BYTE CDB[16];
139} RequestBlock_struct;
140
141typedef union _MoreErrInfo_struct{
142 struct {
143 BYTE Reserved[3];
144 BYTE Type;
145 DWORD ErrorInfo;
146 }Common_Info;
147 struct{
148 BYTE Reserved[2];
149 BYTE offense_size;//size of offending entry
150 BYTE offense_num; //byte # of offense 0-base
151 DWORD offense_value;
152 }Invalid_Cmd;
153}MoreErrInfo_struct;
154typedef struct _ErrorInfo_struct {
155 BYTE ScsiStatus;
156 BYTE SenseLen;
157 HWORD CommandStatus;
158 DWORD ResidualCnt;
159 MoreErrInfo_struct MoreErrInfo;
160 BYTE SenseInfo[SENSEINFOBYTES];
161} ErrorInfo_struct;
162
163#pragma pack()
164#endif /* CCISS_CMD_H */
165
166typedef struct _IOCTL_Command_struct { 40typedef struct _IOCTL_Command_struct {
167 LUNAddr_struct LUN_info; 41 LUNAddr_struct LUN_info;
168 RequestBlock_struct Request; 42 RequestBlock_struct Request;
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 8a4a130cc196..4bca8b60cdf7 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -154,6 +154,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
154 * @max_idle_ns: max idle time permitted by the clocksource (nsecs) 154 * @max_idle_ns: max idle time permitted by the clocksource (nsecs)
155 * @flags: flags describing special properties 155 * @flags: flags describing special properties
156 * @vread: vsyscall based read 156 * @vread: vsyscall based read
157 * @suspend: suspend function for the clocksource, if necessary
157 * @resume: resume function for the clocksource, if necessary 158 * @resume: resume function for the clocksource, if necessary
158 */ 159 */
159struct clocksource { 160struct clocksource {
@@ -172,7 +173,8 @@ struct clocksource {
172 u64 max_idle_ns; 173 u64 max_idle_ns;
173 unsigned long flags; 174 unsigned long flags;
174 cycle_t (*vread)(void); 175 cycle_t (*vread)(void);
175 void (*resume)(void); 176 void (*suspend)(struct clocksource *cs);
177 void (*resume)(struct clocksource *cs);
176#ifdef CONFIG_IA64 178#ifdef CONFIG_IA64
177 void *fsys_mmio; /* used by fsyscall asm code */ 179 void *fsys_mmio; /* used by fsyscall asm code */
178#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) 180#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
@@ -277,6 +279,7 @@ extern void clocksource_unregister(struct clocksource*);
277extern void clocksource_touch_watchdog(void); 279extern void clocksource_touch_watchdog(void);
278extern struct clocksource* clocksource_get_next(void); 280extern struct clocksource* clocksource_get_next(void);
279extern void clocksource_change_rating(struct clocksource *cs, int rating); 281extern void clocksource_change_rating(struct clocksource *cs, int rating);
282extern void clocksource_suspend(void);
280extern void clocksource_resume(void); 283extern void clocksource_resume(void);
281extern struct clocksource * __init __weak clocksource_default_clock(void); 284extern struct clocksource * __init __weak clocksource_default_clock(void);
282extern void clocksource_mark_unstable(struct clocksource *cs); 285extern void clocksource_mark_unstable(struct clocksource *cs);
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 188fcae10a99..a5a472b10746 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -5,7 +5,7 @@
5 5
6#ifdef __CHECKER__ 6#ifdef __CHECKER__
7# define __user __attribute__((noderef, address_space(1))) 7# define __user __attribute__((noderef, address_space(1)))
8# define __kernel /* default address space */ 8# define __kernel __attribute__((address_space(0)))
9# define __safe __attribute__((safe)) 9# define __safe __attribute__((safe))
10# define __force __attribute__((force)) 10# define __force __attribute__((force))
11# define __nocast __attribute__((nocast)) 11# define __nocast __attribute__((nocast))
diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h
new file mode 100644
index 000000000000..7c930dba477c
--- /dev/null
+++ b/include/linux/davinci_emac.h
@@ -0,0 +1,39 @@
1/*
2 * TI DaVinci EMAC platform support
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef _LINUX_DAVINCI_EMAC_H
12#define _LINUX_DAVINCI_EMAC_H
13
14#include <linux/if_ether.h>
15#include <linux/memory.h>
16
17struct emac_platform_data {
18 char mac_addr[ETH_ALEN];
19 u32 ctrl_reg_offset;
20 u32 ctrl_mod_reg_offset;
21 u32 ctrl_ram_offset;
22 u32 hw_ram_addr;
23 u32 mdio_reg_offset;
24 u32 ctrl_ram_size;
25 u32 phy_mask;
26 u32 mdio_max_freq;
27 u8 rmii_en;
28 u8 version;
29 void (*interrupt_enable) (void);
30 void (*interrupt_disable) (void);
31};
32
33enum {
34 EMAC_VERSION_1, /* DM644x */
35 EMAC_VERSION_2, /* DM646x */
36};
37
38void davinci_get_mac_addr(struct memory_accessor *mem_acc, void *context);
39#endif
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 78784982b33e..21fd9b7c6a40 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -162,7 +162,7 @@ struct dma_chan {
162 struct dma_chan_dev *dev; 162 struct dma_chan_dev *dev;
163 163
164 struct list_head device_node; 164 struct list_head device_node;
165 struct dma_chan_percpu *local; 165 struct dma_chan_percpu __percpu *local;
166 int client_count; 166 int client_count;
167 int table_count; 167 int table_count;
168 void *private; 168 void *private;
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index ef4a2d84d922..cca1c3de140d 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -242,6 +242,7 @@ enum ethtool_stringset {
242 ETH_SS_TEST = 0, 242 ETH_SS_TEST = 0,
243 ETH_SS_STATS, 243 ETH_SS_STATS,
244 ETH_SS_PRIV_FLAGS, 244 ETH_SS_PRIV_FLAGS,
245 ETH_SS_NTUPLE_FILTERS,
245}; 246};
246 247
247/* for passing string sets for data tagging */ 248/* for passing string sets for data tagging */
@@ -290,6 +291,7 @@ struct ethtool_perm_addr {
290 */ 291 */
291enum ethtool_flags { 292enum ethtool_flags {
292 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ 293 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
294 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
293}; 295};
294 296
295/* The following structures are for supporting RX network flow 297/* The following structures are for supporting RX network flow
@@ -363,6 +365,35 @@ struct ethtool_rxnfc {
363 __u32 rule_locs[0]; 365 __u32 rule_locs[0];
364}; 366};
365 367
368struct ethtool_rx_ntuple_flow_spec {
369 __u32 flow_type;
370 union {
371 struct ethtool_tcpip4_spec tcp_ip4_spec;
372 struct ethtool_tcpip4_spec udp_ip4_spec;
373 struct ethtool_tcpip4_spec sctp_ip4_spec;
374 struct ethtool_ah_espip4_spec ah_ip4_spec;
375 struct ethtool_ah_espip4_spec esp_ip4_spec;
376 struct ethtool_rawip4_spec raw_ip4_spec;
377 struct ethtool_ether_spec ether_spec;
378 struct ethtool_usrip4_spec usr_ip4_spec;
379 __u8 hdata[64];
380 } h_u, m_u; /* entry, mask */
381
382 __u16 vlan_tag;
383 __u16 vlan_tag_mask;
384 __u64 data; /* user-defined flow spec data */
385 __u64 data_mask; /* user-defined flow spec mask */
386
387 /* signed to distinguish between queue and actions (DROP) */
388 __s32 action;
389#define ETHTOOL_RXNTUPLE_ACTION_DROP -1
390};
391
392struct ethtool_rx_ntuple {
393 __u32 cmd;
394 struct ethtool_rx_ntuple_flow_spec fs;
395};
396
366#define ETHTOOL_FLASH_MAX_FILENAME 128 397#define ETHTOOL_FLASH_MAX_FILENAME 128
367enum ethtool_flash_op_type { 398enum ethtool_flash_op_type {
368 ETHTOOL_FLASH_ALL_REGIONS = 0, 399 ETHTOOL_FLASH_ALL_REGIONS = 0,
@@ -377,6 +408,20 @@ struct ethtool_flash {
377 408
378#ifdef __KERNEL__ 409#ifdef __KERNEL__
379 410
411#include <linux/rculist.h>
412
413struct ethtool_rx_ntuple_flow_spec_container {
414 struct ethtool_rx_ntuple_flow_spec fs;
415 struct list_head list;
416};
417
418struct ethtool_rx_ntuple_list {
419#define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024
420#define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14
421 struct list_head list;
422 unsigned int count;
423};
424
380struct net_device; 425struct net_device;
381 426
382/* Some generic methods drivers may use in their ethtool_ops */ 427/* Some generic methods drivers may use in their ethtool_ops */
@@ -394,6 +439,7 @@ u32 ethtool_op_get_ufo(struct net_device *dev);
394int ethtool_op_set_ufo(struct net_device *dev, u32 data); 439int ethtool_op_set_ufo(struct net_device *dev, u32 data);
395u32 ethtool_op_get_flags(struct net_device *dev); 440u32 ethtool_op_get_flags(struct net_device *dev);
396int ethtool_op_set_flags(struct net_device *dev, u32 data); 441int ethtool_op_set_flags(struct net_device *dev, u32 data);
442void ethtool_ntuple_flush(struct net_device *dev);
397 443
398/** 444/**
399 * &ethtool_ops - Alter and report network device settings 445 * &ethtool_ops - Alter and report network device settings
@@ -500,6 +546,8 @@ struct ethtool_ops {
500 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 546 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
501 int (*flash_device)(struct net_device *, struct ethtool_flash *); 547 int (*flash_device)(struct net_device *, struct ethtool_flash *);
502 int (*reset)(struct net_device *, u32 *); 548 int (*reset)(struct net_device *, u32 *);
549 int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *);
550 int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *);
503}; 551};
504#endif /* __KERNEL__ */ 552#endif /* __KERNEL__ */
505 553
@@ -559,6 +607,9 @@ struct ethtool_ops {
559#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ 607#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
560#define ETHTOOL_RESET 0x00000034 /* Reset hardware */ 608#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
561 609
610#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
611#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */
612
562/* compatibility with older code */ 613/* compatibility with older code */
563#define SPARC_ETH_GSET ETHTOOL_GSET 614#define SPARC_ETH_GSET ETHTOOL_GSET
564#define SPARC_ETH_SSET ETHTOOL_SSET 615#define SPARC_ETH_SSET ETHTOOL_SSET
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 1bc08541c2b9..48e68da097f6 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -46,7 +46,6 @@ struct gameport {
46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ 46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
47 47
48 struct device dev; 48 struct device dev;
49 unsigned int registered; /* port has been fully registered with driver core */
50 49
51 struct list_head node; 50 struct list_head node;
52}; 51};
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 9717081c75ad..56b50514ab25 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -101,7 +101,7 @@ struct hd_struct {
101 unsigned long stamp; 101 unsigned long stamp;
102 int in_flight[2]; 102 int in_flight[2];
103#ifdef CONFIG_SMP 103#ifdef CONFIG_SMP
104 struct disk_stats *dkstats; 104 struct disk_stats __percpu *dkstats;
105#else 105#else
106 struct disk_stats dkstats; 106 struct disk_stats dkstats;
107#endif 107#endif
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index 81f90a59cda6..4f4462974c14 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -180,33 +180,6 @@ struct gfs2_rgrp {
180}; 180};
181 181
182/* 182/*
183 * quota linked list: user quotas and group quotas form two separate
184 * singly linked lists. ll_next stores uids or gids of next quotas in the
185 * linked list.
186
187Given the uid/gid, how to calculate the quota file offsets for the corresponding
188gfs2_quota structures on disk:
189
190for user quotas, given uid,
191offset = uid * sizeof(struct gfs2_quota);
192
193for group quotas, given gid,
194offset = (gid * sizeof(struct gfs2_quota)) + sizeof(struct gfs2_quota);
195
196
197 uid:0 gid:0 uid:12 gid:12 uid:17 gid:17 uid:5142 gid:5142
198+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
199| valid | valid | :: | valid | valid | :: | valid | inval | :: | inval | valid |
200+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
201next:12 next:12 next:17 next:5142 next:NULL next:NULL
202 | | | | |<-- user quota list |
203 \______|___________/ \______|___________/ group quota list -->|
204 | | |
205 \__________________/ \_______________________________________/
206
207*/
208
209/*
210 * quota structure 183 * quota structure
211 */ 184 */
212 185
@@ -214,8 +187,7 @@ struct gfs2_quota {
214 __be64 qu_limit; 187 __be64 qu_limit;
215 __be64 qu_warn; 188 __be64 qu_warn;
216 __be64 qu_value; 189 __be64 qu_value;
217 __be32 qu_ll_next; /* location of next quota in list */ 190 __u8 qu_reserved[64];
218 __u8 qu_reserved[60];
219}; 191};
220 192
221/* 193/*
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index 1289fa7623ca..cd0b3f30f48e 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -10,6 +10,7 @@ struct gpio_keys_button {
10 int type; /* input event type (EV_KEY, EV_SW) */ 10 int type; /* input event type (EV_KEY, EV_SW) */
11 int wakeup; /* configure the button as a wake-up source */ 11 int wakeup; /* configure the button as a wake-up source */
12 int debounce_interval; /* debounce ticks interval in msecs */ 12 int debounce_interval; /* debounce ticks interval in msecs */
13 bool can_disable;
13}; 14};
14 15
15struct gpio_keys_platform_data { 16struct gpio_keys_platform_data {
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index 9eb07bbc6522..a87124d4d533 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -12,9 +12,8 @@
12#ifndef __I2C_PNX_H__ 12#ifndef __I2C_PNX_H__
13#define __I2C_PNX_H__ 13#define __I2C_PNX_H__
14 14
15#include <linux/pm.h>
16
17struct platform_device; 15struct platform_device;
16struct clk;
18 17
19struct i2c_pnx_mif { 18struct i2c_pnx_mif {
20 int ret; /* Return value */ 19 int ret; /* Return value */
@@ -26,20 +25,18 @@ struct i2c_pnx_mif {
26}; 25};
27 26
28struct i2c_pnx_algo_data { 27struct i2c_pnx_algo_data {
29 u32 base; 28 void __iomem *ioaddr;
30 u32 ioaddr;
31 int irq;
32 struct i2c_pnx_mif mif; 29 struct i2c_pnx_mif mif;
33 int last; 30 int last;
31 struct clk *clk;
32 struct i2c_pnx_data *i2c_pnx;
33 struct i2c_adapter adapter;
34}; 34};
35 35
36struct i2c_pnx_data { 36struct i2c_pnx_data {
37 int (*suspend) (struct platform_device *pdev, pm_message_t state); 37 const char *name;
38 int (*resume) (struct platform_device *pdev); 38 u32 base;
39 u32 (*calculate_input_freq) (struct platform_device *pdev); 39 int irq;
40 int (*set_clock_run) (struct platform_device *pdev);
41 int (*set_clock_stop) (struct platform_device *pdev);
42 struct i2c_adapter *adapter;
43}; 40};
44 41
45#endif /* __I2C_PNX_H__ */ 42#endif /* __I2C_PNX_H__ */
diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h
new file mode 100644
index 000000000000..63f57a8c8b31
--- /dev/null
+++ b/include/linux/i2c-smbus.h
@@ -0,0 +1,50 @@
1/*
2 * i2c-smbus.h - SMBus extensions to the I2C protocol
3 *
4 * Copyright (C) 2010 Jean Delvare <khali@linux-fr.org>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _LINUX_I2C_SMBUS_H
22#define _LINUX_I2C_SMBUS_H
23
24#include <linux/i2c.h>
25
26
27/**
28 * i2c_smbus_alert_setup - platform data for the smbus_alert i2c client
29 * @alert_edge_triggered: whether the alert interrupt is edge (1) or level (0)
30 * triggered
31 * @irq: IRQ number, if the smbus_alert driver should take care of interrupt
32 * handling
33 *
34 * If irq is not specified, the smbus_alert driver doesn't take care of
35 * interrupt handling. In that case it is up to the I2C bus driver to either
36 * handle the interrupts or to poll for alerts.
37 *
38 * If irq is specified then it it crucial that alert_edge_triggered is
39 * properly set.
40 */
41struct i2c_smbus_alert_setup {
42 unsigned int alert_edge_triggered:1;
43 int irq;
44};
45
46struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter,
47 struct i2c_smbus_alert_setup *setup);
48int i2c_handle_smbus_alert(struct i2c_client *ara);
49
50#endif /* _LINUX_I2C_SMBUS_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 02fc617782ef..0a5da639b327 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -53,6 +53,7 @@ struct i2c_board_info;
53 * on a bus (or read from them). Apart from two basic transfer functions to 53 * on a bus (or read from them). Apart from two basic transfer functions to
54 * transmit one message at a time, a more complex version can be used to 54 * transmit one message at a time, a more complex version can be used to
55 * transmit an arbitrary number of messages without interruption. 55 * transmit an arbitrary number of messages without interruption.
56 * @count must be be less than 64k since msg.len is u16.
56 */ 57 */
57extern int i2c_master_send(struct i2c_client *client, const char *buf, 58extern int i2c_master_send(struct i2c_client *client, const char *buf,
58 int count); 59 int count);
@@ -152,6 +153,13 @@ struct i2c_driver {
152 int (*suspend)(struct i2c_client *, pm_message_t mesg); 153 int (*suspend)(struct i2c_client *, pm_message_t mesg);
153 int (*resume)(struct i2c_client *); 154 int (*resume)(struct i2c_client *);
154 155
156 /* Alert callback, for example for the SMBus alert protocol.
157 * The format and meaning of the data value depends on the protocol.
158 * For the SMBus alert protocol, there is a single bit of data passed
159 * as the alert response's low bit ("event flag").
160 */
161 void (*alert)(struct i2c_client *, unsigned int data);
162
155 /* a ioctl like command that can be used to perform specific functions 163 /* a ioctl like command that can be used to perform specific functions
156 * with the device. 164 * with the device.
157 */ 165 */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index bf1c5be1f5b6..7897f3096560 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -547,6 +547,10 @@ struct twl4030_codec_data {
547 unsigned int audio_mclk; 547 unsigned int audio_mclk;
548 struct twl4030_codec_audio_data *audio; 548 struct twl4030_codec_audio_data *audio;
549 struct twl4030_codec_vibra_data *vibra; 549 struct twl4030_codec_vibra_data *vibra;
550
551 /* twl6030 */
552 int audpwron_gpio; /* audio power-on gpio */
553 int naudint_irq; /* audio interrupt */
550}; 554};
551 555
552struct twl4030_platform_data { 556struct twl4030_platform_data {
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 4c4e57d1f19d..87018dc5527d 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -385,7 +385,7 @@
385/* defines for max_sectors and max_phys_segments */ 385/* defines for max_sectors and max_phys_segments */
386#define I2O_MAX_SECTORS 1024 386#define I2O_MAX_SECTORS 1024
387#define I2O_MAX_SECTORS_LIMITED 128 387#define I2O_MAX_SECTORS_LIMITED 128
388#define I2O_MAX_PHYS_SEGMENTS MAX_PHYS_SEGMENTS 388#define I2O_MAX_PHYS_SEGMENTS BLK_MAX_SEGMENTS
389 389
390/* 390/*
391 * Message structures 391 * Message structures
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index c0d8357917e2..4c4c74ec5987 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -174,8 +174,7 @@ struct icmp6_filter {
174 174
175extern void icmpv6_send(struct sk_buff *skb, 175extern void icmpv6_send(struct sk_buff *skb,
176 u8 type, u8 code, 176 u8 type, u8 code,
177 __u32 info, 177 __u32 info);
178 struct net_device *dev);
179 178
180extern int icmpv6_init(void); 179extern int icmpv6_init(void);
181extern int icmpv6_err_convert(u8 type, u8 code, 180extern int icmpv6_err_convert(u8 type, u8 code,
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 163c840437d6..19984958ab7b 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -120,6 +120,26 @@
120#define IEEE80211_QOS_CTL_TID_MASK 0x000F 120#define IEEE80211_QOS_CTL_TID_MASK 0x000F
121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
122 122
123/* U-APSD queue for WMM IEs sent by AP */
124#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7)
125
126/* U-APSD queues for WMM IEs sent by STA */
127#define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO (1<<0)
128#define IEEE80211_WMM_IE_STA_QOSINFO_AC_VI (1<<1)
129#define IEEE80211_WMM_IE_STA_QOSINFO_AC_BK (1<<2)
130#define IEEE80211_WMM_IE_STA_QOSINFO_AC_BE (1<<3)
131#define IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK 0x0f
132
133/* U-APSD max SP length for WMM IEs sent by STA */
134#define IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL 0x00
135#define IEEE80211_WMM_IE_STA_QOSINFO_SP_2 0x01
136#define IEEE80211_WMM_IE_STA_QOSINFO_SP_4 0x02
137#define IEEE80211_WMM_IE_STA_QOSINFO_SP_6 0x03
138#define IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK 0x03
139#define IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT 5
140
141#define IEEE80211_HT_CTL_LEN 4
142
123struct ieee80211_hdr { 143struct ieee80211_hdr {
124 __le16 frame_control; 144 __le16 frame_control;
125 __le16 duration_id; 145 __le16 duration_id;
@@ -130,6 +150,25 @@ struct ieee80211_hdr {
130 u8 addr4[6]; 150 u8 addr4[6];
131} __attribute__ ((packed)); 151} __attribute__ ((packed));
132 152
153struct ieee80211_hdr_3addr {
154 __le16 frame_control;
155 __le16 duration_id;
156 u8 addr1[6];
157 u8 addr2[6];
158 u8 addr3[6];
159 __le16 seq_ctrl;
160} __attribute__ ((packed));
161
162struct ieee80211_qos_hdr {
163 __le16 frame_control;
164 __le16 duration_id;
165 u8 addr1[6];
166 u8 addr2[6];
167 u8 addr3[6];
168 __le16 seq_ctrl;
169 __le16 qos_ctrl;
170} __attribute__ ((packed));
171
133/** 172/**
134 * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set 173 * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set
135 * @fc: frame control bytes in little-endian byteorder 174 * @fc: frame control bytes in little-endian byteorder
@@ -707,6 +746,10 @@ struct ieee80211_mgmt {
707 u8 action; 746 u8 action;
708 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; 747 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
709 } __attribute__ ((packed)) sa_query; 748 } __attribute__ ((packed)) sa_query;
749 struct {
750 u8 action;
751 u8 smps_control;
752 } __attribute__ ((packed)) ht_smps;
710 } u; 753 } u;
711 } __attribute__ ((packed)) action; 754 } __attribute__ ((packed)) action;
712 } u; 755 } u;
@@ -771,7 +814,10 @@ struct ieee80211_bar {
771/** 814/**
772 * struct ieee80211_mcs_info - MCS information 815 * struct ieee80211_mcs_info - MCS information
773 * @rx_mask: RX mask 816 * @rx_mask: RX mask
774 * @rx_highest: highest supported RX rate 817 * @rx_highest: highest supported RX rate. If set represents
818 * the highest supported RX data rate in units of 1 Mbps.
819 * If this field is 0 this value should not be used to
820 * consider the highest RX data rate supported.
775 * @tx_params: TX parameters 821 * @tx_params: TX parameters
776 */ 822 */
777struct ieee80211_mcs_info { 823struct ieee80211_mcs_info {
@@ -824,6 +870,7 @@ struct ieee80211_ht_cap {
824#define IEEE80211_HT_CAP_LDPC_CODING 0x0001 870#define IEEE80211_HT_CAP_LDPC_CODING 0x0001
825#define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 871#define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002
826#define IEEE80211_HT_CAP_SM_PS 0x000C 872#define IEEE80211_HT_CAP_SM_PS 0x000C
873#define IEEE80211_HT_CAP_SM_PS_SHIFT 2
827#define IEEE80211_HT_CAP_GRN_FLD 0x0010 874#define IEEE80211_HT_CAP_GRN_FLD 0x0010
828#define IEEE80211_HT_CAP_SGI_20 0x0020 875#define IEEE80211_HT_CAP_SGI_20 0x0020
829#define IEEE80211_HT_CAP_SGI_40 0x0040 876#define IEEE80211_HT_CAP_SGI_40 0x0040
@@ -839,6 +886,7 @@ struct ieee80211_ht_cap {
839/* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ 886/* 802.11n HT capability AMPDU settings (for ampdu_params_info) */
840#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 887#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03
841#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C 888#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C
889#define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2
842 890
843/* 891/*
844 * Maximum length of AMPDU that the STA can receive. 892 * Maximum length of AMPDU that the STA can receive.
@@ -922,12 +970,17 @@ struct ieee80211_ht_info {
922#define IEEE80211_MAX_AMPDU_BUF 0x40 970#define IEEE80211_MAX_AMPDU_BUF 0x40
923 971
924 972
925/* Spatial Multiplexing Power Save Modes */ 973/* Spatial Multiplexing Power Save Modes (for capability) */
926#define WLAN_HT_CAP_SM_PS_STATIC 0 974#define WLAN_HT_CAP_SM_PS_STATIC 0
927#define WLAN_HT_CAP_SM_PS_DYNAMIC 1 975#define WLAN_HT_CAP_SM_PS_DYNAMIC 1
928#define WLAN_HT_CAP_SM_PS_INVALID 2 976#define WLAN_HT_CAP_SM_PS_INVALID 2
929#define WLAN_HT_CAP_SM_PS_DISABLED 3 977#define WLAN_HT_CAP_SM_PS_DISABLED 3
930 978
979/* for SM power control field lower two bits */
980#define WLAN_HT_SMPS_CONTROL_DISABLED 0
981#define WLAN_HT_SMPS_CONTROL_STATIC 1
982#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
983
931/* Authentication algorithms */ 984/* Authentication algorithms */
932#define WLAN_AUTH_OPEN 0 985#define WLAN_AUTH_OPEN 0
933#define WLAN_AUTH_SHARED_KEY 1 986#define WLAN_AUTH_SHARED_KEY 1
@@ -1071,12 +1124,12 @@ enum ieee80211_eid {
1071 WLAN_EID_TIM = 5, 1124 WLAN_EID_TIM = 5,
1072 WLAN_EID_IBSS_PARAMS = 6, 1125 WLAN_EID_IBSS_PARAMS = 6,
1073 WLAN_EID_CHALLENGE = 16, 1126 WLAN_EID_CHALLENGE = 16,
1074 /* 802.11d */ 1127
1075 WLAN_EID_COUNTRY = 7, 1128 WLAN_EID_COUNTRY = 7,
1076 WLAN_EID_HP_PARAMS = 8, 1129 WLAN_EID_HP_PARAMS = 8,
1077 WLAN_EID_HP_TABLE = 9, 1130 WLAN_EID_HP_TABLE = 9,
1078 WLAN_EID_REQUEST = 10, 1131 WLAN_EID_REQUEST = 10,
1079 /* 802.11e */ 1132
1080 WLAN_EID_QBSS_LOAD = 11, 1133 WLAN_EID_QBSS_LOAD = 11,
1081 WLAN_EID_EDCA_PARAM_SET = 12, 1134 WLAN_EID_EDCA_PARAM_SET = 12,
1082 WLAN_EID_TSPEC = 13, 1135 WLAN_EID_TSPEC = 13,
@@ -1099,7 +1152,7 @@ enum ieee80211_eid {
1099 WLAN_EID_PREP = 69, 1152 WLAN_EID_PREP = 69,
1100 WLAN_EID_PERR = 70, 1153 WLAN_EID_PERR = 70,
1101 WLAN_EID_RANN = 49, /* compatible with FreeBSD */ 1154 WLAN_EID_RANN = 49, /* compatible with FreeBSD */
1102 /* 802.11h */ 1155
1103 WLAN_EID_PWR_CONSTRAINT = 32, 1156 WLAN_EID_PWR_CONSTRAINT = 32,
1104 WLAN_EID_PWR_CAPABILITY = 33, 1157 WLAN_EID_PWR_CAPABILITY = 33,
1105 WLAN_EID_TPC_REQUEST = 34, 1158 WLAN_EID_TPC_REQUEST = 34,
@@ -1110,20 +1163,41 @@ enum ieee80211_eid {
1110 WLAN_EID_MEASURE_REPORT = 39, 1163 WLAN_EID_MEASURE_REPORT = 39,
1111 WLAN_EID_QUIET = 40, 1164 WLAN_EID_QUIET = 40,
1112 WLAN_EID_IBSS_DFS = 41, 1165 WLAN_EID_IBSS_DFS = 41,
1113 /* 802.11g */ 1166
1114 WLAN_EID_ERP_INFO = 42, 1167 WLAN_EID_ERP_INFO = 42,
1115 WLAN_EID_EXT_SUPP_RATES = 50, 1168 WLAN_EID_EXT_SUPP_RATES = 50,
1116 /* 802.11n */ 1169
1117 WLAN_EID_HT_CAPABILITY = 45, 1170 WLAN_EID_HT_CAPABILITY = 45,
1118 WLAN_EID_HT_INFORMATION = 61, 1171 WLAN_EID_HT_INFORMATION = 61,
1119 /* 802.11i */ 1172
1120 WLAN_EID_RSN = 48, 1173 WLAN_EID_RSN = 48,
1121 WLAN_EID_TIMEOUT_INTERVAL = 56, 1174 WLAN_EID_MMIE = 76,
1122 WLAN_EID_MMIE = 76 /* 802.11w */,
1123 WLAN_EID_WPA = 221, 1175 WLAN_EID_WPA = 221,
1124 WLAN_EID_GENERIC = 221, 1176 WLAN_EID_GENERIC = 221,
1125 WLAN_EID_VENDOR_SPECIFIC = 221, 1177 WLAN_EID_VENDOR_SPECIFIC = 221,
1126 WLAN_EID_QOS_PARAMETER = 222 1178 WLAN_EID_QOS_PARAMETER = 222,
1179
1180 WLAN_EID_AP_CHAN_REPORT = 51,
1181 WLAN_EID_NEIGHBOR_REPORT = 52,
1182 WLAN_EID_RCPI = 53,
1183 WLAN_EID_BSS_AVG_ACCESS_DELAY = 63,
1184 WLAN_EID_ANTENNA_INFO = 64,
1185 WLAN_EID_RSNI = 65,
1186 WLAN_EID_MEASUREMENT_PILOT_TX_INFO = 66,
1187 WLAN_EID_BSS_AVAILABLE_CAPACITY = 67,
1188 WLAN_EID_BSS_AC_ACCESS_DELAY = 68,
1189 WLAN_EID_RRM_ENABLED_CAPABILITIES = 70,
1190 WLAN_EID_MULTIPLE_BSSID = 71,
1191
1192 WLAN_EID_MOBILITY_DOMAIN = 54,
1193 WLAN_EID_FAST_BSS_TRANSITION = 55,
1194 WLAN_EID_TIMEOUT_INTERVAL = 56,
1195 WLAN_EID_RIC_DATA = 57,
1196 WLAN_EID_RIC_DESCRIPTOR = 75,
1197
1198 WLAN_EID_DSE_REGISTERED_LOCATION = 58,
1199 WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
1200 WLAN_EID_EXT_CHANSWITCH_ANN = 60,
1127}; 1201};
1128 1202
1129/* Action category code */ 1203/* Action category code */
@@ -1150,6 +1224,18 @@ enum ieee80211_spectrum_mgmt_actioncode {
1150 WLAN_ACTION_SPCT_CHL_SWITCH = 4, 1224 WLAN_ACTION_SPCT_CHL_SWITCH = 4,
1151}; 1225};
1152 1226
1227/* HT action codes */
1228enum ieee80211_ht_actioncode {
1229 WLAN_HT_ACTION_NOTIFY_CHANWIDTH = 0,
1230 WLAN_HT_ACTION_SMPS = 1,
1231 WLAN_HT_ACTION_PSMP = 2,
1232 WLAN_HT_ACTION_PCO_PHASE = 3,
1233 WLAN_HT_ACTION_CSI = 4,
1234 WLAN_HT_ACTION_NONCOMPRESSED_BF = 5,
1235 WLAN_HT_ACTION_COMPRESSED_BF = 6,
1236 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7,
1237};
1238
1153/* Security key length */ 1239/* Security key length */
1154enum ieee80211_key_len { 1240enum ieee80211_key_len {
1155 WLAN_KEY_LEN_WEP40 = 5, 1241 WLAN_KEY_LEN_WEP40 = 5,
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 6674791622ca..c9bf92cd7653 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -78,6 +78,11 @@ enum {
78#define IFLA_LINKINFO IFLA_LINKINFO 78#define IFLA_LINKINFO IFLA_LINKINFO
79 IFLA_NET_NS_PID, 79 IFLA_NET_NS_PID,
80 IFLA_IFALIAS, 80 IFLA_IFALIAS,
81 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
82 IFLA_VF_MAC, /* Hardware queue specific attributes */
83 IFLA_VF_VLAN,
84 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
85 IFLA_VFINFO,
81 __IFLA_MAX 86 __IFLA_MAX
82}; 87};
83 88
@@ -196,4 +201,29 @@ enum macvlan_mode {
196 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ 201 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
197}; 202};
198 203
204/* SR-IOV virtual function managment section */
205
206struct ifla_vf_mac {
207 __u32 vf;
208 __u8 mac[32]; /* MAX_ADDR_LEN */
209};
210
211struct ifla_vf_vlan {
212 __u32 vf;
213 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
214 __u32 qos;
215};
216
217struct ifla_vf_tx_rate {
218 __u32 vf;
219 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
220};
221
222struct ifla_vf_info {
223 __u32 vf;
224 __u8 mac[32];
225 __u32 vlan;
226 __u32 qos;
227 __u32 tx_rate;
228};
199#endif /* _LINUX_IF_LINK_H */ 229#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 5f200bac3749..b78a712247da 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -1,6 +1,90 @@
1#ifndef _LINUX_IF_MACVLAN_H 1#ifndef _LINUX_IF_MACVLAN_H
2#define _LINUX_IF_MACVLAN_H 2#define _LINUX_IF_MACVLAN_H
3 3
4#include <linux/if_link.h>
5#include <linux/list.h>
6#include <linux/netdevice.h>
7#include <linux/netlink.h>
8#include <net/netlink.h>
9
10#if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE)
11struct socket *macvtap_get_socket(struct file *);
12#else
13#include <linux/err.h>
14#include <linux/errno.h>
15struct file;
16struct socket;
17static inline struct socket *macvtap_get_socket(struct file *f)
18{
19 return ERR_PTR(-EINVAL);
20}
21#endif /* CONFIG_MACVTAP */
22
23struct macvlan_port;
24struct macvtap_queue;
25
26/**
27 * struct macvlan_rx_stats - MACVLAN percpu rx stats
28 * @rx_packets: number of received packets
29 * @rx_bytes: number of received bytes
30 * @multicast: number of received multicast packets
31 * @rx_errors: number of errors
32 */
33struct macvlan_rx_stats {
34 unsigned long rx_packets;
35 unsigned long rx_bytes;
36 unsigned long multicast;
37 unsigned long rx_errors;
38};
39
40struct macvlan_dev {
41 struct net_device *dev;
42 struct list_head list;
43 struct hlist_node hlist;
44 struct macvlan_port *port;
45 struct net_device *lowerdev;
46 struct macvlan_rx_stats __percpu *rx_stats;
47 enum macvlan_mode mode;
48 int (*receive)(struct sk_buff *skb);
49 int (*forward)(struct net_device *dev, struct sk_buff *skb);
50 struct macvtap_queue *tap;
51};
52
53static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
54 unsigned int len, bool success,
55 bool multicast)
56{
57 struct macvlan_rx_stats *rx_stats;
58
59 rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
60 if (likely(success)) {
61 rx_stats->rx_packets++;;
62 rx_stats->rx_bytes += len;
63 if (multicast)
64 rx_stats->multicast++;
65 } else {
66 rx_stats->rx_errors++;
67 }
68}
69
70extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
71 struct nlattr *tb[], struct nlattr *data[],
72 int (*receive)(struct sk_buff *skb),
73 int (*forward)(struct net_device *dev,
74 struct sk_buff *skb));
75
76extern void macvlan_count_rx(const struct macvlan_dev *vlan,
77 unsigned int len, bool success,
78 bool multicast);
79
80extern void macvlan_dellink(struct net_device *dev, struct list_head *head);
81
82extern int macvlan_link_register(struct rtnl_link_ops *ops);
83
84extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
85 struct net_device *dev);
86
87
4extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); 88extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *);
5 89
6#endif /* _LINUX_IF_MACVLAN_H */ 90#endif /* _LINUX_IF_MACVLAN_H */
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 4021d47cc437..aa57a5f993fc 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -46,6 +46,7 @@ struct sockaddr_ll {
46#define PACKET_RESERVE 12 46#define PACKET_RESERVE 12
47#define PACKET_TX_RING 13 47#define PACKET_TX_RING 13
48#define PACKET_LOSS 14 48#define PACKET_LOSS 14
49#define PACKET_VNET_HDR 15
49 50
50struct tpacket_stats { 51struct tpacket_stats {
51 unsigned int tp_packets; 52 unsigned int tp_packets;
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 3f5fd523b49d..1350a246893a 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -18,6 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/if_ether.h> 20#include <linux/if_ether.h>
21#include <linux/filter.h>
21 22
22/* Read queue size */ 23/* Read queue size */
23#define TUN_READQ_SIZE 500 24#define TUN_READQ_SIZE 500
@@ -48,6 +49,8 @@
48#define TUNGETIFF _IOR('T', 210, unsigned int) 49#define TUNGETIFF _IOR('T', 210, unsigned int)
49#define TUNGETSNDBUF _IOR('T', 211, int) 50#define TUNGETSNDBUF _IOR('T', 211, int)
50#define TUNSETSNDBUF _IOW('T', 212, int) 51#define TUNSETSNDBUF _IOW('T', 212, int)
52#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
53#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
51 54
52/* TUNSETIFF ifr flags */ 55/* TUNSETIFF ifr flags */
53#define IFF_TUN 0x0001 56#define IFF_TUN 0x0001
@@ -86,4 +89,18 @@ struct tun_filter {
86 __u8 addr[0][ETH_ALEN]; 89 __u8 addr[0][ETH_ALEN];
87}; 90};
88 91
92#ifdef __KERNEL__
93#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
94struct socket *tun_get_socket(struct file *);
95#else
96#include <linux/err.h>
97#include <linux/errno.h>
98struct file;
99struct socket;
100static inline struct socket *tun_get_socket(struct file *f)
101{
102 return ERR_PTR(-EINVAL);
103}
104#endif /* CONFIG_TUN */
105#endif /* __KERNEL__ */
89#endif /* __IF_TUN_H */ 106#endif /* __IF_TUN_H */
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 724c27e5d173..93fc2449af10 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -153,6 +153,7 @@ extern int sysctl_igmp_max_msf;
153struct ip_sf_socklist { 153struct ip_sf_socklist {
154 unsigned int sl_max; 154 unsigned int sl_max;
155 unsigned int sl_count; 155 unsigned int sl_count;
156 struct rcu_head rcu;
156 __be32 sl_addr[0]; 157 __be32 sl_addr[0];
157}; 158};
158 159
@@ -170,6 +171,7 @@ struct ip_mc_socklist {
170 struct ip_mreqn multi; 171 struct ip_mreqn multi;
171 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 172 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
172 struct ip_sf_socklist *sflist; 173 struct ip_sf_socklist *sflist;
174 struct rcu_head rcu;
173}; 175};
174 176
175struct ip_sf_list { 177struct ip_sf_list {
diff --git a/include/linux/in.h b/include/linux/in.h
index b615649db129..583c76f9c30f 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -84,6 +84,8 @@ struct in_addr {
84#define IP_ORIGDSTADDR 20 84#define IP_ORIGDSTADDR 20
85#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR 85#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
86 86
87#define IP_MINTTL 21
88
87/* IP_MTU_DISCOVER values */ 89/* IP_MTU_DISCOVER values */
88#define IP_PMTUDISC_DONT 0 /* Never send DF frames */ 90#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
89#define IP_PMTUDISC_WANT 1 /* Use per route hints */ 91#define IP_PMTUDISC_WANT 1 /* Use per route hints */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index b2304929434e..2be1a1a2beb9 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -10,10 +10,40 @@
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h> 11#include <linux/sysctl.h>
12 12
13enum
14{
15 IPV4_DEVCONF_FORWARDING=1,
16 IPV4_DEVCONF_MC_FORWARDING,
17 IPV4_DEVCONF_PROXY_ARP,
18 IPV4_DEVCONF_ACCEPT_REDIRECTS,
19 IPV4_DEVCONF_SECURE_REDIRECTS,
20 IPV4_DEVCONF_SEND_REDIRECTS,
21 IPV4_DEVCONF_SHARED_MEDIA,
22 IPV4_DEVCONF_RP_FILTER,
23 IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
24 IPV4_DEVCONF_BOOTP_RELAY,
25 IPV4_DEVCONF_LOG_MARTIANS,
26 IPV4_DEVCONF_TAG,
27 IPV4_DEVCONF_ARPFILTER,
28 IPV4_DEVCONF_MEDIUM_ID,
29 IPV4_DEVCONF_NOXFRM,
30 IPV4_DEVCONF_NOPOLICY,
31 IPV4_DEVCONF_FORCE_IGMP_VERSION,
32 IPV4_DEVCONF_ARP_ANNOUNCE,
33 IPV4_DEVCONF_ARP_IGNORE,
34 IPV4_DEVCONF_PROMOTE_SECONDARIES,
35 IPV4_DEVCONF_ARP_ACCEPT,
36 IPV4_DEVCONF_ARP_NOTIFY,
37 IPV4_DEVCONF_ACCEPT_LOCAL,
38 IPV4_DEVCONF_SRC_VMARK,
39 IPV4_DEVCONF_PROXY_ARP_PVLAN,
40 __IPV4_DEVCONF_MAX
41};
42
13struct ipv4_devconf { 43struct ipv4_devconf {
14 void *sysctl; 44 void *sysctl;
15 int data[__NET_IPV4_CONF_MAX - 1]; 45 int data[__IPV4_DEVCONF_MAX - 1];
16 DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); 46 DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1);
17}; 47};
18 48
19struct in_device { 49struct in_device {
@@ -40,7 +70,7 @@ struct in_device {
40 struct rcu_head rcu_head; 70 struct rcu_head rcu_head;
41}; 71};
42 72
43#define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) 73#define IPV4_DEVCONF(cnf, attr) ((cnf).data[IPV4_DEVCONF_ ## attr - 1])
44#define IPV4_DEVCONF_ALL(net, attr) \ 74#define IPV4_DEVCONF_ALL(net, attr) \
45 IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) 75 IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr)
46 76
@@ -60,13 +90,13 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index,
60 90
61static inline void ipv4_devconf_setall(struct in_device *in_dev) 91static inline void ipv4_devconf_setall(struct in_device *in_dev)
62{ 92{
63 bitmap_fill(in_dev->cnf.state, __NET_IPV4_CONF_MAX - 1); 93 bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1);
64} 94}
65 95
66#define IN_DEV_CONF_GET(in_dev, attr) \ 96#define IN_DEV_CONF_GET(in_dev, attr) \
67 ipv4_devconf_get((in_dev), NET_IPV4_CONF_ ## attr) 97 ipv4_devconf_get((in_dev), IPV4_DEVCONF_ ## attr)
68#define IN_DEV_CONF_SET(in_dev, attr, val) \ 98#define IN_DEV_CONF_SET(in_dev, attr, val) \
69 ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) 99 ipv4_devconf_set((in_dev), IPV4_DEVCONF_ ## attr, (val))
70 100
71#define IN_DEV_ANDCONF(in_dev, attr) \ 101#define IN_DEV_ANDCONF(in_dev, attr) \
72 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ 102 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \
@@ -89,6 +119,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
89 119
90#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) 120#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)
91#define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) 121#define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP)
122#define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN)
92#define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA) 123#define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA)
93#define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS) 124#define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS)
94#define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \ 125#define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \
diff --git a/include/linux/input.h b/include/linux/input.h
index f44ee9114401..dc24effb6d0e 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -378,7 +378,7 @@ struct input_absinfo {
378#define KEY_WIMAX 246 378#define KEY_WIMAX 246
379#define KEY_RFKILL 247 /* Key that controls all radios */ 379#define KEY_RFKILL 247 /* Key that controls all radios */
380 380
381/* Range 248 - 255 is reserved for special needs of AT keyboard driver */ 381/* Code 255 is reserved for special needs of AT keyboard driver */
382 382
383#define BTN_MISC 0x100 383#define BTN_MISC 0x100
384#define BTN_0 0x100 384#define BTN_0 0x100
@@ -597,6 +597,7 @@ struct input_absinfo {
597#define KEY_NUMERIC_POUND 0x20b 597#define KEY_NUMERIC_POUND 0x20b
598 598
599#define KEY_CAMERA_FOCUS 0x210 599#define KEY_CAMERA_FOCUS 0x210
600#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */
600 601
601#define BTN_TRIGGER_HAPPY 0x2c0 602#define BTN_TRIGGER_HAPPY 0x2c0
602#define BTN_TRIGGER_HAPPY1 0x2c0 603#define BTN_TRIGGER_HAPPY1 0x2c0
@@ -1242,6 +1243,10 @@ struct input_handle;
1242 * @event: event handler. This method is being called by input core with 1243 * @event: event handler. This method is being called by input core with
1243 * interrupts disabled and dev->event_lock spinlock held and so 1244 * interrupts disabled and dev->event_lock spinlock held and so
1244 * it may not sleep 1245 * it may not sleep
1246 * @filter: similar to @event; separates normal event handlers from
1247 * "filters".
1248 * @match: called after comparing device's id with handler's id_table
1249 * to perform fine-grained matching between device and handler
1245 * @connect: called when attaching a handler to an input device 1250 * @connect: called when attaching a handler to an input device
1246 * @disconnect: disconnects a handler from input device 1251 * @disconnect: disconnects a handler from input device
1247 * @start: starts handler for given handle. This function is called by 1252 * @start: starts handler for given handle. This function is called by
@@ -1253,8 +1258,6 @@ struct input_handle;
1253 * @name: name of the handler, to be shown in /proc/bus/input/handlers 1258 * @name: name of the handler, to be shown in /proc/bus/input/handlers
1254 * @id_table: pointer to a table of input_device_ids this driver can 1259 * @id_table: pointer to a table of input_device_ids this driver can
1255 * handle 1260 * handle
1256 * @blacklist: pointer to a table of input_device_ids this driver should
1257 * ignore even if they match @id_table
1258 * @h_list: list of input handles associated with the handler 1261 * @h_list: list of input handles associated with the handler
1259 * @node: for placing the driver onto input_handler_list 1262 * @node: for placing the driver onto input_handler_list
1260 * 1263 *
@@ -1263,6 +1266,11 @@ struct input_handle;
1263 * same time. All of them will get their copy of input event generated by 1266 * same time. All of them will get their copy of input event generated by
1264 * the device. 1267 * the device.
1265 * 1268 *
1269 * The very same structure is used to implement input filters. Input core
1270 * allows filters to run first and will not pass event to regular handlers
1271 * if any of the filters indicate that the event should be filtered (by
1272 * returning %true from their filter() method).
1273 *
1266 * Note that input core serializes calls to connect() and disconnect() 1274 * Note that input core serializes calls to connect() and disconnect()
1267 * methods. 1275 * methods.
1268 */ 1276 */
@@ -1271,6 +1279,8 @@ struct input_handler {
1271 void *private; 1279 void *private;
1272 1280
1273 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); 1281 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
1282 bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
1283 bool (*match)(struct input_handler *handler, struct input_dev *dev);
1274 int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); 1284 int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
1275 void (*disconnect)(struct input_handle *handle); 1285 void (*disconnect)(struct input_handle *handle);
1276 void (*start)(struct input_handle *handle); 1286 void (*start)(struct input_handle *handle);
@@ -1280,7 +1290,6 @@ struct input_handler {
1280 const char *name; 1290 const char *name;
1281 1291
1282 const struct input_device_id *id_table; 1292 const struct input_device_id *id_table;
1283 const struct input_device_id *blacklist;
1284 1293
1285 struct list_head h_list; 1294 struct list_head h_list;
1286 struct list_head node; 1295 struct list_head node;
diff --git a/include/linux/input/sh_keysc.h b/include/linux/input/sh_keysc.h
index c211b5cf08e6..649dc7f12925 100644
--- a/include/linux/input/sh_keysc.h
+++ b/include/linux/input/sh_keysc.h
@@ -1,14 +1,15 @@
1#ifndef __SH_KEYSC_H__ 1#ifndef __SH_KEYSC_H__
2#define __SH_KEYSC_H__ 2#define __SH_KEYSC_H__
3 3
4#define SH_KEYSC_MAXKEYS 30 4#define SH_KEYSC_MAXKEYS 49
5 5
6struct sh_keysc_info { 6struct sh_keysc_info {
7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode; 7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3,
8 SH_KEYSC_MODE_4, SH_KEYSC_MODE_5, SH_KEYSC_MODE_6 } mode;
8 int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */ 9 int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */
9 int delay; 10 int delay;
10 int kycr2_delay; 11 int kycr2_delay;
11 int keycodes[SH_KEYSC_MAXKEYS]; 12 int keycodes[SH_KEYSC_MAXKEYS]; /* KEYIN * KEYOUT */
12}; 13};
13 14
14#endif /* __SH_KEYSC_H__ */ 15#endif /* __SH_KEYSC_H__ */
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index 78ef023227d4..1195a806fe0c 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -49,8 +49,8 @@ struct io_context {
49 /* 49 /*
50 * For request batching 50 * For request batching
51 */ 51 */
52 unsigned long last_waited; /* Time last woken after wait for request */
53 int nr_batch_requests; /* Number of requests left in the batch */ 52 int nr_batch_requests; /* Number of requests left in the batch */
53 unsigned long last_waited; /* Time last woken after wait for request */
54 54
55 struct radix_tree_root radix_root; 55 struct radix_tree_root radix_root;
56 struct hlist_head cic_list; 56 struct hlist_head cic_list;
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 451481c082b5..d13492df57a1 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -90,7 +90,7 @@ struct msi_desc;
90 * @startup: start up the interrupt (defaults to ->enable if NULL) 90 * @startup: start up the interrupt (defaults to ->enable if NULL)
91 * @shutdown: shut down the interrupt (defaults to ->disable if NULL) 91 * @shutdown: shut down the interrupt (defaults to ->disable if NULL)
92 * @enable: enable the interrupt (defaults to chip->unmask if NULL) 92 * @enable: enable the interrupt (defaults to chip->unmask if NULL)
93 * @disable: disable the interrupt (defaults to chip->mask if NULL) 93 * @disable: disable the interrupt
94 * @ack: start of a new interrupt 94 * @ack: start of a new interrupt
95 * @mask: mask an interrupt source 95 * @mask: mask an interrupt source
96 * @mask_ack: ack and mask an interrupt source 96 * @mask_ack: ack and mask an interrupt source
diff --git a/include/linux/isdn/capilli.h b/include/linux/isdn/capilli.h
index 7acb87a44872..11b57c485854 100644
--- a/include/linux/isdn/capilli.h
+++ b/include/linux/isdn/capilli.h
@@ -50,8 +50,7 @@ struct capi_ctr {
50 u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); 50 u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb);
51 51
52 char *(*procinfo)(struct capi_ctr *); 52 char *(*procinfo)(struct capi_ctr *);
53 int (*ctr_read_proc)(char *page, char **start, off_t off, 53 const struct file_operations *proc_fops;
54 int count, int *eof, struct capi_ctr *card);
55 54
56 /* filled in before calling ready callback */ 55 /* filled in before calling ready callback */
57 u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */ 56 u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */
@@ -67,9 +66,10 @@ struct capi_ctr {
67 unsigned long nsentdatapkt; 66 unsigned long nsentdatapkt;
68 67
69 int cnr; /* controller number */ 68 int cnr; /* controller number */
70 volatile unsigned short cardstate; /* controller state */ 69 unsigned short state; /* controller state */
71 volatile int blocked; /* output blocked */ 70 int blocked; /* output blocked */
72 int traceflag; /* capi trace */ 71 int traceflag; /* capi trace */
72 wait_queue_head_t state_wait_queue;
73 73
74 struct proc_dir_entry *procent; 74 struct proc_dir_entry *procent;
75 char procfn[128]; 75 char procfn[128];
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index 8bdb16bfe5fb..506ad20c18f8 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -161,7 +161,4 @@ static inline void con_schedule_flip(struct tty_struct *t)
161 schedule_delayed_work(&t->buf.work, 0); 161 schedule_delayed_work(&t->buf.work, 0);
162} 162}
163 163
164/* mac_hid.c */
165extern int mac_hid_mouse_emulate_buttons(int, unsigned int, int);
166
167#endif 164#endif
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index a53e932f80fb..9c2683929fd3 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -48,9 +48,7 @@ typedef struct kcapi_carddef {
48#include <linux/list.h> 48#include <linux/list.h>
49#include <linux/skbuff.h> 49#include <linux/skbuff.h>
50#include <linux/workqueue.h> 50#include <linux/workqueue.h>
51 51#include <linux/notifier.h>
52#define KCI_CONTRUP 0 /* arg: struct capi_profile */
53#define KCI_CONTRDOWN 1 /* arg: NULL */
54 52
55struct capi20_appl { 53struct capi20_appl {
56 u16 applid; 54 u16 applid;
@@ -67,11 +65,6 @@ struct capi20_appl {
67 struct sk_buff_head recv_queue; 65 struct sk_buff_head recv_queue;
68 struct work_struct recv_work; 66 struct work_struct recv_work;
69 int release_in_progress; 67 int release_in_progress;
70
71 /* ugly hack to allow for notification of added/removed
72 * controllers. The Right Way (tm) is known. XXX
73 */
74 void (*callback) (unsigned int cmd, __u32 contr, void *data);
75}; 68};
76 69
77u16 capi20_isinstalled(void); 70u16 capi20_isinstalled(void);
@@ -84,11 +77,11 @@ u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
84u16 capi20_get_profile(u32 contr, struct capi_profile *profp); 77u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
85int capi20_manufacturer(unsigned int cmd, void __user *data); 78int capi20_manufacturer(unsigned int cmd, void __user *data);
86 79
87/* temporary hack XXX */ 80#define CAPICTR_UP 0
88void capi20_set_callback(struct capi20_appl *ap, 81#define CAPICTR_DOWN 1
89 void (*callback) (unsigned int cmd, __u32 contr, void *data));
90
91 82
83int register_capictr_notifier(struct notifier_block *nb);
84int unregister_capictr_notifier(struct notifier_block *nb);
92 85
93#define CAPI_NOERROR 0x0000 86#define CAPI_NOERROR 0x0000
94 87
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index c356b6914ffd..03e8e8dbc577 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -199,7 +199,7 @@ extern struct kimage *kexec_crash_image;
199 */ 199 */
200extern struct resource crashk_res; 200extern struct resource crashk_res;
201typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; 201typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4];
202extern note_buf_t *crash_notes; 202extern note_buf_t __percpu *crash_notes;
203extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; 203extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
204extern size_t vmcoreinfo_size; 204extern size_t vmcoreinfo_size;
205extern size_t vmcoreinfo_max_size; 205extern size_t vmcoreinfo_max_size;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 73112250862c..f8ea71e6d0e2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -857,6 +857,7 @@ struct ata_port_operations {
857 unsigned int (*sff_data_xfer)(struct ata_device *dev, 857 unsigned int (*sff_data_xfer)(struct ata_device *dev,
858 unsigned char *buf, unsigned int buflen, int rw); 858 unsigned char *buf, unsigned int buflen, int rw);
859 u8 (*sff_irq_on)(struct ata_port *); 859 u8 (*sff_irq_on)(struct ata_port *);
860 bool (*sff_irq_check)(struct ata_port *);
860 void (*sff_irq_clear)(struct ata_port *); 861 void (*sff_irq_clear)(struct ata_port *);
861 862
862 void (*bmdma_setup)(struct ata_queued_cmd *qc); 863 void (*bmdma_setup)(struct ata_queued_cmd *qc);
@@ -1642,8 +1643,8 @@ extern int ata_pci_sff_activate_host(struct ata_host *host,
1642 irq_handler_t irq_handler, 1643 irq_handler_t irq_handler,
1643 struct scsi_host_template *sht); 1644 struct scsi_host_template *sht);
1644extern int ata_pci_sff_init_one(struct pci_dev *pdev, 1645extern int ata_pci_sff_init_one(struct pci_dev *pdev,
1645 const struct ata_port_info * const * ppi, 1646 const struct ata_port_info * const * ppi,
1646 struct scsi_host_template *sht, void *host_priv); 1647 struct scsi_host_template *sht, void *host_priv, int hflags);
1647#endif /* CONFIG_PCI */ 1648#endif /* CONFIG_PCI */
1648 1649
1649/** 1650/**
diff --git a/include/linux/llc.h b/include/linux/llc.h
index 7733585603f1..ad7074ba81af 100644
--- a/include/linux/llc.h
+++ b/include/linux/llc.h
@@ -36,6 +36,7 @@ enum llc_sockopts {
36 LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */ 36 LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */
37 LLC_OPT_TX_WIN, /* tx window size. */ 37 LLC_OPT_TX_WIN, /* tx window size. */
38 LLC_OPT_RX_WIN, /* rx window size. */ 38 LLC_OPT_RX_WIN, /* rx window size. */
39 LLC_OPT_PKTINFO, /* ancillary packet information. */
39 LLC_OPT_MAX 40 LLC_OPT_MAX
40}; 41};
41 42
@@ -70,6 +71,12 @@ enum llc_sockopts {
70#define LLC_SAP_RM 0xD4 /* Resource Management */ 71#define LLC_SAP_RM 0xD4 /* Resource Management */
71#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */ 72#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
72 73
74struct llc_pktinfo {
75 int lpi_ifindex;
76 unsigned char lpi_sap;
77 unsigned char lpi_mac[IFHWADDRLEN];
78};
79
73#ifdef __KERNEL__ 80#ifdef __KERNEL__
74#define LLC_SAP_DYN_START 0xC0 81#define LLC_SAP_DYN_START 0xC0
75#define LLC_SAP_DYN_STOP 0xDE 82#define LLC_SAP_DYN_STOP 0xDE
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index adaf3c15e449..8b5f7cc0fba6 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -30,6 +30,7 @@
30#define HPET_MINOR 228 30#define HPET_MINOR 228
31#define FUSE_MINOR 229 31#define FUSE_MINOR 229
32#define KVM_MINOR 232 32#define KVM_MINOR 232
33#define VHOST_NET_MINOR 233
33#define MISC_DYNAMIC_MINOR 255 34#define MISC_DYNAMIC_MINOR 255
34 35
35struct device; 36struct device;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 8b2fa8593c61..2e724c877ec1 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1081,11 +1081,7 @@ extern void si_meminfo(struct sysinfo * val);
1081extern void si_meminfo_node(struct sysinfo *val, int nid); 1081extern void si_meminfo_node(struct sysinfo *val, int nid);
1082extern int after_bootmem; 1082extern int after_bootmem;
1083 1083
1084#ifdef CONFIG_NUMA
1085extern void setup_per_cpu_pageset(void); 1084extern void setup_per_cpu_pageset(void);
1086#else
1087static inline void setup_per_cpu_pageset(void) {}
1088#endif
1089 1085
1090extern void zone_pcp_update(struct zone *zone); 1086extern void zone_pcp_update(struct zone *zone);
1091 1087
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 30fe668c2542..41acd4bf7664 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -184,13 +184,7 @@ struct per_cpu_pageset {
184 s8 stat_threshold; 184 s8 stat_threshold;
185 s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS]; 185 s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS];
186#endif 186#endif
187} ____cacheline_aligned_in_smp; 187};
188
189#ifdef CONFIG_NUMA
190#define zone_pcp(__z, __cpu) ((__z)->pageset[(__cpu)])
191#else
192#define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)])
193#endif
194 188
195#endif /* !__GENERATING_BOUNDS.H */ 189#endif /* !__GENERATING_BOUNDS.H */
196 190
@@ -306,10 +300,8 @@ struct zone {
306 */ 300 */
307 unsigned long min_unmapped_pages; 301 unsigned long min_unmapped_pages;
308 unsigned long min_slab_pages; 302 unsigned long min_slab_pages;
309 struct per_cpu_pageset *pageset[NR_CPUS];
310#else
311 struct per_cpu_pageset pageset[NR_CPUS];
312#endif 303#endif
304 struct per_cpu_pageset __percpu *pageset;
313 /* 305 /*
314 * free areas of different sizes 306 * free areas of different sizes
315 */ 307 */
diff --git a/include/linux/module.h b/include/linux/module.h
index 6cb1a3cab5d3..dd618eb026aa 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -17,7 +17,7 @@
17#include <linux/moduleparam.h> 17#include <linux/moduleparam.h>
18#include <linux/tracepoint.h> 18#include <linux/tracepoint.h>
19 19
20#include <asm/local.h> 20#include <linux/percpu.h>
21#include <asm/module.h> 21#include <asm/module.h>
22 22
23#include <trace/events/module.h> 23#include <trace/events/module.h>
@@ -363,11 +363,9 @@ struct module
363 /* Destruction function. */ 363 /* Destruction function. */
364 void (*exit)(void); 364 void (*exit)(void);
365 365
366#ifdef CONFIG_SMP 366 struct module_ref {
367 char *refptr; 367 int count;
368#else 368 } __percpu *refptr;
369 local_t ref;
370#endif
371#endif 369#endif
372 370
373#ifdef CONFIG_CONSTRUCTORS 371#ifdef CONFIG_CONSTRUCTORS
@@ -454,25 +452,16 @@ void __symbol_put(const char *symbol);
454#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) 452#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x)
455void symbol_put_addr(void *addr); 453void symbol_put_addr(void *addr);
456 454
457static inline local_t *__module_ref_addr(struct module *mod, int cpu)
458{
459#ifdef CONFIG_SMP
460 return (local_t *) (mod->refptr + per_cpu_offset(cpu));
461#else
462 return &mod->ref;
463#endif
464}
465
466/* Sometimes we know we already have a refcount, and it's easier not 455/* Sometimes we know we already have a refcount, and it's easier not
467 to handle the error case (which only happens with rmmod --wait). */ 456 to handle the error case (which only happens with rmmod --wait). */
468static inline void __module_get(struct module *module) 457static inline void __module_get(struct module *module)
469{ 458{
470 if (module) { 459 if (module) {
471 unsigned int cpu = get_cpu(); 460 preempt_disable();
472 local_inc(__module_ref_addr(module, cpu)); 461 __this_cpu_inc(module->refptr->count);
473 trace_module_get(module, _THIS_IP_, 462 trace_module_get(module, _THIS_IP_,
474 local_read(__module_ref_addr(module, cpu))); 463 __this_cpu_read(module->refptr->count));
475 put_cpu(); 464 preempt_enable();
476 } 465 }
477} 466}
478 467
@@ -481,15 +470,17 @@ static inline int try_module_get(struct module *module)
481 int ret = 1; 470 int ret = 1;
482 471
483 if (module) { 472 if (module) {
484 unsigned int cpu = get_cpu(); 473 preempt_disable();
474
485 if (likely(module_is_live(module))) { 475 if (likely(module_is_live(module))) {
486 local_inc(__module_ref_addr(module, cpu)); 476 __this_cpu_inc(module->refptr->count);
487 trace_module_get(module, _THIS_IP_, 477 trace_module_get(module, _THIS_IP_,
488 local_read(__module_ref_addr(module, cpu))); 478 __this_cpu_read(module->refptr->count));
489 } 479 }
490 else 480 else
491 ret = 0; 481 ret = 0;
492 put_cpu(); 482
483 preempt_enable();
493 } 484 }
494 return ret; 485 return ret;
495} 486}
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 5d5275364867..b5f43a34ef88 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -66,7 +66,7 @@ struct vfsmount {
66 int mnt_pinned; 66 int mnt_pinned;
67 int mnt_ghosts; 67 int mnt_ghosts;
68#ifdef CONFIG_SMP 68#ifdef CONFIG_SMP
69 int *mnt_writers; 69 int __percpu *mnt_writers;
70#else 70#else
71 int mnt_writers; 71 int mnt_writers;
72#endif 72#endif
diff --git a/include/linux/net.h b/include/linux/net.h
index 5e8083cacc8b..4157b5d42bd6 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -174,18 +174,22 @@ struct proto_ops {
174 struct poll_table_struct *wait); 174 struct poll_table_struct *wait);
175 int (*ioctl) (struct socket *sock, unsigned int cmd, 175 int (*ioctl) (struct socket *sock, unsigned int cmd,
176 unsigned long arg); 176 unsigned long arg);
177#ifdef CONFIG_COMPAT
177 int (*compat_ioctl) (struct socket *sock, unsigned int cmd, 178 int (*compat_ioctl) (struct socket *sock, unsigned int cmd,
178 unsigned long arg); 179 unsigned long arg);
180#endif
179 int (*listen) (struct socket *sock, int len); 181 int (*listen) (struct socket *sock, int len);
180 int (*shutdown) (struct socket *sock, int flags); 182 int (*shutdown) (struct socket *sock, int flags);
181 int (*setsockopt)(struct socket *sock, int level, 183 int (*setsockopt)(struct socket *sock, int level,
182 int optname, char __user *optval, unsigned int optlen); 184 int optname, char __user *optval, unsigned int optlen);
183 int (*getsockopt)(struct socket *sock, int level, 185 int (*getsockopt)(struct socket *sock, int level,
184 int optname, char __user *optval, int __user *optlen); 186 int optname, char __user *optval, int __user *optlen);
187#ifdef CONFIG_COMPAT
185 int (*compat_setsockopt)(struct socket *sock, int level, 188 int (*compat_setsockopt)(struct socket *sock, int level,
186 int optname, char __user *optval, unsigned int optlen); 189 int optname, char __user *optval, unsigned int optlen);
187 int (*compat_getsockopt)(struct socket *sock, int level, 190 int (*compat_getsockopt)(struct socket *sock, int level,
188 int optname, char __user *optval, int __user *optlen); 191 int optname, char __user *optval, int __user *optlen);
192#endif
189 int (*sendmsg) (struct kiocb *iocb, struct socket *sock, 193 int (*sendmsg) (struct kiocb *iocb, struct socket *sock,
190 struct msghdr *m, size_t total_len); 194 struct msghdr *m, size_t total_len);
191 int (*recvmsg) (struct kiocb *iocb, struct socket *sock, 195 int (*recvmsg) (struct kiocb *iocb, struct socket *sock,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a3fccc85b1a0..c79a88be7c33 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -28,6 +28,7 @@
28#include <linux/if.h> 28#include <linux/if.h>
29#include <linux/if_ether.h> 29#include <linux/if_ether.h>
30#include <linux/if_packet.h> 30#include <linux/if_packet.h>
31#include <linux/if_link.h>
31 32
32#ifdef __KERNEL__ 33#ifdef __KERNEL__
33#include <linux/timer.h> 34#include <linux/timer.h>
@@ -136,7 +137,7 @@ static inline bool dev_xmit_complete(int rc)
136 * used. 137 * used.
137 */ 138 */
138 139
139#if defined(CONFIG_WLAN_80211) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) 140#if defined(CONFIG_WLAN) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
140# if defined(CONFIG_MAC80211_MESH) 141# if defined(CONFIG_MAC80211_MESH)
141# define LL_MAX_HEADER 128 142# define LL_MAX_HEADER 128
142# else 143# else
@@ -263,6 +264,17 @@ struct netdev_hw_addr_list {
263 int count; 264 int count;
264}; 265};
265 266
267#define netdev_uc_count(dev) ((dev)->uc.count)
268#define netdev_uc_empty(dev) ((dev)->uc.count == 0)
269#define netdev_for_each_uc_addr(ha, dev) \
270 list_for_each_entry(ha, &dev->uc.list, list)
271
272#define netdev_mc_count(dev) ((dev)->mc_count)
273#define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0)
274
275#define netdev_for_each_mc_addr(mclist, dev) \
276 for (mclist = dev->mc_list; mclist; mclist = mclist->next)
277
266struct hh_cache { 278struct hh_cache {
267 struct hh_cache *hh_next; /* Next entry */ 279 struct hh_cache *hh_next; /* Next entry */
268 atomic_t hh_refcnt; /* number of users */ 280 atomic_t hh_refcnt; /* number of users */
@@ -610,6 +622,13 @@ struct netdev_queue {
610 * this function is called when a VLAN id is unregistered. 622 * this function is called when a VLAN id is unregistered.
611 * 623 *
612 * void (*ndo_poll_controller)(struct net_device *dev); 624 * void (*ndo_poll_controller)(struct net_device *dev);
625 *
626 * SR-IOV management functions.
627 * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac);
628 * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos);
629 * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate);
630 * int (*ndo_get_vf_config)(struct net_device *dev,
631 * int vf, struct ifla_vf_info *ivf);
613 */ 632 */
614#define HAVE_NET_DEVICE_OPS 633#define HAVE_NET_DEVICE_OPS
615struct net_device_ops { 634struct net_device_ops {
@@ -621,30 +640,21 @@ struct net_device_ops {
621 struct net_device *dev); 640 struct net_device *dev);
622 u16 (*ndo_select_queue)(struct net_device *dev, 641 u16 (*ndo_select_queue)(struct net_device *dev,
623 struct sk_buff *skb); 642 struct sk_buff *skb);
624#define HAVE_CHANGE_RX_FLAGS
625 void (*ndo_change_rx_flags)(struct net_device *dev, 643 void (*ndo_change_rx_flags)(struct net_device *dev,
626 int flags); 644 int flags);
627#define HAVE_SET_RX_MODE
628 void (*ndo_set_rx_mode)(struct net_device *dev); 645 void (*ndo_set_rx_mode)(struct net_device *dev);
629#define HAVE_MULTICAST
630 void (*ndo_set_multicast_list)(struct net_device *dev); 646 void (*ndo_set_multicast_list)(struct net_device *dev);
631#define HAVE_SET_MAC_ADDR
632 int (*ndo_set_mac_address)(struct net_device *dev, 647 int (*ndo_set_mac_address)(struct net_device *dev,
633 void *addr); 648 void *addr);
634#define HAVE_VALIDATE_ADDR
635 int (*ndo_validate_addr)(struct net_device *dev); 649 int (*ndo_validate_addr)(struct net_device *dev);
636#define HAVE_PRIVATE_IOCTL
637 int (*ndo_do_ioctl)(struct net_device *dev, 650 int (*ndo_do_ioctl)(struct net_device *dev,
638 struct ifreq *ifr, int cmd); 651 struct ifreq *ifr, int cmd);
639#define HAVE_SET_CONFIG
640 int (*ndo_set_config)(struct net_device *dev, 652 int (*ndo_set_config)(struct net_device *dev,
641 struct ifmap *map); 653 struct ifmap *map);
642#define HAVE_CHANGE_MTU
643 int (*ndo_change_mtu)(struct net_device *dev, 654 int (*ndo_change_mtu)(struct net_device *dev,
644 int new_mtu); 655 int new_mtu);
645 int (*ndo_neigh_setup)(struct net_device *dev, 656 int (*ndo_neigh_setup)(struct net_device *dev,
646 struct neigh_parms *); 657 struct neigh_parms *);
647#define HAVE_TX_TIMEOUT
648 void (*ndo_tx_timeout) (struct net_device *dev); 658 void (*ndo_tx_timeout) (struct net_device *dev);
649 659
650 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); 660 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
@@ -656,9 +666,17 @@ struct net_device_ops {
656 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, 666 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
657 unsigned short vid); 667 unsigned short vid);
658#ifdef CONFIG_NET_POLL_CONTROLLER 668#ifdef CONFIG_NET_POLL_CONTROLLER
659#define HAVE_NETDEV_POLL
660 void (*ndo_poll_controller)(struct net_device *dev); 669 void (*ndo_poll_controller)(struct net_device *dev);
661#endif 670#endif
671 int (*ndo_set_vf_mac)(struct net_device *dev,
672 int queue, u8 *mac);
673 int (*ndo_set_vf_vlan)(struct net_device *dev,
674 int queue, u16 vlan, u8 qos);
675 int (*ndo_set_vf_tx_rate)(struct net_device *dev,
676 int vf, int rate);
677 int (*ndo_get_vf_config)(struct net_device *dev,
678 int vf,
679 struct ifla_vf_info *ivf);
662#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) 680#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
663 int (*ndo_fcoe_enable)(struct net_device *dev); 681 int (*ndo_fcoe_enable)(struct net_device *dev);
664 int (*ndo_fcoe_disable)(struct net_device *dev); 682 int (*ndo_fcoe_disable)(struct net_device *dev);
@@ -745,6 +763,7 @@ struct net_device {
745#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ 763#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */
746#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ 764#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */
747#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ 765#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
766#define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */
748 767
749 /* Segmentation offload features */ 768 /* Segmentation offload features */
750#define NETIF_F_GSO_SHIFT 16 769#define NETIF_F_GSO_SHIFT 16
@@ -905,7 +924,12 @@ struct net_device {
905 NETREG_UNREGISTERED, /* completed unregister todo */ 924 NETREG_UNREGISTERED, /* completed unregister todo */
906 NETREG_RELEASED, /* called free_netdev */ 925 NETREG_RELEASED, /* called free_netdev */
907 NETREG_DUMMY, /* dummy device for NAPI poll */ 926 NETREG_DUMMY, /* dummy device for NAPI poll */
908 } reg_state; 927 } reg_state:16;
928
929 enum {
930 RTNL_LINK_INITIALIZED,
931 RTNL_LINK_INITIALIZING,
932 } rtnl_link_state:16;
909 933
910 /* Called from unregister, can be used to call free_netdev */ 934 /* Called from unregister, can be used to call free_netdev */
911 void (*destructor)(struct net_device *dev); 935 void (*destructor)(struct net_device *dev);
@@ -953,6 +977,8 @@ struct net_device {
953 /* max exchange id for FCoE LRO by ddp */ 977 /* max exchange id for FCoE LRO by ddp */
954 unsigned int fcoe_ddp_xid; 978 unsigned int fcoe_ddp_xid;
955#endif 979#endif
980 /* n-tuple filter list attached to this device */
981 struct ethtool_rx_ntuple_list ethtool_ntuple_list;
956}; 982};
957#define to_net_dev(d) container_of(d, struct net_device, dev) 983#define to_net_dev(d) container_of(d, struct net_device, dev)
958 984
@@ -1009,6 +1035,15 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev)
1009 return 0; 1035 return 0;
1010} 1036}
1011 1037
1038#ifndef CONFIG_NET_NS
1039static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev)
1040{
1041 skb->dev = dev;
1042}
1043#else /* CONFIG_NET_NS */
1044void skb_set_dev(struct sk_buff *skb, struct net_device *dev);
1045#endif
1046
1012static inline bool netdev_uses_trailer_tags(struct net_device *dev) 1047static inline bool netdev_uses_trailer_tags(struct net_device *dev)
1013{ 1048{
1014#ifdef CONFIG_NET_DSA_TAG_TRAILER 1049#ifdef CONFIG_NET_DSA_TAG_TRAILER
@@ -1527,7 +1562,6 @@ extern int netif_rx(struct sk_buff *skb);
1527extern int netif_rx_ni(struct sk_buff *skb); 1562extern int netif_rx_ni(struct sk_buff *skb);
1528#define HAVE_NETIF_RECEIVE_SKB 1 1563#define HAVE_NETIF_RECEIVE_SKB 1
1529extern int netif_receive_skb(struct sk_buff *skb); 1564extern int netif_receive_skb(struct sk_buff *skb);
1530extern void napi_gro_flush(struct napi_struct *napi);
1531extern gro_result_t dev_gro_receive(struct napi_struct *napi, 1565extern gro_result_t dev_gro_receive(struct napi_struct *napi,
1532 struct sk_buff *skb); 1566 struct sk_buff *skb);
1533extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); 1567extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
@@ -1553,7 +1587,9 @@ extern int dev_valid_name(const char *name);
1553extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 1587extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
1554extern int dev_ethtool(struct net *net, struct ifreq *); 1588extern int dev_ethtool(struct net *net, struct ifreq *);
1555extern unsigned dev_get_flags(const struct net_device *); 1589extern unsigned dev_get_flags(const struct net_device *);
1590extern int __dev_change_flags(struct net_device *, unsigned int flags);
1556extern int dev_change_flags(struct net_device *, unsigned); 1591extern int dev_change_flags(struct net_device *, unsigned);
1592extern void __dev_notify_flags(struct net_device *, unsigned int old_flags);
1557extern int dev_change_name(struct net_device *, const char *); 1593extern int dev_change_name(struct net_device *, const char *);
1558extern int dev_set_alias(struct net_device *, const char *, size_t); 1594extern int dev_set_alias(struct net_device *, const char *, size_t);
1559extern int dev_change_net_namespace(struct net_device *, 1595extern int dev_change_net_namespace(struct net_device *,
@@ -2083,6 +2119,130 @@ static inline u32 dev_ethtool_get_flags(struct net_device *dev)
2083 return 0; 2119 return 0;
2084 return dev->ethtool_ops->get_flags(dev); 2120 return dev->ethtool_ops->get_flags(dev);
2085} 2121}
2122
2123/* Logging, debugging and troubleshooting/diagnostic helpers. */
2124
2125/* netdev_printk helpers, similar to dev_printk */
2126
2127static inline const char *netdev_name(const struct net_device *dev)
2128{
2129 if (dev->reg_state != NETREG_REGISTERED)
2130 return "(unregistered net_device)";
2131 return dev->name;
2132}
2133
2134#define netdev_printk(level, netdev, format, args...) \
2135 dev_printk(level, (netdev)->dev.parent, \
2136 "%s: " format, \
2137 netdev_name(netdev), ##args)
2138
2139#define netdev_emerg(dev, format, args...) \
2140 netdev_printk(KERN_EMERG, dev, format, ##args)
2141#define netdev_alert(dev, format, args...) \
2142 netdev_printk(KERN_ALERT, dev, format, ##args)
2143#define netdev_crit(dev, format, args...) \
2144 netdev_printk(KERN_CRIT, dev, format, ##args)
2145#define netdev_err(dev, format, args...) \
2146 netdev_printk(KERN_ERR, dev, format, ##args)
2147#define netdev_warn(dev, format, args...) \
2148 netdev_printk(KERN_WARNING, dev, format, ##args)
2149#define netdev_notice(dev, format, args...) \
2150 netdev_printk(KERN_NOTICE, dev, format, ##args)
2151#define netdev_info(dev, format, args...) \
2152 netdev_printk(KERN_INFO, dev, format, ##args)
2153
2154#if defined(DEBUG)
2155#define netdev_dbg(__dev, format, args...) \
2156 netdev_printk(KERN_DEBUG, __dev, format, ##args)
2157#elif defined(CONFIG_DYNAMIC_DEBUG)
2158#define netdev_dbg(__dev, format, args...) \
2159do { \
2160 dynamic_dev_dbg((__dev)->dev.parent, "%s: " format, \
2161 netdev_name(__dev), ##args); \
2162} while (0)
2163#else
2164#define netdev_dbg(__dev, format, args...) \
2165({ \
2166 if (0) \
2167 netdev_printk(KERN_DEBUG, __dev, format, ##args); \
2168 0; \
2169})
2170#endif
2171
2172#if defined(VERBOSE_DEBUG)
2173#define netdev_vdbg netdev_dbg
2174#else
2175
2176#define netdev_vdbg(dev, format, args...) \
2177({ \
2178 if (0) \
2179 netdev_printk(KERN_DEBUG, dev, format, ##args); \
2180 0; \
2181})
2182#endif
2183
2184/*
2185 * netdev_WARN() acts like dev_printk(), but with the key difference
2186 * of using a WARN/WARN_ON to get the message out, including the
2187 * file/line information and a backtrace.
2188 */
2189#define netdev_WARN(dev, format, args...) \
2190 WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args);
2191
2192/* netif printk helpers, similar to netdev_printk */
2193
2194#define netif_printk(priv, type, level, dev, fmt, args...) \
2195do { \
2196 if (netif_msg_##type(priv)) \
2197 netdev_printk(level, (dev), fmt, ##args); \
2198} while (0)
2199
2200#define netif_emerg(priv, type, dev, fmt, args...) \
2201 netif_printk(priv, type, KERN_EMERG, dev, fmt, ##args)
2202#define netif_alert(priv, type, dev, fmt, args...) \
2203 netif_printk(priv, type, KERN_ALERT, dev, fmt, ##args)
2204#define netif_crit(priv, type, dev, fmt, args...) \
2205 netif_printk(priv, type, KERN_CRIT, dev, fmt, ##args)
2206#define netif_err(priv, type, dev, fmt, args...) \
2207 netif_printk(priv, type, KERN_ERR, dev, fmt, ##args)
2208#define netif_warn(priv, type, dev, fmt, args...) \
2209 netif_printk(priv, type, KERN_WARNING, dev, fmt, ##args)
2210#define netif_notice(priv, type, dev, fmt, args...) \
2211 netif_printk(priv, type, KERN_NOTICE, dev, fmt, ##args)
2212#define netif_info(priv, type, dev, fmt, args...) \
2213 netif_printk(priv, type, KERN_INFO, (dev), fmt, ##args)
2214
2215#if defined(DEBUG)
2216#define netif_dbg(priv, type, dev, format, args...) \
2217 netif_printk(priv, type, KERN_DEBUG, dev, format, ##args)
2218#elif defined(CONFIG_DYNAMIC_DEBUG)
2219#define netif_dbg(priv, type, netdev, format, args...) \
2220do { \
2221 if (netif_msg_##type(priv)) \
2222 dynamic_dev_dbg((netdev)->dev.parent, \
2223 "%s: " format, \
2224 netdev_name(netdev), ##args); \
2225} while (0)
2226#else
2227#define netif_dbg(priv, type, dev, format, args...) \
2228({ \
2229 if (0) \
2230 netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
2231 0; \
2232})
2233#endif
2234
2235#if defined(VERBOSE_DEBUG)
2236#define netif_vdbg netdev_dbg
2237#else
2238#define netif_vdbg(priv, type, dev, format, args...) \
2239({ \
2240 if (0) \
2241 netif_printk(KERN_DEBUG, dev, format, ##args); \
2242 0; \
2243})
2244#endif
2245
2086#endif /* __KERNEL__ */ 2246#endif /* __KERNEL__ */
2087 2247
2088#endif /* _LINUX_NETDEVICE_H */ 2248#endif /* _LINUX_NETDEVICE_H */
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 48c54960773c..89341c32631a 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -114,15 +114,17 @@ struct nf_sockopt_ops {
114 int set_optmin; 114 int set_optmin;
115 int set_optmax; 115 int set_optmax;
116 int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); 116 int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len);
117#ifdef CONFIG_COMPAT
117 int (*compat_set)(struct sock *sk, int optval, 118 int (*compat_set)(struct sock *sk, int optval,
118 void __user *user, unsigned int len); 119 void __user *user, unsigned int len);
119 120#endif
120 int get_optmin; 121 int get_optmin;
121 int get_optmax; 122 int get_optmax;
122 int (*get)(struct sock *sk, int optval, void __user *user, int *len); 123 int (*get)(struct sock *sk, int optval, void __user *user, int *len);
124#ifdef CONFIG_COMPAT
123 int (*compat_get)(struct sock *sk, int optval, 125 int (*compat_get)(struct sock *sk, int optval,
124 void __user *user, int *len); 126 void __user *user, int *len);
125 127#endif
126 /* Use the module struct to lock set/get code in place */ 128 /* Use the module struct to lock set/get code in place */
127 struct module *owner; 129 struct module *owner;
128}; 130};
@@ -161,11 +163,8 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
161 struct sk_buff *skb, 163 struct sk_buff *skb,
162 struct net_device *indev, 164 struct net_device *indev,
163 struct net_device *outdev, 165 struct net_device *outdev,
164 int (*okfn)(struct sk_buff *), int thresh, 166 int (*okfn)(struct sk_buff *), int thresh)
165 int cond)
166{ 167{
167 if (!cond)
168 return 1;
169#ifndef CONFIG_NETFILTER_DEBUG 168#ifndef CONFIG_NETFILTER_DEBUG
170 if (list_empty(&nf_hooks[pf][hook])) 169 if (list_empty(&nf_hooks[pf][hook]))
171 return 1; 170 return 1;
@@ -177,7 +176,7 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
177 struct net_device *indev, struct net_device *outdev, 176 struct net_device *indev, struct net_device *outdev,
178 int (*okfn)(struct sk_buff *)) 177 int (*okfn)(struct sk_buff *))
179{ 178{
180 return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1); 179 return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN);
181} 180}
182 181
183/* Activate hook; either okfn or kfree_skb called, unless a hook 182/* Activate hook; either okfn or kfree_skb called, unless a hook
@@ -197,36 +196,49 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
197 coders :) 196 coders :)
198*/ 197*/
199 198
200/* This is gross, but inline doesn't cut it for avoiding the function 199static inline int
201 call in fast path: gcc doesn't inline (needs value tracking?). --RR */ 200NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct sk_buff *skb,
202 201 struct net_device *in, struct net_device *out,
203/* HX: It's slightly less gross now. */ 202 int (*okfn)(struct sk_buff *), int thresh)
203{
204 int ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, thresh);
205 if (ret == 1)
206 ret = okfn(skb);
207 return ret;
208}
204 209
205#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ 210static inline int
206({int __ret; \ 211NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb,
207if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh, 1)) == 1)\ 212 struct net_device *in, struct net_device *out,
208 __ret = (okfn)(skb); \ 213 int (*okfn)(struct sk_buff *), bool cond)
209__ret;}) 214{
215 int ret;
210 216
211#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \ 217 if (!cond ||
212({int __ret; \ 218 (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1))
213if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\ 219 ret = okfn(skb);
214 __ret = (okfn)(skb); \ 220 return ret;
215__ret;}) 221}
216 222
217#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ 223static inline int
218 NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) 224NF_HOOK(uint8_t pf, unsigned int hook, struct sk_buff *skb,
225 struct net_device *in, struct net_device *out,
226 int (*okfn)(struct sk_buff *))
227{
228 return NF_HOOK_THRESH(pf, hook, skb, in, out, okfn, INT_MIN);
229}
219 230
220/* Call setsockopt() */ 231/* Call setsockopt() */
221int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, 232int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
222 unsigned int len); 233 unsigned int len);
223int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, 234int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
224 int *len); 235 int *len);
225 236#ifdef CONFIG_COMPAT
226int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, 237int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval,
227 char __user *opt, unsigned int len); 238 char __user *opt, unsigned int len);
228int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, 239int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval,
229 char __user *opt, int *len); 240 char __user *opt, int *len);
241#endif
230 242
231/* Call this before modifying an existing packet: ensures it is 243/* Call this before modifying an existing packet: ensures it is
232 modifiable and linear to the point you care about (writable_len). 244 modifiable and linear to the point you care about (writable_len).
@@ -325,8 +337,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
325 struct sk_buff *skb, 337 struct sk_buff *skb,
326 struct net_device *indev, 338 struct net_device *indev,
327 struct net_device *outdev, 339 struct net_device *outdev,
328 int (*okfn)(struct sk_buff *), int thresh, 340 int (*okfn)(struct sk_buff *), int thresh)
329 int cond)
330{ 341{
331 return okfn(skb); 342 return okfn(skb);
332} 343}
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 2aea50399c0b..a5a63e41b8af 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -6,6 +6,7 @@ header-y += nfnetlink_queue.h
6header-y += xt_CLASSIFY.h 6header-y += xt_CLASSIFY.h
7header-y += xt_CONNMARK.h 7header-y += xt_CONNMARK.h
8header-y += xt_CONNSECMARK.h 8header-y += xt_CONNSECMARK.h
9header-y += xt_CT.h
9header-y += xt_DSCP.h 10header-y += xt_DSCP.h
10header-y += xt_LED.h 11header-y += xt_LED.h
11header-y += xt_MARK.h 12header-y += xt_MARK.h
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index a374787ed9b0..c608677dda60 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -72,6 +72,28 @@ enum ip_conntrack_status {
72 /* Connection has fixed timeout. */ 72 /* Connection has fixed timeout. */
73 IPS_FIXED_TIMEOUT_BIT = 10, 73 IPS_FIXED_TIMEOUT_BIT = 10,
74 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), 74 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
75
76 /* Conntrack is a template */
77 IPS_TEMPLATE_BIT = 11,
78 IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT),
79};
80
81/* Connection tracking event types */
82enum ip_conntrack_events {
83 IPCT_NEW, /* new conntrack */
84 IPCT_RELATED, /* related conntrack */
85 IPCT_DESTROY, /* destroyed conntrack */
86 IPCT_REPLY, /* connection has seen two-way traffic */
87 IPCT_ASSURED, /* connection status has changed to assured */
88 IPCT_PROTOINFO, /* protocol information has changed */
89 IPCT_HELPER, /* new helper has been set */
90 IPCT_MARK, /* new mark has been set */
91 IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */
92 IPCT_SECMARK, /* new security mark has been set */
93};
94
95enum ip_conntrack_expect_events {
96 IPEXP_NEW, /* new expectation */
75}; 97};
76 98
77#ifdef __KERNEL__ 99#ifdef __KERNEL__
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index 23aa2ec6b7b7..ff8cfbcf3b81 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -14,6 +14,7 @@ enum sip_expectation_classes {
14 SIP_EXPECT_SIGNALLING, 14 SIP_EXPECT_SIGNALLING,
15 SIP_EXPECT_AUDIO, 15 SIP_EXPECT_AUDIO,
16 SIP_EXPECT_VIDEO, 16 SIP_EXPECT_VIDEO,
17 SIP_EXPECT_IMAGE,
17 __SIP_EXPECT_MAX 18 __SIP_EXPECT_MAX
18}; 19};
19#define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1) 20#define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1)
@@ -34,10 +35,10 @@ struct sdp_media_type {
34struct sip_handler { 35struct sip_handler {
35 const char *method; 36 const char *method;
36 unsigned int len; 37 unsigned int len;
37 int (*request)(struct sk_buff *skb, 38 int (*request)(struct sk_buff *skb, unsigned int dataoff,
38 const char **dptr, unsigned int *datalen, 39 const char **dptr, unsigned int *datalen,
39 unsigned int cseq); 40 unsigned int cseq);
40 int (*response)(struct sk_buff *skb, 41 int (*response)(struct sk_buff *skb, unsigned int dataoff,
41 const char **dptr, unsigned int *datalen, 42 const char **dptr, unsigned int *datalen,
42 unsigned int cseq, unsigned int code); 43 unsigned int cseq, unsigned int code);
43}; 44};
@@ -84,7 +85,8 @@ enum sip_header_types {
84 SIP_HDR_FROM, 85 SIP_HDR_FROM,
85 SIP_HDR_TO, 86 SIP_HDR_TO,
86 SIP_HDR_CONTACT, 87 SIP_HDR_CONTACT,
87 SIP_HDR_VIA, 88 SIP_HDR_VIA_UDP,
89 SIP_HDR_VIA_TCP,
88 SIP_HDR_EXPIRES, 90 SIP_HDR_EXPIRES,
89 SIP_HDR_CONTENT_LENGTH, 91 SIP_HDR_CONTENT_LENGTH,
90}; 92};
@@ -100,33 +102,40 @@ enum sdp_header_types {
100}; 102};
101 103
102extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, 104extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb,
105 unsigned int dataoff,
103 const char **dptr, 106 const char **dptr,
104 unsigned int *datalen); 107 unsigned int *datalen);
108extern void (*nf_nat_sip_seq_adjust_hook)(struct sk_buff *skb, s16 off);
105extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, 109extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb,
110 unsigned int dataoff,
106 const char **dptr, 111 const char **dptr,
107 unsigned int *datalen, 112 unsigned int *datalen,
108 struct nf_conntrack_expect *exp, 113 struct nf_conntrack_expect *exp,
109 unsigned int matchoff, 114 unsigned int matchoff,
110 unsigned int matchlen); 115 unsigned int matchlen);
111extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, 116extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb,
112 const char **dptr,
113 unsigned int dataoff, 117 unsigned int dataoff,
118 const char **dptr,
114 unsigned int *datalen, 119 unsigned int *datalen,
120 unsigned int sdpoff,
115 enum sdp_header_types type, 121 enum sdp_header_types type,
116 enum sdp_header_types term, 122 enum sdp_header_types term,
117 const union nf_inet_addr *addr); 123 const union nf_inet_addr *addr);
118extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, 124extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb,
125 unsigned int dataoff,
119 const char **dptr, 126 const char **dptr,
120 unsigned int *datalen, 127 unsigned int *datalen,
121 unsigned int matchoff, 128 unsigned int matchoff,
122 unsigned int matchlen, 129 unsigned int matchlen,
123 u_int16_t port); 130 u_int16_t port);
124extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, 131extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb,
125 const char **dptr,
126 unsigned int dataoff, 132 unsigned int dataoff,
133 const char **dptr,
127 unsigned int *datalen, 134 unsigned int *datalen,
135 unsigned int sdpoff,
128 const union nf_inet_addr *addr); 136 const union nf_inet_addr *addr);
129extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, 137extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb,
138 unsigned int dataoff,
130 const char **dptr, 139 const char **dptr,
131 unsigned int *datalen, 140 unsigned int *datalen,
132 struct nf_conntrack_expect *rtp_exp, 141 struct nf_conntrack_expect *rtp_exp,
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 49d321f3ccd2..53923868c9bd 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -73,11 +73,11 @@ struct nfnetlink_subsystem {
73extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); 73extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
74extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); 74extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
75 75
76extern int nfnetlink_has_listeners(unsigned int group); 76extern int nfnetlink_has_listeners(struct net *net, unsigned int group);
77extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, 77extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group,
78 int echo, gfp_t flags); 78 int echo, gfp_t flags);
79extern void nfnetlink_set_err(u32 pid, u32 group, int error); 79extern void nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error);
80extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); 80extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags);
81 81
82extern void nfnl_lock(void); 82extern void nfnl_lock(void);
83extern void nfnl_unlock(void); 83extern void nfnl_unlock(void);
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index ed4ef8d0b11b..9ed534c991b9 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -40,6 +40,7 @@ enum ctattr_type {
40 CTA_NAT_SEQ_ADJ_ORIG, 40 CTA_NAT_SEQ_ADJ_ORIG,
41 CTA_NAT_SEQ_ADJ_REPLY, 41 CTA_NAT_SEQ_ADJ_REPLY,
42 CTA_SECMARK, 42 CTA_SECMARK,
43 CTA_ZONE,
43 __CTA_MAX 44 __CTA_MAX
44}; 45};
45#define CTA_MAX (__CTA_MAX - 1) 46#define CTA_MAX (__CTA_MAX - 1)
@@ -159,6 +160,7 @@ enum ctattr_expect {
159 CTA_EXPECT_TIMEOUT, 160 CTA_EXPECT_TIMEOUT,
160 CTA_EXPECT_ID, 161 CTA_EXPECT_ID,
161 CTA_EXPECT_HELP_NAME, 162 CTA_EXPECT_HELP_NAME,
163 CTA_EXPECT_ZONE,
162 __CTA_EXPECT_MAX 164 __CTA_EXPECT_MAX
163}; 165};
164#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) 166#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1)
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 378f27ae7772..84c7c928e9eb 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -93,8 +93,7 @@ struct _xt_align {
93 __u64 u64; 93 __u64 u64;
94}; 94};
95 95
96#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \ 96#define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align))
97 & ~(__alignof__(struct _xt_align)-1))
98 97
99/* Standard return verdict, or do jump. */ 98/* Standard return verdict, or do jump. */
100#define XT_STANDARD_TARGET "" 99#define XT_STANDARD_TARGET ""
@@ -121,6 +120,7 @@ struct xt_counters_info {
121 120
122#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */ 121#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
123 122
123#ifndef __KERNEL__
124/* fn returns 0 to continue iteration */ 124/* fn returns 0 to continue iteration */
125#define XT_MATCH_ITERATE(type, e, fn, args...) \ 125#define XT_MATCH_ITERATE(type, e, fn, args...) \
126({ \ 126({ \
@@ -164,6 +164,22 @@ struct xt_counters_info {
164#define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \ 164#define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \
165 XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args) 165 XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
166 166
167#endif /* !__KERNEL__ */
168
169/* pos is normally a struct ipt_entry/ip6t_entry/etc. */
170#define xt_entry_foreach(pos, ehead, esize) \
171 for ((pos) = (typeof(pos))(ehead); \
172 (pos) < (typeof(pos))((char *)(ehead) + (esize)); \
173 (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset))
174
175/* can only be xt_entry_match, so no use of typeof here */
176#define xt_ematch_foreach(pos, entry) \
177 for ((pos) = (struct xt_entry_match *)entry->elems; \
178 (pos) < (struct xt_entry_match *)((char *)(entry) + \
179 (entry)->target_offset); \
180 (pos) = (struct xt_entry_match *)((char *)(pos) + \
181 (pos)->u.match_size))
182
167#ifdef __KERNEL__ 183#ifdef __KERNEL__
168 184
169#include <linux/netdevice.h> 185#include <linux/netdevice.h>
@@ -205,6 +221,7 @@ struct xt_match_param {
205 * @hook_mask: via which hooks the new rule is reachable 221 * @hook_mask: via which hooks the new rule is reachable
206 */ 222 */
207struct xt_mtchk_param { 223struct xt_mtchk_param {
224 struct net *net;
208 const char *table; 225 const char *table;
209 const void *entryinfo; 226 const void *entryinfo;
210 const struct xt_match *match; 227 const struct xt_match *match;
@@ -215,6 +232,7 @@ struct xt_mtchk_param {
215 232
216/* Match destructor parameters */ 233/* Match destructor parameters */
217struct xt_mtdtor_param { 234struct xt_mtdtor_param {
235 struct net *net;
218 const struct xt_match *match; 236 const struct xt_match *match;
219 void *matchinfo; 237 void *matchinfo;
220 u_int8_t family; 238 u_int8_t family;
@@ -247,6 +265,7 @@ struct xt_target_param {
247 * Other fields see above. 265 * Other fields see above.
248 */ 266 */
249struct xt_tgchk_param { 267struct xt_tgchk_param {
268 struct net *net;
250 const char *table; 269 const char *table;
251 const void *entryinfo; 270 const void *entryinfo;
252 const struct xt_target *target; 271 const struct xt_target *target;
@@ -257,6 +276,7 @@ struct xt_tgchk_param {
257 276
258/* Target destructor parameters */ 277/* Target destructor parameters */
259struct xt_tgdtor_param { 278struct xt_tgdtor_param {
279 struct net *net;
260 const struct xt_target *target; 280 const struct xt_target *target;
261 void *targinfo; 281 void *targinfo;
262 u_int8_t family; 282 u_int8_t family;
@@ -281,11 +301,11 @@ struct xt_match {
281 301
282 /* Called when entry of this type deleted. */ 302 /* Called when entry of this type deleted. */
283 void (*destroy)(const struct xt_mtdtor_param *); 303 void (*destroy)(const struct xt_mtdtor_param *);
284 304#ifdef CONFIG_COMPAT
285 /* Called when userspace align differs from kernel space one */ 305 /* Called when userspace align differs from kernel space one */
286 void (*compat_from_user)(void *dst, void *src); 306 void (*compat_from_user)(void *dst, const void *src);
287 int (*compat_to_user)(void __user *dst, void *src); 307 int (*compat_to_user)(void __user *dst, const void *src);
288 308#endif
289 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 309 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
290 struct module *me; 310 struct module *me;
291 311
@@ -294,7 +314,9 @@ struct xt_match {
294 314
295 const char *table; 315 const char *table;
296 unsigned int matchsize; 316 unsigned int matchsize;
317#ifdef CONFIG_COMPAT
297 unsigned int compatsize; 318 unsigned int compatsize;
319#endif
298 unsigned int hooks; 320 unsigned int hooks;
299 unsigned short proto; 321 unsigned short proto;
300 322
@@ -321,17 +343,19 @@ struct xt_target {
321 343
322 /* Called when entry of this type deleted. */ 344 /* Called when entry of this type deleted. */
323 void (*destroy)(const struct xt_tgdtor_param *); 345 void (*destroy)(const struct xt_tgdtor_param *);
324 346#ifdef CONFIG_COMPAT
325 /* Called when userspace align differs from kernel space one */ 347 /* Called when userspace align differs from kernel space one */
326 void (*compat_from_user)(void *dst, void *src); 348 void (*compat_from_user)(void *dst, const void *src);
327 int (*compat_to_user)(void __user *dst, void *src); 349 int (*compat_to_user)(void __user *dst, const void *src);
328 350#endif
329 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 351 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
330 struct module *me; 352 struct module *me;
331 353
332 const char *table; 354 const char *table;
333 unsigned int targetsize; 355 unsigned int targetsize;
356#ifdef CONFIG_COMPAT
334 unsigned int compatsize; 357 unsigned int compatsize;
358#endif
335 unsigned int hooks; 359 unsigned int hooks;
336 unsigned short proto; 360 unsigned short proto;
337 361
@@ -353,6 +377,7 @@ struct xt_table {
353 struct module *me; 377 struct module *me;
354 378
355 u_int8_t af; /* address/protocol family */ 379 u_int8_t af; /* address/protocol family */
380 int priority; /* hook order */
356 381
357 /* A unique name... */ 382 /* A unique name... */
358 const char name[XT_TABLE_MAXNAMELEN]; 383 const char name[XT_TABLE_MAXNAMELEN];
@@ -514,6 +539,9 @@ static inline unsigned long ifname_compare_aligned(const char *_a,
514 return ret; 539 return ret;
515} 540}
516 541
542extern struct nf_hook_ops *xt_hook_link(const struct xt_table *, nf_hookfn *);
543extern void xt_hook_unlink(const struct xt_table *, struct nf_hook_ops *);
544
517#ifdef CONFIG_COMPAT 545#ifdef CONFIG_COMPAT
518#include <net/compat.h> 546#include <net/compat.h>
519 547
@@ -554,11 +582,7 @@ struct compat_xt_entry_target {
554 * current task alignment */ 582 * current task alignment */
555 583
556struct compat_xt_counters { 584struct compat_xt_counters {
557#if defined(CONFIG_X86_64) || defined(CONFIG_IA64) 585 compat_u64 pcnt, bcnt; /* Packet and byte counters */
558 u_int32_t cnt[4];
559#else
560 u_int64_t cnt[2];
561#endif
562}; 586};
563 587
564struct compat_xt_counters_info { 588struct compat_xt_counters_info {
@@ -567,26 +591,32 @@ struct compat_xt_counters_info {
567 struct compat_xt_counters counters[0]; 591 struct compat_xt_counters counters[0];
568}; 592};
569 593
570#define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ 594struct _compat_xt_align {
571 & ~(__alignof__(struct compat_xt_counters)-1)) 595 __u8 u8;
596 __u16 u16;
597 __u32 u32;
598 compat_u64 u64;
599};
600
601#define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align))
572 602
573extern void xt_compat_lock(u_int8_t af); 603extern void xt_compat_lock(u_int8_t af);
574extern void xt_compat_unlock(u_int8_t af); 604extern void xt_compat_unlock(u_int8_t af);
575 605
576extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta); 606extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta);
577extern void xt_compat_flush_offsets(u_int8_t af); 607extern void xt_compat_flush_offsets(u_int8_t af);
578extern short xt_compat_calc_jump(u_int8_t af, unsigned int offset); 608extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset);
579 609
580extern int xt_compat_match_offset(const struct xt_match *match); 610extern int xt_compat_match_offset(const struct xt_match *match);
581extern int xt_compat_match_from_user(struct xt_entry_match *m, 611extern int xt_compat_match_from_user(struct xt_entry_match *m,
582 void **dstptr, unsigned int *size); 612 void **dstptr, unsigned int *size);
583extern int xt_compat_match_to_user(struct xt_entry_match *m, 613extern int xt_compat_match_to_user(const struct xt_entry_match *m,
584 void __user **dstptr, unsigned int *size); 614 void __user **dstptr, unsigned int *size);
585 615
586extern int xt_compat_target_offset(const struct xt_target *target); 616extern int xt_compat_target_offset(const struct xt_target *target);
587extern void xt_compat_target_from_user(struct xt_entry_target *t, 617extern void xt_compat_target_from_user(struct xt_entry_target *t,
588 void **dstptr, unsigned int *size); 618 void **dstptr, unsigned int *size);
589extern int xt_compat_target_to_user(struct xt_entry_target *t, 619extern int xt_compat_target_to_user(const struct xt_entry_target *t,
590 void __user **dstptr, unsigned int *size); 620 void __user **dstptr, unsigned int *size);
591 621
592#endif /* CONFIG_COMPAT */ 622#endif /* CONFIG_COMPAT */
diff --git a/include/linux/netfilter/xt_CT.h b/include/linux/netfilter/xt_CT.h
new file mode 100644
index 000000000000..1b564106891d
--- /dev/null
+++ b/include/linux/netfilter/xt_CT.h
@@ -0,0 +1,17 @@
1#ifndef _XT_CT_H
2#define _XT_CT_H
3
4#define XT_CT_NOTRACK 0x1
5
6struct xt_ct_target_info {
7 u_int16_t flags;
8 u_int16_t zone;
9 u_int32_t ct_events;
10 u_int32_t exp_events;
11 char helper[16];
12
13 /* Used internally by the kernel */
14 struct nf_conn *ct __attribute__((aligned(8)));
15};
16
17#endif /* _XT_CT_H */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index f2336523a9df..e9948c0560f6 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -211,9 +211,11 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e
211 return (void *)e + e->target_offset; 211 return (void *)e + e->target_offset;
212} 212}
213 213
214#ifndef __KERNEL__
214/* fn returns 0 to continue iteration */ 215/* fn returns 0 to continue iteration */
215#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ 216#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
216 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args) 217 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
218#endif
217 219
218/* 220/*
219 * Main firewall chains definitions and global var's definitions. 221 * Main firewall chains definitions and global var's definitions.
@@ -258,6 +260,7 @@ struct arpt_error {
258 .target.errorname = "ERROR", \ 260 .target.errorname = "ERROR", \
259} 261}
260 262
263extern void *arpt_alloc_initial_table(const struct xt_table *);
261extern struct xt_table *arpt_register_table(struct net *net, 264extern struct xt_table *arpt_register_table(struct net *net,
262 const struct xt_table *table, 265 const struct xt_table *table,
263 const struct arpt_replace *repl); 266 const struct arpt_replace *repl);
@@ -290,14 +293,6 @@ compat_arpt_get_target(struct compat_arpt_entry *e)
290 293
291#define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) 294#define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s)
292 295
293/* fn returns 0 to continue iteration */
294#define COMPAT_ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
295 XT_ENTRY_ITERATE(struct compat_arpt_entry, entries, size, fn, ## args)
296
297#define COMPAT_ARPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
298 XT_ENTRY_ITERATE_CONTINUE(struct compat_arpt_entry, entries, size, n, \
299 fn, ## args)
300
301#endif /* CONFIG_COMPAT */ 296#endif /* CONFIG_COMPAT */
302#endif /*__KERNEL__*/ 297#endif /*__KERNEL__*/
303#endif /* _ARPTABLES_H */ 298#endif /* _ARPTABLES_H */
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index 3cc40c131cc3..1c6f0c5f530e 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -289,7 +289,7 @@ struct ebt_table {
289 ~(__alignof__(struct ebt_replace)-1)) 289 ~(__alignof__(struct ebt_replace)-1))
290extern struct ebt_table *ebt_register_table(struct net *net, 290extern struct ebt_table *ebt_register_table(struct net *net,
291 const struct ebt_table *table); 291 const struct ebt_table *table);
292extern void ebt_unregister_table(struct ebt_table *table); 292extern void ebt_unregister_table(struct net *net, struct ebt_table *table);
293extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, 293extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
294 const struct net_device *in, const struct net_device *out, 294 const struct net_device *in, const struct net_device *out,
295 struct ebt_table *table); 295 struct ebt_table *table);
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 27b3f5807305..704a7b6e8169 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -223,6 +223,7 @@ ipt_get_target(struct ipt_entry *e)
223 return (void *)e + e->target_offset; 223 return (void *)e + e->target_offset;
224} 224}
225 225
226#ifndef __KERNEL__
226/* fn returns 0 to continue iteration */ 227/* fn returns 0 to continue iteration */
227#define IPT_MATCH_ITERATE(e, fn, args...) \ 228#define IPT_MATCH_ITERATE(e, fn, args...) \
228 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) 229 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
@@ -230,6 +231,7 @@ ipt_get_target(struct ipt_entry *e)
230/* fn returns 0 to continue iteration */ 231/* fn returns 0 to continue iteration */
231#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ 232#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
232 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) 233 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
234#endif
233 235
234/* 236/*
235 * Main firewall chains definitions and global var's definitions. 237 * Main firewall chains definitions and global var's definitions.
@@ -242,7 +244,7 @@ extern void ipt_init(void) __init;
242extern struct xt_table *ipt_register_table(struct net *net, 244extern struct xt_table *ipt_register_table(struct net *net,
243 const struct xt_table *table, 245 const struct xt_table *table,
244 const struct ipt_replace *repl); 246 const struct ipt_replace *repl);
245extern void ipt_unregister_table(struct xt_table *table); 247extern void ipt_unregister_table(struct net *net, struct xt_table *table);
246 248
247/* Standard entry. */ 249/* Standard entry. */
248struct ipt_standard { 250struct ipt_standard {
@@ -282,6 +284,7 @@ struct ipt_error {
282 .target.errorname = "ERROR", \ 284 .target.errorname = "ERROR", \
283} 285}
284 286
287extern void *ipt_alloc_initial_table(const struct xt_table *);
285extern unsigned int ipt_do_table(struct sk_buff *skb, 288extern unsigned int ipt_do_table(struct sk_buff *skb,
286 unsigned int hook, 289 unsigned int hook,
287 const struct net_device *in, 290 const struct net_device *in,
@@ -312,19 +315,6 @@ compat_ipt_get_target(struct compat_ipt_entry *e)
312 315
313#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) 316#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s)
314 317
315/* fn returns 0 to continue iteration */
316#define COMPAT_IPT_MATCH_ITERATE(e, fn, args...) \
317 XT_MATCH_ITERATE(struct compat_ipt_entry, e, fn, ## args)
318
319/* fn returns 0 to continue iteration */
320#define COMPAT_IPT_ENTRY_ITERATE(entries, size, fn, args...) \
321 XT_ENTRY_ITERATE(struct compat_ipt_entry, entries, size, fn, ## args)
322
323/* fn returns 0 to continue iteration */
324#define COMPAT_IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
325 XT_ENTRY_ITERATE_CONTINUE(struct compat_ipt_entry, entries, size, n, \
326 fn, ## args)
327
328#endif /* CONFIG_COMPAT */ 318#endif /* CONFIG_COMPAT */
329#endif /*__KERNEL__*/ 319#endif /*__KERNEL__*/
330#endif /* _IPTABLES_H */ 320#endif /* _IPTABLES_H */
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index b31050d20ae4..e5ba03d783c6 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -280,6 +280,7 @@ ip6t_get_target(struct ip6t_entry *e)
280 return (void *)e + e->target_offset; 280 return (void *)e + e->target_offset;
281} 281}
282 282
283#ifndef __KERNEL__
283/* fn returns 0 to continue iteration */ 284/* fn returns 0 to continue iteration */
284#define IP6T_MATCH_ITERATE(e, fn, args...) \ 285#define IP6T_MATCH_ITERATE(e, fn, args...) \
285 XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args) 286 XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args)
@@ -287,6 +288,7 @@ ip6t_get_target(struct ip6t_entry *e)
287/* fn returns 0 to continue iteration */ 288/* fn returns 0 to continue iteration */
288#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ 289#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
289 XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args) 290 XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args)
291#endif
290 292
291/* 293/*
292 * Main firewall chains definitions and global var's definitions. 294 * Main firewall chains definitions and global var's definitions.
@@ -297,10 +299,11 @@ ip6t_get_target(struct ip6t_entry *e)
297#include <linux/init.h> 299#include <linux/init.h>
298extern void ip6t_init(void) __init; 300extern void ip6t_init(void) __init;
299 301
302extern void *ip6t_alloc_initial_table(const struct xt_table *);
300extern struct xt_table *ip6t_register_table(struct net *net, 303extern struct xt_table *ip6t_register_table(struct net *net,
301 const struct xt_table *table, 304 const struct xt_table *table,
302 const struct ip6t_replace *repl); 305 const struct ip6t_replace *repl);
303extern void ip6t_unregister_table(struct xt_table *table); 306extern void ip6t_unregister_table(struct net *net, struct xt_table *table);
304extern unsigned int ip6t_do_table(struct sk_buff *skb, 307extern unsigned int ip6t_do_table(struct sk_buff *skb,
305 unsigned int hook, 308 unsigned int hook,
306 const struct net_device *in, 309 const struct net_device *in,
@@ -340,18 +343,6 @@ compat_ip6t_get_target(struct compat_ip6t_entry *e)
340 343
341#define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s) 344#define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s)
342 345
343/* fn returns 0 to continue iteration */
344#define COMPAT_IP6T_MATCH_ITERATE(e, fn, args...) \
345 XT_MATCH_ITERATE(struct compat_ip6t_entry, e, fn, ## args)
346
347/* fn returns 0 to continue iteration */
348#define COMPAT_IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
349 XT_ENTRY_ITERATE(struct compat_ip6t_entry, entries, size, fn, ## args)
350
351#define COMPAT_IP6T_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
352 XT_ENTRY_ITERATE_CONTINUE(struct compat_ip6t_entry, entries, size, n, \
353 fn, ## args)
354
355#endif /* CONFIG_COMPAT */ 346#endif /* CONFIG_COMPAT */
356#endif /*__KERNEL__*/ 347#endif /*__KERNEL__*/
357#endif /* _IP6_TABLES_H */ 348#endif /* _IP6_TABLES_H */
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 2524267210d3..a765ea898549 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -21,15 +21,20 @@ struct netpoll {
21 __be32 local_ip, remote_ip; 21 __be32 local_ip, remote_ip;
22 u16 local_port, remote_port; 22 u16 local_port, remote_port;
23 u8 remote_mac[ETH_ALEN]; 23 u8 remote_mac[ETH_ALEN];
24
25 struct list_head rx; /* rx_np list element */
24}; 26};
25 27
26struct netpoll_info { 28struct netpoll_info {
27 atomic_t refcnt; 29 atomic_t refcnt;
30
28 int rx_flags; 31 int rx_flags;
29 spinlock_t rx_lock; 32 spinlock_t rx_lock;
30 struct netpoll *rx_np; /* netpoll that registered an rx_hook */ 33 struct list_head rx_np; /* netpolls that registered an rx_hook */
34
31 struct sk_buff_head arp_tx; /* list of arp requests to reply to */ 35 struct sk_buff_head arp_tx; /* list of arp requests to reply to */
32 struct sk_buff_head txq; 36 struct sk_buff_head txq;
37
33 struct delayed_work tx_work; 38 struct delayed_work tx_work;
34}; 39};
35 40
@@ -51,7 +56,7 @@ static inline int netpoll_rx(struct sk_buff *skb)
51 unsigned long flags; 56 unsigned long flags;
52 int ret = 0; 57 int ret = 0;
53 58
54 if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags)) 59 if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags))
55 return 0; 60 return 0;
56 61
57 spin_lock_irqsave(&npinfo->rx_lock, flags); 62 spin_lock_irqsave(&npinfo->rx_lock, flags);
@@ -67,7 +72,7 @@ static inline int netpoll_rx_on(struct sk_buff *skb)
67{ 72{
68 struct netpoll_info *npinfo = skb->dev->npinfo; 73 struct netpoll_info *npinfo = skb->dev->npinfo;
69 74
70 return npinfo && (npinfo->rx_np || npinfo->rx_flags); 75 return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
71} 76}
72 77
73static inline int netpoll_receive_skb(struct sk_buff *skb) 78static inline int netpoll_receive_skb(struct sk_buff *skb)
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 34fc6be5bfcf..6a2e44fd75e2 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -105,7 +105,7 @@ struct nfs_server {
105 struct rpc_clnt * client; /* RPC client handle */ 105 struct rpc_clnt * client; /* RPC client handle */
106 struct rpc_clnt * client_acl; /* ACL RPC client handle */ 106 struct rpc_clnt * client_acl; /* ACL RPC client handle */
107 struct nlm_host *nlm_host; /* NLM client handle */ 107 struct nlm_host *nlm_host; /* NLM client handle */
108 struct nfs_iostats * io_stats; /* I/O statistics */ 108 struct nfs_iostats __percpu *io_stats; /* I/O statistics */
109 struct backing_dev_info backing_dev_info; 109 struct backing_dev_info backing_dev_info;
110 atomic_long_t writeback; /* number of writeback pages */ 110 atomic_long_t writeback; /* number of writeback pages */
111 int flags; /* various flags */ 111 int flags; /* various flags */
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index da8ea2e19273..28ba20fda3e2 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -3,7 +3,7 @@
3/* 3/*
4 * 802.11 netlink interface public header 4 * 802.11 netlink interface public header
5 * 5 *
6 * Copyright 2006, 2007, 2008 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
7 * Copyright 2008 Michael Wu <flamingice@sourmilk.net> 7 * Copyright 2008 Michael Wu <flamingice@sourmilk.net>
8 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> 8 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
9 * Copyright 2008 Michael Buesch <mb@bu3sch.de> 9 * Copyright 2008 Michael Buesch <mb@bu3sch.de>
@@ -270,6 +270,60 @@
270 * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices 270 * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
271 * associated with this wiphy must be down and will follow. 271 * associated with this wiphy must be down and will follow.
272 * 272 *
273 * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified
274 * channel for the specified amount of time. This can be used to do
275 * off-channel operations like transmit a Public Action frame and wait for
276 * a response while being associated to an AP on another channel.
277 * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which
278 * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
279 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
280 * optionally used to specify additional channel parameters.
281 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
282 * to remain on the channel. This command is also used as an event to
283 * notify when the requested duration starts (it may take a while for the
284 * driver to schedule this time due to other concurrent needs for the
285 * radio).
286 * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
287 * that will be included with any events pertaining to this request;
288 * the cookie is also used to cancel the request.
289 * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a
290 * pending remain-on-channel duration if the desired operation has been
291 * completed prior to expiration of the originally requested duration.
292 * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the
293 * radio. The %NL80211_ATTR_COOKIE attribute must be given as well to
294 * uniquely identify the request.
295 * This command is also used as an event to notify when a requested
296 * remain-on-channel duration has expired.
297 *
298 * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX
299 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
300 * and @NL80211_ATTR_TX_RATES the set of allowed rates.
301 *
302 * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames
303 * (via @NL80211_CMD_ACTION) for processing in userspace. This command
304 * requires an interface index and a match attribute containing the first
305 * few bytes of the frame that should match, e.g. a single byte for only
306 * a category match or four bytes for vendor frames including the OUI.
307 * The registration cannot be dropped, but is removed automatically
308 * when the netlink socket is closed. Multiple registrations can be made.
309 * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This
310 * command is used both as a request to transmit an Action frame and as an
311 * event indicating reception of an Action frame that was not processed in
312 * kernel code, but is for us (i.e., which may need to be processed in a
313 * user space application). %NL80211_ATTR_FRAME is used to specify the
314 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
315 * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on
316 * which channel the frame is to be transmitted or was received. This
317 * channel has to be the current channel (remain-on-channel or the
318 * operational channel). When called, this operation returns a cookie
319 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event
320 * pertaining to the TX request.
321 * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame
322 * transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies
323 * the TX command and %NL80211_ATTR_FRAME includes the contents of the
324 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
325 * the frame.
326 *
273 * @NL80211_CMD_MAX: highest used command number 327 * @NL80211_CMD_MAX: highest used command number
274 * @__NL80211_CMD_AFTER_LAST: internal use 328 * @__NL80211_CMD_AFTER_LAST: internal use
275 */ 329 */
@@ -353,6 +407,18 @@ enum nl80211_commands {
353 NL80211_CMD_DEL_PMKSA, 407 NL80211_CMD_DEL_PMKSA,
354 NL80211_CMD_FLUSH_PMKSA, 408 NL80211_CMD_FLUSH_PMKSA,
355 409
410 NL80211_CMD_REMAIN_ON_CHANNEL,
411 NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
412
413 NL80211_CMD_SET_TX_BITRATE_MASK,
414
415 NL80211_CMD_REGISTER_ACTION,
416 NL80211_CMD_ACTION,
417 NL80211_CMD_ACTION_TX_STATUS,
418
419 NL80211_CMD_SET_POWER_SAVE,
420 NL80211_CMD_GET_POWER_SAVE,
421
356 /* add new commands above here */ 422 /* add new commands above here */
357 423
358 /* used to define NL80211_CMD_MAX below */ 424 /* used to define NL80211_CMD_MAX below */
@@ -402,6 +468,8 @@ enum nl80211_commands {
402 * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length 468 * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length
403 * larger than or equal to this use RTS/CTS handshake); allowed range: 469 * larger than or equal to this use RTS/CTS handshake); allowed range:
404 * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32 470 * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32
471 * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11
472 * section 7.3.2.9; dot11CoverageClass; u8
405 * 473 *
406 * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on 474 * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
407 * @NL80211_ATTR_IFNAME: network interface name 475 * @NL80211_ATTR_IFNAME: network interface name
@@ -606,6 +674,23 @@ enum nl80211_commands {
606 * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can 674 * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
607 * cache, a wiphy attribute. 675 * cache, a wiphy attribute.
608 * 676 *
677 * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
678 *
679 * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
680 *
681 * @NL80211_ATTR_TX_RATES: Nested set of attributes
682 * (enum nl80211_tx_rate_attributes) describing TX rates per band. The
683 * enum nl80211_band value is used as the index (nla_type() of the nested
684 * data. If a band is not included, it will be configured to allow all
685 * rates based on negotiated supported rates information. This attribute
686 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
687 *
688 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
689 * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION.
690 *
691 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
692 * acknowledged by the recipient.
693 *
609 * @NL80211_ATTR_MAX: highest attribute number currently defined 694 * @NL80211_ATTR_MAX: highest attribute number currently defined
610 * @__NL80211_ATTR_AFTER_LAST: internal use 695 * @__NL80211_ATTR_AFTER_LAST: internal use
611 */ 696 */
@@ -743,6 +828,20 @@ enum nl80211_attrs {
743 NL80211_ATTR_PMKID, 828 NL80211_ATTR_PMKID,
744 NL80211_ATTR_MAX_NUM_PMKIDS, 829 NL80211_ATTR_MAX_NUM_PMKIDS,
745 830
831 NL80211_ATTR_DURATION,
832
833 NL80211_ATTR_COOKIE,
834
835 NL80211_ATTR_WIPHY_COVERAGE_CLASS,
836
837 NL80211_ATTR_TX_RATES,
838
839 NL80211_ATTR_FRAME_MATCH,
840
841 NL80211_ATTR_ACK,
842
843 NL80211_ATTR_PS_STATE,
844
746 /* add attributes here, update the policy in nl80211.c */ 845 /* add attributes here, update the policy in nl80211.c */
747 846
748 __NL80211_ATTR_AFTER_LAST, 847 __NL80211_ATTR_AFTER_LAST,
@@ -1323,13 +1422,20 @@ enum nl80211_channel_type {
1323 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) 1422 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
1324 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16) 1423 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
1325 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the 1424 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
1326 * raw information elements from the probe response/beacon (bin) 1425 * raw information elements from the probe response/beacon (bin);
1426 * if the %NL80211_BSS_BEACON_IES attribute is present, the IEs here are
1427 * from a Probe Response frame; otherwise they are from a Beacon frame.
1428 * However, if the driver does not indicate the source of the IEs, these
1429 * IEs may be from either frame subtype.
1327 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon 1430 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
1328 * in mBm (100 * dBm) (s32) 1431 * in mBm (100 * dBm) (s32)
1329 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon 1432 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
1330 * in unspecified units, scaled to 0..100 (u8) 1433 * in unspecified units, scaled to 0..100 (u8)
1331 * @NL80211_BSS_STATUS: status, if this BSS is "used" 1434 * @NL80211_BSS_STATUS: status, if this BSS is "used"
1332 * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms 1435 * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
1436 * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
1437 * elements from a Beacon frame (bin); not present if no Beacon frame has
1438 * yet been received
1333 * @__NL80211_BSS_AFTER_LAST: internal 1439 * @__NL80211_BSS_AFTER_LAST: internal
1334 * @NL80211_BSS_MAX: highest BSS attribute 1440 * @NL80211_BSS_MAX: highest BSS attribute
1335 */ 1441 */
@@ -1345,6 +1451,7 @@ enum nl80211_bss {
1345 NL80211_BSS_SIGNAL_UNSPEC, 1451 NL80211_BSS_SIGNAL_UNSPEC,
1346 NL80211_BSS_STATUS, 1452 NL80211_BSS_STATUS,
1347 NL80211_BSS_SEEN_MS_AGO, 1453 NL80211_BSS_SEEN_MS_AGO,
1454 NL80211_BSS_BEACON_IES,
1348 1455
1349 /* keep last */ 1456 /* keep last */
1350 __NL80211_BSS_AFTER_LAST, 1457 __NL80211_BSS_AFTER_LAST,
@@ -1442,4 +1549,38 @@ enum nl80211_key_attributes {
1442 NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 1549 NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1
1443}; 1550};
1444 1551
1552/**
1553 * enum nl80211_tx_rate_attributes - TX rate set attributes
1554 * @__NL80211_TXRATE_INVALID: invalid
1555 * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection
1556 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
1557 * 1 = 500 kbps) but without the IE length restriction (at most
1558 * %NL80211_MAX_SUPP_RATES in a single array).
1559 * @__NL80211_TXRATE_AFTER_LAST: internal
1560 * @NL80211_TXRATE_MAX: highest TX rate attribute
1561 */
1562enum nl80211_tx_rate_attributes {
1563 __NL80211_TXRATE_INVALID,
1564 NL80211_TXRATE_LEGACY,
1565
1566 /* keep last */
1567 __NL80211_TXRATE_AFTER_LAST,
1568 NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
1569};
1570
1571/**
1572 * enum nl80211_band - Frequency band
1573 * @NL80211_BAND_2GHZ - 2.4 GHz ISM band
1574 * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz)
1575 */
1576enum nl80211_band {
1577 NL80211_BAND_2GHZ,
1578 NL80211_BAND_5GHZ,
1579};
1580
1581enum nl80211_ps_state {
1582 NL80211_PS_DISABLED,
1583 NL80211_PS_ENABLED,
1584};
1585
1445#endif /* __LINUX_NL80211_H */ 1586#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
index f46c40ac6d45..9bdd91486b49 100644
--- a/include/linux/omapfb.h
+++ b/include/linux/omapfb.h
@@ -57,6 +57,7 @@
57#define OMAPFB_WAITFORGO OMAP_IO(60) 57#define OMAPFB_WAITFORGO OMAP_IO(60)
58#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) 58#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info)
59#define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) 59#define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info)
60#define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(63, struct omapfb_display_info)
60 61
61#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff 62#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
62#define OMAPFB_CAPS_LCDC_MASK 0x00fff000 63#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
@@ -206,6 +207,14 @@ struct omapfb_tearsync_info {
206 __u16 reserved2; 207 __u16 reserved2;
207}; 208};
208 209
210struct omapfb_display_info {
211 __u16 xres;
212 __u16 yres;
213 __u32 width; /* phys width of the display in micrometers */
214 __u32 height; /* phys height of the display in micrometers */
215 __u32 reserved[5];
216};
217
209#ifdef __KERNEL__ 218#ifdef __KERNEL__
210 219
211#include <plat/board.h> 220#include <plat/board.h>
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 25813738c71a..ec95ebe629f1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -662,6 +662,9 @@ extern void pci_remove_bus_device(struct pci_dev *dev);
662extern void pci_stop_bus_device(struct pci_dev *dev); 662extern void pci_stop_bus_device(struct pci_dev *dev);
663void pci_setup_cardbus(struct pci_bus *bus); 663void pci_setup_cardbus(struct pci_bus *bus);
664extern void pci_sort_breadthfirst(void); 664extern void pci_sort_breadthfirst(void);
665#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
666#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false))
667#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0))
665 668
666/* Generic PCI functions exported to card drivers */ 669/* Generic PCI functions exported to card drivers */
667 670
@@ -1195,6 +1198,9 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1195 unsigned int devfn) 1198 unsigned int devfn)
1196{ return NULL; } 1199{ return NULL; }
1197 1200
1201#define dev_is_pci(d) (false)
1202#define dev_is_pf(d) (false)
1203#define dev_num_vf(d) (0)
1198#endif /* CONFIG_PCI */ 1204#endif /* CONFIG_PCI */
1199 1205
1200/* Include architecture-dependent settings and functions */ 1206/* Include architecture-dependent settings and functions */
@@ -1356,6 +1362,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
1356extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); 1362extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1357extern void pci_disable_sriov(struct pci_dev *dev); 1363extern void pci_disable_sriov(struct pci_dev *dev);
1358extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); 1364extern irqreturn_t pci_sriov_migration(struct pci_dev *dev);
1365extern int pci_num_vf(struct pci_dev *dev);
1359#else 1366#else
1360static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1367static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1361{ 1368{
@@ -1368,6 +1375,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
1368{ 1375{
1369 return IRQ_NONE; 1376 return IRQ_NONE;
1370} 1377}
1378static inline int pci_num_vf(struct pci_dev *dev)
1379{
1380 return 0;
1381}
1371#endif 1382#endif
1372 1383
1373#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1384#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
@@ -1404,5 +1415,93 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
1404 1415
1405void pci_request_acs(void); 1416void pci_request_acs(void);
1406 1417
1418
1419#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */
1420#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT)
1421
1422/* Large Resource Data Type Tag Item Names */
1423#define PCI_VPD_LTIN_ID_STRING 0x02 /* Identifier String */
1424#define PCI_VPD_LTIN_RO_DATA 0x10 /* Read-Only Data */
1425#define PCI_VPD_LTIN_RW_DATA 0x11 /* Read-Write Data */
1426
1427#define PCI_VPD_LRDT_ID_STRING PCI_VPD_LRDT_ID(PCI_VPD_LTIN_ID_STRING)
1428#define PCI_VPD_LRDT_RO_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RO_DATA)
1429#define PCI_VPD_LRDT_RW_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RW_DATA)
1430
1431/* Small Resource Data Type Tag Item Names */
1432#define PCI_VPD_STIN_END 0x78 /* End */
1433
1434#define PCI_VPD_SRDT_END PCI_VPD_STIN_END
1435
1436#define PCI_VPD_SRDT_TIN_MASK 0x78
1437#define PCI_VPD_SRDT_LEN_MASK 0x07
1438
1439#define PCI_VPD_LRDT_TAG_SIZE 3
1440#define PCI_VPD_SRDT_TAG_SIZE 1
1441
1442#define PCI_VPD_INFO_FLD_HDR_SIZE 3
1443
1444#define PCI_VPD_RO_KEYWORD_PARTNO "PN"
1445#define PCI_VPD_RO_KEYWORD_MFR_ID "MN"
1446#define PCI_VPD_RO_KEYWORD_VENDOR0 "V0"
1447
1448/**
1449 * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length
1450 * @lrdt: Pointer to the beginning of the Large Resource Data Type tag
1451 *
1452 * Returns the extracted Large Resource Data Type length.
1453 */
1454static inline u16 pci_vpd_lrdt_size(const u8 *lrdt)
1455{
1456 return (u16)lrdt[1] + ((u16)lrdt[2] << 8);
1457}
1458
1459/**
1460 * pci_vpd_srdt_size - Extracts the Small Resource Data Type length
1461 * @lrdt: Pointer to the beginning of the Small Resource Data Type tag
1462 *
1463 * Returns the extracted Small Resource Data Type length.
1464 */
1465static inline u8 pci_vpd_srdt_size(const u8 *srdt)
1466{
1467 return (*srdt) & PCI_VPD_SRDT_LEN_MASK;
1468}
1469
1470/**
1471 * pci_vpd_info_field_size - Extracts the information field length
1472 * @lrdt: Pointer to the beginning of an information field header
1473 *
1474 * Returns the extracted information field length.
1475 */
1476static inline u8 pci_vpd_info_field_size(const u8 *info_field)
1477{
1478 return info_field[2];
1479}
1480
1481/**
1482 * pci_vpd_find_tag - Locates the Resource Data Type tag provided
1483 * @buf: Pointer to buffered vpd data
1484 * @off: The offset into the buffer at which to begin the search
1485 * @len: The length of the vpd buffer
1486 * @rdt: The Resource Data Type to search for
1487 *
1488 * Returns the index where the Resource Data Type was found or
1489 * -ENOENT otherwise.
1490 */
1491int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
1492
1493/**
1494 * pci_vpd_find_info_keyword - Locates an information field keyword in the VPD
1495 * @buf: Pointer to buffered vpd data
1496 * @off: The offset into the buffer at which to begin the search
1497 * @len: The length of the buffer area, relative to off, in which to search
1498 * @kw: The keyword to search for
1499 *
1500 * Returns the index where the information field keyword was found or
1501 * -ENOENT otherwise.
1502 */
1503int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1504 unsigned int len, const char *kw);
1505
1407#endif /* __KERNEL__ */ 1506#endif /* __KERNEL__ */
1408#endif /* LINUX_PCI_H */ 1507#endif /* LINUX_PCI_H */
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 5a5d6ce4bd55..68567c0b3a5d 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -2,12 +2,6 @@
2#define _LINUX_PERCPU_DEFS_H 2#define _LINUX_PERCPU_DEFS_H
3 3
4/* 4/*
5 * Determine the real variable name from the name visible in the
6 * kernel sources.
7 */
8#define per_cpu_var(var) per_cpu__##var
9
10/*
11 * Base implementations of per-CPU variable declarations and definitions, where 5 * Base implementations of per-CPU variable declarations and definitions, where
12 * the section in which the variable is to be placed is provided by the 6 * the section in which the variable is to be placed is provided by the
13 * 'sec' argument. This may be used to affect the parameters governing the 7 * 'sec' argument. This may be used to affect the parameters governing the
@@ -18,13 +12,23 @@
18 * that section. 12 * that section.
19 */ 13 */
20#define __PCPU_ATTRS(sec) \ 14#define __PCPU_ATTRS(sec) \
21 __attribute__((section(PER_CPU_BASE_SECTION sec))) \ 15 __percpu __attribute__((section(PER_CPU_BASE_SECTION sec))) \
22 PER_CPU_ATTRIBUTES 16 PER_CPU_ATTRIBUTES
23 17
24#define __PCPU_DUMMY_ATTRS \ 18#define __PCPU_DUMMY_ATTRS \
25 __attribute__((section(".discard"), unused)) 19 __attribute__((section(".discard"), unused))
26 20
27/* 21/*
22 * Macro which verifies @ptr is a percpu pointer without evaluating
23 * @ptr. This is to be used in percpu accessors to verify that the
24 * input parameter is a percpu pointer.
25 */
26#define __verify_pcpu_ptr(ptr) do { \
27 const void __percpu *__vpp_verify = (typeof(ptr))NULL; \
28 (void)__vpp_verify; \
29} while (0)
30
31/*
28 * s390 and alpha modules require percpu variables to be defined as 32 * s390 and alpha modules require percpu variables to be defined as
29 * weak to force the compiler to generate GOT based external 33 * weak to force the compiler to generate GOT based external
30 * references for them. This is necessary because percpu sections 34 * references for them. This is necessary because percpu sections
@@ -56,24 +60,24 @@
56 */ 60 */
57#define DECLARE_PER_CPU_SECTION(type, name, sec) \ 61#define DECLARE_PER_CPU_SECTION(type, name, sec) \
58 extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ 62 extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
59 extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name 63 extern __PCPU_ATTRS(sec) __typeof__(type) name
60 64
61#define DEFINE_PER_CPU_SECTION(type, name, sec) \ 65#define DEFINE_PER_CPU_SECTION(type, name, sec) \
62 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ 66 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
63 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ 67 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
64 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ 68 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
65 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ 69 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \
66 __typeof__(type) per_cpu__##name 70 __typeof__(type) name
67#else 71#else
68/* 72/*
69 * Normal declaration and definition macros. 73 * Normal declaration and definition macros.
70 */ 74 */
71#define DECLARE_PER_CPU_SECTION(type, name, sec) \ 75#define DECLARE_PER_CPU_SECTION(type, name, sec) \
72 extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name 76 extern __PCPU_ATTRS(sec) __typeof__(type) name
73 77
74#define DEFINE_PER_CPU_SECTION(type, name, sec) \ 78#define DEFINE_PER_CPU_SECTION(type, name, sec) \
75 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \ 79 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \
76 __typeof__(type) per_cpu__##name 80 __typeof__(type) name
77#endif 81#endif
78 82
79/* 83/*
@@ -135,10 +139,16 @@
135 __aligned(PAGE_SIZE) 139 __aligned(PAGE_SIZE)
136 140
137/* 141/*
138 * Intermodule exports for per-CPU variables. 142 * Intermodule exports for per-CPU variables. sparse forgets about
143 * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to
144 * noop if __CHECKER__.
139 */ 145 */
140#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) 146#ifndef __CHECKER__
141#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) 147#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var)
142 148#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var)
149#else
150#define EXPORT_PER_CPU_SYMBOL(var)
151#define EXPORT_PER_CPU_SYMBOL_GPL(var)
152#endif
143 153
144#endif /* _LINUX_PERCPU_DEFS_H */ 154#endif /* _LINUX_PERCPU_DEFS_H */
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index cf5efbcf716c..a93e5bfdccb8 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -27,10 +27,17 @@
27 * we force a syntax error here if it isn't. 27 * we force a syntax error here if it isn't.
28 */ 28 */
29#define get_cpu_var(var) (*({ \ 29#define get_cpu_var(var) (*({ \
30 extern int simple_identifier_##var(void); \
31 preempt_disable(); \ 30 preempt_disable(); \
32 &__get_cpu_var(var); })) 31 &__get_cpu_var(var); }))
33#define put_cpu_var(var) preempt_enable() 32
33/*
34 * The weird & is necessary because sparse considers (void)(var) to be
35 * a direct dereference of percpu variable (var).
36 */
37#define put_cpu_var(var) do { \
38 (void)&(var); \
39 preempt_enable(); \
40} while (0)
34 41
35#ifdef CONFIG_SMP 42#ifdef CONFIG_SMP
36 43
@@ -127,9 +134,9 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size,
127 */ 134 */
128#define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) 135#define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu)))
129 136
130extern void *__alloc_reserved_percpu(size_t size, size_t align); 137extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align);
131extern void *__alloc_percpu(size_t size, size_t align); 138extern void __percpu *__alloc_percpu(size_t size, size_t align);
132extern void free_percpu(void *__pdata); 139extern void free_percpu(void __percpu *__pdata);
133extern phys_addr_t per_cpu_ptr_to_phys(void *addr); 140extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
134 141
135#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA 142#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
@@ -140,7 +147,7 @@ extern void __init setup_per_cpu_areas(void);
140 147
141#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) 148#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
142 149
143static inline void *__alloc_percpu(size_t size, size_t align) 150static inline void __percpu *__alloc_percpu(size_t size, size_t align)
144{ 151{
145 /* 152 /*
146 * Can't easily make larger alignment work with kmalloc. WARN 153 * Can't easily make larger alignment work with kmalloc. WARN
@@ -151,7 +158,7 @@ static inline void *__alloc_percpu(size_t size, size_t align)
151 return kzalloc(size, GFP_KERNEL); 158 return kzalloc(size, GFP_KERNEL);
152} 159}
153 160
154static inline void free_percpu(void *p) 161static inline void free_percpu(void __percpu *p)
155{ 162{
156 kfree(p); 163 kfree(p);
157} 164}
@@ -171,7 +178,7 @@ static inline void *pcpu_lpage_remapped(void *kaddr)
171#endif /* CONFIG_SMP */ 178#endif /* CONFIG_SMP */
172 179
173#define alloc_percpu(type) \ 180#define alloc_percpu(type) \
174 (typeof(type) *)__alloc_percpu(sizeof(type), __alignof__(type)) 181 (typeof(type) __percpu *)__alloc_percpu(sizeof(type), __alignof__(type))
175 182
176/* 183/*
177 * Optional methods for optimized non-lvalue per-cpu variable access. 184 * Optional methods for optimized non-lvalue per-cpu variable access.
@@ -188,17 +195,19 @@ static inline void *pcpu_lpage_remapped(void *kaddr)
188#ifndef percpu_read 195#ifndef percpu_read
189# define percpu_read(var) \ 196# define percpu_read(var) \
190 ({ \ 197 ({ \
191 typeof(per_cpu_var(var)) __tmp_var__; \ 198 typeof(var) *pr_ptr__ = &(var); \
192 __tmp_var__ = get_cpu_var(var); \ 199 typeof(var) pr_ret__; \
193 put_cpu_var(var); \ 200 pr_ret__ = get_cpu_var(*pr_ptr__); \
194 __tmp_var__; \ 201 put_cpu_var(*pr_ptr__); \
202 pr_ret__; \
195 }) 203 })
196#endif 204#endif
197 205
198#define __percpu_generic_to_op(var, val, op) \ 206#define __percpu_generic_to_op(var, val, op) \
199do { \ 207do { \
200 get_cpu_var(var) op val; \ 208 typeof(var) *pgto_ptr__ = &(var); \
201 put_cpu_var(var); \ 209 get_cpu_var(*pgto_ptr__) op val; \
210 put_cpu_var(*pgto_ptr__); \
202} while (0) 211} while (0)
203 212
204#ifndef percpu_write 213#ifndef percpu_write
@@ -234,6 +243,7 @@ extern void __bad_size_call_parameter(void);
234 243
235#define __pcpu_size_call_return(stem, variable) \ 244#define __pcpu_size_call_return(stem, variable) \
236({ typeof(variable) pscr_ret__; \ 245({ typeof(variable) pscr_ret__; \
246 __verify_pcpu_ptr(&(variable)); \
237 switch(sizeof(variable)) { \ 247 switch(sizeof(variable)) { \
238 case 1: pscr_ret__ = stem##1(variable);break; \ 248 case 1: pscr_ret__ = stem##1(variable);break; \
239 case 2: pscr_ret__ = stem##2(variable);break; \ 249 case 2: pscr_ret__ = stem##2(variable);break; \
@@ -247,6 +257,7 @@ extern void __bad_size_call_parameter(void);
247 257
248#define __pcpu_size_call(stem, variable, ...) \ 258#define __pcpu_size_call(stem, variable, ...) \
249do { \ 259do { \
260 __verify_pcpu_ptr(&(variable)); \
250 switch(sizeof(variable)) { \ 261 switch(sizeof(variable)) { \
251 case 1: stem##1(variable, __VA_ARGS__);break; \ 262 case 1: stem##1(variable, __VA_ARGS__);break; \
252 case 2: stem##2(variable, __VA_ARGS__);break; \ 263 case 2: stem##2(variable, __VA_ARGS__);break; \
@@ -259,8 +270,7 @@ do { \
259 270
260/* 271/*
261 * Optimized manipulation for memory allocated through the per cpu 272 * Optimized manipulation for memory allocated through the per cpu
262 * allocator or for addresses of per cpu variables (can be determined 273 * allocator or for addresses of per cpu variables.
263 * using per_cpu_var(xx).
264 * 274 *
265 * These operation guarantee exclusivity of access for other operations 275 * These operation guarantee exclusivity of access for other operations
266 * on the *same* processor. The assumption is that per cpu data is only 276 * on the *same* processor. The assumption is that per cpu data is only
@@ -311,7 +321,7 @@ do { \
311#define _this_cpu_generic_to_op(pcp, val, op) \ 321#define _this_cpu_generic_to_op(pcp, val, op) \
312do { \ 322do { \
313 preempt_disable(); \ 323 preempt_disable(); \
314 *__this_cpu_ptr(&pcp) op val; \ 324 *__this_cpu_ptr(&(pcp)) op val; \
315 preempt_enable(); \ 325 preempt_enable(); \
316} while (0) 326} while (0)
317 327
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 794662b2be5d..c88d67b59394 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -21,7 +21,7 @@ struct percpu_counter {
21#ifdef CONFIG_HOTPLUG_CPU 21#ifdef CONFIG_HOTPLUG_CPU
22 struct list_head list; /* All percpu_counters are on a list */ 22 struct list_head list; /* All percpu_counters are on a list */
23#endif 23#endif
24 s32 *counters; 24 s32 __percpu *counters;
25}; 25};
26 26
27extern int percpu_counter_batch; 27extern int percpu_counter_batch;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 6a7eb402165d..14d7fdf6a90a 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -452,6 +452,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
452 u32 flags, phy_interface_t interface); 452 u32 flags, phy_interface_t interface);
453struct phy_device * phy_attach(struct net_device *dev, 453struct phy_device * phy_attach(struct net_device *dev,
454 const char *bus_id, u32 flags, phy_interface_t interface); 454 const char *bus_id, u32 flags, phy_interface_t interface);
455struct phy_device *phy_find_first(struct mii_bus *bus);
455int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, 456int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
456 void (*handler)(struct net_device *), u32 flags, 457 void (*handler)(struct net_device *), u32 flags,
457 phy_interface_t interface); 458 phy_interface_t interface);
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index 76e5053e1fac..721301b0a908 100644
--- a/include/linux/pktcdvd.h
+++ b/include/linux/pktcdvd.h
@@ -163,10 +163,8 @@ struct packet_iosched
163 atomic_t attention; /* Set to non-zero when queue processing is needed */ 163 atomic_t attention; /* Set to non-zero when queue processing is needed */
164 int writing; /* Non-zero when writing, zero when reading */ 164 int writing; /* Non-zero when writing, zero when reading */
165 spinlock_t lock; /* Protecting read/write queue manipulations */ 165 spinlock_t lock; /* Protecting read/write queue manipulations */
166 struct bio *read_queue; 166 struct bio_list read_queue;
167 struct bio *read_queue_tail; 167 struct bio_list write_queue;
168 struct bio *write_queue;
169 struct bio *write_queue_tail;
170 sector_t last_write; /* The sector where the last write ended */ 168 sector_t last_write; /* The sector where the last write ended */
171 int successive_reads; 169 int successive_reads;
172}; 170};
@@ -206,8 +204,8 @@ struct packet_data
206 spinlock_t lock; /* Lock protecting state transitions and */ 204 spinlock_t lock; /* Lock protecting state transitions and */
207 /* orig_bios list */ 205 /* orig_bios list */
208 206
209 struct bio *orig_bios; /* Original bios passed to pkt_make_request */ 207 struct bio_list orig_bios; /* Original bios passed to pkt_make_request */
210 struct bio *orig_bios_tail;/* that will be handled by this packet */ 208 /* that will be handled by this packet */
211 int write_size; /* Total size of all bios in the orig_bios */ 209 int write_size; /* Total size of all bios in the orig_bios */
212 /* list, measured in number of frames */ 210 /* list, measured in number of frames */
213 211
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 779d70749beb..2c9b46cff3d7 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -406,6 +406,11 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
406 n->next->pprev = &n->next; 406 n->next->pprev = &n->next;
407} 407}
408 408
409#define __hlist_for_each_rcu(pos, head) \
410 for (pos = rcu_dereference((head)->first); \
411 pos && ({ prefetch(pos->next); 1; }); \
412 pos = rcu_dereference(pos->next))
413
409/** 414/**
410 * hlist_for_each_entry_rcu - iterate over rcu list of given type 415 * hlist_for_each_entry_rcu - iterate over rcu list of given type
411 * @tpos: the type * to use as a loop cursor. 416 * @tpos: the type * to use as a loop cursor.
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 5c52fa43785c..d1c7c90e9cd4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -362,6 +362,8 @@ enum {
362#define RTAX_FEATURES RTAX_FEATURES 362#define RTAX_FEATURES RTAX_FEATURES
363 RTAX_RTO_MIN, 363 RTAX_RTO_MIN,
364#define RTAX_RTO_MIN RTAX_RTO_MIN 364#define RTAX_RTO_MIN RTAX_RTO_MIN
365 RTAX_INITRWND,
366#define RTAX_INITRWND RTAX_INITRWND
365 __RTAX_MAX 367 __RTAX_MAX
366}; 368};
367 369
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0eef87b58ea5..4b1753f7e48e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -97,7 +97,7 @@ struct sched_param {
97struct exec_domain; 97struct exec_domain;
98struct futex_pi_state; 98struct futex_pi_state;
99struct robust_list_head; 99struct robust_list_head;
100struct bio; 100struct bio_list;
101struct fs_struct; 101struct fs_struct;
102struct bts_context; 102struct bts_context;
103struct perf_event_context; 103struct perf_event_context;
@@ -1454,7 +1454,7 @@ struct task_struct {
1454 void *journal_info; 1454 void *journal_info;
1455 1455
1456/* stacked block device info */ 1456/* stacked block device info */
1457 struct bio *bio_list, **bio_tail; 1457 struct bio_list *bio_list;
1458 1458
1459/* VM state */ 1459/* VM state */
1460 struct reclaim_state *reclaim_state; 1460 struct reclaim_state *reclaim_state;
diff --git a/include/linux/security.h b/include/linux/security.h
index 2c627d361c02..233d20b52c1b 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -76,7 +76,7 @@ extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
76extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp); 76extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp);
77extern int cap_task_setioprio(struct task_struct *p, int ioprio); 77extern int cap_task_setioprio(struct task_struct *p, int ioprio);
78extern int cap_task_setnice(struct task_struct *p, int nice); 78extern int cap_task_setnice(struct task_struct *p, int nice);
79extern int cap_syslog(int type); 79extern int cap_syslog(int type, bool from_file);
80extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); 80extern int cap_vm_enough_memory(struct mm_struct *mm, long pages);
81 81
82struct msghdr; 82struct msghdr;
@@ -95,6 +95,8 @@ struct seq_file;
95extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 95extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
96extern int cap_netlink_recv(struct sk_buff *skb, int cap); 96extern int cap_netlink_recv(struct sk_buff *skb, int cap);
97 97
98void reset_security_ops(void);
99
98#ifdef CONFIG_MMU 100#ifdef CONFIG_MMU
99extern unsigned long mmap_min_addr; 101extern unsigned long mmap_min_addr;
100extern unsigned long dac_mmap_min_addr; 102extern unsigned long dac_mmap_min_addr;
@@ -985,6 +987,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
985 * Check permissions on incoming network packets. This hook is distinct 987 * Check permissions on incoming network packets. This hook is distinct
986 * from Netfilter's IP input hooks since it is the first time that the 988 * from Netfilter's IP input hooks since it is the first time that the
987 * incoming sk_buff @skb has been associated with a particular socket, @sk. 989 * incoming sk_buff @skb has been associated with a particular socket, @sk.
990 * Must not sleep inside this hook because some callers hold spinlocks.
988 * @sk contains the sock (not socket) associated with the incoming sk_buff. 991 * @sk contains the sock (not socket) associated with the incoming sk_buff.
989 * @skb contains the incoming network data. 992 * @skb contains the incoming network data.
990 * @socket_getpeersec_stream: 993 * @socket_getpeersec_stream:
@@ -1348,6 +1351,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1348 * logging to the console. 1351 * logging to the console.
1349 * See the syslog(2) manual page for an explanation of the @type values. 1352 * See the syslog(2) manual page for an explanation of the @type values.
1350 * @type contains the type of action. 1353 * @type contains the type of action.
1354 * @from_file indicates the context of action (if it came from /proc).
1351 * Return 0 if permission is granted. 1355 * Return 0 if permission is granted.
1352 * @settime: 1356 * @settime:
1353 * Check permission to change the system time. 1357 * Check permission to change the system time.
@@ -1462,7 +1466,7 @@ struct security_operations {
1462 int (*sysctl) (struct ctl_table *table, int op); 1466 int (*sysctl) (struct ctl_table *table, int op);
1463 int (*quotactl) (int cmds, int type, int id, struct super_block *sb); 1467 int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
1464 int (*quota_on) (struct dentry *dentry); 1468 int (*quota_on) (struct dentry *dentry);
1465 int (*syslog) (int type); 1469 int (*syslog) (int type, bool from_file);
1466 int (*settime) (struct timespec *ts, struct timezone *tz); 1470 int (*settime) (struct timespec *ts, struct timezone *tz);
1467 int (*vm_enough_memory) (struct mm_struct *mm, long pages); 1471 int (*vm_enough_memory) (struct mm_struct *mm, long pages);
1468 1472
@@ -1761,7 +1765,7 @@ int security_acct(struct file *file);
1761int security_sysctl(struct ctl_table *table, int op); 1765int security_sysctl(struct ctl_table *table, int op);
1762int security_quotactl(int cmds, int type, int id, struct super_block *sb); 1766int security_quotactl(int cmds, int type, int id, struct super_block *sb);
1763int security_quota_on(struct dentry *dentry); 1767int security_quota_on(struct dentry *dentry);
1764int security_syslog(int type); 1768int security_syslog(int type, bool from_file);
1765int security_settime(struct timespec *ts, struct timezone *tz); 1769int security_settime(struct timespec *ts, struct timezone *tz);
1766int security_vm_enough_memory(long pages); 1770int security_vm_enough_memory(long pages);
1767int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); 1771int security_vm_enough_memory_mm(struct mm_struct *mm, long pages);
@@ -2007,9 +2011,9 @@ static inline int security_quota_on(struct dentry *dentry)
2007 return 0; 2011 return 0;
2008} 2012}
2009 2013
2010static inline int security_syslog(int type) 2014static inline int security_syslog(int type, bool from_file)
2011{ 2015{
2012 return cap_syslog(type); 2016 return cap_syslog(type, from_file);
2013} 2017}
2014 2018
2015static inline int security_settime(struct timespec *ts, struct timezone *tz) 2019static inline int security_settime(struct timespec *ts, struct timezone *tz)
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 8366d8f12e53..03c0232b4169 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -135,4 +135,22 @@ extern struct list_head *seq_list_start_head(struct list_head *head,
135extern struct list_head *seq_list_next(void *v, struct list_head *head, 135extern struct list_head *seq_list_next(void *v, struct list_head *head,
136 loff_t *ppos); 136 loff_t *ppos);
137 137
138/*
139 * Helpers for iteration over hlist_head-s in seq_files
140 */
141
142extern struct hlist_node *seq_hlist_start(struct hlist_head *head,
143 loff_t pos);
144extern struct hlist_node *seq_hlist_start_head(struct hlist_head *head,
145 loff_t pos);
146extern struct hlist_node *seq_hlist_next(void *v, struct hlist_head *head,
147 loff_t *ppos);
148
149extern struct hlist_node *seq_hlist_start_rcu(struct hlist_head *head,
150 loff_t pos);
151extern struct hlist_node *seq_hlist_start_head_rcu(struct hlist_head *head,
152 loff_t pos);
153extern struct hlist_node *seq_hlist_next_rcu(void *v,
154 struct hlist_head *head,
155 loff_t *ppos);
138#endif 156#endif
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 813d26c247ec..64b473066b9a 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -30,7 +30,6 @@ struct serio {
30 char phys[32]; 30 char phys[32];
31 31
32 bool manual_bind; 32 bool manual_bind;
33 bool registered; /* port has been fully registered with driver core */
34 33
35 struct serio_device_id id; 34 struct serio_device_id id;
36 35
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ae836fded530..03f816a9b659 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -315,22 +315,23 @@ struct sk_buff {
315 struct sk_buff *next; 315 struct sk_buff *next;
316 struct sk_buff *prev; 316 struct sk_buff *prev;
317 317
318 struct sock *sk;
319 ktime_t tstamp; 318 ktime_t tstamp;
319
320 struct sock *sk;
320 struct net_device *dev; 321 struct net_device *dev;
321 322
322 unsigned long _skb_dst;
323#ifdef CONFIG_XFRM
324 struct sec_path *sp;
325#endif
326 /* 323 /*
327 * This is the control buffer. It is free to use for every 324 * This is the control buffer. It is free to use for every
328 * layer. Please put your private variables there. If you 325 * layer. Please put your private variables there. If you
329 * want to keep them across layers you have to do a skb_clone() 326 * want to keep them across layers you have to do a skb_clone()
330 * first. This is owned by whoever has the skb queued ATM. 327 * first. This is owned by whoever has the skb queued ATM.
331 */ 328 */
332 char cb[48]; 329 char cb[48] __aligned(8);
333 330
331 unsigned long _skb_dst;
332#ifdef CONFIG_XFRM
333 struct sec_path *sp;
334#endif
334 unsigned int len, 335 unsigned int len,
335 data_len; 336 data_len;
336 __u16 mac_len, 337 __u16 mac_len,
@@ -354,8 +355,8 @@ struct sk_buff {
354 ipvs_property:1, 355 ipvs_property:1,
355 peeked:1, 356 peeked:1,
356 nf_trace:1; 357 nf_trace:1;
357 __be16 protocol:16;
358 kmemcheck_bitfield_end(flags1); 358 kmemcheck_bitfield_end(flags1);
359 __be16 protocol;
359 360
360 void (*destructor)(struct sk_buff *skb); 361 void (*destructor)(struct sk_buff *skb);
361#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 362#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
@@ -738,7 +739,7 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
738} 739}
739 740
740/** 741/**
741 * skb_peek 742 * skb_peek - peek at the head of an &sk_buff_head
742 * @list_: list to peek at 743 * @list_: list to peek at
743 * 744 *
744 * Peek an &sk_buff. Unlike most other operations you _MUST_ 745 * Peek an &sk_buff. Unlike most other operations you _MUST_
@@ -759,7 +760,7 @@ static inline struct sk_buff *skb_peek(struct sk_buff_head *list_)
759} 760}
760 761
761/** 762/**
762 * skb_peek_tail 763 * skb_peek_tail - peek at the tail of an &sk_buff_head
763 * @list_: list to peek at 764 * @list_: list to peek at
764 * 765 *
765 * Peek an &sk_buff. Unlike most other operations you _MUST_ 766 * Peek an &sk_buff. Unlike most other operations you _MUST_
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 0f953fe40413..e28f5a0182e8 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -257,6 +257,7 @@ enum
257 LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */ 257 LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */
258 LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ 258 LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */
259 LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ 259 LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */
260 LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/
260 __LINUX_MIB_XFRMMAX 261 __LINUX_MIB_XFRMMAX
261}; 262};
262 263
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 3084f80909cd..4d5ecb222af9 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -33,7 +33,7 @@ struct srcu_struct_array {
33 33
34struct srcu_struct { 34struct srcu_struct {
35 int completed; 35 int completed;
36 struct srcu_struct_array *per_cpu_ref; 36 struct srcu_struct_array __percpu *per_cpu_ref;
37 struct mutex mutex; 37 struct mutex mutex;
38#ifdef CONFIG_DEBUG_LOCK_ALLOC 38#ifdef CONFIG_DEBUG_LOCK_ALLOC
39 struct lockdep_map dep_map; 39 struct lockdep_map dep_map;
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
new file mode 100644
index 000000000000..32bfd1a8a48d
--- /dev/null
+++ b/include/linux/stmmac.h
@@ -0,0 +1,53 @@
1/*******************************************************************************
2
3 Header file for stmmac platform data
4
5 Copyright (C) 2009 STMicroelectronics Ltd
6
7 This program is free software; you can redistribute it and/or modify it
8 under the terms and conditions of the GNU General Public License,
9 version 2, as published by the Free Software Foundation.
10
11 This program is distributed in the hope it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 more details.
15
16 You should have received a copy of the GNU General Public License along with
17 this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19
20 The full GNU General Public License is included in this distribution in
21 the file called "COPYING".
22
23 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
24*******************************************************************************/
25
26#ifndef __STMMAC_PLATFORM_DATA
27#define __STMMAC_PLATFORM_DATA
28
29/* platfrom data for platfrom device structure's platfrom_data field */
30
31/* Private data for the STM on-board ethernet driver */
32struct plat_stmmacenet_data {
33 int bus_id;
34 int pbl;
35 int has_gmac;
36 void (*fix_mac_speed)(void *priv, unsigned int speed);
37 void (*bus_setup)(unsigned long ioaddr);
38#ifdef CONFIG_STM_DRIVERS
39 struct stm_pad_config *pad_config;
40#endif
41 void *bsp_priv;
42};
43
44struct plat_stmmacphy_data {
45 int bus_id;
46 int phy_addr;
47 unsigned int phy_mask;
48 int interface;
49 int (*phy_reset)(void *priv);
50 void *priv;
51};
52#endif
53
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index bd27fbc9db62..f66014c90c9f 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -481,9 +481,6 @@ enum
481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20, 481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
482 NET_IPV4_CONF_ARP_ACCEPT=21, 482 NET_IPV4_CONF_ARP_ACCEPT=21,
483 NET_IPV4_CONF_ARP_NOTIFY=22, 483 NET_IPV4_CONF_ARP_NOTIFY=22,
484 NET_IPV4_CONF_ACCEPT_LOCAL=23,
485 NET_IPV4_CONF_SRC_VMARK=24,
486 __NET_IPV4_CONF_MAX
487}; 484};
488 485
489/* /proc/sys/net/ipv4/netfilter */ 486/* /proc/sys/net/ipv4/netfilter */
@@ -599,7 +596,6 @@ enum {
599 NET_NEIGH_GC_THRESH3=16, 596 NET_NEIGH_GC_THRESH3=16,
600 NET_NEIGH_RETRANS_TIME_MS=17, 597 NET_NEIGH_RETRANS_TIME_MS=17,
601 NET_NEIGH_REACHABLE_TIME_MS=18, 598 NET_NEIGH_REACHABLE_TIME_MS=18,
602 __NET_NEIGH_MAX
603}; 599};
604 600
605/* /proc/sys/net/dccp */ 601/* /proc/sys/net/dccp */
diff --git a/include/linux/syslog.h b/include/linux/syslog.h
new file mode 100644
index 000000000000..38911391a139
--- /dev/null
+++ b/include/linux/syslog.h
@@ -0,0 +1,52 @@
1/* Syslog internals
2 *
3 * Copyright 2010 Canonical, Ltd.
4 * Author: Kees Cook <kees.cook@canonical.com>
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 as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _LINUX_SYSLOG_H
22#define _LINUX_SYSLOG_H
23
24/* Close the log. Currently a NOP. */
25#define SYSLOG_ACTION_CLOSE 0
26/* Open the log. Currently a NOP. */
27#define SYSLOG_ACTION_OPEN 1
28/* Read from the log. */
29#define SYSLOG_ACTION_READ 2
30/* Read all messages remaining in the ring buffer. */
31#define SYSLOG_ACTION_READ_ALL 3
32/* Read and clear all messages remaining in the ring buffer */
33#define SYSLOG_ACTION_READ_CLEAR 4
34/* Clear ring buffer. */
35#define SYSLOG_ACTION_CLEAR 5
36/* Disable printk's to console */
37#define SYSLOG_ACTION_CONSOLE_OFF 6
38/* Enable printk's to console */
39#define SYSLOG_ACTION_CONSOLE_ON 7
40/* Set level of messages printed to console */
41#define SYSLOG_ACTION_CONSOLE_LEVEL 8
42/* Return number of unread characters in the log buffer */
43#define SYSLOG_ACTION_SIZE_UNREAD 9
44/* Return size of the log buffer */
45#define SYSLOG_ACTION_SIZE_BUFFER 10
46
47#define SYSLOG_FROM_CALL 0
48#define SYSLOG_FROM_FILE 1
49
50int do_syslog(int type, char __user *buf, int count, bool from_file);
51
52#endif /* _LINUX_SYSLOG_H */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 7fee8a4df931..a778ee024590 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -103,6 +103,8 @@ enum {
103#define TCP_CONGESTION 13 /* Congestion control algorithm */ 103#define TCP_CONGESTION 13 /* Congestion control algorithm */
104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ 104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ 105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
106 108
107/* for TCP_INFO socket option */ 109/* for TCP_INFO socket option */
108#define TCPI_OPT_TIMESTAMPS 1 110#define TCPI_OPT_TIMESTAMPS 1
@@ -340,7 +342,10 @@ struct tcp_sock {
340 u32 frto_highmark; /* snd_nxt when RTO occurred */ 342 u32 frto_highmark; /* snd_nxt when RTO occurred */
341 u16 advmss; /* Advertised MSS */ 343 u16 advmss; /* Advertised MSS */
342 u8 frto_counter; /* Number of new acks after RTO */ 344 u8 frto_counter; /* Number of new acks after RTO */
343 u8 nonagle; /* Disable Nagle algorithm? */ 345 u8 nonagle : 4,/* Disable Nagle algorithm? */
346 thin_lto : 1,/* Use linear timeouts for thin streams */
347 thin_dupack : 1,/* Fast retransmit on first dupack */
348 unused : 2;
344 349
345/* RTT measurement */ 350/* RTT measurement */
346 u32 srtt; /* smoothed round trip time << 3 */ 351 u32 srtt; /* smoothed round trip time << 3 */
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 94f8faecdcbc..7a082b32d8e1 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -238,9 +238,6 @@ extern int tickadj; /* amount of adjustment per tick */
238 * phase-lock loop variables 238 * phase-lock loop variables
239 */ 239 */
240extern int time_status; /* clock synchronization status bits */ 240extern int time_status; /* clock synchronization status bits */
241extern long time_maxerror; /* maximum error */
242extern long time_esterror; /* estimated error */
243
244extern long time_adjust; /* The amount of adjtime left */ 241extern long time_adjust; /* The amount of adjtime left */
245 242
246extern void ntp_init(void); 243extern void ntp_init(void);
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
index eaf9dffe0a01..6bb293684eb8 100644
--- a/include/linux/usb/audio.h
+++ b/include/linux/usb/audio.h
@@ -25,6 +25,9 @@
25#define USB_SUBCLASS_AUDIOSTREAMING 0x02 25#define USB_SUBCLASS_AUDIOSTREAMING 0x02
26#define USB_SUBCLASS_MIDISTREAMING 0x03 26#define USB_SUBCLASS_MIDISTREAMING 0x03
27 27
28#define UAC_VERSION_1 0x00
29#define UAC_VERSION_2 0x20
30
28/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ 31/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
29#define UAC_HEADER 0x01 32#define UAC_HEADER 0x01
30#define UAC_INPUT_TERMINAL 0x02 33#define UAC_INPUT_TERMINAL 0x02
@@ -32,8 +35,17 @@
32#define UAC_MIXER_UNIT 0x04 35#define UAC_MIXER_UNIT 0x04
33#define UAC_SELECTOR_UNIT 0x05 36#define UAC_SELECTOR_UNIT 0x05
34#define UAC_FEATURE_UNIT 0x06 37#define UAC_FEATURE_UNIT 0x06
35#define UAC_PROCESSING_UNIT 0x07 38#define UAC_PROCESSING_UNIT_V1 0x07
36#define UAC_EXTENSION_UNIT 0x08 39#define UAC_EXTENSION_UNIT_V1 0x08
40
41/* UAC v2.0 types */
42#define UAC_EFFECT_UNIT 0x07
43#define UAC_PROCESSING_UNIT_V2 0x08
44#define UAC_EXTENSION_UNIT_V2 0x09
45#define UAC_CLOCK_SOURCE 0x0a
46#define UAC_CLOCK_SELECTOR 0x0b
47#define UAC_CLOCK_MULTIPLIER 0x0c
48#define UAC_SAMPLE_RATE_CONVERTER 0x0d
37 49
38/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ 50/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
39#define UAC_AS_GENERAL 0x01 51#define UAC_AS_GENERAL 0x01
@@ -66,6 +78,10 @@
66 78
67#define UAC_GET_STAT 0xff 79#define UAC_GET_STAT 0xff
68 80
81/* Audio class v2.0 handles all the parameter calls differently */
82#define UAC2_CS_CUR 0x01
83#define UAC2_CS_RANGE 0x02
84
69/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ 85/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
70#define UAC_MS_HEADER 0x01 86#define UAC_MS_HEADER 0x01
71#define UAC_MIDI_IN_JACK 0x02 87#define UAC_MIDI_IN_JACK 0x02
@@ -81,7 +97,7 @@
81 97
82/* Terminal Control Selectors */ 98/* Terminal Control Selectors */
83/* 4.3.2 Class-Specific AC Interface Descriptor */ 99/* 4.3.2 Class-Specific AC Interface Descriptor */
84struct uac_ac_header_descriptor { 100struct uac_ac_header_descriptor_v1 {
85 __u8 bLength; /* 8 + n */ 101 __u8 bLength; /* 8 + n */
86 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 102 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
87 __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ 103 __u8 bDescriptorSubtype; /* UAC_MS_HEADER */
@@ -95,7 +111,7 @@ struct uac_ac_header_descriptor {
95 111
96/* As above, but more useful for defining your own descriptors: */ 112/* As above, but more useful for defining your own descriptors: */
97#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ 113#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \
98struct uac_ac_header_descriptor_##n { \ 114struct uac_ac_header_descriptor_v1_##n { \
99 __u8 bLength; \ 115 __u8 bLength; \
100 __u8 bDescriptorType; \ 116 __u8 bDescriptorType; \
101 __u8 bDescriptorSubtype; \ 117 __u8 bDescriptorSubtype; \
@@ -130,8 +146,12 @@ struct uac_input_terminal_descriptor {
130#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 146#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205
131#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 147#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206
132 148
149/* Terminals - control selectors */
150
151#define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01
152
133/* 4.3.2.2 Output Terminal Descriptor */ 153/* 4.3.2.2 Output Terminal Descriptor */
134struct uac_output_terminal_descriptor { 154struct uac_output_terminal_descriptor_v1 {
135 __u8 bLength; /* in bytes: 9 */ 155 __u8 bLength; /* in bytes: 9 */
136 __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ 156 __u8 bDescriptorType; /* CS_INTERFACE descriptor type */
137 __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ 157 __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */
@@ -171,7 +191,7 @@ struct uac_feature_unit_descriptor_##ch { \
171} __attribute__ ((packed)) 191} __attribute__ ((packed))
172 192
173/* 4.5.2 Class-Specific AS Interface Descriptor */ 193/* 4.5.2 Class-Specific AS Interface Descriptor */
174struct uac_as_header_descriptor { 194struct uac_as_header_descriptor_v1 {
175 __u8 bLength; /* in bytes: 7 */ 195 __u8 bLength; /* in bytes: 7 */
176 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 196 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
177 __u8 bDescriptorSubtype; /* AS_GENERAL */ 197 __u8 bDescriptorSubtype; /* AS_GENERAL */
@@ -180,6 +200,19 @@ struct uac_as_header_descriptor {
180 __le16 wFormatTag; /* The Audio Data Format */ 200 __le16 wFormatTag; /* The Audio Data Format */
181} __attribute__ ((packed)); 201} __attribute__ ((packed));
182 202
203struct uac_as_header_descriptor_v2 {
204 __u8 bLength;
205 __u8 bDescriptorType;
206 __u8 bDescriptorSubtype;
207 __u8 bTerminalLink;
208 __u8 bmControls;
209 __u8 bFormatType;
210 __u32 bmFormats;
211 __u8 bNrChannels;
212 __u32 bmChannelConfig;
213 __u8 iChannelNames;
214} __attribute__((packed));
215
183#define UAC_DT_AS_HEADER_SIZE 7 216#define UAC_DT_AS_HEADER_SIZE 7
184 217
185/* Formats - A.1.1 Audio Data Format Type I Codes */ 218/* Formats - A.1.1 Audio Data Format Type I Codes */
@@ -232,11 +265,62 @@ struct uac_format_type_i_discrete_descriptor_##n { \
232 265
233#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) 266#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3))
234 267
268struct uac_format_type_i_ext_descriptor {
269 __u8 bLength;
270 __u8 bDescriptorType;
271 __u8 bDescriptorSubtype;
272 __u8 bSubslotSize;
273 __u8 bFormatType;
274 __u8 bBitResolution;
275 __u8 bHeaderLength;
276 __u8 bControlSize;
277 __u8 bSideBandProtocol;
278} __attribute__((packed));
279
280
281/* Formats - Audio Data Format Type I Codes */
282
283#define UAC_FORMAT_TYPE_II_MPEG 0x1001
284#define UAC_FORMAT_TYPE_II_AC3 0x1002
285
286struct uac_format_type_ii_discrete_descriptor {
287 __u8 bLength;
288 __u8 bDescriptorType;
289 __u8 bDescriptorSubtype;
290 __u8 bFormatType;
291 __le16 wMaxBitRate;
292 __le16 wSamplesPerFrame;
293 __u8 bSamFreqType;
294 __u8 tSamFreq[][3];
295} __attribute__((packed));
296
297struct uac_format_type_ii_ext_descriptor {
298 __u8 bLength;
299 __u8 bDescriptorType;
300 __u8 bDescriptorSubtype;
301 __u8 bFormatType;
302 __u16 wMaxBitRate;
303 __u16 wSamplesPerFrame;
304 __u8 bHeaderLength;
305 __u8 bSideBandProtocol;
306} __attribute__((packed));
307
308/* type III */
309#define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001
310#define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002
311#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003
312#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004
313#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005
314#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006
315
235/* Formats - A.2 Format Type Codes */ 316/* Formats - A.2 Format Type Codes */
236#define UAC_FORMAT_TYPE_UNDEFINED 0x0 317#define UAC_FORMAT_TYPE_UNDEFINED 0x0
237#define UAC_FORMAT_TYPE_I 0x1 318#define UAC_FORMAT_TYPE_I 0x1
238#define UAC_FORMAT_TYPE_II 0x2 319#define UAC_FORMAT_TYPE_II 0x2
239#define UAC_FORMAT_TYPE_III 0x3 320#define UAC_FORMAT_TYPE_III 0x3
321#define UAC_EXT_FORMAT_TYPE_I 0x81
322#define UAC_EXT_FORMAT_TYPE_II 0x82
323#define UAC_EXT_FORMAT_TYPE_III 0x83
240 324
241struct uac_iso_endpoint_descriptor { 325struct uac_iso_endpoint_descriptor {
242 __u8 bLength; /* in bytes: 7 */ 326 __u8 bLength; /* in bytes: 7 */
@@ -252,7 +336,31 @@ struct uac_iso_endpoint_descriptor {
252#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 336#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
253#define UAC_EP_CS_ATTR_FILL_MAX 0x80 337#define UAC_EP_CS_ATTR_FILL_MAX 0x80
254 338
339/* Audio class v2.0: CLOCK_SOURCE descriptor */
340
341struct uac_clock_source_descriptor {
342 __u8 bLength;
343 __u8 bDescriptorType;
344 __u8 bDescriptorSubtype;
345 __u8 bClockID;
346 __u8 bmAttributes;
347 __u8 bmControls;
348 __u8 bAssocTerminal;
349 __u8 iClockSource;
350} __attribute__((packed));
351
255/* A.10.2 Feature Unit Control Selectors */ 352/* A.10.2 Feature Unit Control Selectors */
353
354struct uac_feature_unit_descriptor {
355 __u8 bLength;
356 __u8 bDescriptorType;
357 __u8 bDescriptorSubtype;
358 __u8 bUnitID;
359 __u8 bSourceID;
360 __u8 bControlSize;
361 __u8 controls[0]; /* variable length */
362} __attribute__((packed));
363
256#define UAC_FU_CONTROL_UNDEFINED 0x00 364#define UAC_FU_CONTROL_UNDEFINED 0x00
257#define UAC_MUTE_CONTROL 0x01 365#define UAC_MUTE_CONTROL 0x01
258#define UAC_VOLUME_CONTROL 0x02 366#define UAC_VOLUME_CONTROL 0x02
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index d43755669261..5dc2f227a0f1 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -84,6 +84,9 @@ struct musb_hdrc_platform_data {
84 84
85 /* MUSB configuration-specific details */ 85 /* MUSB configuration-specific details */
86 struct musb_hdrc_config *config; 86 struct musb_hdrc_config *config;
87
88 /* Architecture specific board data */
89 void *board_data;
87}; 90};
88 91
89 92
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 52bb917641f0..fef0972c8146 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -110,9 +110,19 @@ struct otg_transceiver {
110/* for board-specific init logic */ 110/* for board-specific init logic */
111extern int otg_set_transceiver(struct otg_transceiver *); 111extern int otg_set_transceiver(struct otg_transceiver *);
112 112
113#if defined(CONFIG_NOP_USB_XCEIV) || defined(CONFIG_NOP_USB_XCEIV_MODULE)
113/* sometimes transceivers are accessed only through e.g. ULPI */ 114/* sometimes transceivers are accessed only through e.g. ULPI */
114extern void usb_nop_xceiv_register(void); 115extern void usb_nop_xceiv_register(void);
115extern void usb_nop_xceiv_unregister(void); 116extern void usb_nop_xceiv_unregister(void);
117#else
118static inline void usb_nop_xceiv_register(void)
119{
120}
121
122static inline void usb_nop_xceiv_unregister(void)
123{
124}
125#endif
116 126
117/* helpers for direct access thru low-level io interface */ 127/* helpers for direct access thru low-level io interface */
118static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) 128static inline int otg_io_read(struct otg_transceiver *otg, u32 reg)
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 8ce61359bf73..df1e83dd9a54 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -214,25 +214,4 @@ extern void usbnet_set_msglevel (struct net_device *, u32);
214extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); 214extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *);
215extern int usbnet_nway_reset(struct net_device *net); 215extern int usbnet_nway_reset(struct net_device *net);
216 216
217/* messaging support includes the interface name, so it must not be
218 * used before it has one ... notably, in minidriver bind() calls.
219 */
220#ifdef DEBUG
221#define devdbg(usbnet, fmt, arg...) \
222 printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
223#else
224#define devdbg(usbnet, fmt, arg...) \
225 ({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \
226 ## arg); 0; })
227#endif
228
229#define deverr(usbnet, fmt, arg...) \
230 printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
231#define devwarn(usbnet, fmt, arg...) \
232 printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
233
234#define devinfo(usbnet, fmt, arg...) \
235 printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg); \
236
237
238#endif /* __LINUX_USB_USBNET_H */ 217#endif /* __LINUX_USB_USBNET_H */
diff --git a/include/linux/vhost.h b/include/linux/vhost.h
new file mode 100644
index 000000000000..e847f1e30756
--- /dev/null
+++ b/include/linux/vhost.h
@@ -0,0 +1,130 @@
1#ifndef _LINUX_VHOST_H
2#define _LINUX_VHOST_H
3/* Userspace interface for in-kernel virtio accelerators. */
4
5/* vhost is used to reduce the number of system calls involved in virtio.
6 *
7 * Existing virtio net code is used in the guest without modification.
8 *
9 * This header includes interface used by userspace hypervisor for
10 * device configuration.
11 */
12
13#include <linux/types.h>
14#include <linux/compiler.h>
15#include <linux/ioctl.h>
16#include <linux/virtio_config.h>
17#include <linux/virtio_ring.h>
18
19struct vhost_vring_state {
20 unsigned int index;
21 unsigned int num;
22};
23
24struct vhost_vring_file {
25 unsigned int index;
26 int fd; /* Pass -1 to unbind from file. */
27
28};
29
30struct vhost_vring_addr {
31 unsigned int index;
32 /* Option flags. */
33 unsigned int flags;
34 /* Flag values: */
35 /* Whether log address is valid. If set enables logging. */
36#define VHOST_VRING_F_LOG 0
37
38 /* Start of array of descriptors (virtually contiguous) */
39 __u64 desc_user_addr;
40 /* Used structure address. Must be 32 bit aligned */
41 __u64 used_user_addr;
42 /* Available structure address. Must be 16 bit aligned */
43 __u64 avail_user_addr;
44 /* Logging support. */
45 /* Log writes to used structure, at offset calculated from specified
46 * address. Address must be 32 bit aligned. */
47 __u64 log_guest_addr;
48};
49
50struct vhost_memory_region {
51 __u64 guest_phys_addr;
52 __u64 memory_size; /* bytes */
53 __u64 userspace_addr;
54 __u64 flags_padding; /* No flags are currently specified. */
55};
56
57/* All region addresses and sizes must be 4K aligned. */
58#define VHOST_PAGE_SIZE 0x1000
59
60struct vhost_memory {
61 __u32 nregions;
62 __u32 padding;
63 struct vhost_memory_region regions[0];
64};
65
66/* ioctls */
67
68#define VHOST_VIRTIO 0xAF
69
70/* Features bitmask for forward compatibility. Transport bits are used for
71 * vhost specific features. */
72#define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, __u64)
73#define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, __u64)
74
75/* Set current process as the (exclusive) owner of this file descriptor. This
76 * must be called before any other vhost command. Further calls to
77 * VHOST_OWNER_SET fail until VHOST_OWNER_RESET is called. */
78#define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01)
79/* Give up ownership, and reset the device to default values.
80 * Allows subsequent call to VHOST_OWNER_SET to succeed. */
81#define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02)
82
83/* Set up/modify memory layout */
84#define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory)
85
86/* Write logging setup. */
87/* Memory writes can optionally be logged by setting bit at an offset
88 * (calculated from the physical address) from specified log base.
89 * The bit is set using an atomic 32 bit operation. */
90/* Set base address for logging. */
91#define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64)
92/* Specify an eventfd file descriptor to signal on log write. */
93#define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int)
94
95/* Ring setup. */
96/* Set number of descriptors in ring. This parameter can not
97 * be modified while ring is running (bound to a device). */
98#define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, struct vhost_vring_state)
99/* Set addresses for the ring. */
100#define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, struct vhost_vring_addr)
101/* Base value where queue looks for available descriptors */
102#define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
103/* Get accessor: reads index, writes value in num */
104#define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
105
106/* The following ioctls use eventfd file descriptors to signal and poll
107 * for events. */
108
109/* Set eventfd to poll for added buffers */
110#define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, struct vhost_vring_file)
111/* Set eventfd to signal when buffers have beed used */
112#define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, struct vhost_vring_file)
113/* Set eventfd to signal an error */
114#define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, struct vhost_vring_file)
115
116/* VHOST_NET specific defines */
117
118/* Attach virtio net ring to a raw socket, or tap device.
119 * The socket must be already bound to an ethernet device, this device will be
120 * used for transmit. Pass fd -1 to unbind from the socket and the transmit
121 * device. This can be used to stop the ring (e.g. for migration). */
122#define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file)
123
124/* Feature bits */
125/* Log all write descriptors. Can be changed while device is active. */
126#define VHOST_F_LOG_ALL 26
127/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
128#define VHOST_NET_F_VIRTIO_NET_HDR 27
129
130#endif
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index ee03bba9c5df..117f0dd8ad03 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -78,22 +78,22 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
78 78
79static inline void __count_vm_event(enum vm_event_item item) 79static inline void __count_vm_event(enum vm_event_item item)
80{ 80{
81 __this_cpu_inc(per_cpu_var(vm_event_states).event[item]); 81 __this_cpu_inc(vm_event_states.event[item]);
82} 82}
83 83
84static inline void count_vm_event(enum vm_event_item item) 84static inline void count_vm_event(enum vm_event_item item)
85{ 85{
86 this_cpu_inc(per_cpu_var(vm_event_states).event[item]); 86 this_cpu_inc(vm_event_states.event[item]);
87} 87}
88 88
89static inline void __count_vm_events(enum vm_event_item item, long delta) 89static inline void __count_vm_events(enum vm_event_item item, long delta)
90{ 90{
91 __this_cpu_add(per_cpu_var(vm_event_states).event[item], delta); 91 __this_cpu_add(vm_event_states.event[item], delta);
92} 92}
93 93
94static inline void count_vm_events(enum vm_event_item item, long delta) 94static inline void count_vm_events(enum vm_event_item item, long delta)
95{ 95{
96 this_cpu_add(per_cpu_var(vm_event_states).event[item], delta); 96 this_cpu_add(vm_event_states.event[item], delta);
97} 97}
98 98
99extern void all_vm_events(unsigned long *); 99extern void all_vm_events(unsigned long *);
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 29e04beb1fc9..b971e3848493 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -267,8 +267,8 @@ enum xfrm_attr_type_t {
267 XFRMA_ALG_COMP, /* struct xfrm_algo */ 267 XFRMA_ALG_COMP, /* struct xfrm_algo */
268 XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ 268 XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */
269 XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ 269 XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */
270 XFRMA_SA, 270 XFRMA_SA, /* struct xfrm_usersa_info */
271 XFRMA_POLICY, 271 XFRMA_POLICY, /*struct xfrm_userpolicy_info */
272 XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ 272 XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */
273 XFRMA_LTIME_VAL, 273 XFRMA_LTIME_VAL,
274 XFRMA_REPLAY_VAL, 274 XFRMA_REPLAY_VAL,
@@ -276,17 +276,23 @@ enum xfrm_attr_type_t {
276 XFRMA_ETIMER_THRESH, 276 XFRMA_ETIMER_THRESH,
277 XFRMA_SRCADDR, /* xfrm_address_t */ 277 XFRMA_SRCADDR, /* xfrm_address_t */
278 XFRMA_COADDR, /* xfrm_address_t */ 278 XFRMA_COADDR, /* xfrm_address_t */
279 XFRMA_LASTUSED, 279 XFRMA_LASTUSED, /* unsigned long */
280 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ 280 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
281 XFRMA_MIGRATE, 281 XFRMA_MIGRATE,
282 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ 282 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */
283 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ 283 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */
284 XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ 284 XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */
285 XFRMA_MARK, /* struct xfrm_mark */
285 __XFRMA_MAX 286 __XFRMA_MAX
286 287
287#define XFRMA_MAX (__XFRMA_MAX - 1) 288#define XFRMA_MAX (__XFRMA_MAX - 1)
288}; 289};
289 290
291struct xfrm_mark {
292 __u32 v; /* value */
293 __u32 m; /* mask */
294};
295
290enum xfrm_sadattr_type_t { 296enum xfrm_sadattr_type_t {
291 XFRMA_SAD_UNSPEC, 297 XFRMA_SAD_UNSPEC,
292 XFRMA_SAD_CNT, 298 XFRMA_SAD_CNT,
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index ed3aea1605e8..fc0c502d9fd1 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -43,7 +43,7 @@
43#define HCI_NOTIFY_CONN_DEL 2 43#define HCI_NOTIFY_CONN_DEL 2
44#define HCI_NOTIFY_VOICE_SETTING 3 44#define HCI_NOTIFY_VOICE_SETTING 3
45 45
46/* HCI device types */ 46/* HCI bus types */
47#define HCI_VIRTUAL 0 47#define HCI_VIRTUAL 0
48#define HCI_USB 1 48#define HCI_USB 1
49#define HCI_PCCARD 2 49#define HCI_PCCARD 2
@@ -52,6 +52,10 @@
52#define HCI_PCI 5 52#define HCI_PCI 5
53#define HCI_SDIO 6 53#define HCI_SDIO 6
54 54
55/* HCI controller types */
56#define HCI_BREDR 0x00
57#define HCI_80211 0x01
58
55/* HCI device quirks */ 59/* HCI device quirks */
56enum { 60enum {
57 HCI_QUIRK_NO_RESET, 61 HCI_QUIRK_NO_RESET,
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 7b86094a894b..ce3c99e5fa25 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -70,7 +70,8 @@ struct hci_dev {
70 char name[8]; 70 char name[8];
71 unsigned long flags; 71 unsigned long flags;
72 __u16 id; 72 __u16 id;
73 __u8 type; 73 __u8 bus;
74 __u8 dev_type;
74 bdaddr_t bdaddr; 75 bdaddr_t bdaddr;
75 __u8 dev_name[248]; 76 __u8 dev_name[248];
76 __u8 dev_class[3]; 77 __u8 dev_class[3];
@@ -134,6 +135,8 @@ struct hci_dev {
134 135
135 atomic_t promisc; 136 atomic_t promisc;
136 137
138 struct dentry *debugfs;
139
137 struct device *parent; 140 struct device *parent;
138 struct device dev; 141 struct device dev;
139 142
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0884b9a0f778..3d134a1fb96b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3,7 +3,7 @@
3/* 3/*
4 * 802.11 device and configuration interface 4 * 802.11 device and configuration interface
5 * 5 *
6 * Copyright 2006-2009 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -39,8 +39,8 @@
39 * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) 39 * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7)
40 */ 40 */
41enum ieee80211_band { 41enum ieee80211_band {
42 IEEE80211_BAND_2GHZ, 42 IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
43 IEEE80211_BAND_5GHZ, 43 IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
44 44
45 /* keep last */ 45 /* keep last */
46 IEEE80211_NUM_BANDS 46 IEEE80211_NUM_BANDS
@@ -626,8 +626,14 @@ enum cfg80211_signal_type {
626 * @beacon_interval: the beacon interval as from the frame 626 * @beacon_interval: the beacon interval as from the frame
627 * @capability: the capability field in host byte order 627 * @capability: the capability field in host byte order
628 * @information_elements: the information elements (Note that there 628 * @information_elements: the information elements (Note that there
629 * is no guarantee that these are well-formed!) 629 * is no guarantee that these are well-formed!); this is a pointer to
630 * either the beacon_ies or proberesp_ies depending on whether Probe
631 * Response frame has been received
630 * @len_information_elements: total length of the information elements 632 * @len_information_elements: total length of the information elements
633 * @beacon_ies: the information elements from the last Beacon frame
634 * @len_beacon_ies: total length of the beacon_ies
635 * @proberesp_ies: the information elements from the last Probe Response frame
636 * @len_proberesp_ies: total length of the proberesp_ies
631 * @signal: signal strength value (type depends on the wiphy's signal_type) 637 * @signal: signal strength value (type depends on the wiphy's signal_type)
632 * @free_priv: function pointer to free private data 638 * @free_priv: function pointer to free private data
633 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes 639 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
@@ -641,6 +647,10 @@ struct cfg80211_bss {
641 u16 capability; 647 u16 capability;
642 u8 *information_elements; 648 u8 *information_elements;
643 size_t len_information_elements; 649 size_t len_information_elements;
650 u8 *beacon_ies;
651 size_t len_beacon_ies;
652 u8 *proberesp_ies;
653 size_t len_proberesp_ies;
644 654
645 s32 signal; 655 s32 signal;
646 656
@@ -837,6 +847,7 @@ enum wiphy_params_flags {
837 WIPHY_PARAM_RETRY_LONG = 1 << 1, 847 WIPHY_PARAM_RETRY_LONG = 1 << 1,
838 WIPHY_PARAM_FRAG_THRESHOLD = 1 << 2, 848 WIPHY_PARAM_FRAG_THRESHOLD = 1 << 2,
839 WIPHY_PARAM_RTS_THRESHOLD = 1 << 3, 849 WIPHY_PARAM_RTS_THRESHOLD = 1 << 3,
850 WIPHY_PARAM_COVERAGE_CLASS = 1 << 4,
840}; 851};
841 852
842/** 853/**
@@ -856,20 +867,11 @@ enum tx_power_setting {
856 * cfg80211_bitrate_mask - masks for bitrate control 867 * cfg80211_bitrate_mask - masks for bitrate control
857 */ 868 */
858struct cfg80211_bitrate_mask { 869struct cfg80211_bitrate_mask {
859/*
860 * As discussed in Berlin, this struct really
861 * should look like this:
862
863 struct { 870 struct {
864 u32 legacy; 871 u32 legacy;
865 u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; 872 /* TODO: add support for masking MCS rates; e.g.: */
873 /* u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; */
866 } control[IEEE80211_NUM_BANDS]; 874 } control[IEEE80211_NUM_BANDS];
867
868 * Since we can always fix in-kernel users, let's keep
869 * it simpler for now:
870 */
871 u32 fixed; /* fixed bitrate, 0 == not fixed */
872 u32 maxrate; /* in kbps, 0 == no limit */
873}; 875};
874/** 876/**
875 * struct cfg80211_pmksa - PMK Security Association 877 * struct cfg80211_pmksa - PMK Security Association
@@ -988,6 +990,16 @@ struct cfg80211_pmksa {
988 * 990 *
989 * @dump_survey: get site survey information. 991 * @dump_survey: get site survey information.
990 * 992 *
993 * @remain_on_channel: Request the driver to remain awake on the specified
994 * channel for the specified duration to complete an off-channel
995 * operation (e.g., public action frame exchange). When the driver is
996 * ready on the requested channel, it must indicate this with an event
997 * notification by calling cfg80211_ready_on_channel().
998 * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation.
999 * This allows the operation to be terminated prior to timeout based on
1000 * the duration value.
1001 * @action: Transmit an action frame
1002 *
991 * @testmode_cmd: run a test mode command 1003 * @testmode_cmd: run a test mode command
992 * 1004 *
993 * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac 1005 * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac
@@ -1123,7 +1135,21 @@ struct cfg80211_ops {
1123 struct cfg80211_pmksa *pmksa); 1135 struct cfg80211_pmksa *pmksa);
1124 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev); 1136 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev);
1125 1137
1126 /* some temporary stuff to finish wext */ 1138 int (*remain_on_channel)(struct wiphy *wiphy,
1139 struct net_device *dev,
1140 struct ieee80211_channel *chan,
1141 enum nl80211_channel_type channel_type,
1142 unsigned int duration,
1143 u64 *cookie);
1144 int (*cancel_remain_on_channel)(struct wiphy *wiphy,
1145 struct net_device *dev,
1146 u64 cookie);
1147
1148 int (*action)(struct wiphy *wiphy, struct net_device *dev,
1149 struct ieee80211_channel *chan,
1150 enum nl80211_channel_type channel_type,
1151 const u8 *buf, size_t len, u64 *cookie);
1152
1127 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, 1153 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1128 bool enabled, int timeout); 1154 bool enabled, int timeout);
1129}; 1155};
@@ -1174,6 +1200,10 @@ enum wiphy_flags {
1174 WIPHY_FLAG_4ADDR_STATION = BIT(6), 1200 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1175}; 1201};
1176 1202
1203struct mac_address {
1204 u8 addr[ETH_ALEN];
1205};
1206
1177/** 1207/**
1178 * struct wiphy - wireless hardware description 1208 * struct wiphy - wireless hardware description
1179 * @idx: the wiphy index assigned to this item 1209 * @idx: the wiphy index assigned to this item
@@ -1192,12 +1222,28 @@ enum wiphy_flags {
1192 * -1 = fragmentation disabled, only odd values >= 256 used 1222 * -1 = fragmentation disabled, only odd values >= 256 used
1193 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled 1223 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
1194 * @net: the network namespace this wiphy currently lives in 1224 * @net: the network namespace this wiphy currently lives in
1225 * @perm_addr: permanent MAC address of this device
1226 * @addr_mask: If the device supports multiple MAC addresses by masking,
1227 * set this to a mask with variable bits set to 1, e.g. if the last
1228 * four bits are variable then set it to 00:...:00:0f. The actual
1229 * variable bits shall be determined by the interfaces added, with
1230 * interfaces not matching the mask being rejected to be brought up.
1231 * @n_addresses: number of addresses in @addresses.
1232 * @addresses: If the device has more than one address, set this pointer
1233 * to a list of addresses (6 bytes each). The first one will be used
1234 * by default for perm_addr. In this case, the mask should be set to
1235 * all-zeroes. In this case it is assumed that the device can handle
1236 * the same number of arbitrary MAC addresses.
1195 */ 1237 */
1196struct wiphy { 1238struct wiphy {
1197 /* assign these fields before you register the wiphy */ 1239 /* assign these fields before you register the wiphy */
1198 1240
1199 /* permanent MAC address */ 1241 /* permanent MAC address(es) */
1200 u8 perm_addr[ETH_ALEN]; 1242 u8 perm_addr[ETH_ALEN];
1243 u8 addr_mask[ETH_ALEN];
1244
1245 u16 n_addresses;
1246 struct mac_address *addresses;
1201 1247
1202 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1248 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
1203 u16 interface_modes; 1249 u16 interface_modes;
@@ -1217,6 +1263,7 @@ struct wiphy {
1217 u8 retry_long; 1263 u8 retry_long;
1218 u32 frag_threshold; 1264 u32 frag_threshold;
1219 u32 rts_threshold; 1265 u32 rts_threshold;
1266 u8 coverage_class;
1220 1267
1221 char fw_version[ETHTOOL_BUSINFO_LEN]; 1268 char fw_version[ETHTOOL_BUSINFO_LEN];
1222 u32 hw_version; 1269 u32 hw_version;
@@ -1403,6 +1450,8 @@ struct cfg80211_cached_keys;
1403 * set by driver (if supported) on add_interface BEFORE registering the 1450 * set by driver (if supported) on add_interface BEFORE registering the
1404 * netdev and may otherwise be used by driver read-only, will be update 1451 * netdev and may otherwise be used by driver read-only, will be update
1405 * by cfg80211 on change_interface 1452 * by cfg80211 on change_interface
1453 * @action_registrations: list of registrations for action frames
1454 * @action_registrations_lock: lock for the list
1406 */ 1455 */
1407struct wireless_dev { 1456struct wireless_dev {
1408 struct wiphy *wiphy; 1457 struct wiphy *wiphy;
@@ -1412,6 +1461,9 @@ struct wireless_dev {
1412 struct list_head list; 1461 struct list_head list;
1413 struct net_device *netdev; 1462 struct net_device *netdev;
1414 1463
1464 struct list_head action_registrations;
1465 spinlock_t action_registrations_lock;
1466
1415 struct mutex mtx; 1467 struct mutex mtx;
1416 1468
1417 struct work_struct cleanup_work; 1469 struct work_struct cleanup_work;
@@ -1436,6 +1488,9 @@ struct wireless_dev {
1436 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; 1488 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
1437 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 1489 struct cfg80211_internal_bss *current_bss; /* associated / joined */
1438 1490
1491 bool ps;
1492 int ps_timeout;
1493
1439#ifdef CONFIG_CFG80211_WEXT 1494#ifdef CONFIG_CFG80211_WEXT
1440 /* wext data */ 1495 /* wext data */
1441 struct { 1496 struct {
@@ -1447,8 +1502,7 @@ struct wireless_dev {
1447 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; 1502 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
1448 u8 ssid[IEEE80211_MAX_SSID_LEN]; 1503 u8 ssid[IEEE80211_MAX_SSID_LEN];
1449 s8 default_key, default_mgmt_key; 1504 s8 default_key, default_mgmt_key;
1450 bool ps, prev_bssid_valid; 1505 bool prev_bssid_valid;
1451 int ps_timeout;
1452 } wext; 1506 } wext;
1453#endif 1507#endif
1454}; 1508};
@@ -1519,37 +1573,82 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
1519 * Documentation in Documentation/networking/radiotap-headers.txt 1573 * Documentation in Documentation/networking/radiotap-headers.txt
1520 */ 1574 */
1521 1575
1576struct radiotap_align_size {
1577 uint8_t align:4, size:4;
1578};
1579
1580struct ieee80211_radiotap_namespace {
1581 const struct radiotap_align_size *align_size;
1582 int n_bits;
1583 uint32_t oui;
1584 uint8_t subns;
1585};
1586
1587struct ieee80211_radiotap_vendor_namespaces {
1588 const struct ieee80211_radiotap_namespace *ns;
1589 int n_ns;
1590};
1591
1522/** 1592/**
1523 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args 1593 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
1524 * @rtheader: pointer to the radiotap header we are walking through 1594 * @this_arg_index: index of current arg, valid after each successful call
1525 * @max_length: length of radiotap header in cpu byte ordering 1595 * to ieee80211_radiotap_iterator_next()
1526 * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg 1596 * @this_arg: pointer to current radiotap arg; it is valid after each
1527 * @this_arg: pointer to current radiotap arg 1597 * call to ieee80211_radiotap_iterator_next() but also after
1528 * @arg_index: internal next argument index 1598 * ieee80211_radiotap_iterator_init() where it will point to
1529 * @arg: internal next argument pointer 1599 * the beginning of the actual data portion
1530 * @next_bitmap: internal pointer to next present u32 1600 * @this_arg_size: length of the current arg, for convenience
1531 * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present 1601 * @current_namespace: pointer to the current namespace definition
1602 * (or internally %NULL if the current namespace is unknown)
1603 * @is_radiotap_ns: indicates whether the current namespace is the default
1604 * radiotap namespace or not
1605 *
1606 * @overrides: override standard radiotap fields
1607 * @n_overrides: number of overrides
1608 *
1609 * @_rtheader: pointer to the radiotap header we are walking through
1610 * @_max_length: length of radiotap header in cpu byte ordering
1611 * @_arg_index: next argument index
1612 * @_arg: next argument pointer
1613 * @_next_bitmap: internal pointer to next present u32
1614 * @_bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
1615 * @_vns: vendor namespace definitions
1616 * @_next_ns_data: beginning of the next namespace's data
1617 * @_reset_on_ext: internal; reset the arg index to 0 when going to the
1618 * next bitmap word
1619 *
1620 * Describes the radiotap parser state. Fields prefixed with an underscore
1621 * must not be used by users of the parser, only by the parser internally.
1532 */ 1622 */
1533 1623
1534struct ieee80211_radiotap_iterator { 1624struct ieee80211_radiotap_iterator {
1535 struct ieee80211_radiotap_header *rtheader; 1625 struct ieee80211_radiotap_header *_rtheader;
1536 int max_length; 1626 const struct ieee80211_radiotap_vendor_namespaces *_vns;
1627 const struct ieee80211_radiotap_namespace *current_namespace;
1628
1629 unsigned char *_arg, *_next_ns_data;
1630 uint32_t *_next_bitmap;
1631
1632 unsigned char *this_arg;
1537 int this_arg_index; 1633 int this_arg_index;
1538 u8 *this_arg; 1634 int this_arg_size;
1635
1636 int is_radiotap_ns;
1539 1637
1540 int arg_index; 1638 int _max_length;
1541 u8 *arg; 1639 int _arg_index;
1542 __le32 *next_bitmap; 1640 uint32_t _bitmap_shifter;
1543 u32 bitmap_shifter; 1641 int _reset_on_ext;
1544}; 1642};
1545 1643
1546extern int ieee80211_radiotap_iterator_init( 1644extern int ieee80211_radiotap_iterator_init(
1547 struct ieee80211_radiotap_iterator *iterator, 1645 struct ieee80211_radiotap_iterator *iterator,
1548 struct ieee80211_radiotap_header *radiotap_header, 1646 struct ieee80211_radiotap_header *radiotap_header,
1549 int max_length); 1647 int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns);
1550 1648
1551extern int ieee80211_radiotap_iterator_next( 1649extern int ieee80211_radiotap_iterator_next(
1552 struct ieee80211_radiotap_iterator *iterator); 1650 struct ieee80211_radiotap_iterator *iterator);
1651
1553 1652
1554extern const unsigned char rfc1042_header[6]; 1653extern const unsigned char rfc1042_header[6];
1555extern const unsigned char bridge_tunnel_header[6]; 1654extern const unsigned char bridge_tunnel_header[6];
@@ -1578,7 +1677,7 @@ unsigned int ieee80211_hdrlen(__le16 fc);
1578 * @addr: the device MAC address 1677 * @addr: the device MAC address
1579 * @iftype: the virtual interface type 1678 * @iftype: the virtual interface type
1580 */ 1679 */
1581int ieee80211_data_to_8023(struct sk_buff *skb, u8 *addr, 1680int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
1582 enum nl80211_iftype iftype); 1681 enum nl80211_iftype iftype);
1583 1682
1584/** 1683/**
@@ -1589,15 +1688,49 @@ int ieee80211_data_to_8023(struct sk_buff *skb, u8 *addr,
1589 * @bssid: the network bssid (used only for iftype STATION and ADHOC) 1688 * @bssid: the network bssid (used only for iftype STATION and ADHOC)
1590 * @qos: build 802.11 QoS data frame 1689 * @qos: build 802.11 QoS data frame
1591 */ 1690 */
1592int ieee80211_data_from_8023(struct sk_buff *skb, u8 *addr, 1691int ieee80211_data_from_8023(struct sk_buff *skb, const u8 *addr,
1593 enum nl80211_iftype iftype, u8 *bssid, bool qos); 1692 enum nl80211_iftype iftype, u8 *bssid, bool qos);
1594 1693
1595/** 1694/**
1695 * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame
1696 *
1697 * Decode an IEEE 802.11n A-MSDU frame and convert it to a list of
1698 * 802.3 frames. The @list will be empty if the decode fails. The
1699 * @skb is consumed after the function returns.
1700 *
1701 * @skb: The input IEEE 802.11n A-MSDU frame.
1702 * @list: The output list of 802.3 frames. It must be allocated and
1703 * initialized by by the caller.
1704 * @addr: The device MAC address.
1705 * @iftype: The device interface type.
1706 * @extra_headroom: The hardware extra headroom for SKBs in the @list.
1707 */
1708void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
1709 const u8 *addr, enum nl80211_iftype iftype,
1710 const unsigned int extra_headroom);
1711
1712/**
1596 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame 1713 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
1597 * @skb: the data frame 1714 * @skb: the data frame
1598 */ 1715 */
1599unsigned int cfg80211_classify8021d(struct sk_buff *skb); 1716unsigned int cfg80211_classify8021d(struct sk_buff *skb);
1600 1717
1718/**
1719 * cfg80211_find_ie - find information element in data
1720 *
1721 * @eid: element ID
1722 * @ies: data consisting of IEs
1723 * @len: length of data
1724 *
1725 * This function will return %NULL if the element ID could
1726 * not be found or if the element is invalid (claims to be
1727 * longer than the given data), or a pointer to the first byte
1728 * of the requested element, that is the byte containing the
1729 * element ID. There are no checks on the element length
1730 * other than having to fit into the given data.
1731 */
1732const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len);
1733
1601/* 1734/*
1602 * Regulatory helper functions for wiphys 1735 * Regulatory helper functions for wiphys
1603 */ 1736 */
@@ -2129,5 +2262,79 @@ void cfg80211_roamed(struct net_device *dev, const u8 *bssid,
2129void cfg80211_disconnected(struct net_device *dev, u16 reason, 2262void cfg80211_disconnected(struct net_device *dev, u16 reason,
2130 u8 *ie, size_t ie_len, gfp_t gfp); 2263 u8 *ie, size_t ie_len, gfp_t gfp);
2131 2264
2265/**
2266 * cfg80211_ready_on_channel - notification of remain_on_channel start
2267 * @dev: network device
2268 * @cookie: the request cookie
2269 * @chan: The current channel (from remain_on_channel request)
2270 * @channel_type: Channel type
2271 * @duration: Duration in milliseconds that the driver intents to remain on the
2272 * channel
2273 * @gfp: allocation flags
2274 */
2275void cfg80211_ready_on_channel(struct net_device *dev, u64 cookie,
2276 struct ieee80211_channel *chan,
2277 enum nl80211_channel_type channel_type,
2278 unsigned int duration, gfp_t gfp);
2279
2280/**
2281 * cfg80211_remain_on_channel_expired - remain_on_channel duration expired
2282 * @dev: network device
2283 * @cookie: the request cookie
2284 * @chan: The current channel (from remain_on_channel request)
2285 * @channel_type: Channel type
2286 * @gfp: allocation flags
2287 */
2288void cfg80211_remain_on_channel_expired(struct net_device *dev,
2289 u64 cookie,
2290 struct ieee80211_channel *chan,
2291 enum nl80211_channel_type channel_type,
2292 gfp_t gfp);
2293
2294
2295/**
2296 * cfg80211_new_sta - notify userspace about station
2297 *
2298 * @dev: the netdev
2299 * @mac_addr: the station's address
2300 * @sinfo: the station information
2301 * @gfp: allocation flags
2302 */
2303void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
2304 struct station_info *sinfo, gfp_t gfp);
2305
2306/**
2307 * cfg80211_rx_action - notification of received, unprocessed Action frame
2308 * @dev: network device
2309 * @freq: Frequency on which the frame was received in MHz
2310 * @buf: Action frame (header + body)
2311 * @len: length of the frame data
2312 * @gfp: context flags
2313 * Returns %true if a user space application is responsible for rejecting the
2314 * unrecognized Action frame; %false if no such application is registered
2315 * (i.e., the driver is responsible for rejecting the unrecognized Action
2316 * frame)
2317 *
2318 * This function is called whenever an Action frame is received for a station
2319 * mode interface, but is not processed in kernel.
2320 */
2321bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf,
2322 size_t len, gfp_t gfp);
2323
2324/**
2325 * cfg80211_action_tx_status - notification of TX status for Action frame
2326 * @dev: network device
2327 * @cookie: Cookie returned by cfg80211_ops::action()
2328 * @buf: Action frame (header + body)
2329 * @len: length of the frame data
2330 * @ack: Whether frame was acknowledged
2331 * @gfp: context flags
2332 *
2333 * This function is called whenever an Action frame was requested to be
2334 * transmitted with cfg80211_ops::action() to report the TX status of the
2335 * transmission attempt.
2336 */
2337void cfg80211_action_tx_status(struct net_device *dev, u64 cookie,
2338 const u8 *buf, size_t len, bool ack, gfp_t gfp);
2132 2339
2133#endif /* __NET_CFG80211_H */ 2340#endif /* __NET_CFG80211_H */
diff --git a/include/net/dst.h b/include/net/dst.h
index 39c4a5963e12..ce078cda6b74 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -83,8 +83,6 @@ struct dst_entry {
83 * (L1_CACHE_SIZE would be too much) 83 * (L1_CACHE_SIZE would be too much)
84 */ 84 */
85#ifdef CONFIG_64BIT 85#ifdef CONFIG_64BIT
86 long __pad_to_align_refcnt[2];
87#else
88 long __pad_to_align_refcnt[1]; 86 long __pad_to_align_refcnt[1];
89#endif 87#endif
90 /* 88 /*
diff --git a/include/net/icmp.h b/include/net/icmp.h
index dfa72d4e8907..15b3dfe9fce8 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -28,7 +28,7 @@ struct icmp_err {
28 unsigned fatal:1; 28 unsigned fatal:1;
29}; 29};
30 30
31extern struct icmp_err icmp_err_convert[]; 31extern const struct icmp_err icmp_err_convert[];
32#define ICMP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.icmp_statistics, field) 32#define ICMP_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.icmp_statistics, field)
33#define ICMP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.icmp_statistics, field) 33#define ICMP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.icmp_statistics, field)
34#define ICMPMSGOUT_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.icmpmsg_statistics, field+256) 34#define ICMPMSGOUT_INC_STATS(net, field) SNMP_INC_STATS((net)->mib.icmpmsg_statistics, field+256)
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index 9d3d86aaccbb..af49f8ab7f81 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -198,6 +198,10 @@ enum ieee80211_radiotap_type {
198 IEEE80211_RADIOTAP_TX_FLAGS = 15, 198 IEEE80211_RADIOTAP_TX_FLAGS = 15,
199 IEEE80211_RADIOTAP_RTS_RETRIES = 16, 199 IEEE80211_RADIOTAP_RTS_RETRIES = 16,
200 IEEE80211_RADIOTAP_DATA_RETRIES = 17, 200 IEEE80211_RADIOTAP_DATA_RETRIES = 17,
201
202 /* valid in every it_present bitmap, even vendor namespaces */
203 IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
204 IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
201 IEEE80211_RADIOTAP_EXT = 31 205 IEEE80211_RADIOTAP_EXT = 31
202}; 206};
203 207
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index e9d69d198495..545d8b059bef 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -157,7 +157,7 @@ struct inet6_dev {
157 157
158 struct ifmcaddr6 *mc_list; 158 struct ifmcaddr6 *mc_list;
159 struct ifmcaddr6 *mc_tomb; 159 struct ifmcaddr6 *mc_tomb;
160 rwlock_t mc_lock; 160 spinlock_t mc_lock;
161 unsigned char mc_qrv; 161 unsigned char mc_qrv;
162 unsigned char mc_gq_running; 162 unsigned char mc_gq_running;
163 unsigned char mc_ifc_count; 163 unsigned char mc_ifc_count;
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index bd4c53f75ac0..83fd34437cf1 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -122,10 +122,12 @@ struct inet_sock {
122 __be32 inet_saddr; 122 __be32 inet_saddr;
123 __s16 uc_ttl; 123 __s16 uc_ttl;
124 __u16 cmsg_flags; 124 __u16 cmsg_flags;
125 struct ip_options *opt;
126 __be16 inet_sport; 125 __be16 inet_sport;
127 __u16 inet_id; 126 __u16 inet_id;
127
128 struct ip_options *opt;
128 __u8 tos; 129 __u8 tos;
130 __u8 min_ttl;
129 __u8 mc_ttl; 131 __u8 mc_ttl;
130 __u8 pmtudisc; 132 __u8 pmtudisc;
131 __u8 recverr:1, 133 __u8 recverr:1,
diff --git a/include/net/ip.h b/include/net/ip.h
index fb63371c07a8..503994a38ed1 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -174,9 +174,9 @@ extern struct ipv4_config ipv4_config;
174#define NET_ADD_STATS_BH(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd) 174#define NET_ADD_STATS_BH(net, field, adnd) SNMP_ADD_STATS_BH((net)->mib.net_statistics, field, adnd)
175#define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd) 175#define NET_ADD_STATS_USER(net, field, adnd) SNMP_ADD_STATS_USER((net)->mib.net_statistics, field, adnd)
176 176
177extern unsigned long snmp_fold_field(void *mib[], int offt); 177extern unsigned long snmp_fold_field(void __percpu *mib[], int offt);
178extern int snmp_mib_init(void *ptr[2], size_t mibsize); 178extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize);
179extern void snmp_mib_free(void *ptr[2]); 179extern void snmp_mib_free(void __percpu *ptr[2]);
180 180
181extern struct local_ports { 181extern struct local_ports {
182 seqlock_t lock; 182 seqlock_t lock;
@@ -352,8 +352,11 @@ enum ip_defrag_users {
352 IP_DEFRAG_LOCAL_DELIVER, 352 IP_DEFRAG_LOCAL_DELIVER,
353 IP_DEFRAG_CALL_RA_CHAIN, 353 IP_DEFRAG_CALL_RA_CHAIN,
354 IP_DEFRAG_CONNTRACK_IN, 354 IP_DEFRAG_CONNTRACK_IN,
355 __IP_DEFRAG_CONNTRACK_IN_END = IP_DEFRAG_CONNTRACK_IN + USHORT_MAX,
355 IP_DEFRAG_CONNTRACK_OUT, 356 IP_DEFRAG_CONNTRACK_OUT,
357 __IP_DEFRAG_CONNTRACK_OUT_END = IP_DEFRAG_CONNTRACK_OUT + USHORT_MAX,
356 IP_DEFRAG_CONNTRACK_BRIDGE_IN, 358 IP_DEFRAG_CONNTRACK_BRIDGE_IN,
359 __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHORT_MAX,
357 IP_DEFRAG_VS_IN, 360 IP_DEFRAG_VS_IN,
358 IP_DEFRAG_VS_OUT, 361 IP_DEFRAG_VS_OUT,
359 IP_DEFRAG_VS_FWD 362 IP_DEFRAG_VS_FWD
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 257808188add..86f46c49e318 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -124,11 +124,13 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
124} 124}
125 125
126struct fib6_walker_t { 126struct fib6_walker_t {
127 struct fib6_walker_t *prev, *next; 127 struct list_head lh;
128 struct fib6_node *root, *node; 128 struct fib6_node *root, *node;
129 struct rt6_info *leaf; 129 struct rt6_info *leaf;
130 unsigned char state; 130 unsigned char state;
131 unsigned char prune; 131 unsigned char prune;
132 unsigned int skip;
133 unsigned int count;
132 int (*func)(struct fib6_walker_t *); 134 int (*func)(struct fib6_walker_t *);
133 void *args; 135 void *args;
134}; 136};
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 8dc3296b7bea..fe82b1e10a29 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -26,6 +26,11 @@
26#include <linux/ipv6.h> /* for struct ipv6hdr */ 26#include <linux/ipv6.h> /* for struct ipv6hdr */
27#include <net/ipv6.h> /* for ipv6_addr_copy */ 27#include <net/ipv6.h> /* for ipv6_addr_copy */
28 28
29
30/* Connections' size value needed by ip_vs_ctl.c */
31extern int ip_vs_conn_tab_size;
32
33
29struct ip_vs_iphdr { 34struct ip_vs_iphdr {
30 int len; 35 int len;
31 __u8 protocol; 36 __u8 protocol;
@@ -220,6 +225,26 @@ enum {
220}; 225};
221 226
222/* 227/*
228 * SCTP State Values
229 */
230enum ip_vs_sctp_states {
231 IP_VS_SCTP_S_NONE,
232 IP_VS_SCTP_S_INIT_CLI,
233 IP_VS_SCTP_S_INIT_SER,
234 IP_VS_SCTP_S_INIT_ACK_CLI,
235 IP_VS_SCTP_S_INIT_ACK_SER,
236 IP_VS_SCTP_S_ECHO_CLI,
237 IP_VS_SCTP_S_ECHO_SER,
238 IP_VS_SCTP_S_ESTABLISHED,
239 IP_VS_SCTP_S_SHUT_CLI,
240 IP_VS_SCTP_S_SHUT_SER,
241 IP_VS_SCTP_S_SHUT_ACK_CLI,
242 IP_VS_SCTP_S_SHUT_ACK_SER,
243 IP_VS_SCTP_S_CLOSED,
244 IP_VS_SCTP_S_LAST
245};
246
247/*
223 * Delta sequence info structure 248 * Delta sequence info structure
224 * Each ip_vs_conn has 2 (output AND input seq. changes). 249 * Each ip_vs_conn has 2 (output AND input seq. changes).
225 * Only used in the VS/NAT. 250 * Only used in the VS/NAT.
@@ -592,17 +617,6 @@ extern void ip_vs_init_hash_table(struct list_head *table, int rows);
592 * (from ip_vs_conn.c) 617 * (from ip_vs_conn.c)
593 */ 618 */
594 619
595/*
596 * IPVS connection entry hash table
597 */
598#ifndef CONFIG_IP_VS_TAB_BITS
599#define CONFIG_IP_VS_TAB_BITS 12
600#endif
601
602#define IP_VS_CONN_TAB_BITS CONFIG_IP_VS_TAB_BITS
603#define IP_VS_CONN_TAB_SIZE (1 << IP_VS_CONN_TAB_BITS)
604#define IP_VS_CONN_TAB_MASK (IP_VS_CONN_TAB_SIZE - 1)
605
606enum { 620enum {
607 IP_VS_DIR_INPUT = 0, 621 IP_VS_DIR_INPUT = 0,
608 IP_VS_DIR_OUTPUT, 622 IP_VS_DIR_OUTPUT,
@@ -747,7 +761,7 @@ extern struct ip_vs_protocol ip_vs_protocol_udp;
747extern struct ip_vs_protocol ip_vs_protocol_icmp; 761extern struct ip_vs_protocol ip_vs_protocol_icmp;
748extern struct ip_vs_protocol ip_vs_protocol_esp; 762extern struct ip_vs_protocol ip_vs_protocol_esp;
749extern struct ip_vs_protocol ip_vs_protocol_ah; 763extern struct ip_vs_protocol ip_vs_protocol_ah;
750 764extern struct ip_vs_protocol ip_vs_protocol_sctp;
751 765
752/* 766/*
753 * Registering/unregistering scheduler functions 767 * Registering/unregistering scheduler functions
diff --git a/include/net/ipcomp.h b/include/net/ipcomp.h
index 2a1092abaa07..cc4f30cd7315 100644
--- a/include/net/ipcomp.h
+++ b/include/net/ipcomp.h
@@ -9,7 +9,7 @@ struct crypto_comp;
9 9
10struct ipcomp_data { 10struct ipcomp_data {
11 u16 threshold; 11 u16 threshold;
12 struct crypto_comp **tfms; 12 struct crypto_comp * __percpu *tfms;
13}; 13};
14 14
15struct ip_comp_hdr; 15struct ip_comp_hdr;
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index ccab5946c830..e72fb10ce573 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -73,7 +73,6 @@
73#define IPV6_ADDR_SCOPE_MASK 0x00f0U 73#define IPV6_ADDR_SCOPE_MASK 0x00f0U
74 74
75#define IPV6_ADDR_MAPPED 0x1000U 75#define IPV6_ADDR_MAPPED 0x1000U
76#define IPV6_ADDR_RESERVED 0x2000U /* reserved address space */
77 76
78/* 77/*
79 * Addr scopes 78 * Addr scopes
@@ -246,7 +245,9 @@ extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb);
246int ip6_frag_nqueues(struct net *net); 245int ip6_frag_nqueues(struct net *net);
247int ip6_frag_mem(struct net *net); 246int ip6_frag_mem(struct net *net);
248 247
249#define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ 248#define IPV6_FRAG_HIGH_THRESH (256 * 1024) /* 262144 */
249#define IPV6_FRAG_LOW_THRESH (192 * 1024) /* 196608 */
250#define IPV6_FRAG_TIMEOUT (60 * HZ) /* 60 seconds */
250 251
251extern int __ipv6_addr_type(const struct in6_addr *addr); 252extern int __ipv6_addr_type(const struct in6_addr *addr);
252static inline int ipv6_addr_type(const struct in6_addr *addr) 253static inline int ipv6_addr_type(const struct in6_addr *addr)
@@ -353,8 +354,11 @@ struct inet_frag_queue;
353enum ip6_defrag_users { 354enum ip6_defrag_users {
354 IP6_DEFRAG_LOCAL_DELIVER, 355 IP6_DEFRAG_LOCAL_DELIVER,
355 IP6_DEFRAG_CONNTRACK_IN, 356 IP6_DEFRAG_CONNTRACK_IN,
357 __IP6_DEFRAG_CONNTRACK_IN = IP6_DEFRAG_CONNTRACK_IN + USHORT_MAX,
356 IP6_DEFRAG_CONNTRACK_OUT, 358 IP6_DEFRAG_CONNTRACK_OUT,
359 __IP6_DEFRAG_CONNTRACK_OUT = IP6_DEFRAG_CONNTRACK_OUT + USHORT_MAX,
357 IP6_DEFRAG_CONNTRACK_BRIDGE_IN, 360 IP6_DEFRAG_CONNTRACK_BRIDGE_IN,
361 __IP6_DEFRAG_CONNTRACK_BRIDGE_IN = IP6_DEFRAG_CONNTRACK_BRIDGE_IN + USHORT_MAX,
358}; 362};
359 363
360struct ip6_create_arg { 364struct ip6_create_arg {
diff --git a/include/net/llc.h b/include/net/llc.h
index 7940da1606e7..5503b74ab170 100644
--- a/include/net/llc.h
+++ b/include/net/llc.h
@@ -16,6 +16,9 @@
16#include <linux/if_ether.h> 16#include <linux/if_ether.h>
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/rculist_nulls.h>
20#include <linux/hash.h>
21#include <linux/jhash.h>
19 22
20#include <asm/atomic.h> 23#include <asm/atomic.h>
21 24
@@ -31,6 +34,12 @@ struct llc_addr {
31#define LLC_SAP_STATE_INACTIVE 1 34#define LLC_SAP_STATE_INACTIVE 1
32#define LLC_SAP_STATE_ACTIVE 2 35#define LLC_SAP_STATE_ACTIVE 2
33 36
37#define LLC_SK_DEV_HASH_BITS 6
38#define LLC_SK_DEV_HASH_ENTRIES (1<<LLC_SK_DEV_HASH_BITS)
39
40#define LLC_SK_LADDR_HASH_BITS 6
41#define LLC_SK_LADDR_HASH_ENTRIES (1<<LLC_SK_LADDR_HASH_BITS)
42
34/** 43/**
35 * struct llc_sap - Defines the SAP component 44 * struct llc_sap - Defines the SAP component
36 * 45 *
@@ -53,18 +62,38 @@ struct llc_sap {
53 struct net_device *orig_dev); 62 struct net_device *orig_dev);
54 struct llc_addr laddr; 63 struct llc_addr laddr;
55 struct list_head node; 64 struct list_head node;
56 struct { 65 spinlock_t sk_lock;
57 rwlock_t lock; 66 int sk_count;
58 struct hlist_head list; 67 struct hlist_nulls_head sk_laddr_hash[LLC_SK_LADDR_HASH_ENTRIES];
59 } sk_list; 68 struct hlist_head sk_dev_hash[LLC_SK_DEV_HASH_ENTRIES];
60}; 69};
61 70
71static inline
72struct hlist_head *llc_sk_dev_hash(struct llc_sap *sap, int ifindex)
73{
74 return &sap->sk_dev_hash[ifindex % LLC_SK_DEV_HASH_ENTRIES];
75}
76
77static inline
78u32 llc_sk_laddr_hashfn(struct llc_sap *sap, const struct llc_addr *laddr)
79{
80 return hash_32(jhash(laddr->mac, sizeof(laddr->mac), 0),
81 LLC_SK_LADDR_HASH_BITS);
82}
83
84static inline
85struct hlist_nulls_head *llc_sk_laddr_hash(struct llc_sap *sap,
86 const struct llc_addr *laddr)
87{
88 return &sap->sk_laddr_hash[llc_sk_laddr_hashfn(sap, laddr)];
89}
90
62#define LLC_DEST_INVALID 0 /* Invalid LLC PDU type */ 91#define LLC_DEST_INVALID 0 /* Invalid LLC PDU type */
63#define LLC_DEST_SAP 1 /* Type 1 goes here */ 92#define LLC_DEST_SAP 1 /* Type 1 goes here */
64#define LLC_DEST_CONN 2 /* Type 2 goes here */ 93#define LLC_DEST_CONN 2 /* Type 2 goes here */
65 94
66extern struct list_head llc_sap_list; 95extern struct list_head llc_sap_list;
67extern rwlock_t llc_sap_list_lock; 96extern spinlock_t llc_sap_list_lock;
68 97
69extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, 98extern int llc_rcv(struct sk_buff *skb, struct net_device *dev,
70 struct packet_type *pt, struct net_device *orig_dev); 99 struct packet_type *pt, struct net_device *orig_dev);
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h
index e2374e34989f..2f97d8ddce92 100644
--- a/include/net/llc_conn.h
+++ b/include/net/llc_conn.h
@@ -76,6 +76,8 @@ struct llc_sock {
76 u32 rx_pdu_hdr; /* used for saving header of last pdu 76 u32 rx_pdu_hdr; /* used for saving header of last pdu
77 received and caused sending FRMR. 77 received and caused sending FRMR.
78 Used for resending FRMR */ 78 Used for resending FRMR */
79 u32 cmsg_flags;
80 struct hlist_node dev_hash_node;
79}; 81};
80 82
81static inline struct llc_sock *llc_sk(const struct sock *sk) 83static inline struct llc_sock *llc_sk(const struct sock *sk)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0bf369752274..80eb7cc42ce9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright 2002-2005, Devicescape Software, Inc. 4 * Copyright 2002-2005, Devicescape Software, Inc.
5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
6 * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2007-2010 Johannes Berg <johannes@sipsolutions.net>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -107,25 +107,14 @@ enum ieee80211_max_queues {
107 * 2^n-1 in the range 1..32767] 107 * 2^n-1 in the range 1..32767]
108 * @cw_max: maximum contention window [like @cw_min] 108 * @cw_max: maximum contention window [like @cw_min]
109 * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled 109 * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled
110 * @uapsd: is U-APSD mode enabled for the queue
110 */ 111 */
111struct ieee80211_tx_queue_params { 112struct ieee80211_tx_queue_params {
112 u16 txop; 113 u16 txop;
113 u16 cw_min; 114 u16 cw_min;
114 u16 cw_max; 115 u16 cw_max;
115 u8 aifs; 116 u8 aifs;
116}; 117 bool uapsd;
117
118/**
119 * struct ieee80211_tx_queue_stats - transmit queue statistics
120 *
121 * @len: number of packets in queue
122 * @limit: queue length limit
123 * @count: number of frames sent
124 */
125struct ieee80211_tx_queue_stats {
126 unsigned int len;
127 unsigned int limit;
128 unsigned int count;
129}; 118};
130 119
131struct ieee80211_low_level_stats { 120struct ieee80211_low_level_stats {
@@ -184,7 +173,8 @@ enum ieee80211_bss_change {
184 * @use_short_slot: use short slot time (only relevant for ERP); 173 * @use_short_slot: use short slot time (only relevant for ERP);
185 * if the hardware cannot handle this it must set the 174 * if the hardware cannot handle this it must set the
186 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag 175 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag
187 * @dtim_period: num of beacons before the next DTIM, for PSM 176 * @dtim_period: num of beacons before the next DTIM, for beaconing,
177 * not valid in station mode (cf. hw conf ps_dtim_period)
188 * @timestamp: beacon timestamp 178 * @timestamp: beacon timestamp
189 * @beacon_int: beacon interval 179 * @beacon_int: beacon interval
190 * @assoc_capability: capabilities taken from assoc resp 180 * @assoc_capability: capabilities taken from assoc resp
@@ -255,9 +245,6 @@ struct ieee80211_bss_conf {
255 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be 245 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be
256 * set by rate control algorithms to indicate probe rate, will 246 * set by rate control algorithms to indicate probe rate, will
257 * be cleared for fragmented frames (except on the last fragment) 247 * be cleared for fragmented frames (except on the last fragment)
258 * @IEEE80211_TX_INTFL_RCALGO: mac80211 internal flag, do not test or
259 * set this flag in the driver; indicates that the rate control
260 * algorithm was used and should be notified of TX status
261 * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, 248 * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211,
262 * used to indicate that a pending frame requires TX processing before 249 * used to indicate that a pending frame requires TX processing before
263 * it can be sent out. 250 * it can be sent out.
@@ -272,6 +259,14 @@ struct ieee80211_bss_conf {
272 * transmit function after the current frame, this can be used 259 * transmit function after the current frame, this can be used
273 * by drivers to kick the DMA queue only if unset or when the 260 * by drivers to kick the DMA queue only if unset or when the
274 * queue gets full. 261 * queue gets full.
262 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted
263 * after TX status because the destination was asleep, it must not
264 * be modified again (no seqno assignment, crypto, etc.)
265 * @IEEE80211_TX_INTFL_HAS_RADIOTAP: This frame was injected and still
266 * has a radiotap header at skb->data.
267 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211
268 * MLME command (internal to mac80211 to figure out whether to send TX
269 * status to user space)
275 */ 270 */
276enum mac80211_tx_control_flags { 271enum mac80211_tx_control_flags {
277 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 272 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
@@ -287,12 +282,14 @@ enum mac80211_tx_control_flags {
287 IEEE80211_TX_STAT_AMPDU = BIT(10), 282 IEEE80211_TX_STAT_AMPDU = BIT(10),
288 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), 283 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11),
289 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), 284 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
290 IEEE80211_TX_INTFL_RCALGO = BIT(13),
291 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 285 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
292 IEEE80211_TX_INTFL_RETRIED = BIT(15), 286 IEEE80211_TX_INTFL_RETRIED = BIT(15),
293 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), 287 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
294 IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17), 288 IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17),
295 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), 289 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
290 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19),
291 IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20),
292 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
296}; 293};
297 294
298/** 295/**
@@ -571,7 +568,13 @@ struct ieee80211_rx_status {
571 * @IEEE80211_CONF_MONITOR: there's a monitor interface present -- use this 568 * @IEEE80211_CONF_MONITOR: there's a monitor interface present -- use this
572 * to determine for example whether to calculate timestamps for packets 569 * to determine for example whether to calculate timestamps for packets
573 * or not, do not use instead of filter flags! 570 * or not, do not use instead of filter flags!
574 * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) 571 * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only).
572 * This is the power save mode defined by IEEE 802.11-2007 section 11.2,
573 * meaning that the hardware still wakes up for beacons, is able to
574 * transmit frames and receive the possible acknowledgment frames.
575 * Not to be confused with hardware specific wakeup/sleep states,
576 * driver is responsible for that. See the section "Powersave support"
577 * for more.
575 * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set 578 * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set
576 * the driver should be prepared to handle configuration requests but 579 * the driver should be prepared to handle configuration requests but
577 * may turn the device off as much as possible. Typically, this flag will 580 * may turn the device off as much as possible. Typically, this flag will
@@ -595,8 +598,10 @@ enum ieee80211_conf_flags {
595 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed 598 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed
596 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 599 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
597 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed 600 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed
601 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed
598 */ 602 */
599enum ieee80211_conf_changed { 603enum ieee80211_conf_changed {
604 IEEE80211_CONF_CHANGE_SMPS = BIT(1),
600 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), 605 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
601 IEEE80211_CONF_CHANGE_MONITOR = BIT(3), 606 IEEE80211_CONF_CHANGE_MONITOR = BIT(3),
602 IEEE80211_CONF_CHANGE_PS = BIT(4), 607 IEEE80211_CONF_CHANGE_PS = BIT(4),
@@ -607,6 +612,25 @@ enum ieee80211_conf_changed {
607}; 612};
608 613
609/** 614/**
615 * enum ieee80211_smps_mode - spatial multiplexing power save mode
616 *
617 * @IEEE80211_SMPS_AUTOMATIC: automatic
618 * @IEEE80211_SMPS_OFF: off
619 * @IEEE80211_SMPS_STATIC: static
620 * @IEEE80211_SMPS_DYNAMIC: dynamic
621 * @IEEE80211_SMPS_NUM_MODES: internal, don't use
622 */
623enum ieee80211_smps_mode {
624 IEEE80211_SMPS_AUTOMATIC,
625 IEEE80211_SMPS_OFF,
626 IEEE80211_SMPS_STATIC,
627 IEEE80211_SMPS_DYNAMIC,
628
629 /* keep last */
630 IEEE80211_SMPS_NUM_MODES,
631};
632
633/**
610 * struct ieee80211_conf - configuration of the device 634 * struct ieee80211_conf - configuration of the device
611 * 635 *
612 * This struct indicates how the driver shall configure the hardware. 636 * This struct indicates how the driver shall configure the hardware.
@@ -619,6 +643,9 @@ enum ieee80211_conf_changed {
619 * value will be only achievable between DTIM frames, the hardware 643 * value will be only achievable between DTIM frames, the hardware
620 * needs to check for the multicast traffic bit in DTIM beacons. 644 * needs to check for the multicast traffic bit in DTIM beacons.
621 * This variable is valid only when the CONF_PS flag is set. 645 * This variable is valid only when the CONF_PS flag is set.
646 * @ps_dtim_period: The DTIM period of the AP we're connected to, for use
647 * in power saving. Power saving will not be enabled until a beacon
648 * has been received and the DTIM period is known.
622 * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the 649 * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the
623 * powersave documentation below. This variable is valid only when 650 * powersave documentation below. This variable is valid only when
624 * the CONF_PS flag is set. 651 * the CONF_PS flag is set.
@@ -634,6 +661,10 @@ enum ieee80211_conf_changed {
634 * @short_frame_max_tx_count: Maximum number of transmissions for a "short" 661 * @short_frame_max_tx_count: Maximum number of transmissions for a "short"
635 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the 662 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the
636 * number of transmissions not the number of retries 663 * number of transmissions not the number of retries
664 *
665 * @smps_mode: spatial multiplexing powersave mode; note that
666 * %IEEE80211_SMPS_STATIC is used when the device is not
667 * configured for an HT channel
637 */ 668 */
638struct ieee80211_conf { 669struct ieee80211_conf {
639 u32 flags; 670 u32 flags;
@@ -641,11 +672,13 @@ struct ieee80211_conf {
641 int max_sleep_period; 672 int max_sleep_period;
642 673
643 u16 listen_interval; 674 u16 listen_interval;
675 u8 ps_dtim_period;
644 676
645 u8 long_frame_max_tx_count, short_frame_max_tx_count; 677 u8 long_frame_max_tx_count, short_frame_max_tx_count;
646 678
647 struct ieee80211_channel *channel; 679 struct ieee80211_channel *channel;
648 enum nl80211_channel_type channel_type; 680 enum nl80211_channel_type channel_type;
681 enum ieee80211_smps_mode smps_mode;
649}; 682};
650 683
651/** 684/**
@@ -657,12 +690,14 @@ struct ieee80211_conf {
657 * @type: type of this virtual interface 690 * @type: type of this virtual interface
658 * @bss_conf: BSS configuration for this interface, either our own 691 * @bss_conf: BSS configuration for this interface, either our own
659 * or the BSS we're associated to 692 * or the BSS we're associated to
693 * @addr: address of this interface
660 * @drv_priv: data area for driver use, will always be aligned to 694 * @drv_priv: data area for driver use, will always be aligned to
661 * sizeof(void *). 695 * sizeof(void *).
662 */ 696 */
663struct ieee80211_vif { 697struct ieee80211_vif {
664 enum nl80211_iftype type; 698 enum nl80211_iftype type;
665 struct ieee80211_bss_conf bss_conf; 699 struct ieee80211_bss_conf bss_conf;
700 u8 addr[ETH_ALEN];
666 /* must be last */ 701 /* must be last */
667 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 702 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
668}; 703};
@@ -676,33 +711,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
676} 711}
677 712
678/** 713/**
679 * struct ieee80211_if_init_conf - initial configuration of an interface
680 *
681 * @vif: pointer to a driver-use per-interface structure. The pointer
682 * itself is also used for various functions including
683 * ieee80211_beacon_get() and ieee80211_get_buffered_bc().
684 * @type: one of &enum nl80211_iftype constants. Determines the type of
685 * added/removed interface.
686 * @mac_addr: pointer to MAC address of the interface. This pointer is valid
687 * until the interface is removed (i.e. it cannot be used after
688 * remove_interface() callback was called for this interface).
689 *
690 * This structure is used in add_interface() and remove_interface()
691 * callbacks of &struct ieee80211_hw.
692 *
693 * When you allow multiple interfaces to be added to your PHY, take care
694 * that the hardware can actually handle multiple MAC addresses. However,
695 * also take care that when there's no interface left with mac_addr != %NULL
696 * you remove the MAC address from the device to avoid acknowledging packets
697 * in pure monitor mode.
698 */
699struct ieee80211_if_init_conf {
700 enum nl80211_iftype type;
701 struct ieee80211_vif *vif;
702 void *mac_addr;
703};
704
705/**
706 * enum ieee80211_key_alg - key algorithm 714 * enum ieee80211_key_alg - key algorithm
707 * @ALG_WEP: WEP40 or WEP104 715 * @ALG_WEP: WEP40 or WEP104
708 * @ALG_TKIP: TKIP 716 * @ALG_TKIP: TKIP
@@ -797,7 +805,7 @@ enum set_key_cmd {
797 * mac80211, any ieee80211_sta pointer you get access to must 805 * mac80211, any ieee80211_sta pointer you get access to must
798 * either be protected by rcu_read_lock() explicitly or implicitly, 806 * either be protected by rcu_read_lock() explicitly or implicitly,
799 * or you must take good care to not use such a pointer after a 807 * or you must take good care to not use such a pointer after a
800 * call to your sta_notify callback that removed it. 808 * call to your sta_remove callback that removed it.
801 * 809 *
802 * @addr: MAC address 810 * @addr: MAC address
803 * @aid: AID we assigned to the station if we're an AP 811 * @aid: AID we assigned to the station if we're an AP
@@ -823,8 +831,8 @@ struct ieee80211_sta {
823 * indicates addition and removal of a station to station table, 831 * indicates addition and removal of a station to station table,
824 * or if a associated station made a power state transition. 832 * or if a associated station made a power state transition.
825 * 833 *
826 * @STA_NOTIFY_ADD: a station was added to the station table 834 * @STA_NOTIFY_ADD: (DEPRECATED) a station was added to the station table
827 * @STA_NOTIFY_REMOVE: a station being removed from the station table 835 * @STA_NOTIFY_REMOVE: (DEPRECATED) a station being removed from the station table
828 * @STA_NOTIFY_SLEEP: a station is now sleeping 836 * @STA_NOTIFY_SLEEP: a station is now sleeping
829 * @STA_NOTIFY_AWAKE: a sleeping station woke up 837 * @STA_NOTIFY_AWAKE: a sleeping station woke up
830 */ 838 */
@@ -926,6 +934,26 @@ enum ieee80211_tkip_key_type {
926 * @IEEE80211_HW_BEACON_FILTER: 934 * @IEEE80211_HW_BEACON_FILTER:
927 * Hardware supports dropping of irrelevant beacon frames to 935 * Hardware supports dropping of irrelevant beacon frames to
928 * avoid waking up cpu. 936 * avoid waking up cpu.
937 *
938 * @IEEE80211_HW_SUPPORTS_STATIC_SMPS:
939 * Hardware supports static spatial multiplexing powersave,
940 * ie. can turn off all but one chain even on HT connections
941 * that should be using more chains.
942 *
943 * @IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS:
944 * Hardware supports dynamic spatial multiplexing powersave,
945 * ie. can turn off all but one chain and then wake the rest
946 * up as required after, for example, rts/cts handshake.
947 *
948 * @IEEE80211_HW_SUPPORTS_UAPSD:
949 * Hardware supports Unscheduled Automatic Power Save Delivery
950 * (U-APSD) in managed mode. The mode is configured with
951 * conf_tx() operation.
952 *
953 * @IEEE80211_HW_REPORTS_TX_ACK_STATUS:
954 * Hardware can provide ack status reports of Tx frames to
955 * the stack.
956 *
929 */ 957 */
930enum ieee80211_hw_flags { 958enum ieee80211_hw_flags {
931 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 959 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -943,6 +971,10 @@ enum ieee80211_hw_flags {
943 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, 971 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12,
944 IEEE80211_HW_MFP_CAPABLE = 1<<13, 972 IEEE80211_HW_MFP_CAPABLE = 1<<13,
945 IEEE80211_HW_BEACON_FILTER = 1<<14, 973 IEEE80211_HW_BEACON_FILTER = 1<<14,
974 IEEE80211_HW_SUPPORTS_STATIC_SMPS = 1<<15,
975 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16,
976 IEEE80211_HW_SUPPORTS_UAPSD = 1<<17,
977 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18,
946}; 978};
947 979
948/** 980/**
@@ -1121,18 +1153,24 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1121 * 1153 *
1122 * mac80211 has support for various powersave implementations. 1154 * mac80211 has support for various powersave implementations.
1123 * 1155 *
1124 * First, it can support hardware that handles all powersaving by 1156 * First, it can support hardware that handles all powersaving by itself,
1125 * itself, such hardware should simply set the %IEEE80211_HW_SUPPORTS_PS 1157 * such hardware should simply set the %IEEE80211_HW_SUPPORTS_PS hardware
1126 * hardware flag. In that case, it will be told about the desired 1158 * flag. In that case, it will be told about the desired powersave mode
1127 * powersave mode depending on the association status, and the driver 1159 * with the %IEEE80211_CONF_PS flag depending on the association status.
1128 * must take care of sending nullfunc frames when necessary, i.e. when 1160 * The hardware must take care of sending nullfunc frames when necessary,
1129 * entering and leaving powersave mode. The driver is required to look at 1161 * i.e. when entering and leaving powersave mode. The hardware is required
1130 * the AID in beacons and signal to the AP that it woke up when it finds 1162 * to look at the AID in beacons and signal to the AP that it woke up when
1131 * traffic directed to it. This mode supports dynamic PS by simply 1163 * it finds traffic directed to it.
1132 * enabling/disabling PS. 1164 *
1133 * 1165 * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in
1134 * Additionally, such hardware may set the %IEEE80211_HW_SUPPORTS_DYNAMIC_PS 1166 * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused
1135 * flag to indicate that it can support dynamic PS mode itself (see below). 1167 * with hardware wakeup and sleep states. Driver is responsible for waking
1168 * up the hardware before issueing commands to the hardware and putting it
1169 * back to sleep at approriate times.
1170 *
1171 * When PS is enabled, hardware needs to wakeup for beacons and receive the
1172 * buffered multicast/broadcast frames after the beacon. Also it must be
1173 * possible to send frames and receive the acknowledment frame.
1136 * 1174 *
1137 * Other hardware designs cannot send nullfunc frames by themselves and also 1175 * Other hardware designs cannot send nullfunc frames by themselves and also
1138 * need software support for parsing the TIM bitmap. This is also supported 1176 * need software support for parsing the TIM bitmap. This is also supported
@@ -1140,14 +1178,35 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1140 * %IEEE80211_HW_PS_NULLFUNC_STACK flags. The hardware is of course still 1178 * %IEEE80211_HW_PS_NULLFUNC_STACK flags. The hardware is of course still
1141 * required to pass up beacons. The hardware is still required to handle 1179 * required to pass up beacons. The hardware is still required to handle
1142 * waking up for multicast traffic; if it cannot the driver must handle that 1180 * waking up for multicast traffic; if it cannot the driver must handle that
1143 * as best as it can, mac80211 is too slow. 1181 * as best as it can, mac80211 is too slow to do that.
1144 * 1182 *
1145 * Dynamic powersave mode is an extension to normal powersave mode in which 1183 * Dynamic powersave is an extension to normal powersave in which the
1146 * the hardware stays awake for a user-specified period of time after sending 1184 * hardware stays awake for a user-specified period of time after sending a
1147 * a frame so that reply frames need not be buffered and therefore delayed 1185 * frame so that reply frames need not be buffered and therefore delayed to
1148 * to the next wakeup. This can either be supported by hardware, in which case 1186 * the next wakeup. It's compromise of getting good enough latency when
1149 * the driver needs to look at the @dynamic_ps_timeout hardware configuration 1187 * there's data traffic and still saving significantly power in idle
1150 * value, or by the stack if all nullfunc handling is in the stack. 1188 * periods.
1189 *
1190 * Dynamic powersave is supported by simply mac80211 enabling and disabling
1191 * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS
1192 * flag and mac80211 will handle everything automatically. Additionally,
1193 * hardware having support for the dynamic PS feature may set the
1194 * %IEEE80211_HW_SUPPORTS_DYNAMIC_PS flag to indicate that it can support
1195 * dynamic PS mode itself. The driver needs to look at the
1196 * @dynamic_ps_timeout hardware configuration value and use it that value
1197 * whenever %IEEE80211_CONF_PS is set. In this case mac80211 will disable
1198 * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS
1199 * enabled whenever user has enabled powersave.
1200 *
1201 * Driver informs U-APSD client support by enabling
1202 * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the
1203 * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS
1204 * Nullfunc frames and stay awake until the service period has ended. To
1205 * utilize U-APSD, dynamic powersave is disabled for voip AC and all frames
1206 * from that AC are transmitted with powersave enabled.
1207 *
1208 * Note: U-APSD client mode is not yet supported with
1209 * %IEEE80211_HW_PS_NULLFUNC_STACK.
1151 */ 1210 */
1152 1211
1153/** 1212/**
@@ -1211,6 +1270,31 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1211 */ 1270 */
1212 1271
1213/** 1272/**
1273 * DOC: Spatial multiplexing power save
1274 *
1275 * SMPS (Spatial multiplexing power save) is a mechanism to conserve
1276 * power in an 802.11n implementation. For details on the mechanism
1277 * and rationale, please refer to 802.11 (as amended by 802.11n-2009)
1278 * "11.2.3 SM power save".
1279 *
1280 * The mac80211 implementation is capable of sending action frames
1281 * to update the AP about the station's SMPS mode, and will instruct
1282 * the driver to enter the specific mode. It will also announce the
1283 * requested SMPS mode during the association handshake. Hardware
1284 * support for this feature is required, and can be indicated by
1285 * hardware flags.
1286 *
1287 * The default mode will be "automatic", which nl80211/cfg80211
1288 * defines to be dynamic SMPS in (regular) powersave, and SMPS
1289 * turned off otherwise.
1290 *
1291 * To support this feature, the driver must set the appropriate
1292 * hardware support flags, and handle the SMPS flag to the config()
1293 * operation. It will then with this mechanism be instructed to
1294 * enter the requested SMPS mode while associated to an HT AP.
1295 */
1296
1297/**
1214 * DOC: Frame filtering 1298 * DOC: Frame filtering
1215 * 1299 *
1216 * mac80211 requires to see many management frames for proper 1300 * mac80211 requires to see many management frames for proper
@@ -1347,7 +1431,7 @@ enum ieee80211_ampdu_mlme_action {
1347 * When the device is started it should not have a MAC address 1431 * When the device is started it should not have a MAC address
1348 * to avoid acknowledging frames before a non-monitor device 1432 * to avoid acknowledging frames before a non-monitor device
1349 * is added. 1433 * is added.
1350 * Must be implemented. 1434 * Must be implemented and can sleep.
1351 * 1435 *
1352 * @stop: Called after last netdevice attached to the hardware 1436 * @stop: Called after last netdevice attached to the hardware
1353 * is disabled. This should turn off the hardware (at least 1437 * is disabled. This should turn off the hardware (at least
@@ -1355,7 +1439,7 @@ enum ieee80211_ampdu_mlme_action {
1355 * May be called right after add_interface if that rejects 1439 * May be called right after add_interface if that rejects
1356 * an interface. If you added any work onto the mac80211 workqueue 1440 * an interface. If you added any work onto the mac80211 workqueue
1357 * you should ensure to cancel it on this callback. 1441 * you should ensure to cancel it on this callback.
1358 * Must be implemented. 1442 * Must be implemented and can sleep.
1359 * 1443 *
1360 * @add_interface: Called when a netdevice attached to the hardware is 1444 * @add_interface: Called when a netdevice attached to the hardware is
1361 * enabled. Because it is not called for monitor mode devices, @start 1445 * enabled. Because it is not called for monitor mode devices, @start
@@ -1365,7 +1449,7 @@ enum ieee80211_ampdu_mlme_action {
1365 * interface is given in the conf parameter. 1449 * interface is given in the conf parameter.
1366 * The callback may refuse to add an interface by returning a 1450 * The callback may refuse to add an interface by returning a
1367 * negative error code (which will be seen in userspace.) 1451 * negative error code (which will be seen in userspace.)
1368 * Must be implemented. 1452 * Must be implemented and can sleep.
1369 * 1453 *
1370 * @remove_interface: Notifies a driver that an interface is going down. 1454 * @remove_interface: Notifies a driver that an interface is going down.
1371 * The @stop callback is called after this if it is the last interface 1455 * The @stop callback is called after this if it is the last interface
@@ -1374,19 +1458,20 @@ enum ieee80211_ampdu_mlme_action {
1374 * must be cleared so the device no longer acknowledges packets, 1458 * must be cleared so the device no longer acknowledges packets,
1375 * the mac_addr member of the conf structure is, however, set to the 1459 * the mac_addr member of the conf structure is, however, set to the
1376 * MAC address of the device going away. 1460 * MAC address of the device going away.
1377 * Hence, this callback must be implemented. 1461 * Hence, this callback must be implemented. It can sleep.
1378 * 1462 *
1379 * @config: Handler for configuration requests. IEEE 802.11 code calls this 1463 * @config: Handler for configuration requests. IEEE 802.11 code calls this
1380 * function to change hardware configuration, e.g., channel. 1464 * function to change hardware configuration, e.g., channel.
1381 * This function should never fail but returns a negative error code 1465 * This function should never fail but returns a negative error code
1382 * if it does. 1466 * if it does. The callback can sleep.
1383 * 1467 *
1384 * @bss_info_changed: Handler for configuration requests related to BSS 1468 * @bss_info_changed: Handler for configuration requests related to BSS
1385 * parameters that may vary during BSS's lifespan, and may affect low 1469 * parameters that may vary during BSS's lifespan, and may affect low
1386 * level driver (e.g. assoc/disassoc status, erp parameters). 1470 * level driver (e.g. assoc/disassoc status, erp parameters).
1387 * This function should not be used if no BSS has been set, unless 1471 * This function should not be used if no BSS has been set, unless
1388 * for association indication. The @changed parameter indicates which 1472 * for association indication. The @changed parameter indicates which
1389 * of the bss parameters has changed when a call is made. 1473 * of the bss parameters has changed when a call is made. The callback
1474 * can sleep.
1390 * 1475 *
1391 * @prepare_multicast: Prepare for multicast filter configuration. 1476 * @prepare_multicast: Prepare for multicast filter configuration.
1392 * This callback is optional, and its return value is passed 1477 * This callback is optional, and its return value is passed
@@ -1394,20 +1479,22 @@ enum ieee80211_ampdu_mlme_action {
1394 * 1479 *
1395 * @configure_filter: Configure the device's RX filter. 1480 * @configure_filter: Configure the device's RX filter.
1396 * See the section "Frame filtering" for more information. 1481 * See the section "Frame filtering" for more information.
1397 * This callback must be implemented. 1482 * This callback must be implemented and can sleep.
1398 * 1483 *
1399 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 1484 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
1400 * must be set or cleared for a given STA. Must be atomic. 1485 * must be set or cleared for a given STA. Must be atomic.
1401 * 1486 *
1402 * @set_key: See the section "Hardware crypto acceleration" 1487 * @set_key: See the section "Hardware crypto acceleration"
1403 * This callback can sleep, and is only called between add_interface 1488 * This callback is only called between add_interface and
1404 * and remove_interface calls, i.e. while the given virtual interface 1489 * remove_interface calls, i.e. while the given virtual interface
1405 * is enabled. 1490 * is enabled.
1406 * Returns a negative error code if the key can't be added. 1491 * Returns a negative error code if the key can't be added.
1492 * The callback can sleep.
1407 * 1493 *
1408 * @update_tkip_key: See the section "Hardware crypto acceleration" 1494 * @update_tkip_key: See the section "Hardware crypto acceleration"
1409 * This callback will be called in the context of Rx. Called for drivers 1495 * This callback will be called in the context of Rx. Called for drivers
1410 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY. 1496 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY.
1497 * The callback must be atomic.
1411 * 1498 *
1412 * @hw_scan: Ask the hardware to service the scan request, no need to start 1499 * @hw_scan: Ask the hardware to service the scan request, no need to start
1413 * the scan state machine in stack. The scan must honour the channel 1500 * the scan state machine in stack. The scan must honour the channel
@@ -1421,53 +1508,64 @@ enum ieee80211_ampdu_mlme_action {
1421 * When the scan finishes, ieee80211_scan_completed() must be called; 1508 * When the scan finishes, ieee80211_scan_completed() must be called;
1422 * note that it also must be called when the scan cannot finish due to 1509 * note that it also must be called when the scan cannot finish due to
1423 * any error unless this callback returned a negative error code. 1510 * any error unless this callback returned a negative error code.
1511 * The callback can sleep.
1424 * 1512 *
1425 * @sw_scan_start: Notifier function that is called just before a software scan 1513 * @sw_scan_start: Notifier function that is called just before a software scan
1426 * is started. Can be NULL, if the driver doesn't need this notification. 1514 * is started. Can be NULL, if the driver doesn't need this notification.
1515 * The callback can sleep.
1427 * 1516 *
1428 * @sw_scan_complete: Notifier function that is called just after a software scan 1517 * @sw_scan_complete: Notifier function that is called just after a
1429 * finished. Can be NULL, if the driver doesn't need this notification. 1518 * software scan finished. Can be NULL, if the driver doesn't need
1519 * this notification.
1520 * The callback can sleep.
1430 * 1521 *
1431 * @get_stats: Return low-level statistics. 1522 * @get_stats: Return low-level statistics.
1432 * Returns zero if statistics are available. 1523 * Returns zero if statistics are available.
1524 * The callback can sleep.
1433 * 1525 *
1434 * @get_tkip_seq: If your device implements TKIP encryption in hardware this 1526 * @get_tkip_seq: If your device implements TKIP encryption in hardware this
1435 * callback should be provided to read the TKIP transmit IVs (both IV32 1527 * callback should be provided to read the TKIP transmit IVs (both IV32
1436 * and IV16) for the given key from hardware. 1528 * and IV16) for the given key from hardware.
1529 * The callback must be atomic.
1437 * 1530 *
1438 * @set_rts_threshold: Configuration of RTS threshold (if device needs it) 1531 * @set_rts_threshold: Configuration of RTS threshold (if device needs it)
1532 * The callback can sleep.
1533 *
1534 * @sta_add: Notifies low level driver about addition of an associated station,
1535 * AP, IBSS/WDS/mesh peer etc. This callback can sleep.
1536 *
1537 * @sta_remove: Notifies low level driver about removal of an associated
1538 * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep.
1439 * 1539 *
1440 * @sta_notify: Notifies low level driver about addition, removal or power 1540 * @sta_notify: Notifies low level driver about power state transition of an
1441 * state transition of an associated station, AP, IBSS/WDS/mesh peer etc. 1541 * associated station, AP, IBSS/WDS/mesh peer etc. Must be atomic.
1442 * Must be atomic.
1443 * 1542 *
1444 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1543 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1445 * bursting) for a hardware TX queue. 1544 * bursting) for a hardware TX queue.
1446 * Returns a negative error code on failure. 1545 * Returns a negative error code on failure.
1447 * 1546 * The callback can sleep.
1448 * @get_tx_stats: Get statistics of the current TX queue status. This is used
1449 * to get number of currently queued packets (queue length), maximum queue
1450 * size (limit), and total number of packets sent using each TX queue
1451 * (count). The 'stats' pointer points to an array that has hw->queues
1452 * items.
1453 * 1547 *
1454 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, 1548 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
1455 * this is only used for IBSS mode BSSID merging and debugging. Is not a 1549 * this is only used for IBSS mode BSSID merging and debugging. Is not a
1456 * required function. 1550 * required function.
1551 * The callback can sleep.
1457 * 1552 *
1458 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. 1553 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware.
1459 * Currently, this is only used for IBSS mode debugging. Is not a 1554 * Currently, this is only used for IBSS mode debugging. Is not a
1460 * required function. 1555 * required function.
1556 * The callback can sleep.
1461 * 1557 *
1462 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize 1558 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize
1463 * with other STAs in the IBSS. This is only used in IBSS mode. This 1559 * with other STAs in the IBSS. This is only used in IBSS mode. This
1464 * function is optional if the firmware/hardware takes full care of 1560 * function is optional if the firmware/hardware takes full care of
1465 * TSF synchronization. 1561 * TSF synchronization.
1562 * The callback can sleep.
1466 * 1563 *
1467 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. 1564 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
1468 * This is needed only for IBSS mode and the result of this function is 1565 * This is needed only for IBSS mode and the result of this function is
1469 * used to determine whether to reply to Probe Requests. 1566 * used to determine whether to reply to Probe Requests.
1470 * Returns non-zero if this device sent the last beacon. 1567 * Returns non-zero if this device sent the last beacon.
1568 * The callback can sleep.
1471 * 1569 *
1472 * @ampdu_action: Perform a certain A-MPDU action 1570 * @ampdu_action: Perform a certain A-MPDU action
1473 * The RA/TID combination determines the destination and TID we want 1571 * The RA/TID combination determines the destination and TID we want
@@ -1476,21 +1574,32 @@ enum ieee80211_ampdu_mlme_action {
1476 * is the first frame we expect to perform the action on. Notice 1574 * is the first frame we expect to perform the action on. Notice
1477 * that TX/RX_STOP can pass NULL for this parameter. 1575 * that TX/RX_STOP can pass NULL for this parameter.
1478 * Returns a negative error code on failure. 1576 * Returns a negative error code on failure.
1577 * The callback must be atomic.
1479 * 1578 *
1480 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also 1579 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also
1481 * need to set wiphy->rfkill_poll to %true before registration, 1580 * need to set wiphy->rfkill_poll to %true before registration,
1482 * and need to call wiphy_rfkill_set_hw_state() in the callback. 1581 * and need to call wiphy_rfkill_set_hw_state() in the callback.
1582 * The callback can sleep.
1583 *
1584 * @set_coverage_class: Set slot time for given coverage class as specified
1585 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout
1586 * accordingly. This callback is not required and may sleep.
1483 * 1587 *
1484 * @testmode_cmd: Implement a cfg80211 test mode command. 1588 * @testmode_cmd: Implement a cfg80211 test mode command.
1589 * The callback can sleep.
1590 *
1591 * @flush: Flush all pending frames from the hardware queue, making sure
1592 * that the hardware queues are empty. If the parameter @drop is set
1593 * to %true, pending frames may be dropped. The callback can sleep.
1485 */ 1594 */
1486struct ieee80211_ops { 1595struct ieee80211_ops {
1487 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1596 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
1488 int (*start)(struct ieee80211_hw *hw); 1597 int (*start)(struct ieee80211_hw *hw);
1489 void (*stop)(struct ieee80211_hw *hw); 1598 void (*stop)(struct ieee80211_hw *hw);
1490 int (*add_interface)(struct ieee80211_hw *hw, 1599 int (*add_interface)(struct ieee80211_hw *hw,
1491 struct ieee80211_if_init_conf *conf); 1600 struct ieee80211_vif *vif);
1492 void (*remove_interface)(struct ieee80211_hw *hw, 1601 void (*remove_interface)(struct ieee80211_hw *hw,
1493 struct ieee80211_if_init_conf *conf); 1602 struct ieee80211_vif *vif);
1494 int (*config)(struct ieee80211_hw *hw, u32 changed); 1603 int (*config)(struct ieee80211_hw *hw, u32 changed);
1495 void (*bss_info_changed)(struct ieee80211_hw *hw, 1604 void (*bss_info_changed)(struct ieee80211_hw *hw,
1496 struct ieee80211_vif *vif, 1605 struct ieee80211_vif *vif,
@@ -1508,8 +1617,10 @@ struct ieee80211_ops {
1508 struct ieee80211_vif *vif, struct ieee80211_sta *sta, 1617 struct ieee80211_vif *vif, struct ieee80211_sta *sta,
1509 struct ieee80211_key_conf *key); 1618 struct ieee80211_key_conf *key);
1510 void (*update_tkip_key)(struct ieee80211_hw *hw, 1619 void (*update_tkip_key)(struct ieee80211_hw *hw,
1511 struct ieee80211_key_conf *conf, const u8 *address, 1620 struct ieee80211_vif *vif,
1512 u32 iv32, u16 *phase1key); 1621 struct ieee80211_key_conf *conf,
1622 struct ieee80211_sta *sta,
1623 u32 iv32, u16 *phase1key);
1513 int (*hw_scan)(struct ieee80211_hw *hw, 1624 int (*hw_scan)(struct ieee80211_hw *hw,
1514 struct cfg80211_scan_request *req); 1625 struct cfg80211_scan_request *req);
1515 void (*sw_scan_start)(struct ieee80211_hw *hw); 1626 void (*sw_scan_start)(struct ieee80211_hw *hw);
@@ -1519,12 +1630,14 @@ struct ieee80211_ops {
1519 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, 1630 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx,
1520 u32 *iv32, u16 *iv16); 1631 u32 *iv32, u16 *iv16);
1521 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); 1632 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
1633 int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1634 struct ieee80211_sta *sta);
1635 int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1636 struct ieee80211_sta *sta);
1522 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1637 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1523 enum sta_notify_cmd, struct ieee80211_sta *sta); 1638 enum sta_notify_cmd, struct ieee80211_sta *sta);
1524 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 1639 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
1525 const struct ieee80211_tx_queue_params *params); 1640 const struct ieee80211_tx_queue_params *params);
1526 int (*get_tx_stats)(struct ieee80211_hw *hw,
1527 struct ieee80211_tx_queue_stats *stats);
1528 u64 (*get_tsf)(struct ieee80211_hw *hw); 1641 u64 (*get_tsf)(struct ieee80211_hw *hw);
1529 void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf); 1642 void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf);
1530 void (*reset_tsf)(struct ieee80211_hw *hw); 1643 void (*reset_tsf)(struct ieee80211_hw *hw);
@@ -1535,9 +1648,11 @@ struct ieee80211_ops {
1535 struct ieee80211_sta *sta, u16 tid, u16 *ssn); 1648 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
1536 1649
1537 void (*rfkill_poll)(struct ieee80211_hw *hw); 1650 void (*rfkill_poll)(struct ieee80211_hw *hw);
1651 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
1538#ifdef CONFIG_NL80211_TESTMODE 1652#ifdef CONFIG_NL80211_TESTMODE
1539 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 1653 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
1540#endif 1654#endif
1655 void (*flush)(struct ieee80211_hw *hw, bool drop);
1541}; 1656};
1542 1657
1543/** 1658/**
@@ -1777,7 +1892,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1777/** 1892/**
1778 * ieee80211_beacon_get_tim - beacon generation function 1893 * ieee80211_beacon_get_tim - beacon generation function
1779 * @hw: pointer obtained from ieee80211_alloc_hw(). 1894 * @hw: pointer obtained from ieee80211_alloc_hw().
1780 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1895 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1781 * @tim_offset: pointer to variable that will receive the TIM IE offset. 1896 * @tim_offset: pointer to variable that will receive the TIM IE offset.
1782 * Set to 0 if invalid (in non-AP modes). 1897 * Set to 0 if invalid (in non-AP modes).
1783 * @tim_length: pointer to variable that will receive the TIM IE length, 1898 * @tim_length: pointer to variable that will receive the TIM IE length,
@@ -1805,7 +1920,7 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
1805/** 1920/**
1806 * ieee80211_beacon_get - beacon generation function 1921 * ieee80211_beacon_get - beacon generation function
1807 * @hw: pointer obtained from ieee80211_alloc_hw(). 1922 * @hw: pointer obtained from ieee80211_alloc_hw().
1808 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1923 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1809 * 1924 *
1810 * See ieee80211_beacon_get_tim(). 1925 * See ieee80211_beacon_get_tim().
1811 */ 1926 */
@@ -1816,9 +1931,56 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1816} 1931}
1817 1932
1818/** 1933/**
1934 * ieee80211_pspoll_get - retrieve a PS Poll template
1935 * @hw: pointer obtained from ieee80211_alloc_hw().
1936 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1937 *
1938 * Creates a PS Poll a template which can, for example, uploaded to
1939 * hardware. The template must be updated after association so that correct
1940 * AID, BSSID and MAC address is used.
1941 *
1942 * Note: Caller (or hardware) is responsible for setting the
1943 * &IEEE80211_FCTL_PM bit.
1944 */
1945struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
1946 struct ieee80211_vif *vif);
1947
1948/**
1949 * ieee80211_nullfunc_get - retrieve a nullfunc template
1950 * @hw: pointer obtained from ieee80211_alloc_hw().
1951 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1952 *
1953 * Creates a Nullfunc template which can, for example, uploaded to
1954 * hardware. The template must be updated after association so that correct
1955 * BSSID and address is used.
1956 *
1957 * Note: Caller (or hardware) is responsible for setting the
1958 * &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields.
1959 */
1960struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
1961 struct ieee80211_vif *vif);
1962
1963/**
1964 * ieee80211_probereq_get - retrieve a Probe Request template
1965 * @hw: pointer obtained from ieee80211_alloc_hw().
1966 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1967 * @ssid: SSID buffer
1968 * @ssid_len: length of SSID
1969 * @ie: buffer containing all IEs except SSID for the template
1970 * @ie_len: length of the IE buffer
1971 *
1972 * Creates a Probe Request template which can, for example, be uploaded to
1973 * hardware.
1974 */
1975struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw,
1976 struct ieee80211_vif *vif,
1977 const u8 *ssid, size_t ssid_len,
1978 const u8 *ie, size_t ie_len);
1979
1980/**
1819 * ieee80211_rts_get - RTS frame generation function 1981 * ieee80211_rts_get - RTS frame generation function
1820 * @hw: pointer obtained from ieee80211_alloc_hw(). 1982 * @hw: pointer obtained from ieee80211_alloc_hw().
1821 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1983 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1822 * @frame: pointer to the frame that is going to be protected by the RTS. 1984 * @frame: pointer to the frame that is going to be protected by the RTS.
1823 * @frame_len: the frame length (in octets). 1985 * @frame_len: the frame length (in octets).
1824 * @frame_txctl: &struct ieee80211_tx_info of the frame. 1986 * @frame_txctl: &struct ieee80211_tx_info of the frame.
@@ -1837,7 +1999,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1837/** 1999/**
1838 * ieee80211_rts_duration - Get the duration field for an RTS frame 2000 * ieee80211_rts_duration - Get the duration field for an RTS frame
1839 * @hw: pointer obtained from ieee80211_alloc_hw(). 2001 * @hw: pointer obtained from ieee80211_alloc_hw().
1840 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2002 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1841 * @frame_len: the length of the frame that is going to be protected by the RTS. 2003 * @frame_len: the length of the frame that is going to be protected by the RTS.
1842 * @frame_txctl: &struct ieee80211_tx_info of the frame. 2004 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1843 * 2005 *
@@ -1852,7 +2014,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1852/** 2014/**
1853 * ieee80211_ctstoself_get - CTS-to-self frame generation function 2015 * ieee80211_ctstoself_get - CTS-to-self frame generation function
1854 * @hw: pointer obtained from ieee80211_alloc_hw(). 2016 * @hw: pointer obtained from ieee80211_alloc_hw().
1855 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2017 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1856 * @frame: pointer to the frame that is going to be protected by the CTS-to-self. 2018 * @frame: pointer to the frame that is going to be protected by the CTS-to-self.
1857 * @frame_len: the frame length (in octets). 2019 * @frame_len: the frame length (in octets).
1858 * @frame_txctl: &struct ieee80211_tx_info of the frame. 2020 * @frame_txctl: &struct ieee80211_tx_info of the frame.
@@ -1872,7 +2034,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1872/** 2034/**
1873 * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame 2035 * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame
1874 * @hw: pointer obtained from ieee80211_alloc_hw(). 2036 * @hw: pointer obtained from ieee80211_alloc_hw().
1875 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2037 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1876 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. 2038 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self.
1877 * @frame_txctl: &struct ieee80211_tx_info of the frame. 2039 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1878 * 2040 *
@@ -1888,7 +2050,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1888/** 2050/**
1889 * ieee80211_generic_frame_duration - Calculate the duration field for a frame 2051 * ieee80211_generic_frame_duration - Calculate the duration field for a frame
1890 * @hw: pointer obtained from ieee80211_alloc_hw(). 2052 * @hw: pointer obtained from ieee80211_alloc_hw().
1891 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2053 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1892 * @frame_len: the length of the frame. 2054 * @frame_len: the length of the frame.
1893 * @rate: the rate at which the frame is going to be transmitted. 2055 * @rate: the rate at which the frame is going to be transmitted.
1894 * 2056 *
@@ -1903,7 +2065,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1903/** 2065/**
1904 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames 2066 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames
1905 * @hw: pointer as obtained from ieee80211_alloc_hw(). 2067 * @hw: pointer as obtained from ieee80211_alloc_hw().
1906 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2068 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1907 * 2069 *
1908 * Function for accessing buffered broadcast and multicast frames. If 2070 * Function for accessing buffered broadcast and multicast frames. If
1909 * hardware/firmware does not implement buffering of broadcast/multicast 2071 * hardware/firmware does not implement buffering of broadcast/multicast
@@ -2071,7 +2233,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid);
2071 2233
2072/** 2234/**
2073 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. 2235 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate.
2074 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2236 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2075 * @ra: receiver address of the BA session recipient. 2237 * @ra: receiver address of the BA session recipient.
2076 * @tid: the TID to BA on. 2238 * @tid: the TID to BA on.
2077 * 2239 *
@@ -2082,7 +2244,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
2082 2244
2083/** 2245/**
2084 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. 2246 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
2085 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2247 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2086 * @ra: receiver address of the BA session recipient. 2248 * @ra: receiver address of the BA session recipient.
2087 * @tid: the TID to BA on. 2249 * @tid: the TID to BA on.
2088 * 2250 *
@@ -2110,7 +2272,7 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid,
2110 2272
2111/** 2273/**
2112 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. 2274 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate.
2113 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2275 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2114 * @ra: receiver address of the BA session recipient. 2276 * @ra: receiver address of the BA session recipient.
2115 * @tid: the desired TID to BA on. 2277 * @tid: the desired TID to BA on.
2116 * 2278 *
@@ -2121,7 +2283,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
2121 2283
2122/** 2284/**
2123 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. 2285 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
2124 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2286 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2125 * @ra: receiver address of the BA session recipient. 2287 * @ra: receiver address of the BA session recipient.
2126 * @tid: the desired TID to BA on. 2288 * @tid: the desired TID to BA on.
2127 * 2289 *
@@ -2200,7 +2362,7 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
2200/** 2362/**
2201 * ieee80211_beacon_loss - inform hardware does not receive beacons 2363 * ieee80211_beacon_loss - inform hardware does not receive beacons
2202 * 2364 *
2203 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2365 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2204 * 2366 *
2205 * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and 2367 * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and
2206 * IEEE80211_CONF_PS is set, the driver needs to inform whenever the 2368 * IEEE80211_CONF_PS is set, the driver needs to inform whenever the
@@ -2234,8 +2396,12 @@ enum rate_control_changed {
2234 * @short_preamble: whether mac80211 will request short-preamble transmission 2396 * @short_preamble: whether mac80211 will request short-preamble transmission
2235 * if the selected rate supports it 2397 * if the selected rate supports it
2236 * @max_rate_idx: user-requested maximum rate (not MCS for now) 2398 * @max_rate_idx: user-requested maximum rate (not MCS for now)
2399 * (deprecated; this will be removed once drivers get updated to use
2400 * rate_idx_mask)
2401 * @rate_idx_mask: user-requested rate mask (not MCS for now)
2237 * @skb: the skb that will be transmitted, the control information in it needs 2402 * @skb: the skb that will be transmitted, the control information in it needs
2238 * to be filled in 2403 * to be filled in
2404 * @ap: whether this frame is sent out in AP mode
2239 */ 2405 */
2240struct ieee80211_tx_rate_control { 2406struct ieee80211_tx_rate_control {
2241 struct ieee80211_hw *hw; 2407 struct ieee80211_hw *hw;
@@ -2245,6 +2411,8 @@ struct ieee80211_tx_rate_control {
2245 struct ieee80211_tx_rate reported_rate; 2411 struct ieee80211_tx_rate reported_rate;
2246 bool rts, short_preamble; 2412 bool rts, short_preamble;
2247 u8 max_rate_idx; 2413 u8 max_rate_idx;
2414 u32 rate_idx_mask;
2415 bool ap;
2248}; 2416};
2249 2417
2250struct rate_control_ops { 2418struct rate_control_ops {
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index b0173202cad9..da1d58be31b7 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -164,7 +164,7 @@ struct neigh_table {
164 rwlock_t lock; 164 rwlock_t lock;
165 unsigned long last_rand; 165 unsigned long last_rand;
166 struct kmem_cache *kmem_cachep; 166 struct kmem_cache *kmem_cachep;
167 struct neigh_statistics *stats; 167 struct neigh_statistics __percpu *stats;
168 struct neighbour **hash_buckets; 168 struct neighbour **hash_buckets;
169 unsigned int hash_mask; 169 unsigned int hash_mask;
170 __u32 hash_rnd; 170 __u32 hash_rnd;
@@ -251,7 +251,6 @@ extern void neigh_seq_stop(struct seq_file *, void *);
251 251
252extern int neigh_sysctl_register(struct net_device *dev, 252extern int neigh_sysctl_register(struct net_device *dev,
253 struct neigh_parms *p, 253 struct neigh_parms *p,
254 int p_id, int pdev_id,
255 char *p_name, 254 char *p_name,
256 proc_handler *proc_handler); 255 proc_handler *proc_handler);
257extern void neigh_sysctl_unregister(struct neigh_parms *p); 256extern void neigh_sysctl_unregister(struct neigh_parms *p);
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index f307e133d14c..82b7be4db89a 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -81,6 +81,8 @@ struct net {
81#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 81#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
82 struct netns_ct ct; 82 struct netns_ct ct;
83#endif 83#endif
84 struct sock *nfnl;
85 struct sock *nfnl_stash;
84#endif 86#endif
85#ifdef CONFIG_XFRM 87#ifdef CONFIG_XFRM
86 struct netns_xfrm xfrm; 88 struct netns_xfrm xfrm;
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index a0904adfb8f7..bde095f7e845 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -70,7 +70,7 @@ union nf_conntrack_help {
70struct nf_conntrack_helper; 70struct nf_conntrack_helper;
71 71
72/* Must be kept in sync with the classes defined by helpers */ 72/* Must be kept in sync with the classes defined by helpers */
73#define NF_CT_MAX_EXPECT_CLASSES 3 73#define NF_CT_MAX_EXPECT_CLASSES 4
74 74
75/* nf_conn feature for connections that have a helper */ 75/* nf_conn feature for connections that have a helper */
76struct nf_conn_help { 76struct nf_conn_help {
@@ -198,7 +198,8 @@ extern void *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced, int null
198extern void nf_ct_free_hashtable(void *hash, int vmalloced, unsigned int size); 198extern void nf_ct_free_hashtable(void *hash, int vmalloced, unsigned int size);
199 199
200extern struct nf_conntrack_tuple_hash * 200extern struct nf_conntrack_tuple_hash *
201__nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple); 201__nf_conntrack_find(struct net *net, u16 zone,
202 const struct nf_conntrack_tuple *tuple);
202 203
203extern void nf_conntrack_hash_insert(struct nf_conn *ct); 204extern void nf_conntrack_hash_insert(struct nf_conn *ct);
204extern void nf_ct_delete_from_lists(struct nf_conn *ct); 205extern void nf_ct_delete_from_lists(struct nf_conn *ct);
@@ -267,11 +268,16 @@ extern void
267nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data); 268nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data);
268extern void nf_conntrack_free(struct nf_conn *ct); 269extern void nf_conntrack_free(struct nf_conn *ct);
269extern struct nf_conn * 270extern struct nf_conn *
270nf_conntrack_alloc(struct net *net, 271nf_conntrack_alloc(struct net *net, u16 zone,
271 const struct nf_conntrack_tuple *orig, 272 const struct nf_conntrack_tuple *orig,
272 const struct nf_conntrack_tuple *repl, 273 const struct nf_conntrack_tuple *repl,
273 gfp_t gfp); 274 gfp_t gfp);
274 275
276static inline int nf_ct_is_template(const struct nf_conn *ct)
277{
278 return test_bit(IPS_TEMPLATE_BIT, &ct->status);
279}
280
275/* It's confirmed if it is, or has been in the hash table. */ 281/* It's confirmed if it is, or has been in the hash table. */
276static inline int nf_ct_is_confirmed(struct nf_conn *ct) 282static inline int nf_ct_is_confirmed(struct nf_conn *ct)
277{ 283{
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index 5a449b44ba33..dffde8e6920e 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -49,7 +49,8 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
49 49
50/* Find a connection corresponding to a tuple. */ 50/* Find a connection corresponding to a tuple. */
51extern struct nf_conntrack_tuple_hash * 51extern struct nf_conntrack_tuple_hash *
52nf_conntrack_find_get(struct net *net, const struct nf_conntrack_tuple *tuple); 52nf_conntrack_find_get(struct net *net, u16 zone,
53 const struct nf_conntrack_tuple *tuple);
53 54
54extern int __nf_conntrack_confirm(struct sk_buff *skb); 55extern int __nf_conntrack_confirm(struct sk_buff *skb);
55 56
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h
index 475facc3051a..96ba5f7dcab6 100644
--- a/include/net/netfilter/nf_conntrack_ecache.h
+++ b/include/net/netfilter/nf_conntrack_ecache.h
@@ -12,27 +12,12 @@
12#include <linux/netfilter/nf_conntrack_tuple_common.h> 12#include <linux/netfilter/nf_conntrack_tuple_common.h>
13#include <net/netfilter/nf_conntrack_extend.h> 13#include <net/netfilter/nf_conntrack_extend.h>
14 14
15/* Connection tracking event types */
16enum ip_conntrack_events {
17 IPCT_NEW = 0, /* new conntrack */
18 IPCT_RELATED = 1, /* related conntrack */
19 IPCT_DESTROY = 2, /* destroyed conntrack */
20 IPCT_STATUS = 3, /* status has changed */
21 IPCT_PROTOINFO = 4, /* protocol information has changed */
22 IPCT_HELPER = 5, /* new helper has been set */
23 IPCT_MARK = 6, /* new mark has been set */
24 IPCT_NATSEQADJ = 7, /* NAT is doing sequence adjustment */
25 IPCT_SECMARK = 8, /* new security mark has been set */
26};
27
28enum ip_conntrack_expect_events {
29 IPEXP_NEW = 0, /* new expectation */
30};
31
32struct nf_conntrack_ecache { 15struct nf_conntrack_ecache {
33 unsigned long cache; /* bitops want long */ 16 unsigned long cache; /* bitops want long */
34 unsigned long missed; /* missed events */ 17 unsigned long missed; /* missed events */
35 u32 pid; /* netlink pid of destroyer */ 18 u16 ctmask; /* bitmask of ct events to be delivered */
19 u16 expmask; /* bitmask of expect events to be delivered */
20 u32 pid; /* netlink pid of destroyer */
36}; 21};
37 22
38static inline struct nf_conntrack_ecache * 23static inline struct nf_conntrack_ecache *
@@ -42,14 +27,24 @@ nf_ct_ecache_find(const struct nf_conn *ct)
42} 27}
43 28
44static inline struct nf_conntrack_ecache * 29static inline struct nf_conntrack_ecache *
45nf_ct_ecache_ext_add(struct nf_conn *ct, gfp_t gfp) 30nf_ct_ecache_ext_add(struct nf_conn *ct, u16 ctmask, u16 expmask, gfp_t gfp)
46{ 31{
47 struct net *net = nf_ct_net(ct); 32 struct net *net = nf_ct_net(ct);
33 struct nf_conntrack_ecache *e;
48 34
49 if (!net->ct.sysctl_events) 35 if (!ctmask && !expmask && net->ct.sysctl_events) {
36 ctmask = ~0;
37 expmask = ~0;
38 }
39 if (!ctmask && !expmask)
50 return NULL; 40 return NULL;
51 41
52 return nf_ct_ext_add(ct, NF_CT_EXT_ECACHE, gfp); 42 e = nf_ct_ext_add(ct, NF_CT_EXT_ECACHE, gfp);
43 if (e) {
44 e->ctmask = ctmask;
45 e->expmask = expmask;
46 }
47 return e;
53}; 48};
54 49
55#ifdef CONFIG_NF_CONNTRACK_EVENTS 50#ifdef CONFIG_NF_CONNTRACK_EVENTS
@@ -82,6 +77,9 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
82 if (e == NULL) 77 if (e == NULL)
83 return; 78 return;
84 79
80 if (!(e->ctmask & (1 << event)))
81 return;
82
85 set_bit(event, &e->cache); 83 set_bit(event, &e->cache);
86} 84}
87 85
@@ -92,7 +90,6 @@ nf_conntrack_eventmask_report(unsigned int eventmask,
92 int report) 90 int report)
93{ 91{
94 int ret = 0; 92 int ret = 0;
95 struct net *net = nf_ct_net(ct);
96 struct nf_ct_event_notifier *notify; 93 struct nf_ct_event_notifier *notify;
97 struct nf_conntrack_ecache *e; 94 struct nf_conntrack_ecache *e;
98 95
@@ -101,9 +98,6 @@ nf_conntrack_eventmask_report(unsigned int eventmask,
101 if (notify == NULL) 98 if (notify == NULL)
102 goto out_unlock; 99 goto out_unlock;
103 100
104 if (!net->ct.sysctl_events)
105 goto out_unlock;
106
107 e = nf_ct_ecache_find(ct); 101 e = nf_ct_ecache_find(ct);
108 if (e == NULL) 102 if (e == NULL)
109 goto out_unlock; 103 goto out_unlock;
@@ -117,6 +111,9 @@ nf_conntrack_eventmask_report(unsigned int eventmask,
117 /* This is a resent of a destroy event? If so, skip missed */ 111 /* This is a resent of a destroy event? If so, skip missed */
118 unsigned long missed = e->pid ? 0 : e->missed; 112 unsigned long missed = e->pid ? 0 : e->missed;
119 113
114 if (!((eventmask | missed) & e->ctmask))
115 goto out_unlock;
116
120 ret = notify->fcn(eventmask | missed, &item); 117 ret = notify->fcn(eventmask | missed, &item);
121 if (unlikely(ret < 0 || missed)) { 118 if (unlikely(ret < 0 || missed)) {
122 spin_lock_bh(&ct->lock); 119 spin_lock_bh(&ct->lock);
@@ -172,18 +169,19 @@ nf_ct_expect_event_report(enum ip_conntrack_expect_events event,
172 u32 pid, 169 u32 pid,
173 int report) 170 int report)
174{ 171{
175 struct net *net = nf_ct_exp_net(exp);
176 struct nf_exp_event_notifier *notify; 172 struct nf_exp_event_notifier *notify;
173 struct nf_conntrack_ecache *e;
177 174
178 rcu_read_lock(); 175 rcu_read_lock();
179 notify = rcu_dereference(nf_expect_event_cb); 176 notify = rcu_dereference(nf_expect_event_cb);
180 if (notify == NULL) 177 if (notify == NULL)
181 goto out_unlock; 178 goto out_unlock;
182 179
183 if (!net->ct.sysctl_events) 180 e = nf_ct_ecache_find(exp->master);
181 if (e == NULL)
184 goto out_unlock; 182 goto out_unlock;
185 183
186 { 184 if (e->expmask & (1 << event)) {
187 struct nf_exp_event item = { 185 struct nf_exp_event item = {
188 .exp = exp, 186 .exp = exp,
189 .pid = pid, 187 .pid = pid,
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index 9a2b9cb52271..11e815084fcf 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -56,16 +56,13 @@ struct nf_conntrack_expect {
56 56
57static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp) 57static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp)
58{ 58{
59#ifdef CONFIG_NET_NS 59 return nf_ct_net(exp->master);
60 return exp->master->ct_net; /* by definition */
61#else
62 return &init_net;
63#endif
64} 60}
65 61
66struct nf_conntrack_expect_policy { 62struct nf_conntrack_expect_policy {
67 unsigned int max_expected; 63 unsigned int max_expected;
68 unsigned int timeout; 64 unsigned int timeout;
65 const char *name;
69}; 66};
70 67
71#define NF_CT_EXPECT_CLASS_DEFAULT 0 68#define NF_CT_EXPECT_CLASS_DEFAULT 0
@@ -77,13 +74,16 @@ int nf_conntrack_expect_init(struct net *net);
77void nf_conntrack_expect_fini(struct net *net); 74void nf_conntrack_expect_fini(struct net *net);
78 75
79struct nf_conntrack_expect * 76struct nf_conntrack_expect *
80__nf_ct_expect_find(struct net *net, const struct nf_conntrack_tuple *tuple); 77__nf_ct_expect_find(struct net *net, u16 zone,
78 const struct nf_conntrack_tuple *tuple);
81 79
82struct nf_conntrack_expect * 80struct nf_conntrack_expect *
83nf_ct_expect_find_get(struct net *net, const struct nf_conntrack_tuple *tuple); 81nf_ct_expect_find_get(struct net *net, u16 zone,
82 const struct nf_conntrack_tuple *tuple);
84 83
85struct nf_conntrack_expect * 84struct nf_conntrack_expect *
86nf_ct_find_expectation(struct net *net, const struct nf_conntrack_tuple *tuple); 85nf_ct_find_expectation(struct net *net, u16 zone,
86 const struct nf_conntrack_tuple *tuple);
87 87
88void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); 88void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
89void nf_ct_remove_expectations(struct nf_conn *ct); 89void nf_ct_remove_expectations(struct nf_conn *ct);
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index e192dc17c583..2d2a1f9a61d8 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -8,6 +8,7 @@ enum nf_ct_ext_id {
8 NF_CT_EXT_NAT, 8 NF_CT_EXT_NAT,
9 NF_CT_EXT_ACCT, 9 NF_CT_EXT_ACCT,
10 NF_CT_EXT_ECACHE, 10 NF_CT_EXT_ECACHE,
11 NF_CT_EXT_ZONE,
11 NF_CT_EXT_NUM, 12 NF_CT_EXT_NUM,
12}; 13};
13 14
@@ -15,6 +16,7 @@ enum nf_ct_ext_id {
15#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat 16#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat
16#define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter 17#define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter
17#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache 18#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache
19#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone
18 20
19/* Extensions: optional stuff which isn't permanently in struct. */ 21/* Extensions: optional stuff which isn't permanently in struct. */
20struct nf_ct_ext { 22struct nf_ct_ext {
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index d015de92e03f..32c305dbdab6 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -40,14 +40,18 @@ struct nf_conntrack_helper {
40}; 40};
41 41
42extern struct nf_conntrack_helper * 42extern struct nf_conntrack_helper *
43__nf_conntrack_helper_find_byname(const char *name); 43__nf_conntrack_helper_find(const char *name, u16 l3num, u8 protonum);
44
45extern struct nf_conntrack_helper *
46nf_conntrack_helper_try_module_get(const char *name, u16 l3num, u8 protonum);
44 47
45extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); 48extern int nf_conntrack_helper_register(struct nf_conntrack_helper *);
46extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); 49extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);
47 50
48extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp); 51extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp);
49 52
50extern int __nf_ct_try_assign_helper(struct nf_conn *ct, gfp_t flags); 53extern int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl,
54 gfp_t flags);
51 55
52extern void nf_ct_helper_destroy(struct nf_conn *ct); 56extern void nf_ct_helper_destroy(struct nf_conn *ct);
53 57
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index ca6dcf3445ab..e3d3ee3c06a2 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -49,8 +49,8 @@ struct nf_conntrack_l4proto {
49 /* Called when a conntrack entry is destroyed */ 49 /* Called when a conntrack entry is destroyed */
50 void (*destroy)(struct nf_conn *ct); 50 void (*destroy)(struct nf_conn *ct);
51 51
52 int (*error)(struct net *net, struct sk_buff *skb, unsigned int dataoff, 52 int (*error)(struct net *net, struct nf_conn *tmpl, struct sk_buff *skb,
53 enum ip_conntrack_info *ctinfo, 53 unsigned int dataoff, enum ip_conntrack_info *ctinfo,
54 u_int8_t pf, unsigned int hooknum); 54 u_int8_t pf, unsigned int hooknum);
55 55
56 /* Print out the per-protocol part of the tuple. Return like seq_* */ 56 /* Print out the per-protocol part of the tuple. Return like seq_* */
diff --git a/include/net/netfilter/nf_conntrack_zones.h b/include/net/netfilter/nf_conntrack_zones.h
new file mode 100644
index 000000000000..034efe8d45a5
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_zones.h
@@ -0,0 +1,25 @@
1#ifndef _NF_CONNTRACK_ZONES_H
2#define _NF_CONNTRACK_ZONES_H
3
4#define NF_CT_DEFAULT_ZONE 0
5
6#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
7#include <net/netfilter/nf_conntrack_extend.h>
8
9struct nf_conntrack_zone {
10 u16 id;
11};
12
13static inline u16 nf_ct_zone(const struct nf_conn *ct)
14{
15#ifdef CONFIG_NF_CONNTRACK_ZONES
16 struct nf_conntrack_zone *nf_ct_zone;
17 nf_ct_zone = nf_ct_ext_find(ct, NF_CT_EXT_ZONE);
18 if (nf_ct_zone)
19 return nf_ct_zone->id;
20#endif
21 return NF_CT_DEFAULT_ZONE;
22}
23
24#endif /* CONFIG_NF_CONNTRACK || CONFIG_NF_CONNTRACK_MODULE */
25#endif /* _NF_CONNTRACK_ZONES_H */
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h
index 4222220920a5..02bb6c29dc3d 100644
--- a/include/net/netfilter/nf_nat_helper.h
+++ b/include/net/netfilter/nf_nat_helper.h
@@ -7,13 +7,27 @@
7struct sk_buff; 7struct sk_buff;
8 8
9/* These return true or false. */ 9/* These return true or false. */
10extern int nf_nat_mangle_tcp_packet(struct sk_buff *skb, 10extern int __nf_nat_mangle_tcp_packet(struct sk_buff *skb,
11 struct nf_conn *ct, 11 struct nf_conn *ct,
12 enum ip_conntrack_info ctinfo, 12 enum ip_conntrack_info ctinfo,
13 unsigned int match_offset, 13 unsigned int match_offset,
14 unsigned int match_len, 14 unsigned int match_len,
15 const char *rep_buffer, 15 const char *rep_buffer,
16 unsigned int rep_len); 16 unsigned int rep_len, bool adjust);
17
18static inline int nf_nat_mangle_tcp_packet(struct sk_buff *skb,
19 struct nf_conn *ct,
20 enum ip_conntrack_info ctinfo,
21 unsigned int match_offset,
22 unsigned int match_len,
23 const char *rep_buffer,
24 unsigned int rep_len)
25{
26 return __nf_nat_mangle_tcp_packet(skb, ct, ctinfo,
27 match_offset, match_len,
28 rep_buffer, rep_len, true);
29}
30
17extern int nf_nat_mangle_udp_packet(struct sk_buff *skb, 31extern int nf_nat_mangle_udp_packet(struct sk_buff *skb,
18 struct nf_conn *ct, 32 struct nf_conn *ct,
19 enum ip_conntrack_info ctinfo, 33 enum ip_conntrack_info ctinfo,
@@ -21,6 +35,10 @@ extern int nf_nat_mangle_udp_packet(struct sk_buff *skb,
21 unsigned int match_len, 35 unsigned int match_len,
22 const char *rep_buffer, 36 const char *rep_buffer,
23 unsigned int rep_len); 37 unsigned int rep_len);
38
39extern void nf_nat_set_seq_adjust(struct nf_conn *ct,
40 enum ip_conntrack_info ctinfo,
41 __be32 seq, s16 off);
24extern int nf_nat_seq_adjust(struct sk_buff *skb, 42extern int nf_nat_seq_adjust(struct sk_buff *skb,
25 struct nf_conn *ct, 43 struct nf_conn *ct,
26 enum ip_conntrack_info ctinfo); 44 enum ip_conntrack_info ctinfo);
diff --git a/include/net/netlink.h b/include/net/netlink.h
index a63b2192ac1c..f82e463c875a 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -196,7 +196,7 @@ enum {
196 * All other Exact length of attribute payload 196 * All other Exact length of attribute payload
197 * 197 *
198 * Example: 198 * Example:
199 * static struct nla_policy my_policy[ATTR_MAX+1] __read_mostly = { 199 * static const struct nla_policy my_policy[ATTR_MAX+1] = {
200 * [ATTR_FOO] = { .type = NLA_U16 }, 200 * [ATTR_FOO] = { .type = NLA_U16 },
201 * [ATTR_BAR] = { .type = NLA_STRING, .len = BARSIZ }, 201 * [ATTR_BAR] = { .type = NLA_STRING, .len = BARSIZ },
202 * [ATTR_BAZ] = { .len = sizeof(struct mystruct) }, 202 * [ATTR_BAZ] = { .len = sizeof(struct mystruct) },
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index 63d449807d9b..d4958d4c6574 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -17,7 +17,7 @@ struct netns_ct {
17 struct hlist_head *expect_hash; 17 struct hlist_head *expect_hash;
18 struct hlist_nulls_head unconfirmed; 18 struct hlist_nulls_head unconfirmed;
19 struct hlist_nulls_head dying; 19 struct hlist_nulls_head dying;
20 struct ip_conntrack_stat *stat; 20 struct ip_conntrack_stat __percpu *stat;
21 int sysctl_events; 21 int sysctl_events;
22 unsigned int sysctl_events_retry_timeout; 22 unsigned int sysctl_events_retry_timeout;
23 int sysctl_acct; 23 int sysctl_acct;
diff --git a/include/net/netns/core.h b/include/net/netns/core.h
index 24d4be76bbd1..78eb1ff75475 100644
--- a/include/net/netns/core.h
+++ b/include/net/netns/core.h
@@ -10,7 +10,7 @@ struct netns_core {
10 10
11 int sysctl_somaxconn; 11 int sysctl_somaxconn;
12 12
13 struct prot_inuse *inuse; 13 struct prot_inuse __percpu *inuse;
14}; 14};
15 15
16#endif 16#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 9a4b8b714079..2764994c9136 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -37,7 +37,9 @@ struct netns_ipv4 {
37 struct xt_table *iptable_mangle; 37 struct xt_table *iptable_mangle;
38 struct xt_table *iptable_raw; 38 struct xt_table *iptable_raw;
39 struct xt_table *arptable_filter; 39 struct xt_table *arptable_filter;
40#ifdef CONFIG_SECURITY
40 struct xt_table *iptable_security; 41 struct xt_table *iptable_security;
42#endif
41 struct xt_table *nat_table; 43 struct xt_table *nat_table;
42 struct hlist_head *nat_bysource; 44 struct hlist_head *nat_bysource;
43 unsigned int nat_htable_size; 45 unsigned int nat_htable_size;
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index dfeb2d7c425b..1f11ebc22151 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -36,8 +36,10 @@ struct netns_ipv6 {
36 struct xt_table *ip6table_filter; 36 struct xt_table *ip6table_filter;
37 struct xt_table *ip6table_mangle; 37 struct xt_table *ip6table_mangle;
38 struct xt_table *ip6table_raw; 38 struct xt_table *ip6table_raw;
39#ifdef CONFIG_SECURITY
39 struct xt_table *ip6table_security; 40 struct xt_table *ip6table_security;
40#endif 41#endif
42#endif
41 struct rt6_info *ip6_null_entry; 43 struct rt6_info *ip6_null_entry;
42 struct rt6_statistics *rt6_stats; 44 struct rt6_statistics *rt6_stats;
43 struct timer_list ip6_fib_timer; 45 struct timer_list ip6_fib_timer;
diff --git a/include/net/netns/packet.h b/include/net/netns/packet.h
index 637daf698884..cb4e894c0f8d 100644
--- a/include/net/netns/packet.h
+++ b/include/net/netns/packet.h
@@ -4,11 +4,11 @@
4#ifndef __NETNS_PACKET_H__ 4#ifndef __NETNS_PACKET_H__
5#define __NETNS_PACKET_H__ 5#define __NETNS_PACKET_H__
6 6
7#include <linux/list.h> 7#include <linux/rculist.h>
8#include <linux/spinlock.h> 8#include <linux/spinlock.h>
9 9
10struct netns_packet { 10struct netns_packet {
11 rwlock_t sklist_lock; 11 spinlock_t sklist_lock;
12 struct hlist_head sklist; 12 struct hlist_head sklist;
13}; 13};
14 14
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h
index 4c61cdce4e5f..35672b1cf44a 100644
--- a/include/net/phonet/pep.h
+++ b/include/net/phonet/pep.h
@@ -44,6 +44,7 @@ struct pep_sock {
44 u8 rx_fc; /* RX flow control */ 44 u8 rx_fc; /* RX flow control */
45 u8 tx_fc; /* TX flow control */ 45 u8 tx_fc; /* TX flow control */
46 u8 init_enable; /* auto-enable at creation */ 46 u8 init_enable; /* auto-enable at creation */
47 u8 aligned;
47}; 48};
48 49
49static inline struct pep_sock *pep_sk(struct sock *sk) 50static inline struct pep_sock *pep_sk(struct sock *sk)
@@ -77,6 +78,7 @@ static inline struct pnpipehdr *pnp_hdr(struct sk_buff *skb)
77 78
78enum { 79enum {
79 PNS_PIPE_DATA = 0x20, 80 PNS_PIPE_DATA = 0x20,
81 PNS_PIPE_ALIGNED_DATA,
80 82
81 PNS_PEP_CONNECT_REQ = 0x40, 83 PNS_PEP_CONNECT_REQ = 0x40,
82 PNS_PEP_CONNECT_RESP, 84 PNS_PEP_CONNECT_RESP,
@@ -138,6 +140,7 @@ enum {
138 PN_PIPE_SB_NEGOTIATED_FC, 140 PN_PIPE_SB_NEGOTIATED_FC,
139 PN_PIPE_SB_REQUIRED_FC_TX, 141 PN_PIPE_SB_REQUIRED_FC_TX,
140 PN_PIPE_SB_PREFERRED_FC_RX, 142 PN_PIPE_SB_PREFERRED_FC_RX,
143 PN_PIPE_SB_ALIGNED_DATA,
141}; 144};
142 145
143/* Phonet pipe flow control models */ 146/* Phonet pipe flow control models */
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 2d567265363e..b6cdc33b39c1 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -71,6 +71,7 @@ extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
71 71
72extern struct Qdisc_ops pfifo_qdisc_ops; 72extern struct Qdisc_ops pfifo_qdisc_ops;
73extern struct Qdisc_ops bfifo_qdisc_ops; 73extern struct Qdisc_ops bfifo_qdisc_ops;
74extern struct Qdisc_ops pfifo_head_drop_qdisc_ops;
74 75
75extern int fifo_set_limit(struct Qdisc *q, unsigned int limit); 76extern int fifo_set_limit(struct Qdisc *q, unsigned int limit);
76extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops, 77extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index 47995b81c5d7..f873ee37f7e4 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -39,6 +39,7 @@ enum environment_cap {
39 * 00 - World regulatory domain 39 * 00 - World regulatory domain
40 * 99 - built by driver but a specific alpha2 cannot be determined 40 * 99 - built by driver but a specific alpha2 cannot be determined
41 * 98 - result of an intersection between two regulatory domains 41 * 98 - result of an intersection between two regulatory domains
42 * 97 - regulatory domain has not yet been configured
42 * @intersect: indicates whether the wireless core should intersect 43 * @intersect: indicates whether the wireless core should intersect
43 * the requested regulatory domain with the presently set regulatory 44 * the requested regulatory domain with the presently set regulatory
44 * domain. 45 * domain.
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index c9b50ebd9ce9..99e6e19b57c2 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -45,6 +45,8 @@ struct request_sock_ops {
45 void (*send_reset)(struct sock *sk, 45 void (*send_reset)(struct sock *sk,
46 struct sk_buff *skb); 46 struct sk_buff *skb);
47 void (*destructor)(struct request_sock *req); 47 void (*destructor)(struct request_sock *req);
48 void (*syn_ack_timeout)(struct sock *sk,
49 struct request_sock *req);
48}; 50};
49 51
50/* struct request_sock - mini sock to represent a connection request 52/* struct request_sock - mini sock to represent a connection request
diff --git a/include/net/route.h b/include/net/route.h
index bce6dd68d27b..2c9fba7f7731 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -101,7 +101,7 @@ struct rt_cache_stat {
101 unsigned int out_hlist_search; 101 unsigned int out_hlist_search;
102}; 102};
103 103
104extern struct ip_rt_acct *ip_rt_acct; 104extern struct ip_rt_acct __percpu *ip_rt_acct;
105 105
106struct in_device; 106struct in_device;
107extern int ip_rt_init(void); 107extern int ip_rt_init(void);
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 48d3efcb0880..af60fd050844 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -87,6 +87,8 @@ extern void rtnl_link_unregister(struct rtnl_link_ops *ops);
87extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); 87extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
88extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, 88extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
89 char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); 89 char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]);
90extern int rtnl_configure_link(struct net_device *dev,
91 const struct ifinfomsg *ifm);
90extern const struct nla_policy ifla_policy[IFLA_MAX+1]; 92extern const struct nla_policy ifla_policy[IFLA_MAX+1];
91 93
92#define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind) 94#define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index dad558bc06fa..67dc08eaaa45 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -427,6 +427,25 @@ static inline struct sk_buff *qdisc_dequeue_head(struct Qdisc *sch)
427 return __qdisc_dequeue_head(sch, &sch->q); 427 return __qdisc_dequeue_head(sch, &sch->q);
428} 428}
429 429
430static inline unsigned int __qdisc_queue_drop_head(struct Qdisc *sch,
431 struct sk_buff_head *list)
432{
433 struct sk_buff *skb = __qdisc_dequeue_head(sch, list);
434
435 if (likely(skb != NULL)) {
436 unsigned int len = qdisc_pkt_len(skb);
437 kfree_skb(skb);
438 return len;
439 }
440
441 return 0;
442}
443
444static inline unsigned int qdisc_queue_drop_head(struct Qdisc *sch)
445{
446 return __qdisc_queue_drop_head(sch, &sch->q);
447}
448
430static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch, 449static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch,
431 struct sk_buff_head *list) 450 struct sk_buff_head *list)
432{ 451{
diff --git a/include/net/snmp.h b/include/net/snmp.h
index f0d756f2ac99..692ee0061dc4 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -32,7 +32,7 @@
32 * - name of entries. 32 * - name of entries.
33 */ 33 */
34struct snmp_mib { 34struct snmp_mib {
35 char *name; 35 const char *name;
36 int entry; 36 int entry;
37}; 37};
38 38
@@ -129,9 +129,9 @@ struct linux_xfrm_mib {
129 * nonlocked_atomic_inc() primitives -AK 129 * nonlocked_atomic_inc() primitives -AK
130 */ 130 */
131#define DEFINE_SNMP_STAT(type, name) \ 131#define DEFINE_SNMP_STAT(type, name) \
132 __typeof__(type) *name[2] 132 __typeof__(type) __percpu *name[2]
133#define DECLARE_SNMP_STAT(type, name) \ 133#define DECLARE_SNMP_STAT(type, name) \
134 extern __typeof__(type) *name[2] 134 extern __typeof__(type) __percpu *name[2]
135 135
136#define SNMP_STAT_BHPTR(name) (name[0]) 136#define SNMP_STAT_BHPTR(name) (name[0])
137#define SNMP_STAT_USRPTR(name) (name[1]) 137#define SNMP_STAT_USRPTR(name) (name[1])
@@ -148,9 +148,13 @@ struct linux_xfrm_mib {
148 __this_cpu_add(mib[0]->mibs[field], addend) 148 __this_cpu_add(mib[0]->mibs[field], addend)
149#define SNMP_ADD_STATS_USER(mib, field, addend) \ 149#define SNMP_ADD_STATS_USER(mib, field, addend) \
150 this_cpu_add(mib[1]->mibs[field], addend) 150 this_cpu_add(mib[1]->mibs[field], addend)
151/*
152 * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr"
153 * to make @ptr a non-percpu pointer.
154 */
151#define SNMP_UPD_PO_STATS(mib, basefield, addend) \ 155#define SNMP_UPD_PO_STATS(mib, basefield, addend) \
152 do { \ 156 do { \
153 __typeof__(mib[0]) ptr; \ 157 __typeof__(*mib[0]) *ptr; \
154 preempt_disable(); \ 158 preempt_disable(); \
155 ptr = this_cpu_ptr((mib)[!in_softirq()]); \ 159 ptr = this_cpu_ptr((mib)[!in_softirq()]); \
156 ptr->mibs[basefield##PKTS]++; \ 160 ptr->mibs[basefield##PKTS]++; \
@@ -159,7 +163,7 @@ struct linux_xfrm_mib {
159 } while (0) 163 } while (0)
160#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \ 164#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \
161 do { \ 165 do { \
162 __typeof__(mib[0]) ptr = \ 166 __typeof__(*mib[0]) *ptr = \
163 __this_cpu_ptr((mib)[!in_softirq()]); \ 167 __this_cpu_ptr((mib)[!in_softirq()]); \
164 ptr->mibs[basefield##PKTS]++; \ 168 ptr->mibs[basefield##PKTS]++; \
165 ptr->mibs[basefield##OCTETS] += addend;\ 169 ptr->mibs[basefield##OCTETS] += addend;\
diff --git a/include/net/sock.h b/include/net/sock.h
index 3f1a4804bb3f..6cb1676e409a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -317,6 +317,11 @@ struct sock {
317/* 317/*
318 * Hashed lists helper routines 318 * Hashed lists helper routines
319 */ 319 */
320static inline struct sock *sk_entry(const struct hlist_node *node)
321{
322 return hlist_entry(node, struct sock, sk_node);
323}
324
320static inline struct sock *__sk_head(const struct hlist_head *head) 325static inline struct sock *__sk_head(const struct hlist_head *head)
321{ 326{
322 return hlist_entry(head->first, struct sock, sk_node); 327 return hlist_entry(head->first, struct sock, sk_node);
@@ -376,6 +381,7 @@ static __inline__ void __sk_del_node(struct sock *sk)
376 __hlist_del(&sk->sk_node); 381 __hlist_del(&sk->sk_node);
377} 382}
378 383
384/* NB: equivalent to hlist_del_init_rcu */
379static __inline__ int __sk_del_node_init(struct sock *sk) 385static __inline__ int __sk_del_node_init(struct sock *sk)
380{ 386{
381 if (sk_hashed(sk)) { 387 if (sk_hashed(sk)) {
@@ -416,6 +422,7 @@ static __inline__ int sk_del_node_init(struct sock *sk)
416 } 422 }
417 return rc; 423 return rc;
418} 424}
425#define sk_del_node_init_rcu(sk) sk_del_node_init(sk)
419 426
420static __inline__ int __sk_nulls_del_node_init_rcu(struct sock *sk) 427static __inline__ int __sk_nulls_del_node_init_rcu(struct sock *sk)
421{ 428{
@@ -449,6 +456,12 @@ static __inline__ void sk_add_node(struct sock *sk, struct hlist_head *list)
449 __sk_add_node(sk, list); 456 __sk_add_node(sk, list);
450} 457}
451 458
459static __inline__ void sk_add_node_rcu(struct sock *sk, struct hlist_head *list)
460{
461 sock_hold(sk);
462 hlist_add_head_rcu(&sk->sk_node, list);
463}
464
452static __inline__ void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list) 465static __inline__ void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list)
453{ 466{
454 hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list); 467 hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list);
@@ -473,6 +486,8 @@ static __inline__ void sk_add_bind_node(struct sock *sk,
473 486
474#define sk_for_each(__sk, node, list) \ 487#define sk_for_each(__sk, node, list) \
475 hlist_for_each_entry(__sk, node, list, sk_node) 488 hlist_for_each_entry(__sk, node, list, sk_node)
489#define sk_for_each_rcu(__sk, node, list) \
490 hlist_for_each_entry_rcu(__sk, node, list, sk_node)
476#define sk_nulls_for_each(__sk, node, list) \ 491#define sk_nulls_for_each(__sk, node, list) \
477 hlist_nulls_for_each_entry(__sk, node, list, sk_nulls_node) 492 hlist_nulls_for_each_entry(__sk, node, list, sk_nulls_node)
478#define sk_nulls_for_each_rcu(__sk, node, list) \ 493#define sk_nulls_for_each_rcu(__sk, node, list) \
@@ -1044,7 +1059,7 @@ extern void sk_common_release(struct sock *sk);
1044extern void sock_init_data(struct socket *sock, struct sock *sk); 1059extern void sock_init_data(struct socket *sock, struct sock *sk);
1045 1060
1046/** 1061/**
1047 * sk_filter_release: Release a socket filter 1062 * sk_filter_release - release a socket filter
1048 * @fp: filter to remove 1063 * @fp: filter to remove
1049 * 1064 *
1050 * Remove a filter from a socket and release its resources. 1065 * Remove a filter from a socket and release its resources.
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 34f5cc24d903..56f0aec40ed6 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -196,6 +196,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
196#define TCP_NAGLE_CORK 2 /* Socket is corked */ 196#define TCP_NAGLE_CORK 2 /* Socket is corked */
197#define TCP_NAGLE_PUSH 4 /* Cork is overridden for already queued data */ 197#define TCP_NAGLE_PUSH 4 /* Cork is overridden for already queued data */
198 198
199/* TCP thin-stream limits */
200#define TCP_THIN_LINEAR_RETRIES 6 /* After 6 linear retries, do exp. backoff */
201
199extern struct inet_timewait_death_row tcp_death_row; 202extern struct inet_timewait_death_row tcp_death_row;
200 203
201/* sysctl variables for tcp */ 204/* sysctl variables for tcp */
@@ -241,6 +244,8 @@ extern int sysctl_tcp_workaround_signed_windows;
241extern int sysctl_tcp_slow_start_after_idle; 244extern int sysctl_tcp_slow_start_after_idle;
242extern int sysctl_tcp_max_ssthresh; 245extern int sysctl_tcp_max_ssthresh;
243extern int sysctl_tcp_cookie_size; 246extern int sysctl_tcp_cookie_size;
247extern int sysctl_tcp_thin_linear_timeouts;
248extern int sysctl_tcp_thin_dupack;
244 249
245extern atomic_t tcp_memory_allocated; 250extern atomic_t tcp_memory_allocated;
246extern struct percpu_counter tcp_sockets_allocated; 251extern struct percpu_counter tcp_sockets_allocated;
@@ -400,6 +405,8 @@ extern int compat_tcp_setsockopt(struct sock *sk,
400 int level, int optname, 405 int level, int optname,
401 char __user *optval, unsigned int optlen); 406 char __user *optval, unsigned int optlen);
402extern void tcp_set_keepalive(struct sock *sk, int val); 407extern void tcp_set_keepalive(struct sock *sk, int val);
408extern void tcp_syn_ack_timeout(struct sock *sk,
409 struct request_sock *req);
403extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, 410extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk,
404 struct msghdr *msg, 411 struct msghdr *msg,
405 size_t len, int nonblock, 412 size_t len, int nonblock,
@@ -856,13 +863,6 @@ static inline void tcp_check_probe_timer(struct sock *sk)
856 icsk->icsk_rto, TCP_RTO_MAX); 863 icsk->icsk_rto, TCP_RTO_MAX);
857} 864}
858 865
859static inline void tcp_push_pending_frames(struct sock *sk)
860{
861 struct tcp_sock *tp = tcp_sk(sk);
862
863 __tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle);
864}
865
866static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq) 866static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq)
867{ 867{
868 tp->snd_wl1 = seq; 868 tp->snd_wl1 = seq;
@@ -972,7 +972,8 @@ static inline void tcp_sack_reset(struct tcp_options_received *rx_opt)
972/* Determine a window scaling and initial window to offer. */ 972/* Determine a window scaling and initial window to offer. */
973extern void tcp_select_initial_window(int __space, __u32 mss, 973extern void tcp_select_initial_window(int __space, __u32 mss,
974 __u32 *rcv_wnd, __u32 *window_clamp, 974 __u32 *rcv_wnd, __u32 *window_clamp,
975 int wscale_ok, __u8 *rcv_wscale); 975 int wscale_ok, __u8 *rcv_wscale,
976 __u32 init_rcv_wnd);
976 977
977static inline int tcp_win_from_space(int space) 978static inline int tcp_win_from_space(int space)
978{ 979{
@@ -1193,7 +1194,7 @@ extern int tcp_v4_md5_do_del(struct sock *sk,
1193#define tcp_twsk_md5_key(twsk) NULL 1194#define tcp_twsk_md5_key(twsk) NULL
1194#endif 1195#endif
1195 1196
1196extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(struct sock *); 1197extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *);
1197extern void tcp_free_md5sig_pool(void); 1198extern void tcp_free_md5sig_pool(void);
1198 1199
1199extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); 1200extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu);
@@ -1342,6 +1343,15 @@ static inline int tcp_write_queue_empty(struct sock *sk)
1342 return skb_queue_empty(&sk->sk_write_queue); 1343 return skb_queue_empty(&sk->sk_write_queue);
1343} 1344}
1344 1345
1346static inline void tcp_push_pending_frames(struct sock *sk)
1347{
1348 if (tcp_send_head(sk)) {
1349 struct tcp_sock *tp = tcp_sk(sk);
1350
1351 __tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle);
1352 }
1353}
1354
1345/* Start sequence of the highest skb with SACKed bit, valid only if 1355/* Start sequence of the highest skb with SACKed bit, valid only if
1346 * sacked > 0 or when the caller has ensured validity by itself. 1356 * sacked > 0 or when the caller has ensured validity by itself.
1347 */ 1357 */
@@ -1381,6 +1391,14 @@ static inline void tcp_highest_sack_combine(struct sock *sk,
1381 tcp_sk(sk)->highest_sack = new; 1391 tcp_sk(sk)->highest_sack = new;
1382} 1392}
1383 1393
1394/* Determines whether this is a thin stream (which may suffer from
1395 * increased latency). Used to trigger latency-reducing mechanisms.
1396 */
1397static inline unsigned int tcp_stream_is_thin(struct tcp_sock *tp)
1398{
1399 return tp->packets_out < 4 && !tcp_in_initial_slowstart(tp);
1400}
1401
1384/* /proc */ 1402/* /proc */
1385enum tcp_seq_states { 1403enum tcp_seq_states {
1386 TCP_SEQ_STATE_LISTENING, 1404 TCP_SEQ_STATE_LISTENING,
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 60c27706e7b9..a7df3275b860 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -140,6 +140,7 @@ struct xfrm_state {
140 140
141 struct xfrm_id id; 141 struct xfrm_id id;
142 struct xfrm_selector sel; 142 struct xfrm_selector sel;
143 struct xfrm_mark mark;
143 144
144 u32 genid; 145 u32 genid;
145 146
@@ -317,8 +318,8 @@ extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
317struct xfrm_type { 318struct xfrm_type {
318 char *description; 319 char *description;
319 struct module *owner; 320 struct module *owner;
320 __u8 proto; 321 u8 proto;
321 __u8 flags; 322 u8 flags;
322#define XFRM_TYPE_NON_FRAGMENT 1 323#define XFRM_TYPE_NON_FRAGMENT 1
323#define XFRM_TYPE_REPLAY_PROT 2 324#define XFRM_TYPE_REPLAY_PROT 2
324#define XFRM_TYPE_LOCAL_COADDR 4 325#define XFRM_TYPE_LOCAL_COADDR 4
@@ -434,24 +435,24 @@ struct xfrm_tmpl {
434 435
435 unsigned short encap_family; 436 unsigned short encap_family;
436 437
437 __u32 reqid; 438 u32 reqid;
438 439
439/* Mode: transport, tunnel etc. */ 440/* Mode: transport, tunnel etc. */
440 __u8 mode; 441 u8 mode;
441 442
442/* Sharing mode: unique, this session only, this user only etc. */ 443/* Sharing mode: unique, this session only, this user only etc. */
443 __u8 share; 444 u8 share;
444 445
445/* May skip this transfomration if no SA is found */ 446/* May skip this transfomration if no SA is found */
446 __u8 optional; 447 u8 optional;
447 448
448/* Skip aalgos/ealgos/calgos checks. */ 449/* Skip aalgos/ealgos/calgos checks. */
449 __u8 allalgs; 450 u8 allalgs;
450 451
451/* Bit mask of algos allowed for acquisition */ 452/* Bit mask of algos allowed for acquisition */
452 __u32 aalgos; 453 u32 aalgos;
453 __u32 ealgos; 454 u32 ealgos;
454 __u32 calgos; 455 u32 calgos;
455}; 456};
456 457
457#define XFRM_MAX_DEPTH 6 458#define XFRM_MAX_DEPTH 6
@@ -481,6 +482,7 @@ struct xfrm_policy {
481 482
482 u32 priority; 483 u32 priority;
483 u32 index; 484 u32 index;
485 struct xfrm_mark mark;
484 struct xfrm_selector selector; 486 struct xfrm_selector selector;
485 struct xfrm_lifetime_cfg lft; 487 struct xfrm_lifetime_cfg lft;
486 struct xfrm_lifetime_cur curlft; 488 struct xfrm_lifetime_cur curlft;
@@ -770,7 +772,7 @@ static __inline__ int addr_match(void *token1, void *token2, int prefixlen)
770 int pdw; 772 int pdw;
771 int pbi; 773 int pbi;
772 774
773 pdw = prefixlen >> 5; /* num of whole __u32 in prefix */ 775 pdw = prefixlen >> 5; /* num of whole u32 in prefix */
774 pbi = prefixlen & 0x1f; /* num of bits in incomplete u32 in prefix */ 776 pbi = prefixlen & 0x1f; /* num of bits in incomplete u32 in prefix */
775 777
776 if (pdw) 778 if (pdw)
@@ -1259,7 +1261,7 @@ struct xfrm_algo_desc {
1259/* XFRM tunnel handlers. */ 1261/* XFRM tunnel handlers. */
1260struct xfrm_tunnel { 1262struct xfrm_tunnel {
1261 int (*handler)(struct sk_buff *skb); 1263 int (*handler)(struct sk_buff *skb);
1262 int (*err_handler)(struct sk_buff *skb, __u32 info); 1264 int (*err_handler)(struct sk_buff *skb, u32 info);
1263 1265
1264 struct xfrm_tunnel *next; 1266 struct xfrm_tunnel *next;
1265 int priority; 1267 int priority;
@@ -1317,7 +1319,7 @@ extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t
1317 struct flowi *fl, struct xfrm_tmpl *tmpl, 1319 struct flowi *fl, struct xfrm_tmpl *tmpl,
1318 struct xfrm_policy *pol, int *err, 1320 struct xfrm_policy *pol, int *err,
1319 unsigned short family); 1321 unsigned short family);
1320extern struct xfrm_state * xfrm_stateonly_find(struct net *net, 1322extern struct xfrm_state *xfrm_stateonly_find(struct net *net, u32 mark,
1321 xfrm_address_t *daddr, 1323 xfrm_address_t *daddr,
1322 xfrm_address_t *saddr, 1324 xfrm_address_t *saddr,
1323 unsigned short family, 1325 unsigned short family,
@@ -1326,8 +1328,14 @@ extern int xfrm_state_check_expire(struct xfrm_state *x);
1326extern void xfrm_state_insert(struct xfrm_state *x); 1328extern void xfrm_state_insert(struct xfrm_state *x);
1327extern int xfrm_state_add(struct xfrm_state *x); 1329extern int xfrm_state_add(struct xfrm_state *x);
1328extern int xfrm_state_update(struct xfrm_state *x); 1330extern int xfrm_state_update(struct xfrm_state *x);
1329extern struct xfrm_state *xfrm_state_lookup(struct net *net, xfrm_address_t *daddr, __be32 spi, u8 proto, unsigned short family); 1331extern struct xfrm_state *xfrm_state_lookup(struct net *net, u32 mark,
1330extern struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto, unsigned short family); 1332 xfrm_address_t *daddr, __be32 spi,
1333 u8 proto, unsigned short family);
1334extern struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
1335 xfrm_address_t *daddr,
1336 xfrm_address_t *saddr,
1337 u8 proto,
1338 unsigned short family);
1331#ifdef CONFIG_XFRM_SUB_POLICY 1339#ifdef CONFIG_XFRM_SUB_POLICY
1332extern int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, 1340extern int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src,
1333 int n, unsigned short family); 1341 int n, unsigned short family);
@@ -1364,7 +1372,8 @@ struct xfrmk_spdinfo {
1364 u32 spdhmcnt; 1372 u32 spdhmcnt;
1365}; 1373};
1366 1374
1367extern struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 seq); 1375extern struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 mark,
1376 u32 seq);
1368extern int xfrm_state_delete(struct xfrm_state *x); 1377extern int xfrm_state_delete(struct xfrm_state *x);
1369extern int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); 1378extern int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info);
1370extern void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si); 1379extern void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si);
@@ -1408,9 +1417,9 @@ extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
1408 xfrm_address_t *saddr, u8 proto); 1417 xfrm_address_t *saddr, u8 proto);
1409extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family); 1418extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family);
1410extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family); 1419extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family);
1411extern __be32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr); 1420extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr);
1412extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr); 1421extern void xfrm6_tunnel_free_spi(struct net *net, xfrm_address_t *saddr);
1413extern __be32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr); 1422extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, xfrm_address_t *saddr);
1414extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); 1423extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb);
1415extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); 1424extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb);
1416extern int xfrm6_output(struct sk_buff *skb); 1425extern int xfrm6_output(struct sk_buff *skb);
@@ -1441,17 +1450,20 @@ extern int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk,
1441 int (*func)(struct xfrm_policy *, int, int, void*), void *); 1450 int (*func)(struct xfrm_policy *, int, int, void*), void *);
1442extern void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); 1451extern void xfrm_policy_walk_done(struct xfrm_policy_walk *walk);
1443int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1452int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1444struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u8 type, int dir, 1453struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark,
1454 u8 type, int dir,
1445 struct xfrm_selector *sel, 1455 struct xfrm_selector *sel,
1446 struct xfrm_sec_ctx *ctx, int delete, 1456 struct xfrm_sec_ctx *ctx, int delete,
1447 int *err); 1457 int *err);
1448struct xfrm_policy *xfrm_policy_byid(struct net *net, u8, int dir, u32 id, int delete, int *err); 1458struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, u32 id, int delete, int *err);
1449int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1459int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
1450u32 xfrm_get_acqseq(void); 1460u32 xfrm_get_acqseq(void);
1451extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1461extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
1452struct xfrm_state * xfrm_find_acq(struct net *net, u8 mode, u32 reqid, u8 proto, 1462struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark,
1453 xfrm_address_t *daddr, xfrm_address_t *saddr, 1463 u8 mode, u32 reqid, u8 proto,
1454 int create, unsigned short family); 1464 xfrm_address_t *daddr,
1465 xfrm_address_t *saddr, int create,
1466 unsigned short family);
1455extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); 1467extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
1456extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, 1468extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst,
1457 struct flowi *fl, int family, int strict); 1469 struct flowi *fl, int family, int strict);
@@ -1500,7 +1512,7 @@ static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b,
1500 switch (family) { 1512 switch (family) {
1501 default: 1513 default:
1502 case AF_INET: 1514 case AF_INET:
1503 return (__force __u32)a->a4 - (__force __u32)b->a4; 1515 return (__force u32)a->a4 - (__force u32)b->a4;
1504 case AF_INET6: 1516 case AF_INET6:
1505 return ipv6_addr_cmp((struct in6_addr *)a, 1517 return ipv6_addr_cmp((struct in6_addr *)a,
1506 (struct in6_addr *)b); 1518 (struct in6_addr *)b);
@@ -1570,4 +1582,24 @@ static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb)
1570} 1582}
1571#endif 1583#endif
1572 1584
1585static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m)
1586{
1587 if (attrs[XFRMA_MARK])
1588 memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(m));
1589 else
1590 m->v = m->m = 0;
1591
1592 return m->v & m->m;
1593}
1594
1595static inline int xfrm_mark_put(struct sk_buff *skb, struct xfrm_mark *m)
1596{
1597 if (m->m | m->v)
1598 NLA_PUT(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m);
1599 return 0;
1600
1601nla_put_failure:
1602 return -1;
1603}
1604
1573#endif /* _NET_XFRM_H */ 1605#endif /* _NET_XFRM_H */
diff --git a/include/pcmcia/device_id.h b/include/pcmcia/device_id.h
index c33ea08352b8..63e5b8f6b7dd 100644
--- a/include/pcmcia/device_id.h
+++ b/include/pcmcia/device_id.h
@@ -34,6 +34,11 @@
34 .prod_id = { NULL, (v2), NULL, NULL }, \ 34 .prod_id = { NULL, (v2), NULL, NULL }, \
35 .prod_id_hash = { 0, (vh2), 0, 0 }, } 35 .prod_id_hash = { 0, (vh2), 0, 0 }, }
36 36
37#define PCMCIA_DEVICE_PROD_ID3(v3, vh3) { \
38 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID3, \
39 .prod_id = { NULL, NULL, (v3), NULL }, \
40 .prod_id_hash = { 0, 0, (vh3), 0 }, }
41
37#define PCMCIA_DEVICE_PROD_ID12(v1, v2, vh1, vh2) { \ 42#define PCMCIA_DEVICE_PROD_ID12(v1, v2, vh1, vh2) { \
38 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ 43 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
39 PCMCIA_DEV_ID_MATCH_PROD_ID2, \ 44 PCMCIA_DEV_ID_MATCH_PROD_ID2, \
diff --git a/include/rdma/ib_pack.h b/include/rdma/ib_pack.h
index d7fc45c4eba9..cbb50f4da3dd 100644
--- a/include/rdma/ib_pack.h
+++ b/include/rdma/ib_pack.h
@@ -232,6 +232,7 @@ void ib_unpack(const struct ib_field *desc,
232 232
233void ib_ud_header_init(int payload_bytes, 233void ib_ud_header_init(int payload_bytes,
234 int grh_present, 234 int grh_present,
235 int immediate_present,
235 struct ib_ud_header *header); 236 struct ib_ud_header *header);
236 237
237int ib_ud_header_pack(struct ib_ud_header *header, 238int ib_ud_header_pack(struct ib_ud_header *header,
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 09509edb1c5f..a585e0f92bc3 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -984,9 +984,9 @@ struct ib_device {
984 struct list_head event_handler_list; 984 struct list_head event_handler_list;
985 spinlock_t event_handler_lock; 985 spinlock_t event_handler_lock;
986 986
987 spinlock_t client_data_lock;
987 struct list_head core_list; 988 struct list_head core_list;
988 struct list_head client_data_list; 989 struct list_head client_data_list;
989 spinlock_t client_data_lock;
990 990
991 struct ib_cache cache; 991 struct ib_cache cache;
992 int *pkey_tbl_len; 992 int *pkey_tbl_len;
@@ -1144,8 +1144,8 @@ struct ib_device {
1144 IB_DEV_UNREGISTERED 1144 IB_DEV_UNREGISTERED
1145 } reg_state; 1145 } reg_state;
1146 1146
1147 u64 uverbs_cmd_mask;
1148 int uverbs_abi_ver; 1147 int uverbs_abi_ver;
1148 u64 uverbs_cmd_mask;
1149 1149
1150 char node_desc[64]; 1150 char node_desc[64];
1151 __be64 node_guid; 1151 __be64 node_guid;
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
index c6b2962315b3..4fae90304648 100644
--- a/include/rdma/rdma_cm.h
+++ b/include/rdma/rdma_cm.h
@@ -67,7 +67,6 @@ enum rdma_port_space {
67 RDMA_PS_IPOIB = 0x0002, 67 RDMA_PS_IPOIB = 0x0002,
68 RDMA_PS_TCP = 0x0106, 68 RDMA_PS_TCP = 0x0106,
69 RDMA_PS_UDP = 0x0111, 69 RDMA_PS_UDP = 0x0111,
70 RDMA_PS_SCTP = 0x0183
71}; 70};
72 71
73struct rdma_addr { 72struct rdma_addr {
diff --git a/include/sound/core.h b/include/sound/core.h
index a61499c22b0b..89e0ac17f44a 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -458,5 +458,8 @@ struct snd_pci_quirk {
458const struct snd_pci_quirk * 458const struct snd_pci_quirk *
459snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list); 459snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list);
460 460
461const struct snd_pci_quirk *
462snd_pci_quirk_lookup_id(u16 vendor, u16 device,
463 const struct snd_pci_quirk *list);
461 464
462#endif /* __SOUND_CORE_H */ 465#endif /* __SOUND_CORE_H */
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h
index 7c44667e79a6..49b03c9e5e55 100644
--- a/include/sound/cs46xx_dsp_spos.h
+++ b/include/sound/cs46xx_dsp_spos.h
@@ -118,9 +118,11 @@ struct dsp_scb_descriptor {
118 118
119 struct snd_info_entry *proc_info; 119 struct snd_info_entry *proc_info;
120 int ref_count; 120 int ref_count;
121 spinlock_t lock;
122 121
123 int deleted; 122 u16 volume[2];
123 unsigned int deleted :1;
124 unsigned int updated :1;
125 unsigned int volume_set :1;
124}; 126};
125 127
126struct dsp_task_descriptor { 128struct dsp_task_descriptor {
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index c83a4a79f16b..8b611a561985 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -262,6 +262,8 @@ struct snd_pcm_hw_constraint_list {
262 unsigned int mask; 262 unsigned int mask;
263}; 263};
264 264
265struct snd_pcm_hwptr_log;
266
265struct snd_pcm_runtime { 267struct snd_pcm_runtime {
266 /* -- Status -- */ 268 /* -- Status -- */
267 struct snd_pcm_substream *trigger_master; 269 struct snd_pcm_substream *trigger_master;
@@ -310,7 +312,9 @@ struct snd_pcm_runtime {
310 struct snd_pcm_mmap_control *control; 312 struct snd_pcm_mmap_control *control;
311 313
312 /* -- locking / scheduling -- */ 314 /* -- locking / scheduling -- */
313 wait_queue_head_t sleep; 315 unsigned int twake: 1; /* do transfer (!poll) wakeup */
316 wait_queue_head_t sleep; /* poll sleep */
317 wait_queue_head_t tsleep; /* transfer sleep */
314 struct fasync_struct *fasync; 318 struct fasync_struct *fasync;
315 319
316 /* -- private section -- */ 320 /* -- private section -- */
@@ -340,6 +344,10 @@ struct snd_pcm_runtime {
340 /* -- OSS things -- */ 344 /* -- OSS things -- */
341 struct snd_pcm_oss_runtime oss; 345 struct snd_pcm_oss_runtime oss;
342#endif 346#endif
347
348#ifdef CONFIG_SND_PCM_XRUN_DEBUG
349 struct snd_pcm_hwptr_log *hwptr_log;
350#endif
343}; 351};
344 352
345struct snd_pcm_group { /* keep linked substreams */ 353struct snd_pcm_group { /* keep linked substreams */
@@ -834,6 +842,8 @@ void snd_pcm_set_sync(struct snd_pcm_substream *substream);
834int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); 842int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream);
835int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, 843int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
836 unsigned int cmd, void *arg); 844 unsigned int cmd, void *arg);
845int snd_pcm_update_state(struct snd_pcm_substream *substream,
846 struct snd_pcm_runtime *runtime);
837int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); 847int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
838int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream); 848int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream);
839int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream); 849int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream);
@@ -905,6 +915,44 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
905int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); 915int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
906int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); 916int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
907 917
918int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream,
919 size_t size, gfp_t gfp_flags);
920int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream);
921struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream,
922 unsigned long offset);
923#if 0 /* for kernel-doc */
924/**
925 * snd_pcm_lib_alloc_vmalloc_buffer - allocate virtual DMA buffer
926 * @substream: the substream to allocate the buffer to
927 * @size: the requested buffer size, in bytes
928 *
929 * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is
930 * contiguous in kernel virtual space, but not in physical memory. Use this
931 * if the buffer is accessed by kernel code but not by device DMA.
932 *
933 * Returns 1 if the buffer was changed, 0 if not changed, or a negative error
934 * code.
935 */
936static int snd_pcm_lib_alloc_vmalloc_buffer
937 (struct snd_pcm_substream *substream, size_t size);
938/**
939 * snd_pcm_lib_alloc_vmalloc_32_buffer - allocate 32-bit-addressable buffer
940 * @substream: the substream to allocate the buffer to
941 * @size: the requested buffer size, in bytes
942 *
943 * This function works like snd_pcm_lib_alloc_vmalloc_buffer(), but uses
944 * vmalloc_32(), i.e., the pages are allocated from 32-bit-addressable memory.
945 */
946static int snd_pcm_lib_alloc_vmalloc_32_buffer
947 (struct snd_pcm_substream *substream, size_t size);
948#endif
949#define snd_pcm_lib_alloc_vmalloc_buffer(subs, size) \
950 _snd_pcm_lib_alloc_vmalloc_buffer \
951 (subs, size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO)
952#define snd_pcm_lib_alloc_vmalloc_32_buffer(subs, size) \
953 _snd_pcm_lib_alloc_vmalloc_buffer \
954 (subs, size, GFP_KERNEL | GFP_DMA32 | __GFP_ZERO)
955
908#ifdef CONFIG_SND_DMA_SGBUF 956#ifdef CONFIG_SND_DMA_SGBUF
909/* 957/*
910 * SG-buffer handling 958 * SG-buffer handling
@@ -975,6 +1023,10 @@ int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_s
975#define snd_pcm_lib_mmap_iomem NULL 1023#define snd_pcm_lib_mmap_iomem NULL
976#endif 1024#endif
977 1025
1026int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream,
1027 struct vm_area_struct *area);
1028#define snd_pcm_lib_mmap_vmalloc snd_pcm_lib_mmap_noncached
1029
978static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) 1030static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
979{ 1031{
980 *max = dma < 4 ? 64 * 1024 : 128 * 1024; 1032 *max = dma < 4 ? 64 * 1024 : 128 * 1024;
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
index cc4e226f35fd..760c969d885d 100644
--- a/include/sound/pcm_oss.h
+++ b/include/sound/pcm_oss.h
@@ -61,7 +61,7 @@ struct snd_pcm_oss_runtime {
61 struct snd_pcm_plugin *plugin_first; 61 struct snd_pcm_plugin *plugin_first;
62 struct snd_pcm_plugin *plugin_last; 62 struct snd_pcm_plugin *plugin_last;
63#endif 63#endif
64 unsigned int prev_hw_ptr_interrupt; 64 unsigned int prev_hw_ptr_period;
65}; 65};
66 66
67struct snd_pcm_oss_file { 67struct snd_pcm_oss_file {
diff --git a/include/sound/sb.h b/include/sound/sb.h
index 4e62ee1e4115..95353542256a 100644
--- a/include/sound/sb.h
+++ b/include/sound/sb.h
@@ -33,6 +33,7 @@ enum sb_hw_type {
33 SB_HW_20, 33 SB_HW_20,
34 SB_HW_201, 34 SB_HW_201,
35 SB_HW_PRO, 35 SB_HW_PRO,
36 SB_HW_JAZZ16, /* Media Vision Jazz16 */
36 SB_HW_16, 37 SB_HW_16,
37 SB_HW_16CSP, /* SB16 with CSP chip */ 38 SB_HW_16CSP, /* SB16 with CSP chip */
38 SB_HW_ALS100, /* Avance Logic ALS100 chip */ 39 SB_HW_ALS100, /* Avance Logic ALS100 chip */
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index ca24e7f7a3f5..061f16d4c878 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -16,6 +16,8 @@
16 16
17#include <linux/list.h> 17#include <linux/list.h>
18 18
19#include <sound/soc.h>
20
19struct snd_pcm_substream; 21struct snd_pcm_substream;
20 22
21/* 23/*
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index c5c95e1da65b..c0922a034223 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -95,6 +95,21 @@
95 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ 95 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \
96 .num_kcontrols = 1} 96 .num_kcontrols = 1}
97 97
98/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
99#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
100 wcontrols) \
101{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
102 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
103#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \
104 wcontrols)\
105{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
106 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
107#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \
108 wcontrols)\
109{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \
110 .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \
111 .num_kcontrols = ARRAY_SIZE(wcontrols)}
112
98/* path domain with event - event handler must return 0 for success */ 113/* path domain with event - event handler must return 0 for success */
99#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 114#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \
100 wncontrols, wevent, wflags) \ 115 wncontrols, wevent, wflags) \
@@ -126,6 +141,23 @@
126 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \ 141 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
127 .event = wevent, .event_flags = wflags} 142 .event = wevent, .event_flags = wflags}
128 143
144/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
145#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
146 wevent, wflags) \
147{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
148 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
149 .event = wevent, .event_flags = wflags}
150#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
151 wevent, wflags) \
152{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
153 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
154 .event = wevent, .event_flags = wflags}
155#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \
156 wcontrols, wevent, wflags) \
157{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
158 .invert = winvert, .kcontrols = wcontrols, \
159 .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags}
160
129/* events that are pre and post DAPM */ 161/* events that are pre and post DAPM */
130#define SND_SOC_DAPM_PRE(wname, wevent) \ 162#define SND_SOC_DAPM_PRE(wname, wevent) \
131{ .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \ 163{ .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 0d7718f9280d..5d234a8c2506 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -169,6 +169,23 @@
169 .private_value = (unsigned long)&xenum } 169 .private_value = (unsigned long)&xenum }
170 170
171/* 171/*
172 * Simplified versions of above macros, declaring a struct and calculating
173 * ARRAY_SIZE internally
174 */
175#define SOC_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xtexts) \
176 struct soc_enum name = SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, \
177 ARRAY_SIZE(xtexts), xtexts)
178#define SOC_ENUM_SINGLE_DECL(name, xreg, xshift, xtexts) \
179 SOC_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xtexts)
180#define SOC_ENUM_SINGLE_EXT_DECL(name, xtexts) \
181 struct soc_enum name = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(xtexts), xtexts)
182#define SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift_l, xshift_r, xmask, xtexts, xvalues) \
183 struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \
184 ARRAY_SIZE(xtexts), xtexts, xvalues)
185#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
186 SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
187
188/*
172 * Bias levels 189 * Bias levels
173 * 190 *
174 * @ON: Bias is fully on for audio playback and capture operations. 191 * @ON: Bias is fully on for audio playback and capture operations.
@@ -253,6 +270,9 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
253/* codec register bit access */ 270/* codec register bit access */
254int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, 271int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
255 unsigned int mask, unsigned int value); 272 unsigned int mask, unsigned int value);
273int snd_soc_update_bits_locked(struct snd_soc_codec *codec,
274 unsigned short reg, unsigned int mask,
275 unsigned int value);
256int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, 276int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
257 unsigned int mask, unsigned int value); 277 unsigned int mask, unsigned int value);
258 278
@@ -402,6 +422,10 @@ struct snd_soc_codec {
402 short reg_cache_size; 422 short reg_cache_size;
403 short reg_cache_step; 423 short reg_cache_step;
404 424
425 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
426 unsigned int cache_only:1; /* Suppress writes to hardware */
427 unsigned int cache_sync:1; /* Cache needs to be synced to hardware */
428
405 /* dapm */ 429 /* dapm */
406 u32 pop_time; 430 u32 pop_time;
407 struct list_head dapm_widgets; 431 struct list_head dapm_widgets;
@@ -497,6 +521,8 @@ struct snd_soc_card {
497 int (*set_bias_level)(struct snd_soc_card *, 521 int (*set_bias_level)(struct snd_soc_card *,
498 enum snd_soc_bias_level level); 522 enum snd_soc_bias_level level);
499 523
524 long pmdown_time;
525
500 /* CPU <--> Codec DAI links */ 526 /* CPU <--> Codec DAI links */
501 struct snd_soc_dai_link *dai_link; 527 struct snd_soc_dai_link *dai_link;
502 int num_links; 528 int num_links;
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h
index 5858d06a7ffa..ac0665264bdf 100644
--- a/include/sound/tlv320dac33-plat.h
+++ b/include/sound/tlv320dac33-plat.h
@@ -15,6 +15,7 @@
15 15
16struct tlv320dac33_platform_data { 16struct tlv320dac33_platform_data {
17 int power_gpio; 17 int power_gpio;
18 u8 burst_bclkdiv;
18}; 19};
19 20
20#endif /* __TLV320DAC33_PLAT_H */ 21#endif /* __TLV320DAC33_PLAT_H */
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h
index e8c901e749d8..e29fde6b5cbe 100644
--- a/include/sound/tpa6130a2-plat.h
+++ b/include/sound/tpa6130a2-plat.h
@@ -23,7 +23,13 @@
23#ifndef TPA6130A2_PLAT_H 23#ifndef TPA6130A2_PLAT_H
24#define TPA6130A2_PLAT_H 24#define TPA6130A2_PLAT_H
25 25
26enum tpa_model {
27 TPA6130A2,
28 TPA6140A2,
29};
30
26struct tpa6130a2_platform_data { 31struct tpa6130a2_platform_data {
32 enum tpa_model id;
27 int power_gpio; 33 int power_gpio;
28}; 34};
29 35
diff --git a/include/sound/version.h b/include/sound/version.h
index 22939142dd23..7fed23442db8 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h */ 1/* include/version.h */
2#define CONFIG_SND_VERSION "1.0.21" 2#define CONFIG_SND_VERSION "1.0.22.1"
3#define CONFIG_SND_DATE "" 3#define CONFIG_SND_DATE ""
diff --git a/include/sound/wm2000.h b/include/sound/wm2000.h
new file mode 100644
index 000000000000..aa388ca9ec64
--- /dev/null
+++ b/include/sound/wm2000.h
@@ -0,0 +1,26 @@
1/*
2 * linux/sound/wm2000.h -- Platform data for WM2000
3 *
4 * Copyright 2010 Wolfson Microelectronics. PLC.
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
11#ifndef __LINUX_SND_WM2000_H
12#define __LINUX_SND_WM2000_H
13
14struct wm2000_platform_data {
15 /** Filename for system-specific image to download to device. */
16 const char *download_file;
17
18 /** Divide MCLK by 2 for system clock? */
19 unsigned int mclkdiv2:1;
20
21 /** Disable speech clarity enhancement, for use when an
22 * external algorithm is used. */
23 unsigned int speech_enh_disable:1;
24};
25
26#endif
diff --git a/include/sound/wm8904.h b/include/sound/wm8904.h
new file mode 100644
index 000000000000..d66575a601be
--- /dev/null
+++ b/include/sound/wm8904.h
@@ -0,0 +1,57 @@
1/*
2 * Platform data for WM8904
3 *
4 * Copyright 2009 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __MFD_WM8994_PDATA_H__
16#define __MFD_WM8994_PDATA_H__
17
18#define WM8904_DRC_REGS 4
19#define WM8904_EQ_REGS 25
20
21/**
22 * DRC configurations are specified with a label and a set of register
23 * values to write (the enable bits will be ignored). At runtime an
24 * enumerated control will be presented for each DRC block allowing
25 * the user to choose the configration to use.
26 *
27 * Configurations may be generated by hand or by using the DRC control
28 * panel provided by the WISCE - see http://www.wolfsonmicro.com/wisce/
29 * for details.
30 */
31struct wm8904_drc_cfg {
32 const char *name;
33 u16 regs[WM8904_DRC_REGS];
34};
35
36/**
37 * ReTune Mobile configurations are specified with a label, sample
38 * rate and set of values to write (the enable bits will be ignored).
39 *
40 * Configurations are expected to be generated using the ReTune Mobile
41 * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/
42 */
43struct wm8904_retune_mobile_cfg {
44 const char *name;
45 unsigned int rate;
46 u16 regs[WM8904_EQ_REGS];
47};
48
49struct wm8904_pdata {
50 int num_drc_cfgs;
51 struct wm8904_drc_cfg *drc_cfgs;
52
53 int num_retune_mobile_cfgs;
54 struct wm8904_retune_mobile_cfg *retune_mobile_cfgs;
55};
56
57#endif
diff --git a/include/sound/wm8955.h b/include/sound/wm8955.h
new file mode 100644
index 000000000000..5074ef499f40
--- /dev/null
+++ b/include/sound/wm8955.h
@@ -0,0 +1,26 @@
1/*
2 * Platform data for WM8955
3 *
4 * Copyright 2009 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __WM8955_PDATA_H__
16#define __WM8955_PDATA_H__
17
18struct wm8955_pdata {
19 /* Configure LOUT2/ROUT2 to drive a speaker */
20 unsigned int out2_speaker:1;
21
22 /* Configure MONOIN+/- in differential mode */
23 unsigned int monoin_diff:1;
24};
25
26#endif