aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-09-19 05:27:32 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-19 05:28:41 -0400
commit929bf0d0156562ce631728b6fa53d68004d456d2 (patch)
tree739063990a8077b29ef97e69d73bce94573daae4 /include
parentdef0a9b2573e00ab0b486cb5382625203ab4c4a6 (diff)
parent202c4675c55ddf6b443c7e057d2dff6b42ef71aa (diff)
Merge branch 'linus' into perfcounters/core
Merge reason: Bring in tracing changes we depend on. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h18
-rw-r--r--include/asm-generic/Kbuild.asm5
-rw-r--r--include/asm-generic/device.h3
-rw-r--r--include/asm-generic/pci.h13
-rw-r--r--include/asm-generic/percpu.h3
-rw-r--r--include/asm-generic/socket.h3
-rw-r--r--include/asm-generic/vmlinux.lds.h29
-rw-r--r--include/keys/rxrpc-type.h107
-rw-r--r--include/linux/Kbuild4
-rw-r--r--include/linux/agp_backend.h5
-rw-r--r--include/linux/amba/bus.h5
-rw-r--r--include/linux/amba/pl093.h80
-rw-r--r--include/linux/arcdevice.h3
-rw-r--r--include/linux/attribute_container.h2
-rw-r--r--include/linux/backing-dev.h3
-rw-r--r--include/linux/bio.h69
-rw-r--r--include/linux/blk-iopoll.h48
-rw-r--r--include/linux/blkdev.h44
-rw-r--r--include/linux/can/dev.h1
-rw-r--r--include/linux/connector.h6
-rw-r--r--include/linux/cred.h13
-rw-r--r--include/linux/dcbnl.h18
-rw-r--r--include/linux/device.h54
-rw-r--r--include/linux/dma-mapping.h1
-rw-r--r--include/linux/dtlk.h19
-rw-r--r--include/linux/dvb/dmx.h2
-rw-r--r--include/linux/enclosure.h5
-rw-r--r--include/linux/ethtool.h15
-rw-r--r--include/linux/fs.h24
-rw-r--r--include/linux/ftrace_event.h6
-rw-r--r--include/linux/genhd.h21
-rw-r--r--include/linux/gfs2_ondisk.h22
-rw-r--r--include/linux/hdlc.h8
-rw-r--r--include/linux/hid-debug.h48
-rw-r--r--include/linux/hid.h22
-rw-r--r--include/linux/i2c/twl4030.h19
-rw-r--r--include/linux/icmpv6.h2
-rw-r--r--include/linux/ide.h30
-rw-r--r--include/linux/ieee80211.h31
-rw-r--r--include/linux/if_addr.h1
-rw-r--r--include/linux/if_arp.h1
-rw-r--r--include/linux/if_ether.h4
-rw-r--r--include/linux/if_frad.h5
-rw-r--r--include/linux/if_tun.h1
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/init.h12
-rw-r--r--include/linux/input/eeti_ts.h9
-rw-r--r--include/linux/input/matrix_keypad.h32
-rw-r--r--include/linux/interrupt.h1
-rw-r--r--include/linux/io-mapping.h17
-rw-r--r--include/linux/isdn/hdlc.h82
-rw-r--r--include/linux/kprobes.h4
-rw-r--r--include/linux/kvm.h127
-rw-r--r--include/linux/kvm_host.h114
-rw-r--r--include/linux/kvm_para.h1
-rw-r--r--include/linux/libps2.h1
-rw-r--r--include/linux/mISDNhw.h1
-rw-r--r--include/linux/mISDNif.h16
-rw-r--r--include/linux/mdio.h2
-rw-r--r--include/linux/mmc/sdio_ids.h6
-rw-r--r--include/linux/mtd/partitions.h2
-rw-r--r--include/linux/net.h5
-rw-r--r--include/linux/net_dropmon.h1
-rw-r--r--include/linux/netdevice.h56
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netfilter/x_tables.h4
-rw-r--r--include/linux/netfilter/xt_CONNMARK.h6
-rw-r--r--include/linux/netfilter/xt_MARK.h17
-rw-r--r--include/linux/netfilter/xt_connmark.h5
-rw-r--r--include/linux/netfilter/xt_conntrack.h36
-rw-r--r--include/linux/netfilter/xt_mark.h5
-rw-r--r--include/linux/netfilter_arp/arp_tables.h2
-rw-r--r--include/linux/netfilter_bridge/ebtables.h2
-rw-r--r--include/linux/netfilter_ipv4/Kbuild32
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_CLASSIFY.h7
-rw-r--r--include/linux/netfilter_ipv4/ipt_CONNMARK.h19
-rw-r--r--include/linux/netfilter_ipv4/ipt_DSCP.h18
-rw-r--r--include/linux/netfilter_ipv4/ipt_ECN.h4
-rw-r--r--include/linux/netfilter_ipv4/ipt_MARK.h18
-rw-r--r--include/linux/netfilter_ipv4/ipt_NFQUEUE.h16
-rw-r--r--include/linux/netfilter_ipv4/ipt_TCPMSS.h9
-rw-r--r--include/linux/netfilter_ipv4/ipt_TOS.h12
-rw-r--r--include/linux/netfilter_ipv4/ipt_comment.h10
-rw-r--r--include/linux/netfilter_ipv4/ipt_connbytes.h18
-rw-r--r--include/linux/netfilter_ipv4/ipt_connmark.h7
-rw-r--r--include/linux/netfilter_ipv4/ipt_conntrack.h28
-rw-r--r--include/linux/netfilter_ipv4/ipt_dccp.h15
-rw-r--r--include/linux/netfilter_ipv4/ipt_dscp.h21
-rw-r--r--include/linux/netfilter_ipv4/ipt_ecn.h4
-rw-r--r--include/linux/netfilter_ipv4/ipt_esp.h10
-rw-r--r--include/linux/netfilter_ipv4/ipt_hashlimit.h14
-rw-r--r--include/linux/netfilter_ipv4/ipt_helper.h7
-rw-r--r--include/linux/netfilter_ipv4/ipt_iprange.h21
-rw-r--r--include/linux/netfilter_ipv4/ipt_length.h7
-rw-r--r--include/linux/netfilter_ipv4/ipt_limit.h8
-rw-r--r--include/linux/netfilter_ipv4/ipt_mac.h7
-rw-r--r--include/linux/netfilter_ipv4/ipt_mark.h9
-rw-r--r--include/linux/netfilter_ipv4/ipt_multiport.h15
-rw-r--r--include/linux/netfilter_ipv4/ipt_owner.h20
-rw-r--r--include/linux/netfilter_ipv4/ipt_physdev.h17
-rw-r--r--include/linux/netfilter_ipv4/ipt_pkttype.h7
-rw-r--r--include/linux/netfilter_ipv4/ipt_policy.h23
-rw-r--r--include/linux/netfilter_ipv4/ipt_recent.h21
-rw-r--r--include/linux/netfilter_ipv4/ipt_sctp.h105
-rw-r--r--include/linux/netfilter_ipv4/ipt_state.h15
-rw-r--r--include/linux/netfilter_ipv4/ipt_string.h10
-rw-r--r--include/linux/netfilter_ipv4/ipt_tcpmss.h7
-rw-r--r--include/linux/netfilter_ipv4/ipt_tos.h13
-rw-r--r--include/linux/netfilter_ipv6/Kbuild12
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h2
-rw-r--r--include/linux/netfilter_ipv6/ip6t_MARK.h9
-rw-r--r--include/linux/netfilter_ipv6/ip6t_esp.h10
-rw-r--r--include/linux/netfilter_ipv6/ip6t_length.h8
-rw-r--r--include/linux/netfilter_ipv6/ip6t_limit.h8
-rw-r--r--include/linux/netfilter_ipv6/ip6t_mac.h7
-rw-r--r--include/linux/netfilter_ipv6/ip6t_mark.h9
-rw-r--r--include/linux/netfilter_ipv6/ip6t_multiport.h14
-rw-r--r--include/linux/netfilter_ipv6/ip6t_owner.h18
-rw-r--r--include/linux/netfilter_ipv6/ip6t_physdev.h17
-rw-r--r--include/linux/netfilter_ipv6/ip6t_policy.h23
-rw-r--r--include/linux/netlink.h19
-rw-r--r--include/linux/nl80211.h174
-rw-r--r--include/linux/nl802154.h6
-rw-r--r--include/linux/notifier.h2
-rw-r--r--include/linux/page-flags.h4
-rw-r--r--include/linux/pci.h14
-rw-r--r--include/linux/pci_hotplug.h16
-rw-r--r--include/linux/pci_ids.h9
-rw-r--r--include/linux/pci_regs.h1
-rw-r--r--include/linux/percpu-defs.h82
-rw-r--r--include/linux/percpu.h88
-rw-r--r--include/linux/phonet.h20
-rw-r--r--include/linux/platform_device.h5
-rw-r--r--include/linux/pm.h115
-rw-r--r--include/linux/pm_runtime.h114
-rw-r--r--include/linux/rds.h12
-rw-r--r--include/linux/rfkill.h38
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/rxrpc.h7
-rw-r--r--include/linux/sched.h23
-rw-r--r--include/linux/selinux.h9
-rw-r--r--include/linux/serio.h2
-rw-r--r--include/linux/shmem_fs.h3
-rw-r--r--include/linux/skbuff.h6
-rw-r--r--include/linux/slob_def.h5
-rw-r--r--include/linux/slub_def.h8
-rw-r--r--include/linux/ssb/ssb.h69
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h10
-rw-r--r--include/linux/ssb/ssb_regs.h66
-rw-r--r--include/linux/tboot.h162
-rw-r--r--include/linux/tcp.h6
-rw-r--r--include/linux/tipc.h2
-rw-r--r--include/linux/topology.h32
-rw-r--r--include/linux/transport_class.h2
-rw-r--r--include/linux/tty.h4
-rw-r--r--include/linux/usb/rndis_host.h13
-rw-r--r--include/linux/usb/usbnet.h18
-rw-r--r--include/linux/usb/video.h164
-rw-r--r--include/linux/uwb.h2
-rw-r--r--include/linux/vgaarb.h200
-rw-r--r--include/linux/videodev2.h105
-rw-r--r--include/linux/vmalloc.h6
-rw-r--r--include/linux/wait.h4
-rw-r--r--include/linux/wireless.h8
-rw-r--r--include/linux/wm97xx.h7
-rw-r--r--include/linux/writeback.h9
-rw-r--r--include/media/ir-common.h138
-rw-r--r--include/media/ir-kbd-i2c.h22
-rw-r--r--include/media/radio-si4713.h30
-rw-r--r--include/media/si4713.h49
-rw-r--r--include/media/tuner.h1
-rw-r--r--include/media/v4l2-subdev.h5
-rw-r--r--include/net/addrconf.h2
-rw-r--r--include/net/af_ieee802154.h (renamed from include/net/ieee802154/af_ieee802154.h)6
-rw-r--r--include/net/arp.h2
-rw-r--r--include/net/bluetooth/bluetooth.h5
-rw-r--r--include/net/bluetooth/hci_core.h10
-rw-r--r--include/net/bluetooth/l2cap.h134
-rw-r--r--include/net/bluetooth/rfcomm.h2
-rw-r--r--include/net/cfg80211.h570
-rw-r--r--include/net/dcbnl.h2
-rw-r--r--include/net/dst.h23
-rw-r--r--include/net/dst_ops.h28
-rw-r--r--include/net/genetlink.h66
-rw-r--r--include/net/ieee802154.h (renamed from include/net/ieee802154/mac_def.h)4
-rw-r--r--include/net/ieee802154/nl802154.h41
-rw-r--r--include/net/ieee802154_netdev.h (renamed from include/net/ieee802154/netdevice.h)6
-rw-r--r--include/net/ip6_fib.h6
-rw-r--r--include/net/ip_vs.h119
-rw-r--r--include/net/ipv6.h12
-rw-r--r--include/net/irda/ircomm_event.h2
-rw-r--r--include/net/irda/ircomm_tty_attach.h4
-rw-r--r--include/net/irda/irlap_event.h2
-rw-r--r--include/net/irda/irlmp_event.h4
-rw-r--r--include/net/iw_handler.h8
-rw-r--r--include/net/mac80211.h195
-rw-r--r--include/net/neighbour.h6
-rw-r--r--include/net/net_namespace.h26
-rw-r--r--include/net/netfilter/nf_nat_core.h2
-rw-r--r--include/net/netlink.h4
-rw-r--r--include/net/netns/ipv6.h3
-rw-r--r--include/net/netns/x_tables.h3
-rw-r--r--include/net/nl802154.h126
-rw-r--r--include/net/phonet/pn_dev.h2
-rw-r--r--include/net/pkt_sched.h3
-rw-r--r--include/net/protocol.h13
-rw-r--r--include/net/rtnetlink.h5
-rw-r--r--include/net/sch_generic.h22
-rw-r--r--include/net/scm.h2
-rw-r--r--include/net/sctp/command.h3
-rw-r--r--include/net/sctp/constants.h13
-rw-r--r--include/net/sctp/sctp.h7
-rw-r--r--include/net/sctp/structs.h63
-rw-r--r--include/net/sctp/user.h6
-rw-r--r--include/net/tcp.h49
-rw-r--r--include/net/transp_v6.h2
-rw-r--r--include/net/udp.h3
-rw-r--r--include/net/wpan-phy.h63
-rw-r--r--include/net/xfrm.h2
-rw-r--r--include/pcmcia/ss.h4
-rw-r--r--include/scsi/fc/fc_gs.h1
-rw-r--r--include/scsi/fc_encode.h60
-rw-r--r--include/scsi/fc_frame.h7
-rw-r--r--include/scsi/iscsi_if.h1
-rw-r--r--include/scsi/libfc.h244
-rw-r--r--include/scsi/libiscsi.h3
-rw-r--r--include/scsi/scsi_device.h3
-rw-r--r--include/scsi/scsi_dh.h5
-rw-r--r--include/trace/events/block.h4
-rw-r--r--include/trace/events/ext4.h6
-rw-r--r--include/trace/events/irq.h21
-rw-r--r--include/trace/events/kvm.h151
-rw-r--r--include/trace/events/skb.h20
-rw-r--r--include/trace/ftrace.h8
235 files changed, 4339 insertions, 1905 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index c65e4ce6c3af..1fa3ffb7c93b 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -248,7 +248,6 @@ struct acpi_device_perf {
248/* Wakeup Management */ 248/* Wakeup Management */
249struct acpi_device_wakeup_flags { 249struct acpi_device_wakeup_flags {
250 u8 valid:1; /* Can successfully enable wakeup? */ 250 u8 valid:1; /* Can successfully enable wakeup? */
251 u8 prepared:1; /* Has the wake-up capability been enabled? */
252 u8 run_wake:1; /* Run-Wake GPE devices */ 251 u8 run_wake:1; /* Run-Wake GPE devices */
253}; 252};
254 253
@@ -263,6 +262,7 @@ struct acpi_device_wakeup {
263 struct acpi_handle_list resources; 262 struct acpi_handle_list resources;
264 struct acpi_device_wakeup_state state; 263 struct acpi_device_wakeup_state state;
265 struct acpi_device_wakeup_flags flags; 264 struct acpi_device_wakeup_flags flags;
265 int prepare_count;
266}; 266};
267 267
268/* Device */ 268/* Device */
@@ -369,10 +369,26 @@ int register_acpi_bus_type(struct acpi_bus_type *);
369int unregister_acpi_bus_type(struct acpi_bus_type *); 369int unregister_acpi_bus_type(struct acpi_bus_type *);
370struct device *acpi_get_physical_device(acpi_handle); 370struct device *acpi_get_physical_device(acpi_handle);
371 371
372struct acpi_pci_root {
373 struct list_head node;
374 struct acpi_device * device;
375 struct acpi_pci_id id;
376 struct pci_bus *bus;
377 u16 segment;
378 u8 bus_nr;
379
380 u32 osc_support_set; /* _OSC state of support bits */
381 u32 osc_control_set; /* _OSC state of control bits */
382 u32 osc_control_qry; /* the latest _OSC query result */
383
384 u32 osc_queried:1; /* has _OSC control been queried? */
385};
386
372/* helper */ 387/* helper */
373acpi_handle acpi_get_child(acpi_handle, acpi_integer); 388acpi_handle acpi_get_child(acpi_handle, acpi_integer);
374int acpi_is_root_bridge(acpi_handle); 389int acpi_is_root_bridge(acpi_handle);
375acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); 390acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
391struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
376#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) 392#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
377 393
378#ifdef CONFIG_PM_SLEEP 394#ifdef CONFIG_PM_SLEEP
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index 290910e4ede4..96d7c9804dc1 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -3,6 +3,11 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
3header-y += kvm.h 3header-y += kvm.h
4endif 4endif
5 5
6ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
7 $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
8header-y += kvm_para.h
9endif
10
6ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ 11ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
7 $(srctree)/include/asm-$(SRCARCH)/a.out.h),) 12 $(srctree)/include/asm-$(SRCARCH)/a.out.h),)
8unifdef-y += a.out.h 13unifdef-y += a.out.h
diff --git a/include/asm-generic/device.h b/include/asm-generic/device.h
index c17c9600f220..d7c76bba640d 100644
--- a/include/asm-generic/device.h
+++ b/include/asm-generic/device.h
@@ -9,4 +9,7 @@
9struct dev_archdata { 9struct dev_archdata {
10}; 10};
11 11
12struct pdev_archdata {
13};
14
12#endif /* _ASM_GENERIC_DEVICE_H */ 15#endif /* _ASM_GENERIC_DEVICE_H */
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h
index b4326b5466eb..26373cff4546 100644
--- a/include/asm-generic/pci.h
+++ b/include/asm-generic/pci.h
@@ -30,7 +30,18 @@ pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
30 res->end = region->end; 30 res->end = region->end;
31} 31}
32 32
33#define pcibios_scan_all_fns(a, b) 0 33static inline struct resource *
34pcibios_select_root(struct pci_dev *pdev, struct resource *res)
35{
36 struct resource *root = NULL;
37
38 if (res->flags & IORESOURCE_IO)
39 root = &ioport_resource;
40 if (res->flags & IORESOURCE_MEM)
41 root = &iomem_resource;
42
43 return root;
44}
34 45
35#ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 46#ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
36static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 47static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index aa00800adacc..90079c373f1c 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -81,14 +81,17 @@ extern void setup_per_cpu_areas(void);
81 81
82#ifdef MODULE 82#ifdef MODULE
83#define PER_CPU_SHARED_ALIGNED_SECTION "" 83#define PER_CPU_SHARED_ALIGNED_SECTION ""
84#define PER_CPU_ALIGNED_SECTION ""
84#else 85#else
85#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" 86#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned"
87#define PER_CPU_ALIGNED_SECTION ".shared_aligned"
86#endif 88#endif
87#define PER_CPU_FIRST_SECTION ".first" 89#define PER_CPU_FIRST_SECTION ".first"
88 90
89#else 91#else
90 92
91#define PER_CPU_SHARED_ALIGNED_SECTION "" 93#define PER_CPU_SHARED_ALIGNED_SECTION ""
94#define PER_CPU_ALIGNED_SECTION ".shared_aligned"
92#define PER_CPU_FIRST_SECTION "" 95#define PER_CPU_FIRST_SECTION ""
93 96
94#endif 97#endif
diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h
index 5d79e409241c..538991cef6f0 100644
--- a/include/asm-generic/socket.h
+++ b/include/asm-generic/socket.h
@@ -60,4 +60,7 @@
60#define SO_TIMESTAMPING 37 60#define SO_TIMESTAMPING 37
61#define SCM_TIMESTAMPING SO_TIMESTAMPING 61#define SCM_TIMESTAMPING SO_TIMESTAMPING
62 62
63#define SO_PROTOCOL 38
64#define SO_DOMAIN 39
65
63#endif /* __ASM_GENERIC_SOCKET_H */ 66#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 6ad76bf5fb40..29ca8f53ffbe 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -33,13 +33,10 @@
33 * BSS_SECTION(0, 0, 0) 33 * BSS_SECTION(0, 0, 0)
34 * _end = .; 34 * _end = .;
35 * 35 *
36 * /DISCARD/ : {
37 * EXIT_TEXT
38 * EXIT_DATA
39 * EXIT_CALL
40 * }
41 * STABS_DEBUG 36 * STABS_DEBUG
42 * DWARF_DEBUG 37 * DWARF_DEBUG
38 *
39 * DISCARDS // must be the last
43 * } 40 * }
44 * 41 *
45 * [__init_begin, __init_end] is the init section that may be freed after init 42 * [__init_begin, __init_end] is the init section that may be freed after init
@@ -91,7 +88,8 @@
91#endif 88#endif
92 89
93#ifdef CONFIG_FTRACE_MCOUNT_RECORD 90#ifdef CONFIG_FTRACE_MCOUNT_RECORD
94#define MCOUNT_REC() VMLINUX_SYMBOL(__start_mcount_loc) = .; \ 91#define MCOUNT_REC() . = ALIGN(8); \
92 VMLINUX_SYMBOL(__start_mcount_loc) = .; \
95 *(__mcount_loc) \ 93 *(__mcount_loc) \
96 VMLINUX_SYMBOL(__stop_mcount_loc) = .; 94 VMLINUX_SYMBOL(__stop_mcount_loc) = .;
97#else 95#else
@@ -331,7 +329,6 @@
331 /* __*init sections */ \ 329 /* __*init sections */ \
332 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ 330 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
333 *(.ref.rodata) \ 331 *(.ref.rodata) \
334 MCOUNT_REC() \
335 DEV_KEEP(init.rodata) \ 332 DEV_KEEP(init.rodata) \
336 DEV_KEEP(exit.rodata) \ 333 DEV_KEEP(exit.rodata) \
337 CPU_KEEP(init.rodata) \ 334 CPU_KEEP(init.rodata) \
@@ -455,6 +452,7 @@
455 MEM_DISCARD(init.data) \ 452 MEM_DISCARD(init.data) \
456 KERNEL_CTORS() \ 453 KERNEL_CTORS() \
457 *(.init.rodata) \ 454 *(.init.rodata) \
455 MCOUNT_REC() \
458 DEV_DISCARD(init.rodata) \ 456 DEV_DISCARD(init.rodata) \
459 CPU_DISCARD(init.rodata) \ 457 CPU_DISCARD(init.rodata) \
460 MEM_DISCARD(init.rodata) 458 MEM_DISCARD(init.rodata)
@@ -626,6 +624,23 @@
626#define INIT_RAM_FS 624#define INIT_RAM_FS
627#endif 625#endif
628 626
627/*
628 * Default discarded sections.
629 *
630 * Some archs want to discard exit text/data at runtime rather than
631 * link time due to cross-section references such as alt instructions,
632 * bug table, eh_frame, etc. DISCARDS must be the last of output
633 * section definitions so that such archs put those in earlier section
634 * definitions.
635 */
636#define DISCARDS \
637 /DISCARD/ : { \
638 EXIT_TEXT \
639 EXIT_DATA \
640 EXIT_CALL \
641 *(.discard) \
642 }
643
629/** 644/**
630 * PERCPU_VADDR - define output section for percpu area 645 * PERCPU_VADDR - define output section for percpu area
631 * @vaddr: explicit base address (optional) 646 * @vaddr: explicit base address (optional)
diff --git a/include/keys/rxrpc-type.h b/include/keys/rxrpc-type.h
index 7609365577f1..5cb86c307f5d 100644
--- a/include/keys/rxrpc-type.h
+++ b/include/keys/rxrpc-type.h
@@ -21,4 +21,111 @@ extern struct key_type key_type_rxrpc;
21 21
22extern struct key *rxrpc_get_null_key(const char *); 22extern struct key *rxrpc_get_null_key(const char *);
23 23
24/*
25 * RxRPC key for Kerberos IV (type-2 security)
26 */
27struct rxkad_key {
28 u32 vice_id;
29 u32 start; /* time at which ticket starts */
30 u32 expiry; /* time at which ticket expires */
31 u32 kvno; /* key version number */
32 u8 primary_flag; /* T if key for primary cell for this user */
33 u16 ticket_len; /* length of ticket[] */
34 u8 session_key[8]; /* DES session key */
35 u8 ticket[0]; /* the encrypted ticket */
36};
37
38/*
39 * Kerberos 5 principal
40 * name/name/name@realm
41 */
42struct krb5_principal {
43 u8 n_name_parts; /* N of parts of the name part of the principal */
44 char **name_parts; /* parts of the name part of the principal */
45 char *realm; /* parts of the realm part of the principal */
46};
47
48/*
49 * Kerberos 5 tagged data
50 */
51struct krb5_tagged_data {
52 /* for tag value, see /usr/include/krb5/krb5.h
53 * - KRB5_AUTHDATA_* for auth data
54 * -
55 */
56 s32 tag;
57 u32 data_len;
58 u8 *data;
59};
60
61/*
62 * RxRPC key for Kerberos V (type-5 security)
63 */
64struct rxk5_key {
65 u64 authtime; /* time at which auth token generated */
66 u64 starttime; /* time at which auth token starts */
67 u64 endtime; /* time at which auth token expired */
68 u64 renew_till; /* time to which auth token can be renewed */
69 s32 is_skey; /* T if ticket is encrypted in another ticket's
70 * skey */
71 s32 flags; /* mask of TKT_FLG_* bits (krb5/krb5.h) */
72 struct krb5_principal client; /* client principal name */
73 struct krb5_principal server; /* server principal name */
74 u16 ticket_len; /* length of ticket */
75 u16 ticket2_len; /* length of second ticket */
76 u8 n_authdata; /* number of authorisation data elements */
77 u8 n_addresses; /* number of addresses */
78 struct krb5_tagged_data session; /* session data; tag is enctype */
79 struct krb5_tagged_data *addresses; /* addresses */
80 u8 *ticket; /* krb5 ticket */
81 u8 *ticket2; /* second krb5 ticket, if related to ticket (via
82 * DUPLICATE-SKEY or ENC-TKT-IN-SKEY) */
83 struct krb5_tagged_data *authdata; /* authorisation data */
84};
85
86/*
87 * list of tokens attached to an rxrpc key
88 */
89struct rxrpc_key_token {
90 u16 security_index; /* RxRPC header security index */
91 struct rxrpc_key_token *next; /* the next token in the list */
92 union {
93 struct rxkad_key *kad;
94 struct rxk5_key *k5;
95 };
96};
97
98/*
99 * structure of raw payloads passed to add_key() or instantiate key
100 */
101struct rxrpc_key_data_v1 {
102 u32 kif_version; /* 1 */
103 u16 security_index;
104 u16 ticket_length;
105 u32 expiry; /* time_t */
106 u32 kvno;
107 u8 session_key[8];
108 u8 ticket[0];
109};
110
111/*
112 * AF_RXRPC key payload derived from XDR format
113 * - based on openafs-1.4.10/src/auth/afs_token.xg
114 */
115#define AFSTOKEN_LENGTH_MAX 16384 /* max payload size */
116#define AFSTOKEN_STRING_MAX 256 /* max small string length */
117#define AFSTOKEN_DATA_MAX 64 /* max small data length */
118#define AFSTOKEN_CELL_MAX 64 /* max cellname length */
119#define AFSTOKEN_MAX 8 /* max tokens per payload */
120#define AFSTOKEN_BDATALN_MAX 16384 /* max big data length */
121#define AFSTOKEN_RK_TIX_MAX 12000 /* max RxKAD ticket size */
122#define AFSTOKEN_GK_KEY_MAX 64 /* max GSSAPI key size */
123#define AFSTOKEN_GK_TOKEN_MAX 16384 /* max GSSAPI token size */
124#define AFSTOKEN_K5_COMPONENTS_MAX 16 /* max K5 components */
125#define AFSTOKEN_K5_NAME_MAX 128 /* max K5 name length */
126#define AFSTOKEN_K5_REALM_MAX 64 /* max K5 realm name length */
127#define AFSTOKEN_K5_TIX_MAX 16384 /* max K5 ticket size */
128#define AFSTOKEN_K5_ADDRESSES_MAX 16 /* max K5 addresses */
129#define AFSTOKEN_K5_AUTHDATA_MAX 16 /* max K5 pieces of auth data */
130
24#endif /* _KEYS_RXRPC_TYPE_H */ 131#endif /* _KEYS_RXRPC_TYPE_H */
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 334a3593cdfd..cff4a101f266 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -268,6 +268,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
268 $(srctree)/include/asm-$(SRCARCH)/kvm.h),) 268 $(srctree)/include/asm-$(SRCARCH)/kvm.h),)
269unifdef-y += kvm.h 269unifdef-y += kvm.h
270endif 270endif
271ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
272 $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
273unifdef-y += kvm_para.h
274endif
271unifdef-y += llc.h 275unifdef-y += llc.h
272unifdef-y += loop.h 276unifdef-y += loop.h
273unifdef-y += lp.h 277unifdef-y += lp.h
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h
index 76fa794fdac0..880130f7311f 100644
--- a/include/linux/agp_backend.h
+++ b/include/linux/agp_backend.h
@@ -79,9 +79,12 @@ struct agp_memory {
79 u32 physical; 79 u32 physical;
80 bool is_bound; 80 bool is_bound;
81 bool is_flushed; 81 bool is_flushed;
82 bool vmalloc_flag; 82 bool vmalloc_flag;
83 /* list of agp_memory mapped to the aperture */ 83 /* list of agp_memory mapped to the aperture */
84 struct list_head mapped_list; 84 struct list_head mapped_list;
85 /* DMA-mapped addresses */
86 struct scatterlist *sg_list;
87 int num_sg;
85}; 88};
86 89
87#define AGP_NORMAL_MEMORY 0 90#define AGP_NORMAL_MEMORY 0
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 9b93cafa82a0..ab94335b4bb9 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -36,6 +36,11 @@ struct amba_driver {
36 struct amba_id *id_table; 36 struct amba_id *id_table;
37}; 37};
38 38
39enum amba_vendor {
40 AMBA_VENDOR_ARM = 0x41,
41 AMBA_VENDOR_ST = 0x80,
42};
43
39#define amba_get_drvdata(d) dev_get_drvdata(&d->dev) 44#define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
40#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p) 45#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
41 46
diff --git a/include/linux/amba/pl093.h b/include/linux/amba/pl093.h
new file mode 100644
index 000000000000..2983e3671adb
--- /dev/null
+++ b/include/linux/amba/pl093.h
@@ -0,0 +1,80 @@
1/* linux/amba/pl093.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * AMBA PL093 SSMC (synchronous static memory controller)
8 * See DDI0236.pdf (r0p4) for more details
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#define SMB_BANK(x) ((x) * 0x20) /* each bank control set is 0x20 apart */
16
17/* Offsets for SMBxxxxRy registers */
18
19#define SMBIDCYR (0x00)
20#define SMBWSTRDR (0x04)
21#define SMBWSTWRR (0x08)
22#define SMBWSTOENR (0x0C)
23#define SMBWSTWENR (0x10)
24#define SMBCR (0x14)
25#define SMBSR (0x18)
26#define SMBWSTBRDR (0x1C)
27
28/* Masks for SMB registers */
29#define IDCY_MASK (0xf)
30#define WSTRD_MASK (0xf)
31#define WSTWR_MASK (0xf)
32#define WSTOEN_MASK (0xf)
33#define WSTWEN_MASK (0xf)
34
35/* Notes from datasheet:
36 * WSTOEN <= WSTRD
37 * WSTWEN <= WSTWR
38 *
39 * WSTOEN is not used with nWAIT
40 */
41
42/* SMBCR bit definitions */
43#define SMBCR_BIWRITEEN (1 << 21)
44#define SMBCR_ADDRVALIDWRITEEN (1 << 20)
45#define SMBCR_SYNCWRITE (1 << 17)
46#define SMBCR_BMWRITE (1 << 16)
47#define SMBCR_WRAPREAD (1 << 14)
48#define SMBCR_BIREADEN (1 << 13)
49#define SMBCR_ADDRVALIDREADEN (1 << 12)
50#define SMBCR_SYNCREAD (1 << 9)
51#define SMBCR_BMREAD (1 << 8)
52#define SMBCR_SMBLSPOL (1 << 6)
53#define SMBCR_WP (1 << 3)
54#define SMBCR_WAITEN (1 << 2)
55#define SMBCR_WAITPOL (1 << 1)
56#define SMBCR_RBLE (1 << 0)
57
58#define SMBCR_BURSTLENWRITE_MASK (3 << 18)
59#define SMBCR_BURSTLENWRITE_4 (0 << 18)
60#define SMBCR_BURSTLENWRITE_8 (1 << 18)
61#define SMBCR_BURSTLENWRITE_RESERVED (2 << 18)
62#define SMBCR_BURSTLENWRITE_CONTINUOUS (3 << 18)
63
64#define SMBCR_BURSTLENREAD_MASK (3 << 10)
65#define SMBCR_BURSTLENREAD_4 (0 << 10)
66#define SMBCR_BURSTLENREAD_8 (1 << 10)
67#define SMBCR_BURSTLENREAD_16 (2 << 10)
68#define SMBCR_BURSTLENREAD_CONTINUOUS (3 << 10)
69
70#define SMBCR_MW_MASK (3 << 4)
71#define SMBCR_MW_8BIT (0 << 4)
72#define SMBCR_MW_16BIT (1 << 4)
73#define SMBCR_MW_M32BIT (2 << 4)
74
75/* SSMC status registers */
76#define SSMCCSR (0x200)
77#define SSMCCR (0x204)
78#define SSMCITCR (0x208)
79#define SSMCITIP (0x20C)
80#define SSMCITIOP (0x210)
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index cd4bcb6989ce..7d650a0e3d8f 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -337,7 +337,8 @@ struct net_device *alloc_arcdev(const char *name);
337 337
338int arcnet_open(struct net_device *dev); 338int arcnet_open(struct net_device *dev);
339int arcnet_close(struct net_device *dev); 339int arcnet_close(struct net_device *dev);
340int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev); 340netdev_tx_t arcnet_send_packet(struct sk_buff *skb,
341 struct net_device *dev);
341void arcnet_timeout(struct net_device *dev); 342void arcnet_timeout(struct net_device *dev);
342 343
343#endif /* __KERNEL__ */ 344#endif /* __KERNEL__ */
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index 794ad74b1d61..c3ab81428c66 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -17,7 +17,7 @@ struct attribute_container {
17 struct list_head node; 17 struct list_head node;
18 struct klist containers; 18 struct klist containers;
19 struct class *class; 19 struct class *class;
20 struct attribute_group *grp; 20 const struct attribute_group *grp;
21 struct device_attribute **attrs; 21 struct device_attribute **attrs;
22 int (*match)(struct attribute_container *, struct device *); 22 int (*match)(struct attribute_container *, struct device *);
23#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01 23#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index f169bcb90b58..0ee33c2e6129 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -59,6 +59,7 @@ struct bdi_writeback {
59 59
60struct backing_dev_info { 60struct backing_dev_info {
61 struct list_head bdi_list; 61 struct list_head bdi_list;
62 struct rcu_head rcu_head;
62 unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ 63 unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */
63 unsigned long state; /* Always use atomic bitops on this */ 64 unsigned long state; /* Always use atomic bitops on this */
64 unsigned int capabilities; /* Device capabilities */ 65 unsigned int capabilities; /* Device capabilities */
@@ -100,7 +101,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
100 const char *fmt, ...); 101 const char *fmt, ...);
101int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 102int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
102void bdi_unregister(struct backing_dev_info *bdi); 103void bdi_unregister(struct backing_dev_info *bdi);
103void bdi_start_writeback(struct writeback_control *wbc); 104void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages);
104int bdi_writeback_task(struct bdi_writeback *wb); 105int bdi_writeback_task(struct bdi_writeback *wb);
105int bdi_has_dirty_io(struct backing_dev_info *bdi); 106int bdi_has_dirty_io(struct backing_dev_info *bdi);
106 107
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 2892b710771c..5be93f18d842 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -142,56 +142,51 @@ struct bio {
142 * 142 *
143 * bit 0 -- data direction 143 * bit 0 -- data direction
144 * If not set, bio is a read from device. If set, it's a write to device. 144 * If not set, bio is a read from device. If set, it's a write to device.
145 * bit 1 -- rw-ahead when set 145 * bit 1 -- fail fast device errors
146 * bit 2 -- barrier 146 * bit 2 -- fail fast transport errors
147 * bit 3 -- fail fast driver errors
148 * bit 4 -- rw-ahead when set
149 * bit 5 -- barrier
147 * Insert a serialization point in the IO queue, forcing previously 150 * Insert a serialization point in the IO queue, forcing previously
148 * submitted IO to be completed before this one is issued. 151 * submitted IO to be completed before this one is issued.
149 * bit 3 -- synchronous I/O hint. 152 * bit 6 -- synchronous I/O hint.
150 * bit 4 -- Unplug the device immediately after submitting this bio. 153 * bit 7 -- Unplug the device immediately after submitting this bio.
151 * bit 5 -- metadata request 154 * bit 8 -- metadata request
152 * Used for tracing to differentiate metadata and data IO. May also 155 * Used for tracing to differentiate metadata and data IO. May also
153 * get some preferential treatment in the IO scheduler 156 * get some preferential treatment in the IO scheduler
154 * bit 6 -- discard sectors 157 * bit 9 -- discard sectors
155 * Informs the lower level device that this range of sectors is no longer 158 * Informs the lower level device that this range of sectors is no longer
156 * used by the file system and may thus be freed by the device. Used 159 * used by the file system and may thus be freed by the device. Used
157 * for flash based storage. 160 * for flash based storage.
158 * bit 7 -- fail fast device errors
159 * bit 8 -- fail fast transport errors
160 * bit 9 -- fail fast driver errors
161 * Don't want driver retries for any fast fail whatever the reason. 161 * Don't want driver retries for any fast fail whatever the reason.
162 * bit 10 -- Tell the IO scheduler not to wait for more requests after this 162 * bit 10 -- Tell the IO scheduler not to wait for more requests after this
163 one has been submitted, even if it is a SYNC request. 163 one has been submitted, even if it is a SYNC request.
164 */ 164 */
165#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ 165enum bio_rw_flags {
166#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ 166 BIO_RW,
167#define BIO_RW_BARRIER 2 167 BIO_RW_FAILFAST_DEV,
168#define BIO_RW_SYNCIO 3 168 BIO_RW_FAILFAST_TRANSPORT,
169#define BIO_RW_UNPLUG 4 169 BIO_RW_FAILFAST_DRIVER,
170#define BIO_RW_META 5 170 /* above flags must match REQ_* */
171#define BIO_RW_DISCARD 6 171 BIO_RW_AHEAD,
172#define BIO_RW_FAILFAST_DEV 7 172 BIO_RW_BARRIER,
173#define BIO_RW_FAILFAST_TRANSPORT 8 173 BIO_RW_SYNCIO,
174#define BIO_RW_FAILFAST_DRIVER 9 174 BIO_RW_UNPLUG,
175#define BIO_RW_NOIDLE 10 175 BIO_RW_META,
176 176 BIO_RW_DISCARD,
177#define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag))) 177 BIO_RW_NOIDLE,
178};
178 179
179/* 180/*
180 * Old defines, these should eventually be replaced by direct usage of 181 * First four bits must match between bio->bi_rw and rq->cmd_flags, make
181 * bio_rw_flagged() 182 * that explicit here.
182 */ 183 */
183#define bio_barrier(bio) bio_rw_flagged(bio, BIO_RW_BARRIER) 184#define BIO_RW_RQ_MASK 0xf
184#define bio_sync(bio) bio_rw_flagged(bio, BIO_RW_SYNCIO) 185
185#define bio_unplug(bio) bio_rw_flagged(bio, BIO_RW_UNPLUG) 186static inline bool bio_rw_flagged(struct bio *bio, enum bio_rw_flags flag)
186#define bio_failfast_dev(bio) bio_rw_flagged(bio, BIO_RW_FAILFAST_DEV) 187{
187#define bio_failfast_transport(bio) \ 188 return (bio->bi_rw & (1 << flag)) != 0;
188 bio_rw_flagged(bio, BIO_RW_FAILFAST_TRANSPORT) 189}
189#define bio_failfast_driver(bio) \
190 bio_rw_flagged(bio, BIO_RW_FAILFAST_DRIVER)
191#define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD)
192#define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META)
193#define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD)
194#define bio_noidle(bio) bio_rw_flagged(bio, BIO_RW_NOIDLE)
195 190
196/* 191/*
197 * upper 16 bits of bi_rw define the io priority of this bio 192 * upper 16 bits of bi_rw define the io priority of this bio
@@ -216,7 +211,7 @@ struct bio {
216#define bio_offset(bio) bio_iovec((bio))->bv_offset 211#define bio_offset(bio) bio_iovec((bio))->bv_offset
217#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) 212#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
218#define bio_sectors(bio) ((bio)->bi_size >> 9) 213#define bio_sectors(bio) ((bio)->bi_size >> 9)
219#define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio)) 214#define bio_empty_barrier(bio) (bio_rw_flagged(bio, BIO_RW_BARRIER) && !bio_has_data(bio) && !bio_rw_flagged(bio, BIO_RW_DISCARD))
220 215
221static inline unsigned int bio_cur_bytes(struct bio *bio) 216static inline unsigned int bio_cur_bytes(struct bio *bio)
222{ 217{
diff --git a/include/linux/blk-iopoll.h b/include/linux/blk-iopoll.h
new file mode 100644
index 000000000000..308734d3d4a2
--- /dev/null
+++ b/include/linux/blk-iopoll.h
@@ -0,0 +1,48 @@
1#ifndef BLK_IOPOLL_H
2#define BLK_IOPOLL_H
3
4struct blk_iopoll;
5typedef int (blk_iopoll_fn)(struct blk_iopoll *, int);
6
7struct blk_iopoll {
8 struct list_head list;
9 unsigned long state;
10 unsigned long data;
11 int weight;
12 int max;
13 blk_iopoll_fn *poll;
14};
15
16enum {
17 IOPOLL_F_SCHED = 0,
18 IOPOLL_F_DISABLE = 1,
19};
20
21/*
22 * Returns 0 if we successfully set the IOPOLL_F_SCHED bit, indicating
23 * that we were the first to acquire this iop for scheduling. If this iop
24 * is currently disabled, return "failure".
25 */
26static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop)
27{
28 if (!test_bit(IOPOLL_F_DISABLE, &iop->state))
29 return test_and_set_bit(IOPOLL_F_SCHED, &iop->state);
30
31 return 1;
32}
33
34static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop)
35{
36 return test_bit(IOPOLL_F_DISABLE, &iop->state);
37}
38
39extern void blk_iopoll_sched(struct blk_iopoll *);
40extern void blk_iopoll_init(struct blk_iopoll *, int, blk_iopoll_fn *);
41extern void blk_iopoll_complete(struct blk_iopoll *);
42extern void __blk_iopoll_complete(struct blk_iopoll *);
43extern void blk_iopoll_enable(struct blk_iopoll *);
44extern void blk_iopoll_disable(struct blk_iopoll *);
45
46extern int blk_iopoll_enabled;
47
48#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 69103e053c92..e23a86cae5ac 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -86,13 +86,14 @@ enum {
86}; 86};
87 87
88/* 88/*
89 * request type modified bits. first two bits match BIO_RW* bits, important 89 * request type modified bits. first four bits match BIO_RW* bits, important
90 */ 90 */
91enum rq_flag_bits { 91enum rq_flag_bits {
92 __REQ_RW, /* not set, read. set, write */ 92 __REQ_RW, /* not set, read. set, write */
93 __REQ_FAILFAST_DEV, /* no driver retries of device errors */ 93 __REQ_FAILFAST_DEV, /* no driver retries of device errors */
94 __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ 94 __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */
95 __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ 95 __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */
96 /* above flags must match BIO_RW_* */
96 __REQ_DISCARD, /* request to discard sectors */ 97 __REQ_DISCARD, /* request to discard sectors */
97 __REQ_SORTED, /* elevator knows about this request */ 98 __REQ_SORTED, /* elevator knows about this request */
98 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ 99 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
@@ -114,6 +115,7 @@ enum rq_flag_bits {
114 __REQ_INTEGRITY, /* integrity metadata has been remapped */ 115 __REQ_INTEGRITY, /* integrity metadata has been remapped */
115 __REQ_NOIDLE, /* Don't anticipate more IO after this one */ 116 __REQ_NOIDLE, /* Don't anticipate more IO after this one */
116 __REQ_IO_STAT, /* account I/O stat */ 117 __REQ_IO_STAT, /* account I/O stat */
118 __REQ_MIXED_MERGE, /* merge of different types, fail separately */
117 __REQ_NR_BITS, /* stops here */ 119 __REQ_NR_BITS, /* stops here */
118}; 120};
119 121
@@ -142,6 +144,10 @@ enum rq_flag_bits {
142#define REQ_INTEGRITY (1 << __REQ_INTEGRITY) 144#define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
143#define REQ_NOIDLE (1 << __REQ_NOIDLE) 145#define REQ_NOIDLE (1 << __REQ_NOIDLE)
144#define REQ_IO_STAT (1 << __REQ_IO_STAT) 146#define REQ_IO_STAT (1 << __REQ_IO_STAT)
147#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)
148
149#define REQ_FAILFAST_MASK (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | \
150 REQ_FAILFAST_DRIVER)
145 151
146#define BLK_MAX_CDB 16 152#define BLK_MAX_CDB 16
147 153
@@ -453,10 +459,12 @@ struct request_queue
453#define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ 459#define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */
454#define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ 460#define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */
455#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ 461#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */
462#define QUEUE_FLAG_CQ 16 /* hardware does queuing */
456 463
457#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ 464#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
458 (1 << QUEUE_FLAG_CLUSTER) | \ 465 (1 << QUEUE_FLAG_CLUSTER) | \
459 (1 << QUEUE_FLAG_STACKABLE)) 466 (1 << QUEUE_FLAG_STACKABLE) | \
467 (1 << QUEUE_FLAG_SAME_COMP))
460 468
461static inline int queue_is_locked(struct request_queue *q) 469static inline int queue_is_locked(struct request_queue *q)
462{ 470{
@@ -575,6 +583,7 @@ enum {
575 583
576#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) 584#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
577#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) 585#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
586#define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags)
578#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 587#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
579#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) 588#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
580#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) 589#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags)
@@ -828,11 +837,13 @@ static inline void blk_run_address_space(struct address_space *mapping)
828} 837}
829 838
830/* 839/*
831 * blk_rq_pos() : the current sector 840 * blk_rq_pos() : the current sector
832 * blk_rq_bytes() : bytes left in the entire request 841 * blk_rq_bytes() : bytes left in the entire request
833 * blk_rq_cur_bytes() : bytes left in the current segment 842 * blk_rq_cur_bytes() : bytes left in the current segment
834 * blk_rq_sectors() : sectors left in the entire request 843 * blk_rq_err_bytes() : bytes left till the next error boundary
835 * blk_rq_cur_sectors() : sectors left in the current segment 844 * blk_rq_sectors() : sectors left in the entire request
845 * blk_rq_cur_sectors() : sectors left in the current segment
846 * blk_rq_err_sectors() : sectors left till the next error boundary
836 */ 847 */
837static inline sector_t blk_rq_pos(const struct request *rq) 848static inline sector_t blk_rq_pos(const struct request *rq)
838{ 849{
@@ -849,6 +860,8 @@ static inline int blk_rq_cur_bytes(const struct request *rq)
849 return rq->bio ? bio_cur_bytes(rq->bio) : 0; 860 return rq->bio ? bio_cur_bytes(rq->bio) : 0;
850} 861}
851 862
863extern unsigned int blk_rq_err_bytes(const struct request *rq);
864
852static inline unsigned int blk_rq_sectors(const struct request *rq) 865static inline unsigned int blk_rq_sectors(const struct request *rq)
853{ 866{
854 return blk_rq_bytes(rq) >> 9; 867 return blk_rq_bytes(rq) >> 9;
@@ -859,6 +872,11 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
859 return blk_rq_cur_bytes(rq) >> 9; 872 return blk_rq_cur_bytes(rq) >> 9;
860} 873}
861 874
875static inline unsigned int blk_rq_err_sectors(const struct request *rq)
876{
877 return blk_rq_err_bytes(rq) >> 9;
878}
879
862/* 880/*
863 * Request issue related functions. 881 * Request issue related functions.
864 */ 882 */
@@ -885,10 +903,12 @@ extern bool blk_end_request(struct request *rq, int error,
885 unsigned int nr_bytes); 903 unsigned int nr_bytes);
886extern void blk_end_request_all(struct request *rq, int error); 904extern void blk_end_request_all(struct request *rq, int error);
887extern bool blk_end_request_cur(struct request *rq, int error); 905extern bool blk_end_request_cur(struct request *rq, int error);
906extern bool blk_end_request_err(struct request *rq, int error);
888extern bool __blk_end_request(struct request *rq, int error, 907extern bool __blk_end_request(struct request *rq, int error,
889 unsigned int nr_bytes); 908 unsigned int nr_bytes);
890extern void __blk_end_request_all(struct request *rq, int error); 909extern void __blk_end_request_all(struct request *rq, int error);
891extern bool __blk_end_request_cur(struct request *rq, int error); 910extern bool __blk_end_request_cur(struct request *rq, int error);
911extern bool __blk_end_request_err(struct request *rq, int error);
892 912
893extern void blk_complete_request(struct request *); 913extern void blk_complete_request(struct request *);
894extern void __blk_complete_request(struct request *); 914extern void __blk_complete_request(struct request *);
@@ -915,6 +935,7 @@ extern void blk_queue_alignment_offset(struct request_queue *q,
915 unsigned int alignment); 935 unsigned int alignment);
916extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min); 936extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min);
917extern void blk_queue_io_min(struct request_queue *q, unsigned int min); 937extern void blk_queue_io_min(struct request_queue *q, unsigned int min);
938extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt);
918extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); 939extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
919extern void blk_set_default_limits(struct queue_limits *lim); 940extern void blk_set_default_limits(struct queue_limits *lim);
920extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, 941extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
@@ -977,15 +998,18 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
977} 998}
978 999
979extern int blkdev_issue_flush(struct block_device *, sector_t *); 1000extern int blkdev_issue_flush(struct block_device *, sector_t *);
980extern int blkdev_issue_discard(struct block_device *, 1001#define DISCARD_FL_WAIT 0x01 /* wait for completion */
981 sector_t sector, sector_t nr_sects, gfp_t); 1002#define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */
1003extern int blkdev_issue_discard(struct block_device *, sector_t sector,
1004 sector_t nr_sects, gfp_t, int flags);
982 1005
983static inline int sb_issue_discard(struct super_block *sb, 1006static inline int sb_issue_discard(struct super_block *sb,
984 sector_t block, sector_t nr_blocks) 1007 sector_t block, sector_t nr_blocks)
985{ 1008{
986 block <<= (sb->s_blocksize_bits - 9); 1009 block <<= (sb->s_blocksize_bits - 9);
987 nr_blocks <<= (sb->s_blocksize_bits - 9); 1010 nr_blocks <<= (sb->s_blocksize_bits - 9);
988 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); 1011 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
1012 DISCARD_FL_BARRIER);
989} 1013}
990 1014
991extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); 1015extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 4a37a56f6cdd..5824b20b5fcb 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -66,5 +66,6 @@ void can_bus_off(struct net_device *dev);
66 66
67void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); 67void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx);
68void can_get_echo_skb(struct net_device *dev, int idx); 68void can_get_echo_skb(struct net_device *dev, int idx);
69void can_free_echo_skb(struct net_device *dev, int idx);
69 70
70#endif /* CAN_DEV_H */ 71#endif /* CAN_DEV_H */
diff --git a/include/linux/connector.h b/include/linux/connector.h
index b68d27850d51..47ebf416f512 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -136,7 +136,7 @@ struct cn_callback_data {
136 void *ddata; 136 void *ddata;
137 137
138 void *callback_priv; 138 void *callback_priv;
139 void (*callback) (void *); 139 void (*callback) (struct cn_msg *);
140 140
141 void *free; 141 void *free;
142}; 142};
@@ -167,11 +167,11 @@ struct cn_dev {
167 struct cn_queue_dev *cbdev; 167 struct cn_queue_dev *cbdev;
168}; 168};
169 169
170int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); 170int cn_add_callback(struct cb_id *, char *, void (*callback) (struct cn_msg *));
171void cn_del_callback(struct cb_id *); 171void cn_del_callback(struct cb_id *);
172int cn_netlink_send(struct cn_msg *, u32, gfp_t); 172int cn_netlink_send(struct cn_msg *, u32, gfp_t);
173 173
174int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); 174int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *));
175void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); 175void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
176 176
177int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work); 177int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work);
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 24520a539c6f..fb371601a3b4 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -15,6 +15,7 @@
15#include <linux/capability.h> 15#include <linux/capability.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/key.h> 17#include <linux/key.h>
18#include <linux/selinux.h>
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19 20
20struct user_struct; 21struct user_struct;
@@ -182,11 +183,13 @@ static inline bool creds_are_invalid(const struct cred *cred)
182 if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers)) 183 if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers))
183 return true; 184 return true;
184#ifdef CONFIG_SECURITY_SELINUX 185#ifdef CONFIG_SECURITY_SELINUX
185 if ((unsigned long) cred->security < PAGE_SIZE) 186 if (selinux_is_enabled()) {
186 return true; 187 if ((unsigned long) cred->security < PAGE_SIZE)
187 if ((*(u32*)cred->security & 0xffffff00) == 188 return true;
188 (POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8)) 189 if ((*(u32 *)cred->security & 0xffffff00) ==
189 return true; 190 (POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8))
191 return true;
192 }
190#endif 193#endif
191 return false; 194 return false;
192} 195}
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 7d2e10006188..b7cdbb4373df 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -50,6 +50,8 @@ struct dcbmsg {
50 * @DCB_CMD_SNUMTCS: set the number of traffic classes 50 * @DCB_CMD_SNUMTCS: set the number of traffic classes
51 * @DCB_CMD_GBCN: set backward congestion notification configuration 51 * @DCB_CMD_GBCN: set backward congestion notification configuration
52 * @DCB_CMD_SBCN: get backward congestion notification configration. 52 * @DCB_CMD_SBCN: get backward congestion notification configration.
53 * @DCB_CMD_GAPP: get application protocol configuration
54 * @DCB_CMD_SAPP: set application protocol configuration
53 */ 55 */
54enum dcbnl_commands { 56enum dcbnl_commands {
55 DCB_CMD_UNDEFINED, 57 DCB_CMD_UNDEFINED,
@@ -80,6 +82,9 @@ enum dcbnl_commands {
80 DCB_CMD_BCN_GCFG, 82 DCB_CMD_BCN_GCFG,
81 DCB_CMD_BCN_SCFG, 83 DCB_CMD_BCN_SCFG,
82 84
85 DCB_CMD_GAPP,
86 DCB_CMD_SAPP,
87
83 __DCB_CMD_ENUM_MAX, 88 __DCB_CMD_ENUM_MAX,
84 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, 89 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
85}; 90};
@@ -114,6 +119,7 @@ enum dcbnl_attrs {
114 DCB_ATTR_CAP, 119 DCB_ATTR_CAP,
115 DCB_ATTR_NUMTCS, 120 DCB_ATTR_NUMTCS,
116 DCB_ATTR_BCN, 121 DCB_ATTR_BCN,
122 DCB_ATTR_APP,
117 123
118 __DCB_ATTR_ENUM_MAX, 124 __DCB_ATTR_ENUM_MAX,
119 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, 125 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
@@ -338,5 +344,17 @@ enum dcb_general_attr_values {
338 DCB_ATTR_VALUE_UNDEFINED = 0xff 344 DCB_ATTR_VALUE_UNDEFINED = 0xff
339}; 345};
340 346
347#define DCB_APP_IDTYPE_ETHTYPE 0x00
348#define DCB_APP_IDTYPE_PORTNUM 0x01
349enum dcbnl_app_attrs {
350 DCB_APP_ATTR_UNDEFINED,
351
352 DCB_APP_ATTR_IDTYPE,
353 DCB_APP_ATTR_ID,
354 DCB_APP_ATTR_PRIORITY,
355
356 __DCB_APP_ATTR_ENUM_MAX,
357 DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
358};
341 359
342#endif /* __LINUX_DCBNL_H__ */ 360#endif /* __LINUX_DCBNL_H__ */
diff --git a/include/linux/device.h b/include/linux/device.h
index aebb81036db2..847b763e40e9 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -2,7 +2,8 @@
2 * device.h - generic, centralized driver model 2 * device.h - generic, centralized driver model
3 * 3 *
4 * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> 4 * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
5 * Copyright (c) 2004-2007 Greg Kroah-Hartman <gregkh@suse.de> 5 * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de>
6 * Copyright (c) 2008-2009 Novell Inc.
6 * 7 *
7 * This file is released under the GPLv2 8 * This file is released under the GPLv2
8 * 9 *
@@ -62,7 +63,7 @@ struct bus_type {
62 int (*suspend)(struct device *dev, pm_message_t state); 63 int (*suspend)(struct device *dev, pm_message_t state);
63 int (*resume)(struct device *dev); 64 int (*resume)(struct device *dev);
64 65
65 struct dev_pm_ops *pm; 66 const struct dev_pm_ops *pm;
66 67
67 struct bus_type_private *p; 68 struct bus_type_private *p;
68}; 69};
@@ -130,9 +131,9 @@ struct device_driver {
130 void (*shutdown) (struct device *dev); 131 void (*shutdown) (struct device *dev);
131 int (*suspend) (struct device *dev, pm_message_t state); 132 int (*suspend) (struct device *dev, pm_message_t state);
132 int (*resume) (struct device *dev); 133 int (*resume) (struct device *dev);
133 struct attribute_group **groups; 134 const struct attribute_group **groups;
134 135
135 struct dev_pm_ops *pm; 136 const struct dev_pm_ops *pm;
136 137
137 struct driver_private *p; 138 struct driver_private *p;
138}; 139};
@@ -200,7 +201,8 @@ struct class {
200 int (*suspend)(struct device *dev, pm_message_t state); 201 int (*suspend)(struct device *dev, pm_message_t state);
201 int (*resume)(struct device *dev); 202 int (*resume)(struct device *dev);
202 203
203 struct dev_pm_ops *pm; 204 const struct dev_pm_ops *pm;
205
204 struct class_private *p; 206 struct class_private *p;
205}; 207};
206 208
@@ -223,6 +225,14 @@ extern void class_unregister(struct class *class);
223 __class_register(class, &__key); \ 225 __class_register(class, &__key); \
224}) 226})
225 227
228struct class_compat;
229struct class_compat *class_compat_register(const char *name);
230void class_compat_unregister(struct class_compat *cls);
231int class_compat_create_link(struct class_compat *cls, struct device *dev,
232 struct device *device_link);
233void class_compat_remove_link(struct class_compat *cls, struct device *dev,
234 struct device *device_link);
235
226extern void class_dev_iter_init(struct class_dev_iter *iter, 236extern void class_dev_iter_init(struct class_dev_iter *iter,
227 struct class *class, 237 struct class *class,
228 struct device *start, 238 struct device *start,
@@ -286,12 +296,12 @@ extern void class_destroy(struct class *cls);
286 */ 296 */
287struct device_type { 297struct device_type {
288 const char *name; 298 const char *name;
289 struct attribute_group **groups; 299 const struct attribute_group **groups;
290 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 300 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
291 char *(*nodename)(struct device *dev); 301 char *(*nodename)(struct device *dev);
292 void (*release)(struct device *dev); 302 void (*release)(struct device *dev);
293 303
294 struct dev_pm_ops *pm; 304 const struct dev_pm_ops *pm;
295}; 305};
296 306
297/* interface for exporting device attributes */ 307/* interface for exporting device attributes */
@@ -380,7 +390,6 @@ struct device {
380 struct bus_type *bus; /* type of bus device is on */ 390 struct bus_type *bus; /* type of bus device is on */
381 struct device_driver *driver; /* which driver has allocated this 391 struct device_driver *driver; /* which driver has allocated this
382 device */ 392 device */
383 void *driver_data; /* data private to the driver */
384 void *platform_data; /* Platform specific data, device 393 void *platform_data; /* Platform specific data, device
385 core doesn't touch it */ 394 core doesn't touch it */
386 struct dev_pm_info power; 395 struct dev_pm_info power;
@@ -411,7 +420,7 @@ struct device {
411 420
412 struct klist_node knode_class; 421 struct klist_node knode_class;
413 struct class *class; 422 struct class *class;
414 struct attribute_group **groups; /* optional groups */ 423 const struct attribute_group **groups; /* optional groups */
415 424
416 void (*release)(struct device *dev); 425 void (*release)(struct device *dev);
417}; 426};
@@ -446,16 +455,6 @@ static inline void set_dev_node(struct device *dev, int node)
446} 455}
447#endif 456#endif
448 457
449static inline void *dev_get_drvdata(const struct device *dev)
450{
451 return dev->driver_data;
452}
453
454static inline void dev_set_drvdata(struct device *dev, void *data)
455{
456 dev->driver_data = data;
457}
458
459static inline unsigned int dev_get_uevent_suppress(const struct device *dev) 458static inline unsigned int dev_get_uevent_suppress(const struct device *dev)
460{ 459{
461 return dev->kobj.uevent_suppress; 460 return dev->kobj.uevent_suppress;
@@ -489,6 +488,8 @@ extern int device_rename(struct device *dev, char *new_name);
489extern int device_move(struct device *dev, struct device *new_parent, 488extern int device_move(struct device *dev, struct device *new_parent,
490 enum dpm_order dpm_order); 489 enum dpm_order dpm_order);
491extern const char *device_get_nodename(struct device *dev, const char **tmp); 490extern const char *device_get_nodename(struct device *dev, const char **tmp);
491extern void *dev_get_drvdata(const struct device *dev);
492extern void dev_set_drvdata(struct device *dev, void *data);
492 493
493/* 494/*
494 * Root device objects for grouping under /sys/devices 495 * Root device objects for grouping under /sys/devices
@@ -501,6 +502,11 @@ static inline struct device *root_device_register(const char *name)
501} 502}
502extern void root_device_unregister(struct device *root); 503extern void root_device_unregister(struct device *root);
503 504
505static inline void *dev_get_platdata(const struct device *dev)
506{
507 return dev->platform_data;
508}
509
504/* 510/*
505 * Manual binding of a device to driver. See drivers/base/bus.c 511 * Manual binding of a device to driver. See drivers/base/bus.c
506 * for information on use. 512 * for information on use.
@@ -546,6 +552,16 @@ extern void put_device(struct device *dev);
546 552
547extern void wait_for_device_probe(void); 553extern void wait_for_device_probe(void);
548 554
555#ifdef CONFIG_DEVTMPFS
556extern int devtmpfs_create_node(struct device *dev);
557extern int devtmpfs_delete_node(struct device *dev);
558extern int devtmpfs_mount(const char *mountpoint);
559#else
560static inline int devtmpfs_create_node(struct device *dev) { return 0; }
561static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
562static inline int devtmpfs_mount(const char *mountpoint) { return 0; }
563#endif
564
549/* drivers/base/power/shutdown.c */ 565/* drivers/base/power/shutdown.c */
550extern void device_shutdown(void); 566extern void device_shutdown(void);
551 567
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index c0f6c3cd788c..91b761846061 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -58,6 +58,7 @@ struct dma_map_ops {
58 enum dma_data_direction dir); 58 enum dma_data_direction dir);
59 int (*mapping_error)(struct device *dev, dma_addr_t dma_addr); 59 int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
60 int (*dma_supported)(struct device *dev, u64 mask); 60 int (*dma_supported)(struct device *dev, u64 mask);
61 int (*set_dma_mask)(struct device *dev, u64 mask);
61 int is_phys; 62 int is_phys;
62}; 63};
63 64
diff --git a/include/linux/dtlk.h b/include/linux/dtlk.h
index 2896d90118a9..22a7b9a5f5d1 100644
--- a/include/linux/dtlk.h
+++ b/include/linux/dtlk.h
@@ -1,22 +1,3 @@
1#if 0
2
3#define TRACE_TXT(text) \
4 { \
5 if(dtlk_trace) \
6 { \
7 console_print(text); \
8 console_print("\n"); \
9 } \
10 }
11
12#define TRACE_CHR(chr) \
13 { \
14 if(dtlk_trace) \
15 console_print(chr); \
16 } \
17
18#endif
19
20#define DTLK_MINOR 0 1#define DTLK_MINOR 0
21#define DTLK_IO_EXTENT 0x02 2#define DTLK_IO_EXTENT 0x02
22 3
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
index fef943738a24..f078f3ac82d4 100644
--- a/include/linux/dvb/dmx.h
+++ b/include/linux/dvb/dmx.h
@@ -151,5 +151,7 @@ struct dmx_stc {
151#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) 151#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
152#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) 152#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
153#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) 153#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
154#define DMX_ADD_PID _IOW('o', 51, __u16)
155#define DMX_REMOVE_PID _IOW('o', 52, __u16)
154 156
155#endif /*_DVBDMX_H_*/ 157#endif /*_DVBDMX_H_*/
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h
index 4332442b1b57..90d1c2184112 100644
--- a/include/linux/enclosure.h
+++ b/include/linux/enclosure.h
@@ -122,8 +122,9 @@ enclosure_component_register(struct enclosure_device *, unsigned int,
122 enum enclosure_component_type, const char *); 122 enum enclosure_component_type, const char *);
123int enclosure_add_device(struct enclosure_device *enclosure, int component, 123int enclosure_add_device(struct enclosure_device *enclosure, int component,
124 struct device *dev); 124 struct device *dev);
125int enclosure_remove_device(struct enclosure_device *enclosure, int component); 125int enclosure_remove_device(struct enclosure_device *, struct device *);
126struct enclosure_device *enclosure_find(struct device *dev); 126struct enclosure_device *enclosure_find(struct device *dev,
127 struct enclosure_device *start);
127int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *), 128int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *),
128 void *data); 129 void *data);
129 130
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 9b660bd2e2b3..15e4eb713694 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -362,12 +362,25 @@ struct ethtool_rxnfc {
362 __u32 rule_locs[0]; 362 __u32 rule_locs[0];
363}; 363};
364 364
365#define ETHTOOL_FLASH_MAX_FILENAME 128
366enum ethtool_flash_op_type {
367 ETHTOOL_FLASH_ALL_REGIONS = 0,
368};
369
370/* for passing firmware flashing related parameters */
371struct ethtool_flash {
372 __u32 cmd;
373 __u32 region;
374 char data[ETHTOOL_FLASH_MAX_FILENAME];
375};
376
365#ifdef __KERNEL__ 377#ifdef __KERNEL__
366 378
367struct net_device; 379struct net_device;
368 380
369/* Some generic methods drivers may use in their ethtool_ops */ 381/* Some generic methods drivers may use in their ethtool_ops */
370u32 ethtool_op_get_link(struct net_device *dev); 382u32 ethtool_op_get_link(struct net_device *dev);
383u32 ethtool_op_get_rx_csum(struct net_device *dev);
371u32 ethtool_op_get_tx_csum(struct net_device *dev); 384u32 ethtool_op_get_tx_csum(struct net_device *dev);
372int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); 385int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
373int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); 386int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
@@ -488,6 +501,7 @@ struct ethtool_ops {
488 int (*get_stats_count)(struct net_device *);/* use get_sset_count */ 501 int (*get_stats_count)(struct net_device *);/* use get_sset_count */
489 int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); 502 int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *);
490 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 503 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
504 int (*flash_device)(struct net_device *, struct ethtool_flash *);
491}; 505};
492#endif /* __KERNEL__ */ 506#endif /* __KERNEL__ */
493 507
@@ -544,6 +558,7 @@ struct ethtool_ops {
544#define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ 558#define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
545#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ 559#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
546#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ 560#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
561#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
547 562
548/* compatibility with older code */ 563/* compatibility with older code */
549#define SPARC_ETH_GSET ETHTOOL_GSET 564#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a79f48373e7e..90162fb3bf04 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -161,8 +161,8 @@ struct inodes_stat_t {
161 * These aren't really reads or writes, they pass down information about 161 * These aren't really reads or writes, they pass down information about
162 * parts of device that are now unused by the file system. 162 * parts of device that are now unused by the file system.
163 */ 163 */
164#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) 164#define DISCARD_NOBARRIER (WRITE | (1 << BIO_RW_DISCARD))
165#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) 165#define DISCARD_BARRIER (DISCARD_NOBARRIER | (1 << BIO_RW_BARRIER))
166 166
167#define SEL_IN 1 167#define SEL_IN 1
168#define SEL_OUT 2 168#define SEL_OUT 2
@@ -655,7 +655,6 @@ struct block_device {
655 int bd_invalidated; 655 int bd_invalidated;
656 struct gendisk * bd_disk; 656 struct gendisk * bd_disk;
657 struct list_head bd_list; 657 struct list_head bd_list;
658 struct backing_dev_info *bd_inode_backing_dev_info;
659 /* 658 /*
660 * Private data. You must have bd_claim'ed the block_device 659 * Private data. You must have bd_claim'ed the block_device
661 * to use this. NOTE: bd_claim allows an owner to claim 660 * to use this. NOTE: bd_claim allows an owner to claim
@@ -1343,6 +1342,7 @@ struct super_block {
1343 int s_nr_dentry_unused; /* # of dentry on lru */ 1342 int s_nr_dentry_unused; /* # of dentry on lru */
1344 1343
1345 struct block_device *s_bdev; 1344 struct block_device *s_bdev;
1345 struct backing_dev_info *s_bdi;
1346 struct mtd_info *s_mtd; 1346 struct mtd_info *s_mtd;
1347 struct list_head s_instances; 1347 struct list_head s_instances;
1348 struct quota_info s_dquot; /* Diskquota specific options */ 1348 struct quota_info s_dquot; /* Diskquota specific options */
@@ -1455,11 +1455,6 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
1455#define DT_SOCK 12 1455#define DT_SOCK 12
1456#define DT_WHT 14 1456#define DT_WHT 14
1457 1457
1458#define OSYNC_METADATA (1<<0)
1459#define OSYNC_DATA (1<<1)
1460#define OSYNC_INODE (1<<2)
1461int generic_osync_inode(struct inode *, struct address_space *, int);
1462
1463/* 1458/*
1464 * This is the "filldir" function type, used by readdir() to let 1459 * This is the "filldir" function type, used by readdir() to let
1465 * the kernel specify what kind of dirent layout it wants to have. 1460 * the kernel specify what kind of dirent layout it wants to have.
@@ -2086,6 +2081,8 @@ extern int write_inode_now(struct inode *, int);
2086extern int filemap_fdatawrite(struct address_space *); 2081extern int filemap_fdatawrite(struct address_space *);
2087extern int filemap_flush(struct address_space *); 2082extern int filemap_flush(struct address_space *);
2088extern int filemap_fdatawait(struct address_space *); 2083extern int filemap_fdatawait(struct address_space *);
2084extern int filemap_fdatawait_range(struct address_space *, loff_t lstart,
2085 loff_t lend);
2089extern int filemap_write_and_wait(struct address_space *mapping); 2086extern int filemap_write_and_wait(struct address_space *mapping);
2090extern int filemap_write_and_wait_range(struct address_space *mapping, 2087extern int filemap_write_and_wait_range(struct address_space *mapping,
2091 loff_t lstart, loff_t lend); 2088 loff_t lstart, loff_t lend);
@@ -2096,7 +2093,10 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
2096extern int filemap_fdatawrite_range(struct address_space *mapping, 2093extern int filemap_fdatawrite_range(struct address_space *mapping,
2097 loff_t start, loff_t end); 2094 loff_t start, loff_t end);
2098 2095
2096extern int vfs_fsync_range(struct file *file, struct dentry *dentry,
2097 loff_t start, loff_t end, int datasync);
2099extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); 2098extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync);
2099extern int generic_write_sync(struct file *file, loff_t pos, loff_t count);
2100extern void sync_supers(void); 2100extern void sync_supers(void);
2101extern void emergency_sync(void); 2101extern void emergency_sync(void);
2102extern void emergency_remount(void); 2102extern void emergency_remount(void);
@@ -2202,9 +2202,9 @@ extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
2202extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); 2202extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
2203int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); 2203int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
2204extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); 2204extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
2205extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long,
2206 loff_t *);
2205extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); 2207extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
2206extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *,
2207 unsigned long, loff_t);
2208extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, 2208extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *,
2209 unsigned long *, loff_t, loff_t *, size_t, size_t); 2209 unsigned long *, loff_t, loff_t *, size_t, size_t);
2210extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, 2210extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
@@ -2214,6 +2214,10 @@ extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t l
2214extern int generic_segment_checks(const struct iovec *iov, 2214extern int generic_segment_checks(const struct iovec *iov,
2215 unsigned long *nr_segs, size_t *count, int access_flags); 2215 unsigned long *nr_segs, size_t *count, int access_flags);
2216 2216
2217/* fs/block_dev.c */
2218extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2219 unsigned long nr_segs, loff_t pos);
2220
2217/* fs/splice.c */ 2221/* fs/splice.c */
2218extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2222extern ssize_t generic_file_splice_read(struct file *, loff_t *,
2219 struct pipe_inode_info *, size_t, unsigned int); 2223 struct pipe_inode_info *, size_t, unsigned int);
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 23f7179bf74e..bd099ba82ccc 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -1,8 +1,8 @@
1#ifndef _LINUX_FTRACE_EVENT_H 1#ifndef _LINUX_FTRACE_EVENT_H
2#define _LINUX_FTRACE_EVENT_H 2#define _LINUX_FTRACE_EVENT_H
3 3
4#include <linux/trace_seq.h>
5#include <linux/ring_buffer.h> 4#include <linux/ring_buffer.h>
5#include <linux/trace_seq.h>
6#include <linux/percpu.h> 6#include <linux/percpu.h>
7 7
8struct trace_array; 8struct trace_array;
@@ -34,7 +34,7 @@ struct trace_entry {
34 unsigned char flags; 34 unsigned char flags;
35 unsigned char preempt_count; 35 unsigned char preempt_count;
36 int pid; 36 int pid;
37 int tgid; 37 int lock_depth;
38}; 38};
39 39
40#define FTRACE_MAX_EVENT \ 40#define FTRACE_MAX_EVENT \
@@ -135,7 +135,7 @@ struct ftrace_event_call {
135}; 135};
136 136
137#define MAX_FILTER_PRED 32 137#define MAX_FILTER_PRED 32
138#define MAX_FILTER_STR_VAL 128 138#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
139 139
140extern void destroy_preds(struct ftrace_event_call *call); 140extern void destroy_preds(struct ftrace_event_call *call);
141extern int filter_match_preds(struct ftrace_event_call *call, void *rec); 141extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 45fc320a53c6..44263cb27121 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -98,7 +98,7 @@ struct hd_struct {
98 int make_it_fail; 98 int make_it_fail;
99#endif 99#endif
100 unsigned long stamp; 100 unsigned long stamp;
101 int in_flight; 101 int in_flight[2];
102#ifdef CONFIG_SMP 102#ifdef CONFIG_SMP
103 struct disk_stats *dkstats; 103 struct disk_stats *dkstats;
104#else 104#else
@@ -322,18 +322,23 @@ static inline void free_part_stats(struct hd_struct *part)
322#define part_stat_sub(cpu, gendiskp, field, subnd) \ 322#define part_stat_sub(cpu, gendiskp, field, subnd) \
323 part_stat_add(cpu, gendiskp, field, -subnd) 323 part_stat_add(cpu, gendiskp, field, -subnd)
324 324
325static inline void part_inc_in_flight(struct hd_struct *part) 325static inline void part_inc_in_flight(struct hd_struct *part, int rw)
326{ 326{
327 part->in_flight++; 327 part->in_flight[rw]++;
328 if (part->partno) 328 if (part->partno)
329 part_to_disk(part)->part0.in_flight++; 329 part_to_disk(part)->part0.in_flight[rw]++;
330} 330}
331 331
332static inline void part_dec_in_flight(struct hd_struct *part) 332static inline void part_dec_in_flight(struct hd_struct *part, int rw)
333{ 333{
334 part->in_flight--; 334 part->in_flight[rw]--;
335 if (part->partno) 335 if (part->partno)
336 part_to_disk(part)->part0.in_flight--; 336 part_to_disk(part)->part0.in_flight[rw]--;
337}
338
339static inline int part_in_flight(struct hd_struct *part)
340{
341 return part->in_flight[0] + part->in_flight[1];
337} 342}
338 343
339/* block/blk-core.c */ 344/* block/blk-core.c */
@@ -546,6 +551,8 @@ extern ssize_t part_size_show(struct device *dev,
546 struct device_attribute *attr, char *buf); 551 struct device_attribute *attr, char *buf);
547extern ssize_t part_stat_show(struct device *dev, 552extern ssize_t part_stat_show(struct device *dev,
548 struct device_attribute *attr, char *buf); 553 struct device_attribute *attr, char *buf);
554extern ssize_t part_inflight_show(struct device *dev,
555 struct device_attribute *attr, char *buf);
549#ifdef CONFIG_FAIL_MAKE_REQUEST 556#ifdef CONFIG_FAIL_MAKE_REQUEST
550extern ssize_t part_fail_show(struct device *dev, 557extern ssize_t part_fail_show(struct device *dev,
551 struct device_attribute *attr, char *buf); 558 struct device_attribute *attr, char *buf);
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index c56b4bce56d0..b80c88dedbbb 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -333,6 +333,28 @@ struct gfs2_leaf {
333 333
334/* 334/*
335 * Extended attribute header format 335 * Extended attribute header format
336 *
337 * This works in a similar way to dirents. There is a fixed size header
338 * followed by a variable length section made up of the name and the
339 * associated data. In the case of a "stuffed" entry, the value is
340 * inline directly after the name, the ea_num_ptrs entry will be
341 * zero in that case. For non-"stuffed" entries, there will be
342 * a set of pointers (aligned to 8 byte boundary) to the block(s)
343 * containing the value.
344 *
345 * The blocks containing the values and the blocks containing the
346 * extended attribute headers themselves all start with the common
347 * metadata header. Each inode, if it has extended attributes, will
348 * have either a single block containing the extended attribute headers
349 * or a single indirect block pointing to blocks containing the
350 * extended attribure headers.
351 *
352 * The maximim size of the data part of an extended attribute is 64k
353 * so the number of blocks required depends upon block size. Since the
354 * block size also determines the number of pointers in an indirect
355 * block, its a fairly complicated calculation to work out the maximum
356 * number of blocks that an inode may have relating to extended attributes.
357 *
336 */ 358 */
337 359
338#define GFS2_EA_MAX_NAME_LEN 255 360#define GFS2_EA_MAX_NAME_LEN 255
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index 6a6e701f1631..ee275c8b3df1 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -38,7 +38,7 @@ struct hdlc_proto {
38 int (*ioctl)(struct net_device *dev, struct ifreq *ifr); 38 int (*ioctl)(struct net_device *dev, struct ifreq *ifr);
39 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); 39 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev);
40 int (*netif_rx)(struct sk_buff *skb); 40 int (*netif_rx)(struct sk_buff *skb);
41 int (*xmit)(struct sk_buff *skb, struct net_device *dev); 41 netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev);
42 struct module *module; 42 struct module *module;
43 struct hdlc_proto *next; /* next protocol in the list */ 43 struct hdlc_proto *next; /* next protocol in the list */
44}; 44};
@@ -51,7 +51,7 @@ typedef struct hdlc_device {
51 unsigned short encoding, unsigned short parity); 51 unsigned short encoding, unsigned short parity);
52 52
53 /* hardware driver must handle this instead of dev->hard_start_xmit */ 53 /* hardware driver must handle this instead of dev->hard_start_xmit */
54 int (*xmit)(struct sk_buff *skb, struct net_device *dev); 54 netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev);
55 55
56 /* Things below are for HDLC layer internal use only */ 56 /* Things below are for HDLC layer internal use only */
57 const struct hdlc_proto *proto; 57 const struct hdlc_proto *proto;
@@ -60,7 +60,7 @@ typedef struct hdlc_device {
60 spinlock_t state_lock; 60 spinlock_t state_lock;
61 void *state; 61 void *state;
62 void *priv; 62 void *priv;
63}hdlc_device; 63} hdlc_device;
64 64
65 65
66 66
@@ -106,7 +106,7 @@ void hdlc_close(struct net_device *dev);
106/* May be used by hardware driver */ 106/* May be used by hardware driver */
107int hdlc_change_mtu(struct net_device *dev, int new_mtu); 107int hdlc_change_mtu(struct net_device *dev, int new_mtu);
108/* Must be pointed to by hw driver's dev->netdev_ops->ndo_start_xmit */ 108/* Must be pointed to by hw driver's dev->netdev_ops->ndo_start_xmit */
109int hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev); 109netdev_tx_t hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev);
110 110
111int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, 111int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
112 size_t size); 112 size_t size);
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h
index 50d568ec178a..53744fa1c8b7 100644
--- a/include/linux/hid-debug.h
+++ b/include/linux/hid-debug.h
@@ -2,7 +2,7 @@
2#define __HID_DEBUG_H 2#define __HID_DEBUG_H
3 3
4/* 4/*
5 * Copyright (c) 2007 Jiri Kosina 5 * Copyright (c) 2007-2009 Jiri Kosina
6 */ 6 */
7 7
8/* 8/*
@@ -22,24 +22,44 @@
22 * 22 *
23 */ 23 */
24 24
25#ifdef CONFIG_HID_DEBUG 25#define HID_DEBUG_BUFSIZE 512
26 26
27void hid_dump_input(struct hid_usage *, __s32); 27#ifdef CONFIG_DEBUG_FS
28void hid_dump_device(struct hid_device *); 28
29void hid_dump_field(struct hid_field *, int); 29void hid_dump_input(struct hid_device *, struct hid_usage *, __s32);
30void hid_resolv_usage(unsigned); 30void hid_dump_device(struct hid_device *, struct seq_file *);
31void hid_resolv_event(__u8, __u16); 31void hid_dump_field(struct hid_field *, int, struct seq_file *);
32char *hid_resolv_usage(unsigned, struct seq_file *);
33void hid_debug_register(struct hid_device *, const char *);
34void hid_debug_unregister(struct hid_device *);
35void hid_debug_init(void);
36void hid_debug_exit(void);
37void hid_debug_event(struct hid_device *, char *);
32 38
33#else
34 39
35#define hid_dump_input(a,b) do { } while (0) 40struct hid_debug_list {
36#define hid_dump_device(c) do { } while (0) 41 char *hid_debug_buf;
37#define hid_dump_field(a,b) do { } while (0) 42 int head;
38#define hid_resolv_usage(a) do { } while (0) 43 int tail;
39#define hid_resolv_event(a,b) do { } while (0) 44 struct fasync_struct *fasync;
45 struct hid_device *hdev;
46 struct list_head node;
47 struct mutex read_mutex;
48};
40 49
41#endif /* CONFIG_HID_DEBUG */ 50#else
42 51
52#define hid_dump_input(a,b,c) do { } while (0)
53#define hid_dump_device(a,b) do { } while (0)
54#define hid_dump_field(a,b,c) do { } while (0)
55#define hid_resolv_usage(a,b) do { } while (0)
56#define hid_debug_register(a, b) do { } while (0)
57#define hid_debug_unregister(a) do { } while (0)
58#define hid_debug_init() do { } while (0)
59#define hid_debug_exit() do { } while (0)
60#define hid_debug_event(a,b) do { } while (0)
61
62#endif
43 63
44#endif 64#endif
45 65
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 53489fd4d700..a0ebdace7baa 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -500,6 +500,14 @@ struct hid_device { /* device report descriptor */
500 500
501 /* handler for raw output data, used by hidraw */ 501 /* handler for raw output data, used by hidraw */
502 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); 502 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t);
503
504 /* debugging support via debugfs */
505 unsigned short debug;
506 struct dentry *debug_dir;
507 struct dentry *debug_rdesc;
508 struct dentry *debug_events;
509 struct list_head debug_list;
510 wait_queue_head_t debug_wait;
503}; 511};
504 512
505static inline void *hid_get_drvdata(struct hid_device *hdev) 513static inline void *hid_get_drvdata(struct hid_device *hdev)
@@ -657,9 +665,7 @@ struct hid_ll_driver {
657 665
658/* HID core API */ 666/* HID core API */
659 667
660#ifdef CONFIG_HID_DEBUG
661extern int hid_debug; 668extern int hid_debug;
662#endif
663 669
664extern int hid_add_device(struct hid_device *); 670extern int hid_add_device(struct hid_device *);
665extern void hid_destroy_device(struct hid_device *); 671extern void hid_destroy_device(struct hid_device *);
@@ -815,21 +821,9 @@ int hid_pidff_init(struct hid_device *hid);
815#define hid_pidff_init NULL 821#define hid_pidff_init NULL
816#endif 822#endif
817 823
818#ifdef CONFIG_HID_DEBUG
819#define dbg_hid(format, arg...) if (hid_debug) \ 824#define dbg_hid(format, arg...) if (hid_debug) \
820 printk(KERN_DEBUG "%s: " format ,\ 825 printk(KERN_DEBUG "%s: " format ,\
821 __FILE__ , ## arg) 826 __FILE__ , ## arg)
822#define dbg_hid_line(format, arg...) if (hid_debug) \
823 printk(format, ## arg)
824#else
825static inline int __attribute__((format(printf, 1, 2)))
826dbg_hid(const char *fmt, ...)
827{
828 return 0;
829}
830#define dbg_hid_line dbg_hid
831#endif /* HID_DEBUG */
832
833#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ 827#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
834 __FILE__ , ## arg) 828 __FILE__ , ## arg)
835#endif /* HID_FF */ 829#endif /* HID_FF */
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h
index 0dc80ef24975..3fd21d7cb6bf 100644
--- a/include/linux/i2c/twl4030.h
+++ b/include/linux/i2c/twl4030.h
@@ -25,6 +25,9 @@
25#ifndef __TWL4030_H_ 25#ifndef __TWL4030_H_
26#define __TWL4030_H_ 26#define __TWL4030_H_
27 27
28#include <linux/types.h>
29#include <linux/input/matrix_keypad.h>
30
28/* 31/*
29 * Using the twl4030 core we address registers using a pair 32 * Using the twl4030 core we address registers using a pair
30 * { module id, relative register offset } 33 * { module id, relative register offset }
@@ -302,13 +305,17 @@ struct twl4030_madc_platform_data {
302 int irq_line; 305 int irq_line;
303}; 306};
304 307
308/* Boards have uniqe mappings of {col, row} --> keycode.
309 * Column and row are 4 bits, but range only from 0..7.
310 * a PERSISTENT_KEY is "always on" and never reported.
311 */
312#define PERSISTENT_KEY(c, r) KEY((c), (r), KEY_RESERVED)
313
305struct twl4030_keypad_data { 314struct twl4030_keypad_data {
306 int rows; 315 const struct matrix_keymap_data *keymap_data;
307 int cols; 316 unsigned rows;
308 int *keymap; 317 unsigned cols;
309 int irq; 318 bool rep;
310 unsigned int keymapsize;
311 unsigned int rep:1;
312}; 319};
313 320
314enum twl4030_usb_mode { 321enum twl4030_usb_mode {
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index b6a85183c333..c0d8357917e2 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -171,8 +171,6 @@ struct icmp6_filter {
171#ifdef __KERNEL__ 171#ifdef __KERNEL__
172 172
173#include <linux/netdevice.h> 173#include <linux/netdevice.h>
174#include <linux/skbuff.h>
175
176 174
177extern void icmpv6_send(struct sk_buff *skb, 175extern void icmpv6_send(struct sk_buff *skb,
178 u8 type, u8 code, 176 u8 type, u8 code,
diff --git a/include/linux/ide.h b/include/linux/ide.h
index edc93a6d931d..e4135d6e0556 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -258,6 +258,7 @@ enum {
258 IDE_TFLAG_DYN = (1 << 5), 258 IDE_TFLAG_DYN = (1 << 5),
259 IDE_TFLAG_FS = (1 << 6), 259 IDE_TFLAG_FS = (1 << 6),
260 IDE_TFLAG_MULTI_PIO = (1 << 7), 260 IDE_TFLAG_MULTI_PIO = (1 << 7),
261 IDE_TFLAG_SET_XFER = (1 << 8),
261}; 262};
262 263
263enum { 264enum {
@@ -294,7 +295,7 @@ struct ide_cmd {
294 } out, in; 295 } out, in;
295 } valid; 296 } valid;
296 297
297 u8 tf_flags; 298 u16 tf_flags;
298 u8 ftf_flags; /* for TASKFILE ioctl */ 299 u8 ftf_flags; /* for TASKFILE ioctl */
299 int protocol; 300 int protocol;
300 301
@@ -918,8 +919,7 @@ __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL)
918typedef struct { 919typedef struct {
919 const char *name; 920 const char *name;
920 mode_t mode; 921 mode_t mode;
921 read_proc_t *read_proc; 922 const struct file_operations *proc_fops;
922 write_proc_t *write_proc;
923} ide_proc_entry_t; 923} ide_proc_entry_t;
924 924
925void proc_ide_create(void); 925void proc_ide_create(void);
@@ -931,24 +931,8 @@ void ide_proc_unregister_port(ide_hwif_t *);
931void ide_proc_register_driver(ide_drive_t *, struct ide_driver *); 931void ide_proc_register_driver(ide_drive_t *, struct ide_driver *);
932void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *); 932void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *);
933 933
934read_proc_t proc_ide_read_capacity; 934extern const struct file_operations ide_capacity_proc_fops;
935read_proc_t proc_ide_read_geometry; 935extern const struct file_operations ide_geometry_proc_fops;
936
937/*
938 * Standard exit stuff:
939 */
940#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) \
941{ \
942 len -= off; \
943 if (len < count) { \
944 *eof = 1; \
945 if (len <= 0) \
946 return 0; \
947 } else \
948 len = count; \
949 *start = page + off; \
950 return len; \
951}
952#else 936#else
953static inline void proc_ide_create(void) { ; } 937static inline void proc_ide_create(void) { ; }
954static inline void proc_ide_destroy(void) { ; } 938static inline void proc_ide_destroy(void) { ; }
@@ -960,7 +944,6 @@ static inline void ide_proc_register_driver(ide_drive_t *drive,
960 struct ide_driver *driver) { ; } 944 struct ide_driver *driver) { ; }
961static inline void ide_proc_unregister_driver(ide_drive_t *drive, 945static inline void ide_proc_unregister_driver(ide_drive_t *drive,
962 struct ide_driver *driver) { ; } 946 struct ide_driver *driver) { ; }
963#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0;
964#endif 947#endif
965 948
966enum { 949enum {
@@ -1081,6 +1064,7 @@ extern void ide_fixstring(u8 *, const int, const int);
1081 1064
1082int ide_busy_sleep(ide_drive_t *, unsigned long, int); 1065int ide_busy_sleep(ide_drive_t *, unsigned long, int);
1083 1066
1067int __ide_wait_stat(ide_drive_t *, u8, u8, unsigned long, u8 *);
1084int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); 1068int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
1085 1069
1086ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *); 1070ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *);
@@ -1169,7 +1153,7 @@ int ide_no_data_taskfile(ide_drive_t *, struct ide_cmd *);
1169 1153
1170int ide_taskfile_ioctl(ide_drive_t *, unsigned long); 1154int ide_taskfile_ioctl(ide_drive_t *, unsigned long);
1171 1155
1172int ide_dev_read_id(ide_drive_t *, u8, u16 *); 1156int ide_dev_read_id(ide_drive_t *, u8, u16 *, int);
1173 1157
1174extern int ide_driveid_update(ide_drive_t *); 1158extern int ide_driveid_update(ide_drive_t *);
1175extern int ide_config_drive_speed(ide_drive_t *, u8); 1159extern int ide_config_drive_speed(ide_drive_t *, u8);
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index a9173d5434d1..52e15e079c61 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -115,7 +115,7 @@
115#define IEEE80211_MAX_SSID_LEN 32 115#define IEEE80211_MAX_SSID_LEN 32
116 116
117#define IEEE80211_MAX_MESH_ID_LEN 32 117#define IEEE80211_MAX_MESH_ID_LEN 32
118#define IEEE80211_MESH_CONFIG_LEN 19 118#define IEEE80211_MESH_CONFIG_LEN 24
119 119
120#define IEEE80211_QOS_CTL_LEN 2 120#define IEEE80211_QOS_CTL_LEN 2
121#define IEEE80211_QOS_CTL_TID_MASK 0x000F 121#define IEEE80211_QOS_CTL_TID_MASK 0x000F
@@ -802,6 +802,31 @@ struct ieee80211_ht_cap {
802#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 802#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03
803#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C 803#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C
804 804
805/*
806 * Maximum length of AMPDU that the STA can receive.
807 * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets)
808 */
809enum ieee80211_max_ampdu_length_exp {
810 IEEE80211_HT_MAX_AMPDU_8K = 0,
811 IEEE80211_HT_MAX_AMPDU_16K = 1,
812 IEEE80211_HT_MAX_AMPDU_32K = 2,
813 IEEE80211_HT_MAX_AMPDU_64K = 3
814};
815
816#define IEEE80211_HT_MAX_AMPDU_FACTOR 13
817
818/* Minimum MPDU start spacing */
819enum ieee80211_min_mpdu_spacing {
820 IEEE80211_HT_MPDU_DENSITY_NONE = 0, /* No restriction */
821 IEEE80211_HT_MPDU_DENSITY_0_25 = 1, /* 1/4 usec */
822 IEEE80211_HT_MPDU_DENSITY_0_5 = 2, /* 1/2 usec */
823 IEEE80211_HT_MPDU_DENSITY_1 = 3, /* 1 usec */
824 IEEE80211_HT_MPDU_DENSITY_2 = 4, /* 2 usec */
825 IEEE80211_HT_MPDU_DENSITY_4 = 5, /* 4 usec */
826 IEEE80211_HT_MPDU_DENSITY_8 = 6, /* 8 usec */
827 IEEE80211_HT_MPDU_DENSITY_16 = 7 /* 16 usec */
828};
829
805/** 830/**
806 * struct ieee80211_ht_info - HT information 831 * struct ieee80211_ht_info - HT information
807 * 832 *
@@ -1196,6 +1221,10 @@ enum ieee80211_sa_query_action {
1196#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 1221#define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
1197#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 1222#define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
1198 1223
1224/* AKM suite selectors */
1225#define WLAN_AKM_SUITE_8021X 0x000FAC01
1226#define WLAN_AKM_SUITE_PSK 0x000FAC02
1227
1199#define WLAN_MAX_KEY_LEN 32 1228#define WLAN_MAX_KEY_LEN 32
1200 1229
1201/** 1230/**
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h
index a60c821be44c..fd9740466757 100644
--- a/include/linux/if_addr.h
+++ b/include/linux/if_addr.h
@@ -41,6 +41,7 @@ enum
41 41
42#define IFA_F_NODAD 0x02 42#define IFA_F_NODAD 0x02
43#define IFA_F_OPTIMISTIC 0x04 43#define IFA_F_OPTIMISTIC 0x04
44#define IFA_F_DADFAILED 0x08
44#define IFA_F_HOMEADDRESS 0x10 45#define IFA_F_HOMEADDRESS 0x10
45#define IFA_F_DEPRECATED 0x20 46#define IFA_F_DEPRECATED 0x20
46#define IFA_F_TENTATIVE 0x40 47#define IFA_F_TENTATIVE 0x40
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index b554300ef8bf..282eb37e2dec 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -87,7 +87,6 @@
87#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ 87#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
88#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ 88#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
89#define ARPHRD_IEEE802154 804 89#define ARPHRD_IEEE802154 804
90#define ARPHRD_IEEE802154_PHY 805
91 90
92#define ARPHRD_PHONET 820 /* PhoNet media type */ 91#define ARPHRD_PHONET 820 /* PhoNet media type */
93#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ 92#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 70fdba2bbf71..580b6004d00e 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -139,10 +139,10 @@ extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
139/* 139/*
140 * Display a 6 byte device address (MAC) in a readable format. 140 * Display a 6 byte device address (MAC) in a readable format.
141 */ 141 */
142extern char *print_mac(char *buf, const unsigned char *addr); 142extern char *print_mac(char *buf, const unsigned char *addr) __deprecated;
143#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" 143#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
144#define MAC_BUF_SIZE 18 144#define MAC_BUF_SIZE 18
145#define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused 145#define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE]
146 146
147#endif 147#endif
148 148
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h
index 673f2209453d..80b3a1056a5f 100644
--- a/include/linux/if_frad.h
+++ b/include/linux/if_frad.h
@@ -69,11 +69,6 @@ struct dlci_conf {
69 69
70#define DLCI_VALID_FLAGS 0x000B 70#define DLCI_VALID_FLAGS 0x000B
71 71
72/* FRAD driver uses these to indicate what it did with packet */
73#define DLCI_RET_OK 0x00
74#define DLCI_RET_ERR 0x01
75#define DLCI_RET_DROP 0x02
76
77/* defines for the actual Frame Relay hardware */ 72/* defines for the actual Frame Relay hardware */
78#define FRAD_GET_CONF (SIOCDEVPRIVATE) 73#define FRAD_GET_CONF (SIOCDEVPRIVATE)
79#define FRAD_SET_CONF (SIOCDEVPRIVATE + 1) 74#define FRAD_SET_CONF (SIOCDEVPRIVATE + 1)
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 915ba5789f0e..3f5fd523b49d 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -62,6 +62,7 @@
62#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */ 62#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */
63#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */ 63#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
64#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */ 64#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
65#define TUN_F_UFO 0x10 /* I can handle UFO packets */
65 66
66/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */ 67/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
67#define TUN_PKT_STRIP 0x0001 68#define TUN_PKT_STRIP 0x0001
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 92fbd8cbd68f..fe158e0e20e6 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -233,6 +233,8 @@ extern void ip_mc_init_dev(struct in_device *);
233extern void ip_mc_destroy_dev(struct in_device *); 233extern void ip_mc_destroy_dev(struct in_device *);
234extern void ip_mc_up(struct in_device *); 234extern void ip_mc_up(struct in_device *);
235extern void ip_mc_down(struct in_device *); 235extern void ip_mc_down(struct in_device *);
236extern void ip_mc_unmap(struct in_device *);
237extern void ip_mc_remap(struct in_device *);
236extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); 238extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
237extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); 239extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
238extern void ip_mc_rejoin_group(struct ip_mc_list *im); 240extern void ip_mc_rejoin_group(struct ip_mc_list *im);
diff --git a/include/linux/init.h b/include/linux/init.h
index 13b633ed695e..400adbb45414 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -103,8 +103,8 @@
103#define __INIT .section ".init.text","ax" 103#define __INIT .section ".init.text","ax"
104#define __FINIT .previous 104#define __FINIT .previous
105 105
106#define __INITDATA .section ".init.data","aw" 106#define __INITDATA .section ".init.data","aw",%progbits
107#define __INITRODATA .section ".init.rodata","a" 107#define __INITRODATA .section ".init.rodata","a",%progbits
108#define __FINITDATA .previous 108#define __FINITDATA .previous
109 109
110#define __DEVINIT .section ".devinit.text", "ax" 110#define __DEVINIT .section ".devinit.text", "ax"
@@ -305,9 +305,17 @@ void __init parse_early_options(char *cmdline);
305#ifdef CONFIG_MODULES 305#ifdef CONFIG_MODULES
306#define __init_or_module 306#define __init_or_module
307#define __initdata_or_module 307#define __initdata_or_module
308#define __initconst_or_module
309#define __INIT_OR_MODULE .text
310#define __INITDATA_OR_MODULE .data
311#define __INITRODATA_OR_MODULE .section ".rodata","a",%progbits
308#else 312#else
309#define __init_or_module __init 313#define __init_or_module __init
310#define __initdata_or_module __initdata 314#define __initdata_or_module __initdata
315#define __initconst_or_module __initconst
316#define __INIT_OR_MODULE __INIT
317#define __INITDATA_OR_MODULE __INITDATA
318#define __INITRODATA_OR_MODULE __INITRODATA
311#endif /*CONFIG_MODULES*/ 319#endif /*CONFIG_MODULES*/
312 320
313/* Functions marked as __devexit may be discarded at kernel link time, depending 321/* Functions marked as __devexit may be discarded at kernel link time, depending
diff --git a/include/linux/input/eeti_ts.h b/include/linux/input/eeti_ts.h
new file mode 100644
index 000000000000..f875b316249d
--- /dev/null
+++ b/include/linux/input/eeti_ts.h
@@ -0,0 +1,9 @@
1#ifndef LINUX_INPUT_EETI_TS_H
2#define LINUX_INPUT_EETI_TS_H
3
4struct eeti_ts_platform_data {
5 unsigned int irq_active_high;
6};
7
8#endif /* LINUX_INPUT_EETI_TS_H */
9
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
index 15d5903af2dd..b3cd42d50e16 100644
--- a/include/linux/input/matrix_keypad.h
+++ b/include/linux/input/matrix_keypad.h
@@ -63,4 +63,36 @@ struct matrix_keypad_platform_data {
63 bool wakeup; 63 bool wakeup;
64}; 64};
65 65
66/**
67 * matrix_keypad_build_keymap - convert platform keymap into matrix keymap
68 * @keymap_data: keymap supplied by the platform code
69 * @row_shift: number of bits to shift row value by to advance to the next
70 * line in the keymap
71 * @keymap: expanded version of keymap that is suitable for use by
72 * matrix keyboad driver
73 * @keybit: pointer to bitmap of keys supported by input device
74 *
75 * This function converts platform keymap (encoded with KEY() macro) into
76 * an array of keycodes that is suitable for using in a standard matrix
77 * keyboard driver that uses row and col as indices.
78 */
79static inline void
80matrix_keypad_build_keymap(const struct matrix_keymap_data *keymap_data,
81 unsigned int row_shift,
82 unsigned short *keymap, unsigned long *keybit)
83{
84 int i;
85
86 for (i = 0; i < keymap_data->keymap_size; i++) {
87 unsigned int key = keymap_data->keymap[i];
88 unsigned int row = KEY_ROW(key);
89 unsigned int col = KEY_COL(key);
90 unsigned short code = KEY_VAL(key);
91
92 keymap[MATRIX_SCAN_CODE(row, col, row_shift)] = code;
93 __set_bit(code, keybit);
94 }
95 __clear_bit(KEY_RESERVED, keybit);
96}
97
66#endif /* _MATRIX_KEYPAD_H */ 98#endif /* _MATRIX_KEYPAD_H */
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 1ac57e522a1f..8e9e151f811e 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -348,6 +348,7 @@ enum
348 NET_TX_SOFTIRQ, 348 NET_TX_SOFTIRQ,
349 NET_RX_SOFTIRQ, 349 NET_RX_SOFTIRQ,
350 BLOCK_SOFTIRQ, 350 BLOCK_SOFTIRQ,
351 BLOCK_IOPOLL_SOFTIRQ,
351 TASKLET_SOFTIRQ, 352 TASKLET_SOFTIRQ,
352 SCHED_SOFTIRQ, 353 SCHED_SOFTIRQ,
353 HRTIMER_SOFTIRQ, 354 HRTIMER_SOFTIRQ,
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index 0adb0f91568c..97eb928b4924 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -49,23 +49,30 @@ static inline struct io_mapping *
49io_mapping_create_wc(resource_size_t base, unsigned long size) 49io_mapping_create_wc(resource_size_t base, unsigned long size)
50{ 50{
51 struct io_mapping *iomap; 51 struct io_mapping *iomap;
52 52 pgprot_t prot;
53 if (!is_io_mapping_possible(base, size))
54 return NULL;
55 53
56 iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); 54 iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
57 if (!iomap) 55 if (!iomap)
58 return NULL; 56 goto out_err;
57
58 if (iomap_create_wc(base, size, &prot))
59 goto out_free;
59 60
60 iomap->base = base; 61 iomap->base = base;
61 iomap->size = size; 62 iomap->size = size;
62 iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL)); 63 iomap->prot = prot;
63 return iomap; 64 return iomap;
65
66out_free:
67 kfree(iomap);
68out_err:
69 return NULL;
64} 70}
65 71
66static inline void 72static inline void
67io_mapping_free(struct io_mapping *mapping) 73io_mapping_free(struct io_mapping *mapping)
68{ 74{
75 iomap_free(mapping->base, mapping->size);
69 kfree(mapping); 76 kfree(mapping);
70} 77}
71 78
diff --git a/include/linux/isdn/hdlc.h b/include/linux/isdn/hdlc.h
new file mode 100644
index 000000000000..4b3ecc40889a
--- /dev/null
+++ b/include/linux/isdn/hdlc.h
@@ -0,0 +1,82 @@
1/*
2 * hdlc.h -- General purpose ISDN HDLC decoder.
3 *
4 * Implementation of a HDLC decoder/encoder in software.
5 * Neccessary because some ISDN devices don't have HDLC
6 * controllers.
7 *
8 * Copyright (C)
9 * 2009 Karsten Keil <keil@b1-systems.de>
10 * 2002 Wolfgang Mües <wolfgang@iksw-muees.de>
11 * 2001 Frode Isaksen <fisaksen@bewan.com>
12 * 2001 Kai Germaschewski <kai.germaschewski@gmx.de>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#ifndef __ISDNHDLC_H__
30#define __ISDNHDLC_H__
31
32struct isdnhdlc_vars {
33 int bit_shift;
34 int hdlc_bits1;
35 int data_bits;
36 int ffbit_shift; /* encoding only */
37 int state;
38 int dstpos;
39
40 u16 crc;
41
42 u8 cbin;
43 u8 shift_reg;
44 u8 ffvalue;
45
46 /* set if transferring data */
47 u32 data_received:1;
48 /* set if D channel (send idle instead of flags) */
49 u32 dchannel:1;
50 /* set if 56K adaptation */
51 u32 do_adapt56:1;
52 /* set if in closing phase (need to send CRC + flag) */
53 u32 do_closing:1;
54 /* set if data is bitreverse */
55 u32 do_bitreverse:1;
56};
57
58/* Feature Flags */
59#define HDLC_56KBIT 0x01
60#define HDLC_DCHANNEL 0x02
61#define HDLC_BITREVERSE 0x04
62
63/*
64 The return value from isdnhdlc_decode is
65 the frame length, 0 if no complete frame was decoded,
66 or a negative error number
67*/
68#define HDLC_FRAMING_ERROR 1
69#define HDLC_CRC_ERROR 2
70#define HDLC_LENGTH_ERROR 3
71
72extern void isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, u32 features);
73
74extern int isdnhdlc_decode(struct isdnhdlc_vars *hdlc, const u8 *src,
75 int slen, int *count, u8 *dst, int dsize);
76
77extern void isdnhdlc_out_init(struct isdnhdlc_vars *hdlc, u32 features);
78
79extern int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src,
80 u16 slen, int *count, u8 *dst, int dsize);
81
82#endif /* __ISDNHDLC_H__ */
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index bcd9c07848be..3a46b7b7abb2 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -48,13 +48,13 @@
48#define KPROBE_HIT_SSDONE 0x00000008 48#define KPROBE_HIT_SSDONE 0x00000008
49 49
50/* Attach to insert probes on any functions which should be ignored*/ 50/* Attach to insert probes on any functions which should be ignored*/
51#define __kprobes __attribute__((__section__(".kprobes.text"))) notrace 51#define __kprobes __attribute__((__section__(".kprobes.text")))
52#else /* CONFIG_KPROBES */ 52#else /* CONFIG_KPROBES */
53typedef int kprobe_opcode_t; 53typedef int kprobe_opcode_t;
54struct arch_specific_insn { 54struct arch_specific_insn {
55 int dummy; 55 int dummy;
56}; 56};
57#define __kprobes notrace 57#define __kprobes
58#endif /* CONFIG_KPROBES */ 58#endif /* CONFIG_KPROBES */
59 59
60struct kprobe; 60struct kprobe;
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 3db5d8d37485..f8f8900fc5ec 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -14,7 +14,7 @@
14 14
15#define KVM_API_VERSION 12 15#define KVM_API_VERSION 12
16 16
17/* for KVM_TRACE_ENABLE */ 17/* for KVM_TRACE_ENABLE, deprecated */
18struct kvm_user_trace_setup { 18struct kvm_user_trace_setup {
19 __u32 buf_size; /* sub_buffer size of each per-cpu */ 19 __u32 buf_size; /* sub_buffer size of each per-cpu */
20 __u32 buf_nr; /* the number of sub_buffers of each per-cpu */ 20 __u32 buf_nr; /* the number of sub_buffers of each per-cpu */
@@ -70,6 +70,14 @@ struct kvm_irqchip {
70 } chip; 70 } chip;
71}; 71};
72 72
73/* for KVM_CREATE_PIT2 */
74struct kvm_pit_config {
75 __u32 flags;
76 __u32 pad[15];
77};
78
79#define KVM_PIT_SPEAKER_DUMMY 1
80
73#define KVM_EXIT_UNKNOWN 0 81#define KVM_EXIT_UNKNOWN 0
74#define KVM_EXIT_EXCEPTION 1 82#define KVM_EXIT_EXCEPTION 1
75#define KVM_EXIT_IO 2 83#define KVM_EXIT_IO 2
@@ -87,6 +95,10 @@ struct kvm_irqchip {
87#define KVM_EXIT_S390_RESET 14 95#define KVM_EXIT_S390_RESET 14
88#define KVM_EXIT_DCR 15 96#define KVM_EXIT_DCR 15
89#define KVM_EXIT_NMI 16 97#define KVM_EXIT_NMI 16
98#define KVM_EXIT_INTERNAL_ERROR 17
99
100/* For KVM_EXIT_INTERNAL_ERROR */
101#define KVM_INTERNAL_ERROR_EMULATION 1
90 102
91/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ 103/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
92struct kvm_run { 104struct kvm_run {
@@ -173,6 +185,9 @@ struct kvm_run {
173 __u32 data; 185 __u32 data;
174 __u8 is_write; 186 __u8 is_write;
175 } dcr; 187 } dcr;
188 struct {
189 __u32 suberror;
190 } internal;
176 /* Fix the size of the union. */ 191 /* Fix the size of the union. */
177 char padding[256]; 192 char padding[256];
178 }; 193 };
@@ -292,6 +307,28 @@ struct kvm_guest_debug {
292 struct kvm_guest_debug_arch arch; 307 struct kvm_guest_debug_arch arch;
293}; 308};
294 309
310enum {
311 kvm_ioeventfd_flag_nr_datamatch,
312 kvm_ioeventfd_flag_nr_pio,
313 kvm_ioeventfd_flag_nr_deassign,
314 kvm_ioeventfd_flag_nr_max,
315};
316
317#define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch)
318#define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio)
319#define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign)
320
321#define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1)
322
323struct kvm_ioeventfd {
324 __u64 datamatch;
325 __u64 addr; /* legal pio/mmio address */
326 __u32 len; /* 1, 2, 4, or 8 bytes */
327 __s32 fd;
328 __u32 flags;
329 __u8 pad[36];
330};
331
295#define KVM_TRC_SHIFT 16 332#define KVM_TRC_SHIFT 16
296/* 333/*
297 * kvm trace categories 334 * kvm trace categories
@@ -310,35 +347,6 @@ struct kvm_guest_debug {
310#define KVM_TRC_CYCLE_SIZE 8 347#define KVM_TRC_CYCLE_SIZE 8
311#define KVM_TRC_EXTRA_MAX 7 348#define KVM_TRC_EXTRA_MAX 7
312 349
313/* This structure represents a single trace buffer record. */
314struct kvm_trace_rec {
315 /* variable rec_val
316 * is split into:
317 * bits 0 - 27 -> event id
318 * bits 28 -30 -> number of extra data args of size u32
319 * bits 31 -> binary indicator for if tsc is in record
320 */
321 __u32 rec_val;
322 __u32 pid;
323 __u32 vcpu_id;
324 union {
325 struct {
326 __u64 timestamp;
327 __u32 extra_u32[KVM_TRC_EXTRA_MAX];
328 } __attribute__((packed)) timestamp;
329 struct {
330 __u32 extra_u32[KVM_TRC_EXTRA_MAX];
331 } notimestamp;
332 } u;
333};
334
335#define TRACE_REC_EVENT_ID(val) \
336 (0x0fffffff & (val))
337#define TRACE_REC_NUM_DATA_ARGS(val) \
338 (0x70000000 & ((val) << 28))
339#define TRACE_REC_TCS(val) \
340 (0x80000000 & ((val) << 31))
341
342#define KVMIO 0xAE 350#define KVMIO 0xAE
343 351
344/* 352/*
@@ -415,6 +423,19 @@ struct kvm_trace_rec {
415#define KVM_CAP_ASSIGN_DEV_IRQ 29 423#define KVM_CAP_ASSIGN_DEV_IRQ 29
416/* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */ 424/* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */
417#define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 425#define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30
426#ifdef __KVM_HAVE_MCE
427#define KVM_CAP_MCE 31
428#endif
429#define KVM_CAP_IRQFD 32
430#ifdef __KVM_HAVE_PIT
431#define KVM_CAP_PIT2 33
432#endif
433#define KVM_CAP_SET_BOOT_CPU_ID 34
434#ifdef __KVM_HAVE_PIT_STATE2
435#define KVM_CAP_PIT_STATE2 35
436#endif
437#define KVM_CAP_IOEVENTFD 36
438#define KVM_CAP_SET_IDENTITY_MAP_ADDR 37
418 439
419#ifdef KVM_CAP_IRQ_ROUTING 440#ifdef KVM_CAP_IRQ_ROUTING
420 441
@@ -454,15 +475,32 @@ struct kvm_irq_routing {
454 475
455#endif 476#endif
456 477
478#ifdef KVM_CAP_MCE
479/* x86 MCE */
480struct kvm_x86_mce {
481 __u64 status;
482 __u64 addr;
483 __u64 misc;
484 __u64 mcg_status;
485 __u8 bank;
486 __u8 pad1[7];
487 __u64 pad2[3];
488};
489#endif
490
491#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
492
493struct kvm_irqfd {
494 __u32 fd;
495 __u32 gsi;
496 __u32 flags;
497 __u8 pad[20];
498};
499
457/* 500/*
458 * ioctls for VM fds 501 * ioctls for VM fds
459 */ 502 */
460#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) 503#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
461#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
462#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
463#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\
464 struct kvm_userspace_memory_region)
465#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
466/* 504/*
467 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns 505 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
468 * a vcpu fd. 506 * a vcpu fd.
@@ -470,6 +508,12 @@ struct kvm_irq_routing {
470#define KVM_CREATE_VCPU _IO(KVMIO, 0x41) 508#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
471#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) 509#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
472#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) 510#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
511#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
512#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
513#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\
514 struct kvm_userspace_memory_region)
515#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
516#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64)
473/* Device model IOC */ 517/* Device model IOC */
474#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) 518#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)
475#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) 519#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level)
@@ -498,6 +542,10 @@ struct kvm_irq_routing {
498#define KVM_ASSIGN_SET_MSIX_ENTRY \ 542#define KVM_ASSIGN_SET_MSIX_ENTRY \
499 _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) 543 _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry)
500#define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) 544#define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq)
545#define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd)
546#define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config)
547#define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78)
548#define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd)
501 549
502/* 550/*
503 * ioctls for vcpu fds 551 * ioctls for vcpu fds
@@ -541,6 +589,10 @@ struct kvm_irq_routing {
541#define KVM_NMI _IO(KVMIO, 0x9a) 589#define KVM_NMI _IO(KVMIO, 0x9a)
542/* Available with KVM_CAP_SET_GUEST_DEBUG */ 590/* Available with KVM_CAP_SET_GUEST_DEBUG */
543#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) 591#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug)
592/* MCE for x86 */
593#define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64)
594#define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64)
595#define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce)
544 596
545/* 597/*
546 * Deprecated interfaces 598 * Deprecated interfaces
@@ -563,6 +615,9 @@ struct kvm_debug_guest {
563#define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) 615#define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *)
564#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) 616#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *)
565 617
618#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2)
619#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
620
566#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) 621#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
567#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) 622#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
568#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) 623#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
@@ -633,7 +688,7 @@ struct kvm_assigned_msix_nr {
633 __u16 padding; 688 __u16 padding;
634}; 689};
635 690
636#define KVM_MAX_MSIX_PER_DEV 512 691#define KVM_MAX_MSIX_PER_DEV 256
637struct kvm_assigned_msix_entry { 692struct kvm_assigned_msix_entry {
638 __u32 assigned_dev_id; 693 __u32 assigned_dev_id;
639 __u32 gsi; 694 __u32 gsi;
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 3060bdc35ffe..4af56036a6bf 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -42,6 +42,7 @@
42 42
43#define KVM_USERSPACE_IRQ_SOURCE_ID 0 43#define KVM_USERSPACE_IRQ_SOURCE_ID 0
44 44
45struct kvm;
45struct kvm_vcpu; 46struct kvm_vcpu;
46extern struct kmem_cache *kvm_vcpu_cache; 47extern struct kmem_cache *kvm_vcpu_cache;
47 48
@@ -59,10 +60,18 @@ struct kvm_io_bus {
59 60
60void kvm_io_bus_init(struct kvm_io_bus *bus); 61void kvm_io_bus_init(struct kvm_io_bus *bus);
61void kvm_io_bus_destroy(struct kvm_io_bus *bus); 62void kvm_io_bus_destroy(struct kvm_io_bus *bus);
62struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, 63int kvm_io_bus_write(struct kvm_io_bus *bus, gpa_t addr, int len,
63 gpa_t addr, int len, int is_write); 64 const void *val);
64void kvm_io_bus_register_dev(struct kvm_io_bus *bus, 65int kvm_io_bus_read(struct kvm_io_bus *bus, gpa_t addr, int len,
65 struct kvm_io_device *dev); 66 void *val);
67int __kvm_io_bus_register_dev(struct kvm_io_bus *bus,
68 struct kvm_io_device *dev);
69int kvm_io_bus_register_dev(struct kvm *kvm, struct kvm_io_bus *bus,
70 struct kvm_io_device *dev);
71void __kvm_io_bus_unregister_dev(struct kvm_io_bus *bus,
72 struct kvm_io_device *dev);
73void kvm_io_bus_unregister_dev(struct kvm *kvm, struct kvm_io_bus *bus,
74 struct kvm_io_device *dev);
66 75
67struct kvm_vcpu { 76struct kvm_vcpu {
68 struct kvm *kvm; 77 struct kvm *kvm;
@@ -103,7 +112,7 @@ struct kvm_memory_slot {
103 struct { 112 struct {
104 unsigned long rmap_pde; 113 unsigned long rmap_pde;
105 int write_count; 114 int write_count;
106 } *lpage_info; 115 } *lpage_info[KVM_NR_PAGE_SIZES - 1];
107 unsigned long userspace_addr; 116 unsigned long userspace_addr;
108 int user_alloc; 117 int user_alloc;
109}; 118};
@@ -124,7 +133,6 @@ struct kvm_kernel_irq_routing_entry {
124}; 133};
125 134
126struct kvm { 135struct kvm {
127 struct mutex lock; /* protects the vcpus array and APIC accesses */
128 spinlock_t mmu_lock; 136 spinlock_t mmu_lock;
129 spinlock_t requests_lock; 137 spinlock_t requests_lock;
130 struct rw_semaphore slots_lock; 138 struct rw_semaphore slots_lock;
@@ -132,10 +140,23 @@ struct kvm {
132 int nmemslots; 140 int nmemslots;
133 struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + 141 struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
134 KVM_PRIVATE_MEM_SLOTS]; 142 KVM_PRIVATE_MEM_SLOTS];
143#ifdef CONFIG_KVM_APIC_ARCHITECTURE
144 u32 bsp_vcpu_id;
145 struct kvm_vcpu *bsp_vcpu;
146#endif
135 struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; 147 struct kvm_vcpu *vcpus[KVM_MAX_VCPUS];
148 atomic_t online_vcpus;
136 struct list_head vm_list; 149 struct list_head vm_list;
150 struct mutex lock;
137 struct kvm_io_bus mmio_bus; 151 struct kvm_io_bus mmio_bus;
138 struct kvm_io_bus pio_bus; 152 struct kvm_io_bus pio_bus;
153#ifdef CONFIG_HAVE_KVM_EVENTFD
154 struct {
155 spinlock_t lock;
156 struct list_head items;
157 } irqfds;
158 struct list_head ioeventfds;
159#endif
139 struct kvm_vm_stat stat; 160 struct kvm_vm_stat stat;
140 struct kvm_arch arch; 161 struct kvm_arch arch;
141 atomic_t users_count; 162 atomic_t users_count;
@@ -144,6 +165,7 @@ struct kvm {
144 struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; 165 struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
145#endif 166#endif
146 167
168 struct mutex irq_lock;
147#ifdef CONFIG_HAVE_KVM_IRQCHIP 169#ifdef CONFIG_HAVE_KVM_IRQCHIP
148 struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ 170 struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */
149 struct hlist_head mask_notifier_list; 171 struct hlist_head mask_notifier_list;
@@ -167,6 +189,17 @@ struct kvm {
167#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) 189#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt)
168#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) 190#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt)
169 191
192static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
193{
194 smp_rmb();
195 return kvm->vcpus[i];
196}
197
198#define kvm_for_each_vcpu(idx, vcpup, kvm) \
199 for (idx = 0, vcpup = kvm_get_vcpu(kvm, idx); \
200 idx < atomic_read(&kvm->online_vcpus) && vcpup; \
201 vcpup = kvm_get_vcpu(kvm, ++idx))
202
170int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); 203int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id);
171void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); 204void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
172 205
@@ -201,6 +234,7 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
201 struct kvm_userspace_memory_region *mem, 234 struct kvm_userspace_memory_region *mem,
202 struct kvm_memory_slot old, 235 struct kvm_memory_slot old,
203 int user_alloc); 236 int user_alloc);
237void kvm_disable_largepages(void);
204void kvm_arch_flush_shadow(struct kvm *kvm); 238void kvm_arch_flush_shadow(struct kvm *kvm);
205gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); 239gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
206struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); 240struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
@@ -243,8 +277,6 @@ long kvm_arch_dev_ioctl(struct file *filp,
243 unsigned int ioctl, unsigned long arg); 277 unsigned int ioctl, unsigned long arg);
244long kvm_arch_vcpu_ioctl(struct file *filp, 278long kvm_arch_vcpu_ioctl(struct file *filp,
245 unsigned int ioctl, unsigned long arg); 279 unsigned int ioctl, unsigned long arg);
246void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
247void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu);
248 280
249int kvm_dev_ioctl_check_extension(long ext); 281int kvm_dev_ioctl_check_extension(long ext);
250 282
@@ -300,7 +332,6 @@ int kvm_arch_hardware_setup(void);
300void kvm_arch_hardware_unsetup(void); 332void kvm_arch_hardware_unsetup(void);
301void kvm_arch_check_processor_compat(void *rtn); 333void kvm_arch_check_processor_compat(void *rtn);
302int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); 334int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
303int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu);
304 335
305void kvm_free_physmem(struct kvm *kvm); 336void kvm_free_physmem(struct kvm *kvm);
306 337
@@ -309,8 +340,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm);
309void kvm_free_all_assigned_devices(struct kvm *kvm); 340void kvm_free_all_assigned_devices(struct kvm *kvm);
310void kvm_arch_sync_events(struct kvm *kvm); 341void kvm_arch_sync_events(struct kvm *kvm);
311 342
312int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
313int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
314int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); 343int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu);
315void kvm_vcpu_kick(struct kvm_vcpu *vcpu); 344void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
316 345
@@ -366,7 +395,8 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level);
366void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); 395void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
367void kvm_register_irq_ack_notifier(struct kvm *kvm, 396void kvm_register_irq_ack_notifier(struct kvm *kvm,
368 struct kvm_irq_ack_notifier *kian); 397 struct kvm_irq_ack_notifier *kian);
369void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian); 398void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
399 struct kvm_irq_ack_notifier *kian);
370int kvm_request_irq_source_id(struct kvm *kvm); 400int kvm_request_irq_source_id(struct kvm *kvm);
371void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); 401void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id);
372 402
@@ -459,37 +489,6 @@ struct kvm_stats_debugfs_item {
459extern struct kvm_stats_debugfs_item debugfs_entries[]; 489extern struct kvm_stats_debugfs_item debugfs_entries[];
460extern struct dentry *kvm_debugfs_dir; 490extern struct dentry *kvm_debugfs_dir;
461 491
462#define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \
463 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
464 vcpu, 5, d1, d2, d3, d4, d5)
465#define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \
466 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
467 vcpu, 4, d1, d2, d3, d4, 0)
468#define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \
469 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
470 vcpu, 3, d1, d2, d3, 0, 0)
471#define KVMTRACE_2D(evt, vcpu, d1, d2, name) \
472 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
473 vcpu, 2, d1, d2, 0, 0, 0)
474#define KVMTRACE_1D(evt, vcpu, d1, name) \
475 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
476 vcpu, 1, d1, 0, 0, 0, 0)
477#define KVMTRACE_0D(evt, vcpu, name) \
478 trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \
479 vcpu, 0, 0, 0, 0, 0, 0)
480
481#ifdef CONFIG_KVM_TRACE
482int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg);
483void kvm_trace_cleanup(void);
484#else
485static inline
486int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg)
487{
488 return -EINVAL;
489}
490#define kvm_trace_cleanup() ((void)0)
491#endif
492
493#ifdef KVM_ARCH_WANT_MMU_NOTIFIER 492#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
494static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) 493static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq)
495{ 494{
@@ -525,4 +524,33 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {}
525 524
526#endif 525#endif
527 526
527#ifdef CONFIG_HAVE_KVM_EVENTFD
528
529void kvm_eventfd_init(struct kvm *kvm);
530int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags);
531void kvm_irqfd_release(struct kvm *kvm);
532int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
533
534#else
535
536static inline void kvm_eventfd_init(struct kvm *kvm) {}
537static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags)
538{
539 return -EINVAL;
540}
541
542static inline void kvm_irqfd_release(struct kvm *kvm) {}
543static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
544{
545 return -ENOSYS;
546}
547
548#endif /* CONFIG_HAVE_KVM_EVENTFD */
549
550#ifdef CONFIG_KVM_APIC_ARCHITECTURE
551static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu)
552{
553 return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id;
554}
555#endif
528#endif 556#endif
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
index 3ddce03766ca..d73109243fda 100644
--- a/include/linux/kvm_para.h
+++ b/include/linux/kvm_para.h
@@ -13,6 +13,7 @@
13#define KVM_ENOSYS 1000 13#define KVM_ENOSYS 1000
14#define KVM_EFAULT EFAULT 14#define KVM_EFAULT EFAULT
15#define KVM_E2BIG E2BIG 15#define KVM_E2BIG E2BIG
16#define KVM_EPERM EPERM
16 17
17#define KVM_HC_VAPIC_POLL_IRQ 1 18#define KVM_HC_VAPIC_POLL_IRQ 1
18#define KVM_HC_MMU_OP 2 19#define KVM_HC_MMU_OP 2
diff --git a/include/linux/libps2.h b/include/linux/libps2.h
index b94534b7e266..fcf5fbe6a50c 100644
--- a/include/linux/libps2.h
+++ b/include/linux/libps2.h
@@ -44,6 +44,7 @@ struct ps2dev {
44void ps2_init(struct ps2dev *ps2dev, struct serio *serio); 44void ps2_init(struct ps2dev *ps2dev, struct serio *serio);
45int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); 45int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout);
46void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout); 46void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout);
47int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
47int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); 48int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
48int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); 49int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data);
49int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); 50int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data);
diff --git a/include/linux/mISDNhw.h b/include/linux/mISDNhw.h
index 7f9831da847f..4af841408fb5 100644
--- a/include/linux/mISDNhw.h
+++ b/include/linux/mISDNhw.h
@@ -168,6 +168,7 @@ struct bchannel {
168extern int mISDN_initdchannel(struct dchannel *, int, void *); 168extern int mISDN_initdchannel(struct dchannel *, int, void *);
169extern int mISDN_initbchannel(struct bchannel *, int); 169extern int mISDN_initbchannel(struct bchannel *, int);
170extern int mISDN_freedchannel(struct dchannel *); 170extern int mISDN_freedchannel(struct dchannel *);
171extern void mISDN_clear_bchannel(struct bchannel *);
171extern int mISDN_freebchannel(struct bchannel *); 172extern int mISDN_freebchannel(struct bchannel *);
172extern void queue_ch_frame(struct mISDNchannel *, u_int, 173extern void queue_ch_frame(struct mISDNchannel *, u_int,
173 int, struct sk_buff *); 174 int, struct sk_buff *);
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h
index 45100b39a7cf..536ca12442ca 100644
--- a/include/linux/mISDNif.h
+++ b/include/linux/mISDNif.h
@@ -37,7 +37,7 @@
37 */ 37 */
38#define MISDN_MAJOR_VERSION 1 38#define MISDN_MAJOR_VERSION 1
39#define MISDN_MINOR_VERSION 1 39#define MISDN_MINOR_VERSION 1
40#define MISDN_RELEASE 20 40#define MISDN_RELEASE 21
41 41
42/* primitives for information exchange 42/* primitives for information exchange
43 * generell format 43 * generell format
@@ -153,6 +153,18 @@
153#define HFC_VOL_CHANGE_RX 0x2602 153#define HFC_VOL_CHANGE_RX 0x2602
154#define HFC_SPL_LOOP_ON 0x2603 154#define HFC_SPL_LOOP_ON 0x2603
155#define HFC_SPL_LOOP_OFF 0x2604 155#define HFC_SPL_LOOP_OFF 0x2604
156/* for T30 FAX and analog modem */
157#define HW_MOD_FRM 0x4000
158#define HW_MOD_FRH 0x4001
159#define HW_MOD_FTM 0x4002
160#define HW_MOD_FTH 0x4003
161#define HW_MOD_FTS 0x4004
162#define HW_MOD_CONNECT 0x4010
163#define HW_MOD_OK 0x4011
164#define HW_MOD_NOCARR 0x4012
165#define HW_MOD_FCERROR 0x4013
166#define HW_MOD_READY 0x4014
167#define HW_MOD_LASTDATA 0x4015
156 168
157/* DSP_TONE_PATT_ON parameter */ 169/* DSP_TONE_PATT_ON parameter */
158#define TONE_OFF 0x0000 170#define TONE_OFF 0x0000
@@ -224,6 +236,8 @@
224#define ISDN_P_B_L2DTMF 0x24 236#define ISDN_P_B_L2DTMF 0x24
225#define ISDN_P_B_L2DSP 0x25 237#define ISDN_P_B_L2DSP 0x25
226#define ISDN_P_B_L2DSPHDLC 0x26 238#define ISDN_P_B_L2DSPHDLC 0x26
239#define ISDN_P_B_T30_FAX 0x27
240#define ISDN_P_B_MODEM_ASYNC 0x28
227 241
228#define OPTION_L2_PMX 1 242#define OPTION_L2_PMX 1
229#define OPTION_L2_PTP 2 243#define OPTION_L2_PTP 2
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index cfdf1df2875e..c779b49a1fda 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -304,7 +304,7 @@ static inline __u16 mdio_phy_id_devad(int phy_id)
304 */ 304 */
305struct mdio_if_info { 305struct mdio_if_info {
306 int prtad; 306 int prtad;
307 u32 __bitwise mmds; 307 u32 mmds;
308 unsigned mode_support; 308 unsigned mode_support;
309 309
310 struct net_device *dev; 310 struct net_device *dev;
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 39751c8cde9c..2dbfb5a05994 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -22,6 +22,12 @@
22/* 22/*
23 * Vendors and devices. Sort key: vendor first, device next. 23 * Vendors and devices. Sort key: vendor first, device next.
24 */ 24 */
25#define SDIO_VENDOR_ID_INTEL 0x0089
26#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402
27#define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403
28#define SDIO_DEVICE_ID_INTEL_IWMC3200TOP 0x1404
29#define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405
30#define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406
25 31
26#define SDIO_VENDOR_ID_MARVELL 0x02df 32#define SDIO_VENDOR_ID_MARVELL 0x02df
27#define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 33#define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index b70313d33ff8..274b6196091d 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * MTD partitioning layer definitions 2 * MTD partitioning layer definitions
3 * 3 *
4 * (C) 2000 Nicolas Pitre <nico@cam.org> 4 * (C) 2000 Nicolas Pitre <nico@fluxnic.net>
5 * 5 *
6 * This code is GPL 6 * This code is GPL
7 */ 7 */
diff --git a/include/linux/net.h b/include/linux/net.h
index 4fc2ffd527f9..9040a10584f7 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -57,6 +57,7 @@ typedef enum {
57#include <linux/random.h> 57#include <linux/random.h>
58#include <linux/wait.h> 58#include <linux/wait.h>
59#include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ 59#include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */
60#include <linux/kmemcheck.h>
60 61
61struct poll_table_struct; 62struct poll_table_struct;
62struct pipe_inode_info; 63struct pipe_inode_info;
@@ -127,7 +128,11 @@ enum sock_shutdown_cmd {
127 */ 128 */
128struct socket { 129struct socket {
129 socket_state state; 130 socket_state state;
131
132 kmemcheck_bitfield_begin(type);
130 short type; 133 short type;
134 kmemcheck_bitfield_end(type);
135
131 unsigned long flags; 136 unsigned long flags;
132 /* 137 /*
133 * Please keep fasync_list & wait fields in the same cache line 138 * Please keep fasync_list & wait fields in the same cache line
diff --git a/include/linux/net_dropmon.h b/include/linux/net_dropmon.h
index 3ceb0cc1bc78..2a739462caeb 100644
--- a/include/linux/net_dropmon.h
+++ b/include/linux/net_dropmon.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netlink.h> 5#include <linux/netlink.h>
6#include <linux/types.h>
7 6
8struct net_dm_drop_point { 7struct net_dm_drop_point {
9 __u8 pc[8]; 8 __u8 pc[8];
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d4a4d9867794..94958c109761 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -72,10 +72,6 @@ struct wireless_dev;
72/* Backlog congestion levels */ 72/* Backlog congestion levels */
73#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ 73#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
74#define NET_RX_DROP 1 /* packet dropped */ 74#define NET_RX_DROP 1 /* packet dropped */
75#define NET_RX_CN_LOW 2 /* storm alert, just in case */
76#define NET_RX_CN_MOD 3 /* Storm on its way! */
77#define NET_RX_CN_HIGH 4 /* The storm is here */
78#define NET_RX_BAD 5 /* packet dropped due to kernel error */
79 75
80/* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It 76/* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It
81 * indicates that the device will soon be dropping packets, or already drops 77 * indicates that the device will soon be dropping packets, or already drops
@@ -83,17 +79,19 @@ struct wireless_dev;
83#define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) 79#define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e))
84#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) 80#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
85 81
82/* Driver transmit return codes */
83enum netdev_tx {
84 NETDEV_TX_OK = 0, /* driver took care of packet */
85 NETDEV_TX_BUSY, /* driver tx path was busy*/
86 NETDEV_TX_LOCKED = -1, /* driver tx lock was already taken */
87};
88typedef enum netdev_tx netdev_tx_t;
89
86#endif 90#endif
87 91
88#define MAX_ADDR_LEN 32 /* Largest hardware address length */ 92#define MAX_ADDR_LEN 32 /* Largest hardware address length */
89 93
90/* Driver transmit return codes */
91#define NETDEV_TX_OK 0 /* driver took care of packet */
92#define NETDEV_TX_BUSY 1 /* driver tx path was busy*/
93#define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */
94
95#ifdef __KERNEL__ 94#ifdef __KERNEL__
96
97/* 95/*
98 * Compute the worst case header length according to the protocols 96 * Compute the worst case header length according to the protocols
99 * used. 97 * used.
@@ -511,9 +509,11 @@ struct netdev_queue {
511 * This function is called when network device transistions to the down 509 * This function is called when network device transistions to the down
512 * state. 510 * state.
513 * 511 *
514 * int (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev); 512 * netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
513 * struct net_device *dev);
515 * Called when a packet needs to be transmitted. 514 * Called when a packet needs to be transmitted.
516 * Must return NETDEV_TX_OK , NETDEV_TX_BUSY, or NETDEV_TX_LOCKED, 515 * Must return NETDEV_TX_OK , NETDEV_TX_BUSY.
516 * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX)
517 * Required can not be NULL. 517 * Required can not be NULL.
518 * 518 *
519 * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); 519 * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb);
@@ -584,7 +584,7 @@ struct net_device_ops {
584 void (*ndo_uninit)(struct net_device *dev); 584 void (*ndo_uninit)(struct net_device *dev);
585 int (*ndo_open)(struct net_device *dev); 585 int (*ndo_open)(struct net_device *dev);
586 int (*ndo_stop)(struct net_device *dev); 586 int (*ndo_stop)(struct net_device *dev);
587 int (*ndo_start_xmit) (struct sk_buff *skb, 587 netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb,
588 struct net_device *dev); 588 struct net_device *dev);
589 u16 (*ndo_select_queue)(struct net_device *dev, 589 u16 (*ndo_select_queue)(struct net_device *dev,
590 struct sk_buff *skb); 590 struct sk_buff *skb);
@@ -627,6 +627,8 @@ struct net_device_ops {
627 void (*ndo_poll_controller)(struct net_device *dev); 627 void (*ndo_poll_controller)(struct net_device *dev);
628#endif 628#endif
629#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) 629#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
630 int (*ndo_fcoe_enable)(struct net_device *dev);
631 int (*ndo_fcoe_disable)(struct net_device *dev);
630 int (*ndo_fcoe_ddp_setup)(struct net_device *dev, 632 int (*ndo_fcoe_ddp_setup)(struct net_device *dev,
631 u16 xid, 633 u16 xid,
632 struct scatterlist *sgl, 634 struct scatterlist *sgl,
@@ -705,6 +707,7 @@ struct net_device
705/* the GSO_MASK reserves bits 16 through 23 */ 707/* the GSO_MASK reserves bits 16 through 23 */
706#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ 708#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */
707#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ 709#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */
710#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
708 711
709 /* Segmentation offload features */ 712 /* Segmentation offload features */
710#define NETIF_F_GSO_SHIFT 16 713#define NETIF_F_GSO_SHIFT 16
@@ -829,6 +832,9 @@ struct net_device
829 /* Number of TX queues currently active in device */ 832 /* Number of TX queues currently active in device */
830 unsigned int real_num_tx_queues; 833 unsigned int real_num_tx_queues;
831 834
835 /* root qdisc from userspace point of view */
836 struct Qdisc *qdisc;
837
832 unsigned long tx_queue_len; /* Max frames per queue allowed */ 838 unsigned long tx_queue_len; /* Max frames per queue allowed */
833 spinlock_t tx_global_lock; 839 spinlock_t tx_global_lock;
834/* 840/*
@@ -889,7 +895,7 @@ struct net_device
889 /* class/net/name entry */ 895 /* class/net/name entry */
890 struct device dev; 896 struct device dev;
891 /* space for optional statistics and wireless sysfs groups */ 897 /* space for optional statistics and wireless sysfs groups */
892 struct attribute_group *sysfs_groups[3]; 898 const struct attribute_group *sysfs_groups[3];
893 899
894 /* rtnetlink link ops */ 900 /* rtnetlink link ops */
895 const struct rtnl_link_ops *rtnl_link_ops; 901 const struct rtnl_link_ops *rtnl_link_ops;
@@ -992,6 +998,12 @@ static inline void *netdev_priv(const struct net_device *dev)
992 */ 998 */
993#define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) 999#define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev))
994 1000
1001/* Set the sysfs device type for the network logical device to allow
1002 * fin grained indentification of different network device types. For
1003 * example Ethernet, Wirelss LAN, Bluetooth, WiMAX etc.
1004 */
1005#define SET_NETDEV_DEVTYPE(net, devtype) ((net)->dev.type = (devtype))
1006
995/** 1007/**
996 * netif_napi_add - initialize a napi context 1008 * netif_napi_add - initialize a napi context
997 * @dev: network device 1009 * @dev: network device
@@ -1260,7 +1272,7 @@ static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue)
1260{ 1272{
1261#ifdef CONFIG_NETPOLL_TRAP 1273#ifdef CONFIG_NETPOLL_TRAP
1262 if (netpoll_trap()) { 1274 if (netpoll_trap()) {
1263 clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state); 1275 netif_tx_start_queue(dev_queue);
1264 return; 1276 return;
1265 } 1277 }
1266#endif 1278#endif
@@ -1366,7 +1378,8 @@ static inline int netif_running(const struct net_device *dev)
1366static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) 1378static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
1367{ 1379{
1368 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); 1380 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1369 clear_bit(__QUEUE_STATE_XOFF, &txq->state); 1381
1382 netif_tx_start_queue(txq);
1370} 1383}
1371 1384
1372/** 1385/**
@@ -1383,7 +1396,7 @@ static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
1383 if (netpoll_trap()) 1396 if (netpoll_trap())
1384 return; 1397 return;
1385#endif 1398#endif
1386 set_bit(__QUEUE_STATE_XOFF, &txq->state); 1399 netif_tx_stop_queue(txq);
1387} 1400}
1388 1401
1389/** 1402/**
@@ -1397,7 +1410,8 @@ static inline int __netif_subqueue_stopped(const struct net_device *dev,
1397 u16 queue_index) 1410 u16 queue_index)
1398{ 1411{
1399 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); 1412 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1400 return test_bit(__QUEUE_STATE_XOFF, &txq->state); 1413
1414 return netif_tx_queue_stopped(txq);
1401} 1415}
1402 1416
1403static inline int netif_subqueue_stopped(const struct net_device *dev, 1417static inline int netif_subqueue_stopped(const struct net_device *dev,
@@ -1749,8 +1763,7 @@ static inline void netif_tx_unlock(struct net_device *dev)
1749 * force a schedule. 1763 * force a schedule.
1750 */ 1764 */
1751 clear_bit(__QUEUE_STATE_FROZEN, &txq->state); 1765 clear_bit(__QUEUE_STATE_FROZEN, &txq->state);
1752 if (!test_bit(__QUEUE_STATE_XOFF, &txq->state)) 1766 netif_schedule_queue(txq);
1753 __netif_schedule(txq->qdisc);
1754 } 1767 }
1755 spin_unlock(&dev->tx_global_lock); 1768 spin_unlock(&dev->tx_global_lock);
1756} 1769}
@@ -1860,7 +1873,8 @@ extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct
1860extern int dev_set_promiscuity(struct net_device *dev, int inc); 1873extern int dev_set_promiscuity(struct net_device *dev, int inc);
1861extern int dev_set_allmulti(struct net_device *dev, int inc); 1874extern int dev_set_allmulti(struct net_device *dev, int inc);
1862extern void netdev_state_change(struct net_device *dev); 1875extern void netdev_state_change(struct net_device *dev);
1863extern void netdev_bonding_change(struct net_device *dev); 1876extern void netdev_bonding_change(struct net_device *dev,
1877 unsigned long event);
1864extern void netdev_features_change(struct net_device *dev); 1878extern void netdev_features_change(struct net_device *dev);
1865/* Load a device via the kmod */ 1879/* Load a device via the kmod */
1866extern void dev_load(struct net *net, const char *name); 1880extern void dev_load(struct net *net, const char *name);
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index bff4d5741d98..9f00da287f2c 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -58,7 +58,8 @@ struct nfgenmsg {
58struct nfnl_callback 58struct nfnl_callback
59{ 59{
60 int (*call)(struct sock *nl, struct sk_buff *skb, 60 int (*call)(struct sock *nl, struct sk_buff *skb,
61 struct nlmsghdr *nlh, struct nlattr *cda[]); 61 const struct nlmsghdr *nlh,
62 const struct nlattr * const cda[]);
62 const struct nla_policy *policy; /* netlink attribute policy */ 63 const struct nla_policy *policy; /* netlink attribute policy */
63 const u_int16_t attr_count; /* number of nlattr's */ 64 const u_int16_t attr_count; /* number of nlattr's */
64}; 65};
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 1030b7593898..812cb153cabb 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -238,9 +238,9 @@ struct xt_mtdtor_param {
238 */ 238 */
239struct xt_target_param { 239struct xt_target_param {
240 const struct net_device *in, *out; 240 const struct net_device *in, *out;
241 unsigned int hooknum;
242 const struct xt_target *target; 241 const struct xt_target *target;
243 const void *targinfo; 242 const void *targinfo;
243 unsigned int hooknum;
244 u_int8_t family; 244 u_int8_t family;
245}; 245};
246 246
@@ -407,7 +407,7 @@ extern int xt_check_target(struct xt_tgchk_param *,
407 unsigned int size, u_int8_t proto, bool inv_proto); 407 unsigned int size, u_int8_t proto, bool inv_proto);
408 408
409extern struct xt_table *xt_register_table(struct net *net, 409extern struct xt_table *xt_register_table(struct net *net,
410 struct xt_table *table, 410 const struct xt_table *table,
411 struct xt_table_info *bootstrap, 411 struct xt_table_info *bootstrap,
412 struct xt_table_info *newinfo); 412 struct xt_table_info *newinfo);
413extern void *xt_unregister_table(struct xt_table *table); 413extern void *xt_unregister_table(struct xt_table *table);
diff --git a/include/linux/netfilter/xt_CONNMARK.h b/include/linux/netfilter/xt_CONNMARK.h
index 7635c8ffdadb..0a8545866752 100644
--- a/include/linux/netfilter/xt_CONNMARK.h
+++ b/include/linux/netfilter/xt_CONNMARK.h
@@ -18,12 +18,6 @@ enum {
18 XT_CONNMARK_RESTORE 18 XT_CONNMARK_RESTORE
19}; 19};
20 20
21struct xt_connmark_target_info {
22 unsigned long mark;
23 unsigned long mask;
24 __u8 mode;
25};
26
27struct xt_connmark_tginfo1 { 21struct xt_connmark_tginfo1 {
28 __u32 ctmark, ctmask, nfmask; 22 __u32 ctmark, ctmask, nfmask;
29 __u8 mode; 23 __u8 mode;
diff --git a/include/linux/netfilter/xt_MARK.h b/include/linux/netfilter/xt_MARK.h
index 028304bcc0b1..bc9561bdef79 100644
--- a/include/linux/netfilter/xt_MARK.h
+++ b/include/linux/netfilter/xt_MARK.h
@@ -3,23 +3,6 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6/* Version 0 */
7struct xt_mark_target_info {
8 unsigned long mark;
9};
10
11/* Version 1 */
12enum {
13 XT_MARK_SET=0,
14 XT_MARK_AND,
15 XT_MARK_OR,
16};
17
18struct xt_mark_target_info_v1 {
19 unsigned long mark;
20 __u8 mode;
21};
22
23struct xt_mark_tginfo2 { 6struct xt_mark_tginfo2 {
24 __u32 mark, mask; 7 __u32 mark, mask;
25}; 8};
diff --git a/include/linux/netfilter/xt_connmark.h b/include/linux/netfilter/xt_connmark.h
index 571e266d004c..619e47cde01a 100644
--- a/include/linux/netfilter/xt_connmark.h
+++ b/include/linux/netfilter/xt_connmark.h
@@ -12,11 +12,6 @@
12 * (at your option) any later version. 12 * (at your option) any later version.
13 */ 13 */
14 14
15struct xt_connmark_info {
16 unsigned long mark, mask;
17 __u8 invert;
18};
19
20struct xt_connmark_mtinfo1 { 15struct xt_connmark_mtinfo1 {
21 __u32 mark, mask; 16 __u32 mark, mask;
22 __u8 invert; 17 __u8 invert;
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h
index 7ae05338e94c..54f47a2f6152 100644
--- a/include/linux/netfilter/xt_conntrack.h
+++ b/include/linux/netfilter/xt_conntrack.h
@@ -32,42 +32,6 @@ enum {
32 XT_CONNTRACK_DIRECTION = 1 << 12, 32 XT_CONNTRACK_DIRECTION = 1 << 12,
33}; 33};
34 34
35/* This is exposed to userspace, so remains frozen in time. */
36struct ip_conntrack_old_tuple
37{
38 struct {
39 __be32 ip;
40 union {
41 __u16 all;
42 } u;
43 } src;
44
45 struct {
46 __be32 ip;
47 union {
48 __u16 all;
49 } u;
50
51 /* The protocol. */
52 __u16 protonum;
53 } dst;
54};
55
56struct xt_conntrack_info
57{
58 unsigned int statemask, statusmask;
59
60 struct ip_conntrack_old_tuple tuple[IP_CT_DIR_MAX];
61 struct in_addr sipmsk[IP_CT_DIR_MAX], dipmsk[IP_CT_DIR_MAX];
62
63 unsigned long expires_min, expires_max;
64
65 /* Flags word */
66 __u8 flags;
67 /* Inverse flags */
68 __u8 invflags;
69};
70
71struct xt_conntrack_mtinfo1 { 35struct xt_conntrack_mtinfo1 {
72 union nf_inet_addr origsrc_addr, origsrc_mask; 36 union nf_inet_addr origsrc_addr, origsrc_mask;
73 union nf_inet_addr origdst_addr, origdst_mask; 37 union nf_inet_addr origdst_addr, origdst_mask;
diff --git a/include/linux/netfilter/xt_mark.h b/include/linux/netfilter/xt_mark.h
index 6fa460a3cc29..6607c8f38ea5 100644
--- a/include/linux/netfilter/xt_mark.h
+++ b/include/linux/netfilter/xt_mark.h
@@ -3,11 +3,6 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct xt_mark_info {
7 unsigned long mark, mask;
8 __u8 invert;
9};
10
11struct xt_mark_mtinfo1 { 6struct xt_mark_mtinfo1 {
12 __u32 mark, mask; 7 __u32 mark, mask;
13 __u8 invert; 8 __u8 invert;
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 590ac3d6d5d6..6fe3e6aa10db 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -265,7 +265,7 @@ struct arpt_error
265} 265}
266 266
267extern struct xt_table *arpt_register_table(struct net *net, 267extern struct xt_table *arpt_register_table(struct net *net,
268 struct xt_table *table, 268 const struct xt_table *table,
269 const struct arpt_replace *repl); 269 const struct arpt_replace *repl);
270extern void arpt_unregister_table(struct xt_table *table); 270extern void arpt_unregister_table(struct xt_table *table);
271extern unsigned int arpt_do_table(struct sk_buff *skb, 271extern unsigned int arpt_do_table(struct sk_buff *skb,
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index e40ddb94b1af..ea281e6a2048 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -301,7 +301,7 @@ struct ebt_table
301#define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ 301#define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \
302 ~(__alignof__(struct ebt_replace)-1)) 302 ~(__alignof__(struct ebt_replace)-1))
303extern struct ebt_table *ebt_register_table(struct net *net, 303extern struct ebt_table *ebt_register_table(struct net *net,
304 struct ebt_table *table); 304 const struct ebt_table *table);
305extern void ebt_unregister_table(struct ebt_table *table); 305extern void ebt_unregister_table(struct ebt_table *table);
306extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, 306extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
307 const struct net_device *in, const struct net_device *out, 307 const struct net_device *in, const struct net_device *out,
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index 3a7105bb8f33..431b40761920 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -1,46 +1,14 @@
1header-y += ipt_CLASSIFY.h
2header-y += ipt_CLUSTERIP.h 1header-y += ipt_CLUSTERIP.h
3header-y += ipt_CONNMARK.h
4header-y += ipt_DSCP.h
5header-y += ipt_ECN.h 2header-y += ipt_ECN.h
6header-y += ipt_LOG.h 3header-y += ipt_LOG.h
7header-y += ipt_MARK.h
8header-y += ipt_NFQUEUE.h
9header-y += ipt_REJECT.h 4header-y += ipt_REJECT.h
10header-y += ipt_SAME.h 5header-y += ipt_SAME.h
11header-y += ipt_TCPMSS.h
12header-y += ipt_TOS.h
13header-y += ipt_TTL.h 6header-y += ipt_TTL.h
14header-y += ipt_ULOG.h 7header-y += ipt_ULOG.h
15header-y += ipt_addrtype.h 8header-y += ipt_addrtype.h
16header-y += ipt_ah.h 9header-y += ipt_ah.h
17header-y += ipt_comment.h
18header-y += ipt_connbytes.h
19header-y += ipt_connmark.h
20header-y += ipt_conntrack.h
21header-y += ipt_dccp.h
22header-y += ipt_dscp.h
23header-y += ipt_ecn.h 10header-y += ipt_ecn.h
24header-y += ipt_esp.h
25header-y += ipt_hashlimit.h
26header-y += ipt_helper.h
27header-y += ipt_iprange.h
28header-y += ipt_length.h
29header-y += ipt_limit.h
30header-y += ipt_mac.h
31header-y += ipt_mark.h
32header-y += ipt_multiport.h
33header-y += ipt_owner.h
34header-y += ipt_physdev.h
35header-y += ipt_pkttype.h
36header-y += ipt_policy.h
37header-y += ipt_realm.h 11header-y += ipt_realm.h
38header-y += ipt_recent.h
39header-y += ipt_sctp.h
40header-y += ipt_state.h
41header-y += ipt_string.h
42header-y += ipt_tcpmss.h
43header-y += ipt_tos.h
44header-y += ipt_ttl.h 12header-y += ipt_ttl.h
45 13
46unifdef-y += ip_queue.h 14unifdef-y += ip_queue.h
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 092bd50581a9..61fafc868a7b 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -245,7 +245,7 @@ ipt_get_target(struct ipt_entry *e)
245extern void ipt_init(void) __init; 245extern void ipt_init(void) __init;
246 246
247extern struct xt_table *ipt_register_table(struct net *net, 247extern struct xt_table *ipt_register_table(struct net *net,
248 struct xt_table *table, 248 const struct xt_table *table,
249 const struct ipt_replace *repl); 249 const struct ipt_replace *repl);
250extern void ipt_unregister_table(struct xt_table *table); 250extern void ipt_unregister_table(struct xt_table *table);
251 251
diff --git a/include/linux/netfilter_ipv4/ipt_CLASSIFY.h b/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
deleted file mode 100644
index a46d511b5c36..000000000000
--- a/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IPT_CLASSIFY_H
2#define _IPT_CLASSIFY_H
3
4#include <linux/netfilter/xt_CLASSIFY.h>
5#define ipt_classify_target_info xt_classify_target_info
6
7#endif /*_IPT_CLASSIFY_H */
diff --git a/include/linux/netfilter_ipv4/ipt_CONNMARK.h b/include/linux/netfilter_ipv4/ipt_CONNMARK.h
deleted file mode 100644
index 9ecfee0a9e33..000000000000
--- a/include/linux/netfilter_ipv4/ipt_CONNMARK.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef _IPT_CONNMARK_H_target
2#define _IPT_CONNMARK_H_target
3
4/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
5 * by Henrik Nordstrom <hno@marasystems.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12#include <linux/netfilter/xt_CONNMARK.h>
13#define IPT_CONNMARK_SET XT_CONNMARK_SET
14#define IPT_CONNMARK_SAVE XT_CONNMARK_SAVE
15#define IPT_CONNMARK_RESTORE XT_CONNMARK_RESTORE
16
17#define ipt_connmark_target_info xt_connmark_target_info
18
19#endif /*_IPT_CONNMARK_H_target*/
diff --git a/include/linux/netfilter_ipv4/ipt_DSCP.h b/include/linux/netfilter_ipv4/ipt_DSCP.h
deleted file mode 100644
index 3491e524d5ea..000000000000
--- a/include/linux/netfilter_ipv4/ipt_DSCP.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/* iptables module for setting the IPv4 DSCP field
2 *
3 * (C) 2002 Harald Welte <laforge@gnumonks.org>
4 * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com>
5 * This software is distributed under GNU GPL v2, 1991
6 *
7 * See RFC2474 for a description of the DSCP field within the IP Header.
8 *
9 * ipt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp
10*/
11#ifndef _IPT_DSCP_TARGET_H
12#define _IPT_DSCP_TARGET_H
13#include <linux/netfilter_ipv4/ipt_dscp.h>
14#include <linux/netfilter/xt_DSCP.h>
15
16#define ipt_DSCP_info xt_DSCP_info
17
18#endif /* _IPT_DSCP_TARGET_H */
diff --git a/include/linux/netfilter_ipv4/ipt_ECN.h b/include/linux/netfilter_ipv4/ipt_ECN.h
index 94e0d9866469..7ca45918ab8e 100644
--- a/include/linux/netfilter_ipv4/ipt_ECN.h
+++ b/include/linux/netfilter_ipv4/ipt_ECN.h
@@ -8,9 +8,9 @@
8*/ 8*/
9#ifndef _IPT_ECN_TARGET_H 9#ifndef _IPT_ECN_TARGET_H
10#define _IPT_ECN_TARGET_H 10#define _IPT_ECN_TARGET_H
11#include <linux/netfilter_ipv4/ipt_DSCP.h> 11#include <linux/netfilter/xt_DSCP.h>
12 12
13#define IPT_ECN_IP_MASK (~IPT_DSCP_MASK) 13#define IPT_ECN_IP_MASK (~XT_DSCP_MASK)
14 14
15#define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */ 15#define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */
16#define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */ 16#define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */
diff --git a/include/linux/netfilter_ipv4/ipt_MARK.h b/include/linux/netfilter_ipv4/ipt_MARK.h
deleted file mode 100644
index 697a486a96d3..000000000000
--- a/include/linux/netfilter_ipv4/ipt_MARK.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef _IPT_MARK_H_target
2#define _IPT_MARK_H_target
3
4/* Backwards compatibility for old userspace */
5
6#include <linux/netfilter/xt_MARK.h>
7
8/* Version 0 */
9#define ipt_mark_target_info xt_mark_target_info
10
11/* Version 1 */
12#define IPT_MARK_SET XT_MARK_SET
13#define IPT_MARK_AND XT_MARK_AND
14#define IPT_MARK_OR XT_MARK_OR
15
16#define ipt_mark_target_info_v1 xt_mark_target_info_v1
17
18#endif /*_IPT_MARK_H_target*/
diff --git a/include/linux/netfilter_ipv4/ipt_NFQUEUE.h b/include/linux/netfilter_ipv4/ipt_NFQUEUE.h
deleted file mode 100644
index 97a2a7557cb9..000000000000
--- a/include/linux/netfilter_ipv4/ipt_NFQUEUE.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/* iptables module for using NFQUEUE mechanism
2 *
3 * (C) 2005 Harald Welte <laforge@netfilter.org>
4 *
5 * This software is distributed under GNU GPL v2, 1991
6 *
7*/
8#ifndef _IPT_NFQ_TARGET_H
9#define _IPT_NFQ_TARGET_H
10
11/* Backwards compatibility for old userspace */
12#include <linux/netfilter/xt_NFQUEUE.h>
13
14#define ipt_NFQ_info xt_NFQ_info
15
16#endif /* _IPT_DSCP_TARGET_H */
diff --git a/include/linux/netfilter_ipv4/ipt_TCPMSS.h b/include/linux/netfilter_ipv4/ipt_TCPMSS.h
deleted file mode 100644
index 7a850f945824..000000000000
--- a/include/linux/netfilter_ipv4/ipt_TCPMSS.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _IPT_TCPMSS_H
2#define _IPT_TCPMSS_H
3
4#include <linux/netfilter/xt_TCPMSS.h>
5
6#define ipt_tcpmss_info xt_tcpmss_info
7#define IPT_TCPMSS_CLAMP_PMTU XT_TCPMSS_CLAMP_PMTU
8
9#endif /*_IPT_TCPMSS_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_TOS.h b/include/linux/netfilter_ipv4/ipt_TOS.h
deleted file mode 100644
index 6bf9e1fdfd88..000000000000
--- a/include/linux/netfilter_ipv4/ipt_TOS.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _IPT_TOS_H_target
2#define _IPT_TOS_H_target
3
4#ifndef IPTOS_NORMALSVC
5#define IPTOS_NORMALSVC 0
6#endif
7
8struct ipt_tos_target_info {
9 u_int8_t tos;
10};
11
12#endif /*_IPT_TOS_H_target*/
diff --git a/include/linux/netfilter_ipv4/ipt_comment.h b/include/linux/netfilter_ipv4/ipt_comment.h
deleted file mode 100644
index ae2afc2f7481..000000000000
--- a/include/linux/netfilter_ipv4/ipt_comment.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _IPT_COMMENT_H
2#define _IPT_COMMENT_H
3
4#include <linux/netfilter/xt_comment.h>
5
6#define IPT_MAX_COMMENT_LEN XT_MAX_COMMENT_LEN
7
8#define ipt_comment_info xt_comment_info
9
10#endif /* _IPT_COMMENT_H */
diff --git a/include/linux/netfilter_ipv4/ipt_connbytes.h b/include/linux/netfilter_ipv4/ipt_connbytes.h
deleted file mode 100644
index f63e6ee91113..000000000000
--- a/include/linux/netfilter_ipv4/ipt_connbytes.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef _IPT_CONNBYTES_H
2#define _IPT_CONNBYTES_H
3
4#include <linux/netfilter/xt_connbytes.h>
5#define ipt_connbytes_what xt_connbytes_what
6
7#define IPT_CONNBYTES_PKTS XT_CONNBYTES_PKTS
8#define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES
9#define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT
10
11#define ipt_connbytes_direction xt_connbytes_direction
12#define IPT_CONNBYTES_DIR_ORIGINAL XT_CONNBYTES_DIR_ORIGINAL
13#define IPT_CONNBYTES_DIR_REPLY XT_CONNBYTES_DIR_REPLY
14#define IPT_CONNBYTES_DIR_BOTH XT_CONNBYTES_DIR_BOTH
15
16#define ipt_connbytes_info xt_connbytes_info
17
18#endif
diff --git a/include/linux/netfilter_ipv4/ipt_connmark.h b/include/linux/netfilter_ipv4/ipt_connmark.h
deleted file mode 100644
index c7ba6560d44c..000000000000
--- a/include/linux/netfilter_ipv4/ipt_connmark.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IPT_CONNMARK_H
2#define _IPT_CONNMARK_H
3
4#include <linux/netfilter/xt_connmark.h>
5#define ipt_connmark_info xt_connmark_info
6
7#endif /*_IPT_CONNMARK_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_conntrack.h b/include/linux/netfilter_ipv4/ipt_conntrack.h
deleted file mode 100644
index cde6762949c5..000000000000
--- a/include/linux/netfilter_ipv4/ipt_conntrack.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/* Header file for kernel module to match connection tracking information.
2 * GPL (C) 2001 Marc Boucher (marc@mbsi.ca).
3 */
4
5#ifndef _IPT_CONNTRACK_H
6#define _IPT_CONNTRACK_H
7
8#include <linux/netfilter/xt_conntrack.h>
9
10#define IPT_CONNTRACK_STATE_BIT(ctinfo) XT_CONNTRACK_STATE_BIT(ctinfo)
11#define IPT_CONNTRACK_STATE_INVALID XT_CONNTRACK_STATE_INVALID
12
13#define IPT_CONNTRACK_STATE_SNAT XT_CONNTRACK_STATE_SNAT
14#define IPT_CONNTRACK_STATE_DNAT XT_CONNTRACK_STATE_DNAT
15#define IPT_CONNTRACK_STATE_UNTRACKED XT_CONNTRACK_STATE_UNTRACKED
16
17/* flags, invflags: */
18#define IPT_CONNTRACK_STATE XT_CONNTRACK_STATE
19#define IPT_CONNTRACK_PROTO XT_CONNTRACK_PROTO
20#define IPT_CONNTRACK_ORIGSRC XT_CONNTRACK_ORIGSRC
21#define IPT_CONNTRACK_ORIGDST XT_CONNTRACK_ORIGDST
22#define IPT_CONNTRACK_REPLSRC XT_CONNTRACK_REPLSRC
23#define IPT_CONNTRACK_REPLDST XT_CONNTRACK_REPLDST
24#define IPT_CONNTRACK_STATUS XT_CONNTRACK_STATUS
25#define IPT_CONNTRACK_EXPIRES XT_CONNTRACK_EXPIRES
26
27#define ipt_conntrack_info xt_conntrack_info
28#endif /*_IPT_CONNTRACK_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_dccp.h b/include/linux/netfilter_ipv4/ipt_dccp.h
deleted file mode 100644
index e70d11e1f53c..000000000000
--- a/include/linux/netfilter_ipv4/ipt_dccp.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef _IPT_DCCP_H_
2#define _IPT_DCCP_H_
3
4#include <linux/netfilter/xt_dccp.h>
5#define IPT_DCCP_SRC_PORTS XT_DCCP_SRC_PORTS
6#define IPT_DCCP_DEST_PORTS XT_DCCP_DEST_PORTS
7#define IPT_DCCP_TYPE XT_DCCP_TYPE
8#define IPT_DCCP_OPTION XT_DCCP_OPTION
9
10#define IPT_DCCP_VALID_FLAGS XT_DCCP_VALID_FLAGS
11
12#define ipt_dccp_info xt_dccp_info
13
14#endif /* _IPT_DCCP_H_ */
15
diff --git a/include/linux/netfilter_ipv4/ipt_dscp.h b/include/linux/netfilter_ipv4/ipt_dscp.h
deleted file mode 100644
index 4b82ca912b0e..000000000000
--- a/include/linux/netfilter_ipv4/ipt_dscp.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* iptables module for matching the IPv4 DSCP field
2 *
3 * (C) 2002 Harald Welte <laforge@gnumonks.org>
4 * This software is distributed under GNU GPL v2, 1991
5 *
6 * See RFC2474 for a description of the DSCP field within the IP Header.
7 *
8 * ipt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp
9*/
10#ifndef _IPT_DSCP_H
11#define _IPT_DSCP_H
12
13#include <linux/netfilter/xt_dscp.h>
14
15#define IPT_DSCP_MASK XT_DSCP_MASK
16#define IPT_DSCP_SHIFT XT_DSCP_SHIFT
17#define IPT_DSCP_MAX XT_DSCP_MAX
18
19#define ipt_dscp_info xt_dscp_info
20
21#endif /* _IPT_DSCP_H */
diff --git a/include/linux/netfilter_ipv4/ipt_ecn.h b/include/linux/netfilter_ipv4/ipt_ecn.h
index 1f0d9a4d3378..9945baa4ccd7 100644
--- a/include/linux/netfilter_ipv4/ipt_ecn.h
+++ b/include/linux/netfilter_ipv4/ipt_ecn.h
@@ -8,9 +8,9 @@
8*/ 8*/
9#ifndef _IPT_ECN_H 9#ifndef _IPT_ECN_H
10#define _IPT_ECN_H 10#define _IPT_ECN_H
11#include <linux/netfilter_ipv4/ipt_dscp.h> 11#include <linux/netfilter/xt_dscp.h>
12 12
13#define IPT_ECN_IP_MASK (~IPT_DSCP_MASK) 13#define IPT_ECN_IP_MASK (~XT_DSCP_MASK)
14 14
15#define IPT_ECN_OP_MATCH_IP 0x01 15#define IPT_ECN_OP_MATCH_IP 0x01
16#define IPT_ECN_OP_MATCH_ECE 0x10 16#define IPT_ECN_OP_MATCH_ECE 0x10
diff --git a/include/linux/netfilter_ipv4/ipt_esp.h b/include/linux/netfilter_ipv4/ipt_esp.h
deleted file mode 100644
index 78296e7eeff9..000000000000
--- a/include/linux/netfilter_ipv4/ipt_esp.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _IPT_ESP_H
2#define _IPT_ESP_H
3
4#include <linux/netfilter/xt_esp.h>
5
6#define ipt_esp xt_esp
7#define IPT_ESP_INV_SPI XT_ESP_INV_SPI
8#define IPT_ESP_INV_MASK XT_ESP_INV_MASK
9
10#endif /*_IPT_ESP_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_hashlimit.h b/include/linux/netfilter_ipv4/ipt_hashlimit.h
deleted file mode 100644
index 5662120a3d7b..000000000000
--- a/include/linux/netfilter_ipv4/ipt_hashlimit.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef _IPT_HASHLIMIT_H
2#define _IPT_HASHLIMIT_H
3
4#include <linux/netfilter/xt_hashlimit.h>
5
6#define IPT_HASHLIMIT_SCALE XT_HASHLIMIT_SCALE
7#define IPT_HASHLIMIT_HASH_DIP XT_HASHLIMIT_HASH_DIP
8#define IPT_HASHLIMIT_HASH_DPT XT_HASHLIMIT_HASH_DPT
9#define IPT_HASHLIMIT_HASH_SIP XT_HASHLIMIT_HASH_SIP
10#define IPT_HASHLIMIT_HASH_SPT XT_HASHLIMIT_HASH_SPT
11
12#define ipt_hashlimit_info xt_hashlimit_info
13
14#endif /* _IPT_HASHLIMIT_H */
diff --git a/include/linux/netfilter_ipv4/ipt_helper.h b/include/linux/netfilter_ipv4/ipt_helper.h
deleted file mode 100644
index 80452c218551..000000000000
--- a/include/linux/netfilter_ipv4/ipt_helper.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IPT_HELPER_H
2#define _IPT_HELPER_H
3
4#include <linux/netfilter/xt_helper.h>
5#define ipt_helper_info xt_helper_info
6
7#endif /* _IPT_HELPER_H */
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h
deleted file mode 100644
index 5f1aebde4d2f..000000000000
--- a/include/linux/netfilter_ipv4/ipt_iprange.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef _IPT_IPRANGE_H
2#define _IPT_IPRANGE_H
3
4#include <linux/types.h>
5#include <linux/netfilter/xt_iprange.h>
6
7struct ipt_iprange {
8 /* Inclusive: network order. */
9 __be32 min_ip, max_ip;
10};
11
12struct ipt_iprange_info
13{
14 struct ipt_iprange src;
15 struct ipt_iprange dst;
16
17 /* Flags from above */
18 u_int8_t flags;
19};
20
21#endif /* _IPT_IPRANGE_H */
diff --git a/include/linux/netfilter_ipv4/ipt_length.h b/include/linux/netfilter_ipv4/ipt_length.h
deleted file mode 100644
index 9b45206ffcef..000000000000
--- a/include/linux/netfilter_ipv4/ipt_length.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IPT_LENGTH_H
2#define _IPT_LENGTH_H
3
4#include <linux/netfilter/xt_length.h>
5#define ipt_length_info xt_length_info
6
7#endif /*_IPT_LENGTH_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_limit.h b/include/linux/netfilter_ipv4/ipt_limit.h
deleted file mode 100644
index 92f5cd07bbc4..000000000000
--- a/include/linux/netfilter_ipv4/ipt_limit.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _IPT_RATE_H
2#define _IPT_RATE_H
3
4#include <linux/netfilter/xt_limit.h>
5#define IPT_LIMIT_SCALE XT_LIMIT_SCALE
6#define ipt_rateinfo xt_rateinfo
7
8#endif /*_IPT_RATE_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_mac.h b/include/linux/netfilter_ipv4/ipt_mac.h
deleted file mode 100644
index b186008a3c47..000000000000
--- a/include/linux/netfilter_ipv4/ipt_mac.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IPT_MAC_H
2#define _IPT_MAC_H
3
4#include <linux/netfilter/xt_mac.h>
5#define ipt_mac_info xt_mac_info
6
7#endif /*_IPT_MAC_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_mark.h b/include/linux/netfilter_ipv4/ipt_mark.h
deleted file mode 100644
index bfde67c61224..000000000000
--- a/include/linux/netfilter_ipv4/ipt_mark.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _IPT_MARK_H
2#define _IPT_MARK_H
3
4/* Backwards compatibility for old userspace */
5#include <linux/netfilter/xt_mark.h>
6
7#define ipt_mark_info xt_mark_info
8
9#endif /*_IPT_MARK_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_multiport.h b/include/linux/netfilter_ipv4/ipt_multiport.h
deleted file mode 100644
index 55fe85eca88c..000000000000
--- a/include/linux/netfilter_ipv4/ipt_multiport.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef _IPT_MULTIPORT_H
2#define _IPT_MULTIPORT_H
3
4#include <linux/netfilter/xt_multiport.h>
5
6#define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
7#define IPT_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
8#define IPT_MULTIPORT_EITHER XT_MULTIPORT_EITHER
9
10#define IPT_MULTI_PORTS XT_MULTI_PORTS
11
12#define ipt_multiport xt_multiport
13#define ipt_multiport_v1 xt_multiport_v1
14
15#endif /*_IPT_MULTIPORT_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_owner.h b/include/linux/netfilter_ipv4/ipt_owner.h
deleted file mode 100644
index a78445be9992..000000000000
--- a/include/linux/netfilter_ipv4/ipt_owner.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _IPT_OWNER_H
2#define _IPT_OWNER_H
3
4/* match and invert flags */
5#define IPT_OWNER_UID 0x01
6#define IPT_OWNER_GID 0x02
7#define IPT_OWNER_PID 0x04
8#define IPT_OWNER_SID 0x08
9#define IPT_OWNER_COMM 0x10
10
11struct ipt_owner_info {
12 __kernel_uid32_t uid;
13 __kernel_gid32_t gid;
14 __kernel_pid_t pid;
15 __kernel_pid_t sid;
16 char comm[16];
17 u_int8_t match, invert; /* flags */
18};
19
20#endif /*_IPT_OWNER_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_physdev.h b/include/linux/netfilter_ipv4/ipt_physdev.h
deleted file mode 100644
index 2400e7140f26..000000000000
--- a/include/linux/netfilter_ipv4/ipt_physdev.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _IPT_PHYSDEV_H
2#define _IPT_PHYSDEV_H
3
4/* Backwards compatibility for old userspace */
5
6#include <linux/netfilter/xt_physdev.h>
7
8#define IPT_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN
9#define IPT_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT
10#define IPT_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED
11#define IPT_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN
12#define IPT_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT
13#define IPT_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK
14
15#define ipt_physdev_info xt_physdev_info
16
17#endif /*_IPT_PHYSDEV_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_pkttype.h b/include/linux/netfilter_ipv4/ipt_pkttype.h
deleted file mode 100644
index ff1fbc949a0c..000000000000
--- a/include/linux/netfilter_ipv4/ipt_pkttype.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IPT_PKTTYPE_H
2#define _IPT_PKTTYPE_H
3
4#include <linux/netfilter/xt_pkttype.h>
5#define ipt_pkttype_info xt_pkttype_info
6
7#endif /*_IPT_PKTTYPE_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h
deleted file mode 100644
index 1037fb2cd206..000000000000
--- a/include/linux/netfilter_ipv4/ipt_policy.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef _IPT_POLICY_H
2#define _IPT_POLICY_H
3
4#include <linux/netfilter/xt_policy.h>
5
6#define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
7
8/* ipt_policy_flags */
9#define IPT_POLICY_MATCH_IN XT_POLICY_MATCH_IN
10#define IPT_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT
11#define IPT_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE
12#define IPT_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT
13
14/* ipt_policy_modes */
15#define IPT_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT
16#define IPT_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL
17
18#define ipt_policy_spec xt_policy_spec
19#define ipt_policy_addr xt_policy_addr
20#define ipt_policy_elem xt_policy_elem
21#define ipt_policy_info xt_policy_info
22
23#endif /* _IPT_POLICY_H */
diff --git a/include/linux/netfilter_ipv4/ipt_recent.h b/include/linux/netfilter_ipv4/ipt_recent.h
deleted file mode 100644
index d636cca133c2..000000000000
--- a/include/linux/netfilter_ipv4/ipt_recent.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef _IPT_RECENT_H
2#define _IPT_RECENT_H
3
4#include <linux/netfilter/xt_recent.h>
5
6#define ipt_recent_info xt_recent_mtinfo
7
8enum {
9 IPT_RECENT_CHECK = XT_RECENT_CHECK,
10 IPT_RECENT_SET = XT_RECENT_SET,
11 IPT_RECENT_UPDATE = XT_RECENT_UPDATE,
12 IPT_RECENT_REMOVE = XT_RECENT_REMOVE,
13 IPT_RECENT_TTL = XT_RECENT_TTL,
14
15 IPT_RECENT_SOURCE = XT_RECENT_SOURCE,
16 IPT_RECENT_DEST = XT_RECENT_DEST,
17
18 IPT_RECENT_NAME_LEN = XT_RECENT_NAME_LEN,
19};
20
21#endif /*_IPT_RECENT_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_sctp.h b/include/linux/netfilter_ipv4/ipt_sctp.h
deleted file mode 100644
index 80b3dbacd193..000000000000
--- a/include/linux/netfilter_ipv4/ipt_sctp.h
+++ /dev/null
@@ -1,105 +0,0 @@
1#ifndef _IPT_SCTP_H_
2#define _IPT_SCTP_H_
3
4#define IPT_SCTP_SRC_PORTS 0x01
5#define IPT_SCTP_DEST_PORTS 0x02
6#define IPT_SCTP_CHUNK_TYPES 0x04
7
8#define IPT_SCTP_VALID_FLAGS 0x07
9
10
11struct ipt_sctp_flag_info {
12 u_int8_t chunktype;
13 u_int8_t flag;
14 u_int8_t flag_mask;
15};
16
17#define IPT_NUM_SCTP_FLAGS 4
18
19struct ipt_sctp_info {
20 u_int16_t dpts[2]; /* Min, Max */
21 u_int16_t spts[2]; /* Min, Max */
22
23 u_int32_t chunkmap[256 / sizeof (u_int32_t)]; /* Bit mask of chunks to be matched according to RFC 2960 */
24
25#define SCTP_CHUNK_MATCH_ANY 0x01 /* Match if any of the chunk types are present */
26#define SCTP_CHUNK_MATCH_ALL 0x02 /* Match if all of the chunk types are present */
27#define SCTP_CHUNK_MATCH_ONLY 0x04 /* Match if these are the only chunk types present */
28
29 u_int32_t chunk_match_type;
30 struct ipt_sctp_flag_info flag_info[IPT_NUM_SCTP_FLAGS];
31 int flag_count;
32
33 u_int32_t flags;
34 u_int32_t invflags;
35};
36
37#define bytes(type) (sizeof(type) * 8)
38
39#define SCTP_CHUNKMAP_SET(chunkmap, type) \
40 do { \
41 chunkmap[type / bytes(u_int32_t)] |= \
42 1 << (type % bytes(u_int32_t)); \
43 } while (0)
44
45#define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
46 do { \
47 chunkmap[type / bytes(u_int32_t)] &= \
48 ~(1 << (type % bytes(u_int32_t))); \
49 } while (0)
50
51#define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
52({ \
53 (chunkmap[type / bytes (u_int32_t)] & \
54 (1 << (type % bytes (u_int32_t)))) ? 1: 0; \
55})
56
57#define SCTP_CHUNKMAP_RESET(chunkmap) \
58 do { \
59 int i; \
60 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
61 chunkmap[i] = 0; \
62 } while (0)
63
64#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
65 do { \
66 int i; \
67 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
68 chunkmap[i] = ~0; \
69 } while (0)
70
71#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
72 do { \
73 int i; \
74 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
75 destmap[i] = srcmap[i]; \
76 } while (0)
77
78#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \
79({ \
80 int i; \
81 int flag = 1; \
82 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
83 if (chunkmap[i]) { \
84 flag = 0; \
85 break; \
86 } \
87 } \
88 flag; \
89})
90
91#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \
92({ \
93 int i; \
94 int flag = 1; \
95 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
96 if (chunkmap[i] != ~0) { \
97 flag = 0; \
98 break; \
99 } \
100 } \
101 flag; \
102})
103
104#endif /* _IPT_SCTP_H_ */
105
diff --git a/include/linux/netfilter_ipv4/ipt_state.h b/include/linux/netfilter_ipv4/ipt_state.h
deleted file mode 100644
index a44a99cc28cc..000000000000
--- a/include/linux/netfilter_ipv4/ipt_state.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef _IPT_STATE_H
2#define _IPT_STATE_H
3
4/* Backwards compatibility for old userspace */
5
6#include <linux/netfilter/xt_state.h>
7
8#define IPT_STATE_BIT XT_STATE_BIT
9#define IPT_STATE_INVALID XT_STATE_INVALID
10
11#define IPT_STATE_UNTRACKED XT_STATE_UNTRACKED
12
13#define ipt_state_info xt_state_info
14
15#endif /*_IPT_STATE_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_string.h b/include/linux/netfilter_ipv4/ipt_string.h
deleted file mode 100644
index c26de3059903..000000000000
--- a/include/linux/netfilter_ipv4/ipt_string.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _IPT_STRING_H
2#define _IPT_STRING_H
3
4#include <linux/netfilter/xt_string.h>
5
6#define IPT_STRING_MAX_PATTERN_SIZE XT_STRING_MAX_PATTERN_SIZE
7#define IPT_STRING_MAX_ALGO_NAME_SIZE XT_STRING_MAX_ALGO_NAME_SIZE
8#define ipt_string_info xt_string_info
9
10#endif /*_IPT_STRING_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_tcpmss.h b/include/linux/netfilter_ipv4/ipt_tcpmss.h
deleted file mode 100644
index 18bbc8e8e009..000000000000
--- a/include/linux/netfilter_ipv4/ipt_tcpmss.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IPT_TCPMSS_MATCH_H
2#define _IPT_TCPMSS_MATCH_H
3
4#include <linux/netfilter/xt_tcpmss.h>
5#define ipt_tcpmss_match_info xt_tcpmss_match_info
6
7#endif /*_IPT_TCPMSS_MATCH_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_tos.h b/include/linux/netfilter_ipv4/ipt_tos.h
deleted file mode 100644
index a21f5df23c50..000000000000
--- a/include/linux/netfilter_ipv4/ipt_tos.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _IPT_TOS_H
2#define _IPT_TOS_H
3
4struct ipt_tos_info {
5 u_int8_t tos;
6 u_int8_t invert;
7};
8
9#ifndef IPTOS_NORMALSVC
10#define IPTOS_NORMALSVC 0
11#endif
12
13#endif /*_IPT_TOS_H*/
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild
index aca4bd1f6d7c..e864eaee9e5e 100644
--- a/include/linux/netfilter_ipv6/Kbuild
+++ b/include/linux/netfilter_ipv6/Kbuild
@@ -1,22 +1,12 @@
1header-y += ip6t_HL.h 1header-y += ip6t_HL.h
2header-y += ip6t_LOG.h 2header-y += ip6t_LOG.h
3header-y += ip6t_MARK.h
4header-y += ip6t_REJECT.h 3header-y += ip6t_REJECT.h
5header-y += ip6t_ah.h 4header-y += ip6t_ah.h
6header-y += ip6t_esp.h
7header-y += ip6t_frag.h 5header-y += ip6t_frag.h
8header-y += ip6t_hl.h
9header-y += ip6t_ipv6header.h 6header-y += ip6t_ipv6header.h
10header-y += ip6t_length.h 7header-y += ip6t_hl.h
11header-y += ip6t_limit.h
12header-y += ip6t_mac.h
13header-y += ip6t_mark.h
14header-y += ip6t_mh.h 8header-y += ip6t_mh.h
15header-y += ip6t_multiport.h
16header-y += ip6t_opts.h 9header-y += ip6t_opts.h
17header-y += ip6t_owner.h
18header-y += ip6t_physdev.h
19header-y += ip6t_policy.h
20header-y += ip6t_rt.h 10header-y += ip6t_rt.h
21 11
22unifdef-y += ip6_tables.h 12unifdef-y += ip6_tables.h
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 1089e33cf633..a64e1451ac38 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -306,7 +306,7 @@ ip6t_get_target(struct ip6t_entry *e)
306extern void ip6t_init(void) __init; 306extern void ip6t_init(void) __init;
307 307
308extern struct xt_table *ip6t_register_table(struct net *net, 308extern struct xt_table *ip6t_register_table(struct net *net,
309 struct xt_table *table, 309 const struct xt_table *table,
310 const struct ip6t_replace *repl); 310 const struct ip6t_replace *repl);
311extern void ip6t_unregister_table(struct xt_table *table); 311extern void ip6t_unregister_table(struct xt_table *table);
312extern unsigned int ip6t_do_table(struct sk_buff *skb, 312extern unsigned int ip6t_do_table(struct sk_buff *skb,
diff --git a/include/linux/netfilter_ipv6/ip6t_MARK.h b/include/linux/netfilter_ipv6/ip6t_MARK.h
deleted file mode 100644
index 7cf629a8ab92..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_MARK.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _IP6T_MARK_H_target
2#define _IP6T_MARK_H_target
3
4/* Backwards compatibility for old userspace */
5#include <linux/netfilter/xt_MARK.h>
6
7#define ip6t_mark_target_info xt_mark_target_info
8
9#endif /*_IP6T_MARK_H_target*/
diff --git a/include/linux/netfilter_ipv6/ip6t_esp.h b/include/linux/netfilter_ipv6/ip6t_esp.h
deleted file mode 100644
index f62eaf53c16c..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_esp.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _IP6T_ESP_H
2#define _IP6T_ESP_H
3
4#include <linux/netfilter/xt_esp.h>
5
6#define ip6t_esp xt_esp
7#define IP6T_ESP_INV_SPI XT_ESP_INV_SPI
8#define IP6T_ESP_INV_MASK XT_ESP_INV_MASK
9
10#endif /*_IP6T_ESP_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_length.h b/include/linux/netfilter_ipv6/ip6t_length.h
deleted file mode 100644
index 9e9689d03ed7..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_length.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _IP6T_LENGTH_H
2#define _IP6T_LENGTH_H
3
4#include <linux/netfilter/xt_length.h>
5#define ip6t_length_info xt_length_info
6
7#endif /*_IP6T_LENGTH_H*/
8
diff --git a/include/linux/netfilter_ipv6/ip6t_limit.h b/include/linux/netfilter_ipv6/ip6t_limit.h
deleted file mode 100644
index 487e5ea342c6..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_limit.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _IP6T_RATE_H
2#define _IP6T_RATE_H
3
4#include <linux/netfilter/xt_limit.h>
5#define IP6T_LIMIT_SCALE XT_LIMIT_SCALE
6#define ip6t_rateinfo xt_rateinfo
7
8#endif /*_IP6T_RATE_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_mac.h b/include/linux/netfilter_ipv6/ip6t_mac.h
deleted file mode 100644
index ac58e83e9423..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_mac.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _IP6T_MAC_H
2#define _IP6T_MAC_H
3
4#include <linux/netfilter/xt_mac.h>
5#define ip6t_mac_info xt_mac_info
6
7#endif /*_IP6T_MAC_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_mark.h b/include/linux/netfilter_ipv6/ip6t_mark.h
deleted file mode 100644
index ff204951ddc3..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_mark.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _IP6T_MARK_H
2#define _IP6T_MARK_H
3
4/* Backwards compatibility for old userspace */
5#include <linux/netfilter/xt_mark.h>
6
7#define ip6t_mark_info xt_mark_info
8
9#endif /*_IPT_MARK_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_multiport.h b/include/linux/netfilter_ipv6/ip6t_multiport.h
deleted file mode 100644
index 042c92661cee..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_multiport.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef _IP6T_MULTIPORT_H
2#define _IP6T_MULTIPORT_H
3
4#include <linux/netfilter/xt_multiport.h>
5
6#define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
7#define IP6T_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
8#define IP6T_MULTIPORT_EITHER XT_MULTIPORT_EITHER
9
10#define IP6T_MULTI_PORTS XT_MULTI_PORTS
11
12#define ip6t_multiport xt_multiport
13
14#endif /*_IP6T_MULTIPORT_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_owner.h b/include/linux/netfilter_ipv6/ip6t_owner.h
deleted file mode 100644
index ec5cc7a38c42..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_owner.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef _IP6T_OWNER_H
2#define _IP6T_OWNER_H
3
4/* match and invert flags */
5#define IP6T_OWNER_UID 0x01
6#define IP6T_OWNER_GID 0x02
7#define IP6T_OWNER_PID 0x04
8#define IP6T_OWNER_SID 0x08
9
10struct ip6t_owner_info {
11 __kernel_uid32_t uid;
12 __kernel_gid32_t gid;
13 __kernel_pid_t pid;
14 __kernel_pid_t sid;
15 u_int8_t match, invert; /* flags */
16};
17
18#endif /*_IPT_OWNER_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_physdev.h b/include/linux/netfilter_ipv6/ip6t_physdev.h
deleted file mode 100644
index c161c0a81b55..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_physdev.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _IP6T_PHYSDEV_H
2#define _IP6T_PHYSDEV_H
3
4/* Backwards compatibility for old userspace */
5
6#include <linux/netfilter/xt_physdev.h>
7
8#define IP6T_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN
9#define IP6T_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT
10#define IP6T_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED
11#define IP6T_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN
12#define IP6T_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT
13#define IP6T_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK
14
15#define ip6t_physdev_info xt_physdev_info
16
17#endif /*_IP6T_PHYSDEV_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h
deleted file mode 100644
index b1c449d7ec89..000000000000
--- a/include/linux/netfilter_ipv6/ip6t_policy.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef _IP6T_POLICY_H
2#define _IP6T_POLICY_H
3
4#include <linux/netfilter/xt_policy.h>
5
6#define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM
7
8/* ip6t_policy_flags */
9#define IP6T_POLICY_MATCH_IN XT_POLICY_MATCH_IN
10#define IP6T_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT
11#define IP6T_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE
12#define IP6T_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT
13
14/* ip6t_policy_modes */
15#define IP6T_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT
16#define IP6T_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL
17
18#define ip6t_policy_spec xt_policy_spec
19#define ip6t_policy_addr xt_policy_addr
20#define ip6t_policy_elem xt_policy_elem
21#define ip6t_policy_info xt_policy_info
22
23#endif /* _IP6T_POLICY_H */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 5ba398e90304..080f6ba9e73a 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -176,12 +176,16 @@ struct netlink_skb_parms
176#define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) 176#define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds)
177 177
178 178
179extern void netlink_table_grab(void);
180extern void netlink_table_ungrab(void);
181
179extern struct sock *netlink_kernel_create(struct net *net, 182extern struct sock *netlink_kernel_create(struct net *net,
180 int unit,unsigned int groups, 183 int unit,unsigned int groups,
181 void (*input)(struct sk_buff *skb), 184 void (*input)(struct sk_buff *skb),
182 struct mutex *cb_mutex, 185 struct mutex *cb_mutex,
183 struct module *module); 186 struct module *module);
184extern void netlink_kernel_release(struct sock *sk); 187extern void netlink_kernel_release(struct sock *sk);
188extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
185extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 189extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
186extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); 190extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
187extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 191extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
@@ -217,12 +221,13 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
217 221
218struct netlink_callback 222struct netlink_callback
219{ 223{
220 struct sk_buff *skb; 224 struct sk_buff *skb;
221 struct nlmsghdr *nlh; 225 const struct nlmsghdr *nlh;
222 int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); 226 int (*dump)(struct sk_buff * skb,
223 int (*done)(struct netlink_callback *cb); 227 struct netlink_callback *cb);
224 int family; 228 int (*done)(struct netlink_callback *cb);
225 long args[6]; 229 int family;
230 long args[6];
226}; 231};
227 232
228struct netlink_notify 233struct netlink_notify
@@ -258,7 +263,7 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
258 NLMSG_NEW(skb, pid, seq, type, len, 0) 263 NLMSG_NEW(skb, pid, seq, type, len, 0)
259 264
260extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, 265extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
261 struct nlmsghdr *nlh, 266 const struct nlmsghdr *nlh,
262 int (*dump)(struct sk_buff *skb, struct netlink_callback*), 267 int (*dump)(struct sk_buff *skb, struct netlink_callback*),
263 int (*done)(struct netlink_callback*)); 268 int (*done)(struct netlink_callback*));
264 269
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index dbea93b694e5..a8d71ed43a0e 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -242,6 +242,29 @@
242 * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is 242 * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is
243 * determined by the network interface. 243 * determined by the network interface.
244 * 244 *
245 * @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute
246 * to identify the device, and the TESTDATA blob attribute to pass through
247 * to the driver.
248 *
249 * @NL80211_CMD_CONNECT: connection request and notification; this command
250 * requests to connect to a specified network but without separating
251 * auth and assoc steps. For this, you need to specify the SSID in a
252 * %NL80211_ATTR_SSID attribute, and can optionally specify the association
253 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,
254 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT.
255 * It is also sent as an event, with the BSSID and response IEs when the
256 * connection is established or failed to be established. This can be
257 * determined by the STATUS_CODE attribute.
258 * @NL80211_CMD_ROAM: request that the card roam (currently not implemented),
259 * sent as an event when the card/driver roamed by itself.
260 * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
261 * userspace that a connection was dropped by the AP or due to other
262 * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
263 * %NL80211_ATTR_REASON_CODE attributes are used.
264 *
265 * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
266 * associated with this wiphy must be down and will follow.
267 *
245 * @NL80211_CMD_MAX: highest used command number 268 * @NL80211_CMD_MAX: highest used command number
246 * @__NL80211_CMD_AFTER_LAST: internal use 269 * @__NL80211_CMD_AFTER_LAST: internal use
247 */ 270 */
@@ -310,6 +333,14 @@ enum nl80211_commands {
310 NL80211_CMD_JOIN_IBSS, 333 NL80211_CMD_JOIN_IBSS,
311 NL80211_CMD_LEAVE_IBSS, 334 NL80211_CMD_LEAVE_IBSS,
312 335
336 NL80211_CMD_TESTMODE,
337
338 NL80211_CMD_CONNECT,
339 NL80211_CMD_ROAM,
340 NL80211_CMD_DISCONNECT,
341
342 NL80211_CMD_SET_WIPHY_NETNS,
343
313 /* add new commands above here */ 344 /* add new commands above here */
314 345
315 /* used to define NL80211_CMD_MAX below */ 346 /* used to define NL80211_CMD_MAX below */
@@ -449,10 +480,6 @@ enum nl80211_commands {
449 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) 480 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
450 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive 481 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
451 * scanning and include a zero-length SSID (wildcard) for wildcard scan 482 * scanning and include a zero-length SSID (wildcard) for wildcard scan
452 * @NL80211_ATTR_SCAN_GENERATION: the scan generation increases whenever the
453 * scan result list changes (BSS expired or added) so that applications
454 * can verify that they got a single, consistent snapshot (when all dump
455 * messages carried the same generation number)
456 * @NL80211_ATTR_BSS: scan result BSS 483 * @NL80211_ATTR_BSS: scan result BSS
457 * 484 *
458 * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain 485 * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain
@@ -511,6 +538,52 @@ enum nl80211_commands {
511 * authorized by user space. Otherwise, port is marked authorized by 538 * authorized by user space. Otherwise, port is marked authorized by
512 * default in station mode. 539 * default in station mode.
513 * 540 *
541 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
542 * We recommend using nested, driver-specific attributes within this.
543 *
544 * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT
545 * event was due to the AP disconnecting the station, and not due to
546 * a local disconnect request.
547 * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT
548 * event (u16)
549 * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating
550 * that protected APs should be used.
551 *
552 * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT and ASSOCIATE to
553 * indicate which unicast key ciphers will be used with the connection
554 * (an array of u32).
555 * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT and ASSOCIATE to indicate
556 * which group key cipher will be used with the connection (a u32).
557 * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT and ASSOCIATE to indicate
558 * which WPA version(s) the AP we want to associate with is using
559 * (a u32 with flags from &enum nl80211_wpa_versions).
560 * @NL80211_ATTR_AKM_SUITES: Used with CONNECT and ASSOCIATE to indicate
561 * which key management algorithm(s) to use (an array of u32).
562 *
563 * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
564 * sent out by the card, for ROAM and successful CONNECT events.
565 * @NL80211_ATTR_RESP_IE: (Re)association response information elements as
566 * sent by peer, for ROAM and successful CONNECT events.
567 *
568 * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE
569 * commands to specify using a reassociate frame
570 *
571 * @NL80211_ATTR_KEY: key information in a nested attribute with
572 * %NL80211_KEY_* sub-attributes
573 * @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect()
574 * and join_ibss(), key information is in a nested attribute each
575 * with %NL80211_KEY_* sub-attributes
576 *
577 * @NL80211_ATTR_PID: Process ID of a network namespace.
578 *
579 * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for
580 * dumps. This number increases whenever the object list being
581 * dumped changes, and as such userspace can verify that it has
582 * obtained a complete and consistent snapshot by verifying that
583 * all dump messages contain the same generation number. If it
584 * changed then the list changed and the dump should be repeated
585 * completely from scratch.
586 *
514 * @NL80211_ATTR_MAX: highest attribute number currently defined 587 * @NL80211_ATTR_MAX: highest attribute number currently defined
515 * @__NL80211_ATTR_AFTER_LAST: internal use 588 * @__NL80211_ATTR_AFTER_LAST: internal use
516 */ 589 */
@@ -582,7 +655,7 @@ enum nl80211_attrs {
582 655
583 NL80211_ATTR_SCAN_FREQUENCIES, 656 NL80211_ATTR_SCAN_FREQUENCIES,
584 NL80211_ATTR_SCAN_SSIDS, 657 NL80211_ATTR_SCAN_SSIDS,
585 NL80211_ATTR_SCAN_GENERATION, 658 NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */
586 NL80211_ATTR_BSS, 659 NL80211_ATTR_BSS,
587 660
588 NL80211_ATTR_REG_INITIATOR, 661 NL80211_ATTR_REG_INITIATOR,
@@ -619,16 +692,42 @@ enum nl80211_attrs {
619 692
620 NL80211_ATTR_CONTROL_PORT, 693 NL80211_ATTR_CONTROL_PORT,
621 694
695 NL80211_ATTR_TESTDATA,
696
697 NL80211_ATTR_PRIVACY,
698
699 NL80211_ATTR_DISCONNECTED_BY_AP,
700 NL80211_ATTR_STATUS_CODE,
701
702 NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
703 NL80211_ATTR_CIPHER_SUITE_GROUP,
704 NL80211_ATTR_WPA_VERSIONS,
705 NL80211_ATTR_AKM_SUITES,
706
707 NL80211_ATTR_REQ_IE,
708 NL80211_ATTR_RESP_IE,
709
710 NL80211_ATTR_PREV_BSSID,
711
712 NL80211_ATTR_KEY,
713 NL80211_ATTR_KEYS,
714
715 NL80211_ATTR_PID,
716
622 /* add attributes here, update the policy in nl80211.c */ 717 /* add attributes here, update the policy in nl80211.c */
623 718
624 __NL80211_ATTR_AFTER_LAST, 719 __NL80211_ATTR_AFTER_LAST,
625 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 720 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
626}; 721};
627 722
723/* source-level API compatibility */
724#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
725
628/* 726/*
629 * Allow user space programs to use #ifdef on new attributes by defining them 727 * Allow user space programs to use #ifdef on new attributes by defining them
630 * here 728 * here
631 */ 729 */
730#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT
632#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY 731#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
633#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES 732#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
634#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS 733#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
@@ -642,6 +741,12 @@ enum nl80211_attrs {
642#define NL80211_ATTR_SSID NL80211_ATTR_SSID 741#define NL80211_ATTR_SSID NL80211_ATTR_SSID
643#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE 742#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE
644#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE 743#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE
744#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE
745#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP
746#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS
747#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES
748#define NL80211_ATTR_KEY NL80211_ATTR_KEY
749#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
645 750
646#define NL80211_MAX_SUPP_RATES 32 751#define NL80211_MAX_SUPP_RATES 32
647#define NL80211_MAX_SUPP_REG_RULES 32 752#define NL80211_MAX_SUPP_REG_RULES 32
@@ -650,6 +755,9 @@ enum nl80211_attrs {
650#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 755#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
651#define NL80211_HT_CAPABILITY_LEN 26 756#define NL80211_HT_CAPABILITY_LEN 26
652 757
758#define NL80211_MAX_NR_CIPHER_SUITES 5
759#define NL80211_MAX_NR_AKM_SUITES 2
760
653/** 761/**
654 * enum nl80211_iftype - (virtual) interface types 762 * enum nl80211_iftype - (virtual) interface types
655 * 763 *
@@ -1168,6 +1276,7 @@ enum nl80211_channel_type {
1168 * in mBm (100 * dBm) (s32) 1276 * in mBm (100 * dBm) (s32)
1169 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon 1277 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
1170 * in unspecified units, scaled to 0..100 (u8) 1278 * in unspecified units, scaled to 0..100 (u8)
1279 * @NL80211_BSS_STATUS: status, if this BSS is "used"
1171 * @__NL80211_BSS_AFTER_LAST: internal 1280 * @__NL80211_BSS_AFTER_LAST: internal
1172 * @NL80211_BSS_MAX: highest BSS attribute 1281 * @NL80211_BSS_MAX: highest BSS attribute
1173 */ 1282 */
@@ -1181,6 +1290,7 @@ enum nl80211_bss {
1181 NL80211_BSS_INFORMATION_ELEMENTS, 1290 NL80211_BSS_INFORMATION_ELEMENTS,
1182 NL80211_BSS_SIGNAL_MBM, 1291 NL80211_BSS_SIGNAL_MBM,
1183 NL80211_BSS_SIGNAL_UNSPEC, 1292 NL80211_BSS_SIGNAL_UNSPEC,
1293 NL80211_BSS_STATUS,
1184 1294
1185 /* keep last */ 1295 /* keep last */
1186 __NL80211_BSS_AFTER_LAST, 1296 __NL80211_BSS_AFTER_LAST,
@@ -1188,18 +1298,37 @@ enum nl80211_bss {
1188}; 1298};
1189 1299
1190/** 1300/**
1301 * enum nl80211_bss_status - BSS "status"
1302 */
1303enum nl80211_bss_status {
1304 NL80211_BSS_STATUS_AUTHENTICATED,
1305 NL80211_BSS_STATUS_ASSOCIATED,
1306 NL80211_BSS_STATUS_IBSS_JOINED,
1307};
1308
1309/**
1191 * enum nl80211_auth_type - AuthenticationType 1310 * enum nl80211_auth_type - AuthenticationType
1192 * 1311 *
1193 * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication 1312 * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication
1194 * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) 1313 * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
1195 * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) 1314 * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
1196 * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) 1315 * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
1316 * @__NL80211_AUTHTYPE_NUM: internal
1317 * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
1318 * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
1319 * trying multiple times); this is invalid in netlink -- leave out
1320 * the attribute for this on CONNECT commands.
1197 */ 1321 */
1198enum nl80211_auth_type { 1322enum nl80211_auth_type {
1199 NL80211_AUTHTYPE_OPEN_SYSTEM, 1323 NL80211_AUTHTYPE_OPEN_SYSTEM,
1200 NL80211_AUTHTYPE_SHARED_KEY, 1324 NL80211_AUTHTYPE_SHARED_KEY,
1201 NL80211_AUTHTYPE_FT, 1325 NL80211_AUTHTYPE_FT,
1202 NL80211_AUTHTYPE_NETWORK_EAP, 1326 NL80211_AUTHTYPE_NETWORK_EAP,
1327
1328 /* keep last */
1329 __NL80211_AUTHTYPE_NUM,
1330 NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1,
1331 NL80211_AUTHTYPE_AUTOMATIC
1203}; 1332};
1204 1333
1205/** 1334/**
@@ -1224,4 +1353,39 @@ enum nl80211_mfp {
1224 NL80211_MFP_REQUIRED, 1353 NL80211_MFP_REQUIRED,
1225}; 1354};
1226 1355
1356enum nl80211_wpa_versions {
1357 NL80211_WPA_VERSION_1 = 1 << 0,
1358 NL80211_WPA_VERSION_2 = 1 << 1,
1359};
1360
1361/**
1362 * enum nl80211_key_attributes - key attributes
1363 * @__NL80211_KEY_INVALID: invalid
1364 * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of
1365 * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
1366 * keys
1367 * @NL80211_KEY_IDX: key ID (u8, 0-3)
1368 * @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
1369 * section 7.3.2.25.1, e.g. 0x000FAC04)
1370 * @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
1371 * CCMP keys, each six bytes in little endian
1372 * @NL80211_KEY_DEFAULT: flag indicating default key
1373 * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
1374 * @__NL80211_KEY_AFTER_LAST: internal
1375 * @NL80211_KEY_MAX: highest key attribute
1376 */
1377enum nl80211_key_attributes {
1378 __NL80211_KEY_INVALID,
1379 NL80211_KEY_DATA,
1380 NL80211_KEY_IDX,
1381 NL80211_KEY_CIPHER,
1382 NL80211_KEY_SEQ,
1383 NL80211_KEY_DEFAULT,
1384 NL80211_KEY_DEFAULT_MGMT,
1385
1386 /* keep last */
1387 __NL80211_KEY_AFTER_LAST,
1388 NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1
1389};
1390
1227#endif /* __LINUX_NL80211_H */ 1391#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h
index 2cda00ccfcca..b7d9435d5a9f 100644
--- a/include/linux/nl802154.h
+++ b/include/linux/nl802154.h
@@ -64,12 +64,14 @@ enum {
64 IEEE802154_ATTR_COORD_REALIGN, 64 IEEE802154_ATTR_COORD_REALIGN,
65 IEEE802154_ATTR_SEC, 65 IEEE802154_ATTR_SEC,
66 66
67 IEEE802154_ATTR_PAGE,
68
67 __IEEE802154_ATTR_MAX, 69 __IEEE802154_ATTR_MAX,
68}; 70};
69 71
70#define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1) 72#define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1)
71 73
72extern struct nla_policy ieee802154_policy[]; 74extern const struct nla_policy ieee802154_policy[];
73 75
74/* commands */ 76/* commands */
75/* REQ should be responded with CONF 77/* REQ should be responded with CONF
@@ -111,6 +113,8 @@ enum {
111 IEEE802154_RX_ENABLE_REQ, /* Not supported yet */ 113 IEEE802154_RX_ENABLE_REQ, /* Not supported yet */
112 IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ 114 IEEE802154_RX_ENABLE_CONF, /* Not supported yet */
113 115
116 IEEE802154_LIST_IFACE,
117
114 __IEEE802154_CMD_MAX, 118 __IEEE802154_CMD_MAX,
115}; 119};
116 120
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 81bc252dc8ac..44428d247dbe 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -199,6 +199,8 @@ static inline int notifier_to_errno(int ret)
199#define NETDEV_FEAT_CHANGE 0x000B 199#define NETDEV_FEAT_CHANGE 0x000B
200#define NETDEV_BONDING_FAILOVER 0x000C 200#define NETDEV_BONDING_FAILOVER 0x000C
201#define NETDEV_PRE_UP 0x000D 201#define NETDEV_PRE_UP 0x000D
202#define NETDEV_BONDING_OLDTYPE 0x000E
203#define NETDEV_BONDING_NEWTYPE 0x000F
202 204
203#define SYS_DOWN 0x0001 /* Notify of system down */ 205#define SYS_DOWN 0x0001 /* Notify of system down */
204#define SYS_RESTART SYS_DOWN 206#define SYS_RESTART SYS_DOWN
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index e2e5ce543595..2b87acfc5f87 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -99,7 +99,7 @@ enum pageflags {
99#ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT 99#ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT
100 PG_mlocked, /* Page is vma mlocked */ 100 PG_mlocked, /* Page is vma mlocked */
101#endif 101#endif
102#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR 102#ifdef CONFIG_ARCH_USES_PG_UNCACHED
103 PG_uncached, /* Page has been mapped as uncached */ 103 PG_uncached, /* Page has been mapped as uncached */
104#endif 104#endif
105 __NR_PAGEFLAGS, 105 __NR_PAGEFLAGS,
@@ -257,7 +257,7 @@ PAGEFLAG_FALSE(Mlocked)
257 SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked) 257 SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked)
258#endif 258#endif
259 259
260#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR 260#ifdef CONFIG_ARCH_USES_PG_UNCACHED
261PAGEFLAG(Uncached, uncached) 261PAGEFLAG(Uncached, uncached)
262#else 262#else
263PAGEFLAG_FALSE(Uncached) 263PAGEFLAG_FALSE(Uncached)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 115fb7ba5089..f5c7cd343e56 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -241,6 +241,7 @@ struct pci_dev {
241 unsigned int d1_support:1; /* Low power state D1 is supported */ 241 unsigned int d1_support:1; /* Low power state D1 is supported */
242 unsigned int d2_support:1; /* Low power state D2 is supported */ 242 unsigned int d2_support:1; /* Low power state D2 is supported */
243 unsigned int no_d1d2:1; /* Only allow D0 and D3 */ 243 unsigned int no_d1d2:1; /* Only allow D0 and D3 */
244 unsigned int wakeup_prepared:1;
244 245
245#ifdef CONFIG_PCIEASPM 246#ifdef CONFIG_PCIEASPM
246 struct pcie_link_state *link_state; /* ASPM link state. */ 247 struct pcie_link_state *link_state; /* ASPM link state. */
@@ -273,9 +274,12 @@ struct pci_dev {
273 unsigned int ari_enabled:1; /* ARI forwarding */ 274 unsigned int ari_enabled:1; /* ARI forwarding */
274 unsigned int is_managed:1; 275 unsigned int is_managed:1;
275 unsigned int is_pcie:1; 276 unsigned int is_pcie:1;
277 unsigned int needs_freset:1; /* Dev requires fundamental reset */
276 unsigned int state_saved:1; 278 unsigned int state_saved:1;
277 unsigned int is_physfn:1; 279 unsigned int is_physfn:1;
278 unsigned int is_virtfn:1; 280 unsigned int is_virtfn:1;
281 unsigned int reset_fn:1;
282 unsigned int is_hotplug_bridge:1;
279 pci_dev_flags_t dev_flags; 283 pci_dev_flags_t dev_flags;
280 atomic_t enable_cnt; /* pci_enable_device has been called */ 284 atomic_t enable_cnt; /* pci_enable_device has been called */
281 285
@@ -794,6 +798,11 @@ int __must_check __pci_register_driver(struct pci_driver *, struct module *,
794void pci_unregister_driver(struct pci_driver *dev); 798void pci_unregister_driver(struct pci_driver *dev);
795void pci_remove_behind_bridge(struct pci_dev *dev); 799void pci_remove_behind_bridge(struct pci_dev *dev);
796struct pci_driver *pci_dev_driver(const struct pci_dev *dev); 800struct pci_driver *pci_dev_driver(const struct pci_dev *dev);
801int pci_add_dynid(struct pci_driver *drv,
802 unsigned int vendor, unsigned int device,
803 unsigned int subvendor, unsigned int subdevice,
804 unsigned int class, unsigned int class_mask,
805 unsigned long driver_data);
797const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, 806const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
798 struct pci_dev *dev); 807 struct pci_dev *dev);
799int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, 808int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
@@ -805,6 +814,8 @@ int pci_cfg_space_size_ext(struct pci_dev *dev);
805int pci_cfg_space_size(struct pci_dev *dev); 814int pci_cfg_space_size(struct pci_dev *dev);
806unsigned char pci_bus_max_busnr(struct pci_bus *bus); 815unsigned char pci_bus_max_busnr(struct pci_bus *bus);
807 816
817int pci_set_vga_state(struct pci_dev *pdev, bool decode,
818 unsigned int command_bits, bool change_bridge);
808/* kmem_cache style wrapper around pci_alloc_consistent() */ 819/* kmem_cache style wrapper around pci_alloc_consistent() */
809 820
810#include <linux/dmapool.h> 821#include <linux/dmapool.h>
@@ -1236,6 +1247,9 @@ extern int pci_pci_problems;
1236extern unsigned long pci_cardbus_io_size; 1247extern unsigned long pci_cardbus_io_size;
1237extern unsigned long pci_cardbus_mem_size; 1248extern unsigned long pci_cardbus_mem_size;
1238 1249
1250extern unsigned long pci_hotplug_io_size;
1251extern unsigned long pci_hotplug_mem_size;
1252
1239int pcibios_add_platform_entries(struct pci_dev *dev); 1253int pcibios_add_platform_entries(struct pci_dev *dev);
1240void pcibios_disable_device(struct pci_dev *dev); 1254void pcibios_disable_device(struct pci_dev *dev);
1241int pcibios_set_pcie_reset_state(struct pci_dev *dev, 1255int pcibios_set_pcie_reset_state(struct pci_dev *dev,
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 4391741b99dc..652ba797696d 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -62,7 +62,8 @@ enum pcie_link_width {
62}; 62};
63 63
64enum pcie_link_speed { 64enum pcie_link_speed {
65 PCIE_2PT5GB = 0x14, 65 PCIE_2_5GB = 0x14,
66 PCIE_5_0GB = 0x15,
66 PCIE_LNK_SPEED_UNKNOWN = 0xFF, 67 PCIE_LNK_SPEED_UNKNOWN = 0xFF,
67}; 68};
68 69
@@ -226,11 +227,18 @@ struct hotplug_params {
226#ifdef CONFIG_ACPI 227#ifdef CONFIG_ACPI
227#include <acpi/acpi.h> 228#include <acpi/acpi.h>
228#include <acpi/acpi_bus.h> 229#include <acpi/acpi_bus.h>
229extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, 230int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp);
230 struct hotplug_params *hpp);
231int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); 231int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags);
232int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); 232int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle);
233int acpi_pci_detect_ejectable(struct pci_bus *pbus); 233int acpi_pci_detect_ejectable(acpi_handle handle);
234#else
235static inline int pci_get_hp_params(struct pci_dev *dev,
236 struct hotplug_params *hpp)
237{
238 return -ENODEV;
239}
234#endif 240#endif
241
242void pci_configure_slot(struct pci_dev *dev);
235#endif 243#endif
236 244
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c8fdcadce437..3b6b788fe2b5 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2,6 +2,9 @@
2 * PCI Class, Vendor and Device IDs 2 * PCI Class, Vendor and Device IDs
3 * 3 *
4 * Please keep sorted. 4 * Please keep sorted.
5 *
6 * Do not add new entries to this file unless the definitions
7 * are shared between multiple drivers.
5 */ 8 */
6 9
7/* Device classes and subclasses */ 10/* Device classes and subclasses */
@@ -881,6 +884,7 @@
881#define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051 884#define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051
882#define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058 885#define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058
883#define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059 886#define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059
887#define PCI_DEVICE_ID_APPLE_U4_PCIE 0x005b
884#define PCI_DEVICE_ID_APPLE_IPID2_AGP 0x0066 888#define PCI_DEVICE_ID_APPLE_IPID2_AGP 0x0066
885#define PCI_DEVICE_ID_APPLE_IPID2_ATA 0x0069 889#define PCI_DEVICE_ID_APPLE_IPID2_ATA 0x0069
886#define PCI_DEVICE_ID_APPLE_IPID2_FW 0x006a 890#define PCI_DEVICE_ID_APPLE_IPID2_FW 0x006a
@@ -1525,6 +1529,8 @@
1525#define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007 1529#define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007
1526#define PCI_DEVICE_ID_ARTOP_ATP865 0x0008 1530#define PCI_DEVICE_ID_ARTOP_ATP865 0x0008
1527#define PCI_DEVICE_ID_ARTOP_ATP865R 0x0009 1531#define PCI_DEVICE_ID_ARTOP_ATP865R 0x0009
1532#define PCI_DEVICE_ID_ARTOP_ATP867A 0x000A
1533#define PCI_DEVICE_ID_ARTOP_ATP867B 0x000B
1528#define PCI_DEVICE_ID_ARTOP_AEC7610 0x8002 1534#define PCI_DEVICE_ID_ARTOP_AEC7610 0x8002
1529#define PCI_DEVICE_ID_ARTOP_AEC7612UW 0x8010 1535#define PCI_DEVICE_ID_ARTOP_AEC7612UW 0x8010
1530#define PCI_DEVICE_ID_ARTOP_AEC7612U 0x8020 1536#define PCI_DEVICE_ID_ARTOP_AEC7612U 0x8020
@@ -1988,6 +1994,8 @@
1988 1994
1989#define PCI_VENDOR_ID_SAMSUNG 0x144d 1995#define PCI_VENDOR_ID_SAMSUNG 0x144d
1990 1996
1997#define PCI_VENDOR_ID_GIGABYTE 0x1458
1998
1991#define PCI_VENDOR_ID_AMBIT 0x1468 1999#define PCI_VENDOR_ID_AMBIT 0x1468
1992 2000
1993#define PCI_VENDOR_ID_MYRICOM 0x14c1 2001#define PCI_VENDOR_ID_MYRICOM 0x14c1
@@ -2066,7 +2074,6 @@
2066#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 2074#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
2067#define PCI_DEVICE_ID_TIGON3_5782 0x1696 2075#define PCI_DEVICE_ID_TIGON3_5782 0x1696
2068#define PCI_DEVICE_ID_TIGON3_5784 0x1698 2076#define PCI_DEVICE_ID_TIGON3_5784 0x1698
2069#define PCI_DEVICE_ID_TIGON3_5785 0x1699
2070#define PCI_DEVICE_ID_TIGON3_5786 0x169a 2077#define PCI_DEVICE_ID_TIGON3_5786 0x169a
2071#define PCI_DEVICE_ID_TIGON3_5787 0x169b 2078#define PCI_DEVICE_ID_TIGON3_5787 0x169b
2072#define PCI_DEVICE_ID_TIGON3_5788 0x169c 2079#define PCI_DEVICE_ID_TIGON3_5788 0x169c
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index fcaee42c7ac2..dd0bed4f1cf0 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -42,6 +42,7 @@
42#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ 42#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
43 43
44#define PCI_STATUS 0x06 /* 16 bits */ 44#define PCI_STATUS 0x06 /* 16 bits */
45#define PCI_STATUS_INTERRUPT 0x08 /* Interrupt status */
45#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ 46#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
46#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ 47#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
47#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ 48#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 68438e18fff4..9bd03193ecd4 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -10,22 +10,70 @@
10/* 10/*
11 * Base implementations of per-CPU variable declarations and definitions, where 11 * 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 12 * the section in which the variable is to be placed is provided by the
13 * 'section' argument. This may be used to affect the parameters governing the 13 * 'sec' argument. This may be used to affect the parameters governing the
14 * variable's storage. 14 * variable's storage.
15 * 15 *
16 * NOTE! The sections for the DECLARE and for the DEFINE must match, lest 16 * NOTE! The sections for the DECLARE and for the DEFINE must match, lest
17 * linkage errors occur due the compiler generating the wrong code to access 17 * linkage errors occur due the compiler generating the wrong code to access
18 * that section. 18 * that section.
19 */ 19 */
20#define DECLARE_PER_CPU_SECTION(type, name, section) \ 20#define __PCPU_ATTRS(sec) \
21 extern \ 21 __attribute__((section(PER_CPU_BASE_SECTION sec))) \
22 __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ 22 PER_CPU_ATTRIBUTES
23 PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name 23
24 24#define __PCPU_DUMMY_ATTRS \
25#define DEFINE_PER_CPU_SECTION(type, name, section) \ 25 __attribute__((section(".discard"), unused))
26 __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ 26
27 PER_CPU_ATTRIBUTES PER_CPU_DEF_ATTRIBUTES \ 27/*
28 * s390 and alpha modules require percpu variables to be defined as
29 * weak to force the compiler to generate GOT based external
30 * references for them. This is necessary because percpu sections
31 * will be located outside of the usually addressable area.
32 *
33 * This definition puts the following two extra restrictions when
34 * defining percpu variables.
35 *
36 * 1. The symbol must be globally unique, even the static ones.
37 * 2. Static percpu variables cannot be defined inside a function.
38 *
39 * Archs which need weak percpu definitions should define
40 * ARCH_NEEDS_WEAK_PER_CPU in asm/percpu.h when necessary.
41 *
42 * To ensure that the generic code observes the above two
43 * restrictions, if CONFIG_DEBUG_FORCE_WEAK_PER_CPU is set weak
44 * definition is used for all cases.
45 */
46#if defined(ARCH_NEEDS_WEAK_PER_CPU) || defined(CONFIG_DEBUG_FORCE_WEAK_PER_CPU)
47/*
48 * __pcpu_scope_* dummy variable is used to enforce scope. It
49 * receives the static modifier when it's used in front of
50 * DEFINE_PER_CPU() and will trigger build failure if
51 * DECLARE_PER_CPU() is used for the same variable.
52 *
53 * __pcpu_unique_* dummy variable is used to enforce symbol uniqueness
54 * such that hidden weak symbol collision, which will cause unrelated
55 * variables to share the same address, can be detected during build.
56 */
57#define DECLARE_PER_CPU_SECTION(type, name, sec) \
58 extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
59 extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name
60
61#define DEFINE_PER_CPU_SECTION(type, name, sec) \
62 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
63 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
64 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \
28 __typeof__(type) per_cpu__##name 65 __typeof__(type) per_cpu__##name
66#else
67/*
68 * Normal declaration and definition macros.
69 */
70#define DECLARE_PER_CPU_SECTION(type, name, sec) \
71 extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name
72
73#define DEFINE_PER_CPU_SECTION(type, name, sec) \
74 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \
75 __typeof__(type) per_cpu__##name
76#endif
29 77
30/* 78/*
31 * Variant on the per-CPU variable declaration/definition theme used for 79 * Variant on the per-CPU variable declaration/definition theme used for
@@ -66,14 +114,24 @@
66 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ 114 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \
67 ____cacheline_aligned_in_smp 115 ____cacheline_aligned_in_smp
68 116
117#define DECLARE_PER_CPU_ALIGNED(type, name) \
118 DECLARE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \
119 ____cacheline_aligned
120
121#define DEFINE_PER_CPU_ALIGNED(type, name) \
122 DEFINE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \
123 ____cacheline_aligned
124
69/* 125/*
70 * Declaration/definition used for per-CPU variables that must be page aligned. 126 * Declaration/definition used for per-CPU variables that must be page aligned.
71 */ 127 */
72#define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \ 128#define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \
73 DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") 129 DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") \
130 __aligned(PAGE_SIZE)
74 131
75#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ 132#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \
76 DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") 133 DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") \
134 __aligned(PAGE_SIZE)
77 135
78/* 136/*
79 * Intermodule exports for per-CPU variables. 137 * Intermodule exports for per-CPU variables.
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 26fd9d12f050..878836ca999c 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -34,7 +34,7 @@
34 34
35#ifdef CONFIG_SMP 35#ifdef CONFIG_SMP
36 36
37#ifdef CONFIG_HAVE_DYNAMIC_PER_CPU_AREA 37#ifndef CONFIG_HAVE_LEGACY_PER_CPU_AREA
38 38
39/* minimum unit size, also is the maximum supported allocation size */ 39/* minimum unit size, also is the maximum supported allocation size */
40#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) 40#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10)
@@ -57,19 +57,70 @@
57#endif 57#endif
58 58
59extern void *pcpu_base_addr; 59extern void *pcpu_base_addr;
60extern const unsigned long *pcpu_unit_offsets;
60 61
61typedef struct page * (*pcpu_get_page_fn_t)(unsigned int cpu, int pageno); 62struct pcpu_group_info {
62typedef void (*pcpu_populate_pte_fn_t)(unsigned long addr); 63 int nr_units; /* aligned # of units */
64 unsigned long base_offset; /* base address offset */
65 unsigned int *cpu_map; /* unit->cpu map, empty
66 * entries contain NR_CPUS */
67};
68
69struct pcpu_alloc_info {
70 size_t static_size;
71 size_t reserved_size;
72 size_t dyn_size;
73 size_t unit_size;
74 size_t atom_size;
75 size_t alloc_size;
76 size_t __ai_size; /* internal, don't use */
77 int nr_groups; /* 0 if grouping unnecessary */
78 struct pcpu_group_info groups[];
79};
63 80
64extern size_t __init pcpu_setup_first_chunk(pcpu_get_page_fn_t get_page_fn, 81enum pcpu_fc {
65 size_t static_size, size_t reserved_size, 82 PCPU_FC_AUTO,
66 ssize_t dyn_size, ssize_t unit_size, 83 PCPU_FC_EMBED,
67 void *base_addr, 84 PCPU_FC_PAGE,
68 pcpu_populate_pte_fn_t populate_pte_fn);
69 85
70extern ssize_t __init pcpu_embed_first_chunk( 86 PCPU_FC_NR,
71 size_t static_size, size_t reserved_size, 87};
72 ssize_t dyn_size, ssize_t unit_size); 88extern const char *pcpu_fc_names[PCPU_FC_NR];
89
90extern enum pcpu_fc pcpu_chosen_fc;
91
92typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int cpu, size_t size,
93 size_t align);
94typedef void (*pcpu_fc_free_fn_t)(void *ptr, size_t size);
95typedef void (*pcpu_fc_populate_pte_fn_t)(unsigned long addr);
96typedef int (pcpu_fc_cpu_distance_fn_t)(unsigned int from, unsigned int to);
97
98extern struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups,
99 int nr_units);
100extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai);
101
102extern struct pcpu_alloc_info * __init pcpu_build_alloc_info(
103 size_t reserved_size, ssize_t dyn_size,
104 size_t atom_size,
105 pcpu_fc_cpu_distance_fn_t cpu_distance_fn);
106
107extern int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
108 void *base_addr);
109
110#ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK
111extern int __init pcpu_embed_first_chunk(size_t reserved_size, ssize_t dyn_size,
112 size_t atom_size,
113 pcpu_fc_cpu_distance_fn_t cpu_distance_fn,
114 pcpu_fc_alloc_fn_t alloc_fn,
115 pcpu_fc_free_fn_t free_fn);
116#endif
117
118#ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK
119extern int __init pcpu_page_first_chunk(size_t reserved_size,
120 pcpu_fc_alloc_fn_t alloc_fn,
121 pcpu_fc_free_fn_t free_fn,
122 pcpu_fc_populate_pte_fn_t populate_pte_fn);
123#endif
73 124
74/* 125/*
75 * Use this to get to a cpu's version of the per-cpu object 126 * Use this to get to a cpu's version of the per-cpu object
@@ -80,7 +131,7 @@ extern ssize_t __init pcpu_embed_first_chunk(
80 131
81extern void *__alloc_reserved_percpu(size_t size, size_t align); 132extern void *__alloc_reserved_percpu(size_t size, size_t align);
82 133
83#else /* CONFIG_HAVE_DYNAMIC_PER_CPU_AREA */ 134#else /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */
84 135
85struct percpu_data { 136struct percpu_data {
86 void *ptrs[1]; 137 void *ptrs[1];
@@ -99,11 +150,15 @@ struct percpu_data {
99 (__typeof__(ptr))__p->ptrs[(cpu)]; \ 150 (__typeof__(ptr))__p->ptrs[(cpu)]; \
100}) 151})
101 152
102#endif /* CONFIG_HAVE_DYNAMIC_PER_CPU_AREA */ 153#endif /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */
103 154
104extern void *__alloc_percpu(size_t size, size_t align); 155extern void *__alloc_percpu(size_t size, size_t align);
105extern void free_percpu(void *__pdata); 156extern void free_percpu(void *__pdata);
106 157
158#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
159extern void __init setup_per_cpu_areas(void);
160#endif
161
107#else /* CONFIG_SMP */ 162#else /* CONFIG_SMP */
108 163
109#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) 164#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
@@ -124,6 +179,13 @@ static inline void free_percpu(void *p)
124 kfree(p); 179 kfree(p);
125} 180}
126 181
182static inline void __init setup_per_cpu_areas(void) { }
183
184static inline void *pcpu_lpage_remapped(void *kaddr)
185{
186 return NULL;
187}
188
127#endif /* CONFIG_SMP */ 189#endif /* CONFIG_SMP */
128 190
129#define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ 191#define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index ee5e3c9e2bca..1ef5a0781831 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -99,6 +99,9 @@ struct sockaddr_pn {
99 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; 99 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3];
100} __attribute__ ((packed)); 100} __attribute__ ((packed));
101 101
102/* Well known address */
103#define PN_DEV_PC 0x10
104
102static inline __u16 pn_object(__u8 addr, __u16 port) 105static inline __u16 pn_object(__u8 addr, __u16 port)
103{ 106{
104 return (addr << 8) | (port & 0x3ff); 107 return (addr << 8) | (port & 0x3ff);
@@ -170,4 +173,21 @@ static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
170 return spn->spn_resource; 173 return spn->spn_resource;
171} 174}
172 175
176/* Phonet device ioctl requests */
177#ifdef __KERNEL__
178#define SIOCPNGAUTOCONF (SIOCDEVPRIVATE + 0)
179
180struct if_phonet_autoconf {
181 uint8_t device;
182};
183
184struct if_phonet_req {
185 char ifr_phonet_name[16];
186 union {
187 struct if_phonet_autoconf ifru_phonet_autoconf;
188 } ifr_ifru;
189};
190#define ifr_phonet_autoconf ifr_ifru.ifru_phonet_autoconf
191#endif /* __KERNEL__ */
192
173#endif 193#endif
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 8dc5123b6305..3c6675c2444b 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -22,6 +22,9 @@ struct platform_device {
22 struct resource * resource; 22 struct resource * resource;
23 23
24 struct platform_device_id *id_entry; 24 struct platform_device_id *id_entry;
25
26 /* arch specific additions */
27 struct pdev_archdata archdata;
25}; 28};
26 29
27#define platform_get_device_id(pdev) ((pdev)->id_entry) 30#define platform_get_device_id(pdev) ((pdev)->id_entry)
@@ -57,8 +60,6 @@ struct platform_driver {
57 int (*remove)(struct platform_device *); 60 int (*remove)(struct platform_device *);
58 void (*shutdown)(struct platform_device *); 61 void (*shutdown)(struct platform_device *);
59 int (*suspend)(struct platform_device *, pm_message_t state); 62 int (*suspend)(struct platform_device *, pm_message_t state);
60 int (*suspend_late)(struct platform_device *, pm_message_t state);
61 int (*resume_early)(struct platform_device *);
62 int (*resume)(struct platform_device *); 63 int (*resume)(struct platform_device *);
63 struct device_driver driver; 64 struct device_driver driver;
64 struct platform_device_id *id_table; 65 struct platform_device_id *id_table;
diff --git a/include/linux/pm.h b/include/linux/pm.h
index b3f74764a586..3b7e04b95bd2 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -22,6 +22,10 @@
22#define _LINUX_PM_H 22#define _LINUX_PM_H
23 23
24#include <linux/list.h> 24#include <linux/list.h>
25#include <linux/workqueue.h>
26#include <linux/spinlock.h>
27#include <linux/wait.h>
28#include <linux/timer.h>
25 29
26/* 30/*
27 * Callbacks for platform drivers to implement. 31 * Callbacks for platform drivers to implement.
@@ -165,6 +169,28 @@ typedef struct pm_message {
165 * It is allowed to unregister devices while the above callbacks are being 169 * It is allowed to unregister devices while the above callbacks are being
166 * executed. However, it is not allowed to unregister a device from within any 170 * executed. However, it is not allowed to unregister a device from within any
167 * of its own callbacks. 171 * of its own callbacks.
172 *
173 * There also are the following callbacks related to run-time power management
174 * of devices:
175 *
176 * @runtime_suspend: Prepare the device for a condition in which it won't be
177 * able to communicate with the CPU(s) and RAM due to power management.
178 * This need not mean that the device should be put into a low power state.
179 * For example, if the device is behind a link which is about to be turned
180 * off, the device may remain at full power. If the device does go to low
181 * power and if device_may_wakeup(dev) is true, remote wake-up (i.e., a
182 * hardware mechanism allowing the device to request a change of its power
183 * state, such as PCI PME) should be enabled for it.
184 *
185 * @runtime_resume: Put the device into the fully active state in response to a
186 * wake-up event generated by hardware or at the request of software. If
187 * necessary, put the device into the full power state and restore its
188 * registers, so that it is fully operational.
189 *
190 * @runtime_idle: Device appears to be inactive and it might be put into a low
191 * power state if all of the necessary conditions are satisfied. Check
192 * these conditions and handle the device as appropriate, possibly queueing
193 * a suspend request for it. The return value is ignored by the PM core.
168 */ 194 */
169 195
170struct dev_pm_ops { 196struct dev_pm_ops {
@@ -182,8 +208,25 @@ struct dev_pm_ops {
182 int (*thaw_noirq)(struct device *dev); 208 int (*thaw_noirq)(struct device *dev);
183 int (*poweroff_noirq)(struct device *dev); 209 int (*poweroff_noirq)(struct device *dev);
184 int (*restore_noirq)(struct device *dev); 210 int (*restore_noirq)(struct device *dev);
211 int (*runtime_suspend)(struct device *dev);
212 int (*runtime_resume)(struct device *dev);
213 int (*runtime_idle)(struct device *dev);
185}; 214};
186 215
216/*
217 * Use this if you want to use the same suspend and resume callbacks for suspend
218 * to RAM and hibernation.
219 */
220#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
221struct dev_pm_ops name = { \
222 .suspend = suspend_fn, \
223 .resume = resume_fn, \
224 .freeze = suspend_fn, \
225 .thaw = resume_fn, \
226 .poweroff = suspend_fn, \
227 .restore = resume_fn, \
228}
229
187/** 230/**
188 * PM_EVENT_ messages 231 * PM_EVENT_ messages
189 * 232 *
@@ -315,14 +358,80 @@ enum dpm_state {
315 DPM_OFF_IRQ, 358 DPM_OFF_IRQ,
316}; 359};
317 360
361/**
362 * Device run-time power management status.
363 *
364 * These status labels are used internally by the PM core to indicate the
365 * current status of a device with respect to the PM core operations. They do
366 * not reflect the actual power state of the device or its status as seen by the
367 * driver.
368 *
369 * RPM_ACTIVE Device is fully operational. Indicates that the device
370 * bus type's ->runtime_resume() callback has completed
371 * successfully.
372 *
373 * RPM_SUSPENDED Device bus type's ->runtime_suspend() callback has
374 * completed successfully. The device is regarded as
375 * suspended.
376 *
377 * RPM_RESUMING Device bus type's ->runtime_resume() callback is being
378 * executed.
379 *
380 * RPM_SUSPENDING Device bus type's ->runtime_suspend() callback is being
381 * executed.
382 */
383
384enum rpm_status {
385 RPM_ACTIVE = 0,
386 RPM_RESUMING,
387 RPM_SUSPENDED,
388 RPM_SUSPENDING,
389};
390
391/**
392 * Device run-time power management request types.
393 *
394 * RPM_REQ_NONE Do nothing.
395 *
396 * RPM_REQ_IDLE Run the device bus type's ->runtime_idle() callback
397 *
398 * RPM_REQ_SUSPEND Run the device bus type's ->runtime_suspend() callback
399 *
400 * RPM_REQ_RESUME Run the device bus type's ->runtime_resume() callback
401 */
402
403enum rpm_request {
404 RPM_REQ_NONE = 0,
405 RPM_REQ_IDLE,
406 RPM_REQ_SUSPEND,
407 RPM_REQ_RESUME,
408};
409
318struct dev_pm_info { 410struct dev_pm_info {
319 pm_message_t power_state; 411 pm_message_t power_state;
320 unsigned can_wakeup:1; 412 unsigned int can_wakeup:1;
321 unsigned should_wakeup:1; 413 unsigned int should_wakeup:1;
322 enum dpm_state status; /* Owned by the PM core */ 414 enum dpm_state status; /* Owned by the PM core */
323#ifdef CONFIG_PM_SLEEP 415#ifdef CONFIG_PM_SLEEP
324 struct list_head entry; 416 struct list_head entry;
325#endif 417#endif
418#ifdef CONFIG_PM_RUNTIME
419 struct timer_list suspend_timer;
420 unsigned long timer_expires;
421 struct work_struct work;
422 wait_queue_head_t wait_queue;
423 spinlock_t lock;
424 atomic_t usage_count;
425 atomic_t child_count;
426 unsigned int disable_depth:3;
427 unsigned int ignore_children:1;
428 unsigned int idle_notification:1;
429 unsigned int request_pending:1;
430 unsigned int deferred_resume:1;
431 enum rpm_request request;
432 enum rpm_status runtime_status;
433 int runtime_error;
434#endif
326}; 435};
327 436
328/* 437/*
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
new file mode 100644
index 000000000000..44087044910f
--- /dev/null
+++ b/include/linux/pm_runtime.h
@@ -0,0 +1,114 @@
1/*
2 * pm_runtime.h - Device run-time power management helper functions.
3 *
4 * Copyright (C) 2009 Rafael J. Wysocki <rjw@sisk.pl>
5 *
6 * This file is released under the GPLv2.
7 */
8
9#ifndef _LINUX_PM_RUNTIME_H
10#define _LINUX_PM_RUNTIME_H
11
12#include <linux/device.h>
13#include <linux/pm.h>
14
15#ifdef CONFIG_PM_RUNTIME
16
17extern struct workqueue_struct *pm_wq;
18
19extern int pm_runtime_idle(struct device *dev);
20extern int pm_runtime_suspend(struct device *dev);
21extern int pm_runtime_resume(struct device *dev);
22extern int pm_request_idle(struct device *dev);
23extern int pm_schedule_suspend(struct device *dev, unsigned int delay);
24extern int pm_request_resume(struct device *dev);
25extern int __pm_runtime_get(struct device *dev, bool sync);
26extern int __pm_runtime_put(struct device *dev, bool sync);
27extern int __pm_runtime_set_status(struct device *dev, unsigned int status);
28extern int pm_runtime_barrier(struct device *dev);
29extern void pm_runtime_enable(struct device *dev);
30extern void __pm_runtime_disable(struct device *dev, bool check_resume);
31
32static inline bool pm_children_suspended(struct device *dev)
33{
34 return dev->power.ignore_children
35 || !atomic_read(&dev->power.child_count);
36}
37
38static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
39{
40 dev->power.ignore_children = enable;
41}
42
43static inline void pm_runtime_get_noresume(struct device *dev)
44{
45 atomic_inc(&dev->power.usage_count);
46}
47
48static inline void pm_runtime_put_noidle(struct device *dev)
49{
50 atomic_add_unless(&dev->power.usage_count, -1, 0);
51}
52
53#else /* !CONFIG_PM_RUNTIME */
54
55static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; }
56static inline int pm_runtime_suspend(struct device *dev) { return -ENOSYS; }
57static inline int pm_runtime_resume(struct device *dev) { return 0; }
58static inline int pm_request_idle(struct device *dev) { return -ENOSYS; }
59static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
60{
61 return -ENOSYS;
62}
63static inline int pm_request_resume(struct device *dev) { return 0; }
64static inline int __pm_runtime_get(struct device *dev, bool sync) { return 1; }
65static inline int __pm_runtime_put(struct device *dev, bool sync) { return 0; }
66static inline int __pm_runtime_set_status(struct device *dev,
67 unsigned int status) { return 0; }
68static inline int pm_runtime_barrier(struct device *dev) { return 0; }
69static inline void pm_runtime_enable(struct device *dev) {}
70static inline void __pm_runtime_disable(struct device *dev, bool c) {}
71
72static inline bool pm_children_suspended(struct device *dev) { return false; }
73static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
74static inline void pm_runtime_get_noresume(struct device *dev) {}
75static inline void pm_runtime_put_noidle(struct device *dev) {}
76
77#endif /* !CONFIG_PM_RUNTIME */
78
79static inline int pm_runtime_get(struct device *dev)
80{
81 return __pm_runtime_get(dev, false);
82}
83
84static inline int pm_runtime_get_sync(struct device *dev)
85{
86 return __pm_runtime_get(dev, true);
87}
88
89static inline int pm_runtime_put(struct device *dev)
90{
91 return __pm_runtime_put(dev, false);
92}
93
94static inline int pm_runtime_put_sync(struct device *dev)
95{
96 return __pm_runtime_put(dev, true);
97}
98
99static inline int pm_runtime_set_active(struct device *dev)
100{
101 return __pm_runtime_set_status(dev, RPM_ACTIVE);
102}
103
104static inline void pm_runtime_set_suspended(struct device *dev)
105{
106 __pm_runtime_set_status(dev, RPM_SUSPENDED);
107}
108
109static inline void pm_runtime_disable(struct device *dev)
110{
111 __pm_runtime_disable(dev, true);
112}
113
114#endif
diff --git a/include/linux/rds.h b/include/linux/rds.h
index d91dc91f5443..89d46e1afbb1 100644
--- a/include/linux/rds.h
+++ b/include/linux/rds.h
@@ -147,6 +147,18 @@ struct rds_info_socket {
147 u_int64_t inum; 147 u_int64_t inum;
148} __attribute__((packed)); 148} __attribute__((packed));
149 149
150struct rds_info_tcp_socket {
151 __be32 local_addr;
152 __be16 local_port;
153 __be32 peer_addr;
154 __be16 peer_port;
155 u_int64_t hdr_rem;
156 u_int64_t data_rem;
157 u_int32_t last_sent_nxt;
158 u_int32_t last_expected_una;
159 u_int32_t last_seen_una;
160} __attribute__((packed));
161
150#define RDS_IB_GID_LEN 16 162#define RDS_IB_GID_LEN 16
151struct rds_info_rdma_connection { 163struct rds_info_rdma_connection {
152 __be32 src_addr; 164 __be32 src_addr;
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 278777fa8a3a..3392c59d2706 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -6,20 +6,17 @@
6 * Copyright (C) 2007 Dmitry Torokhov 6 * Copyright (C) 2007 Dmitry Torokhov
7 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> 7 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * Permission to use, copy, modify, and/or distribute this software for any
10 * it under the terms of the GNU General Public License as published by 10 * purpose with or without fee is hereby granted, provided that the above
11 * the Free Software Foundation; either version 2 of the License, or 11 * copyright notice and this permission notice appear in all copies.
12 * (at your option) any later version.
13 * 12 *
14 * This program is distributed in the hope that it will be useful, 13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17 * GNU General Public License for more details. 16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * 17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19 * You should have received a copy of the GNU General Public License 18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20 * along with this program; if not, write to the 19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 * Free Software Foundation, Inc.,
22 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 */ 20 */
24 21
25#include <linux/types.h> 22#include <linux/types.h>
@@ -47,6 +44,7 @@ enum rfkill_type {
47 RFKILL_TYPE_UWB, 44 RFKILL_TYPE_UWB,
48 RFKILL_TYPE_WIMAX, 45 RFKILL_TYPE_WIMAX,
49 RFKILL_TYPE_WWAN, 46 RFKILL_TYPE_WWAN,
47 RFKILL_TYPE_GPS,
50 NUM_RFKILL_TYPES, 48 NUM_RFKILL_TYPES,
51}; 49};
52 50
@@ -82,6 +80,20 @@ struct rfkill_event {
82 __u8 soft, hard; 80 __u8 soft, hard;
83} __packed; 81} __packed;
84 82
83/*
84 * We are planning to be backward and forward compatible with changes
85 * to the event struct, by adding new, optional, members at the end.
86 * When reading an event (whether the kernel from userspace or vice
87 * versa) we need to accept anything that's at least as large as the
88 * version 1 event size, but might be able to accept other sizes in
89 * the future.
90 *
91 * One exception is the kernel -- we already have two event sizes in
92 * that we've made the 'hard' member optional since our only option
93 * is to ignore it anyway.
94 */
95#define RFKILL_EVENT_SIZE_V1 8
96
85/* ioctl for turning off rfkill-input (if present) */ 97/* ioctl for turning off rfkill-input (if present) */
86#define RFKILL_IOC_MAGIC 'R' 98#define RFKILL_IOC_MAGIC 'R'
87#define RFKILL_IOC_NOINPUT 1 99#define RFKILL_IOC_NOINPUT 1
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index ba3254ecf7fb..adf2068d12b5 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -104,7 +104,7 @@ enum {
104 RTM_NEWADDRLABEL = 72, 104 RTM_NEWADDRLABEL = 72,
105#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL 105#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
106 RTM_DELADDRLABEL, 106 RTM_DELADDRLABEL,
107#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL 107#define RTM_DELADDRLABEL RTM_DELADDRLABEL
108 RTM_GETADDRLABEL, 108 RTM_GETADDRLABEL,
109#define RTM_GETADDRLABEL RTM_GETADDRLABEL 109#define RTM_GETADDRLABEL RTM_GETADDRLABEL
110 110
diff --git a/include/linux/rxrpc.h b/include/linux/rxrpc.h
index f7b826b565c7..a53915cd5581 100644
--- a/include/linux/rxrpc.h
+++ b/include/linux/rxrpc.h
@@ -58,5 +58,12 @@ struct sockaddr_rxrpc {
58#define RXRPC_SECURITY_AUTH 1 /* authenticated packets */ 58#define RXRPC_SECURITY_AUTH 1 /* authenticated packets */
59#define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */ 59#define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */
60 60
61/*
62 * RxRPC security indices
63 */
64#define RXRPC_SECURITY_NONE 0 /* no security protocol */
65#define RXRPC_SECURITY_RXKAD 2 /* kaserver or kerberos 4 */
66#define RXRPC_SECURITY_RXGK 4 /* gssapi-based */
67#define RXRPC_SECURITY_RXK5 5 /* kerberos 5 */
61 68
62#endif /* _LINUX_RXRPC_H */ 69#endif /* _LINUX_RXRPC_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f3d74bd04d18..8af3d249170e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -190,6 +190,7 @@ extern unsigned long long time_sync_thresh;
190/* in tsk->state again */ 190/* in tsk->state again */
191#define TASK_DEAD 64 191#define TASK_DEAD 64
192#define TASK_WAKEKILL 128 192#define TASK_WAKEKILL 128
193#define TASK_WAKING 256
193 194
194/* Convenience macros for the sake of set_task_state */ 195/* Convenience macros for the sake of set_task_state */
195#define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) 196#define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)
@@ -802,14 +803,14 @@ enum cpu_idle_type {
802#define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */ 803#define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */
803#define SD_BALANCE_EXEC 0x0004 /* Balance on exec */ 804#define SD_BALANCE_EXEC 0x0004 /* Balance on exec */
804#define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ 805#define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */
805#define SD_WAKE_IDLE 0x0010 /* Wake to idle CPU on task wakeup */ 806#define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */
806#define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ 807#define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */
807#define SD_WAKE_BALANCE 0x0040 /* Perform balancing at task wakeup */ 808#define SD_PREFER_LOCAL 0x0040 /* Prefer to keep tasks local to this domain */
808#define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ 809#define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */
809#define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ 810#define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */
810#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ 811#define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */
811#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ 812#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */
812#define SD_WAKE_IDLE_FAR 0x0800 /* Gain latency sacrificing cache hit */ 813
813#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ 814#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */
814 815
815enum powersavings_balance_level { 816enum powersavings_balance_level {
@@ -991,6 +992,9 @@ static inline int test_sd_parent(struct sched_domain *sd, int flag)
991 return 0; 992 return 0;
992} 993}
993 994
995unsigned long default_scale_freq_power(struct sched_domain *sd, int cpu);
996unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu);
997
994#else /* CONFIG_SMP */ 998#else /* CONFIG_SMP */
995 999
996struct sched_domain_attr; 1000struct sched_domain_attr;
@@ -1002,6 +1006,7 @@ partition_sched_domains(int ndoms_new, struct cpumask *doms_new,
1002} 1006}
1003#endif /* !CONFIG_SMP */ 1007#endif /* !CONFIG_SMP */
1004 1008
1009
1005struct io_context; /* See blkdev.h */ 1010struct io_context; /* See blkdev.h */
1006 1011
1007 1012
@@ -1019,6 +1024,12 @@ struct uts_namespace;
1019struct rq; 1024struct rq;
1020struct sched_domain; 1025struct sched_domain;
1021 1026
1027/*
1028 * wake flags
1029 */
1030#define WF_SYNC 0x01 /* waker goes to sleep after wakup */
1031#define WF_FORK 0x02 /* child wakeup after fork */
1032
1022struct sched_class { 1033struct sched_class {
1023 const struct sched_class *next; 1034 const struct sched_class *next;
1024 1035
@@ -1026,13 +1037,13 @@ struct sched_class {
1026 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); 1037 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
1027 void (*yield_task) (struct rq *rq); 1038 void (*yield_task) (struct rq *rq);
1028 1039
1029 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync); 1040 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags);
1030 1041
1031 struct task_struct * (*pick_next_task) (struct rq *rq); 1042 struct task_struct * (*pick_next_task) (struct rq *rq);
1032 void (*put_prev_task) (struct rq *rq, struct task_struct *p); 1043 void (*put_prev_task) (struct rq *rq, struct task_struct *p);
1033 1044
1034#ifdef CONFIG_SMP 1045#ifdef CONFIG_SMP
1035 int (*select_task_rq)(struct task_struct *p, int sync); 1046 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags);
1036 1047
1037 unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, 1048 unsigned long (*load_balance) (struct rq *this_rq, int this_cpu,
1038 struct rq *busiest, unsigned long max_load_move, 1049 struct rq *busiest, unsigned long max_load_move,
@@ -1102,6 +1113,8 @@ struct sched_entity {
1102 u64 start_runtime; 1113 u64 start_runtime;
1103 u64 avg_wakeup; 1114 u64 avg_wakeup;
1104 1115
1116 u64 avg_running;
1117
1105#ifdef CONFIG_SCHEDSTATS 1118#ifdef CONFIG_SCHEDSTATS
1106 u64 wait_start; 1119 u64 wait_start;
1107 u64 wait_max; 1120 u64 wait_max;
diff --git a/include/linux/selinux.h b/include/linux/selinux.h
index 20f965d4b041..82e0f26a1299 100644
--- a/include/linux/selinux.h
+++ b/include/linux/selinux.h
@@ -61,6 +61,11 @@ void selinux_secmark_refcount_inc(void);
61 * existing SECMARK targets has been removed/flushed. 61 * existing SECMARK targets has been removed/flushed.
62 */ 62 */
63void selinux_secmark_refcount_dec(void); 63void selinux_secmark_refcount_dec(void);
64
65/**
66 * selinux_is_enabled - is SELinux enabled?
67 */
68bool selinux_is_enabled(void);
64#else 69#else
65 70
66static inline int selinux_string_to_sid(const char *str, u32 *sid) 71static inline int selinux_string_to_sid(const char *str, u32 *sid)
@@ -84,6 +89,10 @@ static inline void selinux_secmark_refcount_dec(void)
84 return; 89 return;
85} 90}
86 91
92static inline bool selinux_is_enabled(void)
93{
94 return false;
95}
87#endif /* CONFIG_SECURITY_SELINUX */ 96#endif /* CONFIG_SECURITY_SELINUX */
88 97
89#endif /* _LINUX_SELINUX_H */ 98#endif /* _LINUX_SELINUX_H */
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 126d24c9eaa8..a640bc2afe76 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -31,8 +31,6 @@ struct serio {
31 31
32 bool manual_bind; 32 bool manual_bind;
33 bool registered; /* port has been fully registered with driver core */ 33 bool registered; /* port has been fully registered with driver core */
34 bool suspended; /* port is suspended */
35
36 34
37 struct serio_device_id id; 35 struct serio_device_id id;
38 36
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 6d3f2f449ead..deee7afd8d66 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -38,6 +38,9 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
38 return container_of(inode, struct shmem_inode_info, vfs_inode); 38 return container_of(inode, struct shmem_inode_info, vfs_inode);
39} 39}
40 40
41extern int init_tmpfs(void);
42extern int shmem_fill_super(struct super_block *sb, void *data, int silent);
43
41#ifdef CONFIG_TMPFS_POSIX_ACL 44#ifdef CONFIG_TMPFS_POSIX_ACL
42int shmem_check_acl(struct inode *, int); 45int shmem_check_acl(struct inode *, int);
43int shmem_acl_init(struct inode *, struct inode *); 46int shmem_acl_init(struct inode *, struct inode *);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f2c69a2cca17..df7b23ac66e6 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -304,7 +304,6 @@ typedef unsigned char *sk_buff_data_t;
304 * @tc_index: Traffic control index 304 * @tc_index: Traffic control index
305 * @tc_verd: traffic control verdict 305 * @tc_verd: traffic control verdict
306 * @ndisc_nodetype: router type (from link layer) 306 * @ndisc_nodetype: router type (from link layer)
307 * @do_not_encrypt: set to prevent encryption of this frame
308 * @dma_cookie: a cookie to one of several possible DMA operations 307 * @dma_cookie: a cookie to one of several possible DMA operations
309 * done by skb DMA functions 308 * done by skb DMA functions
310 * @secmark: security marking 309 * @secmark: security marking
@@ -380,12 +379,9 @@ struct sk_buff {
380#ifdef CONFIG_IPV6_NDISC_NODETYPE 379#ifdef CONFIG_IPV6_NDISC_NODETYPE
381 __u8 ndisc_nodetype:2; 380 __u8 ndisc_nodetype:2;
382#endif 381#endif
383#if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE)
384 __u8 do_not_encrypt:1;
385#endif
386 kmemcheck_bitfield_end(flags2); 382 kmemcheck_bitfield_end(flags2);
387 383
388 /* 0/13/14 bit hole */ 384 /* 0/14 bit hole */
389 385
390#ifdef CONFIG_NET_DMA 386#ifdef CONFIG_NET_DMA
391 dma_cookie_t dma_cookie; 387 dma_cookie_t dma_cookie;
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
index bb5368df4be8..0ec00b39d006 100644
--- a/include/linux/slob_def.h
+++ b/include/linux/slob_def.h
@@ -34,9 +34,4 @@ static __always_inline void *__kmalloc(size_t size, gfp_t flags)
34 return kmalloc(size, flags); 34 return kmalloc(size, flags);
35} 35}
36 36
37static inline void kmem_cache_init_late(void)
38{
39 /* Nothing to do */
40}
41
42#endif /* __LINUX_SLOB_DEF_H */ 37#endif /* __LINUX_SLOB_DEF_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index c1c862b1d01a..5ad70a60fd74 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -153,12 +153,10 @@ static __always_inline int kmalloc_index(size_t size)
153 if (size <= KMALLOC_MIN_SIZE) 153 if (size <= KMALLOC_MIN_SIZE)
154 return KMALLOC_SHIFT_LOW; 154 return KMALLOC_SHIFT_LOW;
155 155
156#if KMALLOC_MIN_SIZE <= 64 156 if (KMALLOC_MIN_SIZE <= 32 && size > 64 && size <= 96)
157 if (size > 64 && size <= 96)
158 return 1; 157 return 1;
159 if (size > 128 && size <= 192) 158 if (KMALLOC_MIN_SIZE <= 64 && size > 128 && size <= 192)
160 return 2; 159 return 2;
161#endif
162 if (size <= 8) return 3; 160 if (size <= 8) return 3;
163 if (size <= 16) return 4; 161 if (size <= 16) return 4;
164 if (size <= 32) return 5; 162 if (size <= 32) return 5;
@@ -304,6 +302,4 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
304} 302}
305#endif 303#endif
306 304
307void __init kmem_cache_init_late(void);
308
309#endif /* _LINUX_SLUB_DEF_H */ 305#endif /* _LINUX_SLUB_DEF_H */
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 5ae8fa22d331..3d0a9ff24f01 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -27,24 +27,54 @@ struct ssb_sprom {
27 u8 et1mdcport; /* MDIO for enet1 */ 27 u8 et1mdcport; /* MDIO for enet1 */
28 u8 board_rev; /* Board revision number from SPROM. */ 28 u8 board_rev; /* Board revision number from SPROM. */
29 u8 country_code; /* Country Code */ 29 u8 country_code; /* Country Code */
30 u8 ant_available_a; /* A-PHY antenna available bits (up to 4) */ 30 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */
31 u8 ant_available_bg; /* B/G-PHY antenna available bits (up to 4) */ 31 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */
32 u16 pa0b0; 32 u16 pa0b0;
33 u16 pa0b1; 33 u16 pa0b1;
34 u16 pa0b2; 34 u16 pa0b2;
35 u16 pa1b0; 35 u16 pa1b0;
36 u16 pa1b1; 36 u16 pa1b1;
37 u16 pa1b2; 37 u16 pa1b2;
38 u16 pa1lob0;
39 u16 pa1lob1;
40 u16 pa1lob2;
41 u16 pa1hib0;
42 u16 pa1hib1;
43 u16 pa1hib2;
38 u8 gpio0; /* GPIO pin 0 */ 44 u8 gpio0; /* GPIO pin 0 */
39 u8 gpio1; /* GPIO pin 1 */ 45 u8 gpio1; /* GPIO pin 1 */
40 u8 gpio2; /* GPIO pin 2 */ 46 u8 gpio2; /* GPIO pin 2 */
41 u8 gpio3; /* GPIO pin 3 */ 47 u8 gpio3; /* GPIO pin 3 */
42 u16 maxpwr_a; /* A-PHY Amplifier Max Power (in dBm Q5.2) */ 48 u16 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */
43 u16 maxpwr_bg; /* B/G-PHY Amplifier Max Power (in dBm Q5.2) */ 49 u16 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */
50 u16 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */
51 u16 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */
44 u8 itssi_a; /* Idle TSSI Target for A-PHY */ 52 u8 itssi_a; /* Idle TSSI Target for A-PHY */
45 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ 53 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */
46 u16 boardflags_lo; /* Boardflags (low 16 bits) */ 54 u8 tri2g; /* 2.4GHz TX isolation */
47 u16 boardflags_hi; /* Boardflags (high 16 bits) */ 55 u8 tri5gl; /* 5.2GHz TX isolation */
56 u8 tri5g; /* 5.3GHz TX isolation */
57 u8 tri5gh; /* 5.8GHz TX isolation */
58 u8 rxpo2g; /* 2GHz RX power offset */
59 u8 rxpo5g; /* 5GHz RX power offset */
60 u8 rssisav2g; /* 2GHz RSSI params */
61 u8 rssismc2g;
62 u8 rssismf2g;
63 u8 bxa2g; /* 2GHz BX arch */
64 u8 rssisav5g; /* 5GHz RSSI params */
65 u8 rssismc5g;
66 u8 rssismf5g;
67 u8 bxa5g; /* 5GHz BX arch */
68 u16 cck2gpo; /* CCK power offset */
69 u32 ofdm2gpo; /* 2.4GHz OFDM power offset */
70 u32 ofdm5glpo; /* 5.2GHz OFDM power offset */
71 u32 ofdm5gpo; /* 5.3GHz OFDM power offset */
72 u32 ofdm5ghpo; /* 5.8GHz OFDM power offset */
73 u16 boardflags_lo; /* Board flags (bits 0-15) */
74 u16 boardflags_hi; /* Board flags (bits 16-31) */
75 u16 boardflags2_lo; /* Board flags (bits 32-47) */
76 u16 boardflags2_hi; /* Board flags (bits 48-63) */
77 /* TODO store board flags in a single u64 */
48 78
49 /* Antenna gain values for up to 4 antennas 79 /* Antenna gain values for up to 4 antennas
50 * on each band. Values in dBm/4 (Q5.2). Negative gain means the 80 * on each band. Values in dBm/4 (Q5.2). Negative gain means the
@@ -58,7 +88,7 @@ struct ssb_sprom {
58 } ghz5; /* 5GHz band */ 88 } ghz5; /* 5GHz band */
59 } antenna_gain; 89 } antenna_gain;
60 90
61 /* TODO - add any parameters needed from rev 2, 3, or 4 SPROMs */ 91 /* TODO - add any parameters needed from rev 2, 3, 4, 5 or 8 SPROMs */
62}; 92};
63 93
64/* Information about the PCB the circuitry is soldered on. */ 94/* Information about the PCB the circuitry is soldered on. */
@@ -208,6 +238,7 @@ enum ssb_bustype {
208 SSB_BUSTYPE_SSB, /* This SSB bus is the system bus */ 238 SSB_BUSTYPE_SSB, /* This SSB bus is the system bus */
209 SSB_BUSTYPE_PCI, /* SSB is connected to PCI bus */ 239 SSB_BUSTYPE_PCI, /* SSB is connected to PCI bus */
210 SSB_BUSTYPE_PCMCIA, /* SSB is connected to PCMCIA bus */ 240 SSB_BUSTYPE_PCMCIA, /* SSB is connected to PCMCIA bus */
241 SSB_BUSTYPE_SDIO, /* SSB is connected to SDIO bus */
211}; 242};
212 243
213/* board_vendor */ 244/* board_vendor */
@@ -240,8 +271,12 @@ struct ssb_bus {
240 271
241 /* The core in the basic address register window. (PCI bus only) */ 272 /* The core in the basic address register window. (PCI bus only) */
242 struct ssb_device *mapped_device; 273 struct ssb_device *mapped_device;
243 /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ 274 union {
244 u8 mapped_pcmcia_seg; 275 /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */
276 u8 mapped_pcmcia_seg;
277 /* Current SSB base address window for SDIO. */
278 u32 sdio_sbaddr;
279 };
245 /* Lock for core and segment switching. 280 /* Lock for core and segment switching.
246 * On PCMCIA-host busses this is used to protect the whole MMIO access. */ 281 * On PCMCIA-host busses this is used to protect the whole MMIO access. */
247 spinlock_t bar_lock; 282 spinlock_t bar_lock;
@@ -252,6 +287,11 @@ struct ssb_bus {
252 struct pci_dev *host_pci; 287 struct pci_dev *host_pci;
253 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ 288 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */
254 struct pcmcia_device *host_pcmcia; 289 struct pcmcia_device *host_pcmcia;
290 /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */
291 struct sdio_func *host_sdio;
292
293 /* See enum ssb_quirks */
294 unsigned int quirks;
255 295
256#ifdef CONFIG_SSB_SPROM 296#ifdef CONFIG_SSB_SPROM
257 /* Mutex to protect the SPROM writing. */ 297 /* Mutex to protect the SPROM writing. */
@@ -306,6 +346,11 @@ struct ssb_bus {
306#endif /* DEBUG */ 346#endif /* DEBUG */
307}; 347};
308 348
349enum ssb_quirks {
350 /* SDIO connected card requires performing a read after writing a 32-bit value */
351 SSB_QUIRK_SDIO_READ_AFTER_WRITE32 = (1 << 0),
352};
353
309/* The initialization-invariants. */ 354/* The initialization-invariants. */
310struct ssb_init_invariants { 355struct ssb_init_invariants {
311 /* Versioning information about the PCB. */ 356 /* Versioning information about the PCB. */
@@ -336,6 +381,12 @@ extern int ssb_bus_pcmciabus_register(struct ssb_bus *bus,
336 struct pcmcia_device *pcmcia_dev, 381 struct pcmcia_device *pcmcia_dev,
337 unsigned long baseaddr); 382 unsigned long baseaddr);
338#endif /* CONFIG_SSB_PCMCIAHOST */ 383#endif /* CONFIG_SSB_PCMCIAHOST */
384#ifdef CONFIG_SSB_SDIOHOST
385extern int ssb_bus_sdiobus_register(struct ssb_bus *bus,
386 struct sdio_func *sdio_func,
387 unsigned int quirks);
388#endif /* CONFIG_SSB_SDIOHOST */
389
339 390
340extern void ssb_bus_unregister(struct ssb_bus *bus); 391extern void ssb_bus_unregister(struct ssb_bus *bus);
341 392
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index d3b1d18922f2..4e27acf0a92f 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -629,5 +629,15 @@ extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
629/* PMU support */ 629/* PMU support */
630extern void ssb_pmu_init(struct ssb_chipcommon *cc); 630extern void ssb_pmu_init(struct ssb_chipcommon *cc);
631 631
632enum ssb_pmu_ldo_volt_id {
633 LDO_PAREF = 0,
634 LDO_VOLT1,
635 LDO_VOLT2,
636 LDO_VOLT3,
637};
638
639void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc,
640 enum ssb_pmu_ldo_volt_id id, u32 voltage);
641void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on);
632 642
633#endif /* LINUX_SSB_CHIPCO_H_ */ 643#endif /* LINUX_SSB_CHIPCO_H_ */
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index a01b982b5783..9ae9082eaeb4 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -162,7 +162,7 @@
162 162
163/* SPROM shadow area. If not otherwise noted, fields are 163/* SPROM shadow area. If not otherwise noted, fields are
164 * two bytes wide. Note that the SPROM can _only_ be read 164 * two bytes wide. Note that the SPROM can _only_ be read
165 * in two-byte quantinies. 165 * in two-byte quantities.
166 */ 166 */
167#define SSB_SPROMSIZE_WORDS 64 167#define SSB_SPROMSIZE_WORDS 64
168#define SSB_SPROMSIZE_BYTES (SSB_SPROMSIZE_WORDS * sizeof(u16)) 168#define SSB_SPROMSIZE_BYTES (SSB_SPROMSIZE_WORDS * sizeof(u16))
@@ -327,8 +327,11 @@
327#define SSB_SPROM5_GPIOB_P3_SHIFT 8 327#define SSB_SPROM5_GPIOB_P3_SHIFT 8
328 328
329/* SPROM Revision 8 */ 329/* SPROM Revision 8 */
330#define SSB_SPROM8_BFLLO 0x1084 /* Boardflags (low 16 bits) */ 330#define SSB_SPROM8_BOARDREV 0x1082 /* Board revision */
331#define SSB_SPROM8_BFLHI 0x1086 /* Boardflags Hi */ 331#define SSB_SPROM8_BFLLO 0x1084 /* Board flags (bits 0-15) */
332#define SSB_SPROM8_BFLHI 0x1086 /* Board flags (bits 16-31) */
333#define SSB_SPROM8_BFL2LO 0x1088 /* Board flags (bits 32-47) */
334#define SSB_SPROM8_BFL2HI 0x108A /* Board flags (bits 48-63) */
332#define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */ 335#define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */
333#define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */ 336#define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */
334#define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/ 337#define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/
@@ -354,14 +357,63 @@
354#define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */ 357#define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */
355#define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */ 358#define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */
356#define SSB_SPROM8_GPIOB_P3_SHIFT 8 359#define SSB_SPROM8_GPIOB_P3_SHIFT 8
357#define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power BG in path 1 */ 360#define SSB_SPROM8_RSSIPARM2G 0x10A4 /* RSSI params for 2GHz */
358#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ 361#define SSB_SPROM8_RSSISMF2G 0x000F
362#define SSB_SPROM8_RSSISMC2G 0x00F0
363#define SSB_SPROM8_RSSISMC2G_SHIFT 4
364#define SSB_SPROM8_RSSISAV2G 0x0700
365#define SSB_SPROM8_RSSISAV2G_SHIFT 8
366#define SSB_SPROM8_BXA2G 0x1800
367#define SSB_SPROM8_BXA2G_SHIFT 11
368#define SSB_SPROM8_RSSIPARM5G 0x10A6 /* RSSI params for 5GHz */
369#define SSB_SPROM8_RSSISMF5G 0x000F
370#define SSB_SPROM8_RSSISMC5G 0x00F0
371#define SSB_SPROM8_RSSISMC5G_SHIFT 4
372#define SSB_SPROM8_RSSISAV5G 0x0700
373#define SSB_SPROM8_RSSISAV5G_SHIFT 8
374#define SSB_SPROM8_BXA5G 0x1800
375#define SSB_SPROM8_BXA5G_SHIFT 11
376#define SSB_SPROM8_TRI25G 0x10A8 /* TX isolation 2.4&5.3GHz */
377#define SSB_SPROM8_TRI2G 0x00FF /* TX isolation 2.4GHz */
378#define SSB_SPROM8_TRI5G 0xFF00 /* TX isolation 5.3GHz */
379#define SSB_SPROM8_TRI5G_SHIFT 8
380#define SSB_SPROM8_TRI5GHL 0x10AA /* TX isolation 5.2/5.8GHz */
381#define SSB_SPROM8_TRI5GL 0x00FF /* TX isolation 5.2GHz */
382#define SSB_SPROM8_TRI5GH 0xFF00 /* TX isolation 5.8GHz */
383#define SSB_SPROM8_TRI5GH_SHIFT 8
384#define SSB_SPROM8_RXPO 0x10AC /* RX power offsets */
385#define SSB_SPROM8_RXPO2G 0x00FF /* 2GHz RX power offset */
386#define SSB_SPROM8_RXPO5G 0xFF00 /* 5GHz RX power offset */
387#define SSB_SPROM8_RXPO5G_SHIFT 8
388#define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power 2GHz in path 1 */
389#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */
359#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ 390#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */
360#define SSB_SPROM8_ITSSI_BG_SHIFT 8 391#define SSB_SPROM8_ITSSI_BG_SHIFT 8
361#define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power A in path 1 */ 392#define SSB_SPROM8_PA0B0 0x10C2 /* 2GHz power amp settings */
362#define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power A */ 393#define SSB_SPROM8_PA0B1 0x10C4
394#define SSB_SPROM8_PA0B2 0x10C6
395#define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power 5.3GHz */
396#define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power 5.3GHz */
363#define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ 397#define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */
364#define SSB_SPROM8_ITSSI_A_SHIFT 8 398#define SSB_SPROM8_ITSSI_A_SHIFT 8
399#define SSB_SPROM8_MAXP_AHL 0x10CA /* Max Power 5.2/5.8GHz */
400#define SSB_SPROM8_MAXP_AH_MASK 0x00FF /* Mask for Max Power 5.8GHz */
401#define SSB_SPROM8_MAXP_AL_MASK 0xFF00 /* Mask for Max Power 5.2GHz */
402#define SSB_SPROM8_MAXP_AL_SHIFT 8
403#define SSB_SPROM8_PA1B0 0x10CC /* 5.3GHz power amp settings */
404#define SSB_SPROM8_PA1B1 0x10CE
405#define SSB_SPROM8_PA1B2 0x10D0
406#define SSB_SPROM8_PA1LOB0 0x10D2 /* 5.2GHz power amp settings */
407#define SSB_SPROM8_PA1LOB1 0x10D4
408#define SSB_SPROM8_PA1LOB2 0x10D6
409#define SSB_SPROM8_PA1HIB0 0x10D8 /* 5.8GHz power amp settings */
410#define SSB_SPROM8_PA1HIB1 0x10DA
411#define SSB_SPROM8_PA1HIB2 0x10DC
412#define SSB_SPROM8_CCK2GPO 0x1140 /* CCK power offset */
413#define SSB_SPROM8_OFDM2GPO 0x1142 /* 2.4GHz OFDM power offset */
414#define SSB_SPROM8_OFDM5GPO 0x1146 /* 5.3GHz OFDM power offset */
415#define SSB_SPROM8_OFDM5GLPO 0x114A /* 5.2GHz OFDM power offset */
416#define SSB_SPROM8_OFDM5GHPO 0x114E /* 5.8GHz OFDM power offset */
365 417
366/* Values for SSB_SPROM1_BINF_CCODE */ 418/* Values for SSB_SPROM1_BINF_CCODE */
367enum { 419enum {
diff --git a/include/linux/tboot.h b/include/linux/tboot.h
new file mode 100644
index 000000000000..bf2a0c748878
--- /dev/null
+++ b/include/linux/tboot.h
@@ -0,0 +1,162 @@
1/*
2 * tboot.h: shared data structure with tboot and kernel and functions
3 * used by kernel for runtime support of Intel(R) Trusted
4 * Execution Technology
5 *
6 * Copyright (c) 2006-2009, Intel Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 */
22
23#ifndef _LINUX_TBOOT_H
24#define _LINUX_TBOOT_H
25
26/* these must have the values from 0-5 in this order */
27enum {
28 TB_SHUTDOWN_REBOOT = 0,
29 TB_SHUTDOWN_S5,
30 TB_SHUTDOWN_S4,
31 TB_SHUTDOWN_S3,
32 TB_SHUTDOWN_HALT,
33 TB_SHUTDOWN_WFS
34};
35
36#ifdef CONFIG_INTEL_TXT
37#include <acpi/acpi.h>
38/* used to communicate between tboot and the launched kernel */
39
40#define TB_KEY_SIZE 64 /* 512 bits */
41
42#define MAX_TB_MAC_REGIONS 32
43
44struct tboot_mac_region {
45 u64 start; /* must be 64 byte -aligned */
46 u32 size; /* must be 64 byte -granular */
47} __packed;
48
49/* GAS - Generic Address Structure (ACPI 2.0+) */
50struct tboot_acpi_generic_address {
51 u8 space_id;
52 u8 bit_width;
53 u8 bit_offset;
54 u8 access_width;
55 u64 address;
56} __packed;
57
58/*
59 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec
60 * (http://www.acpi.info/)
61 */
62struct tboot_acpi_sleep_info {
63 struct tboot_acpi_generic_address pm1a_cnt_blk;
64 struct tboot_acpi_generic_address pm1b_cnt_blk;
65 struct tboot_acpi_generic_address pm1a_evt_blk;
66 struct tboot_acpi_generic_address pm1b_evt_blk;
67 u16 pm1a_cnt_val;
68 u16 pm1b_cnt_val;
69 u64 wakeup_vector;
70 u32 vector_width;
71 u64 kernel_s3_resume_vector;
72} __packed;
73
74/*
75 * shared memory page used for communication between tboot and kernel
76 */
77struct tboot {
78 /*
79 * version 3+ fields:
80 */
81
82 /* TBOOT_UUID */
83 u8 uuid[16];
84
85 /* version number: 5 is current */
86 u32 version;
87
88 /* physical addr of tb_log_t log */
89 u32 log_addr;
90
91 /*
92 * physical addr of entry point for tboot shutdown and
93 * type of shutdown (TB_SHUTDOWN_*) being requested
94 */
95 u32 shutdown_entry;
96 u32 shutdown_type;
97
98 /* kernel-specified ACPI info for Sx shutdown */
99 struct tboot_acpi_sleep_info acpi_sinfo;
100
101 /* tboot location in memory (physical) */
102 u32 tboot_base;
103 u32 tboot_size;
104
105 /* memory regions (phys addrs) for tboot to MAC on S3 */
106 u8 num_mac_regions;
107 struct tboot_mac_region mac_regions[MAX_TB_MAC_REGIONS];
108
109
110 /*
111 * version 4+ fields:
112 */
113
114 /* symmetric key for use by kernel; will be encrypted on S3 */
115 u8 s3_key[TB_KEY_SIZE];
116
117
118 /*
119 * version 5+ fields:
120 */
121
122 /* used to 4byte-align num_in_wfs */
123 u8 reserved_align[3];
124
125 /* number of processors in wait-for-SIPI */
126 u32 num_in_wfs;
127} __packed;
128
129/*
130 * UUID for tboot data struct to facilitate matching
131 * defined as {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} by tboot, which is
132 * represented as {} in the char array used here
133 */
134#define TBOOT_UUID {0xff, 0x8d, 0x3c, 0x66, 0xb3, 0xe8, 0x82, 0x4b, 0xbf,\
135 0xaa, 0x19, 0xea, 0x4d, 0x5, 0x7a, 0x8}
136
137extern struct tboot *tboot;
138
139static inline int tboot_enabled(void)
140{
141 return tboot != NULL;
142}
143
144extern void tboot_probe(void);
145extern void tboot_shutdown(u32 shutdown_type);
146extern void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control);
147extern struct acpi_table_header *tboot_get_dmar_table(
148 struct acpi_table_header *dmar_tbl);
149extern int tboot_force_iommu(void);
150
151#else
152
153#define tboot_probe() do { } while (0)
154#define tboot_shutdown(shutdown_type) do { } while (0)
155#define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \
156 do { } while (0)
157#define tboot_get_dmar_table(dmar_tbl) (dmar_tbl)
158#define tboot_force_iommu() 0
159
160#endif /* !CONFIG_INTEL_TXT */
161
162#endif /* _LINUX_TBOOT_H */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 8afac76cd748..61723a7c21fe 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -233,7 +233,7 @@ struct tcp_request_sock {
233 struct inet_request_sock req; 233 struct inet_request_sock req;
234#ifdef CONFIG_TCP_MD5SIG 234#ifdef CONFIG_TCP_MD5SIG
235 /* Only used by TCP MD5 Signature so far. */ 235 /* Only used by TCP MD5 Signature so far. */
236 struct tcp_request_sock_ops *af_specific; 236 const struct tcp_request_sock_ops *af_specific;
237#endif 237#endif
238 u32 rcv_isn; 238 u32 rcv_isn;
239 u32 snt_isn; 239 u32 snt_isn;
@@ -401,9 +401,9 @@ struct tcp_sock {
401 401
402#ifdef CONFIG_TCP_MD5SIG 402#ifdef CONFIG_TCP_MD5SIG
403/* TCP AF-Specific parts; only used by MD5 Signature support so far */ 403/* TCP AF-Specific parts; only used by MD5 Signature support so far */
404 struct tcp_sock_af_ops *af_specific; 404 const struct tcp_sock_af_ops *af_specific;
405 405
406/* TCP MD5 Signagure Option information */ 406/* TCP MD5 Signature Option information */
407 struct tcp_md5sig_info *md5sig_info; 407 struct tcp_md5sig_info *md5sig_info;
408#endif 408#endif
409}; 409};
diff --git a/include/linux/tipc.h b/include/linux/tipc.h
index bea469455a0c..3d92396639de 100644
--- a/include/linux/tipc.h
+++ b/include/linux/tipc.h
@@ -209,5 +209,7 @@ struct sockaddr_tipc {
209#define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */ 209#define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */
210#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */ 210#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */
211#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */ 211#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */
212#define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */
213#define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */
212 214
213#endif 215#endif
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 85e8cf7d393c..809b26c07090 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -95,14 +95,12 @@ int arch_update_cpu_topology(void);
95 | 1*SD_BALANCE_NEWIDLE \ 95 | 1*SD_BALANCE_NEWIDLE \
96 | 1*SD_BALANCE_EXEC \ 96 | 1*SD_BALANCE_EXEC \
97 | 1*SD_BALANCE_FORK \ 97 | 1*SD_BALANCE_FORK \
98 | 0*SD_WAKE_IDLE \ 98 | 0*SD_BALANCE_WAKE \
99 | 1*SD_WAKE_AFFINE \ 99 | 1*SD_WAKE_AFFINE \
100 | 1*SD_WAKE_BALANCE \
101 | 1*SD_SHARE_CPUPOWER \ 100 | 1*SD_SHARE_CPUPOWER \
102 | 0*SD_POWERSAVINGS_BALANCE \ 101 | 0*SD_POWERSAVINGS_BALANCE \
103 | 0*SD_SHARE_PKG_RESOURCES \ 102 | 0*SD_SHARE_PKG_RESOURCES \
104 | 0*SD_SERIALIZE \ 103 | 0*SD_SERIALIZE \
105 | 0*SD_WAKE_IDLE_FAR \
106 | 0*SD_PREFER_SIBLING \ 104 | 0*SD_PREFER_SIBLING \
107 , \ 105 , \
108 .last_balance = jiffies, \ 106 .last_balance = jiffies, \
@@ -122,20 +120,19 @@ int arch_update_cpu_topology(void);
122 .imbalance_pct = 125, \ 120 .imbalance_pct = 125, \
123 .cache_nice_tries = 1, \ 121 .cache_nice_tries = 1, \
124 .busy_idx = 2, \ 122 .busy_idx = 2, \
125 .wake_idx = 1, \ 123 .wake_idx = 0, \
126 .forkexec_idx = 1, \ 124 .forkexec_idx = 0, \
127 \ 125 \
128 .flags = 1*SD_LOAD_BALANCE \ 126 .flags = 1*SD_LOAD_BALANCE \
129 | 1*SD_BALANCE_NEWIDLE \ 127 | 1*SD_BALANCE_NEWIDLE \
130 | 1*SD_BALANCE_EXEC \ 128 | 1*SD_BALANCE_EXEC \
131 | 1*SD_BALANCE_FORK \ 129 | 1*SD_BALANCE_FORK \
132 | 1*SD_WAKE_IDLE \ 130 | 0*SD_BALANCE_WAKE \
133 | 1*SD_WAKE_AFFINE \ 131 | 1*SD_WAKE_AFFINE \
134 | 1*SD_WAKE_BALANCE \ 132 | 1*SD_PREFER_LOCAL \
135 | 0*SD_SHARE_CPUPOWER \ 133 | 0*SD_SHARE_CPUPOWER \
136 | 1*SD_SHARE_PKG_RESOURCES \ 134 | 1*SD_SHARE_PKG_RESOURCES \
137 | 0*SD_SERIALIZE \ 135 | 0*SD_SERIALIZE \
138 | 0*SD_WAKE_IDLE_FAR \
139 | sd_balance_for_mc_power() \ 136 | sd_balance_for_mc_power() \
140 | sd_power_saving_flags() \ 137 | sd_power_saving_flags() \
141 , \ 138 , \
@@ -155,21 +152,20 @@ int arch_update_cpu_topology(void);
155 .cache_nice_tries = 1, \ 152 .cache_nice_tries = 1, \
156 .busy_idx = 2, \ 153 .busy_idx = 2, \
157 .idle_idx = 1, \ 154 .idle_idx = 1, \
158 .newidle_idx = 2, \ 155 .newidle_idx = 0, \
159 .wake_idx = 1, \ 156 .wake_idx = 0, \
160 .forkexec_idx = 1, \ 157 .forkexec_idx = 0, \
161 \ 158 \
162 .flags = 1*SD_LOAD_BALANCE \ 159 .flags = 1*SD_LOAD_BALANCE \
163 | 1*SD_BALANCE_NEWIDLE \ 160 | 1*SD_BALANCE_NEWIDLE \
164 | 1*SD_BALANCE_EXEC \ 161 | 1*SD_BALANCE_EXEC \
165 | 1*SD_BALANCE_FORK \ 162 | 1*SD_BALANCE_FORK \
166 | 1*SD_WAKE_IDLE \ 163 | 0*SD_BALANCE_WAKE \
167 | 0*SD_WAKE_AFFINE \ 164 | 1*SD_WAKE_AFFINE \
168 | 1*SD_WAKE_BALANCE \ 165 | 1*SD_PREFER_LOCAL \
169 | 0*SD_SHARE_CPUPOWER \ 166 | 0*SD_SHARE_CPUPOWER \
170 | 0*SD_SHARE_PKG_RESOURCES \ 167 | 0*SD_SHARE_PKG_RESOURCES \
171 | 0*SD_SERIALIZE \ 168 | 0*SD_SERIALIZE \
172 | 0*SD_WAKE_IDLE_FAR \
173 | sd_balance_for_package_power() \ 169 | sd_balance_for_package_power() \
174 | sd_power_saving_flags() \ 170 | sd_power_saving_flags() \
175 , \ 171 , \
@@ -191,14 +187,12 @@ int arch_update_cpu_topology(void);
191 | 1*SD_BALANCE_NEWIDLE \ 187 | 1*SD_BALANCE_NEWIDLE \
192 | 0*SD_BALANCE_EXEC \ 188 | 0*SD_BALANCE_EXEC \
193 | 0*SD_BALANCE_FORK \ 189 | 0*SD_BALANCE_FORK \
194 | 0*SD_WAKE_IDLE \ 190 | 0*SD_BALANCE_WAKE \
195 | 1*SD_WAKE_AFFINE \ 191 | 0*SD_WAKE_AFFINE \
196 | 0*SD_WAKE_BALANCE \
197 | 0*SD_SHARE_CPUPOWER \ 192 | 0*SD_SHARE_CPUPOWER \
198 | 0*SD_POWERSAVINGS_BALANCE \ 193 | 0*SD_POWERSAVINGS_BALANCE \
199 | 0*SD_SHARE_PKG_RESOURCES \ 194 | 0*SD_SHARE_PKG_RESOURCES \
200 | 1*SD_SERIALIZE \ 195 | 1*SD_SERIALIZE \
201 | 1*SD_WAKE_IDLE_FAR \
202 | 0*SD_PREFER_SIBLING \ 196 | 0*SD_PREFER_SIBLING \
203 , \ 197 , \
204 .last_balance = jiffies, \ 198 .last_balance = jiffies, \
diff --git a/include/linux/transport_class.h b/include/linux/transport_class.h
index eaec1ea9558e..9ae8da3e6407 100644
--- a/include/linux/transport_class.h
+++ b/include/linux/transport_class.h
@@ -55,7 +55,7 @@ struct anon_transport_class cls = { \
55 55
56struct transport_container { 56struct transport_container {
57 struct attribute_container ac; 57 struct attribute_container ac;
58 struct attribute_group *statistics; 58 const struct attribute_group *statistics;
59}; 59};
60 60
61#define attribute_container_to_transport_container(x) \ 61#define attribute_container_to_transport_container(x) \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 0d3974f59c53..a916a318004e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -519,10 +519,6 @@ extern void serial_console_init(void);
519 519
520extern int pcxe_open(struct tty_struct *tty, struct file *filp); 520extern int pcxe_open(struct tty_struct *tty, struct file *filp);
521 521
522/* printk.c */
523
524extern void console_print(const char *);
525
526/* vt.c */ 522/* vt.c */
527 523
528extern int vt_ioctl(struct tty_struct *tty, struct file *file, 524extern int vt_ioctl(struct tty_struct *tty, struct file *file,
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h
index 37836b937d97..1ef1ebc2b04f 100644
--- a/include/linux/usb/rndis_host.h
+++ b/include/linux/usb/rndis_host.h
@@ -70,12 +70,13 @@ struct rndis_msg_hdr {
70#define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) 70#define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION)
71 71
72/* codes for "status" field of completion messages */ 72/* codes for "status" field of completion messages */
73#define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000) 73#define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000)
74#define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001) 74#define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001)
75#define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015) 75#define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015)
76#define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb) 76#define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb)
77#define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b) 77#define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b)
78#define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c) 78#define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c)
79#define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION cpu_to_le32(0x40010012)
79 80
80/* codes for OID_GEN_PHYSICAL_MEDIUM */ 81/* codes for OID_GEN_PHYSICAL_MEDIUM */
81#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000) 82#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000)
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 310e18a880ff..bb69e256cd16 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -53,6 +53,7 @@ struct usbnet {
53 struct sk_buff_head rxq; 53 struct sk_buff_head rxq;
54 struct sk_buff_head txq; 54 struct sk_buff_head txq;
55 struct sk_buff_head done; 55 struct sk_buff_head done;
56 struct sk_buff_head rxq_pause;
56 struct urb *interrupt; 57 struct urb *interrupt;
57 struct tasklet_struct bh; 58 struct tasklet_struct bh;
58 59
@@ -63,6 +64,7 @@ struct usbnet {
63# define EVENT_RX_MEMORY 2 64# define EVENT_RX_MEMORY 2
64# define EVENT_STS_SPLIT 3 65# define EVENT_STS_SPLIT 3
65# define EVENT_LINK_RESET 4 66# define EVENT_LINK_RESET 4
67# define EVENT_RX_PAUSED 5
66}; 68};
67 69
68static inline struct usb_driver *driver_of(struct usb_interface *intf) 70static inline struct usb_driver *driver_of(struct usb_interface *intf)
@@ -86,6 +88,7 @@ struct driver_info {
86 88
87#define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */ 89#define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */
88#define FLAG_WLAN 0x0080 /* use "wlan%d" names */ 90#define FLAG_WLAN 0x0080 /* use "wlan%d" names */
91#define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */
89 92
90 93
91 /* init device ... can sleep, or cause probe() failure */ 94 /* init device ... can sleep, or cause probe() failure */
@@ -97,6 +100,9 @@ struct driver_info {
97 /* reset device ... can sleep */ 100 /* reset device ... can sleep */
98 int (*reset)(struct usbnet *); 101 int (*reset)(struct usbnet *);
99 102
103 /* stop device ... can sleep */
104 int (*stop)(struct usbnet *);
105
100 /* see if peer is connected ... can sleep */ 106 /* see if peer is connected ... can sleep */
101 int (*check_connect)(struct usbnet *); 107 int (*check_connect)(struct usbnet *);
102 108
@@ -118,9 +124,8 @@ struct driver_info {
118 * right after minidriver have initialized hardware. */ 124 * right after minidriver have initialized hardware. */
119 int (*early_init)(struct usbnet *dev); 125 int (*early_init)(struct usbnet *dev);
120 126
121 /* called by minidriver when link state changes, state: 0=disconnect, 127 /* called by minidriver when receiving indication */
122 * 1=connect */ 128 void (*indication)(struct usbnet *dev, void *ind, int indlen);
123 void (*link_change)(struct usbnet *dev, int state);
124 129
125 /* for new devices, use the descriptor-reading code instead */ 130 /* for new devices, use the descriptor-reading code instead */
126 int in; /* rx endpoint */ 131 int in; /* rx endpoint */
@@ -177,7 +182,8 @@ struct skb_data { /* skb->cb is one of these */
177 182
178extern int usbnet_open (struct net_device *net); 183extern int usbnet_open (struct net_device *net);
179extern int usbnet_stop (struct net_device *net); 184extern int usbnet_stop (struct net_device *net);
180extern int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net); 185extern netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
186 struct net_device *net);
181extern void usbnet_tx_timeout (struct net_device *net); 187extern void usbnet_tx_timeout (struct net_device *net);
182extern int usbnet_change_mtu (struct net_device *net, int new_mtu); 188extern int usbnet_change_mtu (struct net_device *net, int new_mtu);
183 189
@@ -187,6 +193,10 @@ extern void usbnet_defer_kevent (struct usbnet *, int);
187extern void usbnet_skb_return (struct usbnet *, struct sk_buff *); 193extern void usbnet_skb_return (struct usbnet *, struct sk_buff *);
188extern void usbnet_unlink_rx_urbs(struct usbnet *); 194extern void usbnet_unlink_rx_urbs(struct usbnet *);
189 195
196extern void usbnet_pause_rx(struct usbnet *);
197extern void usbnet_resume_rx(struct usbnet *);
198extern void usbnet_purge_paused_rxq(struct usbnet *);
199
190extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd); 200extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd);
191extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd); 201extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd);
192extern u32 usbnet_get_link (struct net_device *net); 202extern u32 usbnet_get_link (struct net_device *net);
diff --git a/include/linux/usb/video.h b/include/linux/usb/video.h
new file mode 100644
index 000000000000..be436d9ee479
--- /dev/null
+++ b/include/linux/usb/video.h
@@ -0,0 +1,164 @@
1/*
2 * USB Video Class definitions.
3 *
4 * Copyright (C) 2009 Laurent Pinchart <laurent.pinchart@skynet.be>
5 *
6 * This file holds USB constants and structures defined by the USB Device
7 * Class Definition for Video Devices. Unless otherwise stated, comments
8 * below reference relevant sections of the USB Video Class 1.1 specification
9 * available at
10 *
11 * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip
12 */
13
14#ifndef __LINUX_USB_VIDEO_H
15#define __LINUX_USB_VIDEO_H
16
17#include <linux/types.h>
18
19/* --------------------------------------------------------------------------
20 * UVC constants
21 */
22
23/* A.2. Video Interface Subclass Codes */
24#define UVC_SC_UNDEFINED 0x00
25#define UVC_SC_VIDEOCONTROL 0x01
26#define UVC_SC_VIDEOSTREAMING 0x02
27#define UVC_SC_VIDEO_INTERFACE_COLLECTION 0x03
28
29/* A.3. Video Interface Protocol Codes */
30#define UVC_PC_PROTOCOL_UNDEFINED 0x00
31
32/* A.5. Video Class-Specific VC Interface Descriptor Subtypes */
33#define UVC_VC_DESCRIPTOR_UNDEFINED 0x00
34#define UVC_VC_HEADER 0x01
35#define UVC_VC_INPUT_TERMINAL 0x02
36#define UVC_VC_OUTPUT_TERMINAL 0x03
37#define UVC_VC_SELECTOR_UNIT 0x04
38#define UVC_VC_PROCESSING_UNIT 0x05
39#define UVC_VC_EXTENSION_UNIT 0x06
40
41/* A.6. Video Class-Specific VS Interface Descriptor Subtypes */
42#define UVC_VS_UNDEFINED 0x00
43#define UVC_VS_INPUT_HEADER 0x01
44#define UVC_VS_OUTPUT_HEADER 0x02
45#define UVC_VS_STILL_IMAGE_FRAME 0x03
46#define UVC_VS_FORMAT_UNCOMPRESSED 0x04
47#define UVC_VS_FRAME_UNCOMPRESSED 0x05
48#define UVC_VS_FORMAT_MJPEG 0x06
49#define UVC_VS_FRAME_MJPEG 0x07
50#define UVC_VS_FORMAT_MPEG2TS 0x0a
51#define UVC_VS_FORMAT_DV 0x0c
52#define UVC_VS_COLORFORMAT 0x0d
53#define UVC_VS_FORMAT_FRAME_BASED 0x10
54#define UVC_VS_FRAME_FRAME_BASED 0x11
55#define UVC_VS_FORMAT_STREAM_BASED 0x12
56
57/* A.7. Video Class-Specific Endpoint Descriptor Subtypes */
58#define UVC_EP_UNDEFINED 0x00
59#define UVC_EP_GENERAL 0x01
60#define UVC_EP_ENDPOINT 0x02
61#define UVC_EP_INTERRUPT 0x03
62
63/* A.8. Video Class-Specific Request Codes */
64#define UVC_RC_UNDEFINED 0x00
65#define UVC_SET_CUR 0x01
66#define UVC_GET_CUR 0x81
67#define UVC_GET_MIN 0x82
68#define UVC_GET_MAX 0x83
69#define UVC_GET_RES 0x84
70#define UVC_GET_LEN 0x85
71#define UVC_GET_INFO 0x86
72#define UVC_GET_DEF 0x87
73
74/* A.9.1. VideoControl Interface Control Selectors */
75#define UVC_VC_CONTROL_UNDEFINED 0x00
76#define UVC_VC_VIDEO_POWER_MODE_CONTROL 0x01
77#define UVC_VC_REQUEST_ERROR_CODE_CONTROL 0x02
78
79/* A.9.2. Terminal Control Selectors */
80#define UVC_TE_CONTROL_UNDEFINED 0x00
81
82/* A.9.3. Selector Unit Control Selectors */
83#define UVC_SU_CONTROL_UNDEFINED 0x00
84#define UVC_SU_INPUT_SELECT_CONTROL 0x01
85
86/* A.9.4. Camera Terminal Control Selectors */
87#define UVC_CT_CONTROL_UNDEFINED 0x00
88#define UVC_CT_SCANNING_MODE_CONTROL 0x01
89#define UVC_CT_AE_MODE_CONTROL 0x02
90#define UVC_CT_AE_PRIORITY_CONTROL 0x03
91#define UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
92#define UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
93#define UVC_CT_FOCUS_ABSOLUTE_CONTROL 0x06
94#define UVC_CT_FOCUS_RELATIVE_CONTROL 0x07
95#define UVC_CT_FOCUS_AUTO_CONTROL 0x08
96#define UVC_CT_IRIS_ABSOLUTE_CONTROL 0x09
97#define UVC_CT_IRIS_RELATIVE_CONTROL 0x0a
98#define UVC_CT_ZOOM_ABSOLUTE_CONTROL 0x0b
99#define UVC_CT_ZOOM_RELATIVE_CONTROL 0x0c
100#define UVC_CT_PANTILT_ABSOLUTE_CONTROL 0x0d
101#define UVC_CT_PANTILT_RELATIVE_CONTROL 0x0e
102#define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f
103#define UVC_CT_ROLL_RELATIVE_CONTROL 0x10
104#define UVC_CT_PRIVACY_CONTROL 0x11
105
106/* A.9.5. Processing Unit Control Selectors */
107#define UVC_PU_CONTROL_UNDEFINED 0x00
108#define UVC_PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
109#define UVC_PU_BRIGHTNESS_CONTROL 0x02
110#define UVC_PU_CONTRAST_CONTROL 0x03
111#define UVC_PU_GAIN_CONTROL 0x04
112#define UVC_PU_POWER_LINE_FREQUENCY_CONTROL 0x05
113#define UVC_PU_HUE_CONTROL 0x06
114#define UVC_PU_SATURATION_CONTROL 0x07
115#define UVC_PU_SHARPNESS_CONTROL 0x08
116#define UVC_PU_GAMMA_CONTROL 0x09
117#define UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0a
118#define UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0b
119#define UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0c
120#define UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0d
121#define UVC_PU_DIGITAL_MULTIPLIER_CONTROL 0x0e
122#define UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0f
123#define UVC_PU_HUE_AUTO_CONTROL 0x10
124#define UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
125#define UVC_PU_ANALOG_LOCK_STATUS_CONTROL 0x12
126
127/* A.9.7. VideoStreaming Interface Control Selectors */
128#define UVC_VS_CONTROL_UNDEFINED 0x00
129#define UVC_VS_PROBE_CONTROL 0x01
130#define UVC_VS_COMMIT_CONTROL 0x02
131#define UVC_VS_STILL_PROBE_CONTROL 0x03
132#define UVC_VS_STILL_COMMIT_CONTROL 0x04
133#define UVC_VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
134#define UVC_VS_STREAM_ERROR_CODE_CONTROL 0x06
135#define UVC_VS_GENERATE_KEY_FRAME_CONTROL 0x07
136#define UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
137#define UVC_VS_SYNC_DELAY_CONTROL 0x09
138
139/* B.1. USB Terminal Types */
140#define UVC_TT_VENDOR_SPECIFIC 0x0100
141#define UVC_TT_STREAMING 0x0101
142
143/* B.2. Input Terminal Types */
144#define UVC_ITT_VENDOR_SPECIFIC 0x0200
145#define UVC_ITT_CAMERA 0x0201
146#define UVC_ITT_MEDIA_TRANSPORT_INPUT 0x0202
147
148/* B.3. Output Terminal Types */
149#define UVC_OTT_VENDOR_SPECIFIC 0x0300
150#define UVC_OTT_DISPLAY 0x0301
151#define UVC_OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
152
153/* B.4. External Terminal Types */
154#define UVC_EXTERNAL_VENDOR_SPECIFIC 0x0400
155#define UVC_COMPOSITE_CONNECTOR 0x0401
156#define UVC_SVIDEO_CONNECTOR 0x0402
157#define UVC_COMPONENT_CONNECTOR 0x0403
158
159/* 2.4.2.2. Status Packet Type */
160#define UVC_STATUS_TYPE_CONTROL 1
161#define UVC_STATUS_TYPE_STREAMING 2
162
163#endif /* __LINUX_USB_VIDEO_H */
164
diff --git a/include/linux/uwb.h b/include/linux/uwb.h
index c02128991ff7..7fc9746f22cd 100644
--- a/include/linux/uwb.h
+++ b/include/linux/uwb.h
@@ -597,7 +597,7 @@ void uwb_rc_neh_grok(struct uwb_rc *, void *, size_t);
597void uwb_rc_neh_error(struct uwb_rc *, int); 597void uwb_rc_neh_error(struct uwb_rc *, int);
598void uwb_rc_reset_all(struct uwb_rc *rc); 598void uwb_rc_reset_all(struct uwb_rc *rc);
599void uwb_rc_pre_reset(struct uwb_rc *rc); 599void uwb_rc_pre_reset(struct uwb_rc *rc);
600void uwb_rc_post_reset(struct uwb_rc *rc); 600int uwb_rc_post_reset(struct uwb_rc *rc);
601 601
602/** 602/**
603 * uwb_rsv_is_owner - is the owner of this reservation the RC? 603 * uwb_rsv_is_owner - is the owner of this reservation the RC?
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
new file mode 100644
index 000000000000..e81c64af80c1
--- /dev/null
+++ b/include/linux/vgaarb.h
@@ -0,0 +1,200 @@
1/*
2 * vgaarb.c
3 *
4 * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org>
5 * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com>
6 * (C) Copyright 2007, 2009 Tiago Vignatti <vignatti@freedesktop.org>
7 */
8
9#ifndef LINUX_VGA_H
10
11#include <asm/vga.h>
12
13/* Legacy VGA regions */
14#define VGA_RSRC_NONE 0x00
15#define VGA_RSRC_LEGACY_IO 0x01
16#define VGA_RSRC_LEGACY_MEM 0x02
17#define VGA_RSRC_LEGACY_MASK (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM)
18/* Non-legacy access */
19#define VGA_RSRC_NORMAL_IO 0x04
20#define VGA_RSRC_NORMAL_MEM 0x08
21
22/* Passing that instead of a pci_dev to use the system "default"
23 * device, that is the one used by vgacon. Archs will probably
24 * have to provide their own vga_default_device();
25 */
26#define VGA_DEFAULT_DEVICE (NULL)
27
28/* For use by clients */
29
30/**
31 * vga_set_legacy_decoding
32 *
33 * @pdev: pci device of the VGA card
34 * @decodes: bit mask of what legacy regions the card decodes
35 *
36 * Indicates to the arbiter if the card decodes legacy VGA IOs,
37 * legacy VGA Memory, both, or none. All cards default to both,
38 * the card driver (fbdev for example) should tell the arbiter
39 * if it has disabled legacy decoding, so the card can be left
40 * out of the arbitration process (and can be safe to take
41 * interrupts at any time.
42 */
43extern void vga_set_legacy_decoding(struct pci_dev *pdev,
44 unsigned int decodes);
45
46/**
47 * vga_get - acquire & locks VGA resources
48 *
49 * @pdev: pci device of the VGA card or NULL for the system default
50 * @rsrc: bit mask of resources to acquire and lock
51 * @interruptible: blocking should be interruptible by signals ?
52 *
53 * This function acquires VGA resources for the given
54 * card and mark those resources locked. If the resource requested
55 * are "normal" (and not legacy) resources, the arbiter will first check
56 * wether the card is doing legacy decoding for that type of resource. If
57 * yes, the lock is "converted" into a legacy resource lock.
58 * The arbiter will first look for all VGA cards that might conflict
59 * and disable their IOs and/or Memory access, inlcuding VGA forwarding
60 * on P2P bridges if necessary, so that the requested resources can
61 * be used. Then, the card is marked as locking these resources and
62 * the IO and/or Memory accesse are enabled on the card (including
63 * VGA forwarding on parent P2P bridges if any).
64 * This function will block if some conflicting card is already locking
65 * one of the required resources (or any resource on a different bus
66 * segment, since P2P bridges don't differenciate VGA memory and IO
67 * afaik). You can indicate wether this blocking should be interruptible
68 * by a signal (for userland interface) or not.
69 * Must not be called at interrupt time or in atomic context.
70 * If the card already owns the resources, the function succeeds.
71 * Nested calls are supported (a per-resource counter is maintained)
72 */
73
74extern int vga_get(struct pci_dev *pdev, unsigned int rsrc,
75 int interruptible);
76
77/**
78 * vga_get_interruptible
79 *
80 * Shortcut to vga_get
81 */
82
83static inline int vga_get_interruptible(struct pci_dev *pdev,
84 unsigned int rsrc)
85{
86 return vga_get(pdev, rsrc, 1);
87}
88
89/**
90 * vga_get_uninterruptible
91 *
92 * Shortcut to vga_get
93 */
94
95static inline int vga_get_uninterruptible(struct pci_dev *pdev,
96 unsigned int rsrc)
97{
98 return vga_get(pdev, rsrc, 0);
99}
100
101/**
102 * vga_tryget - try to acquire & lock legacy VGA resources
103 *
104 * @pdev: pci devivce of VGA card or NULL for system default
105 * @rsrc: bit mask of resources to acquire and lock
106 *
107 * This function performs the same operation as vga_get(), but
108 * will return an error (-EBUSY) instead of blocking if the resources
109 * are already locked by another card. It can be called in any context
110 */
111
112extern int vga_tryget(struct pci_dev *pdev, unsigned int rsrc);
113
114/**
115 * vga_put - release lock on legacy VGA resources
116 *
117 * @pdev: pci device of VGA card or NULL for system default
118 * @rsrc: but mask of resource to release
119 *
120 * This function releases resources previously locked by vga_get()
121 * or vga_tryget(). The resources aren't disabled right away, so
122 * that a subsequence vga_get() on the same card will succeed
123 * immediately. Resources have a counter, so locks are only
124 * released if the counter reaches 0.
125 */
126
127extern void vga_put(struct pci_dev *pdev, unsigned int rsrc);
128
129
130/**
131 * vga_default_device
132 *
133 * This can be defined by the platform. The default implementation
134 * is rather dumb and will probably only work properly on single
135 * vga card setups and/or x86 platforms.
136 *
137 * If your VGA default device is not PCI, you'll have to return
138 * NULL here. In this case, I assume it will not conflict with
139 * any PCI card. If this is not true, I'll have to define two archs
140 * hooks for enabling/disabling the VGA default device if that is
141 * possible. This may be a problem with real _ISA_ VGA cards, in
142 * addition to a PCI one. I don't know at this point how to deal
143 * with that card. Can theirs IOs be disabled at all ? If not, then
144 * I suppose it's a matter of having the proper arch hook telling
145 * us about it, so we basically never allow anybody to succeed a
146 * vga_get()...
147 */
148
149#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
150extern struct pci_dev *vga_default_device(void);
151#endif
152
153/**
154 * vga_conflicts
155 *
156 * Architectures should define this if they have several
157 * independant PCI domains that can afford concurrent VGA
158 * decoding
159 */
160
161#ifndef __ARCH_HAS_VGA_CONFLICT
162static inline int vga_conflicts(struct pci_dev *p1, struct pci_dev *p2)
163{
164 return 1;
165}
166#endif
167
168/**
169 * vga_client_register
170 *
171 * @pdev: pci device of the VGA client
172 * @cookie: client cookie to be used in callbacks
173 * @irq_set_state: irq state change callback
174 * @set_vga_decode: vga decode change callback
175 *
176 * return value: 0 on success, -1 on failure
177 * Register a client with the VGA arbitration logic
178 *
179 * Clients have two callback mechanisms they can use.
180 * irq enable/disable callback -
181 * If a client can't disable its GPUs VGA resources, then we
182 * need to be able to ask it to turn off its irqs when we
183 * turn off its mem and io decoding.
184 * set_vga_decode
185 * If a client can disable its GPU VGA resource, it will
186 * get a callback from this to set the encode/decode state
187 *
188 * Rationale: we cannot disable VGA decode resources unconditionally
189 * some single GPU laptops seem to require ACPI or BIOS access to the
190 * VGA registers to control things like backlights etc.
191 * Hopefully newer multi-GPU laptops do something saner, and desktops
192 * won't have any special ACPI for this.
193 * They driver will get a callback when VGA arbitration is first used
194 * by userspace since we some older X servers have issues.
195 */
196int vga_client_register(struct pci_dev *pdev, void *cookie,
197 void (*irq_set_state)(void *cookie, bool state),
198 unsigned int (*set_vga_decode)(void *cookie, bool state));
199
200#endif /* LINUX_VGA_H */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 74f16876f38d..3689d7d81fe9 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -167,6 +167,7 @@ enum v4l2_ctrl_type {
167 V4L2_CTRL_TYPE_BUTTON = 4, 167 V4L2_CTRL_TYPE_BUTTON = 4,
168 V4L2_CTRL_TYPE_INTEGER64 = 5, 168 V4L2_CTRL_TYPE_INTEGER64 = 5,
169 V4L2_CTRL_TYPE_CTRL_CLASS = 6, 169 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
170 V4L2_CTRL_TYPE_STRING = 7,
170}; 171};
171 172
172enum v4l2_tuner_type { 173enum v4l2_tuner_type {
@@ -252,10 +253,12 @@ struct v4l2_capability {
252#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ 253#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
253#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ 254#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
254#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ 255#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
256#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */
255 257
256#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ 258#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
257#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ 259#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
258#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ 260#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
261#define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */
259 262
260#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ 263#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
261#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ 264#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
@@ -275,7 +278,9 @@ struct v4l2_pix_format {
275 __u32 priv; /* private data, depends on pixelformat */ 278 __u32 priv; /* private data, depends on pixelformat */
276}; 279};
277 280
278/* Pixel format FOURCC depth Description */ 281/* Pixel format FOURCC depth Description */
282
283/* RGB formats */
279#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ 284#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */
280#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ 285#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */
281#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ 286#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */
@@ -286,12 +291,20 @@ struct v4l2_pix_format {
286#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ 291#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
287#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ 292#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
288#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ 293#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */
294
295/* Grey formats */
289#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ 296#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
290#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ 297#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
298
299/* Palette formats */
291#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ 300#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
301
302/* Luminance+Chrominance formats */
292#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */ 303#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
293#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ 304#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
294#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ 305#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
306#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
307#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
295#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ 308#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
296#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */ 309#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
297#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ 310#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
@@ -301,6 +314,10 @@ struct v4l2_pix_format {
301#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ 314#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
302#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ 315#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
303#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ 316#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
317#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
318#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
319#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
320#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
304 321
305/* two planes -- one Y, one Cr + Cb interleaved */ 322/* two planes -- one Y, one Cr + Cb interleaved */
306#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ 323#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
@@ -308,25 +325,17 @@ struct v4l2_pix_format {
308#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ 325#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
309#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ 326#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
310 327
311/* The following formats are not defined in the V4L2 specification */ 328/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
312#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
313#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
314#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
315#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
316#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
317
318/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
319#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ 329#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
320#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ 330#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
321#define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ 331#define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
322 332#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10bit raw bayer */
323/* 333 /* 10bit raw bayer DPCM compressed to 8 bits */
324 * 10bit raw bayer, expanded to 16 bits
325 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
326 */
327#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0')
328/* 10bit raw bayer DPCM compressed to 8 bits */
329#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') 334#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
335 /*
336 * 10bit raw bayer, expanded to 16 bits
337 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
338 */
330#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ 339#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */
331 340
332/* compressed formats */ 341/* compressed formats */
@@ -350,7 +359,6 @@ struct v4l2_pix_format {
350#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ 359#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
351#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ 360#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
352#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ 361#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
353#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
354#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ 362#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
355#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ 363#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
356 364
@@ -367,6 +375,7 @@ struct v4l2_fmtdesc {
367}; 375};
368 376
369#define V4L2_FMT_FLAG_COMPRESSED 0x0001 377#define V4L2_FMT_FLAG_COMPRESSED 0x0001
378#define V4L2_FMT_FLAG_EMULATED 0x0002
370 379
371#if 1 380#if 1
372 /* Experimental Frame Size and frame rate enumeration */ 381 /* Experimental Frame Size and frame rate enumeration */
@@ -788,11 +797,12 @@ struct v4l2_control {
788 797
789struct v4l2_ext_control { 798struct v4l2_ext_control {
790 __u32 id; 799 __u32 id;
791 __u32 reserved2[2]; 800 __u32 size;
801 __u32 reserved2[1];
792 union { 802 union {
793 __s32 value; 803 __s32 value;
794 __s64 value64; 804 __s64 value64;
795 void *reserved; 805 char *string;
796 }; 806 };
797} __attribute__ ((packed)); 807} __attribute__ ((packed));
798 808
@@ -808,6 +818,7 @@ struct v4l2_ext_controls {
808#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ 818#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
809#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ 819#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
810#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ 820#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
821#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */
811 822
812#define V4L2_CTRL_ID_MASK (0x0fffffff) 823#define V4L2_CTRL_ID_MASK (0x0fffffff)
813#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) 824#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
@@ -1147,6 +1158,39 @@ enum v4l2_exposure_auto_type {
1147 1158
1148#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16) 1159#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
1149 1160
1161/* FM Modulator class control IDs */
1162#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
1163#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)
1164
1165#define V4L2_CID_RDS_TX_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 1)
1166#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
1167#define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3)
1168#define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5)
1169#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6)
1170
1171#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64)
1172#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65)
1173#define V4L2_CID_AUDIO_LIMITER_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 66)
1174
1175#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 80)
1176#define V4L2_CID_AUDIO_COMPRESSION_GAIN (V4L2_CID_FM_TX_CLASS_BASE + 81)
1177#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 82)
1178#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 83)
1179#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 84)
1180
1181#define V4L2_CID_PILOT_TONE_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 96)
1182#define V4L2_CID_PILOT_TONE_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 97)
1183#define V4L2_CID_PILOT_TONE_FREQUENCY (V4L2_CID_FM_TX_CLASS_BASE + 98)
1184
1185#define V4L2_CID_TUNE_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 112)
1186enum v4l2_preemphasis {
1187 V4L2_PREEMPHASIS_DISABLED = 0,
1188 V4L2_PREEMPHASIS_50_uS = 1,
1189 V4L2_PREEMPHASIS_75_uS = 2,
1190};
1191#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
1192#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
1193
1150/* 1194/*
1151 * T U N I N G 1195 * T U N I N G
1152 */ 1196 */
@@ -1181,6 +1225,7 @@ struct v4l2_modulator {
1181#define V4L2_TUNER_CAP_LANG2 0x0020 1225#define V4L2_TUNER_CAP_LANG2 0x0020
1182#define V4L2_TUNER_CAP_SAP 0x0020 1226#define V4L2_TUNER_CAP_SAP 0x0020
1183#define V4L2_TUNER_CAP_LANG1 0x0040 1227#define V4L2_TUNER_CAP_LANG1 0x0040
1228#define V4L2_TUNER_CAP_RDS 0x0080
1184 1229
1185/* Flags for the 'rxsubchans' field */ 1230/* Flags for the 'rxsubchans' field */
1186#define V4L2_TUNER_SUB_MONO 0x0001 1231#define V4L2_TUNER_SUB_MONO 0x0001
@@ -1188,6 +1233,7 @@ struct v4l2_modulator {
1188#define V4L2_TUNER_SUB_LANG2 0x0004 1233#define V4L2_TUNER_SUB_LANG2 0x0004
1189#define V4L2_TUNER_SUB_SAP 0x0004 1234#define V4L2_TUNER_SUB_SAP 0x0004
1190#define V4L2_TUNER_SUB_LANG1 0x0008 1235#define V4L2_TUNER_SUB_LANG1 0x0008
1236#define V4L2_TUNER_SUB_RDS 0x0010
1191 1237
1192/* Values for the 'audmode' field */ 1238/* Values for the 'audmode' field */
1193#define V4L2_TUNER_MODE_MONO 0x0000 1239#define V4L2_TUNER_MODE_MONO 0x0000
@@ -1213,6 +1259,27 @@ struct v4l2_hw_freq_seek {
1213}; 1259};
1214 1260
1215/* 1261/*
1262 * R D S
1263 */
1264
1265struct v4l2_rds_data {
1266 __u8 lsb;
1267 __u8 msb;
1268 __u8 block;
1269} __attribute__ ((packed));
1270
1271#define V4L2_RDS_BLOCK_MSK 0x7
1272#define V4L2_RDS_BLOCK_A 0
1273#define V4L2_RDS_BLOCK_B 1
1274#define V4L2_RDS_BLOCK_C 2
1275#define V4L2_RDS_BLOCK_D 3
1276#define V4L2_RDS_BLOCK_C_ALT 4
1277#define V4L2_RDS_BLOCK_INVALID 7
1278
1279#define V4L2_RDS_BLOCK_CORRECTED 0x40
1280#define V4L2_RDS_BLOCK_ERROR 0x80
1281
1282/*
1216 * A U D I O 1283 * A U D I O
1217 */ 1284 */
1218struct v4l2_audio { 1285struct v4l2_audio {
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index a43ebec3a7b9..227c2a585e4f 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -115,4 +115,10 @@ extern rwlock_t vmlist_lock;
115extern struct vm_struct *vmlist; 115extern struct vm_struct *vmlist;
116extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); 116extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
117 117
118struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
119 const size_t *sizes, int nr_vms,
120 size_t align, gfp_t gfp_mask);
121
122void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
123
118#endif /* _LINUX_VMALLOC_H */ 124#endif /* _LINUX_VMALLOC_H */
diff --git a/include/linux/wait.h b/include/linux/wait.h
index cf3c2f5dba51..a48e16b77d5e 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -26,8 +26,8 @@
26#include <asm/current.h> 26#include <asm/current.h>
27 27
28typedef struct __wait_queue wait_queue_t; 28typedef struct __wait_queue wait_queue_t;
29typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync, void *key); 29typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
30int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); 30int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key);
31 31
32struct __wait_queue { 32struct __wait_queue {
33 unsigned int flags; 33 unsigned int flags;
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index cb24204851f7..5b4c6c772a9b 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -1132,6 +1132,14 @@ struct __compat_iw_event {
1132}; 1132};
1133#define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer) 1133#define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer)
1134#define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length) 1134#define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length)
1135
1136/* Size of the various events for compat */
1137#define IW_EV_COMPAT_CHAR_LEN (IW_EV_COMPAT_LCP_LEN + IFNAMSIZ)
1138#define IW_EV_COMPAT_UINT_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(__u32))
1139#define IW_EV_COMPAT_FREQ_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_freq))
1140#define IW_EV_COMPAT_PARAM_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_param))
1141#define IW_EV_COMPAT_ADDR_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct sockaddr))
1142#define IW_EV_COMPAT_QUAL_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_quality))
1135#define IW_EV_COMPAT_POINT_LEN \ 1143#define IW_EV_COMPAT_POINT_LEN \
1136 (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ 1144 (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \
1137 IW_EV_COMPAT_POINT_OFF) 1145 IW_EV_COMPAT_POINT_OFF)
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h
index 6f69968eab24..0c9878123d5f 100644
--- a/include/linux/wm97xx.h
+++ b/include/linux/wm97xx.h
@@ -16,6 +16,12 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17 17
18/* 18/*
19 * WM97xx variants
20 */
21#define WM97xx_GENERIC 0x0000
22#define WM97xx_WM1613 0x1613
23
24/*
19 * WM97xx AC97 Touchscreen registers 25 * WM97xx AC97 Touchscreen registers
20 */ 26 */
21#define AC97_WM97XX_DIGITISER1 0x76 27#define AC97_WM97XX_DIGITISER1 0x76
@@ -283,6 +289,7 @@ struct wm97xx {
283 unsigned pen_is_down:1; /* Pen is down */ 289 unsigned pen_is_down:1; /* Pen is down */
284 unsigned aux_waiting:1; /* aux measurement waiting */ 290 unsigned aux_waiting:1; /* aux measurement waiting */
285 unsigned pen_probably_down:1; /* used in polling mode */ 291 unsigned pen_probably_down:1; /* used in polling mode */
292 u16 variant; /* WM97xx chip variant */
286 u16 suspend_mode; /* PRP in suspend mode */ 293 u16 suspend_mode; /* PRP in suspend mode */
287}; 294};
288 295
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 78b1e4684cc9..75cf58666ff9 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -50,7 +50,6 @@ struct writeback_control {
50 unsigned encountered_congestion:1; /* An output: a queue is full */ 50 unsigned encountered_congestion:1; /* An output: a queue is full */
51 unsigned for_kupdate:1; /* A kupdate writeback */ 51 unsigned for_kupdate:1; /* A kupdate writeback */
52 unsigned for_reclaim:1; /* Invoked from the page allocator */ 52 unsigned for_reclaim:1; /* Invoked from the page allocator */
53 unsigned for_writepages:1; /* This is a writepages() call */
54 unsigned range_cyclic:1; /* range_start is cyclic */ 53 unsigned range_cyclic:1; /* range_start is cyclic */
55 unsigned more_io:1; /* more io to be dispatched */ 54 unsigned more_io:1; /* more io to be dispatched */
56 /* 55 /*
@@ -69,8 +68,8 @@ struct writeback_control {
69 */ 68 */
70struct bdi_writeback; 69struct bdi_writeback;
71int inode_wait(void *); 70int inode_wait(void *);
72long writeback_inodes_sb(struct super_block *); 71void writeback_inodes_sb(struct super_block *);
73long sync_inodes_sb(struct super_block *); 72void sync_inodes_sb(struct super_block *);
74void writeback_inodes_wbc(struct writeback_control *wbc); 73void writeback_inodes_wbc(struct writeback_control *wbc);
75long wb_do_writeback(struct bdi_writeback *wb, int force_wait); 74long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
76void wakeup_flusher_threads(long nr_pages); 75void wakeup_flusher_threads(long nr_pages);
@@ -150,10 +149,6 @@ int write_cache_pages(struct address_space *mapping,
150 struct writeback_control *wbc, writepage_t writepage, 149 struct writeback_control *wbc, writepage_t writepage,
151 void *data); 150 void *data);
152int do_writepages(struct address_space *mapping, struct writeback_control *wbc); 151int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
153int sync_page_range(struct inode *inode, struct address_space *mapping,
154 loff_t pos, loff_t count);
155int sync_page_range_nolock(struct inode *inode, struct address_space *mapping,
156 loff_t pos, loff_t count);
157void set_page_dirty_balance(struct page *page, int page_mkwrite); 152void set_page_dirty_balance(struct page *page, int page_mkwrite);
158void writeback_set_ratelimit(void); 153void writeback_set_ratelimit(void);
159 154
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 9dcb632f6083..29f0e53cff94 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -31,8 +31,18 @@
31#define IR_TYPE_PD 2 /* Pulse distance encoded IR */ 31#define IR_TYPE_PD 2 /* Pulse distance encoded IR */
32#define IR_TYPE_OTHER 99 32#define IR_TYPE_OTHER 99
33 33
34#define IR_KEYTAB_TYPE u32 34#define IR_KEYTAB_TYPE u32
35#define IR_KEYTAB_SIZE 128 // enougth for rc5, probably need more some day ... 35#define IR_KEYTAB_SIZE 128 /* enougth for rc5, probably need more some day */
36
37struct ir_scancode {
38 u16 scancode;
39 u32 keycode;
40};
41
42struct ir_scancode_table {
43 struct ir_scancode *scan;
44 int size;
45};
36 46
37#define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \ 47#define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \
38 ? tab[code] : KEY_RESERVED) 48 ? tab[code] : KEY_RESERVED)
@@ -93,7 +103,7 @@ struct card_ir {
93}; 103};
94 104
95void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, 105void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
96 int ir_type, IR_KEYTAB_TYPE *ir_codes); 106 int ir_type, struct ir_scancode_table *ir_codes);
97void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); 107void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir);
98void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, 108void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
99 u32 ir_key, u32 ir_raw); 109 u32 ir_key, u32 ir_raw);
@@ -107,67 +117,63 @@ void ir_rc5_timer_keyup(unsigned long data);
107 117
108/* Keymaps to be used by other modules */ 118/* Keymaps to be used by other modules */
109 119
110extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; 120extern struct ir_scancode_table ir_codes_empty_table;
111extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE]; 121extern struct ir_scancode_table ir_codes_avermedia_table;
112extern IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE]; 122extern struct ir_scancode_table ir_codes_avermedia_dvbt_table;
113extern IR_KEYTAB_TYPE ir_codes_avermedia_m135a[IR_KEYTAB_SIZE]; 123extern struct ir_scancode_table ir_codes_avermedia_m135a_table;
114extern IR_KEYTAB_TYPE ir_codes_avermedia_cardbus[IR_KEYTAB_SIZE]; 124extern struct ir_scancode_table ir_codes_avermedia_cardbus_table;
115extern IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE]; 125extern struct ir_scancode_table ir_codes_apac_viewcomp_table;
116extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE]; 126extern struct ir_scancode_table ir_codes_pixelview_table;
117extern IR_KEYTAB_TYPE ir_codes_pixelview_new[IR_KEYTAB_SIZE]; 127extern struct ir_scancode_table ir_codes_pixelview_new_table;
118extern IR_KEYTAB_TYPE ir_codes_nebula[IR_KEYTAB_SIZE]; 128extern struct ir_scancode_table ir_codes_nebula_table;
119extern IR_KEYTAB_TYPE ir_codes_dntv_live_dvb_t[IR_KEYTAB_SIZE]; 129extern struct ir_scancode_table ir_codes_dntv_live_dvb_t_table;
120extern IR_KEYTAB_TYPE ir_codes_iodata_bctv7e[IR_KEYTAB_SIZE]; 130extern struct ir_scancode_table ir_codes_iodata_bctv7e_table;
121extern IR_KEYTAB_TYPE ir_codes_adstech_dvb_t_pci[IR_KEYTAB_SIZE]; 131extern struct ir_scancode_table ir_codes_adstech_dvb_t_pci_table;
122extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere[IR_KEYTAB_SIZE]; 132extern struct ir_scancode_table ir_codes_msi_tvanywhere_table;
123extern IR_KEYTAB_TYPE ir_codes_cinergy_1400[IR_KEYTAB_SIZE]; 133extern struct ir_scancode_table ir_codes_cinergy_1400_table;
124extern IR_KEYTAB_TYPE ir_codes_avertv_303[IR_KEYTAB_SIZE]; 134extern struct ir_scancode_table ir_codes_avertv_303_table;
125extern IR_KEYTAB_TYPE ir_codes_dntv_live_dvbt_pro[IR_KEYTAB_SIZE]; 135extern struct ir_scancode_table ir_codes_dntv_live_dvbt_pro_table;
126extern IR_KEYTAB_TYPE ir_codes_em_terratec[IR_KEYTAB_SIZE]; 136extern struct ir_scancode_table ir_codes_em_terratec_table;
127extern IR_KEYTAB_TYPE ir_codes_pinnacle_grey[IR_KEYTAB_SIZE]; 137extern struct ir_scancode_table ir_codes_pinnacle_grey_table;
128extern IR_KEYTAB_TYPE ir_codes_flyvideo[IR_KEYTAB_SIZE]; 138extern struct ir_scancode_table ir_codes_flyvideo_table;
129extern IR_KEYTAB_TYPE ir_codes_flydvb[IR_KEYTAB_SIZE]; 139extern struct ir_scancode_table ir_codes_flydvb_table;
130extern IR_KEYTAB_TYPE ir_codes_cinergy[IR_KEYTAB_SIZE]; 140extern struct ir_scancode_table ir_codes_cinergy_table;
131extern IR_KEYTAB_TYPE ir_codes_eztv[IR_KEYTAB_SIZE]; 141extern struct ir_scancode_table ir_codes_eztv_table;
132extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE]; 142extern struct ir_scancode_table ir_codes_avermedia_table;
133extern IR_KEYTAB_TYPE ir_codes_videomate_tv_pvr[IR_KEYTAB_SIZE]; 143extern struct ir_scancode_table ir_codes_videomate_tv_pvr_table;
134extern IR_KEYTAB_TYPE ir_codes_manli[IR_KEYTAB_SIZE]; 144extern struct ir_scancode_table ir_codes_manli_table;
135extern IR_KEYTAB_TYPE ir_codes_gotview7135[IR_KEYTAB_SIZE]; 145extern struct ir_scancode_table ir_codes_gotview7135_table;
136extern IR_KEYTAB_TYPE ir_codes_purpletv[IR_KEYTAB_SIZE]; 146extern struct ir_scancode_table ir_codes_purpletv_table;
137extern IR_KEYTAB_TYPE ir_codes_pctv_sedna[IR_KEYTAB_SIZE]; 147extern struct ir_scancode_table ir_codes_pctv_sedna_table;
138extern IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE]; 148extern struct ir_scancode_table ir_codes_pv951_table;
139extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE]; 149extern struct ir_scancode_table ir_codes_rc5_tv_table;
140extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE]; 150extern struct ir_scancode_table ir_codes_winfast_table;
141extern IR_KEYTAB_TYPE ir_codes_pinnacle_color[IR_KEYTAB_SIZE]; 151extern struct ir_scancode_table ir_codes_pinnacle_color_table;
142extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; 152extern struct ir_scancode_table ir_codes_hauppauge_new_table;
143extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; 153extern struct ir_scancode_table ir_codes_npgtech_table;
144extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; 154extern struct ir_scancode_table ir_codes_norwood_table;
145extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; 155extern struct ir_scancode_table ir_codes_proteus_2309_table;
146extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE]; 156extern struct ir_scancode_table ir_codes_budget_ci_old_table;
147extern IR_KEYTAB_TYPE ir_codes_asus_pc39[IR_KEYTAB_SIZE]; 157extern struct ir_scancode_table ir_codes_asus_pc39_table;
148extern IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE]; 158extern struct ir_scancode_table ir_codes_encore_enltv_table;
149extern IR_KEYTAB_TYPE ir_codes_encore_enltv2[IR_KEYTAB_SIZE]; 159extern struct ir_scancode_table ir_codes_encore_enltv2_table;
150extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE]; 160extern struct ir_scancode_table ir_codes_tt_1500_table;
151extern IR_KEYTAB_TYPE ir_codes_fusionhdtv_mce[IR_KEYTAB_SIZE]; 161extern struct ir_scancode_table ir_codes_fusionhdtv_mce_table;
152extern IR_KEYTAB_TYPE ir_codes_behold[IR_KEYTAB_SIZE]; 162extern struct ir_scancode_table ir_codes_behold_table;
153extern IR_KEYTAB_TYPE ir_codes_behold_columbus[IR_KEYTAB_SIZE]; 163extern struct ir_scancode_table ir_codes_behold_columbus_table;
154extern IR_KEYTAB_TYPE ir_codes_pinnacle_pctv_hd[IR_KEYTAB_SIZE]; 164extern struct ir_scancode_table ir_codes_pinnacle_pctv_hd_table;
155extern IR_KEYTAB_TYPE ir_codes_genius_tvgo_a11mce[IR_KEYTAB_SIZE]; 165extern struct ir_scancode_table ir_codes_genius_tvgo_a11mce_table;
156extern IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE]; 166extern struct ir_scancode_table ir_codes_powercolor_real_angel_table;
157extern IR_KEYTAB_TYPE ir_codes_avermedia_a16d[IR_KEYTAB_SIZE]; 167extern struct ir_scancode_table ir_codes_avermedia_a16d_table;
158extern IR_KEYTAB_TYPE ir_codes_encore_enltv_fm53[IR_KEYTAB_SIZE]; 168extern struct ir_scancode_table ir_codes_encore_enltv_fm53_table;
159extern IR_KEYTAB_TYPE ir_codes_real_audio_220_32_keys[IR_KEYTAB_SIZE]; 169extern struct ir_scancode_table ir_codes_real_audio_220_32_keys_table;
160extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_plus[IR_KEYTAB_SIZE]; 170extern struct ir_scancode_table ir_codes_msi_tvanywhere_plus_table;
161extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE]; 171extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table;
162extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE]; 172extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table;
163extern IR_KEYTAB_TYPE ir_codes_kaiomy[IR_KEYTAB_SIZE]; 173extern struct ir_scancode_table ir_codes_kaiomy_table;
164extern IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE]; 174extern struct ir_scancode_table ir_codes_dm1105_nec_table;
165extern IR_KEYTAB_TYPE ir_codes_evga_indtube[IR_KEYTAB_SIZE]; 175extern struct ir_scancode_table ir_codes_evga_indtube_table;
166 176extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table;
177extern struct ir_scancode_table ir_codes_videomate_s350_table;
178extern struct ir_scancode_table ir_codes_gadmei_rm008z_table;
167#endif 179#endif
168
169/*
170 * Local variables:
171 * c-basic-offset: 8
172 * End:
173 */
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index 3ad4ed5402fb..aaf65e8b1a40 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -6,7 +6,8 @@
6struct IR_i2c; 6struct IR_i2c;
7 7
8struct IR_i2c { 8struct IR_i2c {
9 IR_KEYTAB_TYPE *ir_codes; 9 struct ir_scancode_table *ir_codes;
10
10 struct i2c_client *c; 11 struct i2c_client *c;
11 struct input_dev *input; 12 struct input_dev *input;
12 struct ir_input_state ir; 13 struct ir_input_state ir;
@@ -20,10 +21,27 @@ struct IR_i2c {
20 int (*get_key)(struct IR_i2c*, u32*, u32*); 21 int (*get_key)(struct IR_i2c*, u32*, u32*);
21}; 22};
22 23
24enum ir_kbd_get_key_fn {
25 IR_KBD_GET_KEY_CUSTOM = 0,
26 IR_KBD_GET_KEY_PIXELVIEW,
27 IR_KBD_GET_KEY_PV951,
28 IR_KBD_GET_KEY_HAUP,
29 IR_KBD_GET_KEY_KNC1,
30 IR_KBD_GET_KEY_FUSIONHDTV,
31 IR_KBD_GET_KEY_HAUP_XVR,
32 IR_KBD_GET_KEY_AVERMEDIA_CARDBUS,
33};
34
23/* Can be passed when instantiating an ir_video i2c device */ 35/* Can be passed when instantiating an ir_video i2c device */
24struct IR_i2c_init_data { 36struct IR_i2c_init_data {
25 IR_KEYTAB_TYPE *ir_codes; 37 struct ir_scancode_table *ir_codes;
26 const char *name; 38 const char *name;
39 int type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */
40 /*
41 * Specify either a function pointer or a value indicating one of
42 * ir_kbd_i2c's internal get_key functions
43 */
27 int (*get_key)(struct IR_i2c*, u32*, u32*); 44 int (*get_key)(struct IR_i2c*, u32*, u32*);
45 enum ir_kbd_get_key_fn internal_get_key_func;
28}; 46};
29#endif 47#endif
diff --git a/include/media/radio-si4713.h b/include/media/radio-si4713.h
new file mode 100644
index 000000000000..f6aae29c7741
--- /dev/null
+++ b/include/media/radio-si4713.h
@@ -0,0 +1,30 @@
1/*
2 * include/media/radio-si4713.h
3 *
4 * Board related data definitions for Si4713 radio transmitter chip.
5 *
6 * Copyright (c) 2009 Nokia Corporation
7 * Contact: Eduardo Valentin <eduardo.valentin@nokia.com>
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 *
13 */
14
15#ifndef RADIO_SI4713_H
16#define RADIO_SI4713_H
17
18#include <linux/i2c.h>
19
20#define SI4713_NAME "radio-si4713"
21
22/*
23 * Platform dependent definition
24 */
25struct radio_si4713_platform_data {
26 int i2c_bus;
27 struct i2c_board_info *subdev_board_info;
28};
29
30#endif /* ifndef RADIO_SI4713_H*/
diff --git a/include/media/si4713.h b/include/media/si4713.h
new file mode 100644
index 000000000000..99850a54ed09
--- /dev/null
+++ b/include/media/si4713.h
@@ -0,0 +1,49 @@
1/*
2 * include/media/si4713.h
3 *
4 * Board related data definitions for Si4713 i2c device driver.
5 *
6 * Copyright (c) 2009 Nokia Corporation
7 * Contact: Eduardo Valentin <eduardo.valentin@nokia.com>
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied.
12 *
13 */
14
15#ifndef SI4713_H
16#define SI4713_H
17
18/* The SI4713 I2C sensor chip has a fixed slave address of 0xc6 or 0x22. */
19#define SI4713_I2C_ADDR_BUSEN_HIGH 0x63
20#define SI4713_I2C_ADDR_BUSEN_LOW 0x11
21
22/*
23 * Platform dependent definition
24 */
25struct si4713_platform_data {
26 /* Set power state, zero is off, non-zero is on. */
27 int (*set_power)(int power);
28};
29
30/*
31 * Structure to query for Received Noise Level (RNL).
32 */
33struct si4713_rnl {
34 __u32 index; /* modulator index */
35 __u32 frequency; /* frequency to peform rnl measurement */
36 __s32 rnl; /* result of measurement in dBuV */
37 __u32 reserved[4]; /* drivers and apps must init this to 0 */
38};
39
40/*
41 * This is the ioctl number to query for rnl. Users must pass a
42 * struct si4713_rnl pointer specifying desired frequency in 'frequency' field
43 * following driver capabilities (i.e V4L2_TUNER_CAP_LOW).
44 * Driver must return measured value in the same struture, filling 'rnl' field.
45 */
46#define SI4713_IOC_MEASURE_RNL _IOWR('V', BASE_VIDIOC_PRIVATE + 0, \
47 struct si4713_rnl)
48
49#endif /* ifndef SI4713_H*/
diff --git a/include/media/tuner.h b/include/media/tuner.h
index cbf97f45fbec..c146f2f530b0 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -126,6 +126,7 @@
126#define TUNER_PHILIPS_FMD1216MEX_MK3 78 126#define TUNER_PHILIPS_FMD1216MEX_MK3 78
127#define TUNER_PHILIPS_FM1216MK5 79 127#define TUNER_PHILIPS_FM1216MK5 79
128#define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */ 128#define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */
129#define TUNER_PARTSNIC_PTI_5NF05 81
129 130
130/* tv card specific */ 131/* tv card specific */
131#define TDA9887_PRESENT (1<<0) 132#define TDA9887_PRESENT (1<<0)
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 5dcb36785529..d411345f244b 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -137,6 +137,8 @@ struct v4l2_subdev_tuner_ops {
137 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); 137 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
138 int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt); 138 int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
139 int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt); 139 int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
140 int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
141 int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
140 int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type); 142 int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
141 int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config); 143 int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config);
142 int (*s_standby)(struct v4l2_subdev *sd); 144 int (*s_standby)(struct v4l2_subdev *sd);
@@ -220,6 +222,9 @@ struct v4l2_subdev_video_ops {
220 int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); 222 int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
221 int (*try_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); 223 int (*try_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
222 int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt); 224 int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
225 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc);
226 int (*g_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop);
227 int (*s_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop);
223 int (*g_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); 228 int (*g_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param);
224 int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); 229 int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param);
225 int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); 230 int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize);
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 7b55ab215a64..0f7c37825fc1 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -143,6 +143,8 @@ extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr
143extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); 143extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr);
144extern void ipv6_mc_up(struct inet6_dev *idev); 144extern void ipv6_mc_up(struct inet6_dev *idev);
145extern void ipv6_mc_down(struct inet6_dev *idev); 145extern void ipv6_mc_down(struct inet6_dev *idev);
146extern void ipv6_mc_unmap(struct inet6_dev *idev);
147extern void ipv6_mc_remap(struct inet6_dev *idev);
146extern void ipv6_mc_init_dev(struct inet6_dev *idev); 148extern void ipv6_mc_init_dev(struct inet6_dev *idev);
147extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); 149extern void ipv6_mc_destroy_dev(struct inet6_dev *idev);
148extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); 150extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
diff --git a/include/net/ieee802154/af_ieee802154.h b/include/net/af_ieee802154.h
index 0d78605fb1a6..75e64c7a2960 100644
--- a/include/net/ieee802154/af_ieee802154.h
+++ b/include/net/af_ieee802154.h
@@ -54,7 +54,9 @@ struct sockaddr_ieee802154 {
54 struct ieee802154_addr addr; 54 struct ieee802154_addr addr;
55}; 55};
56 56
57/* master device */ 57/* get/setsockopt */
58#define IEEE802154_SIOC_ADD_SLAVE (SIOCDEVPRIVATE + 0) 58#define SOL_IEEE802154 0
59
60#define WPAN_WANTACK 0
59 61
60#endif 62#endif
diff --git a/include/net/arp.h b/include/net/arp.h
index c236270ec95e..716f43c5c98e 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -26,6 +26,6 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
26 const unsigned char *target_hw); 26 const unsigned char *target_hw);
27extern void arp_xmit(struct sk_buff *skb); 27extern void arp_xmit(struct sk_buff *skb);
28 28
29extern struct neigh_ops arp_broken_ops; 29extern const struct neigh_ops arp_broken_ops;
30 30
31#endif /* _ARP_H */ 31#endif /* _ARP_H */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 968166a45f86..718394e2c01e 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -138,8 +138,11 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock);
138struct bt_skb_cb { 138struct bt_skb_cb {
139 __u8 pkt_type; 139 __u8 pkt_type;
140 __u8 incoming; 140 __u8 incoming;
141 __u8 tx_seq;
142 __u8 retries;
143 __u8 sar;
141}; 144};
142#define bt_cb(skb) ((struct bt_skb_cb *)(skb->cb)) 145#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
143 146
144static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) 147static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how)
145{ 148{
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index c4ca4228b083..7b640aeddb64 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -117,7 +117,7 @@ struct hci_dev {
117 struct sk_buff *sent_cmd; 117 struct sk_buff *sent_cmd;
118 struct sk_buff *reassembly[3]; 118 struct sk_buff *reassembly[3];
119 119
120 struct semaphore req_lock; 120 struct mutex req_lock;
121 wait_queue_head_t req_wait_q; 121 wait_queue_head_t req_wait_q;
122 __u32 req_status; 122 __u32 req_status;
123 __u32 req_result; 123 __u32 req_result;
@@ -187,6 +187,7 @@ struct hci_conn {
187 struct work_struct work_del; 187 struct work_struct work_del;
188 188
189 struct device dev; 189 struct device dev;
190 atomic_t devref;
190 191
191 struct hci_dev *hdev; 192 struct hci_dev *hdev;
192 void *l2cap_data; 193 void *l2cap_data;
@@ -339,6 +340,9 @@ int hci_conn_switch_role(struct hci_conn *conn, __u8 role);
339void hci_conn_enter_active_mode(struct hci_conn *conn); 340void hci_conn_enter_active_mode(struct hci_conn *conn);
340void hci_conn_enter_sniff_mode(struct hci_conn *conn); 341void hci_conn_enter_sniff_mode(struct hci_conn *conn);
341 342
343void hci_conn_hold_device(struct hci_conn *conn);
344void hci_conn_put_device(struct hci_conn *conn);
345
342static inline void hci_conn_hold(struct hci_conn *conn) 346static inline void hci_conn_hold(struct hci_conn *conn)
343{ 347{
344 atomic_inc(&conn->refcnt); 348 atomic_inc(&conn->refcnt);
@@ -700,8 +704,8 @@ struct hci_sec_filter {
700#define HCI_REQ_PEND 1 704#define HCI_REQ_PEND 1
701#define HCI_REQ_CANCELED 2 705#define HCI_REQ_CANCELED 2
702 706
703#define hci_req_lock(d) down(&d->req_lock) 707#define hci_req_lock(d) mutex_lock(&d->req_lock)
704#define hci_req_unlock(d) up(&d->req_lock) 708#define hci_req_unlock(d) mutex_unlock(&d->req_lock)
705 709
706void hci_req_complete(struct hci_dev *hdev, int result); 710void hci_req_complete(struct hci_dev *hdev, int result);
707 711
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index e919fca1072a..9516f4b4a3c2 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -27,12 +27,14 @@
27 27
28/* L2CAP defaults */ 28/* L2CAP defaults */
29#define L2CAP_DEFAULT_MTU 672 29#define L2CAP_DEFAULT_MTU 672
30#define L2CAP_DEFAULT_MIN_MTU 48
30#define L2CAP_DEFAULT_FLUSH_TO 0xffff 31#define L2CAP_DEFAULT_FLUSH_TO 0xffff
31#define L2CAP_DEFAULT_RX_WINDOW 1 32#define L2CAP_DEFAULT_TX_WINDOW 63
32#define L2CAP_DEFAULT_MAX_RECEIVE 1 33#define L2CAP_DEFAULT_NUM_TO_ACK (L2CAP_DEFAULT_TX_WINDOW/5)
33#define L2CAP_DEFAULT_RETRANS_TO 300 /* 300 milliseconds */ 34#define L2CAP_DEFAULT_MAX_TX 3
34#define L2CAP_DEFAULT_MONITOR_TO 1000 /* 1 second */ 35#define L2CAP_DEFAULT_RETRANS_TO 1000 /* 1 second */
35#define L2CAP_DEFAULT_MAX_RX_APDU 0xfff7 36#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */
37#define L2CAP_DEFAULT_MAX_PDU_SIZE 672
36 38
37#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ 39#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
38#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ 40#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
@@ -52,6 +54,7 @@ struct l2cap_options {
52 __u16 imtu; 54 __u16 imtu;
53 __u16 flush_to; 55 __u16 flush_to;
54 __u8 mode; 56 __u8 mode;
57 __u8 fcs;
55}; 58};
56 59
57#define L2CAP_CONNINFO 0x02 60#define L2CAP_CONNINFO 0x02
@@ -93,6 +96,32 @@ struct l2cap_conninfo {
93#define L2CAP_FCS_NONE 0x00 96#define L2CAP_FCS_NONE 0x00
94#define L2CAP_FCS_CRC16 0x01 97#define L2CAP_FCS_CRC16 0x01
95 98
99/* L2CAP Control Field bit masks */
100#define L2CAP_CTRL_SAR 0xC000
101#define L2CAP_CTRL_REQSEQ 0x3F00
102#define L2CAP_CTRL_TXSEQ 0x007E
103#define L2CAP_CTRL_RETRANS 0x0080
104#define L2CAP_CTRL_FINAL 0x0080
105#define L2CAP_CTRL_POLL 0x0010
106#define L2CAP_CTRL_SUPERVISE 0x000C
107#define L2CAP_CTRL_FRAME_TYPE 0x0001 /* I- or S-Frame */
108
109#define L2CAP_CTRL_TXSEQ_SHIFT 1
110#define L2CAP_CTRL_REQSEQ_SHIFT 8
111#define L2CAP_CTRL_SAR_SHIFT 14
112
113/* L2CAP Supervisory Function */
114#define L2CAP_SUPER_RCV_READY 0x0000
115#define L2CAP_SUPER_REJECT 0x0004
116#define L2CAP_SUPER_RCV_NOT_READY 0x0008
117#define L2CAP_SUPER_SELECT_REJECT 0x000C
118
119/* L2CAP Segmentation and Reassembly */
120#define L2CAP_SDU_UNSEGMENTED 0x0000
121#define L2CAP_SDU_START 0x4000
122#define L2CAP_SDU_END 0x8000
123#define L2CAP_SDU_CONTINUE 0xC000
124
96/* L2CAP structures */ 125/* L2CAP structures */
97struct l2cap_hdr { 126struct l2cap_hdr {
98 __le16 len; 127 __le16 len;
@@ -190,7 +219,7 @@ struct l2cap_conf_rfc {
190#define L2CAP_MODE_RETRANS 0x01 219#define L2CAP_MODE_RETRANS 0x01
191#define L2CAP_MODE_FLOWCTL 0x02 220#define L2CAP_MODE_FLOWCTL 0x02
192#define L2CAP_MODE_ERTM 0x03 221#define L2CAP_MODE_ERTM 0x03
193#define L2CAP_MODE_STREAM 0x04 222#define L2CAP_MODE_STREAMING 0x04
194 223
195struct l2cap_disconn_req { 224struct l2cap_disconn_req {
196 __le16 dcid; 225 __le16 dcid;
@@ -261,6 +290,14 @@ struct l2cap_conn {
261 290
262/* ----- L2CAP channel and socket info ----- */ 291/* ----- L2CAP channel and socket info ----- */
263#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) 292#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk)
293#define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue)
294#define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue)
295#define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list)
296
297struct srej_list {
298 __u8 tx_seq;
299 struct list_head list;
300};
264 301
265struct l2cap_pinfo { 302struct l2cap_pinfo {
266 struct bt_sock bt; 303 struct bt_sock bt;
@@ -271,30 +308,97 @@ struct l2cap_pinfo {
271 __u16 imtu; 308 __u16 imtu;
272 __u16 omtu; 309 __u16 omtu;
273 __u16 flush_to; 310 __u16 flush_to;
274 __u8 sec_level; 311 __u8 mode;
312 __u8 num_conf_req;
313 __u8 num_conf_rsp;
314
315 __u8 fcs;
316 __u8 sec_level;
275 __u8 role_switch; 317 __u8 role_switch;
276 __u8 force_reliable; 318 __u8 force_reliable;
277 319
278 __u8 conf_req[64]; 320 __u8 conf_req[64];
279 __u8 conf_len; 321 __u8 conf_len;
280 __u8 conf_state; 322 __u8 conf_state;
281 __u8 conf_retry; 323 __u8 conn_state;
324
325 __u8 next_tx_seq;
326 __u8 expected_ack_seq;
327 __u8 req_seq;
328 __u8 expected_tx_seq;
329 __u8 buffer_seq;
330 __u8 buffer_seq_srej;
331 __u8 srej_save_reqseq;
332 __u8 unacked_frames;
333 __u8 retry_count;
334 __u8 num_to_ack;
335 __u16 sdu_len;
336 __u16 partial_sdu_len;
337 struct sk_buff *sdu;
282 338
283 __u8 ident; 339 __u8 ident;
284 340
341 __u8 remote_tx_win;
342 __u8 remote_max_tx;
343 __u16 retrans_timeout;
344 __u16 monitor_timeout;
345 __u16 max_pdu_size;
346
285 __le16 sport; 347 __le16 sport;
286 348
349 struct timer_list retrans_timer;
350 struct timer_list monitor_timer;
351 struct sk_buff_head tx_queue;
352 struct sk_buff_head srej_queue;
353 struct srej_list srej_l;
287 struct l2cap_conn *conn; 354 struct l2cap_conn *conn;
288 struct sock *next_c; 355 struct sock *next_c;
289 struct sock *prev_c; 356 struct sock *prev_c;
290}; 357};
291 358
292#define L2CAP_CONF_REQ_SENT 0x01 359#define L2CAP_CONF_REQ_SENT 0x01
293#define L2CAP_CONF_INPUT_DONE 0x02 360#define L2CAP_CONF_INPUT_DONE 0x02
294#define L2CAP_CONF_OUTPUT_DONE 0x04 361#define L2CAP_CONF_OUTPUT_DONE 0x04
295#define L2CAP_CONF_CONNECT_PEND 0x80 362#define L2CAP_CONF_MTU_DONE 0x08
296 363#define L2CAP_CONF_MODE_DONE 0x10
297#define L2CAP_CONF_MAX_RETRIES 2 364#define L2CAP_CONF_CONNECT_PEND 0x20
365#define L2CAP_CONF_NO_FCS_RECV 0x40
366#define L2CAP_CONF_STATE2_DEVICE 0x80
367
368#define L2CAP_CONF_MAX_CONF_REQ 2
369#define L2CAP_CONF_MAX_CONF_RSP 2
370
371#define L2CAP_CONN_SAR_SDU 0x01
372#define L2CAP_CONN_SREJ_SENT 0x02
373#define L2CAP_CONN_WAIT_F 0x04
374#define L2CAP_CONN_SREJ_ACT 0x08
375#define L2CAP_CONN_SEND_PBIT 0x10
376#define L2CAP_CONN_REMOTE_BUSY 0x20
377#define L2CAP_CONN_LOCAL_BUSY 0x40
378
379#define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \
380 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO));
381#define __mod_monitor_timer() mod_timer(&l2cap_pi(sk)->monitor_timer, \
382 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO));
383
384static inline int l2cap_tx_window_full(struct sock *sk)
385{
386 struct l2cap_pinfo *pi = l2cap_pi(sk);
387 int sub;
388
389 sub = (pi->next_tx_seq - pi->expected_ack_seq) % 64;
390
391 if (sub < 0)
392 sub += 64;
393
394 return (sub == pi->remote_tx_win);
395}
396
397#define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1
398#define __get_reqseq(ctrl) ((ctrl) & L2CAP_CTRL_REQSEQ) >> 8
399#define __is_iframe(ctrl) !((ctrl) & L2CAP_CTRL_FRAME_TYPE)
400#define __is_sframe(ctrl) (ctrl) & L2CAP_CTRL_FRAME_TYPE
401#define __is_sar_start(ctrl) ((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START
298 402
299void l2cap_load(void); 403void l2cap_load(void);
300 404
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index c274993234e3..921d7b3c7f8d 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -29,6 +29,7 @@
29#define RFCOMM_CONN_TIMEOUT (HZ * 30) 29#define RFCOMM_CONN_TIMEOUT (HZ * 30)
30#define RFCOMM_DISC_TIMEOUT (HZ * 20) 30#define RFCOMM_DISC_TIMEOUT (HZ * 20)
31#define RFCOMM_AUTH_TIMEOUT (HZ * 25) 31#define RFCOMM_AUTH_TIMEOUT (HZ * 25)
32#define RFCOMM_IDLE_TIMEOUT (HZ * 2)
32 33
33#define RFCOMM_DEFAULT_MTU 127 34#define RFCOMM_DEFAULT_MTU 127
34#define RFCOMM_DEFAULT_CREDITS 7 35#define RFCOMM_DEFAULT_CREDITS 7
@@ -154,6 +155,7 @@ struct rfcomm_msc {
154struct rfcomm_session { 155struct rfcomm_session {
155 struct list_head list; 156 struct list_head list;
156 struct socket *sock; 157 struct socket *sock;
158 struct timer_list timer;
157 unsigned long state; 159 unsigned long state;
158 unsigned long flags; 160 unsigned long flags;
159 atomic_t refcnt; 161 atomic_t refcnt;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d1892d66701a..3d874c620219 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -80,7 +80,6 @@ enum ieee80211_channel_flags {
80 * with cfg80211. 80 * with cfg80211.
81 * 81 *
82 * @center_freq: center frequency in MHz 82 * @center_freq: center frequency in MHz
83 * @max_bandwidth: maximum allowed bandwidth for this channel, in MHz
84 * @hw_value: hardware-specific value for the channel 83 * @hw_value: hardware-specific value for the channel
85 * @flags: channel flags from &enum ieee80211_channel_flags. 84 * @flags: channel flags from &enum ieee80211_channel_flags.
86 * @orig_flags: channel flags at registration time, used by regulatory 85 * @orig_flags: channel flags at registration time, used by regulatory
@@ -97,7 +96,6 @@ enum ieee80211_channel_flags {
97struct ieee80211_channel { 96struct ieee80211_channel {
98 enum ieee80211_band band; 97 enum ieee80211_band band;
99 u16 center_freq; 98 u16 center_freq;
100 u8 max_bandwidth;
101 u16 hw_value; 99 u16 hw_value;
102 u32 flags; 100 u32 flags;
103 int max_antenna_gain; 101 int max_antenna_gain;
@@ -372,6 +370,10 @@ struct rate_info {
372 * @txrate: current unicast bitrate to this station 370 * @txrate: current unicast bitrate to this station
373 * @rx_packets: packets received from this station 371 * @rx_packets: packets received from this station
374 * @tx_packets: packets transmitted to this station 372 * @tx_packets: packets transmitted to this station
373 * @generation: generation number for nl80211 dumps.
374 * This number should increase every time the list of stations
375 * changes, i.e. when a station is added or removed, so that
376 * userspace can tell whether it got a consistent snapshot.
375 */ 377 */
376struct station_info { 378struct station_info {
377 u32 filled; 379 u32 filled;
@@ -385,6 +387,8 @@ struct station_info {
385 struct rate_info txrate; 387 struct rate_info txrate;
386 u32 rx_packets; 388 u32 rx_packets;
387 u32 tx_packets; 389 u32 tx_packets;
390
391 int generation;
388}; 392};
389 393
390/** 394/**
@@ -444,6 +448,10 @@ enum mpath_info_flags {
444 * @flags: mesh path flags 448 * @flags: mesh path flags
445 * @discovery_timeout: total mesh path discovery timeout, in msecs 449 * @discovery_timeout: total mesh path discovery timeout, in msecs
446 * @discovery_retries: mesh path discovery retries 450 * @discovery_retries: mesh path discovery retries
451 * @generation: generation number for nl80211 dumps.
452 * This number should increase every time the list of mesh paths
453 * changes, i.e. when a station is added or removed, so that
454 * userspace can tell whether it got a consistent snapshot.
447 */ 455 */
448struct mpath_info { 456struct mpath_info {
449 u32 filled; 457 u32 filled;
@@ -454,6 +462,8 @@ struct mpath_info {
454 u32 discovery_timeout; 462 u32 discovery_timeout;
455 u8 discovery_retries; 463 u8 discovery_retries;
456 u8 flags; 464 u8 flags;
465
466 int generation;
457}; 467};
458 468
459/** 469/**
@@ -538,23 +548,26 @@ struct cfg80211_ssid {
538 * @ssids: SSIDs to scan for (active scan only) 548 * @ssids: SSIDs to scan for (active scan only)
539 * @n_ssids: number of SSIDs 549 * @n_ssids: number of SSIDs
540 * @channels: channels to scan on. 550 * @channels: channels to scan on.
541 * @n_channels: number of channels for each band 551 * @n_channels: total number of channels to scan
542 * @ie: optional information element(s) to add into Probe Request or %NULL 552 * @ie: optional information element(s) to add into Probe Request or %NULL
543 * @ie_len: length of ie in octets 553 * @ie_len: length of ie in octets
544 * @wiphy: the wiphy this was for 554 * @wiphy: the wiphy this was for
545 * @ifidx: the interface index 555 * @dev: the interface
546 */ 556 */
547struct cfg80211_scan_request { 557struct cfg80211_scan_request {
548 struct cfg80211_ssid *ssids; 558 struct cfg80211_ssid *ssids;
549 int n_ssids; 559 int n_ssids;
550 struct ieee80211_channel **channels;
551 u32 n_channels; 560 u32 n_channels;
552 const u8 *ie; 561 const u8 *ie;
553 size_t ie_len; 562 size_t ie_len;
554 563
555 /* internal */ 564 /* internal */
556 struct wiphy *wiphy; 565 struct wiphy *wiphy;
557 int ifidx; 566 struct net_device *dev;
567 bool aborted;
568
569 /* keep last */
570 struct ieee80211_channel *channels[0];
558}; 571};
559 572
560/** 573/**
@@ -584,7 +597,6 @@ enum cfg80211_signal_type {
584 * is no guarantee that these are well-formed!) 597 * is no guarantee that these are well-formed!)
585 * @len_information_elements: total length of the information elements 598 * @len_information_elements: total length of the information elements
586 * @signal: signal strength value (type depends on the wiphy's signal_type) 599 * @signal: signal strength value (type depends on the wiphy's signal_type)
587 * @hold: BSS should not expire
588 * @free_priv: function pointer to free private data 600 * @free_priv: function pointer to free private data
589 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes 601 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
590 */ 602 */
@@ -605,37 +617,59 @@ struct cfg80211_bss {
605}; 617};
606 618
607/** 619/**
620 * ieee80211_bss_get_ie - find IE with given ID
621 * @bss: the bss to search
622 * @ie: the IE ID
623 * Returns %NULL if not found.
624 */
625const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
626
627
628/**
629 * struct cfg80211_crypto_settings - Crypto settings
630 * @wpa_versions: indicates which, if any, WPA versions are enabled
631 * (from enum nl80211_wpa_versions)
632 * @cipher_group: group key cipher suite (or 0 if unset)
633 * @n_ciphers_pairwise: number of AP supported unicast ciphers
634 * @ciphers_pairwise: unicast key cipher suites
635 * @n_akm_suites: number of AKM suites
636 * @akm_suites: AKM suites
637 * @control_port: Whether user space controls IEEE 802.1X port, i.e.,
638 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
639 * required to assume that the port is unauthorized until authorized by
640 * user space. Otherwise, port is marked authorized by default.
641 */
642struct cfg80211_crypto_settings {
643 u32 wpa_versions;
644 u32 cipher_group;
645 int n_ciphers_pairwise;
646 u32 ciphers_pairwise[NL80211_MAX_NR_CIPHER_SUITES];
647 int n_akm_suites;
648 u32 akm_suites[NL80211_MAX_NR_AKM_SUITES];
649 bool control_port;
650};
651
652/**
608 * struct cfg80211_auth_request - Authentication request data 653 * struct cfg80211_auth_request - Authentication request data
609 * 654 *
610 * This structure provides information needed to complete IEEE 802.11 655 * This structure provides information needed to complete IEEE 802.11
611 * authentication. 656 * authentication.
612 * NOTE: This structure will likely change when more code from mac80211 is 657 *
613 * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too. 658 * @bss: The BSS to authenticate with.
614 * Before using this in a driver that does not use mac80211, it would be better
615 * to check the status of that work and better yet, volunteer to work on it.
616 *
617 * @chan: The channel to use or %NULL if not specified (auto-select based on
618 * scan results)
619 * @peer_addr: The address of the peer STA (AP BSSID in infrastructure case);
620 * this field is required to be present; if the driver wants to help with
621 * BSS selection, it should use (yet to be added) MLME event to allow user
622 * space SME to be notified of roaming candidate, so that the SME can then
623 * use the authentication request with the recommended BSSID and whatever
624 * other data may be needed for authentication/association
625 * @ssid: SSID or %NULL if not yet available
626 * @ssid_len: Length of ssid in octets
627 * @auth_type: Authentication type (algorithm) 659 * @auth_type: Authentication type (algorithm)
628 * @ie: Extra IEs to add to Authentication frame or %NULL 660 * @ie: Extra IEs to add to Authentication frame or %NULL
629 * @ie_len: Length of ie buffer in octets 661 * @ie_len: Length of ie buffer in octets
662 * @key_len: length of WEP key for shared key authentication
663 * @key_idx: index of WEP key for shared key authentication
664 * @key: WEP key for shared key authentication
630 */ 665 */
631struct cfg80211_auth_request { 666struct cfg80211_auth_request {
632 struct ieee80211_channel *chan; 667 struct cfg80211_bss *bss;
633 u8 *peer_addr;
634 const u8 *ssid;
635 size_t ssid_len;
636 enum nl80211_auth_type auth_type;
637 const u8 *ie; 668 const u8 *ie;
638 size_t ie_len; 669 size_t ie_len;
670 enum nl80211_auth_type auth_type;
671 const u8 *key;
672 u8 key_len, key_idx;
639}; 673};
640 674
641/** 675/**
@@ -643,35 +677,19 @@ struct cfg80211_auth_request {
643 * 677 *
644 * This structure provides information needed to complete IEEE 802.11 678 * This structure provides information needed to complete IEEE 802.11
645 * (re)association. 679 * (re)association.
646 * NOTE: This structure will likely change when more code from mac80211 is 680 * @bss: The BSS to associate with.
647 * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too.
648 * Before using this in a driver that does not use mac80211, it would be better
649 * to check the status of that work and better yet, volunteer to work on it.
650 *
651 * @chan: The channel to use or %NULL if not specified (auto-select based on
652 * scan results)
653 * @peer_addr: The address of the peer STA (AP BSSID); this field is required
654 * to be present and the STA must be in State 2 (authenticated) with the
655 * peer STA
656 * @ssid: SSID
657 * @ssid_len: Length of ssid in octets
658 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL 681 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL
659 * @ie_len: Length of ie buffer in octets 682 * @ie_len: Length of ie buffer in octets
660 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association 683 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association
661 * @control_port: Whether user space controls IEEE 802.1X port, i.e., 684 * @crypto: crypto settings
662 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is 685 * @prev_bssid: previous BSSID, if not %NULL use reassociate frame
663 * required to assume that the port is unauthorized until authorized by
664 * user space. Otherwise, port is marked authorized by default.
665 */ 686 */
666struct cfg80211_assoc_request { 687struct cfg80211_assoc_request {
667 struct ieee80211_channel *chan; 688 struct cfg80211_bss *bss;
668 u8 *peer_addr; 689 const u8 *ie, *prev_bssid;
669 const u8 *ssid;
670 size_t ssid_len;
671 const u8 *ie;
672 size_t ie_len; 690 size_t ie_len;
691 struct cfg80211_crypto_settings crypto;
673 bool use_mfp; 692 bool use_mfp;
674 bool control_port;
675}; 693};
676 694
677/** 695/**
@@ -680,16 +698,16 @@ struct cfg80211_assoc_request {
680 * This structure provides information needed to complete IEEE 802.11 698 * This structure provides information needed to complete IEEE 802.11
681 * deauthentication. 699 * deauthentication.
682 * 700 *
683 * @peer_addr: The address of the peer STA (AP BSSID); this field is required 701 * @bss: the BSS to deauthenticate from
684 * to be present and the STA must be authenticated with the peer STA
685 * @ie: Extra IEs to add to Deauthentication frame or %NULL 702 * @ie: Extra IEs to add to Deauthentication frame or %NULL
686 * @ie_len: Length of ie buffer in octets 703 * @ie_len: Length of ie buffer in octets
704 * @reason_code: The reason code for the deauthentication
687 */ 705 */
688struct cfg80211_deauth_request { 706struct cfg80211_deauth_request {
689 u8 *peer_addr; 707 struct cfg80211_bss *bss;
690 u16 reason_code;
691 const u8 *ie; 708 const u8 *ie;
692 size_t ie_len; 709 size_t ie_len;
710 u16 reason_code;
693}; 711};
694 712
695/** 713/**
@@ -698,16 +716,16 @@ struct cfg80211_deauth_request {
698 * This structure provides information needed to complete IEEE 802.11 716 * This structure provides information needed to complete IEEE 802.11
699 * disassocation. 717 * disassocation.
700 * 718 *
701 * @peer_addr: The address of the peer STA (AP BSSID); this field is required 719 * @bss: the BSS to disassociate from
702 * to be present and the STA must be associated with the peer STA
703 * @ie: Extra IEs to add to Disassociation frame or %NULL 720 * @ie: Extra IEs to add to Disassociation frame or %NULL
704 * @ie_len: Length of ie buffer in octets 721 * @ie_len: Length of ie buffer in octets
722 * @reason_code: The reason code for the disassociation
705 */ 723 */
706struct cfg80211_disassoc_request { 724struct cfg80211_disassoc_request {
707 u8 *peer_addr; 725 struct cfg80211_bss *bss;
708 u16 reason_code;
709 const u8 *ie; 726 const u8 *ie;
710 size_t ie_len; 727 size_t ie_len;
728 u16 reason_code;
711}; 729};
712 730
713/** 731/**
@@ -726,6 +744,8 @@ struct cfg80211_disassoc_request {
726 * @ie: information element(s) to include in the beacon 744 * @ie: information element(s) to include in the beacon
727 * @ie_len: length of that 745 * @ie_len: length of that
728 * @beacon_interval: beacon interval to use 746 * @beacon_interval: beacon interval to use
747 * @privacy: this is a protected network, keys will be configured
748 * after joining
729 */ 749 */
730struct cfg80211_ibss_params { 750struct cfg80211_ibss_params {
731 u8 *ssid; 751 u8 *ssid;
@@ -735,6 +755,42 @@ struct cfg80211_ibss_params {
735 u8 ssid_len, ie_len; 755 u8 ssid_len, ie_len;
736 u16 beacon_interval; 756 u16 beacon_interval;
737 bool channel_fixed; 757 bool channel_fixed;
758 bool privacy;
759};
760
761/**
762 * struct cfg80211_connect_params - Connection parameters
763 *
764 * This structure provides information needed to complete IEEE 802.11
765 * authentication and association.
766 *
767 * @channel: The channel to use or %NULL if not specified (auto-select based
768 * on scan results)
769 * @bssid: The AP BSSID or %NULL if not specified (auto-select based on scan
770 * results)
771 * @ssid: SSID
772 * @ssid_len: Length of ssid in octets
773 * @auth_type: Authentication type (algorithm)
774 * @assoc_ie: IEs for association request
775 * @assoc_ie_len: Length of assoc_ie in octets
776 * @privacy: indicates whether privacy-enabled APs should be used
777 * @crypto: crypto settings
778 * @key_len: length of WEP key for shared key authentication
779 * @key_idx: index of WEP key for shared key authentication
780 * @key: WEP key for shared key authentication
781 */
782struct cfg80211_connect_params {
783 struct ieee80211_channel *channel;
784 u8 *bssid;
785 u8 *ssid;
786 size_t ssid_len;
787 enum nl80211_auth_type auth_type;
788 u8 *ie;
789 size_t ie_len;
790 bool privacy;
791 struct cfg80211_crypto_settings crypto;
792 const u8 *key;
793 u8 key_len, key_idx;
738}; 794};
739 795
740/** 796/**
@@ -764,6 +820,26 @@ enum tx_power_setting {
764 TX_POWER_FIXED, 820 TX_POWER_FIXED,
765}; 821};
766 822
823/*
824 * cfg80211_bitrate_mask - masks for bitrate control
825 */
826struct cfg80211_bitrate_mask {
827/*
828 * As discussed in Berlin, this struct really
829 * should look like this:
830
831 struct {
832 u32 legacy;
833 u8 mcs[IEEE80211_HT_MCS_MASK_LEN];
834 } control[IEEE80211_NUM_BANDS];
835
836 * Since we can always fix in-kernel users, let's keep
837 * it simpler for now:
838 */
839 u32 fixed; /* fixed bitrate, 0 == not fixed */
840 u32 maxrate; /* in kbps, 0 == no limit */
841};
842
767/** 843/**
768 * struct cfg80211_ops - backend description for wireless configuration 844 * struct cfg80211_ops - backend description for wireless configuration
769 * 845 *
@@ -781,7 +857,8 @@ enum tx_power_setting {
781 * @resume: wiphy device needs to be resumed 857 * @resume: wiphy device needs to be resumed
782 * 858 *
783 * @add_virtual_intf: create a new virtual interface with the given name, 859 * @add_virtual_intf: create a new virtual interface with the given name,
784 * must set the struct wireless_dev's iftype. 860 * must set the struct wireless_dev's iftype. Beware: You must create
861 * the new netdev in the wiphy's network namespace!
785 * 862 *
786 * @del_virtual_intf: remove the virtual interface determined by ifindex. 863 * @del_virtual_intf: remove the virtual interface determined by ifindex.
787 * 864 *
@@ -841,6 +918,12 @@ enum tx_power_setting {
841 * @deauth: Request to deauthenticate from the specified peer 918 * @deauth: Request to deauthenticate from the specified peer
842 * @disassoc: Request to disassociate from the specified peer 919 * @disassoc: Request to disassociate from the specified peer
843 * 920 *
921 * @connect: Connect to the ESS with the specified parameters. When connected,
922 * call cfg80211_connect_result() with status code %WLAN_STATUS_SUCCESS.
923 * If the connection fails for some reason, call cfg80211_connect_result()
924 * with the status from the AP.
925 * @disconnect: Disconnect from the BSS/ESS.
926 *
844 * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call 927 * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call
845 * cfg80211_ibss_joined(), also call that function when changing BSSID due 928 * cfg80211_ibss_joined(), also call that function when changing BSSID due
846 * to a merge. 929 * to a merge.
@@ -857,6 +940,8 @@ enum tx_power_setting {
857 * 940 *
858 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting 941 * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
859 * functions to adjust rfkill hw state 942 * functions to adjust rfkill hw state
943 *
944 * @testmode_cmd: run a test mode command
860 */ 945 */
861struct cfg80211_ops { 946struct cfg80211_ops {
862 int (*suspend)(struct wiphy *wiphy); 947 int (*suspend)(struct wiphy *wiphy);
@@ -865,8 +950,9 @@ struct cfg80211_ops {
865 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 950 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
866 enum nl80211_iftype type, u32 *flags, 951 enum nl80211_iftype type, u32 *flags,
867 struct vif_params *params); 952 struct vif_params *params);
868 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex); 953 int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev);
869 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex, 954 int (*change_virtual_intf)(struct wiphy *wiphy,
955 struct net_device *dev,
870 enum nl80211_iftype type, u32 *flags, 956 enum nl80211_iftype type, u32 *flags,
871 struct vif_params *params); 957 struct vif_params *params);
872 958
@@ -939,9 +1025,16 @@ struct cfg80211_ops {
939 int (*assoc)(struct wiphy *wiphy, struct net_device *dev, 1025 int (*assoc)(struct wiphy *wiphy, struct net_device *dev,
940 struct cfg80211_assoc_request *req); 1026 struct cfg80211_assoc_request *req);
941 int (*deauth)(struct wiphy *wiphy, struct net_device *dev, 1027 int (*deauth)(struct wiphy *wiphy, struct net_device *dev,
942 struct cfg80211_deauth_request *req); 1028 struct cfg80211_deauth_request *req,
1029 void *cookie);
943 int (*disassoc)(struct wiphy *wiphy, struct net_device *dev, 1030 int (*disassoc)(struct wiphy *wiphy, struct net_device *dev,
944 struct cfg80211_disassoc_request *req); 1031 struct cfg80211_disassoc_request *req,
1032 void *cookie);
1033
1034 int (*connect)(struct wiphy *wiphy, struct net_device *dev,
1035 struct cfg80211_connect_params *sme);
1036 int (*disconnect)(struct wiphy *wiphy, struct net_device *dev,
1037 u16 reason_code);
945 1038
946 int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev, 1039 int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev,
947 struct cfg80211_ibss_params *params); 1040 struct cfg80211_ibss_params *params);
@@ -953,7 +1046,23 @@ struct cfg80211_ops {
953 enum tx_power_setting type, int dbm); 1046 enum tx_power_setting type, int dbm);
954 int (*get_tx_power)(struct wiphy *wiphy, int *dbm); 1047 int (*get_tx_power)(struct wiphy *wiphy, int *dbm);
955 1048
1049 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
1050 u8 *addr);
1051
956 void (*rfkill_poll)(struct wiphy *wiphy); 1052 void (*rfkill_poll)(struct wiphy *wiphy);
1053
1054#ifdef CONFIG_NL80211_TESTMODE
1055 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len);
1056#endif
1057
1058 int (*set_bitrate_mask)(struct wiphy *wiphy,
1059 struct net_device *dev,
1060 const u8 *peer,
1061 const struct cfg80211_bitrate_mask *mask);
1062
1063 /* some temporary stuff to finish wext */
1064 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1065 bool enabled, int timeout);
957}; 1066};
958 1067
959/* 1068/*
@@ -996,6 +1105,12 @@ struct cfg80211_ops {
996 * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold); 1105 * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold);
997 * -1 = fragmentation disabled, only odd values >= 256 used 1106 * -1 = fragmentation disabled, only odd values >= 256 used
998 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled 1107 * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
1108 * @net: the network namespace this wiphy currently lives in
1109 * @netnsok: if set to false, do not allow changing the netns of this
1110 * wiphy at all
1111 * @ps_default: default for powersave, will be set depending on the
1112 * kernel's default on wiphy_new(), but can be changed by the
1113 * driver if it has a good reason to override the default
999 */ 1114 */
1000struct wiphy { 1115struct wiphy {
1001 /* assign these fields before you register the wiphy */ 1116 /* assign these fields before you register the wiphy */
@@ -1010,6 +1125,9 @@ struct wiphy {
1010 bool strict_regulatory; 1125 bool strict_regulatory;
1011 bool disable_beacon_hints; 1126 bool disable_beacon_hints;
1012 1127
1128 bool netnsok;
1129 bool ps_default;
1130
1013 enum cfg80211_signal_type signal_type; 1131 enum cfg80211_signal_type signal_type;
1014 1132
1015 int bss_priv_size; 1133 int bss_priv_size;
@@ -1048,9 +1166,35 @@ struct wiphy {
1048 /* dir in debugfs: ieee80211/<wiphyname> */ 1166 /* dir in debugfs: ieee80211/<wiphyname> */
1049 struct dentry *debugfsdir; 1167 struct dentry *debugfsdir;
1050 1168
1169#ifdef CONFIG_NET_NS
1170 /* the network namespace this phy lives in currently */
1171 struct net *_net;
1172#endif
1173
1051 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); 1174 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
1052}; 1175};
1053 1176
1177#ifdef CONFIG_NET_NS
1178static inline struct net *wiphy_net(struct wiphy *wiphy)
1179{
1180 return wiphy->_net;
1181}
1182
1183static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
1184{
1185 wiphy->_net = net;
1186}
1187#else
1188static inline struct net *wiphy_net(struct wiphy *wiphy)
1189{
1190 return &init_net;
1191}
1192
1193static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
1194{
1195}
1196#endif
1197
1054/** 1198/**
1055 * wiphy_priv - return priv from wiphy 1199 * wiphy_priv - return priv from wiphy
1056 * 1200 *
@@ -1063,6 +1207,17 @@ static inline void *wiphy_priv(struct wiphy *wiphy)
1063} 1207}
1064 1208
1065/** 1209/**
1210 * priv_to_wiphy - return the wiphy containing the priv
1211 *
1212 * @priv: a pointer previously returned by wiphy_priv
1213 */
1214static inline struct wiphy *priv_to_wiphy(void *priv)
1215{
1216 BUG_ON(!priv);
1217 return container_of(priv, struct wiphy, priv);
1218}
1219
1220/**
1066 * set_wiphy_dev - set device pointer for wiphy 1221 * set_wiphy_dev - set device pointer for wiphy
1067 * 1222 *
1068 * @wiphy: The wiphy whose device to bind 1223 * @wiphy: The wiphy whose device to bind
@@ -1134,6 +1289,13 @@ extern void wiphy_unregister(struct wiphy *wiphy);
1134 */ 1289 */
1135extern void wiphy_free(struct wiphy *wiphy); 1290extern void wiphy_free(struct wiphy *wiphy);
1136 1291
1292/* internal structs */
1293struct cfg80211_conn;
1294struct cfg80211_internal_bss;
1295struct cfg80211_cached_keys;
1296
1297#define MAX_AUTH_BSSES 4
1298
1137/** 1299/**
1138 * struct wireless_dev - wireless per-netdev state 1300 * struct wireless_dev - wireless per-netdev state
1139 * 1301 *
@@ -1157,22 +1319,45 @@ struct wireless_dev {
1157 struct wiphy *wiphy; 1319 struct wiphy *wiphy;
1158 enum nl80211_iftype iftype; 1320 enum nl80211_iftype iftype;
1159 1321
1160 /* private to the generic wireless code */ 1322 /* the remainder of this struct should be private to cfg80211 */
1161 struct list_head list; 1323 struct list_head list;
1162 struct net_device *netdev; 1324 struct net_device *netdev;
1163 1325
1164 /* currently used for IBSS - might be rearranged in the future */ 1326 struct mutex mtx;
1165 struct cfg80211_bss *current_bss; 1327
1166 u8 bssid[ETH_ALEN]; 1328 struct work_struct cleanup_work;
1329
1330 /* currently used for IBSS and SME - might be rearranged later */
1167 u8 ssid[IEEE80211_MAX_SSID_LEN]; 1331 u8 ssid[IEEE80211_MAX_SSID_LEN];
1168 u8 ssid_len; 1332 u8 ssid_len;
1333 enum {
1334 CFG80211_SME_IDLE,
1335 CFG80211_SME_CONNECTING,
1336 CFG80211_SME_CONNECTED,
1337 } sme_state;
1338 struct cfg80211_conn *conn;
1339 struct cfg80211_cached_keys *connect_keys;
1340
1341 struct list_head event_list;
1342 spinlock_t event_lock;
1343
1344 struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES];
1345 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
1346 struct cfg80211_internal_bss *current_bss; /* associated / joined */
1169 1347
1170#ifdef CONFIG_WIRELESS_EXT 1348#ifdef CONFIG_WIRELESS_EXT
1171 /* wext data */ 1349 /* wext data */
1172 struct { 1350 struct {
1173 struct cfg80211_ibss_params ibss; 1351 struct cfg80211_ibss_params ibss;
1174 u8 bssid[ETH_ALEN]; 1352 struct cfg80211_connect_params connect;
1353 struct cfg80211_cached_keys *keys;
1354 u8 *ie;
1355 size_t ie_len;
1356 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
1357 u8 ssid[IEEE80211_MAX_SSID_LEN];
1175 s8 default_key, default_mgmt_key; 1358 s8 default_key, default_mgmt_key;
1359 bool ps, prev_bssid_valid;
1360 int ps_timeout;
1176 } wext; 1361 } wext;
1177#endif 1362#endif
1178}; 1363};
@@ -1352,20 +1537,6 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb);
1352extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); 1537extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
1353 1538
1354/** 1539/**
1355 * regulatory_hint_11d - hints a country IE as a regulatory domain
1356 * @wiphy: the wireless device giving the hint (used only for reporting
1357 * conflicts)
1358 * @country_ie: pointer to the country IE
1359 * @country_ie_len: length of the country IE
1360 *
1361 * We will intersect the rd with the what CRDA tells us should apply
1362 * for the alpha2 this country IE belongs to, this prevents APs from
1363 * sending us incorrect or outdated information against a country.
1364 */
1365extern void regulatory_hint_11d(struct wiphy *wiphy,
1366 u8 *country_ie,
1367 u8 country_ie_len);
1368/**
1369 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain 1540 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
1370 * @wiphy: the wireless device we want to process the regulatory domain on 1541 * @wiphy: the wireless device we want to process the regulatory domain on
1371 * @regd: the custom regulatory domain to use for this wiphy 1542 * @regd: the custom regulatory domain to use for this wiphy
@@ -1433,27 +1604,34 @@ int cfg80211_wext_siwmlme(struct net_device *dev,
1433int cfg80211_wext_giwrange(struct net_device *dev, 1604int cfg80211_wext_giwrange(struct net_device *dev,
1434 struct iw_request_info *info, 1605 struct iw_request_info *info,
1435 struct iw_point *data, char *extra); 1606 struct iw_point *data, char *extra);
1436int cfg80211_ibss_wext_siwfreq(struct net_device *dev, 1607int cfg80211_wext_siwgenie(struct net_device *dev,
1437 struct iw_request_info *info, 1608 struct iw_request_info *info,
1438 struct iw_freq *freq, char *extra); 1609 struct iw_point *data, char *extra);
1439int cfg80211_ibss_wext_giwfreq(struct net_device *dev, 1610int cfg80211_wext_siwauth(struct net_device *dev,
1440 struct iw_request_info *info, 1611 struct iw_request_info *info,
1441 struct iw_freq *freq, char *extra); 1612 struct iw_param *data, char *extra);
1442int cfg80211_ibss_wext_siwessid(struct net_device *dev, 1613int cfg80211_wext_giwauth(struct net_device *dev,
1443 struct iw_request_info *info, 1614 struct iw_request_info *info,
1444 struct iw_point *data, char *ssid); 1615 struct iw_param *data, char *extra);
1445int cfg80211_ibss_wext_giwessid(struct net_device *dev,
1446 struct iw_request_info *info,
1447 struct iw_point *data, char *ssid);
1448int cfg80211_ibss_wext_siwap(struct net_device *dev,
1449 struct iw_request_info *info,
1450 struct sockaddr *ap_addr, char *extra);
1451int cfg80211_ibss_wext_giwap(struct net_device *dev,
1452 struct iw_request_info *info,
1453 struct sockaddr *ap_addr, char *extra);
1454 1616
1455struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy, 1617int cfg80211_wext_siwfreq(struct net_device *dev,
1456 struct iw_freq *freq); 1618 struct iw_request_info *info,
1619 struct iw_freq *freq, char *extra);
1620int cfg80211_wext_giwfreq(struct net_device *dev,
1621 struct iw_request_info *info,
1622 struct iw_freq *freq, char *extra);
1623int cfg80211_wext_siwessid(struct net_device *dev,
1624 struct iw_request_info *info,
1625 struct iw_point *data, char *ssid);
1626int cfg80211_wext_giwessid(struct net_device *dev,
1627 struct iw_request_info *info,
1628 struct iw_point *data, char *ssid);
1629int cfg80211_wext_siwrate(struct net_device *dev,
1630 struct iw_request_info *info,
1631 struct iw_param *rate, char *extra);
1632int cfg80211_wext_giwrate(struct net_device *dev,
1633 struct iw_request_info *info,
1634 struct iw_param *rate, char *extra);
1457 1635
1458int cfg80211_wext_siwrts(struct net_device *dev, 1636int cfg80211_wext_siwrts(struct net_device *dev,
1459 struct iw_request_info *info, 1637 struct iw_request_info *info,
@@ -1488,6 +1666,21 @@ int cfg80211_wext_siwtxpower(struct net_device *dev,
1488int cfg80211_wext_giwtxpower(struct net_device *dev, 1666int cfg80211_wext_giwtxpower(struct net_device *dev,
1489 struct iw_request_info *info, 1667 struct iw_request_info *info,
1490 union iwreq_data *data, char *keybuf); 1668 union iwreq_data *data, char *keybuf);
1669struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev);
1670
1671int cfg80211_wext_siwpower(struct net_device *dev,
1672 struct iw_request_info *info,
1673 struct iw_param *wrq, char *extra);
1674int cfg80211_wext_giwpower(struct net_device *dev,
1675 struct iw_request_info *info,
1676 struct iw_param *wrq, char *extra);
1677
1678int cfg80211_wext_siwap(struct net_device *dev,
1679 struct iw_request_info *info,
1680 struct sockaddr *ap_addr, char *extra);
1681int cfg80211_wext_giwap(struct net_device *dev,
1682 struct iw_request_info *info,
1683 struct sockaddr *ap_addr, char *extra);
1491 1684
1492/* 1685/*
1493 * callbacks for asynchronous cfg80211 methods, notification 1686 * callbacks for asynchronous cfg80211 methods, notification
@@ -1569,7 +1762,7 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
1569 * This function is called whenever an authentication has been processed in 1762 * This function is called whenever an authentication has been processed in
1570 * station mode. The driver is required to call either this function or 1763 * station mode. The driver is required to call either this function or
1571 * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth() 1764 * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth()
1572 * call. 1765 * call. This function may sleep.
1573 */ 1766 */
1574void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); 1767void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
1575 1768
@@ -1577,6 +1770,8 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
1577 * cfg80211_send_auth_timeout - notification of timed out authentication 1770 * cfg80211_send_auth_timeout - notification of timed out authentication
1578 * @dev: network device 1771 * @dev: network device
1579 * @addr: The MAC address of the device with which the authentication timed out 1772 * @addr: The MAC address of the device with which the authentication timed out
1773 *
1774 * This function may sleep.
1580 */ 1775 */
1581void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); 1776void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
1582 1777
@@ -1589,7 +1784,7 @@ void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
1589 * This function is called whenever a (re)association response has been 1784 * This function is called whenever a (re)association response has been
1590 * processed in station mode. The driver is required to call either this 1785 * processed in station mode. The driver is required to call either this
1591 * function or cfg80211_send_assoc_timeout() to indicate the result of 1786 * function or cfg80211_send_assoc_timeout() to indicate the result of
1592 * cfg80211_ops::assoc() call. 1787 * cfg80211_ops::assoc() call. This function may sleep.
1593 */ 1788 */
1594void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); 1789void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
1595 1790
@@ -1597,6 +1792,8 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len);
1597 * cfg80211_send_assoc_timeout - notification of timed out association 1792 * cfg80211_send_assoc_timeout - notification of timed out association
1598 * @dev: network device 1793 * @dev: network device
1599 * @addr: The MAC address of the device with which the association timed out 1794 * @addr: The MAC address of the device with which the association timed out
1795 *
1796 * This function may sleep.
1600 */ 1797 */
1601void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); 1798void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
1602 1799
@@ -1605,41 +1802,30 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr);
1605 * @dev: network device 1802 * @dev: network device
1606 * @buf: deauthentication frame (header + body) 1803 * @buf: deauthentication frame (header + body)
1607 * @len: length of the frame data 1804 * @len: length of the frame data
1805 * @cookie: cookie from ->deauth if called within that callback,
1806 * %NULL otherwise
1608 * 1807 *
1609 * This function is called whenever deauthentication has been processed in 1808 * This function is called whenever deauthentication has been processed in
1610 * station mode. This includes both received deauthentication frames and 1809 * station mode. This includes both received deauthentication frames and
1611 * locally generated ones. 1810 * locally generated ones. This function may sleep.
1612 */ 1811 */
1613void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); 1812void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len,
1813 void *cookie);
1614 1814
1615/** 1815/**
1616 * cfg80211_send_disassoc - notification of processed disassociation 1816 * cfg80211_send_disassoc - notification of processed disassociation
1617 * @dev: network device 1817 * @dev: network device
1618 * @buf: disassociation response frame (header + body) 1818 * @buf: disassociation response frame (header + body)
1619 * @len: length of the frame data 1819 * @len: length of the frame data
1820 * @cookie: cookie from ->disassoc if called within that callback,
1821 * %NULL otherwise
1620 * 1822 *
1621 * This function is called whenever disassociation has been processed in 1823 * This function is called whenever disassociation has been processed in
1622 * station mode. This includes both received disassociation frames and locally 1824 * station mode. This includes both received disassociation frames and locally
1623 * generated ones. 1825 * generated ones. This function may sleep.
1624 */
1625void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
1626
1627/**
1628 * cfg80211_hold_bss - exclude bss from expiration
1629 * @bss: bss which should not expire
1630 *
1631 * In a case when the BSS is not updated but it shouldn't expire this
1632 * function can be used to mark the BSS to be excluded from expiration.
1633 */
1634void cfg80211_hold_bss(struct cfg80211_bss *bss);
1635
1636/**
1637 * cfg80211_unhold_bss - remove expiration exception from the BSS
1638 * @bss: bss which can expire again
1639 *
1640 * This function marks the BSS to be expirable again.
1641 */ 1826 */
1642void cfg80211_unhold_bss(struct cfg80211_bss *bss); 1827void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len,
1828 void *cookie);
1643 1829
1644/** 1830/**
1645 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) 1831 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
@@ -1648,6 +1834,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss);
1648 * @key_type: The key type that the received frame used 1834 * @key_type: The key type that the received frame used
1649 * @key_id: Key identifier (0..3) 1835 * @key_id: Key identifier (0..3)
1650 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets) 1836 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
1837 * @gfp: allocation flags
1651 * 1838 *
1652 * This function is called whenever the local MAC detects a MIC failure in a 1839 * This function is called whenever the local MAC detects a MIC failure in a
1653 * received frame. This matches with MLME-MICHAELMICFAILURE.indication() 1840 * received frame. This matches with MLME-MICHAELMICFAILURE.indication()
@@ -1655,7 +1842,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss);
1655 */ 1842 */
1656void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, 1843void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
1657 enum nl80211_key_type key_type, int key_id, 1844 enum nl80211_key_type key_type, int key_id,
1658 const u8 *tsc); 1845 const u8 *tsc, gfp_t gfp);
1659 1846
1660/** 1847/**
1661 * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS 1848 * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS
@@ -1692,4 +1879,137 @@ void wiphy_rfkill_start_polling(struct wiphy *wiphy);
1692 */ 1879 */
1693void wiphy_rfkill_stop_polling(struct wiphy *wiphy); 1880void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
1694 1881
1882#ifdef CONFIG_NL80211_TESTMODE
1883/**
1884 * cfg80211_testmode_alloc_reply_skb - allocate testmode reply
1885 * @wiphy: the wiphy
1886 * @approxlen: an upper bound of the length of the data that will
1887 * be put into the skb
1888 *
1889 * This function allocates and pre-fills an skb for a reply to
1890 * the testmode command. Since it is intended for a reply, calling
1891 * it outside of the @testmode_cmd operation is invalid.
1892 *
1893 * The returned skb (or %NULL if any errors happen) is pre-filled
1894 * with the wiphy index and set up in a way that any data that is
1895 * put into the skb (with skb_put(), nla_put() or similar) will end
1896 * up being within the %NL80211_ATTR_TESTDATA attribute, so all that
1897 * needs to be done with the skb is adding data for the corresponding
1898 * userspace tool which can then read that data out of the testdata
1899 * attribute. You must not modify the skb in any other way.
1900 *
1901 * When done, call cfg80211_testmode_reply() with the skb and return
1902 * its error code as the result of the @testmode_cmd operation.
1903 */
1904struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy,
1905 int approxlen);
1906
1907/**
1908 * cfg80211_testmode_reply - send the reply skb
1909 * @skb: The skb, must have been allocated with
1910 * cfg80211_testmode_alloc_reply_skb()
1911 *
1912 * Returns an error code or 0 on success, since calling this
1913 * function will usually be the last thing before returning
1914 * from the @testmode_cmd you should return the error code.
1915 * Note that this function consumes the skb regardless of the
1916 * return value.
1917 */
1918int cfg80211_testmode_reply(struct sk_buff *skb);
1919
1920/**
1921 * cfg80211_testmode_alloc_event_skb - allocate testmode event
1922 * @wiphy: the wiphy
1923 * @approxlen: an upper bound of the length of the data that will
1924 * be put into the skb
1925 * @gfp: allocation flags
1926 *
1927 * This function allocates and pre-fills an skb for an event on the
1928 * testmode multicast group.
1929 *
1930 * The returned skb (or %NULL if any errors happen) is set up in the
1931 * same way as with cfg80211_testmode_alloc_reply_skb() but prepared
1932 * for an event. As there, you should simply add data to it that will
1933 * then end up in the %NL80211_ATTR_TESTDATA attribute. Again, you must
1934 * not modify the skb in any other way.
1935 *
1936 * When done filling the skb, call cfg80211_testmode_event() with the
1937 * skb to send the event.
1938 */
1939struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
1940 int approxlen, gfp_t gfp);
1941
1942/**
1943 * cfg80211_testmode_event - send the event
1944 * @skb: The skb, must have been allocated with
1945 * cfg80211_testmode_alloc_event_skb()
1946 * @gfp: allocation flags
1947 *
1948 * This function sends the given @skb, which must have been allocated
1949 * by cfg80211_testmode_alloc_event_skb(), as an event. It always
1950 * consumes it.
1951 */
1952void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp);
1953
1954#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
1955#else
1956#define CFG80211_TESTMODE_CMD(cmd)
1957#endif
1958
1959/**
1960 * cfg80211_connect_result - notify cfg80211 of connection result
1961 *
1962 * @dev: network device
1963 * @bssid: the BSSID of the AP
1964 * @req_ie: association request IEs (maybe be %NULL)
1965 * @req_ie_len: association request IEs length
1966 * @resp_ie: association response IEs (may be %NULL)
1967 * @resp_ie_len: assoc response IEs length
1968 * @status: status code, 0 for successful connection, use
1969 * %WLAN_STATUS_UNSPECIFIED_FAILURE if your device cannot give you
1970 * the real status code for failures.
1971 * @gfp: allocation flags
1972 *
1973 * It should be called by the underlying driver whenever connect() has
1974 * succeeded.
1975 */
1976void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
1977 const u8 *req_ie, size_t req_ie_len,
1978 const u8 *resp_ie, size_t resp_ie_len,
1979 u16 status, gfp_t gfp);
1980
1981/**
1982 * cfg80211_roamed - notify cfg80211 of roaming
1983 *
1984 * @dev: network device
1985 * @bssid: the BSSID of the new AP
1986 * @req_ie: association request IEs (maybe be %NULL)
1987 * @req_ie_len: association request IEs length
1988 * @resp_ie: association response IEs (may be %NULL)
1989 * @resp_ie_len: assoc response IEs length
1990 * @gfp: allocation flags
1991 *
1992 * It should be called by the underlying driver whenever it roamed
1993 * from one AP to another while connected.
1994 */
1995void cfg80211_roamed(struct net_device *dev, const u8 *bssid,
1996 const u8 *req_ie, size_t req_ie_len,
1997 const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp);
1998
1999/**
2000 * cfg80211_disconnected - notify cfg80211 that connection was dropped
2001 *
2002 * @dev: network device
2003 * @ie: information elements of the deauth/disassoc frame (may be %NULL)
2004 * @ie_len: length of IEs
2005 * @reason: reason code for the disconnection, set it to 0 if unknown
2006 * @gfp: allocation flags
2007 *
2008 * After it calls this function, the driver should enter an idle state
2009 * and not try to connect to any AP any more.
2010 */
2011void cfg80211_disconnected(struct net_device *dev, u16 reason,
2012 u8 *ie, size_t ie_len, gfp_t gfp);
2013
2014
1695#endif /* __NET_CFG80211_H */ 2015#endif /* __NET_CFG80211_H */
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index 775cfc8055be..b36ac7e0914d 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -48,6 +48,8 @@ struct dcbnl_rtnl_ops {
48 void (*setbcncfg)(struct net_device *, int, u32); 48 void (*setbcncfg)(struct net_device *, int, u32);
49 void (*getbcnrp)(struct net_device *, int, u8 *); 49 void (*getbcnrp)(struct net_device *, int, u8 *);
50 void (*setbcnrp)(struct net_device *, int, u8); 50 void (*setbcnrp)(struct net_device *, int, u8);
51 u8 (*setapp)(struct net_device *, u8, u16, u8);
52 u8 (*getapp)(struct net_device *, u8, u16);
51}; 53};
52 54
53#endif /* __NET_DCBNL_H__ */ 55#endif /* __NET_DCBNL_H__ */
diff --git a/include/net/dst.h b/include/net/dst.h
index 7fc409c19b37..5a900ddcf10d 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -8,6 +8,7 @@
8#ifndef _NET_DST_H 8#ifndef _NET_DST_H
9#define _NET_DST_H 9#define _NET_DST_H
10 10
11#include <net/dst_ops.h>
11#include <linux/netdevice.h> 12#include <linux/netdevice.h>
12#include <linux/rtnetlink.h> 13#include <linux/rtnetlink.h>
13#include <linux/rcupdate.h> 14#include <linux/rcupdate.h>
@@ -102,28 +103,6 @@ struct dst_entry
102 }; 103 };
103}; 104};
104 105
105
106struct dst_ops
107{
108 unsigned short family;
109 __be16 protocol;
110 unsigned gc_thresh;
111
112 int (*gc)(struct dst_ops *ops);
113 struct dst_entry * (*check)(struct dst_entry *, __u32 cookie);
114 void (*destroy)(struct dst_entry *);
115 void (*ifdown)(struct dst_entry *,
116 struct net_device *dev, int how);
117 struct dst_entry * (*negative_advice)(struct dst_entry *);
118 void (*link_failure)(struct sk_buff *);
119 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
120 int (*local_out)(struct sk_buff *skb);
121
122 atomic_t entries;
123 struct kmem_cache *kmem_cachep;
124 struct net *dst_net;
125};
126
127#ifdef __KERNEL__ 106#ifdef __KERNEL__
128 107
129static inline u32 108static inline u32
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h
new file mode 100644
index 000000000000..d1ff9b7e99b8
--- /dev/null
+++ b/include/net/dst_ops.h
@@ -0,0 +1,28 @@
1#ifndef _NET_DST_OPS_H
2#define _NET_DST_OPS_H
3#include <linux/types.h>
4
5struct dst_entry;
6struct kmem_cachep;
7struct net_device;
8struct sk_buff;
9
10struct dst_ops {
11 unsigned short family;
12 __be16 protocol;
13 unsigned gc_thresh;
14
15 int (*gc)(struct dst_ops *ops);
16 struct dst_entry * (*check)(struct dst_entry *, __u32 cookie);
17 void (*destroy)(struct dst_entry *);
18 void (*ifdown)(struct dst_entry *,
19 struct net_device *dev, int how);
20 struct dst_entry * (*negative_advice)(struct dst_entry *);
21 void (*link_failure)(struct sk_buff *);
22 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
23 int (*local_out)(struct sk_buff *skb);
24
25 atomic_t entries;
26 struct kmem_cache *kmem_cachep;
27};
28#endif
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 1b0e3ee4ddd8..2a1c06874c42 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/genetlink.h> 4#include <linux/genetlink.h>
5#include <net/netlink.h> 5#include <net/netlink.h>
6#include <net/net_namespace.h>
6 7
7/** 8/**
8 * struct genl_multicast_group - generic netlink multicast group 9 * struct genl_multicast_group - generic netlink multicast group
@@ -27,6 +28,8 @@ struct genl_multicast_group
27 * @name: name of family 28 * @name: name of family
28 * @version: protocol version 29 * @version: protocol version
29 * @maxattr: maximum number of attributes supported 30 * @maxattr: maximum number of attributes supported
31 * @netnsok: set to true if the family can handle network
32 * namespaces and should be presented in all of them
30 * @attrbuf: buffer to store parsed attributes 33 * @attrbuf: buffer to store parsed attributes
31 * @ops_list: list of all assigned operations 34 * @ops_list: list of all assigned operations
32 * @family_list: family list 35 * @family_list: family list
@@ -39,6 +42,7 @@ struct genl_family
39 char name[GENL_NAMSIZ]; 42 char name[GENL_NAMSIZ];
40 unsigned int version; 43 unsigned int version;
41 unsigned int maxattr; 44 unsigned int maxattr;
45 bool netnsok;
42 struct nlattr ** attrbuf; /* private */ 46 struct nlattr ** attrbuf; /* private */
43 struct list_head ops_list; /* private */ 47 struct list_head ops_list; /* private */
44 struct list_head family_list; /* private */ 48 struct list_head family_list; /* private */
@@ -62,8 +66,32 @@ struct genl_info
62 struct genlmsghdr * genlhdr; 66 struct genlmsghdr * genlhdr;
63 void * userhdr; 67 void * userhdr;
64 struct nlattr ** attrs; 68 struct nlattr ** attrs;
69#ifdef CONFIG_NET_NS
70 struct net * _net;
71#endif
65}; 72};
66 73
74#ifdef CONFIG_NET_NS
75static inline struct net *genl_info_net(struct genl_info *info)
76{
77 return info->_net;
78}
79
80static inline void genl_info_net_set(struct genl_info *info, struct net *net)
81{
82 info->_net = net;
83}
84#else
85static inline struct net *genl_info_net(struct genl_info *info)
86{
87 return &init_net;
88}
89
90static inline void genl_info_net_set(struct genl_info *info, struct net *net)
91{
92}
93#endif
94
67/** 95/**
68 * struct genl_ops - generic netlink operations 96 * struct genl_ops - generic netlink operations
69 * @cmd: command identifier 97 * @cmd: command identifier
@@ -98,8 +126,6 @@ extern int genl_register_mc_group(struct genl_family *family,
98extern void genl_unregister_mc_group(struct genl_family *family, 126extern void genl_unregister_mc_group(struct genl_family *family,
99 struct genl_multicast_group *grp); 127 struct genl_multicast_group *grp);
100 128
101extern struct sock *genl_sock;
102
103/** 129/**
104 * genlmsg_put - Add generic netlink header to netlink message 130 * genlmsg_put - Add generic netlink header to netlink message
105 * @skb: socket buffer holding the message 131 * @skb: socket buffer holding the message
@@ -170,7 +196,21 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr)
170} 196}
171 197
172/** 198/**
173 * genlmsg_multicast - multicast a netlink message 199 * genlmsg_multicast_netns - multicast a netlink message to a specific netns
200 * @net: the net namespace
201 * @skb: netlink message as socket buffer
202 * @pid: own netlink pid to avoid sending to yourself
203 * @group: multicast group id
204 * @flags: allocation flags
205 */
206static inline int genlmsg_multicast_netns(struct net *net, struct sk_buff *skb,
207 u32 pid, unsigned int group, gfp_t flags)
208{
209 return nlmsg_multicast(net->genl_sock, skb, pid, group, flags);
210}
211
212/**
213 * genlmsg_multicast - multicast a netlink message to the default netns
174 * @skb: netlink message as socket buffer 214 * @skb: netlink message as socket buffer
175 * @pid: own netlink pid to avoid sending to yourself 215 * @pid: own netlink pid to avoid sending to yourself
176 * @group: multicast group id 216 * @group: multicast group id
@@ -179,17 +219,29 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr)
179static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid, 219static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid,
180 unsigned int group, gfp_t flags) 220 unsigned int group, gfp_t flags)
181{ 221{
182 return nlmsg_multicast(genl_sock, skb, pid, group, flags); 222 return genlmsg_multicast_netns(&init_net, skb, pid, group, flags);
183} 223}
184 224
185/** 225/**
226 * genlmsg_multicast_allns - multicast a netlink message to all net namespaces
227 * @skb: netlink message as socket buffer
228 * @pid: own netlink pid to avoid sending to yourself
229 * @group: multicast group id
230 * @flags: allocation flags
231 *
232 * This function must hold the RTNL or rcu_read_lock().
233 */
234int genlmsg_multicast_allns(struct sk_buff *skb, u32 pid,
235 unsigned int group, gfp_t flags);
236
237/**
186 * genlmsg_unicast - unicast a netlink message 238 * genlmsg_unicast - unicast a netlink message
187 * @skb: netlink message as socket buffer 239 * @skb: netlink message as socket buffer
188 * @pid: netlink pid of the destination socket 240 * @pid: netlink pid of the destination socket
189 */ 241 */
190static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid) 242static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb, u32 pid)
191{ 243{
192 return nlmsg_unicast(genl_sock, skb, pid); 244 return nlmsg_unicast(net->genl_sock, skb, pid);
193} 245}
194 246
195/** 247/**
@@ -199,7 +251,7 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid)
199 */ 251 */
200static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info) 252static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info)
201{ 253{
202 return genlmsg_unicast(skb, info->snd_pid); 254 return genlmsg_unicast(genl_info_net(info), skb, info->snd_pid);
203} 255}
204 256
205/** 257/**
diff --git a/include/net/ieee802154/mac_def.h b/include/net/ieee802154.h
index 8cb684635650..d52685defb11 100644
--- a/include/net/ieee802154/mac_def.h
+++ b/include/net/ieee802154.h
@@ -23,8 +23,8 @@
23 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 23 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
24 */ 24 */
25 25
26#ifndef IEEE802154_MAC_DEF_H 26#ifndef NET_IEEE802154_H
27#define IEEE802154_MAC_DEF_H 27#define NET_IEEE802154_H
28 28
29#define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */ 29#define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */
30#define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */ 30#define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */
diff --git a/include/net/ieee802154/nl802154.h b/include/net/ieee802154/nl802154.h
deleted file mode 100644
index 78efcdf52b59..000000000000
--- a/include/net/ieee802154/nl802154.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * nl802154.h
3 *
4 * Copyright (C) 2007, 2008, 2009 Siemens AG
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 */
20
21#ifndef IEEE802154_NL_H
22#define IEEE802154_NL_H
23
24struct net_device;
25struct ieee802154_addr;
26
27int ieee802154_nl_assoc_indic(struct net_device *dev,
28 struct ieee802154_addr *addr, u8 cap);
29int ieee802154_nl_assoc_confirm(struct net_device *dev,
30 u16 short_addr, u8 status);
31int ieee802154_nl_disassoc_indic(struct net_device *dev,
32 struct ieee802154_addr *addr, u8 reason);
33int ieee802154_nl_disassoc_confirm(struct net_device *dev,
34 u8 status);
35int ieee802154_nl_scan_confirm(struct net_device *dev,
36 u8 status, u8 scan_type, u32 unscanned,
37 u8 *edl/*, struct list_head *pan_desc_list */);
38int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid,
39 u16 coord_addr);
40
41#endif
diff --git a/include/net/ieee802154/netdevice.h b/include/net/ieee802154_netdev.h
index e2506af3e7c8..5dc6a61952de 100644
--- a/include/net/ieee802154/netdevice.h
+++ b/include/net/ieee802154_netdev.h
@@ -80,7 +80,7 @@ static inline int mac_cb_type(struct sk_buff *skb)
80struct ieee802154_mlme_ops { 80struct ieee802154_mlme_ops {
81 int (*assoc_req)(struct net_device *dev, 81 int (*assoc_req)(struct net_device *dev,
82 struct ieee802154_addr *addr, 82 struct ieee802154_addr *addr,
83 u8 channel, u8 cap); 83 u8 channel, u8 page, u8 cap);
84 int (*assoc_resp)(struct net_device *dev, 84 int (*assoc_resp)(struct net_device *dev,
85 struct ieee802154_addr *addr, 85 struct ieee802154_addr *addr,
86 u16 short_addr, u8 status); 86 u16 short_addr, u8 status);
@@ -89,10 +89,10 @@ struct ieee802154_mlme_ops {
89 u8 reason); 89 u8 reason);
90 int (*start_req)(struct net_device *dev, 90 int (*start_req)(struct net_device *dev,
91 struct ieee802154_addr *addr, 91 struct ieee802154_addr *addr,
92 u8 channel, u8 bcn_ord, u8 sf_ord, 92 u8 channel, u8 page, u8 bcn_ord, u8 sf_ord,
93 u8 pan_coord, u8 blx, u8 coord_realign); 93 u8 pan_coord, u8 blx, u8 coord_realign);
94 int (*scan_req)(struct net_device *dev, 94 int (*scan_req)(struct net_device *dev,
95 u8 type, u32 channels, u8 duration); 95 u8 type, u32 channels, u8 page, u8 duration);
96 96
97 /* 97 /*
98 * FIXME: these should become the part of PIB/MIB interface. 98 * FIXME: these should become the part of PIB/MIB interface.
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 7c5c0f79168a..15b492a9aa79 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -22,6 +22,12 @@
22#include <net/flow.h> 22#include <net/flow.h>
23#include <net/netlink.h> 23#include <net/netlink.h>
24 24
25#ifdef CONFIG_IPV6_MULTIPLE_TABLES
26#define FIB6_TABLE_HASHSZ 256
27#else
28#define FIB6_TABLE_HASHSZ 1
29#endif
30
25struct rt6_info; 31struct rt6_info;
26 32
27struct fib6_config 33struct fib6_config
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index bbae1e87efcd..98978e73f666 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -99,47 +99,47 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
99 return &buf[*idx - len]; 99 return &buf[*idx - len];
100} 100}
101 101
102#define IP_VS_DBG_BUF(level, msg...) \ 102#define IP_VS_DBG_BUF(level, msg, ...) \
103 do { \ 103 do { \
104 char ip_vs_dbg_buf[160]; \ 104 char ip_vs_dbg_buf[160]; \
105 int ip_vs_dbg_idx = 0; \ 105 int ip_vs_dbg_idx = 0; \
106 if (level <= ip_vs_get_debug_level()) \ 106 if (level <= ip_vs_get_debug_level()) \
107 printk(KERN_DEBUG "IPVS: " msg); \ 107 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
108 } while (0) 108 } while (0)
109#define IP_VS_ERR_BUF(msg...) \ 109#define IP_VS_ERR_BUF(msg...) \
110 do { \ 110 do { \
111 char ip_vs_dbg_buf[160]; \ 111 char ip_vs_dbg_buf[160]; \
112 int ip_vs_dbg_idx = 0; \ 112 int ip_vs_dbg_idx = 0; \
113 printk(KERN_ERR "IPVS: " msg); \ 113 pr_err(msg); \
114 } while (0) 114 } while (0)
115 115
116/* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */ 116/* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */
117#define IP_VS_DBG_ADDR(af, addr) \ 117#define IP_VS_DBG_ADDR(af, addr) \
118 ip_vs_dbg_addr(af, ip_vs_dbg_buf, \ 118 ip_vs_dbg_addr(af, ip_vs_dbg_buf, \
119 sizeof(ip_vs_dbg_buf), addr, \ 119 sizeof(ip_vs_dbg_buf), addr, \
120 &ip_vs_dbg_idx) 120 &ip_vs_dbg_idx)
121 121
122#define IP_VS_DBG(level, msg...) \ 122#define IP_VS_DBG(level, msg, ...) \
123 do { \ 123 do { \
124 if (level <= ip_vs_get_debug_level()) \ 124 if (level <= ip_vs_get_debug_level()) \
125 printk(KERN_DEBUG "IPVS: " msg); \ 125 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
126 } while (0) 126 } while (0)
127#define IP_VS_DBG_RL(msg...) \ 127#define IP_VS_DBG_RL(msg, ...) \
128 do { \ 128 do { \
129 if (net_ratelimit()) \ 129 if (net_ratelimit()) \
130 printk(KERN_DEBUG "IPVS: " msg); \ 130 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
131 } while (0) 131 } while (0)
132#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ 132#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \
133 do { \ 133 do { \
134 if (level <= ip_vs_get_debug_level()) \ 134 if (level <= ip_vs_get_debug_level()) \
135 pp->debug_packet(pp, skb, ofs, msg); \ 135 pp->debug_packet(pp, skb, ofs, msg); \
136 } while (0) 136 } while (0)
137#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ 137#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \
138 do { \ 138 do { \
139 if (level <= ip_vs_get_debug_level() && \ 139 if (level <= ip_vs_get_debug_level() && \
140 net_ratelimit()) \ 140 net_ratelimit()) \
141 pp->debug_packet(pp, skb, ofs, msg); \ 141 pp->debug_packet(pp, skb, ofs, msg); \
142 } while (0) 142 } while (0)
143#else /* NO DEBUGGING at ALL */ 143#else /* NO DEBUGGING at ALL */
144#define IP_VS_DBG_BUF(level, msg...) do {} while (0) 144#define IP_VS_DBG_BUF(level, msg...) do {} while (0)
145#define IP_VS_ERR_BUF(msg...) do {} while (0) 145#define IP_VS_ERR_BUF(msg...) do {} while (0)
@@ -150,29 +150,27 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
150#endif 150#endif
151 151
152#define IP_VS_BUG() BUG() 152#define IP_VS_BUG() BUG()
153#define IP_VS_ERR(msg...) printk(KERN_ERR "IPVS: " msg) 153#define IP_VS_ERR_RL(msg, ...) \
154#define IP_VS_INFO(msg...) printk(KERN_INFO "IPVS: " msg) 154 do { \
155#define IP_VS_WARNING(msg...) \ 155 if (net_ratelimit()) \
156 printk(KERN_WARNING "IPVS: " msg) 156 pr_err(msg, ##__VA_ARGS__); \
157#define IP_VS_ERR_RL(msg...) \ 157 } while (0)
158 do { \
159 if (net_ratelimit()) \
160 printk(KERN_ERR "IPVS: " msg); \
161 } while (0)
162 158
163#ifdef CONFIG_IP_VS_DEBUG 159#ifdef CONFIG_IP_VS_DEBUG
164#define EnterFunction(level) \ 160#define EnterFunction(level) \
165 do { \ 161 do { \
166 if (level <= ip_vs_get_debug_level()) \ 162 if (level <= ip_vs_get_debug_level()) \
167 printk(KERN_DEBUG "Enter: %s, %s line %i\n", \ 163 printk(KERN_DEBUG \
168 __func__, __FILE__, __LINE__); \ 164 pr_fmt("Enter: %s, %s line %i\n"), \
169 } while (0) 165 __func__, __FILE__, __LINE__); \
170#define LeaveFunction(level) \ 166 } while (0)
171 do { \ 167#define LeaveFunction(level) \
172 if (level <= ip_vs_get_debug_level()) \ 168 do { \
173 printk(KERN_DEBUG "Leave: %s, %s line %i\n", \ 169 if (level <= ip_vs_get_debug_level()) \
174 __func__, __FILE__, __LINE__); \ 170 printk(KERN_DEBUG \
175 } while (0) 171 pr_fmt("Leave: %s, %s line %i\n"), \
172 __func__, __FILE__, __LINE__); \
173 } while (0)
176#else 174#else
177#define EnterFunction(level) do {} while (0) 175#define EnterFunction(level) do {} while (0)
178#define LeaveFunction(level) do {} while (0) 176#define LeaveFunction(level) do {} while (0)
@@ -740,7 +738,8 @@ extern void ip_vs_protocol_cleanup(void);
740extern void ip_vs_protocol_timeout_change(int flags); 738extern void ip_vs_protocol_timeout_change(int flags);
741extern int *ip_vs_create_timeout_table(int *table, int size); 739extern int *ip_vs_create_timeout_table(int *table, int size);
742extern int 740extern int
743ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to); 741ip_vs_set_state_timeout(int *table, int num, const char *const *names,
742 const char *name, int to);
744extern void 743extern void
745ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, 744ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb,
746 int offset, const char *msg); 745 int offset, const char *msg);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index f27fd83d67d8..ad9a51130254 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -441,6 +441,18 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
441 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); 441 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
442} 442}
443 443
444static __inline__ void ipv6_select_ident(struct frag_hdr *fhdr)
445{
446 static u32 ipv6_fragmentation_id = 1;
447 static DEFINE_SPINLOCK(ip6_id_lock);
448
449 spin_lock_bh(&ip6_id_lock);
450 fhdr->identification = htonl(ipv6_fragmentation_id);
451 if (++ipv6_fragmentation_id == 0)
452 ipv6_fragmentation_id = 1;
453 spin_unlock_bh(&ip6_id_lock);
454}
455
444/* 456/*
445 * Prototypes exported by ipv6 457 * Prototypes exported by ipv6
446 */ 458 */
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h
index c290447872d1..bc0c6f31f1c6 100644
--- a/include/net/irda/ircomm_event.h
+++ b/include/net/irda/ircomm_event.h
@@ -74,7 +74,7 @@ struct ircomm_info {
74 struct qos_info *qos; 74 struct qos_info *qos;
75}; 75};
76 76
77extern char *ircomm_state[]; 77extern const char *const ircomm_state[];
78 78
79struct ircomm_cb; /* Forward decl. */ 79struct ircomm_cb; /* Forward decl. */
80 80
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h
index f91a5695aa44..0a63bbb972d7 100644
--- a/include/net/irda/ircomm_tty_attach.h
+++ b/include/net/irda/ircomm_tty_attach.h
@@ -66,8 +66,8 @@ struct ircomm_tty_info {
66 __u8 dlsap_sel; 66 __u8 dlsap_sel;
67}; 67};
68 68
69extern char *ircomm_state[]; 69extern const char *const ircomm_state[];
70extern char *ircomm_tty_state[]; 70extern const char *const ircomm_tty_state[];
71 71
72int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event, 72int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
73 struct sk_buff *skb, struct ircomm_tty_info *info); 73 struct sk_buff *skb, struct ircomm_tty_info *info);
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h
index 2ae2e119ef4b..4c90824c50fb 100644
--- a/include/net/irda/irlap_event.h
+++ b/include/net/irda/irlap_event.h
@@ -120,7 +120,7 @@ typedef enum { /* FIXME check the two first reason codes */
120 LAP_PRIMARY_CONFLICT, 120 LAP_PRIMARY_CONFLICT,
121} LAP_REASON; 121} LAP_REASON;
122 122
123extern const char *irlap_state[]; 123extern const char *const irlap_state[];
124 124
125void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, 125void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event,
126 struct sk_buff *skb, struct irlap_info *info); 126 struct sk_buff *skb, struct irlap_info *info);
diff --git a/include/net/irda/irlmp_event.h b/include/net/irda/irlmp_event.h
index e03ae4ae3963..9e4ec17a7449 100644
--- a/include/net/irda/irlmp_event.h
+++ b/include/net/irda/irlmp_event.h
@@ -79,8 +79,8 @@ typedef enum {
79 LM_LAP_IDLE_TIMEOUT, 79 LM_LAP_IDLE_TIMEOUT,
80} IRLMP_EVENT; 80} IRLMP_EVENT;
81 81
82extern const char *irlmp_state[]; 82extern const char *const irlmp_state[];
83extern const char *irlsap_state[]; 83extern const char *const irlsap_state[];
84 84
85void irlmp_watchdog_timer_expired(void *data); 85void irlmp_watchdog_timer_expired(void *data);
86void irlmp_discovery_timer_expired(void *data); 86void irlmp_discovery_timer_expired(void *data);
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index 51b9a37de991..e9054a283fde 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -416,13 +416,13 @@ struct iw_spy_data
416 * data (i.e. valid as long as struct net_device exist, same locking rules). 416 * data (i.e. valid as long as struct net_device exist, same locking rules).
417 */ 417 */
418/* Forward declaration */ 418/* Forward declaration */
419struct ieee80211_device; 419struct libipw_device;
420/* The struct */ 420/* The struct */
421struct iw_public_data { 421struct iw_public_data {
422 /* Driver enhanced spy support */ 422 /* Driver enhanced spy support */
423 struct iw_spy_data * spy_data; 423 struct iw_spy_data * spy_data;
424 /* Structure managed by the in-kernel IEEE 802.11 layer */ 424 /* Legacy structure managed by the ipw2x00-specific IEEE 802.11 layer */
425 struct ieee80211_device * ieee80211; 425 struct libipw_device * libipw;
426}; 426};
427 427
428/**************************** PROTOTYPES ****************************/ 428/**************************** PROTOTYPES ****************************/
@@ -443,7 +443,7 @@ extern int dev_get_wireless_info(char * buffer, char **start, off_t offset,
443extern void wireless_send_event(struct net_device * dev, 443extern void wireless_send_event(struct net_device * dev,
444 unsigned int cmd, 444 unsigned int cmd,
445 union iwreq_data * wrqu, 445 union iwreq_data * wrqu,
446 char * extra); 446 const char * extra);
447 447
448/* We may need a function to send a stream of events to user space. 448/* We may need a function to send a stream of events to user space.
449 * More on that later... */ 449 * More on that later... */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c06104476973..466859b285e1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -73,6 +73,21 @@
73 */ 73 */
74 74
75/** 75/**
76 * DOC: mac80211 workqueue
77 *
78 * mac80211 provides its own workqueue for drivers and internal mac80211 use.
79 * The workqueue is a single threaded workqueue and can only be accessed by
80 * helpers for sanity checking. Drivers must ensure all work added onto the
81 * mac80211 workqueue should be cancelled on the driver stop() callback.
82 *
83 * mac80211 will flushed the workqueue upon interface removal and during
84 * suspend.
85 *
86 * All work performed on the mac80211 workqueue must not acquire the RTNL lock.
87 *
88 */
89
90/**
76 * enum ieee80211_max_queues - maximum number of queues 91 * enum ieee80211_max_queues - maximum number of queues
77 * 92 *
78 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. 93 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues.
@@ -224,7 +239,14 @@ struct ieee80211_bss_conf {
224 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU 239 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU
225 * @IEEE80211_TX_CTL_INJECTED: Frame was injected, internal to mac80211. 240 * @IEEE80211_TX_CTL_INJECTED: Frame was injected, internal to mac80211.
226 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted 241 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted
227 * because the destination STA was in powersave mode. 242 * because the destination STA was in powersave mode. Note that to
243 * avoid race conditions, the filter must be set by the hardware or
244 * firmware upon receiving a frame that indicates that the station
245 * went to sleep (must be done on device to filter frames already on
246 * the queue) and may only be unset after mac80211 gives the OK for
247 * that by setting the IEEE80211_TX_CTL_CLEAR_PS_FILT (see above),
248 * since only then is it guaranteed that no more frames are in the
249 * hardware queue.
228 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged 250 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged
229 * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status 251 * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status
230 * is for the whole aggregation. 252 * is for the whole aggregation.
@@ -241,6 +263,15 @@ struct ieee80211_bss_conf {
241 * it can be sent out. 263 * it can be sent out.
242 * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211, 264 * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211,
243 * used to indicate that a frame was already retried due to PS 265 * used to indicate that a frame was already retried due to PS
266 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
267 * used to indicate frame should not be encrypted
268 * @IEEE80211_TX_CTL_PSPOLL_RESPONSE: (internal?)
269 * This frame is a response to a PS-poll frame and should be sent
270 * although the station is in powersave mode.
271 * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the
272 * transmit function after the current frame, this can be used
273 * by drivers to kick the DMA queue only if unset or when the
274 * queue gets full.
244 */ 275 */
245enum mac80211_tx_control_flags { 276enum mac80211_tx_control_flags {
246 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 277 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
@@ -259,6 +290,9 @@ enum mac80211_tx_control_flags {
259 IEEE80211_TX_INTFL_RCALGO = BIT(13), 290 IEEE80211_TX_INTFL_RCALGO = BIT(13),
260 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 291 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
261 IEEE80211_TX_INTFL_RETRIED = BIT(15), 292 IEEE80211_TX_INTFL_RETRIED = BIT(15),
293 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
294 IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17),
295 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
262}; 296};
263 297
264/** 298/**
@@ -316,6 +350,21 @@ enum mac80211_rate_control_flags {
316 * 350 *
317 * When used for transmit status reporting, the driver should 351 * When used for transmit status reporting, the driver should
318 * always report the rate along with the flags it used. 352 * always report the rate along with the flags it used.
353 *
354 * &struct ieee80211_tx_info contains an array of these structs
355 * in the control information, and it will be filled by the rate
356 * control algorithm according to what should be sent. For example,
357 * if this array contains, in the format { <idx>, <count> } the
358 * information
359 * { 3, 2 }, { 2, 2 }, { 1, 4 }, { -1, 0 }, { -1, 0 }
360 * then this means that the frame should be transmitted
361 * up to twice at rate 3, up to twice at rate 2, and up to four
362 * times at rate 1 if it doesn't get acknowledged. Say it gets
363 * acknowledged by the peer after the fifth attempt, the status
364 * information should then contain
365 * { 3, 2 }, { 2, 2 }, { 1, 1 }, { -1, 0 } ...
366 * since it was transmitted twice at rate 3, twice at rate 2
367 * and once at rate 1 after which we received an acknowledgement.
319 */ 368 */
320struct ieee80211_tx_rate { 369struct ieee80211_tx_rate {
321 s8 idx; 370 s8 idx;
@@ -397,6 +446,11 @@ static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
397 return (struct ieee80211_tx_info *)skb->cb; 446 return (struct ieee80211_tx_info *)skb->cb;
398} 447}
399 448
449static inline struct ieee80211_rx_status *IEEE80211_SKB_RXCB(struct sk_buff *skb)
450{
451 return (struct ieee80211_rx_status *)skb->cb;
452}
453
400/** 454/**
401 * ieee80211_tx_info_clear_status - clear TX status 455 * ieee80211_tx_info_clear_status - clear TX status
402 * 456 *
@@ -478,7 +532,7 @@ enum mac80211_rx_flags {
478 * 532 *
479 * The low-level driver should provide this information (the subset 533 * The low-level driver should provide this information (the subset
480 * supported by hardware) to the 802.11 code with each received 534 * supported by hardware) to the 802.11 code with each received
481 * frame. 535 * frame, in the skb's control buffer (cb).
482 * 536 *
483 * @mactime: value in microseconds of the 64-bit Time Synchronization Function 537 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
484 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. 538 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
@@ -529,7 +583,6 @@ enum ieee80211_conf_flags {
529/** 583/**
530 * enum ieee80211_conf_changed - denotes which configuration changed 584 * enum ieee80211_conf_changed - denotes which configuration changed
531 * 585 *
532 * @_IEEE80211_CONF_CHANGE_RADIO_ENABLED: DEPRECATED
533 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed 586 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
534 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed 587 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
535 * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed 588 * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed
@@ -539,7 +592,6 @@ enum ieee80211_conf_flags {
539 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed 592 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed
540 */ 593 */
541enum ieee80211_conf_changed { 594enum ieee80211_conf_changed {
542 _IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
543 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), 595 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
544 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), 596 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3),
545 IEEE80211_CONF_CHANGE_PS = BIT(4), 597 IEEE80211_CONF_CHANGE_PS = BIT(4),
@@ -549,14 +601,6 @@ enum ieee80211_conf_changed {
549 IEEE80211_CONF_CHANGE_IDLE = BIT(8), 601 IEEE80211_CONF_CHANGE_IDLE = BIT(8),
550}; 602};
551 603
552static inline __deprecated enum ieee80211_conf_changed
553__IEEE80211_CONF_CHANGE_RADIO_ENABLED(void)
554{
555 return _IEEE80211_CONF_CHANGE_RADIO_ENABLED;
556}
557#define IEEE80211_CONF_CHANGE_RADIO_ENABLED \
558 __IEEE80211_CONF_CHANGE_RADIO_ENABLED()
559
560/** 604/**
561 * struct ieee80211_conf - configuration of the device 605 * struct ieee80211_conf - configuration of the device
562 * 606 *
@@ -564,9 +608,6 @@ __IEEE80211_CONF_CHANGE_RADIO_ENABLED(void)
564 * 608 *
565 * @flags: configuration flags defined above 609 * @flags: configuration flags defined above
566 * 610 *
567 * @radio_enabled: when zero, driver is required to switch off the radio.
568 * @beacon_int: DEPRECATED, DO NOT USE
569 *
570 * @listen_interval: listen interval in units of beacon interval 611 * @listen_interval: listen interval in units of beacon interval
571 * @max_sleep_period: the maximum number of beacon intervals to sleep for 612 * @max_sleep_period: the maximum number of beacon intervals to sleep for
572 * before checking the beacon for a TIM bit (managed mode only); this 613 * before checking the beacon for a TIM bit (managed mode only); this
@@ -590,13 +631,11 @@ __IEEE80211_CONF_CHANGE_RADIO_ENABLED(void)
590 * number of transmissions not the number of retries 631 * number of transmissions not the number of retries
591 */ 632 */
592struct ieee80211_conf { 633struct ieee80211_conf {
593 int __deprecated beacon_int;
594 u32 flags; 634 u32 flags;
595 int power_level, dynamic_ps_timeout; 635 int power_level, dynamic_ps_timeout;
596 int max_sleep_period; 636 int max_sleep_period;
597 637
598 u16 listen_interval; 638 u16 listen_interval;
599 bool __deprecated radio_enabled;
600 639
601 u8 long_frame_max_tx_count, short_frame_max_tx_count; 640 u8 long_frame_max_tx_count, short_frame_max_tx_count;
602 641
@@ -901,12 +940,6 @@ enum ieee80211_hw_flags {
901 * 940 *
902 * @conf: &struct ieee80211_conf, device configuration, don't use. 941 * @conf: &struct ieee80211_conf, device configuration, don't use.
903 * 942 *
904 * @workqueue: single threaded workqueue available for driver use,
905 * allocated by mac80211 on registration and flushed when an
906 * interface is removed.
907 * NOTICE: All work performed on this workqueue must not
908 * acquire the RTNL lock.
909 *
910 * @priv: pointer to private area that was allocated for driver use 943 * @priv: pointer to private area that was allocated for driver use
911 * along with this structure. 944 * along with this structure.
912 * 945 *
@@ -942,7 +975,6 @@ enum ieee80211_hw_flags {
942struct ieee80211_hw { 975struct ieee80211_hw {
943 struct ieee80211_conf conf; 976 struct ieee80211_conf conf;
944 struct wiphy *wiphy; 977 struct wiphy *wiphy;
945 struct workqueue_struct *workqueue;
946 const char *rate_control_algorithm; 978 const char *rate_control_algorithm;
947 void *priv; 979 void *priv;
948 u32 flags; 980 u32 flags;
@@ -1172,10 +1204,13 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1172 * the driver's configure_filter() function which frames should be 1204 * the driver's configure_filter() function which frames should be
1173 * passed to mac80211 and which should be filtered out. 1205 * passed to mac80211 and which should be filtered out.
1174 * 1206 *
1175 * The configure_filter() callback is invoked with the parameters 1207 * Before configure_filter() is invoked, the prepare_multicast()
1176 * @mc_count and @mc_list for the combined multicast address list 1208 * callback is invoked with the parameters @mc_count and @mc_list
1177 * of all virtual interfaces, @changed_flags telling which flags 1209 * for the combined multicast address list of all virtual interfaces.
1178 * were changed and @total_flags with the new flag states. 1210 * It's use is optional, and it returns a u64 that is passed to
1211 * configure_filter(). Additionally, configure_filter() has the
1212 * arguments @changed_flags telling which flags were changed and
1213 * @total_flags with the new flag states.
1179 * 1214 *
1180 * If your device has no multicast address filters your driver will 1215 * If your device has no multicast address filters your driver will
1181 * need to check both the %FIF_ALLMULTI flag and the @mc_count 1216 * need to check both the %FIF_ALLMULTI flag and the @mc_count
@@ -1224,10 +1259,13 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1224 * mac80211 needs to do and the amount of CPU wakeups, so you should 1259 * mac80211 needs to do and the amount of CPU wakeups, so you should
1225 * honour this flag if possible. 1260 * honour this flag if possible.
1226 * 1261 *
1227 * @FIF_CONTROL: pass control frames, if PROMISC_IN_BSS is not set then 1262 * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS
1228 * only those addressed to this station 1263 * is not set then only those addressed to this station.
1229 * 1264 *
1230 * @FIF_OTHER_BSS: pass frames destined to other BSSes 1265 * @FIF_OTHER_BSS: pass frames destined to other BSSes
1266 *
1267 * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only
1268 * those addressed to this station.
1231 */ 1269 */
1232enum ieee80211_filter_flags { 1270enum ieee80211_filter_flags {
1233 FIF_PROMISC_IN_BSS = 1<<0, 1271 FIF_PROMISC_IN_BSS = 1<<0,
@@ -1237,6 +1275,7 @@ enum ieee80211_filter_flags {
1237 FIF_BCN_PRBRESP_PROMISC = 1<<4, 1275 FIF_BCN_PRBRESP_PROMISC = 1<<4,
1238 FIF_CONTROL = 1<<5, 1276 FIF_CONTROL = 1<<5,
1239 FIF_OTHER_BSS = 1<<6, 1277 FIF_OTHER_BSS = 1<<6,
1278 FIF_PSPOLL = 1<<7,
1240}; 1279};
1241 1280
1242/** 1281/**
@@ -1289,7 +1328,8 @@ enum ieee80211_ampdu_mlme_action {
1289 * is disabled. This should turn off the hardware (at least 1328 * is disabled. This should turn off the hardware (at least
1290 * it must turn off frame reception.) 1329 * it must turn off frame reception.)
1291 * May be called right after add_interface if that rejects 1330 * May be called right after add_interface if that rejects
1292 * an interface. 1331 * an interface. If you added any work onto the mac80211 workqueue
1332 * you should ensure to cancel it on this callback.
1293 * Must be implemented. 1333 * Must be implemented.
1294 * 1334 *
1295 * @add_interface: Called when a netdevice attached to the hardware is 1335 * @add_interface: Called when a netdevice attached to the hardware is
@@ -1323,9 +1363,13 @@ enum ieee80211_ampdu_mlme_action {
1323 * for association indication. The @changed parameter indicates which 1363 * for association indication. The @changed parameter indicates which
1324 * of the bss parameters has changed when a call is made. 1364 * of the bss parameters has changed when a call is made.
1325 * 1365 *
1366 * @prepare_multicast: Prepare for multicast filter configuration.
1367 * This callback is optional, and its return value is passed
1368 * to configure_filter(). This callback must be atomic.
1369 *
1326 * @configure_filter: Configure the device's RX filter. 1370 * @configure_filter: Configure the device's RX filter.
1327 * See the section "Frame filtering" for more information. 1371 * See the section "Frame filtering" for more information.
1328 * This callback must be implemented and atomic. 1372 * This callback must be implemented.
1329 * 1373 *
1330 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 1374 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
1331 * must be set or cleared for a given STA. Must be atomic. 1375 * must be set or cleared for a given STA. Must be atomic.
@@ -1411,6 +1455,8 @@ enum ieee80211_ampdu_mlme_action {
1411 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also 1455 * @rfkill_poll: Poll rfkill hardware state. If you need this, you also
1412 * need to set wiphy->rfkill_poll to %true before registration, 1456 * need to set wiphy->rfkill_poll to %true before registration,
1413 * and need to call wiphy_rfkill_set_hw_state() in the callback. 1457 * and need to call wiphy_rfkill_set_hw_state() in the callback.
1458 *
1459 * @testmode_cmd: Implement a cfg80211 test mode command.
1414 */ 1460 */
1415struct ieee80211_ops { 1461struct ieee80211_ops {
1416 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1462 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1425,10 +1471,12 @@ struct ieee80211_ops {
1425 struct ieee80211_vif *vif, 1471 struct ieee80211_vif *vif,
1426 struct ieee80211_bss_conf *info, 1472 struct ieee80211_bss_conf *info,
1427 u32 changed); 1473 u32 changed);
1474 u64 (*prepare_multicast)(struct ieee80211_hw *hw,
1475 int mc_count, struct dev_addr_list *mc_list);
1428 void (*configure_filter)(struct ieee80211_hw *hw, 1476 void (*configure_filter)(struct ieee80211_hw *hw,
1429 unsigned int changed_flags, 1477 unsigned int changed_flags,
1430 unsigned int *total_flags, 1478 unsigned int *total_flags,
1431 int mc_count, struct dev_addr_list *mc_list); 1479 u64 multicast);
1432 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 1480 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
1433 bool set); 1481 bool set);
1434 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 1482 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
@@ -1461,6 +1509,9 @@ struct ieee80211_ops {
1461 struct ieee80211_sta *sta, u16 tid, u16 *ssn); 1509 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
1462 1510
1463 void (*rfkill_poll)(struct ieee80211_hw *hw); 1511 void (*rfkill_poll)(struct ieee80211_hw *hw);
1512#ifdef CONFIG_NL80211_TESTMODE
1513 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
1514#endif
1464}; 1515};
1465 1516
1466/** 1517/**
@@ -1606,10 +1657,6 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
1606 */ 1657 */
1607void ieee80211_restart_hw(struct ieee80211_hw *hw); 1658void ieee80211_restart_hw(struct ieee80211_hw *hw);
1608 1659
1609/* trick to avoid symbol clashes with the ieee80211 subsystem */
1610void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1611 struct ieee80211_rx_status *status);
1612
1613/** 1660/**
1614 * ieee80211_rx - receive frame 1661 * ieee80211_rx - receive frame
1615 * 1662 *
@@ -1624,14 +1671,8 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1624 * 1671 *
1625 * @hw: the hardware this frame came in on 1672 * @hw: the hardware this frame came in on
1626 * @skb: the buffer to receive, owned by mac80211 after this call 1673 * @skb: the buffer to receive, owned by mac80211 after this call
1627 * @status: status of this frame; the status pointer need not be valid
1628 * after this function returns
1629 */ 1674 */
1630static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, 1675void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb);
1631 struct ieee80211_rx_status *status)
1632{
1633 __ieee80211_rx(hw, skb, status);
1634}
1635 1676
1636/** 1677/**
1637 * ieee80211_rx_irqsafe - receive frame 1678 * ieee80211_rx_irqsafe - receive frame
@@ -1644,13 +1685,8 @@ static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1644 * 1685 *
1645 * @hw: the hardware this frame came in on 1686 * @hw: the hardware this frame came in on
1646 * @skb: the buffer to receive, owned by mac80211 after this call 1687 * @skb: the buffer to receive, owned by mac80211 after this call
1647 * @status: status of this frame; the status pointer need not be valid
1648 * after this function returns and is not freed by mac80211,
1649 * it is recommended that it points to a stack area
1650 */ 1688 */
1651void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, 1689void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb);
1652 struct sk_buff *skb,
1653 struct ieee80211_rx_status *status);
1654 1690
1655/** 1691/**
1656 * ieee80211_tx_status - transmit status callback 1692 * ieee80211_tx_status - transmit status callback
@@ -1917,6 +1953,31 @@ void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw,
1917 void *data); 1953 void *data);
1918 1954
1919/** 1955/**
1956 * ieee80211_queue_work - add work onto the mac80211 workqueue
1957 *
1958 * Drivers and mac80211 use this to add work onto the mac80211 workqueue.
1959 * This helper ensures drivers are not queueing work when they should not be.
1960 *
1961 * @hw: the hardware struct for the interface we are adding work for
1962 * @work: the work we want to add onto the mac80211 workqueue
1963 */
1964void ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *work);
1965
1966/**
1967 * ieee80211_queue_delayed_work - add work onto the mac80211 workqueue
1968 *
1969 * Drivers and mac80211 use this to queue delayed work onto the mac80211
1970 * workqueue.
1971 *
1972 * @hw: the hardware struct for the interface we are adding work for
1973 * @dwork: delayable work to queue onto the mac80211 workqueue
1974 * @delay: number of jiffies to wait before queueing
1975 */
1976void ieee80211_queue_delayed_work(struct ieee80211_hw *hw,
1977 struct delayed_work *dwork,
1978 unsigned long delay);
1979
1980/**
1920 * ieee80211_start_tx_ba_session - Start a tx Block Ack session. 1981 * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
1921 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1982 * @hw: pointer as obtained from ieee80211_alloc_hw().
1922 * @ra: receiver address of the BA session recipient 1983 * @ra: receiver address of the BA session recipient
@@ -2090,6 +2151,29 @@ static inline int rate_supported(struct ieee80211_sta *sta,
2090 return (sta == NULL || sta->supp_rates[band] & BIT(index)); 2151 return (sta == NULL || sta->supp_rates[band] & BIT(index));
2091} 2152}
2092 2153
2154/**
2155 * rate_control_send_low - helper for drivers for management/no-ack frames
2156 *
2157 * Rate control algorithms that agree to use the lowest rate to
2158 * send management frames and NO_ACK data with the respective hw
2159 * retries should use this in the beginning of their mac80211 get_rate
2160 * callback. If true is returned the rate control can simply return.
2161 * If false is returned we guarantee that sta and sta and priv_sta is
2162 * not null.
2163 *
2164 * Rate control algorithms wishing to do more intelligent selection of
2165 * rate for multicast/broadcast frames may choose to not use this.
2166 *
2167 * @sta: &struct ieee80211_sta pointer to the target destination. Note
2168 * that this may be null.
2169 * @priv_sta: private rate control structure. This may be null.
2170 * @txrc: rate control information we sholud populate for mac80211.
2171 */
2172bool rate_control_send_low(struct ieee80211_sta *sta,
2173 void *priv_sta,
2174 struct ieee80211_tx_rate_control *txrc);
2175
2176
2093static inline s8 2177static inline s8
2094rate_lowest_index(struct ieee80211_supported_band *sband, 2178rate_lowest_index(struct ieee80211_supported_band *sband,
2095 struct ieee80211_sta *sta) 2179 struct ieee80211_sta *sta)
@@ -2106,6 +2190,17 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
2106 return 0; 2190 return 0;
2107} 2191}
2108 2192
2193static inline
2194bool rate_usable_index_exists(struct ieee80211_supported_band *sband,
2195 struct ieee80211_sta *sta)
2196{
2197 unsigned int i;
2198
2199 for (i = 0; i < sband->n_bitrates; i++)
2200 if (rate_supported(sta, sband->band, i))
2201 return true;
2202 return false;
2203}
2109 2204
2110int ieee80211_rate_control_register(struct rate_control_ops *ops); 2205int ieee80211_rate_control_register(struct rate_control_ops *ops);
2111void ieee80211_rate_control_unregister(struct rate_control_ops *ops); 2206void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index d8d790e56d3d..3817fda82a80 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -24,6 +24,7 @@
24 24
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/sysctl.h> 26#include <linux/sysctl.h>
27#include <linux/workqueue.h>
27#include <net/rtnetlink.h> 28#include <net/rtnetlink.h>
28 29
29/* 30/*
@@ -117,7 +118,7 @@ struct neighbour
117 int (*output)(struct sk_buff *skb); 118 int (*output)(struct sk_buff *skb);
118 struct sk_buff_head arp_queue; 119 struct sk_buff_head arp_queue;
119 struct timer_list timer; 120 struct timer_list timer;
120 struct neigh_ops *ops; 121 const struct neigh_ops *ops;
121 u8 primary_key[0]; 122 u8 primary_key[0];
122}; 123};
123 124
@@ -167,7 +168,7 @@ struct neigh_table
167 int gc_thresh2; 168 int gc_thresh2;
168 int gc_thresh3; 169 int gc_thresh3;
169 unsigned long last_flush; 170 unsigned long last_flush;
170 struct timer_list gc_timer; 171 struct delayed_work gc_work;
171 struct timer_list proxy_timer; 172 struct timer_list proxy_timer;
172 struct sk_buff_head proxy_queue; 173 struct sk_buff_head proxy_queue;
173 atomic_t entries; 174 atomic_t entries;
@@ -178,7 +179,6 @@ struct neigh_table
178 struct neighbour **hash_buckets; 179 struct neighbour **hash_buckets;
179 unsigned int hash_mask; 180 unsigned int hash_mask;
180 __u32 hash_rnd; 181 __u32 hash_rnd;
181 unsigned int hash_chain_gc;
182 struct pneigh_entry **phash_buckets; 182 struct pneigh_entry **phash_buckets;
183}; 183};
184 184
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index ded434b032a4..a1202841aadd 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -26,6 +26,7 @@ struct net_device;
26struct sock; 26struct sock;
27struct ctl_table_header; 27struct ctl_table_header;
28struct net_generic; 28struct net_generic;
29struct sock;
29 30
30struct net { 31struct net {
31 atomic_t count; /* To decided when the network 32 atomic_t count; /* To decided when the network
@@ -57,6 +58,7 @@ struct net {
57 spinlock_t rules_mod_lock; 58 spinlock_t rules_mod_lock;
58 59
59 struct sock *rtnl; /* rtnetlink socket */ 60 struct sock *rtnl; /* rtnetlink socket */
61 struct sock *genl_sock;
60 62
61 struct netns_core core; 63 struct netns_core core;
62 struct netns_mib mib; 64 struct netns_mib mib;
@@ -78,6 +80,9 @@ struct net {
78#ifdef CONFIG_XFRM 80#ifdef CONFIG_XFRM
79 struct netns_xfrm xfrm; 81 struct netns_xfrm xfrm;
80#endif 82#endif
83#ifdef CONFIG_WIRELESS_EXT
84 struct sk_buff_head wext_nlevents;
85#endif
81 struct net_generic *gen; 86 struct net_generic *gen;
82}; 87};
83 88
@@ -106,6 +111,8 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)
106 111
107extern struct list_head net_namespace_list; 112extern struct list_head net_namespace_list;
108 113
114extern struct net *get_net_ns_by_pid(pid_t pid);
115
109#ifdef CONFIG_NET_NS 116#ifdef CONFIG_NET_NS
110extern void __put_net(struct net *net); 117extern void __put_net(struct net *net);
111 118
@@ -208,6 +215,9 @@ static inline struct net *read_pnet(struct net * const *pnet)
208#define for_each_net(VAR) \ 215#define for_each_net(VAR) \
209 list_for_each_entry(VAR, &net_namespace_list, list) 216 list_for_each_entry(VAR, &net_namespace_list, list)
210 217
218#define for_each_net_rcu(VAR) \
219 list_for_each_entry_rcu(VAR, &net_namespace_list, list)
220
211#ifdef CONFIG_NET_NS 221#ifdef CONFIG_NET_NS
212#define __net_init 222#define __net_init
213#define __net_exit 223#define __net_exit
@@ -229,13 +239,15 @@ struct pernet_operations {
229 * needs per network namespace operations use device pernet operations, 239 * needs per network namespace operations use device pernet operations,
230 * otherwise use pernet subsys operations. 240 * otherwise use pernet subsys operations.
231 * 241 *
232 * This is critically important. Most of the network code cleanup 242 * Network interfaces need to be removed from a dying netns _before_
233 * runs with the assumption that dev_remove_pack has been called so no 243 * subsys notifiers can be called, as most of the network code cleanup
234 * new packets will arrive during and after the cleanup functions have 244 * (which is done from subsys notifiers) runs with the assumption that
235 * been called. dev_remove_pack is not per namespace so instead the 245 * dev_remove_pack has been called so no new packets will arrive during
236 * guarantee of no more packets arriving in a network namespace is 246 * and after the cleanup functions have been called. dev_remove_pack
237 * provided by ensuring that all network devices and all sockets have 247 * is not per namespace so instead the guarantee of no more packets
238 * left the network namespace before the cleanup methods are called. 248 * arriving in a network namespace is provided by ensuring that all
249 * network devices and all sockets have left the network namespace
250 * before the cleanup methods are called.
239 * 251 *
240 * For the longest time the ipv4 icmp code was registered as a pernet 252 * For the longest time the ipv4 icmp code was registered as a pernet
241 * device which caused kernel oops, and panics during network 253 * device which caused kernel oops, and panics during network
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h
index 58684066388c..33602ab66190 100644
--- a/include/net/netfilter/nf_nat_core.h
+++ b/include/net/netfilter/nf_nat_core.h
@@ -31,6 +31,6 @@ struct nlattr;
31extern int 31extern int
32(*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct, 32(*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct,
33 enum nf_nat_manip_type manip, 33 enum nf_nat_manip_type manip,
34 struct nlattr *attr); 34 const struct nlattr *attr);
35 35
36#endif /* _NF_NAT_CORE_H */ 36#endif /* _NF_NAT_CORE_H */
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 007bdb07dabb..a63b2192ac1c 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -365,7 +365,7 @@ static inline struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining)
365 * 365 *
366 * See nla_parse() 366 * See nla_parse()
367 */ 367 */
368static inline int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen, 368static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
369 struct nlattr *tb[], int maxtype, 369 struct nlattr *tb[], int maxtype,
370 const struct nla_policy *policy) 370 const struct nla_policy *policy)
371{ 371{
@@ -414,7 +414,7 @@ static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype,
414 * 414 *
415 * Returns 1 if a report back to the application is requested. 415 * Returns 1 if a report back to the application is requested.
416 */ 416 */
417static inline int nlmsg_report(struct nlmsghdr *nlh) 417static inline int nlmsg_report(const struct nlmsghdr *nlh)
418{ 418{
419 return !!(nlh->nlmsg_flags & NLM_F_ECHO); 419 return !!(nlh->nlmsg_flags & NLM_F_ECHO);
420} 420}
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index afab4e4cbac7..dfeb2d7c425b 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -6,6 +6,7 @@
6 6
7#ifndef __NETNS_IPV6_H__ 7#ifndef __NETNS_IPV6_H__
8#define __NETNS_IPV6_H__ 8#define __NETNS_IPV6_H__
9#include <net/dst_ops.h>
9 10
10struct ctl_table_header; 11struct ctl_table_header;
11 12
@@ -42,7 +43,7 @@ struct netns_ipv6 {
42 struct timer_list ip6_fib_timer; 43 struct timer_list ip6_fib_timer;
43 struct hlist_head *fib_table_hash; 44 struct hlist_head *fib_table_hash;
44 struct fib6_table *fib6_main_tbl; 45 struct fib6_table *fib6_main_tbl;
45 struct dst_ops *ip6_dst_ops; 46 struct dst_ops ip6_dst_ops;
46 unsigned int ip6_rt_gc_expire; 47 unsigned int ip6_rt_gc_expire;
47 unsigned long ip6_rt_last_gc; 48 unsigned long ip6_rt_last_gc;
48#ifdef CONFIG_IPV6_MULTIPLE_TABLES 49#ifdef CONFIG_IPV6_MULTIPLE_TABLES
diff --git a/include/net/netns/x_tables.h b/include/net/netns/x_tables.h
index 9554a644a8f8..591db7d657a3 100644
--- a/include/net/netns/x_tables.h
+++ b/include/net/netns/x_tables.h
@@ -8,8 +8,11 @@ struct ebt_table;
8 8
9struct netns_xt { 9struct netns_xt {
10 struct list_head tables[NFPROTO_NUMPROTO]; 10 struct list_head tables[NFPROTO_NUMPROTO];
11#if defined(CONFIG_BRIDGE_NF_EBTABLES) || \
12 defined(CONFIG_BRIDGE_NF_EBTABLES_MODULE)
11 struct ebt_table *broute_table; 13 struct ebt_table *broute_table;
12 struct ebt_table *frame_filter; 14 struct ebt_table *frame_filter;
13 struct ebt_table *frame_nat; 15 struct ebt_table *frame_nat;
16#endif
14}; 17};
15#endif 18#endif
diff --git a/include/net/nl802154.h b/include/net/nl802154.h
new file mode 100644
index 000000000000..99d2ba1c7e03
--- /dev/null
+++ b/include/net/nl802154.h
@@ -0,0 +1,126 @@
1/*
2 * nl802154.h
3 *
4 * Copyright (C) 2007, 2008, 2009 Siemens AG
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 */
20
21#ifndef IEEE802154_NL_H
22#define IEEE802154_NL_H
23
24struct net_device;
25struct ieee802154_addr;
26
27/**
28 * ieee802154_nl_assoc_indic - Notify userland of an association request.
29 * @dev: The network device on which this association request was
30 * received.
31 * @addr: The address of the device requesting association.
32 * @cap: The capability information field from the device.
33 *
34 * This informs a userland coordinator of a device requesting to
35 * associate with the PAN controlled by the coordinator.
36 *
37 * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document.
38 */
39int ieee802154_nl_assoc_indic(struct net_device *dev,
40 struct ieee802154_addr *addr, u8 cap);
41
42/**
43 * ieee802154_nl_assoc_confirm - Notify userland of association.
44 * @dev: The device which has completed association.
45 * @short_addr: The short address assigned to the device.
46 * @status: The status of the association.
47 *
48 * Inform userland of the result of an association request. If the
49 * association request included asking the coordinator to allocate
50 * a short address then it is returned in @short_addr.
51 *
52 * Note: This is in section 7.3.2 of the IEEE 802.15.4 document.
53 */
54int ieee802154_nl_assoc_confirm(struct net_device *dev,
55 u16 short_addr, u8 status);
56
57/**
58 * ieee802154_nl_disassoc_indic - Notify userland of disassociation.
59 * @dev: The device on which disassociation was indicated.
60 * @addr: The device which is disassociating.
61 * @reason: The reason for the disassociation.
62 *
63 * Inform userland that a device has disassociated from the network.
64 *
65 * Note: This is in section 7.3.3 of the IEEE 802.15.4 document.
66 */
67int ieee802154_nl_disassoc_indic(struct net_device *dev,
68 struct ieee802154_addr *addr, u8 reason);
69
70/**
71 * ieee802154_nl_disassoc_confirm - Notify userland of disassociation
72 * completion.
73 * @dev: The device on which disassociation was ordered.
74 * @status: The result of the disassociation.
75 *
76 * Inform userland of the result of requesting that a device
77 * disassociate, or the result of requesting that we disassociate from
78 * a PAN managed by another coordinator.
79 *
80 * Note: This is in section 7.1.4.3 of the IEEE 802.15.4 document.
81 */
82int ieee802154_nl_disassoc_confirm(struct net_device *dev,
83 u8 status);
84
85/**
86 * ieee802154_nl_scan_confirm - Notify userland of completion of scan.
87 * @dev: The device which was instructed to scan.
88 * @status: The status of the scan operation.
89 * @scan_type: What type of scan was performed.
90 * @unscanned: Any channels that the device was unable to scan.
91 * @edl: The energy levels (if a passive scan).
92 *
93 *
94 * Note: This is in section 7.1.11 of the IEEE 802.15.4 document.
95 * Note: This API does not permit the return of an active scan result.
96 */
97int ieee802154_nl_scan_confirm(struct net_device *dev,
98 u8 status, u8 scan_type, u32 unscanned, u8 page,
99 u8 *edl/*, struct list_head *pan_desc_list */);
100
101/**
102 * ieee802154_nl_beacon_indic - Notify userland of a received beacon.
103 * @dev: The device on which a beacon was received.
104 * @panid: The PAN of the coordinator.
105 * @coord_addr: The short address of the coordinator on that PAN.
106 *
107 * Note: This is in section 7.1.5 of the IEEE 802.15.4 document.
108 * Note: This API does not provide extended information such as what
109 * channel the PAN is on or what the LQI of the beacon frame was on
110 * receipt.
111 * Note: This API cannot indicate a beacon frame for a coordinator
112 * operating in long addressing mode.
113 */
114int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid,
115 u16 coord_addr);
116
117/**
118 * ieee802154_nl_start_confirm - Notify userland of completion of start.
119 * @dev: The device which was instructed to scan.
120 * @status: The status of the scan operation.
121 *
122 * Note: This is in section 7.1.14 of the IEEE 802.15.4 document.
123 */
124int ieee802154_nl_start_confirm(struct net_device *dev, u8 status);
125
126#endif
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h
index 29d126736611..44c923c9e21d 100644
--- a/include/net/phonet/pn_dev.h
+++ b/include/net/phonet/pn_dev.h
@@ -49,4 +49,6 @@ void phonet_address_notify(int event, struct net_device *dev, u8 addr);
49 49
50#define PN_NO_ADDR 0xff 50#define PN_NO_ADDR 0xff
51 51
52extern const struct file_operations pn_sock_seq_fops;
53
52#endif 54#endif
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 82a3191375f5..f911ec7598ef 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -87,6 +87,9 @@ extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
87extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 87extern void qdisc_put_rtab(struct qdisc_rate_table *tab);
88extern void qdisc_put_stab(struct qdisc_size_table *tab); 88extern void qdisc_put_stab(struct qdisc_size_table *tab);
89extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); 89extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc);
90extern int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
91 struct net_device *dev, struct netdev_queue *txq,
92 spinlock_t *root_lock);
90 93
91extern void __qdisc_run(struct Qdisc *q); 94extern void __qdisc_run(struct Qdisc *q);
92 95
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 1089d5aabd49..60249e51b669 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -94,21 +94,20 @@ struct inet_protosw {
94#define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */ 94#define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */
95#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ 95#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */
96 96
97extern struct net_protocol *inet_protocol_base; 97extern const struct net_protocol *inet_protos[MAX_INET_PROTOS];
98extern struct net_protocol *inet_protos[MAX_INET_PROTOS];
99 98
100#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 99#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
101extern struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; 100extern const struct inet6_protocol *inet6_protos[MAX_INET_PROTOS];
102#endif 101#endif
103 102
104extern int inet_add_protocol(struct net_protocol *prot, unsigned char num); 103extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num);
105extern int inet_del_protocol(struct net_protocol *prot, unsigned char num); 104extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num);
106extern void inet_register_protosw(struct inet_protosw *p); 105extern void inet_register_protosw(struct inet_protosw *p);
107extern void inet_unregister_protosw(struct inet_protosw *p); 106extern void inet_unregister_protosw(struct inet_protosw *p);
108 107
109#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 108#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
110extern int inet6_add_protocol(struct inet6_protocol *prot, unsigned char num); 109extern int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num);
111extern int inet6_del_protocol(struct inet6_protocol *prot, unsigned char num); 110extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num);
112extern int inet6_register_protosw(struct inet_protosw *p); 111extern int inet6_register_protosw(struct inet_protosw *p);
113extern void inet6_unregister_protosw(struct inet_protosw *p); 112extern void inet6_unregister_protosw(struct inet_protosw *p);
114#endif 113#endif
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 3c1895e54b7f..c3aa044d3fc3 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -14,7 +14,7 @@ extern void rtnl_register(int protocol, int msgtype,
14extern int rtnl_unregister(int protocol, int msgtype); 14extern int rtnl_unregister(int protocol, int msgtype);
15extern void rtnl_unregister_all(int protocol); 15extern void rtnl_unregister_all(int protocol);
16 16
17static inline int rtnl_msg_family(struct nlmsghdr *nlh) 17static inline int rtnl_msg_family(const struct nlmsghdr *nlh)
18{ 18{
19 if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg)) 19 if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg))
20 return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family; 20 return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family;
@@ -70,6 +70,9 @@ struct rtnl_link_ops {
70 size_t (*get_xstats_size)(const struct net_device *dev); 70 size_t (*get_xstats_size)(const struct net_device *dev);
71 int (*fill_xstats)(struct sk_buff *skb, 71 int (*fill_xstats)(struct sk_buff *skb,
72 const struct net_device *dev); 72 const struct net_device *dev);
73 int (*get_tx_queues)(struct net *net, struct nlattr *tb[],
74 unsigned int *tx_queues,
75 unsigned int *real_tx_queues);
73}; 76};
74 77
75extern int __rtnl_link_register(struct rtnl_link_ops *ops); 78extern int __rtnl_link_register(struct rtnl_link_ops *ops);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 5482e9582f55..c33180dd42b4 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -45,6 +45,8 @@ struct Qdisc
45#define TCQ_F_BUILTIN 1 45#define TCQ_F_BUILTIN 1
46#define TCQ_F_THROTTLED 2 46#define TCQ_F_THROTTLED 2
47#define TCQ_F_INGRESS 4 47#define TCQ_F_INGRESS 4
48#define TCQ_F_CAN_BYPASS 8
49#define TCQ_F_MQROOT 16
48#define TCQ_F_WARN_NONWC (1 << 16) 50#define TCQ_F_WARN_NONWC (1 << 16)
49 int padded; 51 int padded;
50 struct Qdisc_ops *ops; 52 struct Qdisc_ops *ops;
@@ -79,6 +81,7 @@ struct Qdisc
79struct Qdisc_class_ops 81struct Qdisc_class_ops
80{ 82{
81 /* Child qdisc manipulation */ 83 /* Child qdisc manipulation */
84 struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *);
82 int (*graft)(struct Qdisc *, unsigned long cl, 85 int (*graft)(struct Qdisc *, unsigned long cl,
83 struct Qdisc *, struct Qdisc **); 86 struct Qdisc *, struct Qdisc **);
84 struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl); 87 struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl);
@@ -121,6 +124,7 @@ struct Qdisc_ops
121 void (*reset)(struct Qdisc *); 124 void (*reset)(struct Qdisc *);
122 void (*destroy)(struct Qdisc *); 125 void (*destroy)(struct Qdisc *);
123 int (*change)(struct Qdisc *, struct nlattr *arg); 126 int (*change)(struct Qdisc *, struct nlattr *arg);
127 void (*attach)(struct Qdisc *);
124 128
125 int (*dump)(struct Qdisc *, struct sk_buff *); 129 int (*dump)(struct Qdisc *, struct sk_buff *);
126 int (*dump_stats)(struct Qdisc *, struct gnet_dump *); 130 int (*dump_stats)(struct Qdisc *, struct gnet_dump *);
@@ -182,6 +186,11 @@ struct qdisc_skb_cb {
182 char data[]; 186 char data[];
183}; 187};
184 188
189static inline int qdisc_qlen(struct Qdisc *q)
190{
191 return q->q.qlen;
192}
193
185static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb) 194static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb)
186{ 195{
187 return (struct qdisc_skb_cb *)skb->cb; 196 return (struct qdisc_skb_cb *)skb->cb;
@@ -249,6 +258,8 @@ static inline void sch_tree_unlock(struct Qdisc *q)
249 258
250extern struct Qdisc noop_qdisc; 259extern struct Qdisc noop_qdisc;
251extern struct Qdisc_ops noop_qdisc_ops; 260extern struct Qdisc_ops noop_qdisc_ops;
261extern struct Qdisc_ops pfifo_fast_ops;
262extern struct Qdisc_ops mq_qdisc_ops;
252 263
253struct Qdisc_class_common 264struct Qdisc_class_common
254{ 265{
@@ -296,6 +307,8 @@ extern void dev_init_scheduler(struct net_device *dev);
296extern void dev_shutdown(struct net_device *dev); 307extern void dev_shutdown(struct net_device *dev);
297extern void dev_activate(struct net_device *dev); 308extern void dev_activate(struct net_device *dev);
298extern void dev_deactivate(struct net_device *dev); 309extern void dev_deactivate(struct net_device *dev);
310extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
311 struct Qdisc *qdisc);
299extern void qdisc_reset(struct Qdisc *qdisc); 312extern void qdisc_reset(struct Qdisc *qdisc);
300extern void qdisc_destroy(struct Qdisc *qdisc); 313extern void qdisc_destroy(struct Qdisc *qdisc);
301extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 314extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
@@ -387,13 +400,18 @@ static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch)
387 return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; 400 return qdisc_enqueue(skb, sch) & NET_XMIT_MASK;
388} 401}
389 402
403static inline void __qdisc_update_bstats(struct Qdisc *sch, unsigned int len)
404{
405 sch->bstats.bytes += len;
406 sch->bstats.packets++;
407}
408
390static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, 409static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
391 struct sk_buff_head *list) 410 struct sk_buff_head *list)
392{ 411{
393 __skb_queue_tail(list, skb); 412 __skb_queue_tail(list, skb);
394 sch->qstats.backlog += qdisc_pkt_len(skb); 413 sch->qstats.backlog += qdisc_pkt_len(skb);
395 sch->bstats.bytes += qdisc_pkt_len(skb); 414 __qdisc_update_bstats(sch, qdisc_pkt_len(skb));
396 sch->bstats.packets++;
397 415
398 return NET_XMIT_SUCCESS; 416 return NET_XMIT_SUCCESS;
399} 417}
diff --git a/include/net/scm.h b/include/net/scm.h
index f45bb6eca7d4..cf48c800e926 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -26,7 +26,6 @@ struct scm_cookie
26#ifdef CONFIG_SECURITY_NETWORK 26#ifdef CONFIG_SECURITY_NETWORK
27 u32 secid; /* Passed security ID */ 27 u32 secid; /* Passed security ID */
28#endif 28#endif
29 unsigned long seq; /* Connection seqno */
30}; 29};
31 30
32extern void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm); 31extern void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm);
@@ -59,7 +58,6 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
59 scm->creds.gid = current_gid(); 58 scm->creds.gid = current_gid();
60 scm->creds.pid = task_tgid_vnr(p); 59 scm->creds.pid = task_tgid_vnr(p);
61 scm->fp = NULL; 60 scm->fp = NULL;
62 scm->seq = 0;
63 unix_get_peersec_dgram(sock, scm); 61 unix_get_peersec_dgram(sock, scm);
64 if (msg->msg_controllen <= 0) 62 if (msg->msg_controllen <= 0)
65 return 0; 63 return 0;
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 3b966802e05d..8be5135ff7aa 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -106,6 +106,7 @@ typedef enum {
106 SCTP_CMD_ASSOC_SHKEY, /* generate the association shared keys */ 106 SCTP_CMD_ASSOC_SHKEY, /* generate the association shared keys */
107 SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ 107 SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */
108 SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ 108 SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */
109 SCTP_CMD_SEND_MSG, /* Send the whole use message */
109 SCTP_CMD_LAST 110 SCTP_CMD_LAST
110} sctp_verb_t; 111} sctp_verb_t;
111 112
@@ -139,6 +140,7 @@ typedef union {
139 struct sctp_ulpevent *ulpevent; 140 struct sctp_ulpevent *ulpevent;
140 struct sctp_packet *packet; 141 struct sctp_packet *packet;
141 sctp_sackhdr_t *sackh; 142 sctp_sackhdr_t *sackh;
143 struct sctp_datamsg *msg;
142} sctp_arg_t; 144} sctp_arg_t;
143 145
144/* We are simulating ML type constructors here. 146/* We are simulating ML type constructors here.
@@ -188,6 +190,7 @@ SCTP_ARG_CONSTRUCTOR(PEER_INIT, sctp_init_chunk_t *, init)
188SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent) 190SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent)
189SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) 191SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet)
190SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) 192SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh)
193SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg)
191 194
192typedef struct { 195typedef struct {
193 sctp_arg_t obj; 196 sctp_arg_t obj;
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index b05b0557211f..58f714a3b670 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -231,7 +231,7 @@ typedef enum {
231 SCTP_SS_LISTENING = TCP_LISTEN, 231 SCTP_SS_LISTENING = TCP_LISTEN,
232 SCTP_SS_ESTABLISHING = TCP_SYN_SENT, 232 SCTP_SS_ESTABLISHING = TCP_SYN_SENT,
233 SCTP_SS_ESTABLISHED = TCP_ESTABLISHED, 233 SCTP_SS_ESTABLISHED = TCP_ESTABLISHED,
234 SCTP_SS_DISCONNECTING = TCP_CLOSING, 234 SCTP_SS_CLOSING = TCP_CLOSING,
235} sctp_sock_state_t; 235} sctp_sock_state_t;
236 236
237/* These functions map various type to printable names. */ 237/* These functions map various type to printable names. */
@@ -241,7 +241,9 @@ const char *sctp_tname(const sctp_subtype_t); /* timeouts */
241const char *sctp_pname(const sctp_subtype_t); /* primitives */ 241const char *sctp_pname(const sctp_subtype_t); /* primitives */
242 242
243/* This is a table of printable names of sctp_state_t's. */ 243/* This is a table of printable names of sctp_state_t's. */
244extern const char *sctp_state_tbl[], *sctp_evttype_tbl[], *sctp_status_tbl[]; 244extern const char *const sctp_state_tbl[];
245extern const char *const sctp_evttype_tbl[];
246extern const char *const sctp_status_tbl[];
245 247
246/* Maximum chunk length considering padding requirements. */ 248/* Maximum chunk length considering padding requirements. */
247enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) }; 249enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) };
@@ -361,6 +363,13 @@ typedef enum {
361 SCTP_SCOPE_UNUSABLE, /* IPv4 unusable addresses */ 363 SCTP_SCOPE_UNUSABLE, /* IPv4 unusable addresses */
362} sctp_scope_t; 364} sctp_scope_t;
363 365
366typedef enum {
367 SCTP_SCOPE_POLICY_DISABLE, /* Disable IPv4 address scoping */
368 SCTP_SCOPE_POLICY_ENABLE, /* Enable IPv4 address scoping */
369 SCTP_SCOPE_POLICY_PRIVATE, /* Follow draft but allow IPv4 private addresses */
370 SCTP_SCOPE_POLICY_LINK, /* Follow draft but allow IPv4 link local addresses */
371} sctp_scope_policy_t;
372
364/* Based on IPv4 scoping <draft-stewart-tsvwg-sctp-ipv4-00.txt>, 373/* Based on IPv4 scoping <draft-stewart-tsvwg-sctp-ipv4-00.txt>,
365 * SCTP IPv4 unusable addresses: 0.0.0.0/8, 224.0.0.0/4, 198.18.0.0/24, 374 * SCTP IPv4 unusable addresses: 0.0.0.0/8, 224.0.0.0/4, 198.18.0.0/24,
366 * 192.88.99.0/24. 375 * 192.88.99.0/24.
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index d16a304cbed4..8a6d5297de16 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -486,15 +486,16 @@ static inline __s32 sctp_jitter(__u32 rto)
486} 486}
487 487
488/* Break down data chunks at this point. */ 488/* Break down data chunks at this point. */
489static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu) 489static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu)
490{ 490{
491 struct sctp_sock *sp = sctp_sk(asoc->base.sk);
491 int frag = pmtu; 492 int frag = pmtu;
492 493
493 frag -= sp->pf->af->net_header_len; 494 frag -= sp->pf->af->net_header_len;
494 frag -= sizeof(struct sctphdr) + sizeof(struct sctp_data_chunk); 495 frag -= sizeof(struct sctphdr) + sizeof(struct sctp_data_chunk);
495 496
496 if (sp->user_frag) 497 if (asoc->user_frag)
497 frag = min_t(int, frag, sp->user_frag); 498 frag = min_t(int, frag, asoc->user_frag);
498 499
499 frag = min_t(int, frag, SCTP_MAX_CHUNK_LEN); 500 frag = min_t(int, frag, SCTP_MAX_CHUNK_LEN);
500 501
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index edfcacf3250e..42d00ced5eb8 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -219,6 +219,15 @@ extern struct sctp_globals {
219 /* Flag to idicate if SCTP-AUTH is enabled */ 219 /* Flag to idicate if SCTP-AUTH is enabled */
220 int auth_enable; 220 int auth_enable;
221 221
222 /*
223 * Policy to control SCTP IPv4 address scoping
224 * 0 - Disable IPv4 address scoping
225 * 1 - Enable IPv4 address scoping
226 * 2 - Selectively allow only IPv4 private addresses
227 * 3 - Selectively allow only IPv4 link local address
228 */
229 int ipv4_scope_policy;
230
222 /* Flag to indicate whether computing and verifying checksum 231 /* Flag to indicate whether computing and verifying checksum
223 * is disabled. */ 232 * is disabled. */
224 int checksum_disable; 233 int checksum_disable;
@@ -252,6 +261,7 @@ extern struct sctp_globals {
252#define sctp_port_hashtable (sctp_globals.port_hashtable) 261#define sctp_port_hashtable (sctp_globals.port_hashtable)
253#define sctp_local_addr_list (sctp_globals.local_addr_list) 262#define sctp_local_addr_list (sctp_globals.local_addr_list)
254#define sctp_local_addr_lock (sctp_globals.addr_list_lock) 263#define sctp_local_addr_lock (sctp_globals.addr_list_lock)
264#define sctp_scope_policy (sctp_globals.ipv4_scope_policy)
255#define sctp_addip_enable (sctp_globals.addip_enable) 265#define sctp_addip_enable (sctp_globals.addip_enable)
256#define sctp_addip_noauth (sctp_globals.addip_noauth_enable) 266#define sctp_addip_noauth (sctp_globals.addip_noauth_enable)
257#define sctp_prsctp_enable (sctp_globals.prsctp_enable) 267#define sctp_prsctp_enable (sctp_globals.prsctp_enable)
@@ -628,7 +638,7 @@ struct sctp_datamsg {
628 /* Chunks waiting to be submitted to lower layer. */ 638 /* Chunks waiting to be submitted to lower layer. */
629 struct list_head chunks; 639 struct list_head chunks;
630 /* Chunks that have been transmitted. */ 640 /* Chunks that have been transmitted. */
631 struct list_head track; 641 size_t msg_size;
632 /* Reference counting. */ 642 /* Reference counting. */
633 atomic_t refcnt; 643 atomic_t refcnt;
634 /* When is this message no longer interesting to the peer? */ 644 /* When is this message no longer interesting to the peer? */
@@ -643,6 +653,7 @@ struct sctp_datamsg {
643struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, 653struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *,
644 struct sctp_sndrcvinfo *, 654 struct sctp_sndrcvinfo *,
645 struct msghdr *, int len); 655 struct msghdr *, int len);
656void sctp_datamsg_free(struct sctp_datamsg *);
646void sctp_datamsg_put(struct sctp_datamsg *); 657void sctp_datamsg_put(struct sctp_datamsg *);
647void sctp_chunk_fail(struct sctp_chunk *, int error); 658void sctp_chunk_fail(struct sctp_chunk *, int error);
648int sctp_chunk_abandoned(struct sctp_chunk *); 659int sctp_chunk_abandoned(struct sctp_chunk *);
@@ -811,22 +822,12 @@ struct sctp_packet {
811 /* pointer to the auth chunk for this packet */ 822 /* pointer to the auth chunk for this packet */
812 struct sctp_chunk *auth; 823 struct sctp_chunk *auth;
813 824
814 /* This packet contains a COOKIE-ECHO chunk. */ 825 u8 has_cookie_echo:1, /* This packet contains a COOKIE-ECHO chunk. */
815 __u8 has_cookie_echo; 826 has_sack:1, /* This packet contains a SACK chunk. */
816 827 has_auth:1, /* This packet contains an AUTH chunk */
817 /* This packet contains a SACK chunk. */ 828 has_data:1, /* This packet contains at least 1 DATA chunk */
818 __u8 has_sack; 829 ipfragok:1, /* So let ip fragment this packet */
819 830 malloced:1; /* Is it malloced? */
820 /* This packet contains an AUTH chunk */
821 __u8 has_auth;
822
823 /* This packet contains at least 1 DATA chunk */
824 __u8 has_data;
825
826 /* SCTP cannot fragment this packet. So let ip fragment it. */
827 __u8 ipfragok;
828
829 __u8 malloced;
830}; 831};
831 832
832struct sctp_packet *sctp_packet_init(struct sctp_packet *, 833struct sctp_packet *sctp_packet_init(struct sctp_packet *,
@@ -1567,13 +1568,13 @@ struct sctp_association {
1567 __u32 sack_cnt; 1568 __u32 sack_cnt;
1568 1569
1569 /* These are capabilities which our peer advertised. */ 1570 /* These are capabilities which our peer advertised. */
1570 __u8 ecn_capable; /* Can peer do ECN? */ 1571 __u8 ecn_capable:1, /* Can peer do ECN? */
1571 __u8 ipv4_address; /* Peer understands IPv4 addresses? */ 1572 ipv4_address:1, /* Peer understands IPv4 addresses? */
1572 __u8 ipv6_address; /* Peer understands IPv6 addresses? */ 1573 ipv6_address:1, /* Peer understands IPv6 addresses? */
1573 __u8 hostname_address;/* Peer understands DNS addresses? */ 1574 hostname_address:1, /* Peer understands DNS addresses? */
1574 __u8 asconf_capable; /* Does peer support ADDIP? */ 1575 asconf_capable:1, /* Does peer support ADDIP? */
1575 __u8 prsctp_capable; /* Can peer do PR-SCTP? */ 1576 prsctp_capable:1, /* Can peer do PR-SCTP? */
1576 __u8 auth_capable; /* Is peer doing SCTP-AUTH? */ 1577 auth_capable:1; /* Is peer doing SCTP-AUTH? */
1577 1578
1578 __u32 adaptation_ind; /* Adaptation Code point. */ 1579 __u32 adaptation_ind; /* Adaptation Code point. */
1579 1580
@@ -1738,6 +1739,12 @@ struct sctp_association {
1738 */ 1739 */
1739 __u32 rwnd_over; 1740 __u32 rwnd_over;
1740 1741
1742 /* Keeps treack of rwnd pressure. This happens when we have
1743 * a window, but not recevie buffer (i.e small packets). This one
1744 * is releases slowly (1 PMTU at a time ).
1745 */
1746 __u32 rwnd_press;
1747
1741 /* This is the sndbuf size in use for the association. 1748 /* This is the sndbuf size in use for the association.
1742 * This corresponds to the sndbuf size for the association, 1749 * This corresponds to the sndbuf size for the association,
1743 * as specified in the sk->sndbuf. 1750 * as specified in the sk->sndbuf.
@@ -1756,6 +1763,7 @@ struct sctp_association {
1756 1763
1757 /* The message size at which SCTP fragmentation will occur. */ 1764 /* The message size at which SCTP fragmentation will occur. */
1758 __u32 frag_point; 1765 __u32 frag_point;
1766 __u32 user_frag;
1759 1767
1760 /* Counter used to count INIT errors. */ 1768 /* Counter used to count INIT errors. */
1761 int init_err_counter; 1769 int init_err_counter;
@@ -1905,11 +1913,8 @@ struct sctp_association {
1905 1913
1906 __u16 active_key_id; 1914 __u16 active_key_id;
1907 1915
1908 /* Need to send an ECNE Chunk? */ 1916 __u8 need_ecne:1, /* Need to send an ECNE Chunk? */
1909 char need_ecne; 1917 temp:1; /* Is it a temporary association? */
1910
1911 /* Is it a temporary association? */
1912 char temp;
1913}; 1918};
1914 1919
1915 1920
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 1580c04f68bc..be2334aaf52e 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -210,12 +210,6 @@ enum sctp_sinfo_flags {
210}; 210};
211 211
212 212
213typedef union {
214 __u8 raw;
215 struct sctp_initmsg init;
216 struct sctp_sndrcvinfo sndrcv;
217} sctp_cmsg_data_t;
218
219/* These are cmsg_types. */ 213/* These are cmsg_types. */
220typedef enum sctp_cmsg_type { 214typedef enum sctp_cmsg_type {
221 SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */ 215 SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 88af84306471..56b76027b85e 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -469,6 +469,7 @@ extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
469 int nonagle); 469 int nonagle);
470extern int tcp_may_send_now(struct sock *sk); 470extern int tcp_may_send_now(struct sock *sk);
471extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); 471extern int tcp_retransmit_skb(struct sock *, struct sk_buff *);
472extern void tcp_retransmit_timer(struct sock *sk);
472extern void tcp_xmit_retransmit_queue(struct sock *); 473extern void tcp_xmit_retransmit_queue(struct sock *);
473extern void tcp_simple_retransmit(struct sock *); 474extern void tcp_simple_retransmit(struct sock *);
474extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); 475extern int tcp_trim_head(struct sock *, struct sk_buff *, u32);
@@ -521,6 +522,17 @@ extern int tcp_mtu_to_mss(struct sock *sk, int pmtu);
521extern int tcp_mss_to_mtu(struct sock *sk, int mss); 522extern int tcp_mss_to_mtu(struct sock *sk, int mss);
522extern void tcp_mtup_init(struct sock *sk); 523extern void tcp_mtup_init(struct sock *sk);
523 524
525static inline void tcp_bound_rto(const struct sock *sk)
526{
527 if (inet_csk(sk)->icsk_rto > TCP_RTO_MAX)
528 inet_csk(sk)->icsk_rto = TCP_RTO_MAX;
529}
530
531static inline u32 __tcp_set_rto(const struct tcp_sock *tp)
532{
533 return (tp->srtt >> 3) + tp->rttvar;
534}
535
524static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) 536static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
525{ 537{
526 tp->pred_flags = htonl((tp->tcp_header_len << 26) | 538 tp->pred_flags = htonl((tp->tcp_header_len << 26) |
@@ -781,6 +793,13 @@ static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp)
781 return tp->packets_out - tcp_left_out(tp) + tp->retrans_out; 793 return tp->packets_out - tcp_left_out(tp) + tp->retrans_out;
782} 794}
783 795
796#define TCP_INFINITE_SSTHRESH 0x7fffffff
797
798static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp)
799{
800 return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH;
801}
802
784/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd. 803/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd.
785 * The exception is rate halving phase, when cwnd is decreasing towards 804 * The exception is rate halving phase, when cwnd is decreasing towards
786 * ssthresh. 805 * ssthresh.
@@ -1007,6 +1026,11 @@ static inline int keepalive_time_when(const struct tcp_sock *tp)
1007 return tp->keepalive_time ? : sysctl_tcp_keepalive_time; 1026 return tp->keepalive_time ? : sysctl_tcp_keepalive_time;
1008} 1027}
1009 1028
1029static inline int keepalive_probes(const struct tcp_sock *tp)
1030{
1031 return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes;
1032}
1033
1010static inline int tcp_fin_time(const struct sock *sk) 1034static inline int tcp_fin_time(const struct sock *sk)
1011{ 1035{
1012 int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; 1036 int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout;
@@ -1169,7 +1193,7 @@ extern int tcp_v4_md5_do_del(struct sock *sk,
1169#define tcp_twsk_md5_key(twsk) NULL 1193#define tcp_twsk_md5_key(twsk) NULL
1170#endif 1194#endif
1171 1195
1172extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); 1196extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(struct sock *);
1173extern void tcp_free_md5sig_pool(void); 1197extern void tcp_free_md5sig_pool(void);
1174 1198
1175extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); 1199extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu);
@@ -1235,6 +1259,29 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu
1235#define tcp_for_write_queue_from_safe(skb, tmp, sk) \ 1259#define tcp_for_write_queue_from_safe(skb, tmp, sk) \
1236 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) 1260 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp)
1237 1261
1262/* This function calculates a "timeout" which is equivalent to the timeout of a
1263 * TCP connection after "boundary" unsucessful, exponentially backed-off
1264 * retransmissions with an initial RTO of TCP_RTO_MIN.
1265 */
1266static inline bool retransmits_timed_out(const struct sock *sk,
1267 unsigned int boundary)
1268{
1269 unsigned int timeout, linear_backoff_thresh;
1270
1271 if (!inet_csk(sk)->icsk_retransmits)
1272 return false;
1273
1274 linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN);
1275
1276 if (boundary <= linear_backoff_thresh)
1277 timeout = ((2 << boundary) - 1) * TCP_RTO_MIN;
1278 else
1279 timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN +
1280 (boundary - linear_backoff_thresh) * TCP_RTO_MAX;
1281
1282 return (tcp_time_stamp - tcp_sk(sk)->retrans_stamp) >= timeout;
1283}
1284
1238static inline struct sk_buff *tcp_send_head(struct sock *sk) 1285static inline struct sk_buff *tcp_send_head(struct sock *sk)
1239{ 1286{
1240 return sk->sk_send_head; 1287 return sk->sk_send_head;
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index bfb240c6cf79..d65381cad0fc 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -51,7 +51,7 @@ extern int datagram_send_ctl(struct net *net,
51/* 51/*
52 * address family specific functions 52 * address family specific functions
53 */ 53 */
54extern struct inet_connection_sock_af_ops ipv4_specific; 54extern const struct inet_connection_sock_af_ops ipv4_specific;
55 55
56extern void inet6_destroy_sock(struct sock *sk); 56extern void inet6_destroy_sock(struct sock *sk);
57 57
diff --git a/include/net/udp.h b/include/net/udp.h
index 90e6ce56be65..5fb029f817a3 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -207,4 +207,7 @@ extern void udp4_proc_exit(void);
207#endif 207#endif
208 208
209extern void udp_init(void); 209extern void udp_init(void);
210
211extern int udp4_ufo_send_check(struct sk_buff *skb);
212extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, int features);
210#endif /* _UDP_H */ 213#endif /* _UDP_H */
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h
new file mode 100644
index 000000000000..547b1e271ac9
--- /dev/null
+++ b/include/net/wpan-phy.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (C) 2007, 2008, 2009 Siemens AG
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 *
17 * Written by:
18 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
19 */
20
21#ifndef WPAN_PHY_H
22#define WPAN_PHY_H
23
24#include <linux/netdevice.h>
25#include <linux/mutex.h>
26
27struct wpan_phy {
28 struct mutex pib_lock;
29
30 /*
31 * This is a PIB acording to 802.15.4-2006.
32 * We do not provide timing-related variables, as they
33 * aren't used outside of driver
34 */
35 u8 current_channel;
36 u8 current_page;
37 u32 channels_supported;
38 u8 transmit_power;
39 u8 cca_mode;
40
41 struct device dev;
42 int idx;
43
44 char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
45};
46
47struct wpan_phy *wpan_phy_alloc(size_t priv_size);
48int wpan_phy_register(struct device *parent, struct wpan_phy *phy);
49void wpan_phy_unregister(struct wpan_phy *phy);
50void wpan_phy_free(struct wpan_phy *phy);
51
52static inline void *wpan_phy_priv(struct wpan_phy *phy)
53{
54 BUG_ON(!phy);
55 return &phy->priv;
56}
57
58struct wpan_phy *wpan_phy_find(const char *str);
59static inline const char *wpan_phy_name(struct wpan_phy *phy)
60{
61 return dev_name(&phy->dev);
62}
63#endif
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 9e3a3f4c1f60..223e90a44824 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1280,7 +1280,7 @@ struct xfrm6_tunnel {
1280}; 1280};
1281 1281
1282extern void xfrm_init(void); 1282extern void xfrm_init(void);
1283extern void xfrm4_init(void); 1283extern void xfrm4_init(int rt_hash_size);
1284extern int xfrm_state_init(struct net *net); 1284extern int xfrm_state_init(struct net *net);
1285extern void xfrm_state_fini(struct net *net); 1285extern void xfrm_state_fini(struct net *net);
1286extern void xfrm4_state_init(void); 1286extern void xfrm4_state_init(void);
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 9b4ac9385f5d..9a3b49865173 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -90,14 +90,14 @@ typedef struct pccard_io_map {
90 u_char map; 90 u_char map;
91 u_char flags; 91 u_char flags;
92 u_short speed; 92 u_short speed;
93 u_int start, stop; 93 phys_addr_t start, stop;
94} pccard_io_map; 94} pccard_io_map;
95 95
96typedef struct pccard_mem_map { 96typedef struct pccard_mem_map {
97 u_char map; 97 u_char map;
98 u_char flags; 98 u_char flags;
99 u_short speed; 99 u_short speed;
100 u_long static_start; 100 phys_addr_t static_start;
101 u_int card_start; 101 u_int card_start;
102 struct resource *res; 102 struct resource *res;
103} pccard_mem_map; 103} pccard_mem_map;
diff --git a/include/scsi/fc/fc_gs.h b/include/scsi/fc/fc_gs.h
index ffab0272c65a..324dd0e3c622 100644
--- a/include/scsi/fc/fc_gs.h
+++ b/include/scsi/fc/fc_gs.h
@@ -87,6 +87,7 @@ enum fc_ct_explan {
87 FC_FS_EXP_PNAM = 0x02, /* port name not registered */ 87 FC_FS_EXP_PNAM = 0x02, /* port name not registered */
88 FC_FS_EXP_NNAM = 0x03, /* node name not registered */ 88 FC_FS_EXP_NNAM = 0x03, /* node name not registered */
89 FC_FS_EXP_COS = 0x04, /* class of service not registered */ 89 FC_FS_EXP_COS = 0x04, /* class of service not registered */
90 FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */
90 /* definitions not complete */ 91 /* definitions not complete */
91}; 92};
92 93
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h
index a0ff61c3e935..27dad703824f 100644
--- a/include/scsi/fc_encode.h
+++ b/include/scsi/fc_encode.h
@@ -32,6 +32,7 @@ struct fc_ct_req {
32 struct fc_ns_gid_ft gid; 32 struct fc_ns_gid_ft gid;
33 struct fc_ns_rn_id rn; 33 struct fc_ns_rn_id rn;
34 struct fc_ns_rft rft; 34 struct fc_ns_rft rft;
35 struct fc_ns_fid fid;
35 } payload; 36 } payload;
36}; 37};
37 38
@@ -57,6 +58,23 @@ static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl,
57} 58}
58 59
59/** 60/**
61 * fc_adisc_fill() - Fill in adisc request frame
62 * @lport: local port.
63 * @fp: fc frame where payload will be placed.
64 */
65static inline void fc_adisc_fill(struct fc_lport *lport, struct fc_frame *fp)
66{
67 struct fc_els_adisc *adisc;
68
69 adisc = fc_frame_payload_get(fp, sizeof(*adisc));
70 memset(adisc, 0, sizeof(*adisc));
71 adisc->adisc_cmd = ELS_ADISC;
72 put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn);
73 put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn);
74 hton24(adisc->adisc_port_id, fc_host_port_id(lport->host));
75}
76
77/**
60 * fc_ct_hdr_fill- fills ct header and reset ct payload 78 * fc_ct_hdr_fill- fills ct header and reset ct payload
61 * returns pointer to ct request. 79 * returns pointer to ct request.
62 */ 80 */
@@ -77,10 +95,17 @@ static inline struct fc_ct_req *fc_ct_hdr_fill(const struct fc_frame *fp,
77} 95}
78 96
79/** 97/**
80 * fc_ct_fill - Fill in a name service request frame 98 * fc_ct_fill() - Fill in a name service request frame
99 * @lport: local port.
100 * @fc_id: FC_ID of non-destination rport for GPN_ID and similar inquiries.
101 * @fp: frame to contain payload.
102 * @op: CT opcode.
103 * @r_ctl: pointer to FC header R_CTL.
104 * @fh_type: pointer to FC-4 type.
81 */ 105 */
82static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, 106static inline int fc_ct_fill(struct fc_lport *lport,
83 unsigned int op, enum fc_rctl *r_ctl, u32 *did, 107 u32 fc_id, struct fc_frame *fp,
108 unsigned int op, enum fc_rctl *r_ctl,
84 enum fc_fh_type *fh_type) 109 enum fc_fh_type *fh_type)
85{ 110{
86 struct fc_ct_req *ct; 111 struct fc_ct_req *ct;
@@ -91,6 +116,11 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp,
91 ct->payload.gid.fn_fc4_type = FC_TYPE_FCP; 116 ct->payload.gid.fn_fc4_type = FC_TYPE_FCP;
92 break; 117 break;
93 118
119 case FC_NS_GPN_ID:
120 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_fid));
121 hton24(ct->payload.fid.fp_fid, fc_id);
122 break;
123
94 case FC_NS_RFT_ID: 124 case FC_NS_RFT_ID:
95 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); 125 ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft));
96 hton24(ct->payload.rft.fid.fp_fid, 126 hton24(ct->payload.rft.fid.fp_fid,
@@ -110,7 +140,6 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp,
110 return -EINVAL; 140 return -EINVAL;
111 } 141 }
112 *r_ctl = FC_RCTL_DD_UNSOL_CTL; 142 *r_ctl = FC_RCTL_DD_UNSOL_CTL;
113 *did = FC_FID_DIR_SERV;
114 *fh_type = FC_TYPE_CT; 143 *fh_type = FC_TYPE_CT;
115 return 0; 144 return 0;
116} 145}
@@ -249,51 +278,42 @@ static inline void fc_scr_fill(struct fc_lport *lport, struct fc_frame *fp)
249/** 278/**
250 * fc_els_fill - Fill in an ELS request frame 279 * fc_els_fill - Fill in an ELS request frame
251 */ 280 */
252static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport, 281static inline int fc_els_fill(struct fc_lport *lport,
282 u32 did,
253 struct fc_frame *fp, unsigned int op, 283 struct fc_frame *fp, unsigned int op,
254 enum fc_rctl *r_ctl, u32 *did, enum fc_fh_type *fh_type) 284 enum fc_rctl *r_ctl, enum fc_fh_type *fh_type)
255{ 285{
256 switch (op) { 286 switch (op) {
287 case ELS_ADISC:
288 fc_adisc_fill(lport, fp);
289 break;
290
257 case ELS_PLOGI: 291 case ELS_PLOGI:
258 fc_plogi_fill(lport, fp, ELS_PLOGI); 292 fc_plogi_fill(lport, fp, ELS_PLOGI);
259 *did = rport->port_id;
260 break; 293 break;
261 294
262 case ELS_FLOGI: 295 case ELS_FLOGI:
263 fc_flogi_fill(lport, fp); 296 fc_flogi_fill(lport, fp);
264 *did = FC_FID_FLOGI;
265 break; 297 break;
266 298
267 case ELS_LOGO: 299 case ELS_LOGO:
268 fc_logo_fill(lport, fp); 300 fc_logo_fill(lport, fp);
269 *did = FC_FID_FLOGI;
270 /*
271 * if rport is valid then it
272 * is port logo, therefore
273 * set did to rport id.
274 */
275 if (rport)
276 *did = rport->port_id;
277 break; 301 break;
278 302
279 case ELS_RTV: 303 case ELS_RTV:
280 fc_rtv_fill(lport, fp); 304 fc_rtv_fill(lport, fp);
281 *did = rport->port_id;
282 break; 305 break;
283 306
284 case ELS_REC: 307 case ELS_REC:
285 fc_rec_fill(lport, fp); 308 fc_rec_fill(lport, fp);
286 *did = rport->port_id;
287 break; 309 break;
288 310
289 case ELS_PRLI: 311 case ELS_PRLI:
290 fc_prli_fill(lport, fp); 312 fc_prli_fill(lport, fp);
291 *did = rport->port_id;
292 break; 313 break;
293 314
294 case ELS_SCR: 315 case ELS_SCR:
295 fc_scr_fill(lport, fp); 316 fc_scr_fill(lport, fp);
296 *did = FC_FID_FCTRL;
297 break; 317 break;
298 318
299 default: 319 default:
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h
index 59511057cee0..c35d2383cc26 100644
--- a/include/scsi/fc_frame.h
+++ b/include/scsi/fc_frame.h
@@ -37,13 +37,6 @@
37#define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ 37#define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */
38#define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ 38#define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */
39 39
40/*
41 * Information about an individual fibre channel frame received or to be sent.
42 * The buffer may be in up to 4 additional non-contiguous sections,
43 * but the linear section must hold the frame header.
44 */
45#define FC_FRAME_SG_LEN 4 /* scatter/gather list maximum length */
46
47#define fp_skb(fp) (&((fp)->skb)) 40#define fp_skb(fp) (&((fp)->skb))
48#define fr_hdr(fp) ((fp)->skb.data) 41#define fr_hdr(fp) ((fp)->skb.data)
49#define fr_len(fp) ((fp)->skb.len) 42#define fr_len(fp) ((fp)->skb.len)
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 4426f00da5ff..d67dda2b6aa0 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -262,6 +262,7 @@ enum iscsi_err {
262 ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, 262 ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17,
263 ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, 263 ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18,
264 ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, 264 ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19,
265 ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20,
265}; 266};
266 267
267/* 268/*
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index b92584a8843a..65dc9aacbf70 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -51,55 +51,49 @@ do { \
51 do { \ 51 do { \
52 CMD; \ 52 CMD; \
53 } while (0); \ 53 } while (0); \
54} while (0); 54} while (0)
55 55
56#define FC_LIBFC_DBG(fmt, args...) \ 56#define FC_LIBFC_DBG(fmt, args...) \
57 FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \ 57 FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \
58 printk(KERN_INFO "libfc: " fmt, ##args);) 58 printk(KERN_INFO "libfc: " fmt, ##args))
59 59
60#define FC_LPORT_DBG(lport, fmt, args...) \ 60#define FC_LPORT_DBG(lport, fmt, args...) \
61 FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ 61 FC_CHECK_LOGGING(FC_LPORT_LOGGING, \
62 printk(KERN_INFO "lport: %6x: " fmt, \ 62 printk(KERN_INFO "host%u: lport %6x: " fmt, \
63 fc_host_port_id(lport->host), ##args);) 63 (lport)->host->host_no, \
64 fc_host_port_id((lport)->host), ##args))
64 65
65#define FC_DISC_DBG(disc, fmt, args...) \ 66#define FC_DISC_DBG(disc, fmt, args...) \
66 FC_CHECK_LOGGING(FC_DISC_LOGGING, \ 67 FC_CHECK_LOGGING(FC_DISC_LOGGING, \
67 printk(KERN_INFO "disc: %6x: " fmt, \ 68 printk(KERN_INFO "host%u: disc: " fmt, \
68 fc_host_port_id(disc->lport->host), \ 69 (disc)->lport->host->host_no, \
69 ##args);) 70 ##args))
70 71
71#define FC_RPORT_DBG(rport, fmt, args...) \ 72#define FC_RPORT_ID_DBG(lport, port_id, fmt, args...) \
72do { \
73 struct fc_rport_libfc_priv *rdata = rport->dd_data; \
74 struct fc_lport *lport = rdata->local_port; \
75 FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ 73 FC_CHECK_LOGGING(FC_RPORT_LOGGING, \
76 printk(KERN_INFO "rport: %6x: %6x: " fmt, \ 74 printk(KERN_INFO "host%u: rport %6x: " fmt, \
77 fc_host_port_id(lport->host), \ 75 (lport)->host->host_no, \
78 rport->port_id, ##args);) \ 76 (port_id), ##args))
79} while (0); 77
78#define FC_RPORT_DBG(rdata, fmt, args...) \
79 FC_RPORT_ID_DBG((rdata)->local_port, (rdata)->ids.port_id, fmt, ##args)
80 80
81#define FC_FCP_DBG(pkt, fmt, args...) \ 81#define FC_FCP_DBG(pkt, fmt, args...) \
82 FC_CHECK_LOGGING(FC_FCP_LOGGING, \ 82 FC_CHECK_LOGGING(FC_FCP_LOGGING, \
83 printk(KERN_INFO "fcp: %6x: %6x: " fmt, \ 83 printk(KERN_INFO "host%u: fcp: %6x: " fmt, \
84 fc_host_port_id(pkt->lp->host), \ 84 (pkt)->lp->host->host_no, \
85 pkt->rport->port_id, ##args);) 85 pkt->rport->port_id, ##args))
86
87#define FC_EM_DBG(em, fmt, args...) \
88 FC_CHECK_LOGGING(FC_EM_LOGGING, \
89 printk(KERN_INFO "em: %6x: " fmt, \
90 fc_host_port_id(em->lp->host), \
91 ##args);)
92 86
93#define FC_EXCH_DBG(exch, fmt, args...) \ 87#define FC_EXCH_DBG(exch, fmt, args...) \
94 FC_CHECK_LOGGING(FC_EXCH_LOGGING, \ 88 FC_CHECK_LOGGING(FC_EXCH_LOGGING, \
95 printk(KERN_INFO "exch: %6x: %4x: " fmt, \ 89 printk(KERN_INFO "host%u: xid %4x: " fmt, \
96 fc_host_port_id(exch->lp->host), \ 90 (exch)->lp->host->host_no, \
97 exch->xid, ##args);) 91 exch->xid, ##args))
98 92
99#define FC_SCSI_DBG(lport, fmt, args...) \ 93#define FC_SCSI_DBG(lport, fmt, args...) \
100 FC_CHECK_LOGGING(FC_SCSI_LOGGING, \ 94 FC_CHECK_LOGGING(FC_SCSI_LOGGING, \
101 printk(KERN_INFO "scsi: %6x: " fmt, \ 95 printk(KERN_INFO "host%u: scsi: " fmt, \
102 fc_host_port_id(lport->host), ##args);) 96 (lport)->host->host_no, ##args))
103 97
104/* 98/*
105 * libfc error codes 99 * libfc error codes
@@ -125,7 +119,7 @@ do { \
125 * FC HBA status 119 * FC HBA status
126 */ 120 */
127enum fc_lport_state { 121enum fc_lport_state {
128 LPORT_ST_NONE = 0, 122 LPORT_ST_DISABLED = 0,
129 LPORT_ST_FLOGI, 123 LPORT_ST_FLOGI,
130 LPORT_ST_DNS, 124 LPORT_ST_DNS,
131 LPORT_ST_RPN_ID, 125 LPORT_ST_RPN_ID,
@@ -143,53 +137,74 @@ enum fc_disc_event {
143}; 137};
144 138
145enum fc_rport_state { 139enum fc_rport_state {
146 RPORT_ST_NONE = 0,
147 RPORT_ST_INIT, /* initialized */ 140 RPORT_ST_INIT, /* initialized */
148 RPORT_ST_PLOGI, /* waiting for PLOGI completion */ 141 RPORT_ST_PLOGI, /* waiting for PLOGI completion */
149 RPORT_ST_PRLI, /* waiting for PRLI completion */ 142 RPORT_ST_PRLI, /* waiting for PRLI completion */
150 RPORT_ST_RTV, /* waiting for RTV completion */ 143 RPORT_ST_RTV, /* waiting for RTV completion */
151 RPORT_ST_READY, /* ready for use */ 144 RPORT_ST_READY, /* ready for use */
152 RPORT_ST_LOGO, /* port logout sent */ 145 RPORT_ST_LOGO, /* port logout sent */
153}; 146 RPORT_ST_ADISC, /* Discover Address sent */
154 147 RPORT_ST_DELETE, /* port being deleted */
155enum fc_rport_trans_state {
156 FC_PORTSTATE_ROGUE,
157 FC_PORTSTATE_REAL,
158}; 148};
159 149
160/** 150/**
161 * struct fc_disc_port - temporary discovery port to hold rport identifiers 151 * struct fc_disc_port - temporary discovery port to hold rport identifiers
162 * @lp: Fibre Channel host port instance 152 * @lp: Fibre Channel host port instance
163 * @peers: node for list management during discovery and RSCN processing 153 * @peers: Node for list management during discovery and RSCN processing
164 * @ids: identifiers structure to pass to fc_remote_port_add() 154 * @rport_work: Work struct for starting the rport state machine
165 * @rport_work: work struct for starting the rport state machine 155 * @port_id: Port ID of the discovered port
166 */ 156 */
167struct fc_disc_port { 157struct fc_disc_port {
168 struct fc_lport *lp; 158 struct fc_lport *lp;
169 struct list_head peers; 159 struct list_head peers;
170 struct fc_rport_identifiers ids;
171 struct work_struct rport_work; 160 struct work_struct rport_work;
161 u32 port_id;
172}; 162};
173 163
174enum fc_rport_event { 164enum fc_rport_event {
175 RPORT_EV_NONE = 0, 165 RPORT_EV_NONE = 0,
176 RPORT_EV_CREATED, 166 RPORT_EV_READY,
177 RPORT_EV_FAILED, 167 RPORT_EV_FAILED,
178 RPORT_EV_STOP, 168 RPORT_EV_STOP,
179 RPORT_EV_LOGO 169 RPORT_EV_LOGO
180}; 170};
181 171
172struct fc_rport_priv;
173
182struct fc_rport_operations { 174struct fc_rport_operations {
183 void (*event_callback)(struct fc_lport *, struct fc_rport *, 175 void (*event_callback)(struct fc_lport *, struct fc_rport_priv *,
184 enum fc_rport_event); 176 enum fc_rport_event);
185}; 177};
186 178
187/** 179/**
188 * struct fc_rport_libfc_priv - libfc internal information about a remote port 180 * struct fc_rport_libfc_priv - libfc internal information about a remote port
189 * @local_port: Fibre Channel host port instance 181 * @local_port: Fibre Channel host port instance
182 * @rp_state: indicates READY for I/O or DELETE when blocked.
183 * @flags: REC and RETRY supported flags
184 * @e_d_tov: error detect timeout value (in msec)
185 * @r_a_tov: resource allocation timeout value (in msec)
186 */
187struct fc_rport_libfc_priv {
188 struct fc_lport *local_port;
189 enum fc_rport_state rp_state;
190 u16 flags;
191 #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0)
192 #define FC_RP_FLAGS_RETRY (1 << 1)
193 unsigned int e_d_tov;
194 unsigned int r_a_tov;
195};
196
197/**
198 * struct fc_rport_priv - libfc rport and discovery info about a remote port
199 * @local_port: Fibre Channel host port instance
200 * @rport: transport remote port
201 * @kref: reference counter
190 * @rp_state: state tracks progress of PLOGI, PRLI, and RTV exchanges 202 * @rp_state: state tracks progress of PLOGI, PRLI, and RTV exchanges
203 * @ids: remote port identifiers and roles
191 * @flags: REC and RETRY supported flags 204 * @flags: REC and RETRY supported flags
192 * @max_seq: maximum number of concurrent sequences 205 * @max_seq: maximum number of concurrent sequences
206 * @disc_id: discovery identifier
207 * @maxframe_size: maximum frame size
193 * @retries: retry count in current state 208 * @retries: retry count in current state
194 * @e_d_tov: error detect timeout value (in msec) 209 * @e_d_tov: error detect timeout value (in msec)
195 * @r_a_tov: resource allocation timeout value (in msec) 210 * @r_a_tov: resource allocation timeout value (in msec)
@@ -197,38 +212,28 @@ struct fc_rport_operations {
197 * @retry_work: 212 * @retry_work:
198 * @event_callback: Callback for rport READY, FAILED or LOGO 213 * @event_callback: Callback for rport READY, FAILED or LOGO
199 */ 214 */
200struct fc_rport_libfc_priv { 215struct fc_rport_priv {
201 struct fc_lport *local_port; 216 struct fc_lport *local_port;
217 struct fc_rport *rport;
218 struct kref kref;
202 enum fc_rport_state rp_state; 219 enum fc_rport_state rp_state;
220 struct fc_rport_identifiers ids;
203 u16 flags; 221 u16 flags;
204 #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0)
205 #define FC_RP_FLAGS_RETRY (1 << 1)
206 u16 max_seq; 222 u16 max_seq;
223 u16 disc_id;
224 u16 maxframe_size;
207 unsigned int retries; 225 unsigned int retries;
208 unsigned int e_d_tov; 226 unsigned int e_d_tov;
209 unsigned int r_a_tov; 227 unsigned int r_a_tov;
210 enum fc_rport_trans_state trans_state;
211 struct mutex rp_mutex; 228 struct mutex rp_mutex;
212 struct delayed_work retry_work; 229 struct delayed_work retry_work;
213 enum fc_rport_event event; 230 enum fc_rport_event event;
214 struct fc_rport_operations *ops; 231 struct fc_rport_operations *ops;
215 struct list_head peers; 232 struct list_head peers;
216 struct work_struct event_work; 233 struct work_struct event_work;
234 u32 supported_classes;
217}; 235};
218 236
219#define PRIV_TO_RPORT(x) \
220 (struct fc_rport *)((void *)x - sizeof(struct fc_rport));
221#define RPORT_TO_PRIV(x) \
222 (struct fc_rport_libfc_priv *)((void *)x + sizeof(struct fc_rport));
223
224struct fc_rport *fc_rport_rogue_create(struct fc_disc_port *);
225
226static inline void fc_rport_set_name(struct fc_rport *rport, u64 wwpn, u64 wwnn)
227{
228 rport->node_name = wwnn;
229 rport->port_name = wwpn;
230}
231
232/* 237/*
233 * fcoe stats structure 238 * fcoe stats structure
234 */ 239 */
@@ -344,6 +349,8 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp)
344 */ 349 */
345 350
346struct fc_exch_mgr; 351struct fc_exch_mgr;
352struct fc_exch_mgr_anchor;
353extern u16 fc_cpu_mask; /* cpu mask for possible cpus */
347 354
348/* 355/*
349 * Sequence. 356 * Sequence.
@@ -368,6 +375,7 @@ struct fc_seq {
368 */ 375 */
369struct fc_exch { 376struct fc_exch {
370 struct fc_exch_mgr *em; /* exchange manager */ 377 struct fc_exch_mgr *em; /* exchange manager */
378 struct fc_exch_pool *pool; /* per cpu exches pool */
371 u32 state; /* internal driver state */ 379 u32 state; /* internal driver state */
372 u16 xid; /* our exchange ID */ 380 u16 xid; /* our exchange ID */
373 struct list_head ex_list; /* free or busy list linkage */ 381 struct list_head ex_list; /* free or busy list linkage */
@@ -415,7 +423,7 @@ struct libfc_function_template {
415 * STATUS: OPTIONAL 423 * STATUS: OPTIONAL
416 */ 424 */
417 struct fc_seq *(*elsct_send)(struct fc_lport *lport, 425 struct fc_seq *(*elsct_send)(struct fc_lport *lport,
418 struct fc_rport *rport, 426 u32 did,
419 struct fc_frame *fp, 427 struct fc_frame *fp,
420 unsigned int op, 428 unsigned int op,
421 void (*resp)(struct fc_seq *, 429 void (*resp)(struct fc_seq *,
@@ -519,25 +527,6 @@ struct libfc_function_template {
519 void (*exch_done)(struct fc_seq *sp); 527 void (*exch_done)(struct fc_seq *sp);
520 528
521 /* 529 /*
522 * Assigns a EM and a free XID for an new exchange and then
523 * allocates a new exchange and sequence pair.
524 * The fp can be used to determine free XID.
525 *
526 * STATUS: OPTIONAL
527 */
528 struct fc_exch *(*exch_get)(struct fc_lport *lp, struct fc_frame *fp);
529
530 /*
531 * Release previously assigned XID by exch_get API.
532 * The LLD may implement this if XID is assigned by LLD
533 * in exch_get().
534 *
535 * STATUS: OPTIONAL
536 */
537 void (*exch_put)(struct fc_lport *lp, struct fc_exch_mgr *mp,
538 u16 ex_id);
539
540 /*
541 * Start a new sequence on the same exchange/sequence tuple. 530 * Start a new sequence on the same exchange/sequence tuple.
542 * 531 *
543 * STATUS: OPTIONAL 532 * STATUS: OPTIONAL
@@ -577,9 +566,11 @@ struct libfc_function_template {
577 int (*lport_reset)(struct fc_lport *); 566 int (*lport_reset)(struct fc_lport *);
578 567
579 /* 568 /*
580 * Create a remote port 569 * Create a remote port with a given port ID
570 *
571 * STATUS: OPTIONAL
581 */ 572 */
582 struct fc_rport *(*rport_create)(struct fc_disc_port *); 573 struct fc_rport_priv *(*rport_create)(struct fc_lport *, u32);
583 574
584 /* 575 /*
585 * Initiates the RP state machine. It is called from the LP module. 576 * Initiates the RP state machine. It is called from the LP module.
@@ -592,7 +583,7 @@ struct libfc_function_template {
592 * 583 *
593 * STATUS: OPTIONAL 584 * STATUS: OPTIONAL
594 */ 585 */
595 int (*rport_login)(struct fc_rport *rport); 586 int (*rport_login)(struct fc_rport_priv *);
596 587
597 /* 588 /*
598 * Logoff, and remove the rport from the transport if 589 * Logoff, and remove the rport from the transport if
@@ -600,7 +591,7 @@ struct libfc_function_template {
600 * 591 *
601 * STATUS: OPTIONAL 592 * STATUS: OPTIONAL
602 */ 593 */
603 int (*rport_logoff)(struct fc_rport *rport); 594 int (*rport_logoff)(struct fc_rport_priv *);
604 595
605 /* 596 /*
606 * Recieve a request from a remote port. 597 * Recieve a request from a remote port.
@@ -608,14 +599,20 @@ struct libfc_function_template {
608 * STATUS: OPTIONAL 599 * STATUS: OPTIONAL
609 */ 600 */
610 void (*rport_recv_req)(struct fc_seq *, struct fc_frame *, 601 void (*rport_recv_req)(struct fc_seq *, struct fc_frame *,
611 struct fc_rport *); 602 struct fc_lport *);
612 603
613 /* 604 /*
614 * lookup an rport by it's port ID. 605 * lookup an rport by it's port ID.
615 * 606 *
616 * STATUS: OPTIONAL 607 * STATUS: OPTIONAL
617 */ 608 */
618 struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32); 609 struct fc_rport_priv *(*rport_lookup)(const struct fc_lport *, u32);
610
611 /*
612 * Destroy an rport after final kref_put().
613 * The argument is a pointer to the kref inside the fc_rport_priv.
614 */
615 void (*rport_destroy)(struct kref *);
619 616
620 /* 617 /*
621 * Send a fcp cmd from fsp pkt. 618 * Send a fcp cmd from fsp pkt.
@@ -681,18 +678,16 @@ struct libfc_function_template {
681/* information used by the discovery layer */ 678/* information used by the discovery layer */
682struct fc_disc { 679struct fc_disc {
683 unsigned char retry_count; 680 unsigned char retry_count;
684 unsigned char delay;
685 unsigned char pending; 681 unsigned char pending;
686 unsigned char requested; 682 unsigned char requested;
687 unsigned short seq_count; 683 unsigned short seq_count;
688 unsigned char buf_len; 684 unsigned char buf_len;
689 enum fc_disc_event event; 685 u16 disc_id;
690 686
691 void (*disc_callback)(struct fc_lport *, 687 void (*disc_callback)(struct fc_lport *,
692 enum fc_disc_event); 688 enum fc_disc_event);
693 689
694 struct list_head rports; 690 struct list_head rports;
695 struct list_head rogue_rports;
696 struct fc_lport *lport; 691 struct fc_lport *lport;
697 struct mutex disc_mutex; 692 struct mutex disc_mutex;
698 struct fc_gpn_ft_resp partial_buf; /* partial name buffer */ 693 struct fc_gpn_ft_resp partial_buf; /* partial name buffer */
@@ -704,9 +699,9 @@ struct fc_lport {
704 699
705 /* Associations */ 700 /* Associations */
706 struct Scsi_Host *host; 701 struct Scsi_Host *host;
707 struct fc_exch_mgr *emp; 702 struct list_head ema_list;
708 struct fc_rport *dns_rp; 703 struct fc_rport_priv *dns_rp;
709 struct fc_rport *ptp_rp; 704 struct fc_rport_priv *ptp_rp;
710 void *scsi_priv; 705 void *scsi_priv;
711 struct fc_disc disc; 706 struct fc_disc disc;
712 707
@@ -960,6 +955,28 @@ int fc_elsct_init(struct fc_lport *lp);
960int fc_exch_init(struct fc_lport *lp); 955int fc_exch_init(struct fc_lport *lp);
961 956
962/* 957/*
958 * Adds Exchange Manager (EM) mp to lport.
959 *
960 * Adds specified mp to lport using struct fc_exch_mgr_anchor,
961 * the struct fc_exch_mgr_anchor allows same EM sharing by
962 * more than one lport with their specified match function,
963 * the match function is used in allocating exchange from
964 * added mp.
965 */
966struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *lport,
967 struct fc_exch_mgr *mp,
968 bool (*match)(struct fc_frame *));
969
970/*
971 * Deletes Exchange Manager (EM) from lport by removing
972 * its anchor ema from lport.
973 *
974 * If removed anchor ema was the last user of its associated EM
975 * then also destroys associated EM.
976 */
977void fc_exch_mgr_del(struct fc_exch_mgr_anchor *ema);
978
979/*
963 * Allocates an Exchange Manager (EM). 980 * Allocates an Exchange Manager (EM).
964 * 981 *
965 * The EM manages exchanges for their allocation and 982 * The EM manages exchanges for their allocation and
@@ -974,27 +991,25 @@ int fc_exch_init(struct fc_lport *lp);
974 * a new exchange. 991 * a new exchange.
975 * The LLD may choose to have multiple EMs, 992 * The LLD may choose to have multiple EMs,
976 * e.g. one EM instance per CPU receive thread in LLD. 993 * e.g. one EM instance per CPU receive thread in LLD.
977 * The LLD can use exch_get() of struct libfc_function_template
978 * to specify XID for a new exchange within
979 * a specified EM instance.
980 * 994 *
981 * The em_idx to uniquely identify an EM instance. 995 * Specified match function is used in allocating exchanges
996 * from newly allocated EM.
982 */ 997 */
983struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp, 998struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp,
984 enum fc_class class, 999 enum fc_class class,
985 u16 min_xid, 1000 u16 min_xid,
986 u16 max_xid); 1001 u16 max_xid,
1002 bool (*match)(struct fc_frame *));
987 1003
988/* 1004/*
989 * Free an exchange manager. 1005 * Free all exchange managers of a lport.
990 */ 1006 */
991void fc_exch_mgr_free(struct fc_exch_mgr *mp); 1007void fc_exch_mgr_free(struct fc_lport *lport);
992 1008
993/* 1009/*
994 * Receive a frame on specified local port and exchange manager. 1010 * Receive a frame on specified local port and exchange manager.
995 */ 1011 */
996void fc_exch_recv(struct fc_lport *lp, struct fc_exch_mgr *mp, 1012void fc_exch_recv(struct fc_lport *lp, struct fc_frame *fp);
997 struct fc_frame *fp);
998 1013
999/* 1014/*
1000 * This function is for exch_seq_send function pointer in 1015 * This function is for exch_seq_send function pointer in
@@ -1036,28 +1051,20 @@ int fc_seq_exch_abort(const struct fc_seq *req_sp, unsigned int timer_msec);
1036void fc_exch_done(struct fc_seq *sp); 1051void fc_exch_done(struct fc_seq *sp);
1037 1052
1038/* 1053/*
1039 * Assigns a EM and XID for a frame and then allocates
1040 * a new exchange and sequence pair.
1041 * The fp can be used to determine free XID.
1042 */
1043struct fc_exch *fc_exch_get(struct fc_lport *lp, struct fc_frame *fp);
1044
1045/*
1046 * Allocate a new exchange and sequence pair. 1054 * Allocate a new exchange and sequence pair.
1047 * if ex_id is zero then next free exchange id
1048 * from specified exchange manger mp will be assigned.
1049 */ 1055 */
1050struct fc_exch *fc_exch_alloc(struct fc_exch_mgr *mp, 1056struct fc_exch *fc_exch_alloc(struct fc_lport *lport, struct fc_frame *fp);
1051 struct fc_frame *fp, u16 ex_id);
1052/* 1057/*
1053 * Start a new sequence on the same exchange as the supplied sequence. 1058 * Start a new sequence on the same exchange as the supplied sequence.
1054 */ 1059 */
1055struct fc_seq *fc_seq_start_next(struct fc_seq *sp); 1060struct fc_seq *fc_seq_start_next(struct fc_seq *sp);
1056 1061
1062
1057/* 1063/*
1058 * Reset an exchange manager, completing all sequences and exchanges. 1064 * Reset all EMs of a lport, releasing its all sequences and
1059 * If s_id is non-zero, reset only exchanges originating from that FID. 1065 * exchanges. If sid is non-zero, then reset only exchanges
1060 * If d_id is non-zero, reset only exchanges sending to that FID. 1066 * we sourced from that FID. If did is non-zero, reset only
1067 * exchanges destined to that FID.
1061 */ 1068 */
1062void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); 1069void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id);
1063 1070
@@ -1078,4 +1085,9 @@ void fc_destroy_exch_mgr(void);
1078int fc_setup_rport(void); 1085int fc_setup_rport(void);
1079void fc_destroy_rport(void); 1086void fc_destroy_rport(void);
1080 1087
1088/*
1089 * Internal libfc functions.
1090 */
1091const char *fc_els_resp_type(struct fc_frame *);
1092
1081#endif /* _LIBFC_H_ */ 1093#endif /* _LIBFC_H_ */
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 61afeb59a836..887e57e3e223 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -390,6 +390,7 @@ extern void iscsi_session_failure(struct iscsi_session *session,
390extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, 390extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
391 enum iscsi_param param, char *buf); 391 enum iscsi_param param, char *buf);
392extern void iscsi_suspend_tx(struct iscsi_conn *conn); 392extern void iscsi_suspend_tx(struct iscsi_conn *conn);
393extern void iscsi_suspend_queue(struct iscsi_conn *conn);
393extern void iscsi_conn_queue_work(struct iscsi_conn *conn); 394extern void iscsi_conn_queue_work(struct iscsi_conn *conn);
394 395
395#define iscsi_conn_printk(prefix, _c, fmt, a...) \ 396#define iscsi_conn_printk(prefix, _c, fmt, a...) \
@@ -415,6 +416,8 @@ extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t);
415extern void iscsi_requeue_task(struct iscsi_task *task); 416extern void iscsi_requeue_task(struct iscsi_task *task);
416extern void iscsi_put_task(struct iscsi_task *task); 417extern void iscsi_put_task(struct iscsi_task *task);
417extern void __iscsi_get_task(struct iscsi_task *task); 418extern void __iscsi_get_task(struct iscsi_task *task);
419extern void iscsi_complete_scsi_task(struct iscsi_task *task,
420 uint32_t exp_cmdsn, uint32_t max_cmdsn);
418 421
419/* 422/*
420 * generic helpers 423 * generic helpers
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 3f566af3f101..9af48cbf0036 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -187,10 +187,13 @@ struct scsi_device_handler {
187 void (*detach)(struct scsi_device *); 187 void (*detach)(struct scsi_device *);
188 int (*activate)(struct scsi_device *); 188 int (*activate)(struct scsi_device *);
189 int (*prep_fn)(struct scsi_device *, struct request *); 189 int (*prep_fn)(struct scsi_device *, struct request *);
190 int (*set_params)(struct scsi_device *, const char *);
190}; 191};
191 192
192struct scsi_dh_data { 193struct scsi_dh_data {
193 struct scsi_device_handler *scsi_dh; 194 struct scsi_device_handler *scsi_dh;
195 struct scsi_device *sdev;
196 struct kref kref;
194 char buf[0]; 197 char buf[0];
195}; 198};
196 199
diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h
index 33efce20c26c..ff2407405b42 100644
--- a/include/scsi/scsi_dh.h
+++ b/include/scsi/scsi_dh.h
@@ -60,6 +60,7 @@ extern int scsi_dh_activate(struct request_queue *);
60extern int scsi_dh_handler_exist(const char *); 60extern int scsi_dh_handler_exist(const char *);
61extern int scsi_dh_attach(struct request_queue *, const char *); 61extern int scsi_dh_attach(struct request_queue *, const char *);
62extern void scsi_dh_detach(struct request_queue *); 62extern void scsi_dh_detach(struct request_queue *);
63extern int scsi_dh_set_params(struct request_queue *, const char *);
63#else 64#else
64static inline int scsi_dh_activate(struct request_queue *req) 65static inline int scsi_dh_activate(struct request_queue *req)
65{ 66{
@@ -77,4 +78,8 @@ static inline void scsi_dh_detach(struct request_queue *q)
77{ 78{
78 return; 79 return;
79} 80}
81static inline int scsi_dh_set_params(struct request_queue *req, const char *params)
82{
83 return -SCSI_DH_NOSYS;
84}
80#endif 85#endif
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 9a74b468a229..d86af94691c2 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -171,6 +171,7 @@ TRACE_EVENT(block_rq_complete,
171 (unsigned long long)__entry->sector, 171 (unsigned long long)__entry->sector,
172 __entry->nr_sector, __entry->errors) 172 __entry->nr_sector, __entry->errors)
173); 173);
174
174TRACE_EVENT(block_bio_bounce, 175TRACE_EVENT(block_bio_bounce,
175 176
176 TP_PROTO(struct request_queue *q, struct bio *bio), 177 TP_PROTO(struct request_queue *q, struct bio *bio),
@@ -186,7 +187,8 @@ TRACE_EVENT(block_bio_bounce,
186 ), 187 ),
187 188
188 TP_fast_assign( 189 TP_fast_assign(
189 __entry->dev = bio->bi_bdev->bd_dev; 190 __entry->dev = bio->bi_bdev ?
191 bio->bi_bdev->bd_dev : 0;
190 __entry->sector = bio->bi_sector; 192 __entry->sector = bio->bi_sector;
191 __entry->nr_sector = bio->bi_size >> 9; 193 __entry->nr_sector = bio->bi_size >> 9;
192 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 194 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size);
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 7d8b5bc74185..8d433c4e3709 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -227,7 +227,6 @@ TRACE_EVENT(ext4_da_writepages,
227 __field( char, nonblocking ) 227 __field( char, nonblocking )
228 __field( char, for_kupdate ) 228 __field( char, for_kupdate )
229 __field( char, for_reclaim ) 229 __field( char, for_reclaim )
230 __field( char, for_writepages )
231 __field( char, range_cyclic ) 230 __field( char, range_cyclic )
232 ), 231 ),
233 232
@@ -241,16 +240,15 @@ TRACE_EVENT(ext4_da_writepages,
241 __entry->nonblocking = wbc->nonblocking; 240 __entry->nonblocking = wbc->nonblocking;
242 __entry->for_kupdate = wbc->for_kupdate; 241 __entry->for_kupdate = wbc->for_kupdate;
243 __entry->for_reclaim = wbc->for_reclaim; 242 __entry->for_reclaim = wbc->for_reclaim;
244 __entry->for_writepages = wbc->for_writepages;
245 __entry->range_cyclic = wbc->range_cyclic; 243 __entry->range_cyclic = wbc->range_cyclic;
246 ), 244 ),
247 245
248 TP_printk("dev %s ino %lu nr_t_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d for_writepages %d range_cyclic %d", 246 TP_printk("dev %s ino %lu nr_t_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d",
249 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->nr_to_write, 247 jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->nr_to_write,
250 __entry->pages_skipped, __entry->range_start, 248 __entry->pages_skipped, __entry->range_start,
251 __entry->range_end, __entry->nonblocking, 249 __entry->range_end, __entry->nonblocking,
252 __entry->for_kupdate, __entry->for_reclaim, 250 __entry->for_kupdate, __entry->for_reclaim,
253 __entry->for_writepages, __entry->range_cyclic) 251 __entry->range_cyclic)
254); 252);
255 253
256TRACE_EVENT(ext4_da_writepages_result, 254TRACE_EVENT(ext4_da_writepages_result,
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index 1cb0c3aa11e6..b89f9db4a404 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -8,16 +8,17 @@
8#include <linux/interrupt.h> 8#include <linux/interrupt.h>
9 9
10#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } 10#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
11#define show_softirq_name(val) \ 11#define show_softirq_name(val) \
12 __print_symbolic(val, \ 12 __print_symbolic(val, \
13 softirq_name(HI), \ 13 softirq_name(HI), \
14 softirq_name(TIMER), \ 14 softirq_name(TIMER), \
15 softirq_name(NET_TX), \ 15 softirq_name(NET_TX), \
16 softirq_name(NET_RX), \ 16 softirq_name(NET_RX), \
17 softirq_name(BLOCK), \ 17 softirq_name(BLOCK), \
18 softirq_name(TASKLET), \ 18 softirq_name(BLOCK_IOPOLL), \
19 softirq_name(SCHED), \ 19 softirq_name(TASKLET), \
20 softirq_name(HRTIMER), \ 20 softirq_name(SCHED), \
21 softirq_name(HRTIMER), \
21 softirq_name(RCU)) 22 softirq_name(RCU))
22 23
23/** 24/**
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
new file mode 100644
index 000000000000..dbe108455275
--- /dev/null
+++ b/include/trace/events/kvm.h
@@ -0,0 +1,151 @@
1#if !defined(_TRACE_KVM_MAIN_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_KVM_MAIN_H
3
4#include <linux/tracepoint.h>
5
6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM kvm
8#define TRACE_INCLUDE_FILE kvm
9
10#if defined(__KVM_HAVE_IOAPIC)
11TRACE_EVENT(kvm_set_irq,
12 TP_PROTO(unsigned int gsi, int level, int irq_source_id),
13 TP_ARGS(gsi, level, irq_source_id),
14
15 TP_STRUCT__entry(
16 __field( unsigned int, gsi )
17 __field( int, level )
18 __field( int, irq_source_id )
19 ),
20
21 TP_fast_assign(
22 __entry->gsi = gsi;
23 __entry->level = level;
24 __entry->irq_source_id = irq_source_id;
25 ),
26
27 TP_printk("gsi %u level %d source %d",
28 __entry->gsi, __entry->level, __entry->irq_source_id)
29);
30
31#define kvm_deliver_mode \
32 {0x0, "Fixed"}, \
33 {0x1, "LowPrio"}, \
34 {0x2, "SMI"}, \
35 {0x3, "Res3"}, \
36 {0x4, "NMI"}, \
37 {0x5, "INIT"}, \
38 {0x6, "SIPI"}, \
39 {0x7, "ExtINT"}
40
41TRACE_EVENT(kvm_ioapic_set_irq,
42 TP_PROTO(__u64 e, int pin, bool coalesced),
43 TP_ARGS(e, pin, coalesced),
44
45 TP_STRUCT__entry(
46 __field( __u64, e )
47 __field( int, pin )
48 __field( bool, coalesced )
49 ),
50
51 TP_fast_assign(
52 __entry->e = e;
53 __entry->pin = pin;
54 __entry->coalesced = coalesced;
55 ),
56
57 TP_printk("pin %u dst %x vec=%u (%s|%s|%s%s)%s",
58 __entry->pin, (u8)(__entry->e >> 56), (u8)__entry->e,
59 __print_symbolic((__entry->e >> 8 & 0x7), kvm_deliver_mode),
60 (__entry->e & (1<<11)) ? "logical" : "physical",
61 (__entry->e & (1<<15)) ? "level" : "edge",
62 (__entry->e & (1<<16)) ? "|masked" : "",
63 __entry->coalesced ? " (coalesced)" : "")
64);
65
66TRACE_EVENT(kvm_msi_set_irq,
67 TP_PROTO(__u64 address, __u64 data),
68 TP_ARGS(address, data),
69
70 TP_STRUCT__entry(
71 __field( __u64, address )
72 __field( __u64, data )
73 ),
74
75 TP_fast_assign(
76 __entry->address = address;
77 __entry->data = data;
78 ),
79
80 TP_printk("dst %u vec %x (%s|%s|%s%s)",
81 (u8)(__entry->address >> 12), (u8)__entry->data,
82 __print_symbolic((__entry->data >> 8 & 0x7), kvm_deliver_mode),
83 (__entry->address & (1<<2)) ? "logical" : "physical",
84 (__entry->data & (1<<15)) ? "level" : "edge",
85 (__entry->address & (1<<3)) ? "|rh" : "")
86);
87
88#define kvm_irqchips \
89 {KVM_IRQCHIP_PIC_MASTER, "PIC master"}, \
90 {KVM_IRQCHIP_PIC_SLAVE, "PIC slave"}, \
91 {KVM_IRQCHIP_IOAPIC, "IOAPIC"}
92
93TRACE_EVENT(kvm_ack_irq,
94 TP_PROTO(unsigned int irqchip, unsigned int pin),
95 TP_ARGS(irqchip, pin),
96
97 TP_STRUCT__entry(
98 __field( unsigned int, irqchip )
99 __field( unsigned int, pin )
100 ),
101
102 TP_fast_assign(
103 __entry->irqchip = irqchip;
104 __entry->pin = pin;
105 ),
106
107 TP_printk("irqchip %s pin %u",
108 __print_symbolic(__entry->irqchip, kvm_irqchips),
109 __entry->pin)
110);
111
112
113
114#endif /* defined(__KVM_HAVE_IOAPIC) */
115
116#define KVM_TRACE_MMIO_READ_UNSATISFIED 0
117#define KVM_TRACE_MMIO_READ 1
118#define KVM_TRACE_MMIO_WRITE 2
119
120#define kvm_trace_symbol_mmio \
121 { KVM_TRACE_MMIO_READ_UNSATISFIED, "unsatisfied-read" }, \
122 { KVM_TRACE_MMIO_READ, "read" }, \
123 { KVM_TRACE_MMIO_WRITE, "write" }
124
125TRACE_EVENT(kvm_mmio,
126 TP_PROTO(int type, int len, u64 gpa, u64 val),
127 TP_ARGS(type, len, gpa, val),
128
129 TP_STRUCT__entry(
130 __field( u32, type )
131 __field( u32, len )
132 __field( u64, gpa )
133 __field( u64, val )
134 ),
135
136 TP_fast_assign(
137 __entry->type = type;
138 __entry->len = len;
139 __entry->gpa = gpa;
140 __entry->val = val;
141 ),
142
143 TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx",
144 __print_symbolic(__entry->type, kvm_trace_symbol_mmio),
145 __entry->len, __entry->gpa, __entry->val)
146);
147
148#endif /* _TRACE_KVM_MAIN_H */
149
150/* This part must be outside protection */
151#include <trace/define_trace.h>
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index e499863b9669..4b2be6dc76f0 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -5,6 +5,7 @@
5#define _TRACE_SKB_H 5#define _TRACE_SKB_H
6 6
7#include <linux/skbuff.h> 7#include <linux/skbuff.h>
8#include <linux/netdevice.h>
8#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
9 10
10/* 11/*
@@ -34,6 +35,25 @@ TRACE_EVENT(kfree_skb,
34 __entry->skbaddr, __entry->protocol, __entry->location) 35 __entry->skbaddr, __entry->protocol, __entry->location)
35); 36);
36 37
38TRACE_EVENT(skb_copy_datagram_iovec,
39
40 TP_PROTO(const struct sk_buff *skb, int len),
41
42 TP_ARGS(skb, len),
43
44 TP_STRUCT__entry(
45 __field( const void *, skbaddr )
46 __field( int, len )
47 ),
48
49 TP_fast_assign(
50 __entry->skbaddr = skb;
51 __entry->len = len;
52 ),
53
54 TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len)
55);
56
37#endif /* _TRACE_SKB_H */ 57#endif /* _TRACE_SKB_H */
38 58
39/* This part must be outside protection */ 59/* This part must be outside protection */
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 308bafd93325..72a3b437b829 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -239,9 +239,9 @@ ftrace_format_##call(struct ftrace_event_call *unused, \
239#undef __print_flags 239#undef __print_flags
240#define __print_flags(flag, delim, flag_array...) \ 240#define __print_flags(flag, delim, flag_array...) \
241 ({ \ 241 ({ \
242 static const struct trace_print_flags flags[] = \ 242 static const struct trace_print_flags __flags[] = \
243 { flag_array, { -1, NULL }}; \ 243 { flag_array, { -1, NULL }}; \
244 ftrace_print_flags_seq(p, delim, flag, flags); \ 244 ftrace_print_flags_seq(p, delim, flag, __flags); \
245 }) 245 })
246 246
247#undef __print_symbolic 247#undef __print_symbolic
@@ -254,7 +254,7 @@ ftrace_format_##call(struct ftrace_event_call *unused, \
254 254
255#undef TRACE_EVENT 255#undef TRACE_EVENT
256#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ 256#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
257enum print_line_t \ 257static enum print_line_t \
258ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ 258ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
259{ \ 259{ \
260 struct trace_seq *s = &iter->seq; \ 260 struct trace_seq *s = &iter->seq; \
@@ -317,7 +317,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
317 317
318#undef TRACE_EVENT 318#undef TRACE_EVENT
319#define TRACE_EVENT(call, proto, args, tstruct, func, print) \ 319#define TRACE_EVENT(call, proto, args, tstruct, func, print) \
320int \ 320static int \
321ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ 321ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
322{ \ 322{ \
323 struct ftrace_raw_##call field; \ 323 struct ftrace_raw_##call field; \