aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-15 11:49:32 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-15 11:49:32 -0500
commit7547a3e8a43d31aaf91c2daf5f597e43212ccddf (patch)
treeadd99b58ac3b490f6ede666b9dbf2333d87e24fa /include/linux
parent0f5e182dff576e6f3cd9b805834f18d11f2882aa (diff)
parent3ea6b3d0e6d0ffd91c0f8cadeb69b7133c038b32 (diff)
Merge commit 'linus' into next
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/ata.h44
-rw-r--r--include/linux/backing-dev.h13
-rw-r--r--include/linux/bio.h20
-rw-r--r--include/linux/blkdev.h56
-rw-r--r--include/linux/bootmem.h1
-rw-r--r--include/linux/brcmphy.h19
-rw-r--r--include/linux/can/core.h2
-rw-r--r--include/linux/can/dev.h20
-rw-r--r--include/linux/can/platform/mcp251x.h36
-rw-r--r--include/linux/can/platform/ti_hecc.h40
-rw-r--r--include/linux/capability.h2
-rw-r--r--include/linux/cciss_ioctl.h2
-rw-r--r--include/linux/cgroup_subsys.h6
-rw-r--r--include/linux/chio.h2
-rw-r--r--include/linux/clockchips.h19
-rw-r--r--include/linux/clocksource.h18
-rw-r--r--include/linux/compat.h44
-rw-r--r--include/linux/compiler-gcc.h1
-rw-r--r--include/linux/compiler-gcc4.h22
-rw-r--r--include/linux/compiler.h20
-rw-r--r--include/linux/connector.h2
-rw-r--r--include/linux/cpu.h15
-rw-r--r--include/linux/cpufreq.h1
-rw-r--r--include/linux/cpumask.h2
-rw-r--r--include/linux/crypto.h27
-rw-r--r--include/linux/cryptohash.h1
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/dm-log-userspace.h2
-rw-r--r--include/linux/dmar.h25
-rw-r--r--include/linux/dn.h9
-rw-r--r--include/linux/drbd.h343
-rw-r--r--include/linux/drbd_limits.h137
-rw-r--r--include/linux/drbd_nl.h137
-rw-r--r--include/linux/drbd_tag_magic.h83
-rw-r--r--include/linux/errqueue.h6
-rw-r--r--include/linux/ethtool.h43
-rw-r--r--include/linux/ext2_fs.h16
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fb.h1
-rw-r--r--include/linux/fib_rules.h17
-rw-r--r--include/linux/filter.h10
-rw-r--r--include/linux/firewire.h17
-rw-r--r--include/linux/firmware.h5
-rw-r--r--include/linux/fs.h7
-rw-r--r--include/linux/fsl_devices.h11
-rw-r--r--include/linux/ftrace_event.h39
-rw-r--r--include/linux/gen_stats.h15
-rw-r--r--include/linux/genhd.h1
-rw-r--r--include/linux/gfs2_ondisk.h6
-rw-r--r--include/linux/gigaset_dev.h22
-rw-r--r--include/linux/hardirq.h24
-rw-r--r--include/linux/hayesesp.h114
-rw-r--r--include/linux/hid.h1
-rw-r--r--include/linux/hpet.h2
-rw-r--r--include/linux/hrtimer.h58
-rw-r--r--include/linux/hw_breakpoint.h125
-rw-r--r--include/linux/hw_random.h7
-rw-r--r--include/linux/i2c.h98
-rw-r--r--include/linux/i2c/tps65010.h19
-rw-r--r--include/linux/i2c/twl.h (renamed from include/linux/i2c/twl4030.h)228
-rw-r--r--include/linux/i82593.h229
-rw-r--r--include/linux/ide.h4
-rw-r--r--include/linux/ieee80211.h45
-rw-r--r--include/linux/if.h16
-rw-r--r--include/linux/if_addr.h9
-rw-r--r--include/linux/if_addrlabel.h6
-rw-r--r--include/linux/if_arcnet.h18
-rw-r--r--include/linux/if_arp.h3
-rw-r--r--include/linux/if_bonding.h3
-rw-r--r--include/linux/if_bridge.h9
-rw-r--r--include/linux/if_ec.h12
-rw-r--r--include/linux/if_ether.h6
-rw-r--r--include/linux/if_fddi.h22
-rw-r--r--include/linux/if_hippi.h15
-rw-r--r--include/linux/if_link.h42
-rw-r--r--include/linux/if_packet.h27
-rw-r--r--include/linux/if_plip.h3
-rw-r--r--include/linux/if_pppol2tp.h3
-rw-r--r--include/linux/if_tunnel.h18
-rw-r--r--include/linux/if_vlan.h41
-rw-r--r--include/linux/igmp.h15
-rw-r--r--include/linux/in.h18
-rw-r--r--include/linux/in6.h11
-rw-r--r--include/linux/inetdevice.h10
-rw-r--r--include/linux/init_task.h4
-rw-r--r--include/linux/input/sh_keysc.h14
-rw-r--r--include/linux/interrupt.h6
-rw-r--r--include/linux/iocontext.h14
-rw-r--r--include/linux/ip_vs.h3
-rw-r--r--include/linux/ipv6.h4
-rw-r--r--include/linux/irq.h2
-rw-r--r--include/linux/irqflags.h2
-rw-r--r--include/linux/isicom.h1
-rw-r--r--include/linux/jiffies.h1
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/kernel_stat.h1
-rw-r--r--include/linux/kprobes.h2
-rw-r--r--include/linux/kvm.h273
-rw-r--r--include/linux/kvm_host.h53
-rw-r--r--include/linux/libata.h5
-rw-r--r--include/linux/lru_cache.h294
-rw-r--r--include/linux/lsm_audit.h18
-rw-r--r--include/linux/mfd/88pm8607.h217
-rw-r--r--include/linux/mfd/ab4500.h262
-rw-r--r--include/linux/mfd/adp5520.h299
-rw-r--r--include/linux/mfd/da903x.h4
-rw-r--r--include/linux/mfd/ezx-pcap.h7
-rw-r--r--include/linux/mfd/mc13783-private.h208
-rw-r--r--include/linux/mfd/mc13783.h120
-rw-r--r--include/linux/mfd/mcp.h69
-rw-r--r--include/linux/mfd/pcf50633/core.h10
-rw-r--r--include/linux/mfd/sh_mobile_sdhi.h8
-rw-r--r--include/linux/mfd/twl4030-codec.h272
-rw-r--r--include/linux/mfd/ucb1x00.h258
-rw-r--r--include/linux/mfd/wm831x/core.h43
-rw-r--r--include/linux/mfd/wm831x/pdata.h1
-rw-r--r--include/linux/mfd/wm8350/core.h14
-rw-r--r--include/linux/mfd/wm8350/gpio.h18
-rw-r--r--include/linux/mmc/sdio_ids.h1
-rw-r--r--include/linux/mroute.h31
-rw-r--r--include/linux/mroute6.h15
-rw-r--r--include/linux/mtd/ubi.h2
-rw-r--r--include/linux/namei.h1
-rw-r--r--include/linux/neighbour.h18
-rw-r--r--include/linux/net.h91
-rw-r--r--include/linux/netdevice.h156
-rw-r--r--include/linux/netfilter.h6
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h6
-rw-r--r--include/linux/netfilter/nf_conntrack_ftp.h3
-rw-r--r--include/linux/netfilter/nf_conntrack_sctp.h3
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h6
-rw-r--r--include/linux/netfilter/nfnetlink.h6
-rw-r--r--include/linux/netfilter/nfnetlink_compat.h3
-rw-r--r--include/linux/netfilter/x_tables.h45
-rw-r--r--include/linux/netfilter/xt_connbytes.h3
-rw-r--r--include/linux/netfilter/xt_esp.h3
-rw-r--r--include/linux/netfilter/xt_multiport.h9
-rw-r--r--include/linux/netfilter/xt_policy.h18
-rw-r--r--include/linux/netfilter/xt_state.h3
-rw-r--r--include/linux/netfilter/xt_string.h3
-rw-r--r--include/linux/netfilter/xt_tcpudp.h6
-rw-r--r--include/linux/netfilter_arp/arp_tables.h21
-rw-r--r--include/linux/netfilter_bridge/ebt_802_3.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_among.h9
-rw-r--r--include/linux/netfilter_bridge/ebt_arpreply.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_ip.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_ip6.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_limit.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_log.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_mark_m.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_mark_t.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_nat.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_pkttype.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_redirect.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_stp.h6
-rw-r--r--include/linux/netfilter_bridge/ebtables.h39
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h27
-rw-r--r--include/linux/netfilter_ipv4/ipt_SAME.h3
-rw-r--r--include/linux/netfilter_ipv4/ipt_ah.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h27
-rw-r--r--include/linux/netfilter_ipv6/ip6t_ah.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_frag.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_ipv6header.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_mh.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_opts.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6t_rt.h3
-rw-r--r--include/linux/netlink.h24
-rw-r--r--include/linux/nfs4.h3
-rw-r--r--include/linux/nfs_fs_sb.h1
-rw-r--r--include/linux/nfs_xdr.h13
-rw-r--r--include/linux/nilfs2_fs.h24
-rw-r--r--include/linux/nl80211.h62
-rw-r--r--include/linux/nl802154.h6
-rw-r--r--include/linux/notifier.h2
-rw-r--r--include/linux/of.h103
-rw-r--r--include/linux/of_fdt.h86
-rw-r--r--include/linux/omapfb.h251
-rw-r--r--include/linux/pci.h42
-rw-r--r--include/linux/pci_ids.h25
-rw-r--r--include/linux/pci_regs.h18
-rw-r--r--include/linux/pcieport_if.h16
-rw-r--r--include/linux/percpu-defs.h1
-rw-r--r--include/linux/percpu.h434
-rw-r--r--include/linux/perf_counter.h3
-rw-r--r--include/linux/perf_event.h60
-rw-r--r--include/linux/pkt_cls.h84
-rw-r--r--include/linux/pkt_sched.h111
-rw-r--r--include/linux/pktcdvd.h2
-rw-r--r--include/linux/platform_device.h20
-rw-r--r--include/linux/pm.h8
-rw-r--r--include/linux/pm_runtime.h12
-rw-r--r--include/linux/posix_acl.h14
-rw-r--r--include/linux/preempt.h5
-rw-r--r--include/linux/quota.h17
-rw-r--r--include/linux/raid/pq.h19
-rw-r--r--include/linux/ratelimit.h33
-rw-r--r--include/linux/rculist.h14
-rw-r--r--include/linux/rcupdate.h10
-rw-r--r--include/linux/rcutiny.h104
-rw-r--r--include/linux/rcutree.h7
-rw-r--r--include/linux/rds.h8
-rw-r--r--include/linux/reiserfs_fs.h71
-rw-r--r--include/linux/reiserfs_fs_sb.h20
-rw-r--r--include/linux/rfkill.h3
-rw-r--r--include/linux/route.h3
-rw-r--r--include/linux/rtnetlink.h63
-rw-r--r--include/linux/sched.h68
-rw-r--r--include/linux/screen_info.h5
-rw-r--r--include/linux/sctp.h1
-rw-r--r--include/linux/securebits.h24
-rw-r--r--include/linux/security.h48
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/serial_reg.h8
-rw-r--r--include/linux/sh_intc.h7
-rw-r--r--include/linux/sh_pfc.h96
-rw-r--r--include/linux/skbuff.h31
-rw-r--r--include/linux/slab_def.h4
-rw-r--r--include/linux/slub_def.h4
-rw-r--r--include/linux/smp.h11
-rw-r--r--include/linux/smp_lock.h21
-rw-r--r--include/linux/smsc911x.h1
-rw-r--r--include/linux/socket.h13
-rw-r--r--include/linux/spi/sh_msiof.h10
-rw-r--r--include/linux/spi/spi_bitbang.h2
-rw-r--r--include/linux/spi/wl12xx.h1
-rw-r--r--include/linux/spi/xilinx_spi.h20
-rw-r--r--include/linux/spinlock.h6
-rw-r--r--include/linux/spinlock_api_smp.h75
-rw-r--r--include/linux/srcu.h1
-rw-r--r--include/linux/ssb/ssb.h20
-rw-r--r--include/linux/sunrpc/sched.h2
-rw-r--r--include/linux/swiotlb.h12
-rw-r--r--include/linux/syscalls.h85
-rw-r--r--include/linux/sysctl.h55
-rw-r--r--include/linux/tc_act/tc_defact.h6
-rw-r--r--include/linux/tc_act/tc_gact.h9
-rw-r--r--include/linux/tc_act/tc_ipt.h3
-rw-r--r--include/linux/tc_act/tc_mirred.h6
-rw-r--r--include/linux/tc_act/tc_nat.h6
-rw-r--r--include/linux/tc_act/tc_pedit.h9
-rw-r--r--include/linux/tc_act/tc_skbedit.h2
-rw-r--r--include/linux/tc_ematch/tc_em_cmp.h6
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h15
-rw-r--r--include/linux/tc_ematch/tc_em_nbyte.h3
-rw-r--r--include/linux/tc_ematch/tc_em_text.h3
-rw-r--r--include/linux/tcp.h72
-rw-r--r--include/linux/tick.h5
-rw-r--r--include/linux/time.h1
-rw-r--r--include/linux/timex.h9
-rw-r--r--include/linux/tpm.h9
-rw-r--r--include/linux/trace_seq.h7
-rw-r--r--include/linux/tracepoint.h6
-rw-r--r--include/linux/tty.h25
-rw-r--r--include/linux/udp.h15
-rw-r--r--include/linux/usb.h33
-rw-r--r--include/linux/usb/composite.h1
-rw-r--r--include/linux/usb/otg.h68
-rw-r--r--include/linux/usb/serial.h3
-rw-r--r--include/linux/usb/ulpi.h7
-rw-r--r--include/linux/usb/usbnet.h8
-rw-r--r--include/linux/usb/wusb.h2
-rw-r--r--include/linux/usb_usual.h4
-rw-r--r--include/linux/usbdevice_fs.h26
-rw-r--r--include/linux/user-return-notifier.h49
-rw-r--r--include/linux/videodev2.h9
-rw-r--r--include/linux/vmstat.h10
-rw-r--r--include/linux/vt_kern.h3
-rw-r--r--include/linux/wimax/debug.h72
-rw-r--r--include/linux/wimax/i2400m.h13
-rw-r--r--include/linux/workqueue.h38
-rw-r--r--include/linux/writeback.h1
-rw-r--r--include/linux/x25.h1
-rw-r--r--include/linux/xfrm.h35
274 files changed, 6752 insertions, 2074 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 1feed71551c9..f72914db2a11 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -214,7 +214,6 @@ unifdef-y += futex.h
214unifdef-y += fs.h 214unifdef-y += fs.h
215unifdef-y += gameport.h 215unifdef-y += gameport.h
216unifdef-y += generic_serial.h 216unifdef-y += generic_serial.h
217unifdef-y += hayesesp.h
218unifdef-y += hdlcdrv.h 217unifdef-y += hdlcdrv.h
219unifdef-y += hdlc.h 218unifdef-y += hdlc.h
220unifdef-y += hdreg.h 219unifdef-y += hdreg.h
@@ -330,6 +329,7 @@ unifdef-y += scc.h
330unifdef-y += sched.h 329unifdef-y += sched.h
331unifdef-y += screen_info.h 330unifdef-y += screen_info.h
332unifdef-y += sdla.h 331unifdef-y += sdla.h
332unifdef-y += securebits.h
333unifdef-y += selinux_netlink.h 333unifdef-y += selinux_netlink.h
334unifdef-y += sem.h 334unifdef-y += sem.h
335unifdef-y += serial_core.h 335unifdef-y += serial_core.h
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 4fb357312b3b..38a6948ce0c2 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -75,6 +75,7 @@ enum {
75 ATA_ID_EIDE_DMA_TIME = 66, 75 ATA_ID_EIDE_DMA_TIME = 66,
76 ATA_ID_EIDE_PIO = 67, 76 ATA_ID_EIDE_PIO = 67,
77 ATA_ID_EIDE_PIO_IORDY = 68, 77 ATA_ID_EIDE_PIO_IORDY = 68,
78 ATA_ID_ADDITIONAL_SUPP = 69,
78 ATA_ID_QUEUE_DEPTH = 75, 79 ATA_ID_QUEUE_DEPTH = 75,
79 ATA_ID_MAJOR_VER = 80, 80 ATA_ID_MAJOR_VER = 80,
80 ATA_ID_COMMAND_SET_1 = 82, 81 ATA_ID_COMMAND_SET_1 = 82,
@@ -87,6 +88,7 @@ enum {
87 ATA_ID_HW_CONFIG = 93, 88 ATA_ID_HW_CONFIG = 93,
88 ATA_ID_SPG = 98, 89 ATA_ID_SPG = 98,
89 ATA_ID_LBA_CAPACITY_2 = 100, 90 ATA_ID_LBA_CAPACITY_2 = 100,
91 ATA_ID_SECTOR_SIZE = 106,
90 ATA_ID_LAST_LUN = 126, 92 ATA_ID_LAST_LUN = 126,
91 ATA_ID_DLF = 128, 93 ATA_ID_DLF = 128,
92 ATA_ID_CSFO = 129, 94 ATA_ID_CSFO = 129,
@@ -638,6 +640,18 @@ static inline int ata_id_flush_ext_enabled(const u16 *id)
638 return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400; 640 return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400;
639} 641}
640 642
643static inline int ata_id_has_large_logical_sectors(const u16 *id)
644{
645 if ((id[ATA_ID_SECTOR_SIZE] & 0xc000) != 0x4000)
646 return 0;
647 return id[ATA_ID_SECTOR_SIZE] & (1 << 13);
648}
649
650static inline u8 ata_id_logical_per_physical_sectors(const u16 *id)
651{
652 return id[ATA_ID_SECTOR_SIZE] & 0xf;
653}
654
641static inline int ata_id_has_lba48(const u16 *id) 655static inline int ata_id_has_lba48(const u16 *id)
642{ 656{
643 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) 657 if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000)
@@ -803,6 +817,16 @@ static inline int ata_id_has_trim(const u16 *id)
803 return 0; 817 return 0;
804} 818}
805 819
820static inline int ata_id_has_zero_after_trim(const u16 *id)
821{
822 /* DSM supported, deterministic read, and read zero after trim set */
823 if (ata_id_has_trim(id) &&
824 (id[ATA_ID_ADDITIONAL_SUPP] & 0x4020) == 0x4020)
825 return 1;
826
827 return 0;
828}
829
806static inline int ata_id_current_chs_valid(const u16 *id) 830static inline int ata_id_current_chs_valid(const u16 *id)
807{ 831{
808 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 832 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
@@ -958,17 +982,17 @@ static inline void ata_id_to_hd_driveid(u16 *id)
958} 982}
959 983
960/* 984/*
961 * Write up to 'max' LBA Range Entries to the buffer that will cover the 985 * Write LBA Range Entries to the buffer that will cover the extent from
962 * extent from sector to sector + count. This is used for TRIM and for 986 * sector to sector + count. This is used for TRIM and for ADD LBA(S)
963 * ADD LBA(S) TO NV CACHE PINNED SET. 987 * TO NV CACHE PINNED SET.
964 */ 988 */
965static inline unsigned ata_set_lba_range_entries(void *_buffer, unsigned max, 989static inline unsigned ata_set_lba_range_entries(void *_buffer,
966 u64 sector, unsigned long count) 990 unsigned buf_size, u64 sector, unsigned long count)
967{ 991{
968 __le64 *buffer = _buffer; 992 __le64 *buffer = _buffer;
969 unsigned i = 0; 993 unsigned i = 0, used_bytes;
970 994
971 while (i < max) { 995 while (i < buf_size / 8 ) { /* 6-byte LBA + 2-byte range per entry */
972 u64 entry = sector | 996 u64 entry = sector |
973 ((u64)(count > 0xffff ? 0xffff : count) << 48); 997 ((u64)(count > 0xffff ? 0xffff : count) << 48);
974 buffer[i++] = __cpu_to_le64(entry); 998 buffer[i++] = __cpu_to_le64(entry);
@@ -978,9 +1002,9 @@ static inline unsigned ata_set_lba_range_entries(void *_buffer, unsigned max,
978 sector += 0xffff; 1002 sector += 0xffff;
979 } 1003 }
980 1004
981 max = ALIGN(i * 8, 512); 1005 used_bytes = ALIGN(i * 8, 512);
982 memset(buffer + i, 0, max - i * 8); 1006 memset(buffer + i, 0, used_bytes - i * 8);
983 return max; 1007 return used_bytes;
984} 1008}
985 1009
986static inline int is_multi_taskfile(struct ata_taskfile *tf) 1010static inline int is_multi_taskfile(struct ata_taskfile *tf)
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index b449e738533a..fcbc26af00e4 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -331,4 +331,17 @@ static inline int bdi_sched_wait(void *word)
331 return 0; 331 return 0;
332} 332}
333 333
334static inline void blk_run_backing_dev(struct backing_dev_info *bdi,
335 struct page *page)
336{
337 if (bdi && bdi->unplug_io_fn)
338 bdi->unplug_io_fn(bdi, page);
339}
340
341static inline void blk_run_address_space(struct address_space *mapping)
342{
343 if (mapping)
344 blk_run_backing_dev(mapping->backing_dev_info, NULL);
345}
346
334#endif /* _LINUX_BACKING_DEV_H */ 347#endif /* _LINUX_BACKING_DEV_H */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 5be93f18d842..7fc5606e6ea5 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -391,6 +391,18 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
391 gfp_t, int); 391 gfp_t, int);
392extern void bio_set_pages_dirty(struct bio *bio); 392extern void bio_set_pages_dirty(struct bio *bio);
393extern void bio_check_pages_dirty(struct bio *bio); 393extern void bio_check_pages_dirty(struct bio *bio);
394
395#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
396# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
397#endif
398#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
399extern void bio_flush_dcache_pages(struct bio *bi);
400#else
401static inline void bio_flush_dcache_pages(struct bio *bi)
402{
403}
404#endif
405
394extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *, 406extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *,
395 unsigned long, unsigned int, int, gfp_t); 407 unsigned long, unsigned int, int, gfp_t);
396extern struct bio *bio_copy_user_iov(struct request_queue *, 408extern struct bio *bio_copy_user_iov(struct request_queue *,
@@ -450,11 +462,8 @@ extern struct biovec_slab bvec_slabs[BIOVEC_NR_POOLS] __read_mostly;
450/* 462/*
451 * remember never ever reenable interrupts between a bvec_kmap_irq and 463 * remember never ever reenable interrupts between a bvec_kmap_irq and
452 * bvec_kunmap_irq! 464 * bvec_kunmap_irq!
453 *
454 * This function MUST be inlined - it plays with the CPU interrupt flags.
455 */ 465 */
456static __always_inline char *bvec_kmap_irq(struct bio_vec *bvec, 466static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags)
457 unsigned long *flags)
458{ 467{
459 unsigned long addr; 468 unsigned long addr;
460 469
@@ -470,8 +479,7 @@ static __always_inline char *bvec_kmap_irq(struct bio_vec *bvec,
470 return (char *) addr + bvec->bv_offset; 479 return (char *) addr + bvec->bv_offset;
471} 480}
472 481
473static __always_inline void bvec_kunmap_irq(char *buffer, 482static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
474 unsigned long *flags)
475{ 483{
476 unsigned long ptr = (unsigned long) buffer & PAGE_MASK; 484 unsigned long ptr = (unsigned long) buffer & PAGE_MASK;
477 485
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 221cecd86bd3..784a919aa0d0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -312,13 +312,17 @@ struct queue_limits {
312 unsigned int io_min; 312 unsigned int io_min;
313 unsigned int io_opt; 313 unsigned int io_opt;
314 unsigned int max_discard_sectors; 314 unsigned int max_discard_sectors;
315 unsigned int discard_granularity;
316 unsigned int discard_alignment;
315 317
316 unsigned short logical_block_size; 318 unsigned short logical_block_size;
317 unsigned short max_hw_segments; 319 unsigned short max_hw_segments;
318 unsigned short max_phys_segments; 320 unsigned short max_phys_segments;
319 321
320 unsigned char misaligned; 322 unsigned char misaligned;
323 unsigned char discard_misaligned;
321 unsigned char no_cluster; 324 unsigned char no_cluster;
325 signed char discard_zeroes_data;
322}; 326};
323 327
324struct request_queue 328struct request_queue
@@ -749,6 +753,17 @@ struct req_iterator {
749#define rq_iter_last(rq, _iter) \ 753#define rq_iter_last(rq, _iter) \
750 (_iter.bio->bi_next == NULL && _iter.i == _iter.bio->bi_vcnt-1) 754 (_iter.bio->bi_next == NULL && _iter.i == _iter.bio->bi_vcnt-1)
751 755
756#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
757# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
758#endif
759#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
760extern void rq_flush_dcache_pages(struct request *rq);
761#else
762static inline void rq_flush_dcache_pages(struct request *rq)
763{
764}
765#endif
766
752extern int blk_register_queue(struct gendisk *disk); 767extern int blk_register_queue(struct gendisk *disk);
753extern void blk_unregister_queue(struct gendisk *disk); 768extern void blk_unregister_queue(struct gendisk *disk);
754extern void register_disk(struct gendisk *dev); 769extern void register_disk(struct gendisk *dev);
@@ -823,19 +838,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
823 return bdev->bd_disk->queue; 838 return bdev->bd_disk->queue;
824} 839}
825 840
826static inline void blk_run_backing_dev(struct backing_dev_info *bdi,
827 struct page *page)
828{
829 if (bdi && bdi->unplug_io_fn)
830 bdi->unplug_io_fn(bdi, page);
831}
832
833static inline void blk_run_address_space(struct address_space *mapping)
834{
835 if (mapping)
836 blk_run_backing_dev(mapping->backing_dev_info, NULL);
837}
838
839/* 841/*
840 * blk_rq_pos() : the current sector 842 * blk_rq_pos() : the current sector
841 * blk_rq_bytes() : bytes left in the entire request 843 * blk_rq_bytes() : bytes left in the entire request
@@ -1134,6 +1136,34 @@ static inline int bdev_alignment_offset(struct block_device *bdev)
1134 return q->limits.alignment_offset; 1136 return q->limits.alignment_offset;
1135} 1137}
1136 1138
1139static inline int queue_discard_alignment(struct request_queue *q)
1140{
1141 if (q->limits.discard_misaligned)
1142 return -1;
1143
1144 return q->limits.discard_alignment;
1145}
1146
1147static inline int queue_sector_discard_alignment(struct request_queue *q,
1148 sector_t sector)
1149{
1150 return ((sector << 9) - q->limits.discard_alignment)
1151 & (q->limits.discard_granularity - 1);
1152}
1153
1154static inline unsigned int queue_discard_zeroes_data(struct request_queue *q)
1155{
1156 if (q->limits.discard_zeroes_data == 1)
1157 return 1;
1158
1159 return 0;
1160}
1161
1162static inline unsigned int bdev_discard_zeroes_data(struct block_device *bdev)
1163{
1164 return queue_discard_zeroes_data(bdev_get_queue(bdev));
1165}
1166
1137static inline int queue_dma_alignment(struct request_queue *q) 1167static inline int queue_dma_alignment(struct request_queue *q)
1138{ 1168{
1139 return q ? q->dma_alignment : 511; 1169 return q ? q->dma_alignment : 511;
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index dd97fb8408a8..b10ec49ee2dd 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -53,6 +53,7 @@ extern void free_bootmem_node(pg_data_t *pgdat,
53 unsigned long addr, 53 unsigned long addr,
54 unsigned long size); 54 unsigned long size);
55extern void free_bootmem(unsigned long addr, unsigned long size); 55extern void free_bootmem(unsigned long addr, unsigned long size);
56extern void free_bootmem_late(unsigned long addr, unsigned long size);
56 57
57/* 58/*
58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, 59 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 9b64b6d67873..2b31b91f5871 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -1,6 +1,13 @@
1#define PHY_BRCM_WIRESPEED_ENABLE 0x00000001 1#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001
2#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000002 2#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002
3#define PHY_BRCM_APD_CLK125_ENABLE 0x00000004 3#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010
4#define PHY_BRCM_STD_IBND_DISABLE 0x00000008 4#define PHY_BCM_FLAGS_INTF_XAUI 0x00000020
5#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00000010 5#define PHY_BRCM_WIRESPEED_ENABLE 0x00000100
6#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00000020 6#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000200
7#define PHY_BRCM_RX_REFCLK_UNUSED 0x00000400
8#define PHY_BRCM_STD_IBND_DISABLE 0x00000800
9#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00001000
10#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000
11#define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000
12#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000
13#define PHY_BCM_FLAGS_VALID 0x80000000
diff --git a/include/linux/can/core.h b/include/linux/can/core.h
index 25085cbadcfc..6c507bea275f 100644
--- a/include/linux/can/core.h
+++ b/include/linux/can/core.h
@@ -32,14 +32,12 @@
32 * struct can_proto - CAN protocol structure 32 * struct can_proto - CAN protocol structure
33 * @type: type argument in socket() syscall, e.g. SOCK_DGRAM. 33 * @type: type argument in socket() syscall, e.g. SOCK_DGRAM.
34 * @protocol: protocol number in socket() syscall. 34 * @protocol: protocol number in socket() syscall.
35 * @capability: capability needed to open the socket, or -1 for no restriction.
36 * @ops: pointer to struct proto_ops for sock->ops. 35 * @ops: pointer to struct proto_ops for sock->ops.
37 * @prot: pointer to struct proto structure. 36 * @prot: pointer to struct proto structure.
38 */ 37 */
39struct can_proto { 38struct can_proto {
40 int type; 39 int type;
41 int protocol; 40 int protocol;
42 int capability;
43 struct proto_ops *ops; 41 struct proto_ops *ops;
44 struct proto *prot; 42 struct proto *prot;
45}; 43};
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 5824b20b5fcb..1ed2a5cc03f5 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -29,8 +29,6 @@ enum can_mode {
29/* 29/*
30 * CAN common private data 30 * CAN common private data
31 */ 31 */
32#define CAN_ECHO_SKB_MAX 4
33
34struct can_priv { 32struct can_priv {
35 struct can_device_stats can_stats; 33 struct can_device_stats can_stats;
36 34
@@ -44,15 +42,16 @@ struct can_priv {
44 int restart_ms; 42 int restart_ms;
45 struct timer_list restart_timer; 43 struct timer_list restart_timer;
46 44
47 struct sk_buff *echo_skb[CAN_ECHO_SKB_MAX];
48
49 int (*do_set_bittiming)(struct net_device *dev); 45 int (*do_set_bittiming)(struct net_device *dev);
50 int (*do_set_mode)(struct net_device *dev, enum can_mode mode); 46 int (*do_set_mode)(struct net_device *dev, enum can_mode mode);
51 int (*do_get_state)(const struct net_device *dev, 47 int (*do_get_state)(const struct net_device *dev,
52 enum can_state *state); 48 enum can_state *state);
49
50 unsigned int echo_skb_max;
51 struct sk_buff **echo_skb;
53}; 52};
54 53
55struct net_device *alloc_candev(int sizeof_priv); 54struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
56void free_candev(struct net_device *dev); 55void free_candev(struct net_device *dev);
57 56
58int open_candev(struct net_device *dev); 57int open_candev(struct net_device *dev);
@@ -64,8 +63,13 @@ void unregister_candev(struct net_device *dev);
64int can_restart_now(struct net_device *dev); 63int can_restart_now(struct net_device *dev);
65void can_bus_off(struct net_device *dev); 64void can_bus_off(struct net_device *dev);
66 65
67void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); 66void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
68void can_get_echo_skb(struct net_device *dev, int idx); 67 unsigned int idx);
69void can_free_echo_skb(struct net_device *dev, int idx); 68void can_get_echo_skb(struct net_device *dev, unsigned int idx);
69void can_free_echo_skb(struct net_device *dev, unsigned int idx);
70
71struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf);
72struct sk_buff *alloc_can_err_skb(struct net_device *dev,
73 struct can_frame **cf);
70 74
71#endif /* CAN_DEV_H */ 75#endif /* CAN_DEV_H */
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h
new file mode 100644
index 000000000000..1448177d86d5
--- /dev/null
+++ b/include/linux/can/platform/mcp251x.h
@@ -0,0 +1,36 @@
1#ifndef __CAN_PLATFORM_MCP251X_H__
2#define __CAN_PLATFORM_MCP251X_H__
3
4/*
5 *
6 * CAN bus driver for Microchip 251x CAN Controller with SPI Interface
7 *
8 */
9
10#include <linux/spi/spi.h>
11
12/**
13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data
14 * @oscillator_frequency: - oscillator frequency in Hz
15 * @model: - actual type of chip
16 * @board_specific_setup: - called before probing the chip (power,reset)
17 * @transceiver_enable: - called to power on/off the transceiver
18 * @power_enable: - called to power on/off the mcp *and* the
19 * transceiver
20 *
21 * Please note that you should define power_enable or transceiver_enable or
22 * none of them. Defining both of them is no use.
23 *
24 */
25
26struct mcp251x_platform_data {
27 unsigned long oscillator_frequency;
28 int model;
29#define CAN_MCP251X_MCP2510 0
30#define CAN_MCP251X_MCP2515 1
31 int (*board_specific_setup)(struct spi_device *spi);
32 int (*transceiver_enable)(int enable);
33 int (*power_enable) (int enable);
34};
35
36#endif /* __CAN_PLATFORM_MCP251X_H__ */
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h
new file mode 100644
index 000000000000..4688c7bb1bd1
--- /dev/null
+++ b/include/linux/can/platform/ti_hecc.h
@@ -0,0 +1,40 @@
1/*
2 * TI HECC (High End CAN Controller) driver platform header
3 *
4 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed as is WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17/**
18 * struct hecc_platform_data - HECC Platform Data
19 *
20 * @scc_hecc_offset: mostly 0 - should really never change
21 * @scc_ram_offset: SCC RAM offset
22 * @hecc_ram_offset: HECC RAM offset
23 * @mbx_offset: Mailbox RAM offset
24 * @int_line: Interrupt line to use - 0 or 1
25 * @version: version for future use
26 *
27 * Platform data structure to get all platform specific settings.
28 * this structure also accounts the fact that the IP may have different
29 * RAM and mailbox offsets for different SOC's
30 */
31struct ti_hecc_platform_data {
32 u32 scc_hecc_offset;
33 u32 scc_ram_offset;
34 u32 hecc_ram_offset;
35 u32 mbx_offset;
36 u32 int_line;
37 u32 version;
38};
39
40
diff --git a/include/linux/capability.h b/include/linux/capability.h
index c8f2a5f70ed5..39e5ff512fbe 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -92,9 +92,7 @@ struct vfs_cap_data {
92#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 92#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
93#define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3 93#define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3
94 94
95#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
96extern int file_caps_enabled; 95extern int file_caps_enabled;
97#endif
98 96
99typedef struct kernel_cap_struct { 97typedef struct kernel_cap_struct {
100 __u32 cap[_KERNEL_CAPABILITY_U32S]; 98 __u32 cap[_KERNEL_CAPABILITY_U32S];
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index cb57c30081a8..eb130b4d8e72 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -39,7 +39,7 @@ typedef __u32 DriverVer_type;
39#ifndef CCISS_CMD_H 39#ifndef CCISS_CMD_H
40// This defines are duplicated in cciss_cmd.h in the driver directory 40// This defines are duplicated in cciss_cmd.h in the driver directory
41 41
42//general boundary defintions 42//general boundary definitions
43#define SENSEINFOBYTES 32//note that this value may vary between host implementations 43#define SENSEINFOBYTES 32//note that this value may vary between host implementations
44 44
45//Command Status value 45//Command Status value
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index 9c8d31bacf46..ccefff02b6cb 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -60,3 +60,9 @@ SUBSYS(net_cls)
60#endif 60#endif
61 61
62/* */ 62/* */
63
64#ifdef CONFIG_BLK_CGROUP
65SUBSYS(blkio)
66#endif
67
68/* */
diff --git a/include/linux/chio.h b/include/linux/chio.h
index 519248d8b2b6..d9bac7f97282 100644
--- a/include/linux/chio.h
+++ b/include/linux/chio.h
@@ -21,7 +21,7 @@
21 * query vendor-specific element types 21 * query vendor-specific element types
22 * 22 *
23 * accessing elements works by specifing type and unit of the element. 23 * accessing elements works by specifing type and unit of the element.
24 * for eample, storage elements are addressed with type = CHET_ST and 24 * for example, storage elements are addressed with type = CHET_ST and
25 * unit = 0 .. cp_nslots-1 25 * unit = 0 .. cp_nslots-1
26 * 26 *
27 */ 27 */
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 3a1dbba4d3ae..0cf725bdd2a1 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -77,10 +77,10 @@ enum clock_event_nofitiers {
77struct clock_event_device { 77struct clock_event_device {
78 const char *name; 78 const char *name;
79 unsigned int features; 79 unsigned int features;
80 unsigned long max_delta_ns; 80 u64 max_delta_ns;
81 unsigned long min_delta_ns; 81 u64 min_delta_ns;
82 unsigned long mult; 82 u32 mult;
83 int shift; 83 u32 shift;
84 int rating; 84 int rating;
85 int irq; 85 int irq;
86 const struct cpumask *cpumask; 86 const struct cpumask *cpumask;
@@ -116,8 +116,8 @@ static inline unsigned long div_sc(unsigned long ticks, unsigned long nsec,
116} 116}
117 117
118/* Clock event layer functions */ 118/* Clock event layer functions */
119extern unsigned long clockevent_delta2ns(unsigned long latch, 119extern u64 clockevent_delta2ns(unsigned long latch,
120 struct clock_event_device *evt); 120 struct clock_event_device *evt);
121extern void clockevents_register_device(struct clock_event_device *dev); 121extern void clockevents_register_device(struct clock_event_device *dev);
122 122
123extern void clockevents_exchange_device(struct clock_event_device *old, 123extern void clockevents_exchange_device(struct clock_event_device *old,
@@ -130,6 +130,13 @@ extern int clockevents_program_event(struct clock_event_device *dev,
130 130
131extern void clockevents_handle_noop(struct clock_event_device *dev); 131extern void clockevents_handle_noop(struct clock_event_device *dev);
132 132
133static inline void
134clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec)
135{
136 return clocks_calc_mult_shift(&ce->mult, &ce->shift, NSEC_PER_SEC,
137 freq, minsec);
138}
139
133#ifdef CONFIG_GENERIC_CLOCKEVENTS 140#ifdef CONFIG_GENERIC_CLOCKEVENTS
134extern void clockevents_notify(unsigned long reason, void *arg); 141extern void clockevents_notify(unsigned long reason, void *arg);
135#else 142#else
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 83d2fbd81b93..8a4a130cc196 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -151,6 +151,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
151 * subtraction of non 64 bit counters 151 * subtraction of non 64 bit counters
152 * @mult: cycle to nanosecond multiplier 152 * @mult: cycle to nanosecond multiplier
153 * @shift: cycle to nanosecond divisor (power of two) 153 * @shift: cycle to nanosecond divisor (power of two)
154 * @max_idle_ns: max idle time permitted by the clocksource (nsecs)
154 * @flags: flags describing special properties 155 * @flags: flags describing special properties
155 * @vread: vsyscall based read 156 * @vread: vsyscall based read
156 * @resume: resume function for the clocksource, if necessary 157 * @resume: resume function for the clocksource, if necessary
@@ -168,6 +169,7 @@ struct clocksource {
168 cycle_t mask; 169 cycle_t mask;
169 u32 mult; 170 u32 mult;
170 u32 shift; 171 u32 shift;
172 u64 max_idle_ns;
171 unsigned long flags; 173 unsigned long flags;
172 cycle_t (*vread)(void); 174 cycle_t (*vread)(void);
173 void (*resume)(void); 175 void (*resume)(void);
@@ -279,11 +281,23 @@ extern void clocksource_resume(void);
279extern struct clocksource * __init __weak clocksource_default_clock(void); 281extern struct clocksource * __init __weak clocksource_default_clock(void);
280extern void clocksource_mark_unstable(struct clocksource *cs); 282extern void clocksource_mark_unstable(struct clocksource *cs);
281 283
284extern void
285clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
286
287static inline void
288clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec)
289{
290 return clocks_calc_mult_shift(&cs->mult, &cs->shift, freq,
291 NSEC_PER_SEC, minsec);
292}
293
282#ifdef CONFIG_GENERIC_TIME_VSYSCALL 294#ifdef CONFIG_GENERIC_TIME_VSYSCALL
283extern void update_vsyscall(struct timespec *ts, struct clocksource *c); 295extern void
296update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult);
284extern void update_vsyscall_tz(void); 297extern void update_vsyscall_tz(void);
285#else 298#else
286static inline void update_vsyscall(struct timespec *ts, struct clocksource *c) 299static inline void
300update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult)
287{ 301{
288} 302}
289 303
diff --git a/include/linux/compat.h b/include/linux/compat.h
index af931ee43dd8..ef68119a4fd2 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -10,6 +10,8 @@
10#include <linux/stat.h> 10#include <linux/stat.h>
11#include <linux/param.h> /* for HZ */ 11#include <linux/param.h> /* for HZ */
12#include <linux/sem.h> 12#include <linux/sem.h>
13#include <linux/socket.h>
14#include <linux/if.h>
13 15
14#include <asm/compat.h> 16#include <asm/compat.h>
15#include <asm/siginfo.h> 17#include <asm/siginfo.h>
@@ -154,6 +156,48 @@ typedef struct compat_sigevent {
154 } _sigev_un; 156 } _sigev_un;
155} compat_sigevent_t; 157} compat_sigevent_t;
156 158
159struct compat_ifmap {
160 compat_ulong_t mem_start;
161 compat_ulong_t mem_end;
162 unsigned short base_addr;
163 unsigned char irq;
164 unsigned char dma;
165 unsigned char port;
166};
167
168struct compat_if_settings
169{
170 unsigned int type; /* Type of physical device or protocol */
171 unsigned int size; /* Size of the data allocated by the caller */
172 compat_uptr_t ifs_ifsu; /* union of pointers */
173};
174
175struct compat_ifreq {
176 union {
177 char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
178 } ifr_ifrn;
179 union {
180 struct sockaddr ifru_addr;
181 struct sockaddr ifru_dstaddr;
182 struct sockaddr ifru_broadaddr;
183 struct sockaddr ifru_netmask;
184 struct sockaddr ifru_hwaddr;
185 short ifru_flags;
186 compat_int_t ifru_ivalue;
187 compat_int_t ifru_mtu;
188 struct compat_ifmap ifru_map;
189 char ifru_slave[IFNAMSIZ]; /* Just fits the size */
190 char ifru_newname[IFNAMSIZ];
191 compat_caddr_t ifru_data;
192 struct compat_if_settings ifru_settings;
193 } ifr_ifru;
194};
195
196struct compat_ifconf {
197 compat_int_t ifc_len; /* size of buffer */
198 compat_caddr_t ifcbuf;
199};
200
157struct compat_robust_list { 201struct compat_robust_list {
158 compat_uptr_t next; 202 compat_uptr_t next;
159}; 203};
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index a3ed7cb8ca34..73dcf804bc94 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -79,6 +79,7 @@
79#define noinline __attribute__((noinline)) 79#define noinline __attribute__((noinline))
80#define __attribute_const__ __attribute__((__const__)) 80#define __attribute_const__ __attribute__((__const__))
81#define __maybe_unused __attribute__((unused)) 81#define __maybe_unused __attribute__((unused))
82#define __always_unused __attribute__((unused))
82 83
83#define __gcc_header(x) #x 84#define __gcc_header(x) #x
84#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) 85#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 450fa597c94d..94dea3ffbfa1 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -36,4 +36,26 @@
36 the kernel context */ 36 the kernel context */
37#define __cold __attribute__((__cold__)) 37#define __cold __attribute__((__cold__))
38 38
39
40#if __GNUC_MINOR__ >= 5
41/*
42 * Mark a position in code as unreachable. This can be used to
43 * suppress control flow warnings after asm blocks that transfer
44 * control elsewhere.
45 *
46 * Early snapshots of gcc 4.5 don't support this and we can't detect
47 * this in the preprocessor, but we can live with this because they're
48 * unreleased. Really, we need to have autoconf for the kernel.
49 */
50#define unreachable() __builtin_unreachable()
51#endif
52
53#endif
54
55#if __GNUC_MINOR__ > 0
56#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
57#endif
58#if __GNUC_MINOR__ >= 4
59#define __compiletime_warning(message) __attribute__((warning(message)))
60#define __compiletime_error(message) __attribute__((error(message)))
39#endif 61#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 04fb5135b4e1..5be3dab4a695 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -144,6 +144,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
144# define barrier() __memory_barrier() 144# define barrier() __memory_barrier()
145#endif 145#endif
146 146
147/* Unreachable code */
148#ifndef unreachable
149# define unreachable() do { } while (1)
150#endif
151
147#ifndef RELOC_HIDE 152#ifndef RELOC_HIDE
148# define RELOC_HIDE(ptr, off) \ 153# define RELOC_HIDE(ptr, off) \
149 ({ unsigned long __ptr; \ 154 ({ unsigned long __ptr; \
@@ -213,6 +218,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
213# define __maybe_unused /* unimplemented */ 218# define __maybe_unused /* unimplemented */
214#endif 219#endif
215 220
221#ifndef __always_unused
222# define __always_unused /* unimplemented */
223#endif
224
216#ifndef noinline 225#ifndef noinline
217#define noinline 226#define noinline
218#endif 227#endif
@@ -266,6 +275,17 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
266# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) 275# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
267#endif 276#endif
268 277
278/* Compile time object size, -1 for unknown */
279#ifndef __compiletime_object_size
280# define __compiletime_object_size(obj) -1
281#endif
282#ifndef __compiletime_warning
283# define __compiletime_warning(message)
284#endif
285#ifndef __compiletime_error
286# define __compiletime_error(message)
287#endif
288
269/* 289/*
270 * Prevent the compiler from merging or refetching accesses. The compiler 290 * Prevent the compiler from merging or refetching accesses. The compiler
271 * is also forbidden from reordering successive instances of ACCESS_ONCE(), 291 * is also forbidden from reordering successive instances of ACCESS_ONCE(),
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 3a14615fd35c..72ba63eb83c5 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -43,6 +43,8 @@
43#define CN_DST_VAL 0x1 43#define CN_DST_VAL 0x1
44#define CN_IDX_DM 0x7 /* Device Mapper */ 44#define CN_IDX_DM 0x7 /* Device Mapper */
45#define CN_VAL_DM_USERSPACE_LOG 0x1 45#define CN_VAL_DM_USERSPACE_LOG 0x1
46#define CN_IDX_DRBD 0x8
47#define CN_VAL_DRBD 0x1
46 48
47#define CN_NETLINK_USERS 8 49#define CN_NETLINK_USERS 8
48 50
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 47536197ffdd..e287863ac053 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -43,6 +43,8 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
43 43
44#ifdef CONFIG_HOTPLUG_CPU 44#ifdef CONFIG_HOTPLUG_CPU
45extern void unregister_cpu(struct cpu *cpu); 45extern void unregister_cpu(struct cpu *cpu);
46extern ssize_t arch_cpu_probe(const char *, size_t);
47extern ssize_t arch_cpu_release(const char *, size_t);
46#endif 48#endif
47struct notifier_block; 49struct notifier_block;
48 50
@@ -115,6 +117,19 @@ extern void put_online_cpus(void);
115#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) 117#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb)
116int cpu_down(unsigned int cpu); 118int cpu_down(unsigned int cpu);
117 119
120#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
121extern void cpu_hotplug_driver_lock(void);
122extern void cpu_hotplug_driver_unlock(void);
123#else
124static inline void cpu_hotplug_driver_lock(void)
125{
126}
127
128static inline void cpu_hotplug_driver_unlock(void)
129{
130}
131#endif
132
118#else /* CONFIG_HOTPLUG_CPU */ 133#else /* CONFIG_HOTPLUG_CPU */
119 134
120#define get_online_cpus() do { } while (0) 135#define get_online_cpus() do { } while (0)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 79a2340d83cd..4de02b10007f 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -232,6 +232,7 @@ struct cpufreq_driver {
232 /* optional */ 232 /* optional */
233 unsigned int (*getavg) (struct cpufreq_policy *policy, 233 unsigned int (*getavg) (struct cpufreq_policy *policy,
234 unsigned int cpu); 234 unsigned int cpu);
235 int (*bios_limit) (int cpu, unsigned int *limit);
235 236
236 int (*exit) (struct cpufreq_policy *policy); 237 int (*exit) (struct cpufreq_policy *policy);
237 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); 238 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg);
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 789cf5f920ce..d77b54733c5b 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -84,6 +84,7 @@ extern const struct cpumask *const cpu_active_mask;
84#define num_online_cpus() cpumask_weight(cpu_online_mask) 84#define num_online_cpus() cpumask_weight(cpu_online_mask)
85#define num_possible_cpus() cpumask_weight(cpu_possible_mask) 85#define num_possible_cpus() cpumask_weight(cpu_possible_mask)
86#define num_present_cpus() cpumask_weight(cpu_present_mask) 86#define num_present_cpus() cpumask_weight(cpu_present_mask)
87#define num_active_cpus() cpumask_weight(cpu_active_mask)
87#define cpu_online(cpu) cpumask_test_cpu((cpu), cpu_online_mask) 88#define cpu_online(cpu) cpumask_test_cpu((cpu), cpu_online_mask)
88#define cpu_possible(cpu) cpumask_test_cpu((cpu), cpu_possible_mask) 89#define cpu_possible(cpu) cpumask_test_cpu((cpu), cpu_possible_mask)
89#define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask) 90#define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask)
@@ -92,6 +93,7 @@ extern const struct cpumask *const cpu_active_mask;
92#define num_online_cpus() 1 93#define num_online_cpus() 1
93#define num_possible_cpus() 1 94#define num_possible_cpus() 1
94#define num_present_cpus() 1 95#define num_present_cpus() 1
96#define num_active_cpus() 1
95#define cpu_online(cpu) ((cpu) == 0) 97#define cpu_online(cpu) ((cpu) == 0)
96#define cpu_possible(cpu) ((cpu) == 0) 98#define cpu_possible(cpu) ((cpu) == 0)
97#define cpu_present(cpu) ((cpu) == 0) 99#define cpu_present(cpu) ((cpu) == 0)
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index fd929889e8dc..24d2e30f1b46 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -250,29 +250,6 @@ struct cipher_alg {
250 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 250 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
251}; 251};
252 252
253struct digest_alg {
254 unsigned int dia_digestsize;
255 void (*dia_init)(struct crypto_tfm *tfm);
256 void (*dia_update)(struct crypto_tfm *tfm, const u8 *data,
257 unsigned int len);
258 void (*dia_final)(struct crypto_tfm *tfm, u8 *out);
259 int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key,
260 unsigned int keylen);
261};
262
263struct hash_alg {
264 int (*init)(struct hash_desc *desc);
265 int (*update)(struct hash_desc *desc, struct scatterlist *sg,
266 unsigned int nbytes);
267 int (*final)(struct hash_desc *desc, u8 *out);
268 int (*digest)(struct hash_desc *desc, struct scatterlist *sg,
269 unsigned int nbytes, u8 *out);
270 int (*setkey)(struct crypto_hash *tfm, const u8 *key,
271 unsigned int keylen);
272
273 unsigned int digestsize;
274};
275
276struct compress_alg { 253struct compress_alg {
277 int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src, 254 int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src,
278 unsigned int slen, u8 *dst, unsigned int *dlen); 255 unsigned int slen, u8 *dst, unsigned int *dlen);
@@ -293,8 +270,6 @@ struct rng_alg {
293#define cra_aead cra_u.aead 270#define cra_aead cra_u.aead
294#define cra_blkcipher cra_u.blkcipher 271#define cra_blkcipher cra_u.blkcipher
295#define cra_cipher cra_u.cipher 272#define cra_cipher cra_u.cipher
296#define cra_digest cra_u.digest
297#define cra_hash cra_u.hash
298#define cra_compress cra_u.compress 273#define cra_compress cra_u.compress
299#define cra_rng cra_u.rng 274#define cra_rng cra_u.rng
300 275
@@ -320,8 +295,6 @@ struct crypto_alg {
320 struct aead_alg aead; 295 struct aead_alg aead;
321 struct blkcipher_alg blkcipher; 296 struct blkcipher_alg blkcipher;
322 struct cipher_alg cipher; 297 struct cipher_alg cipher;
323 struct digest_alg digest;
324 struct hash_alg hash;
325 struct compress_alg compress; 298 struct compress_alg compress;
326 struct rng_alg rng; 299 struct rng_alg rng;
327 } cra_u; 300 } cra_u;
diff --git a/include/linux/cryptohash.h b/include/linux/cryptohash.h
index c118b2ad9807..ec78a4bbe1d5 100644
--- a/include/linux/cryptohash.h
+++ b/include/linux/cryptohash.h
@@ -2,6 +2,7 @@
2#define __CRYPTOHASH_H 2#define __CRYPTOHASH_H
3 3
4#define SHA_DIGEST_WORDS 5 4#define SHA_DIGEST_WORDS 5
5#define SHA_MESSAGE_BYTES (512 /*bits*/ / 8)
5#define SHA_WORKSPACE_WORDS 80 6#define SHA_WORKSPACE_WORDS 80
6 7
7void sha_init(__u32 *buf); 8void sha_init(__u32 *buf);
diff --git a/include/linux/device.h b/include/linux/device.h
index 2ea3e4921812..2a73d9bcbc9c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -558,7 +558,7 @@ extern void wait_for_device_probe(void);
558#ifdef CONFIG_DEVTMPFS 558#ifdef CONFIG_DEVTMPFS
559extern int devtmpfs_create_node(struct device *dev); 559extern int devtmpfs_create_node(struct device *dev);
560extern int devtmpfs_delete_node(struct device *dev); 560extern int devtmpfs_delete_node(struct device *dev);
561extern int devtmpfs_mount(const char *mountpoint); 561extern int devtmpfs_mount(const char *mntdir);
562#else 562#else
563static inline int devtmpfs_create_node(struct device *dev) { return 0; } 563static inline int devtmpfs_create_node(struct device *dev) { return 0; }
564static inline int devtmpfs_delete_node(struct device *dev) { return 0; } 564static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h
index 8a1f972c0fe9..0c3c3a2110c4 100644
--- a/include/linux/dm-log-userspace.h
+++ b/include/linux/dm-log-userspace.h
@@ -363,7 +363,7 @@
363 * various request types above. The remaining 24-bits are currently 363 * various request types above. The remaining 24-bits are currently
364 * set to zero and are reserved for future use and compatibility concerns. 364 * set to zero and are reserved for future use and compatibility concerns.
365 * 365 *
366 * User-space should always use DM_ULOG_REQUEST_TYPE to aquire the 366 * User-space should always use DM_ULOG_REQUEST_TYPE to acquire the
367 * request type from the 'request_type' field to maintain forward compatibility. 367 * request type from the 'request_type' field to maintain forward compatibility.
368 */ 368 */
369#define DM_ULOG_REQUEST_MASK 0xFF 369#define DM_ULOG_REQUEST_MASK 0xFF
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 4a2b162c256a..d7cecc90ed34 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -126,7 +126,9 @@ extern int free_irte(int irq);
126extern int irq_remapped(int irq); 126extern int irq_remapped(int irq);
127extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); 127extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev);
128extern struct intel_iommu *map_ioapic_to_ir(int apic); 128extern struct intel_iommu *map_ioapic_to_ir(int apic);
129extern struct intel_iommu *map_hpet_to_ir(u8 id);
129extern int set_ioapic_sid(struct irte *irte, int apic); 130extern int set_ioapic_sid(struct irte *irte, int apic);
131extern int set_hpet_sid(struct irte *irte, u8 id);
130extern int set_msi_sid(struct irte *irte, struct pci_dev *dev); 132extern int set_msi_sid(struct irte *irte, struct pci_dev *dev);
131#else 133#else
132static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) 134static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
@@ -158,10 +160,18 @@ static inline struct intel_iommu *map_ioapic_to_ir(int apic)
158{ 160{
159 return NULL; 161 return NULL;
160} 162}
163static inline struct intel_iommu *map_hpet_to_ir(unsigned int hpet_id)
164{
165 return NULL;
166}
161static inline int set_ioapic_sid(struct irte *irte, int apic) 167static inline int set_ioapic_sid(struct irte *irte, int apic)
162{ 168{
163 return 0; 169 return 0;
164} 170}
171static inline int set_hpet_sid(struct irte *irte, u8 id)
172{
173 return -1;
174}
165static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev) 175static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)
166{ 176{
167 return 0; 177 return 0;
@@ -208,16 +218,9 @@ struct dmar_atsr_unit {
208 u8 include_all:1; /* include all ports */ 218 u8 include_all:1; /* include all ports */
209}; 219};
210 220
211/* Intel DMAR initialization functions */
212extern int intel_iommu_init(void); 221extern int intel_iommu_init(void);
213#else 222#else /* !CONFIG_DMAR: */
214static inline int intel_iommu_init(void) 223static inline int intel_iommu_init(void) { return -ENODEV; }
215{ 224#endif /* CONFIG_DMAR */
216#ifdef CONFIG_INTR_REMAP 225
217 return dmar_dev_scope_init();
218#else
219 return -ENODEV;
220#endif
221}
222#endif /* !CONFIG_DMAR */
223#endif /* __DMAR_H__ */ 226#endif /* __DMAR_H__ */
diff --git a/include/linux/dn.h b/include/linux/dn.h
index fe9990823193..9c50445462d9 100644
--- a/include/linux/dn.h
+++ b/include/linux/dn.h
@@ -71,14 +71,12 @@
71/* Structures */ 71/* Structures */
72 72
73 73
74struct dn_naddr 74struct dn_naddr {
75{
76 __le16 a_len; 75 __le16 a_len;
77 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */ 76 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
78}; 77};
79 78
80struct sockaddr_dn 79struct sockaddr_dn {
81{
82 __u16 sdn_family; 80 __u16 sdn_family;
83 __u8 sdn_flags; 81 __u8 sdn_flags;
84 __u8 sdn_objnum; 82 __u8 sdn_objnum;
@@ -101,8 +99,7 @@ struct optdata_dn {
101 __u8 opt_data[16]; /* User data */ 99 __u8 opt_data[16]; /* User data */
102}; 100};
103 101
104struct accessdata_dn 102struct accessdata_dn {
105{
106 __u8 acc_accl; 103 __u8 acc_accl;
107 __u8 acc_acc[DN_MAXACCL]; 104 __u8 acc_acc[DN_MAXACCL];
108 __u8 acc_passl; 105 __u8 acc_passl;
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
new file mode 100644
index 000000000000..e84f4733cb55
--- /dev/null
+++ b/include/linux/drbd.h
@@ -0,0 +1,343 @@
1/*
2 drbd.h
3 Kernel module for 2.6.x Kernels
4
5 This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
6
7 Copyright (C) 2001-2008, LINBIT Information Technologies GmbH.
8 Copyright (C) 2001-2008, Philipp Reisner <philipp.reisner@linbit.com>.
9 Copyright (C) 2001-2008, Lars Ellenberg <lars.ellenberg@linbit.com>.
10
11 drbd is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
14 any later version.
15
16 drbd is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with drbd; see the file COPYING. If not, write to
23 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24
25*/
26#ifndef DRBD_H
27#define DRBD_H
28#include <linux/connector.h>
29#include <asm/types.h>
30
31#ifdef __KERNEL__
32#include <linux/types.h>
33#include <asm/byteorder.h>
34#else
35#include <sys/types.h>
36#include <sys/wait.h>
37#include <limits.h>
38
39/* Altough the Linux source code makes a difference between
40 generic endianness and the bitfields' endianness, there is no
41 architecture as of Linux-2.6.24-rc4 where the bitfileds' endianness
42 does not match the generic endianness. */
43
44#if __BYTE_ORDER == __LITTLE_ENDIAN
45#define __LITTLE_ENDIAN_BITFIELD
46#elif __BYTE_ORDER == __BIG_ENDIAN
47#define __BIG_ENDIAN_BITFIELD
48#else
49# error "sorry, weird endianness on this box"
50#endif
51
52#endif
53
54
55extern const char *drbd_buildtag(void);
56#define REL_VERSION "8.3.6"
57#define API_VERSION 88
58#define PRO_VERSION_MIN 86
59#define PRO_VERSION_MAX 91
60
61
62enum drbd_io_error_p {
63 EP_PASS_ON, /* FIXME should the better be named "Ignore"? */
64 EP_CALL_HELPER,
65 EP_DETACH
66};
67
68enum drbd_fencing_p {
69 FP_DONT_CARE,
70 FP_RESOURCE,
71 FP_STONITH
72};
73
74enum drbd_disconnect_p {
75 DP_RECONNECT,
76 DP_DROP_NET_CONF,
77 DP_FREEZE_IO
78};
79
80enum drbd_after_sb_p {
81 ASB_DISCONNECT,
82 ASB_DISCARD_YOUNGER_PRI,
83 ASB_DISCARD_OLDER_PRI,
84 ASB_DISCARD_ZERO_CHG,
85 ASB_DISCARD_LEAST_CHG,
86 ASB_DISCARD_LOCAL,
87 ASB_DISCARD_REMOTE,
88 ASB_CONSENSUS,
89 ASB_DISCARD_SECONDARY,
90 ASB_CALL_HELPER,
91 ASB_VIOLENTLY
92};
93
94/* KEEP the order, do not delete or insert. Only append. */
95enum drbd_ret_codes {
96 ERR_CODE_BASE = 100,
97 NO_ERROR = 101,
98 ERR_LOCAL_ADDR = 102,
99 ERR_PEER_ADDR = 103,
100 ERR_OPEN_DISK = 104,
101 ERR_OPEN_MD_DISK = 105,
102 ERR_DISK_NOT_BDEV = 107,
103 ERR_MD_NOT_BDEV = 108,
104 ERR_DISK_TO_SMALL = 111,
105 ERR_MD_DISK_TO_SMALL = 112,
106 ERR_BDCLAIM_DISK = 114,
107 ERR_BDCLAIM_MD_DISK = 115,
108 ERR_MD_IDX_INVALID = 116,
109 ERR_IO_MD_DISK = 118,
110 ERR_MD_INVALID = 119,
111 ERR_AUTH_ALG = 120,
112 ERR_AUTH_ALG_ND = 121,
113 ERR_NOMEM = 122,
114 ERR_DISCARD = 123,
115 ERR_DISK_CONFIGURED = 124,
116 ERR_NET_CONFIGURED = 125,
117 ERR_MANDATORY_TAG = 126,
118 ERR_MINOR_INVALID = 127,
119 ERR_INTR = 129, /* EINTR */
120 ERR_RESIZE_RESYNC = 130,
121 ERR_NO_PRIMARY = 131,
122 ERR_SYNC_AFTER = 132,
123 ERR_SYNC_AFTER_CYCLE = 133,
124 ERR_PAUSE_IS_SET = 134,
125 ERR_PAUSE_IS_CLEAR = 135,
126 ERR_PACKET_NR = 137,
127 ERR_NO_DISK = 138,
128 ERR_NOT_PROTO_C = 139,
129 ERR_NOMEM_BITMAP = 140,
130 ERR_INTEGRITY_ALG = 141, /* DRBD 8.2 only */
131 ERR_INTEGRITY_ALG_ND = 142, /* DRBD 8.2 only */
132 ERR_CPU_MASK_PARSE = 143, /* DRBD 8.2 only */
133 ERR_CSUMS_ALG = 144, /* DRBD 8.2 only */
134 ERR_CSUMS_ALG_ND = 145, /* DRBD 8.2 only */
135 ERR_VERIFY_ALG = 146, /* DRBD 8.2 only */
136 ERR_VERIFY_ALG_ND = 147, /* DRBD 8.2 only */
137 ERR_CSUMS_RESYNC_RUNNING= 148, /* DRBD 8.2 only */
138 ERR_VERIFY_RUNNING = 149, /* DRBD 8.2 only */
139 ERR_DATA_NOT_CURRENT = 150,
140 ERR_CONNECTED = 151, /* DRBD 8.3 only */
141 ERR_PERM = 152,
142
143 /* insert new ones above this line */
144 AFTER_LAST_ERR_CODE
145};
146
147#define DRBD_PROT_A 1
148#define DRBD_PROT_B 2
149#define DRBD_PROT_C 3
150
151enum drbd_role {
152 R_UNKNOWN = 0,
153 R_PRIMARY = 1, /* role */
154 R_SECONDARY = 2, /* role */
155 R_MASK = 3,
156};
157
158/* The order of these constants is important.
159 * The lower ones (<C_WF_REPORT_PARAMS) indicate
160 * that there is no socket!
161 * >=C_WF_REPORT_PARAMS ==> There is a socket
162 */
163enum drbd_conns {
164 C_STANDALONE,
165 C_DISCONNECTING, /* Temporal state on the way to StandAlone. */
166 C_UNCONNECTED, /* >= C_UNCONNECTED -> inc_net() succeeds */
167
168 /* These temporal states are all used on the way
169 * from >= C_CONNECTED to Unconnected.
170 * The 'disconnect reason' states
171 * I do not allow to change beween them. */
172 C_TIMEOUT,
173 C_BROKEN_PIPE,
174 C_NETWORK_FAILURE,
175 C_PROTOCOL_ERROR,
176 C_TEAR_DOWN,
177
178 C_WF_CONNECTION,
179 C_WF_REPORT_PARAMS, /* we have a socket */
180 C_CONNECTED, /* we have introduced each other */
181 C_STARTING_SYNC_S, /* starting full sync by admin request. */
182 C_STARTING_SYNC_T, /* stariing full sync by admin request. */
183 C_WF_BITMAP_S,
184 C_WF_BITMAP_T,
185 C_WF_SYNC_UUID,
186
187 /* All SyncStates are tested with this comparison
188 * xx >= C_SYNC_SOURCE && xx <= C_PAUSED_SYNC_T */
189 C_SYNC_SOURCE,
190 C_SYNC_TARGET,
191 C_VERIFY_S,
192 C_VERIFY_T,
193 C_PAUSED_SYNC_S,
194 C_PAUSED_SYNC_T,
195 C_MASK = 31
196};
197
198enum drbd_disk_state {
199 D_DISKLESS,
200 D_ATTACHING, /* In the process of reading the meta-data */
201 D_FAILED, /* Becomes D_DISKLESS as soon as we told it the peer */
202 /* when >= D_FAILED it is legal to access mdev->bc */
203 D_NEGOTIATING, /* Late attaching state, we need to talk to the peer */
204 D_INCONSISTENT,
205 D_OUTDATED,
206 D_UNKNOWN, /* Only used for the peer, never for myself */
207 D_CONSISTENT, /* Might be D_OUTDATED, might be D_UP_TO_DATE ... */
208 D_UP_TO_DATE, /* Only this disk state allows applications' IO ! */
209 D_MASK = 15
210};
211
212union drbd_state {
213/* According to gcc's docs is the ...
214 * The order of allocation of bit-fields within a unit (C90 6.5.2.1, C99 6.7.2.1).
215 * Determined by ABI.
216 * pointed out by Maxim Uvarov q<muvarov@ru.mvista.com>
217 * even though we transmit as "cpu_to_be32(state)",
218 * the offsets of the bitfields still need to be swapped
219 * on different endianess.
220 */
221 struct {
222#if defined(__LITTLE_ENDIAN_BITFIELD)
223 unsigned role:2 ; /* 3/4 primary/secondary/unknown */
224 unsigned peer:2 ; /* 3/4 primary/secondary/unknown */
225 unsigned conn:5 ; /* 17/32 cstates */
226 unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
227 unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
228 unsigned susp:1 ; /* 2/2 IO suspended no/yes */
229 unsigned aftr_isp:1 ; /* isp .. imposed sync pause */
230 unsigned peer_isp:1 ;
231 unsigned user_isp:1 ;
232 unsigned _pad:11; /* 0 unused */
233#elif defined(__BIG_ENDIAN_BITFIELD)
234 unsigned _pad:11; /* 0 unused */
235 unsigned user_isp:1 ;
236 unsigned peer_isp:1 ;
237 unsigned aftr_isp:1 ; /* isp .. imposed sync pause */
238 unsigned susp:1 ; /* 2/2 IO suspended no/yes */
239 unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
240 unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */
241 unsigned conn:5 ; /* 17/32 cstates */
242 unsigned peer:2 ; /* 3/4 primary/secondary/unknown */
243 unsigned role:2 ; /* 3/4 primary/secondary/unknown */
244#else
245# error "this endianess is not supported"
246#endif
247 };
248 unsigned int i;
249};
250
251enum drbd_state_ret_codes {
252 SS_CW_NO_NEED = 4,
253 SS_CW_SUCCESS = 3,
254 SS_NOTHING_TO_DO = 2,
255 SS_SUCCESS = 1,
256 SS_UNKNOWN_ERROR = 0, /* Used to sleep longer in _drbd_request_state */
257 SS_TWO_PRIMARIES = -1,
258 SS_NO_UP_TO_DATE_DISK = -2,
259 SS_NO_LOCAL_DISK = -4,
260 SS_NO_REMOTE_DISK = -5,
261 SS_CONNECTED_OUTDATES = -6,
262 SS_PRIMARY_NOP = -7,
263 SS_RESYNC_RUNNING = -8,
264 SS_ALREADY_STANDALONE = -9,
265 SS_CW_FAILED_BY_PEER = -10,
266 SS_IS_DISKLESS = -11,
267 SS_DEVICE_IN_USE = -12,
268 SS_NO_NET_CONFIG = -13,
269 SS_NO_VERIFY_ALG = -14, /* drbd-8.2 only */
270 SS_NEED_CONNECTION = -15, /* drbd-8.2 only */
271 SS_LOWER_THAN_OUTDATED = -16,
272 SS_NOT_SUPPORTED = -17, /* drbd-8.2 only */
273 SS_IN_TRANSIENT_STATE = -18, /* Retry after the next state change */
274 SS_CONCURRENT_ST_CHG = -19, /* Concurrent cluster side state change! */
275 SS_AFTER_LAST_ERROR = -20, /* Keep this at bottom */
276};
277
278/* from drbd_strings.c */
279extern const char *drbd_conn_str(enum drbd_conns);
280extern const char *drbd_role_str(enum drbd_role);
281extern const char *drbd_disk_str(enum drbd_disk_state);
282extern const char *drbd_set_st_err_str(enum drbd_state_ret_codes);
283
284#define SHARED_SECRET_MAX 64
285
286#define MDF_CONSISTENT (1 << 0)
287#define MDF_PRIMARY_IND (1 << 1)
288#define MDF_CONNECTED_IND (1 << 2)
289#define MDF_FULL_SYNC (1 << 3)
290#define MDF_WAS_UP_TO_DATE (1 << 4)
291#define MDF_PEER_OUT_DATED (1 << 5)
292#define MDF_CRASHED_PRIMARY (1 << 6)
293
294enum drbd_uuid_index {
295 UI_CURRENT,
296 UI_BITMAP,
297 UI_HISTORY_START,
298 UI_HISTORY_END,
299 UI_SIZE, /* nl-packet: number of dirty bits */
300 UI_FLAGS, /* nl-packet: flags */
301 UI_EXTENDED_SIZE /* Everything. */
302};
303
304enum drbd_timeout_flag {
305 UT_DEFAULT = 0,
306 UT_DEGRADED = 1,
307 UT_PEER_OUTDATED = 2,
308};
309
310#define UUID_JUST_CREATED ((__u64)4)
311
312#define DRBD_MAGIC 0x83740267
313#define BE_DRBD_MAGIC __constant_cpu_to_be32(DRBD_MAGIC)
314
315/* these are of type "int" */
316#define DRBD_MD_INDEX_INTERNAL -1
317#define DRBD_MD_INDEX_FLEX_EXT -2
318#define DRBD_MD_INDEX_FLEX_INT -3
319
320/* Start of the new netlink/connector stuff */
321
322#define DRBD_NL_CREATE_DEVICE 0x01
323#define DRBD_NL_SET_DEFAULTS 0x02
324
325
326/* For searching a vacant cn_idx value */
327#define CN_IDX_STEP 6977
328
329struct drbd_nl_cfg_req {
330 int packet_type;
331 unsigned int drbd_minor;
332 int flags;
333 unsigned short tag_list[];
334};
335
336struct drbd_nl_cfg_reply {
337 int packet_type;
338 unsigned int minor;
339 int ret_code; /* enum ret_code or set_st_err_t */
340 unsigned short tag_list[]; /* only used with get_* calls */
341};
342
343#endif
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h
new file mode 100644
index 000000000000..51f47a586ad8
--- /dev/null
+++ b/include/linux/drbd_limits.h
@@ -0,0 +1,137 @@
1/*
2 drbd_limits.h
3 This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
4*/
5
6/*
7 * Our current limitations.
8 * Some of them are hard limits,
9 * some of them are arbitrary range limits, that make it easier to provide
10 * feedback about nonsense settings for certain configurable values.
11 */
12
13#ifndef DRBD_LIMITS_H
14#define DRBD_LIMITS_H 1
15
16#define DEBUG_RANGE_CHECK 0
17
18#define DRBD_MINOR_COUNT_MIN 1
19#define DRBD_MINOR_COUNT_MAX 255
20
21#define DRBD_DIALOG_REFRESH_MIN 0
22#define DRBD_DIALOG_REFRESH_MAX 600
23
24/* valid port number */
25#define DRBD_PORT_MIN 1
26#define DRBD_PORT_MAX 0xffff
27
28/* startup { */
29 /* if you want more than 3.4 days, disable */
30#define DRBD_WFC_TIMEOUT_MIN 0
31#define DRBD_WFC_TIMEOUT_MAX 300000
32#define DRBD_WFC_TIMEOUT_DEF 0
33
34#define DRBD_DEGR_WFC_TIMEOUT_MIN 0
35#define DRBD_DEGR_WFC_TIMEOUT_MAX 300000
36#define DRBD_DEGR_WFC_TIMEOUT_DEF 0
37
38#define DRBD_OUTDATED_WFC_TIMEOUT_MIN 0
39#define DRBD_OUTDATED_WFC_TIMEOUT_MAX 300000
40#define DRBD_OUTDATED_WFC_TIMEOUT_DEF 0
41/* }*/
42
43/* net { */
44 /* timeout, unit centi seconds
45 * more than one minute timeout is not usefull */
46#define DRBD_TIMEOUT_MIN 1
47#define DRBD_TIMEOUT_MAX 600
48#define DRBD_TIMEOUT_DEF 60 /* 6 seconds */
49
50 /* active connection retries when C_WF_CONNECTION */
51#define DRBD_CONNECT_INT_MIN 1
52#define DRBD_CONNECT_INT_MAX 120
53#define DRBD_CONNECT_INT_DEF 10 /* seconds */
54
55 /* keep-alive probes when idle */
56#define DRBD_PING_INT_MIN 1
57#define DRBD_PING_INT_MAX 120
58#define DRBD_PING_INT_DEF 10
59
60 /* timeout for the ping packets.*/
61#define DRBD_PING_TIMEO_MIN 1
62#define DRBD_PING_TIMEO_MAX 100
63#define DRBD_PING_TIMEO_DEF 5
64
65 /* max number of write requests between write barriers */
66#define DRBD_MAX_EPOCH_SIZE_MIN 1
67#define DRBD_MAX_EPOCH_SIZE_MAX 20000
68#define DRBD_MAX_EPOCH_SIZE_DEF 2048
69
70 /* I don't think that a tcp send buffer of more than 10M is usefull */
71#define DRBD_SNDBUF_SIZE_MIN 0
72#define DRBD_SNDBUF_SIZE_MAX (10<<20)
73#define DRBD_SNDBUF_SIZE_DEF 0
74
75#define DRBD_RCVBUF_SIZE_MIN 0
76#define DRBD_RCVBUF_SIZE_MAX (10<<20)
77#define DRBD_RCVBUF_SIZE_DEF 0
78
79 /* @4k PageSize -> 128kB - 512MB */
80#define DRBD_MAX_BUFFERS_MIN 32
81#define DRBD_MAX_BUFFERS_MAX 131072
82#define DRBD_MAX_BUFFERS_DEF 2048
83
84 /* @4k PageSize -> 4kB - 512MB */
85#define DRBD_UNPLUG_WATERMARK_MIN 1
86#define DRBD_UNPLUG_WATERMARK_MAX 131072
87#define DRBD_UNPLUG_WATERMARK_DEF (DRBD_MAX_BUFFERS_DEF/16)
88
89 /* 0 is disabled.
90 * 200 should be more than enough even for very short timeouts */
91#define DRBD_KO_COUNT_MIN 0
92#define DRBD_KO_COUNT_MAX 200
93#define DRBD_KO_COUNT_DEF 0
94/* } */
95
96/* syncer { */
97 /* FIXME allow rate to be zero? */
98#define DRBD_RATE_MIN 1
99/* channel bonding 10 GbE, or other hardware */
100#define DRBD_RATE_MAX (4 << 20)
101#define DRBD_RATE_DEF 250 /* kb/second */
102
103 /* less than 7 would hit performance unneccessarily.
104 * 3833 is the largest prime that still does fit
105 * into 64 sectors of activity log */
106#define DRBD_AL_EXTENTS_MIN 7
107#define DRBD_AL_EXTENTS_MAX 3833
108#define DRBD_AL_EXTENTS_DEF 127
109
110#define DRBD_AFTER_MIN -1
111#define DRBD_AFTER_MAX 255
112#define DRBD_AFTER_DEF -1
113
114/* } */
115
116/* drbdsetup XY resize -d Z
117 * you are free to reduce the device size to nothing, if you want to.
118 * the upper limit with 64bit kernel, enough ram and flexible meta data
119 * is 16 TB, currently. */
120/* DRBD_MAX_SECTORS */
121#define DRBD_DISK_SIZE_SECT_MIN 0
122#define DRBD_DISK_SIZE_SECT_MAX (16 * (2LLU << 30))
123#define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */
124
125#define DRBD_ON_IO_ERROR_DEF EP_PASS_ON
126#define DRBD_FENCING_DEF FP_DONT_CARE
127#define DRBD_AFTER_SB_0P_DEF ASB_DISCONNECT
128#define DRBD_AFTER_SB_1P_DEF ASB_DISCONNECT
129#define DRBD_AFTER_SB_2P_DEF ASB_DISCONNECT
130#define DRBD_RR_CONFLICT_DEF ASB_DISCONNECT
131
132#define DRBD_MAX_BIO_BVECS_MIN 0
133#define DRBD_MAX_BIO_BVECS_MAX 128
134#define DRBD_MAX_BIO_BVECS_DEF 0
135
136#undef RANGE
137#endif
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h
new file mode 100644
index 000000000000..db5721ad50d1
--- /dev/null
+++ b/include/linux/drbd_nl.h
@@ -0,0 +1,137 @@
1/*
2 PAKET( name,
3 TYPE ( pn, pr, member )
4 ...
5 )
6
7 You may never reissue one of the pn arguments
8*/
9
10#if !defined(NL_PACKET) || !defined(NL_STRING) || !defined(NL_INTEGER) || !defined(NL_BIT) || !defined(NL_INT64)
11#error "The macros NL_PACKET, NL_STRING, NL_INTEGER, NL_INT64 and NL_BIT needs to be defined"
12#endif
13
14NL_PACKET(primary, 1,
15 NL_BIT( 1, T_MAY_IGNORE, overwrite_peer)
16)
17
18NL_PACKET(secondary, 2, )
19
20NL_PACKET(disk_conf, 3,
21 NL_INT64( 2, T_MAY_IGNORE, disk_size)
22 NL_STRING( 3, T_MANDATORY, backing_dev, 128)
23 NL_STRING( 4, T_MANDATORY, meta_dev, 128)
24 NL_INTEGER( 5, T_MANDATORY, meta_dev_idx)
25 NL_INTEGER( 6, T_MAY_IGNORE, on_io_error)
26 NL_INTEGER( 7, T_MAY_IGNORE, fencing)
27 NL_BIT( 37, T_MAY_IGNORE, use_bmbv)
28 NL_BIT( 53, T_MAY_IGNORE, no_disk_flush)
29 NL_BIT( 54, T_MAY_IGNORE, no_md_flush)
30 /* 55 max_bio_size was available in 8.2.6rc2 */
31 NL_INTEGER( 56, T_MAY_IGNORE, max_bio_bvecs)
32 NL_BIT( 57, T_MAY_IGNORE, no_disk_barrier)
33 NL_BIT( 58, T_MAY_IGNORE, no_disk_drain)
34)
35
36NL_PACKET(detach, 4, )
37
38NL_PACKET(net_conf, 5,
39 NL_STRING( 8, T_MANDATORY, my_addr, 128)
40 NL_STRING( 9, T_MANDATORY, peer_addr, 128)
41 NL_STRING( 10, T_MAY_IGNORE, shared_secret, SHARED_SECRET_MAX)
42 NL_STRING( 11, T_MAY_IGNORE, cram_hmac_alg, SHARED_SECRET_MAX)
43 NL_STRING( 44, T_MAY_IGNORE, integrity_alg, SHARED_SECRET_MAX)
44 NL_INTEGER( 14, T_MAY_IGNORE, timeout)
45 NL_INTEGER( 15, T_MANDATORY, wire_protocol)
46 NL_INTEGER( 16, T_MAY_IGNORE, try_connect_int)
47 NL_INTEGER( 17, T_MAY_IGNORE, ping_int)
48 NL_INTEGER( 18, T_MAY_IGNORE, max_epoch_size)
49 NL_INTEGER( 19, T_MAY_IGNORE, max_buffers)
50 NL_INTEGER( 20, T_MAY_IGNORE, unplug_watermark)
51 NL_INTEGER( 21, T_MAY_IGNORE, sndbuf_size)
52 NL_INTEGER( 22, T_MAY_IGNORE, ko_count)
53 NL_INTEGER( 24, T_MAY_IGNORE, after_sb_0p)
54 NL_INTEGER( 25, T_MAY_IGNORE, after_sb_1p)
55 NL_INTEGER( 26, T_MAY_IGNORE, after_sb_2p)
56 NL_INTEGER( 39, T_MAY_IGNORE, rr_conflict)
57 NL_INTEGER( 40, T_MAY_IGNORE, ping_timeo)
58 NL_INTEGER( 67, T_MAY_IGNORE, rcvbuf_size)
59 /* 59 addr_family was available in GIT, never released */
60 NL_BIT( 60, T_MANDATORY, mind_af)
61 NL_BIT( 27, T_MAY_IGNORE, want_lose)
62 NL_BIT( 28, T_MAY_IGNORE, two_primaries)
63 NL_BIT( 41, T_MAY_IGNORE, always_asbp)
64 NL_BIT( 61, T_MAY_IGNORE, no_cork)
65 NL_BIT( 62, T_MANDATORY, auto_sndbuf_size)
66)
67
68NL_PACKET(disconnect, 6, )
69
70NL_PACKET(resize, 7,
71 NL_INT64( 29, T_MAY_IGNORE, resize_size)
72)
73
74NL_PACKET(syncer_conf, 8,
75 NL_INTEGER( 30, T_MAY_IGNORE, rate)
76 NL_INTEGER( 31, T_MAY_IGNORE, after)
77 NL_INTEGER( 32, T_MAY_IGNORE, al_extents)
78 NL_STRING( 52, T_MAY_IGNORE, verify_alg, SHARED_SECRET_MAX)
79 NL_STRING( 51, T_MAY_IGNORE, cpu_mask, 32)
80 NL_STRING( 64, T_MAY_IGNORE, csums_alg, SHARED_SECRET_MAX)
81 NL_BIT( 65, T_MAY_IGNORE, use_rle)
82)
83
84NL_PACKET(invalidate, 9, )
85NL_PACKET(invalidate_peer, 10, )
86NL_PACKET(pause_sync, 11, )
87NL_PACKET(resume_sync, 12, )
88NL_PACKET(suspend_io, 13, )
89NL_PACKET(resume_io, 14, )
90NL_PACKET(outdate, 15, )
91NL_PACKET(get_config, 16, )
92NL_PACKET(get_state, 17,
93 NL_INTEGER( 33, T_MAY_IGNORE, state_i)
94)
95
96NL_PACKET(get_uuids, 18,
97 NL_STRING( 34, T_MAY_IGNORE, uuids, (UI_SIZE*sizeof(__u64)))
98 NL_INTEGER( 35, T_MAY_IGNORE, uuids_flags)
99)
100
101NL_PACKET(get_timeout_flag, 19,
102 NL_BIT( 36, T_MAY_IGNORE, use_degraded)
103)
104
105NL_PACKET(call_helper, 20,
106 NL_STRING( 38, T_MAY_IGNORE, helper, 32)
107)
108
109/* Tag nr 42 already allocated in drbd-8.1 development. */
110
111NL_PACKET(sync_progress, 23,
112 NL_INTEGER( 43, T_MAY_IGNORE, sync_progress)
113)
114
115NL_PACKET(dump_ee, 24,
116 NL_STRING( 45, T_MAY_IGNORE, dump_ee_reason, 32)
117 NL_STRING( 46, T_MAY_IGNORE, seen_digest, SHARED_SECRET_MAX)
118 NL_STRING( 47, T_MAY_IGNORE, calc_digest, SHARED_SECRET_MAX)
119 NL_INT64( 48, T_MAY_IGNORE, ee_sector)
120 NL_INT64( 49, T_MAY_IGNORE, ee_block_id)
121 NL_STRING( 50, T_MAY_IGNORE, ee_data, 32 << 10)
122)
123
124NL_PACKET(start_ov, 25,
125 NL_INT64( 66, T_MAY_IGNORE, start_sector)
126)
127
128NL_PACKET(new_c_uuid, 26,
129 NL_BIT( 63, T_MANDATORY, clear_bm)
130)
131
132#undef NL_PACKET
133#undef NL_INTEGER
134#undef NL_INT64
135#undef NL_BIT
136#undef NL_STRING
137
diff --git a/include/linux/drbd_tag_magic.h b/include/linux/drbd_tag_magic.h
new file mode 100644
index 000000000000..fcdff8410e99
--- /dev/null
+++ b/include/linux/drbd_tag_magic.h
@@ -0,0 +1,83 @@
1#ifndef DRBD_TAG_MAGIC_H
2#define DRBD_TAG_MAGIC_H
3
4#define TT_END 0
5#define TT_REMOVED 0xE000
6
7/* declare packet_type enums */
8enum packet_types {
9#define NL_PACKET(name, number, fields) P_ ## name = number,
10#define NL_INTEGER(pn, pr, member)
11#define NL_INT64(pn, pr, member)
12#define NL_BIT(pn, pr, member)
13#define NL_STRING(pn, pr, member, len)
14#include "drbd_nl.h"
15 P_nl_after_last_packet,
16};
17
18/* These struct are used to deduce the size of the tag lists: */
19#define NL_PACKET(name, number, fields) \
20 struct name ## _tag_len_struct { fields };
21#define NL_INTEGER(pn, pr, member) \
22 int member; int tag_and_len ## member;
23#define NL_INT64(pn, pr, member) \
24 __u64 member; int tag_and_len ## member;
25#define NL_BIT(pn, pr, member) \
26 unsigned char member:1; int tag_and_len ## member;
27#define NL_STRING(pn, pr, member, len) \
28 unsigned char member[len]; int member ## _len; \
29 int tag_and_len ## member;
30#include "linux/drbd_nl.h"
31
32/* declate tag-list-sizes */
33static const int tag_list_sizes[] = {
34#define NL_PACKET(name, number, fields) 2 fields ,
35#define NL_INTEGER(pn, pr, member) + 4 + 4
36#define NL_INT64(pn, pr, member) + 4 + 8
37#define NL_BIT(pn, pr, member) + 4 + 1
38#define NL_STRING(pn, pr, member, len) + 4 + (len)
39#include "drbd_nl.h"
40};
41
42/* The two highest bits are used for the tag type */
43#define TT_MASK 0xC000
44#define TT_INTEGER 0x0000
45#define TT_INT64 0x4000
46#define TT_BIT 0x8000
47#define TT_STRING 0xC000
48/* The next bit indicates if processing of the tag is mandatory */
49#define T_MANDATORY 0x2000
50#define T_MAY_IGNORE 0x0000
51#define TN_MASK 0x1fff
52/* The remaining 13 bits are used to enumerate the tags */
53
54#define tag_type(T) ((T) & TT_MASK)
55#define tag_number(T) ((T) & TN_MASK)
56
57/* declare tag enums */
58#define NL_PACKET(name, number, fields) fields
59enum drbd_tags {
60#define NL_INTEGER(pn, pr, member) T_ ## member = pn | TT_INTEGER | pr ,
61#define NL_INT64(pn, pr, member) T_ ## member = pn | TT_INT64 | pr ,
62#define NL_BIT(pn, pr, member) T_ ## member = pn | TT_BIT | pr ,
63#define NL_STRING(pn, pr, member, len) T_ ## member = pn | TT_STRING | pr ,
64#include "drbd_nl.h"
65};
66
67struct tag {
68 const char *name;
69 int type_n_flags;
70 int max_len;
71};
72
73/* declare tag names */
74#define NL_PACKET(name, number, fields) fields
75static const struct tag tag_descriptions[] = {
76#define NL_INTEGER(pn, pr, member) [ pn ] = { #member, TT_INTEGER | pr, sizeof(int) },
77#define NL_INT64(pn, pr, member) [ pn ] = { #member, TT_INT64 | pr, sizeof(__u64) },
78#define NL_BIT(pn, pr, member) [ pn ] = { #member, TT_BIT | pr, sizeof(int) },
79#define NL_STRING(pn, pr, member, len) [ pn ] = { #member, TT_STRING | pr, (len) },
80#include "drbd_nl.h"
81};
82
83#endif
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
index ec12cc74366f..034072cea853 100644
--- a/include/linux/errqueue.h
+++ b/include/linux/errqueue.h
@@ -3,8 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct sock_extended_err 6struct sock_extended_err {
7{
8 __u32 ee_errno; 7 __u32 ee_errno;
9 __u8 ee_origin; 8 __u8 ee_origin;
10 __u8 ee_type; 9 __u8 ee_type;
@@ -31,8 +30,7 @@ struct sock_extended_err
31 30
32#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb)) 31#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb))
33 32
34struct sock_exterr_skb 33struct sock_exterr_skb {
35{
36 union { 34 union {
37 struct inet_skb_parm h4; 35 struct inet_skb_parm h4;
38#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 36#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 15e4eb713694..ef4a2d84d922 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -49,13 +49,14 @@ static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
49 return (ep->speed_hi << 16) | ep->speed; 49 return (ep->speed_hi << 16) | ep->speed;
50} 50}
51 51
52#define ETHTOOL_FWVERS_LEN 32
52#define ETHTOOL_BUSINFO_LEN 32 53#define ETHTOOL_BUSINFO_LEN 32
53/* these strings are set to whatever the driver author decides... */ 54/* these strings are set to whatever the driver author decides... */
54struct ethtool_drvinfo { 55struct ethtool_drvinfo {
55 __u32 cmd; 56 __u32 cmd;
56 char driver[32]; /* driver short name, "tulip", "eepro100" */ 57 char driver[32]; /* driver short name, "tulip", "eepro100" */
57 char version[32]; /* driver version string */ 58 char version[32]; /* driver version string */
58 char fw_version[32]; /* firmware version string, if applicable */ 59 char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */
59 char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */ 60 char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
60 /* For PCI devices, use pci_name(pci_dev). */ 61 /* For PCI devices, use pci_name(pci_dev). */
61 char reserved1[32]; 62 char reserved1[32];
@@ -495,13 +496,10 @@ struct ethtool_ops {
495 u32 (*get_priv_flags)(struct net_device *); 496 u32 (*get_priv_flags)(struct net_device *);
496 int (*set_priv_flags)(struct net_device *, u32); 497 int (*set_priv_flags)(struct net_device *, u32);
497 int (*get_sset_count)(struct net_device *, int); 498 int (*get_sset_count)(struct net_device *, int);
498
499 /* the following hooks are obsolete */
500 int (*self_test_count)(struct net_device *);/* use get_sset_count */
501 int (*get_stats_count)(struct net_device *);/* use get_sset_count */
502 int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); 499 int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *);
503 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 500 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
504 int (*flash_device)(struct net_device *, struct ethtool_flash *); 501 int (*flash_device)(struct net_device *, struct ethtool_flash *);
502 int (*reset)(struct net_device *, u32 *);
505}; 503};
506#endif /* __KERNEL__ */ 504#endif /* __KERNEL__ */
507 505
@@ -559,6 +557,7 @@ struct ethtool_ops {
559#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ 557#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
560#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ 558#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
561#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ 559#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
560#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
562 561
563/* compatibility with older code */ 562/* compatibility with older code */
564#define SPARC_ETH_GSET ETHTOOL_GSET 563#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -633,6 +632,8 @@ struct ethtool_ops {
633#define PORT_MII 0x02 632#define PORT_MII 0x02
634#define PORT_FIBRE 0x03 633#define PORT_FIBRE 0x03
635#define PORT_BNC 0x04 634#define PORT_BNC 0x04
635#define PORT_DA 0x05
636#define PORT_NONE 0xef
636#define PORT_OTHER 0xff 637#define PORT_OTHER 0xff
637 638
638/* Which transceiver to use. */ 639/* Which transceiver to use. */
@@ -676,6 +677,8 @@ struct ethtool_ops {
676#define AH_V6_FLOW 0x0b 677#define AH_V6_FLOW 0x0b
677#define ESP_V6_FLOW 0x0c 678#define ESP_V6_FLOW 0x0c
678#define IP_USER_FLOW 0x0d 679#define IP_USER_FLOW 0x0d
680#define IPV4_FLOW 0x10
681#define IPV6_FLOW 0x11
679 682
680/* L3-L4 network traffic flow hash options */ 683/* L3-L4 network traffic flow hash options */
681#define RXH_L2DA (1 << 1) 684#define RXH_L2DA (1 << 1)
@@ -689,4 +692,34 @@ struct ethtool_ops {
689 692
690#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL 693#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
691 694
695/* Reset flags */
696/* The reset() operation must clear the flags for the components which
697 * were actually reset. On successful return, the flags indicate the
698 * components which were not reset, either because they do not exist
699 * in the hardware or because they cannot be reset independently. The
700 * driver must never reset any components that were not requested.
701 */
702enum ethtool_reset_flags {
703 /* These flags represent components dedicated to the interface
704 * the command is addressed to. Shift any flag left by
705 * ETH_RESET_SHARED_SHIFT to reset a shared component of the
706 * same type.
707 */
708 ETH_RESET_MGMT = 1 << 0, /* Management processor */
709 ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */
710 ETH_RESET_DMA = 1 << 2, /* DMA engine */
711 ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */
712 ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */
713 ETH_RESET_MAC = 1 << 5, /* Media access controller */
714 ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */
715 ETH_RESET_RAM = 1 << 7, /* RAM shared between
716 * multiple components */
717
718 ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to
719 * this interface */
720 ETH_RESET_ALL = 0xffffffff, /* All components used by this
721 * interface, even if shared */
722};
723#define ETH_RESET_SHARED_SHIFT 16
724
692#endif /* _LINUX_ETHTOOL_H */ 725#endif /* _LINUX_ETHTOOL_H */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 121720d74e15..2dfa7076e8b6 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -565,14 +565,14 @@ struct ext2_dir_entry_2 {
565 * other bits are reserved for now. 565 * other bits are reserved for now.
566 */ 566 */
567enum { 567enum {
568 EXT2_FT_UNKNOWN, 568 EXT2_FT_UNKNOWN = 0,
569 EXT2_FT_REG_FILE, 569 EXT2_FT_REG_FILE = 1,
570 EXT2_FT_DIR, 570 EXT2_FT_DIR = 2,
571 EXT2_FT_CHRDEV, 571 EXT2_FT_CHRDEV = 3,
572 EXT2_FT_BLKDEV, 572 EXT2_FT_BLKDEV = 4,
573 EXT2_FT_FIFO, 573 EXT2_FT_FIFO = 5,
574 EXT2_FT_SOCK, 574 EXT2_FT_SOCK = 6,
575 EXT2_FT_SYMLINK, 575 EXT2_FT_SYMLINK = 7,
576 EXT2_FT_MAX 576 EXT2_FT_MAX
577}; 577};
578 578
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 7499b3667798..6b049030fbe6 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -918,6 +918,8 @@ extern void ext3_abort (struct super_block *, const char *, const char *, ...)
918 __attribute__ ((format (printf, 3, 4))); 918 __attribute__ ((format (printf, 3, 4)));
919extern void ext3_warning (struct super_block *, const char *, const char *, ...) 919extern void ext3_warning (struct super_block *, const char *, const char *, ...)
920 __attribute__ ((format (printf, 3, 4))); 920 __attribute__ ((format (printf, 3, 4)));
921extern void ext3_msg(struct super_block *, const char *, const char *, ...)
922 __attribute__ ((format (printf, 3, 4)));
921extern void ext3_update_dynamic_rev (struct super_block *sb); 923extern void ext3_update_dynamic_rev (struct super_block *sb);
922 924
923#define ext3_std_error(sb, errno) \ 925#define ext3_std_error(sb, errno) \
diff --git a/include/linux/fb.h b/include/linux/fb.h
index de9c722e7b90..369767bd873e 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -763,6 +763,7 @@ struct fb_tile_ops {
763 * takes over; acceleration engine should be in a quiescent state */ 763 * takes over; acceleration engine should be in a quiescent state */
764 764
765/* hints */ 765/* hints */
766#define FBINFO_VIRTFB 0x0004 /* FB is System RAM, not device. */
766#define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */ 767#define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */
767#define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering */ 768#define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering */
768 769
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
index 87b606b63f1e..51da65b68b85 100644
--- a/include/linux/fib_rules.h
+++ b/include/linux/fib_rules.h
@@ -8,13 +8,14 @@
8#define FIB_RULE_PERMANENT 0x00000001 8#define FIB_RULE_PERMANENT 0x00000001
9#define FIB_RULE_INVERT 0x00000002 9#define FIB_RULE_INVERT 0x00000002
10#define FIB_RULE_UNRESOLVED 0x00000004 10#define FIB_RULE_UNRESOLVED 0x00000004
11#define FIB_RULE_DEV_DETACHED 0x00000008 11#define FIB_RULE_IIF_DETACHED 0x00000008
12#define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED
13#define FIB_RULE_OIF_DETACHED 0x00000010
12 14
13/* try to find source address in routing lookups */ 15/* try to find source address in routing lookups */
14#define FIB_RULE_FIND_SADDR 0x00010000 16#define FIB_RULE_FIND_SADDR 0x00010000
15 17
16struct fib_rule_hdr 18struct fib_rule_hdr {
17{
18 __u8 family; 19 __u8 family;
19 __u8 dst_len; 20 __u8 dst_len;
20 __u8 src_len; 21 __u8 src_len;
@@ -28,12 +29,12 @@ struct fib_rule_hdr
28 __u32 flags; 29 __u32 flags;
29}; 30};
30 31
31enum 32enum {
32{
33 FRA_UNSPEC, 33 FRA_UNSPEC,
34 FRA_DST, /* destination address */ 34 FRA_DST, /* destination address */
35 FRA_SRC, /* source address */ 35 FRA_SRC, /* source address */
36 FRA_IFNAME, /* interface name */ 36 FRA_IIFNAME, /* interface name */
37#define FRA_IFNAME FRA_IIFNAME
37 FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */ 38 FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
38 FRA_UNUSED2, 39 FRA_UNUSED2,
39 FRA_PRIORITY, /* priority/preference */ 40 FRA_PRIORITY, /* priority/preference */
@@ -47,13 +48,13 @@ enum
47 FRA_UNUSED8, 48 FRA_UNUSED8,
48 FRA_TABLE, /* Extended table id */ 49 FRA_TABLE, /* Extended table id */
49 FRA_FWMASK, /* mask for netfilter mark */ 50 FRA_FWMASK, /* mask for netfilter mark */
51 FRA_OIFNAME,
50 __FRA_MAX 52 __FRA_MAX
51}; 53};
52 54
53#define FRA_MAX (__FRA_MAX - 1) 55#define FRA_MAX (__FRA_MAX - 1)
54 56
55enum 57enum {
56{
57 FR_ACT_UNSPEC, 58 FR_ACT_UNSPEC,
58 FR_ACT_TO_TBL, /* Pass to fixed table */ 59 FR_ACT_TO_TBL, /* Pass to fixed table */
59 FR_ACT_GOTO, /* Jump to another rule */ 60 FR_ACT_GOTO, /* Jump to another rule */
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 1354aaf6abbe..29a0e3db9f43 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -23,16 +23,14 @@
23 * the BPF code definitions which need to match so you can share filters 23 * the BPF code definitions which need to match so you can share filters
24 */ 24 */
25 25
26struct sock_filter /* Filter block */ 26struct sock_filter { /* Filter block */
27{
28 __u16 code; /* Actual filter code */ 27 __u16 code; /* Actual filter code */
29 __u8 jt; /* Jump true */ 28 __u8 jt; /* Jump true */
30 __u8 jf; /* Jump false */ 29 __u8 jf; /* Jump false */
31 __u32 k; /* Generic multiuse field */ 30 __u32 k; /* Generic multiuse field */
32}; 31};
33 32
34struct sock_fprog /* Required for SO_ATTACH_FILTER. */ 33struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
35{
36 unsigned short len; /* Number of filter blocks */ 34 unsigned short len; /* Number of filter blocks */
37 struct sock_filter __user *filter; 35 struct sock_filter __user *filter;
38}; 36};
@@ -123,7 +121,9 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */
123#define SKF_AD_IFINDEX 8 121#define SKF_AD_IFINDEX 8
124#define SKF_AD_NLATTR 12 122#define SKF_AD_NLATTR 12
125#define SKF_AD_NLATTR_NEST 16 123#define SKF_AD_NLATTR_NEST 16
126#define SKF_AD_MAX 20 124#define SKF_AD_MARK 20
125#define SKF_AD_QUEUE 24
126#define SKF_AD_MAX 28
127#define SKF_NET_OFF (-0x100000) 127#define SKF_NET_OFF (-0x100000)
128#define SKF_LL_OFF (-0x200000) 128#define SKF_LL_OFF (-0x200000)
129 129
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 7e1d4dec83e7..9416a461b696 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -20,20 +20,6 @@
20#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) 20#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args)
21#define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) 21#define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args)
22 22
23static inline void fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
24{
25 u32 *dst = _dst;
26 __be32 *src = _src;
27 int i;
28
29 for (i = 0; i < size / 4; i++)
30 dst[i] = be32_to_cpu(src[i]);
31}
32
33static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size)
34{
35 fw_memcpy_from_be32(_dst, _src, size);
36}
37#define CSR_REGISTER_BASE 0xfffff0000000ULL 23#define CSR_REGISTER_BASE 0xfffff0000000ULL
38 24
39/* register offsets are relative to CSR_REGISTER_BASE */ 25/* register offsets are relative to CSR_REGISTER_BASE */
@@ -131,7 +117,7 @@ struct fw_card {
131 117
132 bool broadcast_channel_allocated; 118 bool broadcast_channel_allocated;
133 u32 broadcast_channel; 119 u32 broadcast_channel;
134 u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; 120 __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
135}; 121};
136 122
137struct fw_attribute_group { 123struct fw_attribute_group {
@@ -281,6 +267,7 @@ struct fw_packet {
281 void *payload; 267 void *payload;
282 size_t payload_length; 268 size_t payload_length;
283 dma_addr_t payload_bus; 269 dma_addr_t payload_bus;
270 bool payload_mapped;
284 u32 timestamp; 271 u32 timestamp;
285 272
286 /* 273 /*
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index d31544628436..043811f0d277 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -4,6 +4,7 @@
4#include <linux/module.h> 4#include <linux/module.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/compiler.h> 6#include <linux/compiler.h>
7#include <linux/gfp.h>
7 8
8#define FW_ACTION_NOHOTPLUG 0 9#define FW_ACTION_NOHOTPLUG 0
9#define FW_ACTION_HOTPLUG 1 10#define FW_ACTION_HOTPLUG 1
@@ -38,7 +39,7 @@ int request_firmware(const struct firmware **fw, const char *name,
38 struct device *device); 39 struct device *device);
39int request_firmware_nowait( 40int request_firmware_nowait(
40 struct module *module, int uevent, 41 struct module *module, int uevent,
41 const char *name, struct device *device, void *context, 42 const char *name, struct device *device, gfp_t gfp, void *context,
42 void (*cont)(const struct firmware *fw, void *context)); 43 void (*cont)(const struct firmware *fw, void *context));
43 44
44void release_firmware(const struct firmware *fw); 45void release_firmware(const struct firmware *fw);
@@ -51,7 +52,7 @@ static inline int request_firmware(const struct firmware **fw,
51} 52}
52static inline int request_firmware_nowait( 53static inline int request_firmware_nowait(
53 struct module *module, int uevent, 54 struct module *module, int uevent,
54 const char *name, struct device *device, void *context, 55 const char *name, struct device *device, gfp_t gfp, void *context,
55 void (*cont)(const struct firmware *fw, void *context)) 56 void (*cont)(const struct firmware *fw, void *context))
56{ 57{
57 return -EINVAL; 58 return -EINVAL;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2620a8c63571..a057f48eb156 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -129,7 +129,7 @@ struct inodes_stat_t {
129 * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device 129 * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device
130 * immediately after submission. The write equivalent 130 * immediately after submission. The write equivalent
131 * of READ_SYNC. 131 * of READ_SYNC.
132 * WRITE_ODIRECT Special case write for O_DIRECT only. 132 * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only.
133 * SWRITE_SYNC 133 * SWRITE_SYNC
134 * SWRITE_SYNC_PLUG Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer. 134 * SWRITE_SYNC_PLUG Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer.
135 * See SWRITE. 135 * See SWRITE.
@@ -151,7 +151,7 @@ struct inodes_stat_t {
151#define READ_META (READ | (1 << BIO_RW_META)) 151#define READ_META (READ | (1 << BIO_RW_META))
152#define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) 152#define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
153#define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) 153#define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))
154#define WRITE_ODIRECT (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG)) 154#define WRITE_ODIRECT_PLUG (WRITE | (1 << BIO_RW_SYNCIO))
155#define SWRITE_SYNC_PLUG \ 155#define SWRITE_SYNC_PLUG \
156 (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) 156 (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
157#define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) 157#define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))
@@ -304,6 +304,7 @@ struct inodes_stat_t {
304#define BLKIOOPT _IO(0x12,121) 304#define BLKIOOPT _IO(0x12,121)
305#define BLKALIGNOFF _IO(0x12,122) 305#define BLKALIGNOFF _IO(0x12,122)
306#define BLKPBSZGET _IO(0x12,123) 306#define BLKPBSZGET _IO(0x12,123)
307#define BLKDISCARDZEROES _IO(0x12,124)
307 308
308#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ 309#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
309#define FIBMAP _IO(0x00,1) /* bmap access */ 310#define FIBMAP _IO(0x00,1) /* bmap access */
@@ -2090,8 +2091,6 @@ extern int filemap_fdatawait_range(struct address_space *, loff_t lstart,
2090extern int filemap_write_and_wait(struct address_space *mapping); 2091extern int filemap_write_and_wait(struct address_space *mapping);
2091extern int filemap_write_and_wait_range(struct address_space *mapping, 2092extern int filemap_write_and_wait_range(struct address_space *mapping,
2092 loff_t lstart, loff_t lend); 2093 loff_t lstart, loff_t lend);
2093extern int wait_on_page_writeback_range(struct address_space *mapping,
2094 pgoff_t start, pgoff_t end);
2095extern int __filemap_fdatawrite_range(struct address_space *mapping, 2094extern int __filemap_fdatawrite_range(struct address_space *mapping,
2096 loff_t start, loff_t end, int sync_mode); 2095 loff_t start, loff_t end, int sync_mode);
2097extern int filemap_fdatawrite_range(struct address_space *mapping, 2096extern int filemap_fdatawrite_range(struct address_space *mapping,
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 43fc95d822d5..28e33fea5107 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -74,7 +74,12 @@ struct spi_device;
74struct fsl_spi_platform_data { 74struct fsl_spi_platform_data {
75 u32 initial_spmode; /* initial SPMODE value */ 75 u32 initial_spmode; /* initial SPMODE value */
76 s16 bus_num; 76 s16 bus_num;
77 bool qe_mode; 77 unsigned int flags;
78#define SPI_QE_CPU_MODE (1 << 0) /* QE CPU ("PIO") mode */
79#define SPI_CPM_MODE (1 << 1) /* CPM/QE ("DMA") mode */
80#define SPI_CPM1 (1 << 2) /* SPI unit is in CPM1 block */
81#define SPI_CPM2 (1 << 3) /* SPI unit is in CPM2 block */
82#define SPI_QE (1 << 4) /* SPI unit is in QE block */
78 /* board specific information */ 83 /* board specific information */
79 u16 max_chipselect; 84 u16 max_chipselect;
80 void (*cs_control)(struct spi_device *spi, bool on); 85 void (*cs_control)(struct spi_device *spi, bool on);
@@ -90,6 +95,10 @@ struct mpc8xx_pcmcia_ops {
90 * lead to a deep sleep (i.e. power removed from the core, 95 * lead to a deep sleep (i.e. power removed from the core,
91 * instead of just the clock). 96 * instead of just the clock).
92 */ 97 */
98#if defined(CONFIG_PPC_83xx) && defined(CONFIG_SUSPEND)
93int fsl_deep_sleep(void); 99int fsl_deep_sleep(void);
100#else
101static inline int fsl_deep_sleep(void) { return 0; }
102#endif
94 103
95#endif /* _FSL_DEVICE_H_ */ 104#endif /* _FSL_DEVICE_H_ */
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 4ec5e67e18cf..38f8d6553831 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -57,6 +57,7 @@ struct trace_iterator {
57 /* The below is zeroed out in pipe_read */ 57 /* The below is zeroed out in pipe_read */
58 struct trace_seq seq; 58 struct trace_seq seq;
59 struct trace_entry *ent; 59 struct trace_entry *ent;
60 int leftover;
60 int cpu; 61 int cpu;
61 u64 ts; 62 u64 ts;
62 63
@@ -117,12 +118,12 @@ struct ftrace_event_call {
117 struct dentry *dir; 118 struct dentry *dir;
118 struct trace_event *event; 119 struct trace_event *event;
119 int enabled; 120 int enabled;
120 int (*regfunc)(void *); 121 int (*regfunc)(struct ftrace_event_call *);
121 void (*unregfunc)(void *); 122 void (*unregfunc)(struct ftrace_event_call *);
122 int id; 123 int id;
123 int (*raw_init)(void); 124 int (*raw_init)(struct ftrace_event_call *);
124 int (*show_format)(struct ftrace_event_call *call, 125 int (*show_format)(struct ftrace_event_call *,
125 struct trace_seq *s); 126 struct trace_seq *);
126 int (*define_fields)(struct ftrace_event_call *); 127 int (*define_fields)(struct ftrace_event_call *);
127 struct list_head fields; 128 struct list_head fields;
128 int filter_active; 129 int filter_active;
@@ -131,20 +132,20 @@ struct ftrace_event_call {
131 void *data; 132 void *data;
132 133
133 atomic_t profile_count; 134 atomic_t profile_count;
134 int (*profile_enable)(void); 135 int (*profile_enable)(struct ftrace_event_call *);
135 void (*profile_disable)(void); 136 void (*profile_disable)(struct ftrace_event_call *);
136}; 137};
137 138
138#define FTRACE_MAX_PROFILE_SIZE 2048 139#define FTRACE_MAX_PROFILE_SIZE 2048
139 140
140extern char *trace_profile_buf; 141extern char *perf_trace_buf;
141extern char *trace_profile_buf_nmi; 142extern char *perf_trace_buf_nmi;
142 143
143#define MAX_FILTER_PRED 32 144#define MAX_FILTER_PRED 32
144#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ 145#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
145 146
146extern void destroy_preds(struct ftrace_event_call *call); 147extern void destroy_preds(struct ftrace_event_call *call);
147extern int filter_match_preds(struct ftrace_event_call *call, void *rec); 148extern int filter_match_preds(struct event_filter *filter, void *rec);
148extern int filter_current_check_discard(struct ring_buffer *buffer, 149extern int filter_current_check_discard(struct ring_buffer *buffer,
149 struct ftrace_event_call *call, 150 struct ftrace_event_call *call,
150 void *rec, 151 void *rec,
@@ -157,11 +158,12 @@ enum {
157 FILTER_PTR_STRING, 158 FILTER_PTR_STRING,
158}; 159};
159 160
160extern int trace_define_field(struct ftrace_event_call *call,
161 const char *type, const char *name,
162 int offset, int size, int is_signed,
163 int filter_type);
164extern int trace_define_common_fields(struct ftrace_event_call *call); 161extern int trace_define_common_fields(struct ftrace_event_call *call);
162extern int trace_define_field(struct ftrace_event_call *call, const char *type,
163 const char *name, int offset, int size,
164 int is_signed, int filter_type);
165extern int trace_add_event_call(struct ftrace_event_call *call);
166extern void trace_remove_event_call(struct ftrace_event_call *call);
165 167
166#define is_signed_type(type) (((type)(-1)) < 0) 168#define is_signed_type(type) (((type)(-1)) < 0)
167 169
@@ -186,4 +188,13 @@ do { \
186 __trace_printk(ip, fmt, ##args); \ 188 __trace_printk(ip, fmt, ##args); \
187} while (0) 189} while (0)
188 190
191#ifdef CONFIG_EVENT_PROFILE
192struct perf_event;
193extern int ftrace_profile_enable(int event_id);
194extern void ftrace_profile_disable(int event_id);
195extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
196 char *filter_str);
197extern void ftrace_profile_free_filter(struct perf_event *event);
198#endif
199
189#endif /* _LINUX_FTRACE_EVENT_H */ 200#endif /* _LINUX_FTRACE_EVENT_H */
diff --git a/include/linux/gen_stats.h b/include/linux/gen_stats.h
index 710e901085d0..552c8a0a12d1 100644
--- a/include/linux/gen_stats.h
+++ b/include/linux/gen_stats.h
@@ -18,13 +18,11 @@ enum {
18 * @bytes: number of seen bytes 18 * @bytes: number of seen bytes
19 * @packets: number of seen packets 19 * @packets: number of seen packets
20 */ 20 */
21struct gnet_stats_basic 21struct gnet_stats_basic {
22{
23 __u64 bytes; 22 __u64 bytes;
24 __u32 packets; 23 __u32 packets;
25}; 24};
26struct gnet_stats_basic_packed 25struct gnet_stats_basic_packed {
27{
28 __u64 bytes; 26 __u64 bytes;
29 __u32 packets; 27 __u32 packets;
30} __attribute__ ((packed)); 28} __attribute__ ((packed));
@@ -34,8 +32,7 @@ struct gnet_stats_basic_packed
34 * @bps: current byte rate 32 * @bps: current byte rate
35 * @pps: current packet rate 33 * @pps: current packet rate
36 */ 34 */
37struct gnet_stats_rate_est 35struct gnet_stats_rate_est {
38{
39 __u32 bps; 36 __u32 bps;
40 __u32 pps; 37 __u32 pps;
41}; 38};
@@ -48,8 +45,7 @@ struct gnet_stats_rate_est
48 * @requeues: number of requeues 45 * @requeues: number of requeues
49 * @overlimits: number of enqueues over the limit 46 * @overlimits: number of enqueues over the limit
50 */ 47 */
51struct gnet_stats_queue 48struct gnet_stats_queue {
52{
53 __u32 qlen; 49 __u32 qlen;
54 __u32 backlog; 50 __u32 backlog;
55 __u32 drops; 51 __u32 drops;
@@ -62,8 +58,7 @@ struct gnet_stats_queue
62 * @interval: sampling period 58 * @interval: sampling period
63 * @ewma_log: the log of measurement window weight 59 * @ewma_log: the log of measurement window weight
64 */ 60 */
65struct gnet_estimator 61struct gnet_estimator {
66{
67 signed char interval; 62 signed char interval;
68 unsigned char ewma_log; 63 unsigned char ewma_log;
69}; 64};
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 297df45ffd0a..c6c0c41af35f 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -91,6 +91,7 @@ struct hd_struct {
91 sector_t start_sect; 91 sector_t start_sect;
92 sector_t nr_sects; 92 sector_t nr_sects;
93 sector_t alignment_offset; 93 sector_t alignment_offset;
94 unsigned int discard_alignment;
94 struct device __dev; 95 struct device __dev;
95 struct kobject *holder_dir; 96 struct kobject *holder_dir;
96 int policy, partno; 97 int policy, partno;
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index b80c88dedbbb..81f90a59cda6 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -81,7 +81,11 @@ struct gfs2_meta_header {
81 __be32 mh_type; 81 __be32 mh_type;
82 __be64 __pad0; /* Was generation number in gfs1 */ 82 __be64 __pad0; /* Was generation number in gfs1 */
83 __be32 mh_format; 83 __be32 mh_format;
84 __be32 __pad1; /* Was incarnation number in gfs1 */ 84 /* This union is to keep userspace happy */
85 union {
86 __be32 mh_jid; /* Was incarnation number in gfs1 */
87 __be32 __pad1;
88 };
85}; 89};
86 90
87/* 91/*
diff --git a/include/linux/gigaset_dev.h b/include/linux/gigaset_dev.h
index 5dc4a316ca37..258ba82937e7 100644
--- a/include/linux/gigaset_dev.h
+++ b/include/linux/gigaset_dev.h
@@ -16,15 +16,23 @@
16 16
17#include <linux/ioctl.h> 17#include <linux/ioctl.h>
18 18
19/* The magic IOCTL value for this interface. */
19#define GIGASET_IOCTL 0x47 20#define GIGASET_IOCTL 0x47
20 21
21#define GIGVER_DRIVER 0 22/* enable/disable device control via character device (lock out ISDN subsys) */
22#define GIGVER_COMPAT 1 23#define GIGASET_REDIR _IOWR(GIGASET_IOCTL, 0, int)
23#define GIGVER_FWBASE 2
24 24
25#define GIGASET_REDIR _IOWR (GIGASET_IOCTL, 0, int) 25/* enable adapter configuration mode (M10x only) */
26#define GIGASET_CONFIG _IOWR (GIGASET_IOCTL, 1, int) 26#define GIGASET_CONFIG _IOWR(GIGASET_IOCTL, 1, int)
27#define GIGASET_BRKCHARS _IOW (GIGASET_IOCTL, 2, unsigned char[6]) //FIXME [6] okay? 27
28#define GIGASET_VERSION _IOWR (GIGASET_IOCTL, 3, unsigned[4]) 28/* set break characters (M105 only) */
29#define GIGASET_BRKCHARS _IOW(GIGASET_IOCTL, 2, unsigned char[6])
30
31/* get version information selected by arg[0] */
32#define GIGASET_VERSION _IOWR(GIGASET_IOCTL, 3, unsigned[4])
33/* values for GIGASET_VERSION arg[0] */
34#define GIGVER_DRIVER 0 /* get driver version */
35#define GIGVER_COMPAT 1 /* get interface compatibility version */
36#define GIGVER_FWBASE 2 /* get base station firmware version */
29 37
30#endif 38#endif
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 6d527ee82b2b..d5b387669dab 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -139,10 +139,34 @@ static inline void account_system_vtime(struct task_struct *tsk)
139#endif 139#endif
140 140
141#if defined(CONFIG_NO_HZ) 141#if defined(CONFIG_NO_HZ)
142#if defined(CONFIG_TINY_RCU)
143extern void rcu_enter_nohz(void);
144extern void rcu_exit_nohz(void);
145
146static inline void rcu_irq_enter(void)
147{
148 rcu_exit_nohz();
149}
150
151static inline void rcu_irq_exit(void)
152{
153 rcu_enter_nohz();
154}
155
156static inline void rcu_nmi_enter(void)
157{
158}
159
160static inline void rcu_nmi_exit(void)
161{
162}
163
164#else
142extern void rcu_irq_enter(void); 165extern void rcu_irq_enter(void);
143extern void rcu_irq_exit(void); 166extern void rcu_irq_exit(void);
144extern void rcu_nmi_enter(void); 167extern void rcu_nmi_enter(void);
145extern void rcu_nmi_exit(void); 168extern void rcu_nmi_exit(void);
169#endif
146#else 170#else
147# define rcu_irq_enter() do { } while (0) 171# define rcu_irq_enter() do { } while (0)
148# define rcu_irq_exit() do { } while (0) 172# define rcu_irq_exit() do { } while (0)
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h
deleted file mode 100644
index 92b08cfe4a75..000000000000
--- a/include/linux/hayesesp.h
+++ /dev/null
@@ -1,114 +0,0 @@
1#ifndef HAYESESP_H
2#define HAYESESP_H
3
4struct hayes_esp_config {
5 short flow_on;
6 short flow_off;
7 short rx_trigger;
8 short tx_trigger;
9 short pio_threshold;
10 unsigned char rx_timeout;
11 char dma_channel;
12};
13
14#ifdef __KERNEL__
15
16#define ESP_DMA_CHANNEL 0
17#define ESP_RX_TRIGGER 768
18#define ESP_TX_TRIGGER 768
19#define ESP_FLOW_OFF 1016
20#define ESP_FLOW_ON 944
21#define ESP_RX_TMOUT 128
22#define ESP_PIO_THRESHOLD 32
23
24#define ESP_IN_MAJOR 57 /* major dev # for dial in */
25#define ESP_OUT_MAJOR 58 /* major dev # for dial out */
26#define ESPC_SCALE 3
27#define UART_ESI_BASE 0x00
28#define UART_ESI_SID 0x01
29#define UART_ESI_RX 0x02
30#define UART_ESI_TX 0x02
31#define UART_ESI_CMD1 0x04
32#define UART_ESI_CMD2 0x05
33#define UART_ESI_STAT1 0x04
34#define UART_ESI_STAT2 0x05
35#define UART_ESI_RWS 0x07
36
37#define UART_IER_DMA_TMOUT 0x80
38#define UART_IER_DMA_TC 0x08
39
40#define ESI_SET_IRQ 0x04
41#define ESI_SET_DMA_TMOUT 0x05
42#define ESI_SET_SRV_MASK 0x06
43#define ESI_SET_ERR_MASK 0x07
44#define ESI_SET_FLOW_CNTL 0x08
45#define ESI_SET_FLOW_CHARS 0x09
46#define ESI_SET_FLOW_LVL 0x0a
47#define ESI_SET_TRIGGER 0x0b
48#define ESI_SET_RX_TIMEOUT 0x0c
49#define ESI_SET_FLOW_TMOUT 0x0d
50#define ESI_WRITE_UART 0x0e
51#define ESI_READ_UART 0x0f
52#define ESI_SET_MODE 0x10
53#define ESI_GET_ERR_STAT 0x12
54#define ESI_GET_UART_STAT 0x13
55#define ESI_GET_RX_AVAIL 0x14
56#define ESI_GET_TX_AVAIL 0x15
57#define ESI_START_DMA_RX 0x16
58#define ESI_START_DMA_TX 0x17
59#define ESI_ISSUE_BREAK 0x1a
60#define ESI_FLUSH_RX 0x1b
61#define ESI_FLUSH_TX 0x1c
62#define ESI_SET_BAUD 0x1d
63#define ESI_SET_ENH_IRQ 0x1f
64#define ESI_SET_REINTR 0x20
65#define ESI_SET_PRESCALAR 0x23
66#define ESI_NO_COMMAND 0xff
67
68#define ESP_STAT_RX_TIMEOUT 0x01
69#define ESP_STAT_DMA_RX 0x02
70#define ESP_STAT_DMA_TX 0x04
71#define ESP_STAT_NEVER_DMA 0x08
72#define ESP_STAT_USE_PIO 0x10
73
74#define ESP_MAGIC 0x53ee
75#define ESP_XMIT_SIZE 4096
76
77struct esp_struct {
78 int magic;
79 struct tty_port port;
80 spinlock_t lock;
81 int io_port;
82 int irq;
83 int read_status_mask;
84 int ignore_status_mask;
85 int timeout;
86 int stat_flags;
87 int custom_divisor;
88 int close_delay;
89 unsigned short closing_wait;
90 unsigned short closing_wait2;
91 int IER; /* Interrupt Enable Register */
92 int MCR; /* Modem control register */
93 unsigned long last_active;
94 int line;
95 unsigned char *xmit_buf;
96 int xmit_head;
97 int xmit_tail;
98 int xmit_cnt;
99 wait_queue_head_t break_wait;
100 struct async_icount icount; /* kernel counters for the 4 input interrupts */
101 struct hayes_esp_config config; /* port configuration */
102 struct esp_struct *next_port; /* For the linked list */
103};
104
105struct esp_pio_buffer {
106 unsigned char data[1024];
107 struct esp_pio_buffer *next;
108};
109
110#endif /* __KERNEL__ */
111
112
113#endif /* ESP_H */
114
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 10f628416740..87093652dda8 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -312,6 +312,7 @@ struct hid_item {
312#define HID_QUIRK_MULTI_INPUT 0x00000040 312#define HID_QUIRK_MULTI_INPUT 0x00000040
313#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 313#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
314#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 314#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
315#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
315 316
316/* 317/*
317 * This is the global environment of the parser. This information is 318 * This is the global environment of the parser. This information is
diff --git a/include/linux/hpet.h b/include/linux/hpet.h
index 79f63a27bcef..219ca4f6bea6 100644
--- a/include/linux/hpet.h
+++ b/include/linux/hpet.h
@@ -126,4 +126,6 @@ struct hpet_info {
126#define HPET_DPI _IO('h', 0x05) /* disable periodic */ 126#define HPET_DPI _IO('h', 0x05) /* disable periodic */
127#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */ 127#define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */
128 128
129#define MAX_HPET_TBS 8 /* maximum hpet timer blocks */
130
129#endif /* !__HPET__ */ 131#endif /* !__HPET__ */
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index ff037f0b1b4e..af634e95871d 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -162,10 +162,11 @@ struct hrtimer_clock_base {
162 * @expires_next: absolute time of the next event which was scheduled 162 * @expires_next: absolute time of the next event which was scheduled
163 * via clock_set_next_event() 163 * via clock_set_next_event()
164 * @hres_active: State of high resolution mode 164 * @hres_active: State of high resolution mode
165 * @check_clocks: Indictator, when set evaluate time source and clock 165 * @hang_detected: The last hrtimer interrupt detected a hang
166 * event devices whether high resolution mode can be 166 * @nr_events: Total number of hrtimer interrupt events
167 * activated. 167 * @nr_retries: Total number of hrtimer interrupt retries
168 * @nr_events: Total number of timer interrupt events 168 * @nr_hangs: Total number of hrtimer interrupt hangs
169 * @max_hang_time: Maximum time spent in hrtimer_interrupt
169 */ 170 */
170struct hrtimer_cpu_base { 171struct hrtimer_cpu_base {
171 spinlock_t lock; 172 spinlock_t lock;
@@ -173,7 +174,11 @@ struct hrtimer_cpu_base {
173#ifdef CONFIG_HIGH_RES_TIMERS 174#ifdef CONFIG_HIGH_RES_TIMERS
174 ktime_t expires_next; 175 ktime_t expires_next;
175 int hres_active; 176 int hres_active;
177 int hang_detected;
176 unsigned long nr_events; 178 unsigned long nr_events;
179 unsigned long nr_retries;
180 unsigned long nr_hangs;
181 ktime_t max_hang_time;
177#endif 182#endif
178}; 183};
179 184
@@ -435,49 +440,4 @@ extern u64 ktime_divns(const ktime_t kt, s64 div);
435/* Show pending timers: */ 440/* Show pending timers: */
436extern void sysrq_timer_list_show(void); 441extern void sysrq_timer_list_show(void);
437 442
438/*
439 * Timer-statistics info:
440 */
441#ifdef CONFIG_TIMER_STATS
442
443extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
444 void *timerf, char *comm,
445 unsigned int timer_flag);
446
447static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
448{
449 if (likely(!timer->start_site))
450 return;
451 timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
452 timer->function, timer->start_comm, 0);
453}
454
455extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer,
456 void *addr);
457
458static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
459{
460 if (likely(!timer_stats_active))
461 return;
462 __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0));
463}
464
465static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer)
466{
467 timer->start_site = NULL;
468}
469#else
470static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
471{
472}
473
474static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer)
475{
476}
477
478static inline void timer_stats_hrtimer_clear_start_info(struct hrtimer *timer)
479{
480}
481#endif
482
483#endif 443#endif
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
new file mode 100644
index 000000000000..41235c93e4e9
--- /dev/null
+++ b/include/linux/hw_breakpoint.h
@@ -0,0 +1,125 @@
1#ifndef _LINUX_HW_BREAKPOINT_H
2#define _LINUX_HW_BREAKPOINT_H
3
4enum {
5 HW_BREAKPOINT_LEN_1 = 1,
6 HW_BREAKPOINT_LEN_2 = 2,
7 HW_BREAKPOINT_LEN_4 = 4,
8 HW_BREAKPOINT_LEN_8 = 8,
9};
10
11enum {
12 HW_BREAKPOINT_R = 1,
13 HW_BREAKPOINT_W = 2,
14 HW_BREAKPOINT_X = 4,
15};
16
17#ifdef __KERNEL__
18
19#include <linux/perf_event.h>
20
21#ifdef CONFIG_HAVE_HW_BREAKPOINT
22
23static inline void hw_breakpoint_init(struct perf_event_attr *attr)
24{
25 memset(attr, 0, sizeof(*attr));
26
27 attr->type = PERF_TYPE_BREAKPOINT;
28 attr->size = sizeof(*attr);
29 /*
30 * As it's for in-kernel or ptrace use, we want it to be pinned
31 * and to call its callback every hits.
32 */
33 attr->pinned = 1;
34 attr->sample_period = 1;
35}
36
37static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
38{
39 return bp->attr.bp_addr;
40}
41
42static inline int hw_breakpoint_type(struct perf_event *bp)
43{
44 return bp->attr.bp_type;
45}
46
47static inline int hw_breakpoint_len(struct perf_event *bp)
48{
49 return bp->attr.bp_len;
50}
51
52extern struct perf_event *
53register_user_hw_breakpoint(struct perf_event_attr *attr,
54 perf_overflow_handler_t triggered,
55 struct task_struct *tsk);
56
57/* FIXME: only change from the attr, and don't unregister */
58extern int
59modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr);
60
61/*
62 * Kernel breakpoints are not associated with any particular thread.
63 */
64extern struct perf_event *
65register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
66 perf_overflow_handler_t triggered,
67 int cpu);
68
69extern struct perf_event **
70register_wide_hw_breakpoint(struct perf_event_attr *attr,
71 perf_overflow_handler_t triggered);
72
73extern int register_perf_hw_breakpoint(struct perf_event *bp);
74extern int __register_perf_hw_breakpoint(struct perf_event *bp);
75extern void unregister_hw_breakpoint(struct perf_event *bp);
76extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events);
77
78extern int reserve_bp_slot(struct perf_event *bp);
79extern void release_bp_slot(struct perf_event *bp);
80
81extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk);
82
83static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
84{
85 return &bp->hw.info;
86}
87
88#else /* !CONFIG_HAVE_HW_BREAKPOINT */
89
90static inline struct perf_event *
91register_user_hw_breakpoint(struct perf_event_attr *attr,
92 perf_overflow_handler_t triggered,
93 struct task_struct *tsk) { return NULL; }
94static inline int
95modify_user_hw_breakpoint(struct perf_event *bp,
96 struct perf_event_attr *attr) { return -ENOSYS; }
97static inline struct perf_event *
98register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
99 perf_overflow_handler_t triggered,
100 int cpu) { return NULL; }
101static inline struct perf_event **
102register_wide_hw_breakpoint(struct perf_event_attr *attr,
103 perf_overflow_handler_t triggered) { return NULL; }
104static inline int
105register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
106static inline int
107__register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
108static inline void unregister_hw_breakpoint(struct perf_event *bp) { }
109static inline void
110unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { }
111static inline int
112reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; }
113static inline void release_bp_slot(struct perf_event *bp) { }
114
115static inline void flush_ptrace_hw_breakpoint(struct task_struct *tsk) { }
116
117static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
118{
119 return NULL;
120}
121
122#endif /* CONFIG_HAVE_HW_BREAKPOINT */
123#endif /* __KERNEL__ */
124
125#endif /* _LINUX_HW_BREAKPOINT_H */
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h
index 7244456e7e65..9bede7633f74 100644
--- a/include/linux/hw_random.h
+++ b/include/linux/hw_random.h
@@ -22,10 +22,12 @@
22 * @cleanup: Cleanup callback (can be NULL). 22 * @cleanup: Cleanup callback (can be NULL).
23 * @data_present: Callback to determine if data is available 23 * @data_present: Callback to determine if data is available
24 * on the RNG. If NULL, it is assumed that 24 * on the RNG. If NULL, it is assumed that
25 * there is always data available. 25 * there is always data available. *OBSOLETE*
26 * @data_read: Read data from the RNG device. 26 * @data_read: Read data from the RNG device.
27 * Returns the number of lower random bytes in "data". 27 * Returns the number of lower random bytes in "data".
28 * Must not be NULL. 28 * Must not be NULL. *OSOLETE*
29 * @read: New API. drivers can fill up to max bytes of data
30 * into the buffer. The buffer is aligned for any type.
29 * @priv: Private data, for use by the RNG driver. 31 * @priv: Private data, for use by the RNG driver.
30 */ 32 */
31struct hwrng { 33struct hwrng {
@@ -34,6 +36,7 @@ struct hwrng {
34 void (*cleanup)(struct hwrng *rng); 36 void (*cleanup)(struct hwrng *rng);
35 int (*data_present)(struct hwrng *rng, int wait); 37 int (*data_present)(struct hwrng *rng, int wait);
36 int (*data_read)(struct hwrng *rng, u32 *data); 38 int (*data_read)(struct hwrng *rng, u32 *data);
39 int (*read)(struct hwrng *rng, void *data, size_t max, bool wait);
37 unsigned long priv; 40 unsigned long priv;
38 41
39 /* internal. */ 42 /* internal. */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 7b40cda57a70..419ab546b266 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -110,7 +110,7 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
110 * @driver: Device driver model driver 110 * @driver: Device driver model driver
111 * @id_table: List of I2C devices supported by this driver 111 * @id_table: List of I2C devices supported by this driver
112 * @detect: Callback for device detection 112 * @detect: Callback for device detection
113 * @address_data: The I2C addresses to probe, ignore or force (for detect) 113 * @address_data: The I2C addresses to probe (for detect)
114 * @clients: List of detected clients we created (for i2c-core use only) 114 * @clients: List of detected clients we created (for i2c-core use only)
115 * 115 *
116 * The driver.owner field should be set to the module owner of this driver. 116 * The driver.owner field should be set to the module owner of this driver.
@@ -338,8 +338,7 @@ struct i2c_adapter {
338 void *algo_data; 338 void *algo_data;
339 339
340 /* data fields that are valid for all devices */ 340 /* data fields that are valid for all devices */
341 u8 level; /* nesting level for lockdep */ 341 struct rt_mutex bus_lock;
342 struct mutex bus_lock;
343 342
344 int timeout; /* in jiffies */ 343 int timeout; /* in jiffies */
345 int retries; 344 int retries;
@@ -367,7 +366,7 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
367 */ 366 */
368static inline void i2c_lock_adapter(struct i2c_adapter *adapter) 367static inline void i2c_lock_adapter(struct i2c_adapter *adapter)
369{ 368{
370 mutex_lock(&adapter->bus_lock); 369 rt_mutex_lock(&adapter->bus_lock);
371} 370}
372 371
373/** 372/**
@@ -376,7 +375,7 @@ static inline void i2c_lock_adapter(struct i2c_adapter *adapter)
376 */ 375 */
377static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) 376static inline void i2c_unlock_adapter(struct i2c_adapter *adapter)
378{ 377{
379 mutex_unlock(&adapter->bus_lock); 378 rt_mutex_unlock(&adapter->bus_lock);
380} 379}
381 380
382/*flags for the client struct: */ 381/*flags for the client struct: */
@@ -398,9 +397,6 @@ static inline void i2c_unlock_adapter(struct i2c_adapter *adapter)
398 */ 397 */
399struct i2c_client_address_data { 398struct i2c_client_address_data {
400 const unsigned short *normal_i2c; 399 const unsigned short *normal_i2c;
401 const unsigned short *probe;
402 const unsigned short *ignore;
403 const unsigned short * const *forces;
404}; 400};
405 401
406/* Internal numbers to terminate lists */ 402/* Internal numbers to terminate lists */
@@ -614,134 +610,48 @@ union i2c_smbus_data {
614 module_param_array(var, short, &var##_num, 0); \ 610 module_param_array(var, short, &var##_num, 0); \
615 MODULE_PARM_DESC(var, desc) 611 MODULE_PARM_DESC(var, desc)
616 612
617#define I2C_CLIENT_MODULE_PARM_FORCE(name) \
618I2C_CLIENT_MODULE_PARM(force_##name, \
619 "List of adapter,address pairs which are " \
620 "unquestionably assumed to contain a `" \
621 # name "' chip")
622
623
624#define I2C_CLIENT_INSMOD_COMMON \ 613#define I2C_CLIENT_INSMOD_COMMON \
625I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \
626 "additionally"); \
627I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \
628 "scan"); \
629static const struct i2c_client_address_data addr_data = { \ 614static const struct i2c_client_address_data addr_data = { \
630 .normal_i2c = normal_i2c, \ 615 .normal_i2c = normal_i2c, \
631 .probe = probe, \
632 .ignore = ignore, \
633 .forces = forces, \
634} 616}
635 617
636#define I2C_CLIENT_FORCE_TEXT \
637 "List of adapter,address pairs to boldly assume to be present"
638
639/* These are the ones you want to use in your own drivers. Pick the one 618/* These are the ones you want to use in your own drivers. Pick the one
640 which matches the number of devices the driver differenciates between. */ 619 which matches the number of devices the driver differenciates between. */
641#define I2C_CLIENT_INSMOD \ 620#define I2C_CLIENT_INSMOD \
642I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
643static const unsigned short * const forces[] = { force, NULL }; \
644I2C_CLIENT_INSMOD_COMMON 621I2C_CLIENT_INSMOD_COMMON
645 622
646#define I2C_CLIENT_INSMOD_1(chip1) \ 623#define I2C_CLIENT_INSMOD_1(chip1) \
647enum chips { any_chip, chip1 }; \ 624enum chips { any_chip, chip1 }; \
648I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
649I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
650static const unsigned short * const forces[] = { force, \
651 force_##chip1, NULL }; \
652I2C_CLIENT_INSMOD_COMMON 625I2C_CLIENT_INSMOD_COMMON
653 626
654#define I2C_CLIENT_INSMOD_2(chip1, chip2) \ 627#define I2C_CLIENT_INSMOD_2(chip1, chip2) \
655enum chips { any_chip, chip1, chip2 }; \ 628enum chips { any_chip, chip1, chip2 }; \
656I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
657I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
658I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
659static const unsigned short * const forces[] = { force, \
660 force_##chip1, force_##chip2, NULL }; \
661I2C_CLIENT_INSMOD_COMMON 629I2C_CLIENT_INSMOD_COMMON
662 630
663#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ 631#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \
664enum chips { any_chip, chip1, chip2, chip3 }; \ 632enum chips { any_chip, chip1, chip2, chip3 }; \
665I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
666I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
667I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
668I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
669static const unsigned short * const forces[] = { force, \
670 force_##chip1, force_##chip2, force_##chip3, NULL }; \
671I2C_CLIENT_INSMOD_COMMON 633I2C_CLIENT_INSMOD_COMMON
672 634
673#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ 635#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \
674enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ 636enum chips { any_chip, chip1, chip2, chip3, chip4 }; \
675I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
676I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
677I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
678I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
679I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
680static const unsigned short * const forces[] = { force, \
681 force_##chip1, force_##chip2, force_##chip3, \
682 force_##chip4, NULL}; \
683I2C_CLIENT_INSMOD_COMMON 637I2C_CLIENT_INSMOD_COMMON
684 638
685#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ 639#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \
686enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ 640enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \
687I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
688I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
689I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
690I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
691I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
692I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
693static const unsigned short * const forces[] = { force, \
694 force_##chip1, force_##chip2, force_##chip3, \
695 force_##chip4, force_##chip5, NULL }; \
696I2C_CLIENT_INSMOD_COMMON 641I2C_CLIENT_INSMOD_COMMON
697 642
698#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ 643#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \
699enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ 644enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \
700I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
701I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
702I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
703I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
704I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
705I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
706I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
707static const unsigned short * const forces[] = { force, \
708 force_##chip1, force_##chip2, force_##chip3, \
709 force_##chip4, force_##chip5, force_##chip6, NULL }; \
710I2C_CLIENT_INSMOD_COMMON 645I2C_CLIENT_INSMOD_COMMON
711 646
712#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ 647#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \
713enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ 648enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
714 chip7 }; \ 649 chip7 }; \
715I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
716I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
717I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
718I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
719I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
720I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
721I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
722I2C_CLIENT_MODULE_PARM_FORCE(chip7); \
723static const unsigned short * const forces[] = { force, \
724 force_##chip1, force_##chip2, force_##chip3, \
725 force_##chip4, force_##chip5, force_##chip6, \
726 force_##chip7, NULL }; \
727I2C_CLIENT_INSMOD_COMMON 650I2C_CLIENT_INSMOD_COMMON
728 651
729#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ 652#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \
730enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ 653enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
731 chip7, chip8 }; \ 654 chip7, chip8 }; \
732I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \
733I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
734I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
735I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
736I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
737I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
738I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
739I2C_CLIENT_MODULE_PARM_FORCE(chip7); \
740I2C_CLIENT_MODULE_PARM_FORCE(chip8); \
741static const unsigned short * const forces[] = { force, \
742 force_##chip1, force_##chip2, force_##chip3, \
743 force_##chip4, force_##chip5, force_##chip6, \
744 force_##chip7, force_##chip8, NULL }; \
745I2C_CLIENT_INSMOD_COMMON 655I2C_CLIENT_INSMOD_COMMON
746#endif /* __KERNEL__ */ 656#endif /* __KERNEL__ */
747#endif /* _LINUX_I2C_H */ 657#endif /* _LINUX_I2C_H */
diff --git a/include/linux/i2c/tps65010.h b/include/linux/i2c/tps65010.h
index 918c5354d9b8..08aa92278d71 100644
--- a/include/linux/i2c/tps65010.h
+++ b/include/linux/i2c/tps65010.h
@@ -72,6 +72,21 @@
72#define TPS_VDCDC1 0x0c 72#define TPS_VDCDC1 0x0c
73# define TPS_ENABLE_LP (1 << 3) 73# define TPS_ENABLE_LP (1 << 3)
74#define TPS_VDCDC2 0x0d 74#define TPS_VDCDC2 0x0d
75# define TPS_LP_COREOFF (1 << 7)
76# define TPS_VCORE_1_8V (7<<4)
77# define TPS_VCORE_1_5V (6 << 4)
78# define TPS_VCORE_1_4V (5 << 4)
79# define TPS_VCORE_1_3V (4 << 4)
80# define TPS_VCORE_1_2V (3 << 4)
81# define TPS_VCORE_1_1V (2 << 4)
82# define TPS_VCORE_1_0V (1 << 4)
83# define TPS_VCORE_0_85V (0 << 4)
84# define TPS_VCORE_LP_1_2V (3 << 2)
85# define TPS_VCORE_LP_1_1V (2 << 2)
86# define TPS_VCORE_LP_1_0V (1 << 2)
87# define TPS_VCORE_LP_0_85V (0 << 2)
88# define TPS_VIB (1 << 1)
89# define TPS_VCORE_DISCH (1 << 0)
75#define TPS_VREGS1 0x0e 90#define TPS_VREGS1 0x0e
76# define TPS_LDO2_ENABLE (1 << 7) 91# define TPS_LDO2_ENABLE (1 << 7)
77# define TPS_LDO2_OFF (1 << 6) 92# define TPS_LDO2_OFF (1 << 6)
@@ -152,6 +167,10 @@ extern int tps65010_config_vregs1(unsigned value);
152 */ 167 */
153extern int tps65013_set_low_pwr(unsigned mode); 168extern int tps65013_set_low_pwr(unsigned mode);
154 169
170/* tps65010_set_vdcdc2
171 * value to be written to VDCDC2
172 */
173extern int tps65010_config_vdcdc2(unsigned value);
155 174
156struct i2c_client; 175struct i2c_client;
157 176
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl.h
index 508824ee35e6..bf1c5be1f5b6 100644
--- a/include/linux/i2c/twl4030.h
+++ b/include/linux/i2c/twl.h
@@ -22,8 +22,8 @@
22 * 22 *
23 */ 23 */
24 24
25#ifndef __TWL4030_H_ 25#ifndef __TWL_H_
26#define __TWL4030_H_ 26#define __TWL_H_
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/input/matrix_keypad.h> 29#include <linux/input/matrix_keypad.h>
@@ -61,28 +61,112 @@
61#define TWL4030_MODULE_PWMA 0x0E 61#define TWL4030_MODULE_PWMA 0x0E
62#define TWL4030_MODULE_PWMB 0x0F 62#define TWL4030_MODULE_PWMB 0x0F
63 63
64#define TWL5031_MODULE_ACCESSORY 0x10
65#define TWL5031_MODULE_INTERRUPTS 0x11
66
64/* Slave 3 (i2c address 0x4b) */ 67/* Slave 3 (i2c address 0x4b) */
65#define TWL4030_MODULE_BACKUP 0x10 68#define TWL4030_MODULE_BACKUP 0x12
66#define TWL4030_MODULE_INT 0x11 69#define TWL4030_MODULE_INT 0x13
67#define TWL4030_MODULE_PM_MASTER 0x12 70#define TWL4030_MODULE_PM_MASTER 0x14
68#define TWL4030_MODULE_PM_RECEIVER 0x13 71#define TWL4030_MODULE_PM_RECEIVER 0x15
69#define TWL4030_MODULE_RTC 0x14 72#define TWL4030_MODULE_RTC 0x16
70#define TWL4030_MODULE_SECURED_REG 0x15 73#define TWL4030_MODULE_SECURED_REG 0x17
74
75#define TWL_MODULE_USB TWL4030_MODULE_USB
76#define TWL_MODULE_AUDIO_VOICE TWL4030_MODULE_AUDIO_VOICE
77#define TWL_MODULE_PIH TWL4030_MODULE_PIH
78#define TWL_MODULE_MADC TWL4030_MODULE_MADC
79#define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE
80#define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER
81#define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
82#define TWL_MODULE_RTC TWL4030_MODULE_RTC
83
84#define GPIO_INTR_OFFSET 0
85#define KEYPAD_INTR_OFFSET 1
86#define BCI_INTR_OFFSET 2
87#define MADC_INTR_OFFSET 3
88#define USB_INTR_OFFSET 4
89#define BCI_PRES_INTR_OFFSET 9
90#define USB_PRES_INTR_OFFSET 10
91#define RTC_INTR_OFFSET 11
92
93/*
94 * Offset from TWL6030_IRQ_BASE / pdata->irq_base
95 */
96#define PWR_INTR_OFFSET 0
97#define HOTDIE_INTR_OFFSET 12
98#define SMPSLDO_INTR_OFFSET 13
99#define BATDETECT_INTR_OFFSET 14
100#define SIMDETECT_INTR_OFFSET 15
101#define MMCDETECT_INTR_OFFSET 16
102#define GASGAUGE_INTR_OFFSET 17
103#define USBOTG_INTR_OFFSET 4
104#define CHARGER_INTR_OFFSET 2
105#define RSV_INTR_OFFSET 0
106
107/* INT register offsets */
108#define REG_INT_STS_A 0x00
109#define REG_INT_STS_B 0x01
110#define REG_INT_STS_C 0x02
111
112#define REG_INT_MSK_LINE_A 0x03
113#define REG_INT_MSK_LINE_B 0x04
114#define REG_INT_MSK_LINE_C 0x05
115
116#define REG_INT_MSK_STS_A 0x06
117#define REG_INT_MSK_STS_B 0x07
118#define REG_INT_MSK_STS_C 0x08
119
120/* MASK INT REG GROUP A */
121#define TWL6030_PWR_INT_MASK 0x07
122#define TWL6030_RTC_INT_MASK 0x18
123#define TWL6030_HOTDIE_INT_MASK 0x20
124#define TWL6030_SMPSLDOA_INT_MASK 0xC0
125
126/* MASK INT REG GROUP B */
127#define TWL6030_SMPSLDOB_INT_MASK 0x01
128#define TWL6030_BATDETECT_INT_MASK 0x02
129#define TWL6030_SIMDETECT_INT_MASK 0x04
130#define TWL6030_MMCDETECT_INT_MASK 0x08
131#define TWL6030_GPADC_INT_MASK 0x60
132#define TWL6030_GASGAUGE_INT_MASK 0x80
133
134/* MASK INT REG GROUP C */
135#define TWL6030_USBOTG_INT_MASK 0x0F
136#define TWL6030_CHARGER_CTRL_INT_MASK 0x10
137#define TWL6030_CHARGER_FAULT_INT_MASK 0x60
138
139
140#define TWL4030_CLASS_ID 0x4030
141#define TWL6030_CLASS_ID 0x6030
142unsigned int twl_rev(void);
143#define GET_TWL_REV (twl_rev())
144#define TWL_CLASS_IS(class, id) \
145static inline int twl_class_is_ ##class(void) \
146{ \
147 return ((id) == (GET_TWL_REV)) ? 1 : 0; \
148}
149
150TWL_CLASS_IS(4030, TWL4030_CLASS_ID)
151TWL_CLASS_IS(6030, TWL6030_CLASS_ID)
71 152
72/* 153/*
73 * Read and write single 8-bit registers 154 * Read and write single 8-bit registers
74 */ 155 */
75int twl4030_i2c_write_u8(u8 mod_no, u8 val, u8 reg); 156int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg);
76int twl4030_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); 157int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg);
77 158
78/* 159/*
79 * Read and write several 8-bit registers at once. 160 * Read and write several 8-bit registers at once.
80 * 161 *
81 * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 162 * IMPORTANT: For twl_i2c_write(), allocate num_bytes + 1
82 * for the value, and populate your data starting at offset 1. 163 * for the value, and populate your data starting at offset 1.
83 */ 164 */
84int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); 165int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
85int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); 166int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
167
168int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
169int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
86 170
87/*----------------------------------------------------------------------*/ 171/*----------------------------------------------------------------------*/
88 172
@@ -221,6 +305,38 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
221 305
222/*----------------------------------------------------------------------*/ 306/*----------------------------------------------------------------------*/
223 307
308/*
309 * Accessory Interrupts
310 */
311#define TWL5031_ACIIMR_LSB 0x05
312#define TWL5031_ACIIMR_MSB 0x06
313#define TWL5031_ACIIDR_LSB 0x07
314#define TWL5031_ACIIDR_MSB 0x08
315#define TWL5031_ACCISR1 0x0F
316#define TWL5031_ACCIMR1 0x10
317#define TWL5031_ACCISR2 0x11
318#define TWL5031_ACCIMR2 0x12
319#define TWL5031_ACCSIR 0x13
320#define TWL5031_ACCEDR1 0x14
321#define TWL5031_ACCSIHCTRL 0x15
322
323/*----------------------------------------------------------------------*/
324
325/*
326 * Battery Charger Controller
327 */
328
329#define TWL5031_INTERRUPTS_BCIISR1 0x0
330#define TWL5031_INTERRUPTS_BCIIMR1 0x1
331#define TWL5031_INTERRUPTS_BCIISR2 0x2
332#define TWL5031_INTERRUPTS_BCIIMR2 0x3
333#define TWL5031_INTERRUPTS_BCISIR 0x4
334#define TWL5031_INTERRUPTS_BCIEDR1 0x5
335#define TWL5031_INTERRUPTS_BCIEDR2 0x6
336#define TWL5031_INTERRUPTS_BCISIHCTRL 0x7
337
338/*----------------------------------------------------------------------*/
339
224/* Power bus message definitions */ 340/* Power bus message definitions */
225 341
226/* The TWL4030/5030 splits its power-management resources (the various 342/* The TWL4030/5030 splits its power-management resources (the various
@@ -250,6 +366,7 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
250 366
251#define RES_TYPE_ALL 0x7 367#define RES_TYPE_ALL 0x7
252 368
369/* Resource states */
253#define RES_STATE_WRST 0xF 370#define RES_STATE_WRST 0xF
254#define RES_STATE_ACTIVE 0xE 371#define RES_STATE_ACTIVE 0xE
255#define RES_STATE_SLEEP 0x8 372#define RES_STATE_SLEEP 0x8
@@ -310,8 +427,18 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
310#define MSG_SINGULAR(devgrp, id, state) \ 427#define MSG_SINGULAR(devgrp, id, state) \
311 ((devgrp) << 13 | 0 << 12 | (id) << 4 | (state)) 428 ((devgrp) << 13 | 0 << 12 | (id) << 4 | (state))
312 429
430#define MSG_BROADCAST_ALL(devgrp, state) \
431 ((devgrp) << 5 | (state))
432
433#define MSG_BROADCAST_REF MSG_BROADCAST_ALL
434#define MSG_BROADCAST_PROV MSG_BROADCAST_ALL
435#define MSG_BROADCAST__CLK_RST MSG_BROADCAST_ALL
313/*----------------------------------------------------------------------*/ 436/*----------------------------------------------------------------------*/
314 437
438struct twl4030_clock_init_data {
439 bool ck32k_lowpwr_enable;
440};
441
315struct twl4030_bci_platform_data { 442struct twl4030_bci_platform_data {
316 int *battery_tmp_tbl; 443 int *battery_tmp_tbl;
317 unsigned int tblsize; 444 unsigned int tblsize;
@@ -391,38 +518,73 @@ struct twl4030_resconfig {
391 u8 devgroup; /* Processor group that Power resource belongs to */ 518 u8 devgroup; /* Processor group that Power resource belongs to */
392 u8 type; /* Power resource addressed, 6 / broadcast message */ 519 u8 type; /* Power resource addressed, 6 / broadcast message */
393 u8 type2; /* Power resource addressed, 3 / broadcast message */ 520 u8 type2; /* Power resource addressed, 3 / broadcast message */
521 u8 remap_off; /* off state remapping */
522 u8 remap_sleep; /* sleep state remapping */
394}; 523};
395 524
396struct twl4030_power_data { 525struct twl4030_power_data {
397 struct twl4030_script **scripts; 526 struct twl4030_script **scripts;
398 unsigned num; 527 unsigned num;
399 struct twl4030_resconfig *resource_config; 528 struct twl4030_resconfig *resource_config;
529#define TWL4030_RESCONFIG_UNDEF ((u8)-1)
400}; 530};
401 531
402extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); 532extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
403 533
534struct twl4030_codec_audio_data {
535 unsigned int audio_mclk;
536 unsigned int ramp_delay_value;
537 unsigned int hs_extmute:1;
538 void (*set_hs_extmute)(int mute);
539};
540
541struct twl4030_codec_vibra_data {
542 unsigned int audio_mclk;
543 unsigned int coexist;
544};
545
546struct twl4030_codec_data {
547 unsigned int audio_mclk;
548 struct twl4030_codec_audio_data *audio;
549 struct twl4030_codec_vibra_data *vibra;
550};
551
404struct twl4030_platform_data { 552struct twl4030_platform_data {
405 unsigned irq_base, irq_end; 553 unsigned irq_base, irq_end;
554 struct twl4030_clock_init_data *clock;
406 struct twl4030_bci_platform_data *bci; 555 struct twl4030_bci_platform_data *bci;
407 struct twl4030_gpio_platform_data *gpio; 556 struct twl4030_gpio_platform_data *gpio;
408 struct twl4030_madc_platform_data *madc; 557 struct twl4030_madc_platform_data *madc;
409 struct twl4030_keypad_data *keypad; 558 struct twl4030_keypad_data *keypad;
410 struct twl4030_usb_data *usb; 559 struct twl4030_usb_data *usb;
411 struct twl4030_power_data *power; 560 struct twl4030_power_data *power;
561 struct twl4030_codec_data *codec;
412 562
413 /* LDO regulators */ 563 /* Common LDO regulators for TWL4030/TWL6030 */
414 struct regulator_init_data *vdac; 564 struct regulator_init_data *vdac;
565 struct regulator_init_data *vaux1;
566 struct regulator_init_data *vaux2;
567 struct regulator_init_data *vaux3;
568 /* TWL4030 LDO regulators */
415 struct regulator_init_data *vpll1; 569 struct regulator_init_data *vpll1;
416 struct regulator_init_data *vpll2; 570 struct regulator_init_data *vpll2;
417 struct regulator_init_data *vmmc1; 571 struct regulator_init_data *vmmc1;
418 struct regulator_init_data *vmmc2; 572 struct regulator_init_data *vmmc2;
419 struct regulator_init_data *vsim; 573 struct regulator_init_data *vsim;
420 struct regulator_init_data *vaux1;
421 struct regulator_init_data *vaux2;
422 struct regulator_init_data *vaux3;
423 struct regulator_init_data *vaux4; 574 struct regulator_init_data *vaux4;
424 575 struct regulator_init_data *vio;
425 /* REVISIT more to come ... _nothing_ should be hard-wired */ 576 struct regulator_init_data *vdd1;
577 struct regulator_init_data *vdd2;
578 struct regulator_init_data *vintana1;
579 struct regulator_init_data *vintana2;
580 struct regulator_init_data *vintdig;
581 /* TWL6030 LDO regulators */
582 struct regulator_init_data *vmmc;
583 struct regulator_init_data *vpp;
584 struct regulator_init_data *vusim;
585 struct regulator_init_data *vana;
586 struct regulator_init_data *vcxio;
587 struct regulator_init_data *vusb;
426}; 588};
427 589
428/*----------------------------------------------------------------------*/ 590/*----------------------------------------------------------------------*/
@@ -454,6 +616,7 @@ int twl4030_sih_setup(int module);
454 * VIO is generally fixed. 616 * VIO is generally fixed.
455 */ 617 */
456 618
619/* TWL4030 SMPS/LDO's */
457/* EXTERNAL dc-to-dc buck converters */ 620/* EXTERNAL dc-to-dc buck converters */
458#define TWL4030_REG_VDD1 0 621#define TWL4030_REG_VDD1 0
459#define TWL4030_REG_VDD2 1 622#define TWL4030_REG_VDD2 1
@@ -480,4 +643,31 @@ int twl4030_sih_setup(int module);
480#define TWL4030_REG_VUSB1V8 18 643#define TWL4030_REG_VUSB1V8 18
481#define TWL4030_REG_VUSB3V1 19 644#define TWL4030_REG_VUSB3V1 19
482 645
646/* TWL6030 SMPS/LDO's */
647/* EXTERNAL dc-to-dc buck convertor contollable via SR */
648#define TWL6030_REG_VDD1 30
649#define TWL6030_REG_VDD2 31
650#define TWL6030_REG_VDD3 32
651
652/* Non SR compliant dc-to-dc buck convertors */
653#define TWL6030_REG_VMEM 33
654#define TWL6030_REG_V2V1 34
655#define TWL6030_REG_V1V29 35
656#define TWL6030_REG_V1V8 36
657
658/* EXTERNAL LDOs */
659#define TWL6030_REG_VAUX1_6030 37
660#define TWL6030_REG_VAUX2_6030 38
661#define TWL6030_REG_VAUX3_6030 39
662#define TWL6030_REG_VMMC 40
663#define TWL6030_REG_VPP 41
664#define TWL6030_REG_VUSIM 42
665#define TWL6030_REG_VANA 43
666#define TWL6030_REG_VCXIO 44
667#define TWL6030_REG_VDAC 45
668#define TWL6030_REG_VUSB 46
669
670/* INTERNAL LDOs */
671#define TWL6030_REG_VRTC 47
672
483#endif /* End of __TWL4030_H */ 673#endif /* End of __TWL4030_H */
diff --git a/include/linux/i82593.h b/include/linux/i82593.h
new file mode 100644
index 000000000000..afac5c7a323d
--- /dev/null
+++ b/include/linux/i82593.h
@@ -0,0 +1,229 @@
1/*
2 * Definitions for Intel 82593 CSMA/CD Core LAN Controller
3 * The definitions are taken from the 1992 users manual with Intel
4 * order number 297125-001.
5 *
6 * /usr/src/pc/RCS/i82593.h,v 1.1 1996/07/17 15:23:12 root Exp
7 *
8 * Copyright 1994, Anders Klemets <klemets@it.kth.se>
9 *
10 * HISTORY
11 * i82593.h,v
12 * Revision 1.4 2005/11/4 09:15:00 baroniunas
13 * Modified copyright with permission of author as follows:
14 *
15 * "If I82539.H is the only file with my copyright statement
16 * that is included in the Source Forge project, then you have
17 * my approval to change the copyright statement to be a GPL
18 * license, in the way you proposed on October 10."
19 *
20 * Revision 1.1 1996/07/17 15:23:12 root
21 * Initial revision
22 *
23 * Revision 1.3 1995/04/05 15:13:58 adj
24 * Initial alpha release
25 *
26 * Revision 1.2 1994/06/16 23:57:31 klemets
27 * Mirrored all the fields in the configuration block.
28 *
29 * Revision 1.1 1994/06/02 20:25:34 klemets
30 * Initial revision
31 *
32 *
33 */
34#ifndef _I82593_H
35#define _I82593_H
36
37/* Intel 82593 CSMA/CD Core LAN Controller */
38
39/* Port 0 Command Register definitions */
40
41/* Execution operations */
42#define OP0_NOP 0 /* CHNL = 0 */
43#define OP0_SWIT_TO_PORT_1 0 /* CHNL = 1 */
44#define OP0_IA_SETUP 1
45#define OP0_CONFIGURE 2
46#define OP0_MC_SETUP 3
47#define OP0_TRANSMIT 4
48#define OP0_TDR 5
49#define OP0_DUMP 6
50#define OP0_DIAGNOSE 7
51#define OP0_TRANSMIT_NO_CRC 9
52#define OP0_RETRANSMIT 12
53#define OP0_ABORT 13
54/* Reception operations */
55#define OP0_RCV_ENABLE 8
56#define OP0_RCV_DISABLE 10
57#define OP0_STOP_RCV 11
58/* Status pointer control operations */
59#define OP0_FIX_PTR 15 /* CHNL = 1 */
60#define OP0_RLS_PTR 15 /* CHNL = 0 */
61#define OP0_RESET 14
62
63#define CR0_CHNL (1 << 4) /* 0=Channel 0, 1=Channel 1 */
64#define CR0_STATUS_0 0x00
65#define CR0_STATUS_1 0x20
66#define CR0_STATUS_2 0x40
67#define CR0_STATUS_3 0x60
68#define CR0_INT_ACK (1 << 7) /* 0=No ack, 1=acknowledge */
69
70/* Port 0 Status Register definitions */
71
72#define SR0_NO_RESULT 0 /* dummy */
73#define SR0_EVENT_MASK 0x0f
74#define SR0_IA_SETUP_DONE 1
75#define SR0_CONFIGURE_DONE 2
76#define SR0_MC_SETUP_DONE 3
77#define SR0_TRANSMIT_DONE 4
78#define SR0_TDR_DONE 5
79#define SR0_DUMP_DONE 6
80#define SR0_DIAGNOSE_PASSED 7
81#define SR0_TRANSMIT_NO_CRC_DONE 9
82#define SR0_RETRANSMIT_DONE 12
83#define SR0_EXECUTION_ABORTED 13
84#define SR0_END_OF_FRAME 8
85#define SR0_RECEPTION_ABORTED 10
86#define SR0_DIAGNOSE_FAILED 15
87#define SR0_STOP_REG_HIT 11
88
89#define SR0_CHNL (1 << 4)
90#define SR0_EXECUTION (1 << 5)
91#define SR0_RECEPTION (1 << 6)
92#define SR0_INTERRUPT (1 << 7)
93#define SR0_BOTH_RX_TX (SR0_EXECUTION | SR0_RECEPTION)
94
95#define SR3_EXEC_STATE_MASK 0x03
96#define SR3_EXEC_IDLE 0
97#define SR3_TX_ABORT_IN_PROGRESS 1
98#define SR3_EXEC_ACTIVE 2
99#define SR3_ABORT_IN_PROGRESS 3
100#define SR3_EXEC_CHNL (1 << 2)
101#define SR3_STP_ON_NO_RSRC (1 << 3)
102#define SR3_RCVING_NO_RSRC (1 << 4)
103#define SR3_RCV_STATE_MASK 0x60
104#define SR3_RCV_IDLE 0x00
105#define SR3_RCV_READY 0x20
106#define SR3_RCV_ACTIVE 0x40
107#define SR3_RCV_STOP_IN_PROG 0x60
108#define SR3_RCV_CHNL (1 << 7)
109
110/* Port 1 Command Register definitions */
111
112#define OP1_NOP 0
113#define OP1_SWIT_TO_PORT_0 1
114#define OP1_INT_DISABLE 2
115#define OP1_INT_ENABLE 3
116#define OP1_SET_TS 5
117#define OP1_RST_TS 7
118#define OP1_POWER_DOWN 8
119#define OP1_RESET_RING_MNGMT 11
120#define OP1_RESET 14
121#define OP1_SEL_RST 15
122
123#define CR1_STATUS_4 0x00
124#define CR1_STATUS_5 0x20
125#define CR1_STATUS_6 0x40
126#define CR1_STOP_REG_UPDATE (1 << 7)
127
128/* Receive frame status bits */
129
130#define RX_RCLD (1 << 0)
131#define RX_IA_MATCH (1 << 1)
132#define RX_NO_AD_MATCH (1 << 2)
133#define RX_NO_SFD (1 << 3)
134#define RX_SRT_FRM (1 << 7)
135#define RX_OVRRUN (1 << 8)
136#define RX_ALG_ERR (1 << 10)
137#define RX_CRC_ERR (1 << 11)
138#define RX_LEN_ERR (1 << 12)
139#define RX_RCV_OK (1 << 13)
140#define RX_TYP_LEN (1 << 15)
141
142/* Transmit status bits */
143
144#define TX_NCOL_MASK 0x0f
145#define TX_FRTL (1 << 4)
146#define TX_MAX_COL (1 << 5)
147#define TX_HRT_BEAT (1 << 6)
148#define TX_DEFER (1 << 7)
149#define TX_UND_RUN (1 << 8)
150#define TX_LOST_CTS (1 << 9)
151#define TX_LOST_CRS (1 << 10)
152#define TX_LTCOL (1 << 11)
153#define TX_OK (1 << 13)
154#define TX_COLL (1 << 15)
155
156struct i82593_conf_block {
157 u_char fifo_limit : 4,
158 forgnesi : 1,
159 fifo_32 : 1,
160 d6mod : 1,
161 throttle_enb : 1;
162 u_char throttle : 6,
163 cntrxint : 1,
164 contin : 1;
165 u_char addr_len : 3,
166 acloc : 1,
167 preamb_len : 2,
168 loopback : 2;
169 u_char lin_prio : 3,
170 tbofstop : 1,
171 exp_prio : 3,
172 bof_met : 1;
173 u_char : 4,
174 ifrm_spc : 4;
175 u_char : 5,
176 slottim_low : 3;
177 u_char slottim_hi : 3,
178 : 1,
179 max_retr : 4;
180 u_char prmisc : 1,
181 bc_dis : 1,
182 : 1,
183 crs_1 : 1,
184 nocrc_ins : 1,
185 crc_1632 : 1,
186 : 1,
187 crs_cdt : 1;
188 u_char cs_filter : 3,
189 crs_src : 1,
190 cd_filter : 3,
191 : 1;
192 u_char : 2,
193 min_fr_len : 6;
194 u_char lng_typ : 1,
195 lng_fld : 1,
196 rxcrc_xf : 1,
197 artx : 1,
198 sarec : 1,
199 tx_jabber : 1, /* why is this called max_len in the manual? */
200 hash_1 : 1,
201 lbpkpol : 1;
202 u_char : 6,
203 fdx : 1,
204 : 1;
205 u_char dummy_6 : 6, /* supposed to be ones */
206 mult_ia : 1,
207 dis_bof : 1;
208 u_char dummy_1 : 1, /* supposed to be one */
209 tx_ifs_retrig : 2,
210 mc_all : 1,
211 rcv_mon : 2,
212 frag_acpt : 1,
213 tstrttrs : 1;
214 u_char fretx : 1,
215 runt_eop : 1,
216 hw_sw_pin : 1,
217 big_endn : 1,
218 syncrqs : 1,
219 sttlen : 1,
220 tx_eop : 1,
221 rx_eop : 1;
222 u_char rbuf_size : 5,
223 rcvstop : 1,
224 : 2;
225};
226
227#define I82593_MAX_MULTICAST_ADDRESSES 128 /* Hardware hashed filter */
228
229#endif /* _I82593_H */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index e4135d6e0556..0ec612959042 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -125,8 +125,8 @@ struct ide_io_ports {
125 * Timeouts for various operations: 125 * Timeouts for various operations:
126 */ 126 */
127enum { 127enum {
128 /* spec allows up to 20ms */ 128 /* spec allows up to 20ms, but CF cards and SSD drives need more */
129 WAIT_DRQ = HZ / 10, /* 100ms */ 129 WAIT_DRQ = 1 * HZ, /* 1s */
130 /* some laptops are very slow */ 130 /* some laptops are very slow */
131 WAIT_READY = 5 * HZ, /* 5s */ 131 WAIT_READY = 5 * HZ, /* 5s */
132 /* should be less than 3ms (?), if all ATAPI CD is closed at boot */ 132 /* should be less than 3ms (?), if all ATAPI CD is closed at boot */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 52e15e079c61..d9724a28c0c2 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -115,7 +115,6 @@
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 24
119 118
120#define IEEE80211_QOS_CTL_LEN 2 119#define IEEE80211_QOS_CTL_LEN 2
121#define IEEE80211_QOS_CTL_TID_MASK 0x000F 120#define IEEE80211_QOS_CTL_TID_MASK 0x000F
@@ -472,7 +471,7 @@ static inline int ieee80211_is_cfendack(__le16 fc)
472} 471}
473 472
474/** 473/**
475 * ieee80211_is_nullfunc - check if FTYPE=IEEE80211_FTYPE_DATA and STYPE=IEEE80211_STYPE_NULLFUNC 474 * ieee80211_is_nullfunc - check if frame is a regular (non-QoS) nullfunc frame
476 * @fc: frame control bytes in little-endian byteorder 475 * @fc: frame control bytes in little-endian byteorder
477 */ 476 */
478static inline int ieee80211_is_nullfunc(__le16 fc) 477static inline int ieee80211_is_nullfunc(__le16 fc)
@@ -481,6 +480,16 @@ static inline int ieee80211_is_nullfunc(__le16 fc)
481 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); 480 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC);
482} 481}
483 482
483/**
484 * ieee80211_is_qos_nullfunc - check if frame is a QoS nullfunc frame
485 * @fc: frame control bytes in little-endian byteorder
486 */
487static inline int ieee80211_is_qos_nullfunc(__le16 fc)
488{
489 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
490 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC);
491}
492
484struct ieee80211s_hdr { 493struct ieee80211s_hdr {
485 u8 flags; 494 u8 flags;
486 u8 ttl; 495 u8 ttl;
@@ -544,6 +553,35 @@ struct ieee80211_tim_ie {
544 u8 virtual_map[1]; 553 u8 virtual_map[1];
545} __attribute__ ((packed)); 554} __attribute__ ((packed));
546 555
556/**
557 * struct ieee80211_meshconf_ie
558 *
559 * This structure refers to "Mesh Configuration information element"
560 */
561struct ieee80211_meshconf_ie {
562 u8 meshconf_psel;
563 u8 meshconf_pmetric;
564 u8 meshconf_congest;
565 u8 meshconf_synch;
566 u8 meshconf_auth;
567 u8 meshconf_form;
568 u8 meshconf_cap;
569} __attribute__ ((packed));
570
571/**
572 * struct ieee80211_rann_ie
573 *
574 * This structure refers to "Root Announcement information element"
575 */
576struct ieee80211_rann_ie {
577 u8 rann_flags;
578 u8 rann_hopcount;
579 u8 rann_ttl;
580 u8 rann_addr[6];
581 u32 rann_seq;
582 u32 rann_metric;
583} __attribute__ ((packed));
584
547#define WLAN_SA_QUERY_TR_ID_LEN 2 585#define WLAN_SA_QUERY_TR_ID_LEN 2
548 586
549struct ieee80211_mgmt { 587struct ieee80211_mgmt {
@@ -1060,6 +1098,7 @@ enum ieee80211_eid {
1060 WLAN_EID_PREQ = 68, 1098 WLAN_EID_PREQ = 68,
1061 WLAN_EID_PREP = 69, 1099 WLAN_EID_PREP = 69,
1062 WLAN_EID_PERR = 70, 1100 WLAN_EID_PERR = 70,
1101 WLAN_EID_RANN = 49, /* compatible with FreeBSD */
1063 /* 802.11h */ 1102 /* 802.11h */
1064 WLAN_EID_PWR_CONSTRAINT = 32, 1103 WLAN_EID_PWR_CONSTRAINT = 32,
1065 WLAN_EID_PWR_CAPABILITY = 33, 1104 WLAN_EID_PWR_CAPABILITY = 33,
@@ -1227,6 +1266,8 @@ enum ieee80211_sa_query_action {
1227 1266
1228#define WLAN_MAX_KEY_LEN 32 1267#define WLAN_MAX_KEY_LEN 32
1229 1268
1269#define WLAN_PMKID_LEN 16
1270
1230/** 1271/**
1231 * ieee80211_get_qos_ctl - get pointer to qos control bytes 1272 * ieee80211_get_qos_ctl - get pointer to qos control bytes
1232 * @hdr: the frame 1273 * @hdr: the frame
diff --git a/include/linux/if.h b/include/linux/if.h
index b9a6229f3be7..3a9f410a296b 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -70,6 +70,7 @@
70#define IFF_XMIT_DST_RELEASE 0x400 /* dev_hard_start_xmit() is allowed to 70#define IFF_XMIT_DST_RELEASE 0x400 /* dev_hard_start_xmit() is allowed to
71 * release skb->dst 71 * release skb->dst
72 */ 72 */
73#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
73 74
74#define IF_GET_IFACE 0x0001 /* for querying only */ 75#define IF_GET_IFACE 0x0001 /* for querying only */
75#define IF_GET_PROTO 0x0002 76#define IF_GET_PROTO 0x0002
@@ -125,8 +126,7 @@ enum {
125 * being very small might be worth keeping for clean configuration. 126 * being very small might be worth keeping for clean configuration.
126 */ 127 */
127 128
128struct ifmap 129struct ifmap {
129{
130 unsigned long mem_start; 130 unsigned long mem_start;
131 unsigned long mem_end; 131 unsigned long mem_end;
132 unsigned short base_addr; 132 unsigned short base_addr;
@@ -136,8 +136,7 @@ struct ifmap
136 /* 3 bytes spare */ 136 /* 3 bytes spare */
137}; 137};
138 138
139struct if_settings 139struct if_settings {
140{
141 unsigned int type; /* Type of physical device or protocol */ 140 unsigned int type; /* Type of physical device or protocol */
142 unsigned int size; /* Size of the data allocated by the caller */ 141 unsigned int size; /* Size of the data allocated by the caller */
143 union { 142 union {
@@ -161,8 +160,7 @@ struct if_settings
161 * remainder may be interface specific. 160 * remainder may be interface specific.
162 */ 161 */
163 162
164struct ifreq 163struct ifreq {
165{
166#define IFHWADDRLEN 6 164#define IFHWADDRLEN 6
167 union 165 union
168 { 166 {
@@ -211,11 +209,9 @@ struct ifreq
211 * must know all networks accessible). 209 * must know all networks accessible).
212 */ 210 */
213 211
214struct ifconf 212struct ifconf {
215{
216 int ifc_len; /* size of buffer */ 213 int ifc_len; /* size of buffer */
217 union 214 union {
218 {
219 char __user *ifcu_buf; 215 char __user *ifcu_buf;
220 struct ifreq __user *ifcu_req; 216 struct ifreq __user *ifcu_req;
221 } ifc_ifcu; 217 } ifc_ifcu;
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h
index fd9740466757..23357ab81a77 100644
--- a/include/linux/if_addr.h
+++ b/include/linux/if_addr.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netlink.h> 5#include <linux/netlink.h>
6 6
7struct ifaddrmsg 7struct ifaddrmsg {
8{
9 __u8 ifa_family; 8 __u8 ifa_family;
10 __u8 ifa_prefixlen; /* The prefix length */ 9 __u8 ifa_prefixlen; /* The prefix length */
11 __u8 ifa_flags; /* Flags */ 10 __u8 ifa_flags; /* Flags */
@@ -20,8 +19,7 @@ struct ifaddrmsg
20 * but for point-to-point IFA_ADDRESS is DESTINATION address, 19 * but for point-to-point IFA_ADDRESS is DESTINATION address,
21 * local address is supplied in IFA_LOCAL attribute. 20 * local address is supplied in IFA_LOCAL attribute.
22 */ 21 */
23enum 22enum {
24{
25 IFA_UNSPEC, 23 IFA_UNSPEC,
26 IFA_ADDRESS, 24 IFA_ADDRESS,
27 IFA_LOCAL, 25 IFA_LOCAL,
@@ -47,8 +45,7 @@ enum
47#define IFA_F_TENTATIVE 0x40 45#define IFA_F_TENTATIVE 0x40
48#define IFA_F_PERMANENT 0x80 46#define IFA_F_PERMANENT 0x80
49 47
50struct ifa_cacheinfo 48struct ifa_cacheinfo {
51{
52 __u32 ifa_prefered; 49 __u32 ifa_prefered;
53 __u32 ifa_valid; 50 __u32 ifa_valid;
54 __u32 cstamp; /* created timestamp, hundredths of seconds */ 51 __u32 cstamp; /* created timestamp, hundredths of seconds */
diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h
index 89571f65d6de..54580c298187 100644
--- a/include/linux/if_addrlabel.h
+++ b/include/linux/if_addrlabel.h
@@ -12,8 +12,7 @@
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14 14
15struct ifaddrlblmsg 15struct ifaddrlblmsg {
16{
17 __u8 ifal_family; /* Address family */ 16 __u8 ifal_family; /* Address family */
18 __u8 __ifal_reserved; /* Reserved */ 17 __u8 __ifal_reserved; /* Reserved */
19 __u8 ifal_prefixlen; /* Prefix length */ 18 __u8 ifal_prefixlen; /* Prefix length */
@@ -22,8 +21,7 @@ struct ifaddrlblmsg
22 __u32 ifal_seq; /* sequence number */ 21 __u32 ifal_seq; /* sequence number */
23}; 22};
24 23
25enum 24enum {
26{
27 IFAL_ADDRESS = 1, 25 IFAL_ADDRESS = 1,
28 IFAL_LABEL = 2, 26 IFAL_LABEL = 2,
29 __IFAL_MAX 27 __IFAL_MAX
diff --git a/include/linux/if_arcnet.h b/include/linux/if_arcnet.h
index 0835debab115..46e34bd0e783 100644
--- a/include/linux/if_arcnet.h
+++ b/include/linux/if_arcnet.h
@@ -56,8 +56,7 @@
56/* 56/*
57 * The RFC1201-specific components of an arcnet packet header. 57 * The RFC1201-specific components of an arcnet packet header.
58 */ 58 */
59struct arc_rfc1201 59struct arc_rfc1201 {
60{
61 __u8 proto; /* protocol ID field - varies */ 60 __u8 proto; /* protocol ID field - varies */
62 __u8 split_flag; /* for use with split packets */ 61 __u8 split_flag; /* for use with split packets */
63 __be16 sequence; /* sequence number */ 62 __be16 sequence; /* sequence number */
@@ -69,8 +68,7 @@ struct arc_rfc1201
69/* 68/*
70 * The RFC1051-specific components. 69 * The RFC1051-specific components.
71 */ 70 */
72struct arc_rfc1051 71struct arc_rfc1051 {
73{
74 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */ 72 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
75 __u8 payload[0]; /* 507 bytes */ 73 __u8 payload[0]; /* 507 bytes */
76}; 74};
@@ -81,8 +79,7 @@ struct arc_rfc1051
81 * The ethernet-encap-specific components. We have a real ethernet header 79 * The ethernet-encap-specific components. We have a real ethernet header
82 * and some data. 80 * and some data.
83 */ 81 */
84struct arc_eth_encap 82struct arc_eth_encap {
85{
86 __u8 proto; /* Always ARC_P_ETHER */ 83 __u8 proto; /* Always ARC_P_ETHER */
87 struct ethhdr eth; /* standard ethernet header (yuck!) */ 84 struct ethhdr eth; /* standard ethernet header (yuck!) */
88 __u8 payload[0]; /* 493 bytes */ 85 __u8 payload[0]; /* 493 bytes */
@@ -90,8 +87,7 @@ struct arc_eth_encap
90#define ETH_ENCAP_HDR_SIZE 14 87#define ETH_ENCAP_HDR_SIZE 14
91 88
92 89
93struct arc_cap 90struct arc_cap {
94{
95 __u8 proto; 91 __u8 proto;
96 __u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */ 92 __u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */
97 union { 93 union {
@@ -108,8 +104,7 @@ struct arc_cap
108 * the _end_ of the 512-byte buffer. We hide this complexity inside the 104 * the _end_ of the 512-byte buffer. We hide this complexity inside the
109 * driver. 105 * driver.
110 */ 106 */
111struct arc_hardware 107struct arc_hardware {
112{
113 __u8 source, /* source ARCnet - filled in automagically */ 108 __u8 source, /* source ARCnet - filled in automagically */
114 dest, /* destination ARCnet - 0 for broadcast */ 109 dest, /* destination ARCnet - 0 for broadcast */
115 offset[2]; /* offset bytes (some weird semantics) */ 110 offset[2]; /* offset bytes (some weird semantics) */
@@ -120,8 +115,7 @@ struct arc_hardware
120 * This is an ARCnet frame header, as seen by the kernel (and userspace, 115 * This is an ARCnet frame header, as seen by the kernel (and userspace,
121 * when you do a raw packet capture). 116 * when you do a raw packet capture).
122 */ 117 */
123struct archdr 118struct archdr {
124{
125 /* hardware requirements */ 119 /* hardware requirements */
126 struct arc_hardware hard; 120 struct arc_hardware hard;
127 121
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 282eb37e2dec..e80b7f88f7c6 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -133,8 +133,7 @@ struct arpreq_old {
133 * This structure defines an ethernet arp header. 133 * This structure defines an ethernet arp header.
134 */ 134 */
135 135
136struct arphdr 136struct arphdr {
137{
138 __be16 ar_hrd; /* format of hardware address */ 137 __be16 ar_hrd; /* format of hardware address */
139 __be16 ar_pro; /* format of protocol address */ 138 __be16 ar_pro; /* format of protocol address */
140 unsigned char ar_hln; /* length of hardware address */ 139 unsigned char ar_hln; /* length of hardware address */
diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h
index 65c2d247068b..cd525fae3c98 100644
--- a/include/linux/if_bonding.h
+++ b/include/linux/if_bonding.h
@@ -94,8 +94,7 @@ typedef struct ifbond {
94 __s32 miimon; 94 __s32 miimon;
95} ifbond; 95} ifbond;
96 96
97typedef struct ifslave 97typedef struct ifslave {
98{
99 __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */ 98 __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
100 char slave_name[IFNAMSIZ]; 99 char slave_name[IFNAMSIZ];
101 __s8 link; 100 __s8 link;
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 6badb3e2c4e4..938b7e81df95 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -49,8 +49,7 @@
49#define BR_STATE_FORWARDING 3 49#define BR_STATE_FORWARDING 3
50#define BR_STATE_BLOCKING 4 50#define BR_STATE_BLOCKING 4
51 51
52struct __bridge_info 52struct __bridge_info {
53{
54 __u64 designated_root; 53 __u64 designated_root;
55 __u64 bridge_id; 54 __u64 bridge_id;
56 __u32 root_path_cost; 55 __u32 root_path_cost;
@@ -72,8 +71,7 @@ struct __bridge_info
72 __u32 gc_timer_value; 71 __u32 gc_timer_value;
73}; 72};
74 73
75struct __port_info 74struct __port_info {
76{
77 __u64 designated_root; 75 __u64 designated_root;
78 __u64 designated_bridge; 76 __u64 designated_bridge;
79 __u16 port_id; 77 __u16 port_id;
@@ -89,8 +87,7 @@ struct __port_info
89 __u32 hold_timer_value; 87 __u32 hold_timer_value;
90}; 88};
91 89
92struct __fdb_entry 90struct __fdb_entry {
93{
94 __u8 mac_addr[6]; 91 __u8 mac_addr[6];
95 __u8 port_no; 92 __u8 port_no;
96 __u8 is_local; 93 __u8 is_local;
diff --git a/include/linux/if_ec.h b/include/linux/if_ec.h
index e7499aa79783..d85f9f48129f 100644
--- a/include/linux/if_ec.h
+++ b/include/linux/if_ec.h
@@ -5,14 +5,12 @@
5 5
6/* User visible stuff. Glibc provides its own but libc5 folk will use these */ 6/* User visible stuff. Glibc provides its own but libc5 folk will use these */
7 7
8struct ec_addr 8struct ec_addr {
9{
10 unsigned char station; /* Station number. */ 9 unsigned char station; /* Station number. */
11 unsigned char net; /* Network number. */ 10 unsigned char net; /* Network number. */
12}; 11};
13 12
14struct sockaddr_ec 13struct sockaddr_ec {
15{
16 unsigned short sec_family; 14 unsigned short sec_family;
17 unsigned char port; /* Port number. */ 15 unsigned char port; /* Port number. */
18 unsigned char cb; /* Control/flag byte. */ 16 unsigned char cb; /* Control/flag byte. */
@@ -37,8 +35,7 @@ struct sockaddr_ec
37#define EC_HLEN 6 35#define EC_HLEN 6
38 36
39/* This is what an Econet frame looks like on the wire. */ 37/* This is what an Econet frame looks like on the wire. */
40struct ec_framehdr 38struct ec_framehdr {
41{
42 unsigned char dst_stn; 39 unsigned char dst_stn;
43 unsigned char dst_net; 40 unsigned char dst_net;
44 unsigned char src_stn; 41 unsigned char src_stn;
@@ -62,8 +59,7 @@ static inline struct econet_sock *ec_sk(const struct sock *sk)
62 return (struct econet_sock *)sk; 59 return (struct econet_sock *)sk;
63} 60}
64 61
65struct ec_device 62struct ec_device {
66{
67 unsigned char station, net; /* Econet protocol address */ 63 unsigned char station, net; /* Econet protocol address */
68}; 64};
69 65
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 580b6004d00e..299b4121f914 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -136,13 +136,7 @@ extern struct ctl_table ether_table[];
136 136
137extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); 137extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
138 138
139/*
140 * Display a 6 byte device address (MAC) in a readable format.
141 */
142extern char *print_mac(char *buf, const unsigned char *addr) __deprecated;
143#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" 139#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
144#define MAC_BUF_SIZE 18
145#define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE]
146 140
147#endif 141#endif
148 142
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index 45de1046dbbf..5459c5c09930 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -63,36 +63,32 @@
63#define FDDI_UI_CMD 0x03 63#define FDDI_UI_CMD 0x03
64 64
65/* Define 802.2 Type 1 header */ 65/* Define 802.2 Type 1 header */
66struct fddi_8022_1_hdr 66struct fddi_8022_1_hdr {
67 {
68 __u8 dsap; /* destination service access point */ 67 __u8 dsap; /* destination service access point */
69 __u8 ssap; /* source service access point */ 68 __u8 ssap; /* source service access point */
70 __u8 ctrl; /* control byte #1 */ 69 __u8 ctrl; /* control byte #1 */
71 } __attribute__ ((packed)); 70} __attribute__ ((packed));
72 71
73/* Define 802.2 Type 2 header */ 72/* Define 802.2 Type 2 header */
74struct fddi_8022_2_hdr 73struct fddi_8022_2_hdr {
75 {
76 __u8 dsap; /* destination service access point */ 74 __u8 dsap; /* destination service access point */
77 __u8 ssap; /* source service access point */ 75 __u8 ssap; /* source service access point */
78 __u8 ctrl_1; /* control byte #1 */ 76 __u8 ctrl_1; /* control byte #1 */
79 __u8 ctrl_2; /* control byte #2 */ 77 __u8 ctrl_2; /* control byte #2 */
80 } __attribute__ ((packed)); 78} __attribute__ ((packed));
81 79
82/* Define 802.2 SNAP header */ 80/* Define 802.2 SNAP header */
83#define FDDI_K_OUI_LEN 3 81#define FDDI_K_OUI_LEN 3
84struct fddi_snap_hdr 82struct fddi_snap_hdr {
85 {
86 __u8 dsap; /* always 0xAA */ 83 __u8 dsap; /* always 0xAA */
87 __u8 ssap; /* always 0xAA */ 84 __u8 ssap; /* always 0xAA */
88 __u8 ctrl; /* always 0x03 */ 85 __u8 ctrl; /* always 0x03 */
89 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ 86 __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
90 __be16 ethertype; /* packet type ID field */ 87 __be16 ethertype; /* packet type ID field */
91 } __attribute__ ((packed)); 88} __attribute__ ((packed));
92 89
93/* Define FDDI LLC frame header */ 90/* Define FDDI LLC frame header */
94struct fddihdr 91struct fddihdr {
95 {
96 __u8 fc; /* frame control */ 92 __u8 fc; /* frame control */
97 __u8 daddr[FDDI_K_ALEN]; /* destination address */ 93 __u8 daddr[FDDI_K_ALEN]; /* destination address */
98 __u8 saddr[FDDI_K_ALEN]; /* source address */ 94 __u8 saddr[FDDI_K_ALEN]; /* source address */
@@ -102,7 +98,7 @@ struct fddihdr
102 struct fddi_8022_2_hdr llc_8022_2; 98 struct fddi_8022_2_hdr llc_8022_2;
103 struct fddi_snap_hdr llc_snap; 99 struct fddi_snap_hdr llc_snap;
104 } hdr; 100 } hdr;
105 } __attribute__ ((packed)); 101} __attribute__ ((packed));
106 102
107#ifdef __KERNEL__ 103#ifdef __KERNEL__
108#include <linux/netdevice.h> 104#include <linux/netdevice.h>
@@ -197,7 +193,7 @@ struct fddi_statistics {
197 __u32 port_pc_withhold[2]; 193 __u32 port_pc_withhold[2];
198 __u32 port_ler_flag[2]; 194 __u32 port_ler_flag[2];
199 __u32 port_hardware_present[2]; 195 __u32 port_hardware_present[2];
200 }; 196};
201#endif /* __KERNEL__ */ 197#endif /* __KERNEL__ */
202 198
203#endif /* _LINUX_IF_FDDI_H */ 199#endif /* _LINUX_IF_FDDI_H */
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h
index 4a7c9940b080..8d038eb8db5c 100644
--- a/include/linux/if_hippi.h
+++ b/include/linux/if_hippi.h
@@ -51,8 +51,7 @@
51 * HIPPI statistics collection data. 51 * HIPPI statistics collection data.
52 */ 52 */
53 53
54struct hipnet_statistics 54struct hipnet_statistics {
55{
56 int rx_packets; /* total packets received */ 55 int rx_packets; /* total packets received */
57 int tx_packets; /* total packets transmitted */ 56 int tx_packets; /* total packets transmitted */
58 int rx_errors; /* bad packets received */ 57 int rx_errors; /* bad packets received */
@@ -77,8 +76,7 @@ struct hipnet_statistics
77}; 76};
78 77
79 78
80struct hippi_fp_hdr 79struct hippi_fp_hdr {
81{
82#if 0 80#if 0
83 __u8 ulp; /* must contain 4 */ 81 __u8 ulp; /* must contain 4 */
84#if defined (__BIG_ENDIAN_BITFIELD) 82#if defined (__BIG_ENDIAN_BITFIELD)
@@ -108,8 +106,7 @@ struct hippi_fp_hdr
108 __be32 d2_size; 106 __be32 d2_size;
109} __attribute__ ((packed)); 107} __attribute__ ((packed));
110 108
111struct hippi_le_hdr 109struct hippi_le_hdr {
112{
113#if defined (__BIG_ENDIAN_BITFIELD) 110#if defined (__BIG_ENDIAN_BITFIELD)
114 __u8 fc:3; 111 __u8 fc:3;
115 __u8 double_wide:1; 112 __u8 double_wide:1;
@@ -139,8 +136,7 @@ struct hippi_le_hdr
139 * Looks like the dsap and ssap fields have been swapped by mistake in 136 * Looks like the dsap and ssap fields have been swapped by mistake in
140 * RFC 2067 "IP over HIPPI". 137 * RFC 2067 "IP over HIPPI".
141 */ 138 */
142struct hippi_snap_hdr 139struct hippi_snap_hdr {
143{
144 __u8 dsap; /* always 0xAA */ 140 __u8 dsap; /* always 0xAA */
145 __u8 ssap; /* always 0xAA */ 141 __u8 ssap; /* always 0xAA */
146 __u8 ctrl; /* always 0x03 */ 142 __u8 ctrl; /* always 0x03 */
@@ -148,8 +144,7 @@ struct hippi_snap_hdr
148 __be16 ethertype; /* packet type ID field */ 144 __be16 ethertype; /* packet type ID field */
149} __attribute__ ((packed)); 145} __attribute__ ((packed));
150 146
151struct hippi_hdr 147struct hippi_hdr {
152{
153 struct hippi_fp_hdr fp; 148 struct hippi_fp_hdr fp;
154 struct hippi_le_hdr le; 149 struct hippi_le_hdr le;
155 struct hippi_snap_hdr snap; 150 struct hippi_snap_hdr snap;
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 176c5182c515..6674791622ca 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -5,8 +5,7 @@
5#include <linux/netlink.h> 5#include <linux/netlink.h>
6 6
7/* The struct should be in sync with struct net_device_stats */ 7/* The struct should be in sync with struct net_device_stats */
8struct rtnl_link_stats 8struct rtnl_link_stats {
9{
10 __u32 rx_packets; /* total packets received */ 9 __u32 rx_packets; /* total packets received */
11 __u32 tx_packets; /* total packets transmitted */ 10 __u32 tx_packets; /* total packets transmitted */
12 __u32 rx_bytes; /* total bytes received */ 11 __u32 rx_bytes; /* total bytes received */
@@ -39,8 +38,7 @@ struct rtnl_link_stats
39}; 38};
40 39
41/* The struct should be in sync with struct ifmap */ 40/* The struct should be in sync with struct ifmap */
42struct rtnl_link_ifmap 41struct rtnl_link_ifmap {
43{
44 __u64 mem_start; 42 __u64 mem_start;
45 __u64 mem_end; 43 __u64 mem_end;
46 __u64 base_addr; 44 __u64 base_addr;
@@ -49,8 +47,7 @@ struct rtnl_link_ifmap
49 __u8 port; 47 __u8 port;
50}; 48};
51 49
52enum 50enum {
53{
54 IFLA_UNSPEC, 51 IFLA_UNSPEC,
55 IFLA_ADDRESS, 52 IFLA_ADDRESS,
56 IFLA_BROADCAST, 53 IFLA_BROADCAST,
@@ -123,8 +120,7 @@ enum
123 */ 120 */
124 121
125/* Subtype attributes for IFLA_PROTINFO */ 122/* Subtype attributes for IFLA_PROTINFO */
126enum 123enum {
127{
128 IFLA_INET6_UNSPEC, 124 IFLA_INET6_UNSPEC,
129 IFLA_INET6_FLAGS, /* link flags */ 125 IFLA_INET6_FLAGS, /* link flags */
130 IFLA_INET6_CONF, /* sysctl parameters */ 126 IFLA_INET6_CONF, /* sysctl parameters */
@@ -137,16 +133,14 @@ enum
137 133
138#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) 134#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
139 135
140struct ifla_cacheinfo 136struct ifla_cacheinfo {
141{
142 __u32 max_reasm_len; 137 __u32 max_reasm_len;
143 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ 138 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
144 __u32 reachable_time; 139 __u32 reachable_time;
145 __u32 retrans_time; 140 __u32 retrans_time;
146}; 141};
147 142
148enum 143enum {
149{
150 IFLA_INFO_UNSPEC, 144 IFLA_INFO_UNSPEC,
151 IFLA_INFO_KIND, 145 IFLA_INFO_KIND,
152 IFLA_INFO_DATA, 146 IFLA_INFO_DATA,
@@ -158,8 +152,7 @@ enum
158 152
159/* VLAN section */ 153/* VLAN section */
160 154
161enum 155enum {
162{
163 IFLA_VLAN_UNSPEC, 156 IFLA_VLAN_UNSPEC,
164 IFLA_VLAN_ID, 157 IFLA_VLAN_ID,
165 IFLA_VLAN_FLAGS, 158 IFLA_VLAN_FLAGS,
@@ -175,8 +168,7 @@ struct ifla_vlan_flags {
175 __u32 mask; 168 __u32 mask;
176}; 169};
177 170
178enum 171enum {
179{
180 IFLA_VLAN_QOS_UNSPEC, 172 IFLA_VLAN_QOS_UNSPEC,
181 IFLA_VLAN_QOS_MAPPING, 173 IFLA_VLAN_QOS_MAPPING,
182 __IFLA_VLAN_QOS_MAX 174 __IFLA_VLAN_QOS_MAX
@@ -184,10 +176,24 @@ enum
184 176
185#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1) 177#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
186 178
187struct ifla_vlan_qos_mapping 179struct ifla_vlan_qos_mapping {
188{
189 __u32 from; 180 __u32 from;
190 __u32 to; 181 __u32 to;
191}; 182};
192 183
184/* MACVLAN section */
185enum {
186 IFLA_MACVLAN_UNSPEC,
187 IFLA_MACVLAN_MODE,
188 __IFLA_MACVLAN_MAX,
189};
190
191#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
192
193enum macvlan_mode {
194 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
195 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
196 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
197};
198
193#endif /* _LINUX_IF_LINK_H */ 199#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index dea7d6b7cf98..4021d47cc437 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -3,15 +3,13 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct sockaddr_pkt 6struct sockaddr_pkt {
7{
8 unsigned short spkt_family; 7 unsigned short spkt_family;
9 unsigned char spkt_device[14]; 8 unsigned char spkt_device[14];
10 __be16 spkt_protocol; 9 __be16 spkt_protocol;
11}; 10};
12 11
13struct sockaddr_ll 12struct sockaddr_ll {
14{
15 unsigned short sll_family; 13 unsigned short sll_family;
16 __be16 sll_protocol; 14 __be16 sll_protocol;
17 int sll_ifindex; 15 int sll_ifindex;
@@ -49,14 +47,12 @@ struct sockaddr_ll
49#define PACKET_TX_RING 13 47#define PACKET_TX_RING 13
50#define PACKET_LOSS 14 48#define PACKET_LOSS 14
51 49
52struct tpacket_stats 50struct tpacket_stats {
53{
54 unsigned int tp_packets; 51 unsigned int tp_packets;
55 unsigned int tp_drops; 52 unsigned int tp_drops;
56}; 53};
57 54
58struct tpacket_auxdata 55struct tpacket_auxdata {
59{
60 __u32 tp_status; 56 __u32 tp_status;
61 __u32 tp_len; 57 __u32 tp_len;
62 __u32 tp_snaplen; 58 __u32 tp_snaplen;
@@ -78,8 +74,7 @@ struct tpacket_auxdata
78#define TP_STATUS_SENDING 0x2 74#define TP_STATUS_SENDING 0x2
79#define TP_STATUS_WRONG_FORMAT 0x4 75#define TP_STATUS_WRONG_FORMAT 0x4
80 76
81struct tpacket_hdr 77struct tpacket_hdr {
82{
83 unsigned long tp_status; 78 unsigned long tp_status;
84 unsigned int tp_len; 79 unsigned int tp_len;
85 unsigned int tp_snaplen; 80 unsigned int tp_snaplen;
@@ -93,8 +88,7 @@ struct tpacket_hdr
93#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) 88#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
94#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) 89#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
95 90
96struct tpacket2_hdr 91struct tpacket2_hdr {
97{
98 __u32 tp_status; 92 __u32 tp_status;
99 __u32 tp_len; 93 __u32 tp_len;
100 __u32 tp_snaplen; 94 __u32 tp_snaplen;
@@ -107,8 +101,7 @@ struct tpacket2_hdr
107 101
108#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) 102#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
109 103
110enum tpacket_versions 104enum tpacket_versions {
111{
112 TPACKET_V1, 105 TPACKET_V1,
113 TPACKET_V2, 106 TPACKET_V2,
114}; 107};
@@ -126,16 +119,14 @@ enum tpacket_versions
126 - Pad to align to TPACKET_ALIGNMENT=16 119 - Pad to align to TPACKET_ALIGNMENT=16
127 */ 120 */
128 121
129struct tpacket_req 122struct tpacket_req {
130{
131 unsigned int tp_block_size; /* Minimal size of contiguous block */ 123 unsigned int tp_block_size; /* Minimal size of contiguous block */
132 unsigned int tp_block_nr; /* Number of blocks */ 124 unsigned int tp_block_nr; /* Number of blocks */
133 unsigned int tp_frame_size; /* Size of frame */ 125 unsigned int tp_frame_size; /* Size of frame */
134 unsigned int tp_frame_nr; /* Total number of frames */ 126 unsigned int tp_frame_nr; /* Total number of frames */
135}; 127};
136 128
137struct packet_mreq 129struct packet_mreq {
138{
139 int mr_ifindex; 130 int mr_ifindex;
140 unsigned short mr_type; 131 unsigned short mr_type;
141 unsigned short mr_alen; 132 unsigned short mr_alen;
diff --git a/include/linux/if_plip.h b/include/linux/if_plip.h
index 153a649915a2..6298c7e88b2b 100644
--- a/include/linux/if_plip.h
+++ b/include/linux/if_plip.h
@@ -15,8 +15,7 @@
15 15
16#define SIOCDEVPLIP SIOCDEVPRIVATE 16#define SIOCDEVPLIP SIOCDEVPRIVATE
17 17
18struct plipconf 18struct plipconf {
19{
20 unsigned short pcmd; 19 unsigned short pcmd;
21 unsigned long nibble; 20 unsigned long nibble;
22 unsigned long trigger; 21 unsigned long trigger;
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index 3a14b088c8ec..c58baea4a25b 100644
--- a/include/linux/if_pppol2tp.h
+++ b/include/linux/if_pppol2tp.h
@@ -24,8 +24,7 @@
24/* Structure used to connect() the socket to a particular tunnel UDP 24/* Structure used to connect() the socket to a particular tunnel UDP
25 * socket. 25 * socket.
26 */ 26 */
27struct pppol2tp_addr 27struct pppol2tp_addr {
28{
29 __kernel_pid_t pid; /* pid that owns the fd. 28 __kernel_pid_t pid; /* pid that owns the fd.
30 * 0 => current */ 29 * 0 => current */
31 int fd; /* FD of UDP socket to use */ 30 int fd; /* FD of UDP socket to use */
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 5a9aae4adb44..1822d635be6b 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -5,6 +5,7 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7#include <linux/ip.h> 7#include <linux/ip.h>
8#include <linux/in6.h>
8#endif 9#endif
9 10
10#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) 11#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
@@ -15,6 +16,10 @@
15#define SIOCADDPRL (SIOCDEVPRIVATE + 5) 16#define SIOCADDPRL (SIOCDEVPRIVATE + 5)
16#define SIOCDELPRL (SIOCDEVPRIVATE + 6) 17#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
17#define SIOCCHGPRL (SIOCDEVPRIVATE + 7) 18#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
19#define SIOCGET6RD (SIOCDEVPRIVATE + 8)
20#define SIOCADD6RD (SIOCDEVPRIVATE + 9)
21#define SIOCDEL6RD (SIOCDEVPRIVATE + 10)
22#define SIOCCHG6RD (SIOCDEVPRIVATE + 11)
18 23
19#define GRE_CSUM __cpu_to_be16(0x8000) 24#define GRE_CSUM __cpu_to_be16(0x8000)
20#define GRE_ROUTING __cpu_to_be16(0x4000) 25#define GRE_ROUTING __cpu_to_be16(0x4000)
@@ -25,8 +30,7 @@
25#define GRE_FLAGS __cpu_to_be16(0x00F8) 30#define GRE_FLAGS __cpu_to_be16(0x00F8)
26#define GRE_VERSION __cpu_to_be16(0x0007) 31#define GRE_VERSION __cpu_to_be16(0x0007)
27 32
28struct ip_tunnel_parm 33struct ip_tunnel_parm {
29{
30 char name[IFNAMSIZ]; 34 char name[IFNAMSIZ];
31 int link; 35 int link;
32 __be16 i_flags; 36 __be16 i_flags;
@@ -51,8 +55,14 @@ struct ip_tunnel_prl {
51/* PRL flags */ 55/* PRL flags */
52#define PRL_DEFAULT 0x0001 56#define PRL_DEFAULT 0x0001
53 57
54enum 58struct ip_tunnel_6rd {
55{ 59 struct in6_addr prefix;
60 __be32 relay_prefix;
61 __u16 prefixlen;
62 __u16 relay_prefixlen;
63};
64
65enum {
56 IFLA_GRE_UNSPEC, 66 IFLA_GRE_UNSPEC,
57 IFLA_GRE_LINK, 67 IFLA_GRE_LINK,
58 IFLA_GRE_IFLAGS, 68 IFLA_GRE_IFLAGS,
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 7ff9af1d0f05..3d870fda8c4f 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -63,7 +63,11 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
63 return (struct vlan_ethhdr *)skb_mac_header(skb); 63 return (struct vlan_ethhdr *)skb_mac_header(skb);
64} 64}
65 65
66#define VLAN_VID_MASK 0xfff 66#define VLAN_PRIO_MASK 0xe000 /* Priority Code Point */
67#define VLAN_PRIO_SHIFT 13
68#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */
69#define VLAN_TAG_PRESENT VLAN_CFI_MASK
70#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */
67 71
68/* found in socket.c */ 72/* found in socket.c */
69extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); 73extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
@@ -81,6 +85,7 @@ struct vlan_group {
81 * the vlan is attached to. 85 * the vlan is attached to.
82 */ 86 */
83 unsigned int nr_vlans; 87 unsigned int nr_vlans;
88 int killall;
84 struct hlist_node hlist; /* linked list */ 89 struct hlist_node hlist; /* linked list */
85 struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; 90 struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS];
86 struct rcu_head rcu; 91 struct rcu_head rcu;
@@ -105,8 +110,8 @@ static inline void vlan_group_set_device(struct vlan_group *vg,
105 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; 110 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev;
106} 111}
107 112
108#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci) 113#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
109#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci) 114#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
110 115
111#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 116#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
112extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 117extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
@@ -115,10 +120,12 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
115extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, 120extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
116 u16 vlan_tci, int polling); 121 u16 vlan_tci, int polling);
117extern int vlan_hwaccel_do_receive(struct sk_buff *skb); 122extern int vlan_hwaccel_do_receive(struct sk_buff *skb);
118extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 123extern gro_result_t
119 unsigned int vlan_tci, struct sk_buff *skb); 124vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
120extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, 125 unsigned int vlan_tci, struct sk_buff *skb);
121 unsigned int vlan_tci); 126extern gro_result_t
127vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
128 unsigned int vlan_tci);
122 129
123#else 130#else
124static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) 131static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
@@ -145,17 +152,18 @@ static inline int vlan_hwaccel_do_receive(struct sk_buff *skb)
145 return 0; 152 return 0;
146} 153}
147 154
148static inline int vlan_gro_receive(struct napi_struct *napi, 155static inline gro_result_t
149 struct vlan_group *grp, 156vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
150 unsigned int vlan_tci, struct sk_buff *skb) 157 unsigned int vlan_tci, struct sk_buff *skb)
151{ 158{
152 return NET_RX_DROP; 159 return GRO_DROP;
153} 160}
154 161
155static inline int vlan_gro_frags(struct napi_struct *napi, 162static inline gro_result_t
156 struct vlan_group *grp, unsigned int vlan_tci) 163vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
164 unsigned int vlan_tci)
157{ 165{
158 return NET_RX_DROP; 166 return GRO_DROP;
159} 167}
160#endif 168#endif
161 169
@@ -231,7 +239,7 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
231static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, 239static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
232 u16 vlan_tci) 240 u16 vlan_tci)
233{ 241{
234 skb->vlan_tci = vlan_tci; 242 skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci;
235 return skb; 243 return skb;
236} 244}
237 245
@@ -284,7 +292,7 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
284 u16 *vlan_tci) 292 u16 *vlan_tci)
285{ 293{
286 if (vlan_tx_tag_present(skb)) { 294 if (vlan_tx_tag_present(skb)) {
287 *vlan_tci = skb->vlan_tci; 295 *vlan_tci = vlan_tx_tag_get(skb);
288 return 0; 296 return 0;
289 } else { 297 } else {
290 *vlan_tci = 0; 298 *vlan_tci = 0;
@@ -331,6 +339,7 @@ enum vlan_ioctl_cmds {
331enum vlan_flags { 339enum vlan_flags {
332 VLAN_FLAG_REORDER_HDR = 0x1, 340 VLAN_FLAG_REORDER_HDR = 0x1,
333 VLAN_FLAG_GVRP = 0x2, 341 VLAN_FLAG_GVRP = 0x2,
342 VLAN_FLAG_LOOSE_BINDING = 0x4,
334}; 343};
335 344
336enum vlan_name_types { 345enum vlan_name_types {
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index fe158e0e20e6..724c27e5d173 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -27,8 +27,7 @@
27 * Header in on cable format 27 * Header in on cable format
28 */ 28 */
29 29
30struct igmphdr 30struct igmphdr {
31{
32 __u8 type; 31 __u8 type;
33 __u8 code; /* For newer IGMP */ 32 __u8 code; /* For newer IGMP */
34 __sum16 csum; 33 __sum16 csum;
@@ -151,8 +150,7 @@ static inline struct igmpv3_query *
151extern int sysctl_igmp_max_memberships; 150extern int sysctl_igmp_max_memberships;
152extern int sysctl_igmp_max_msf; 151extern int sysctl_igmp_max_msf;
153 152
154struct ip_sf_socklist 153struct ip_sf_socklist {
155{
156 unsigned int sl_max; 154 unsigned int sl_max;
157 unsigned int sl_count; 155 unsigned int sl_count;
158 __be32 sl_addr[0]; 156 __be32 sl_addr[0];
@@ -167,16 +165,14 @@ struct ip_sf_socklist
167 this list never used in fast path code 165 this list never used in fast path code
168 */ 166 */
169 167
170struct ip_mc_socklist 168struct ip_mc_socklist {
171{
172 struct ip_mc_socklist *next; 169 struct ip_mc_socklist *next;
173 struct ip_mreqn multi; 170 struct ip_mreqn multi;
174 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 171 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
175 struct ip_sf_socklist *sflist; 172 struct ip_sf_socklist *sflist;
176}; 173};
177 174
178struct ip_sf_list 175struct ip_sf_list {
179{
180 struct ip_sf_list *sf_next; 176 struct ip_sf_list *sf_next;
181 __be32 sf_inaddr; 177 __be32 sf_inaddr;
182 unsigned long sf_count[2]; /* include/exclude counts */ 178 unsigned long sf_count[2]; /* include/exclude counts */
@@ -185,8 +181,7 @@ struct ip_sf_list
185 unsigned char sf_crcount; /* retrans. left to send */ 181 unsigned char sf_crcount; /* retrans. left to send */
186}; 182};
187 183
188struct ip_mc_list 184struct ip_mc_list {
189{
190 struct in_device *interface; 185 struct in_device *interface;
191 __be32 multiaddr; 186 __be32 multiaddr;
192 struct ip_sf_list *sources; 187 struct ip_sf_list *sources;
diff --git a/include/linux/in.h b/include/linux/in.h
index cf196da04ec9..b615649db129 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -118,14 +118,12 @@ struct in_addr {
118 118
119/* Request struct for multicast socket ops */ 119/* Request struct for multicast socket ops */
120 120
121struct ip_mreq 121struct ip_mreq {
122{
123 struct in_addr imr_multiaddr; /* IP multicast address of group */ 122 struct in_addr imr_multiaddr; /* IP multicast address of group */
124 struct in_addr imr_interface; /* local IP address of interface */ 123 struct in_addr imr_interface; /* local IP address of interface */
125}; 124};
126 125
127struct ip_mreqn 126struct ip_mreqn {
128{
129 struct in_addr imr_multiaddr; /* IP multicast address of group */ 127 struct in_addr imr_multiaddr; /* IP multicast address of group */
130 struct in_addr imr_address; /* local IP address of interface */ 128 struct in_addr imr_address; /* local IP address of interface */
131 int imr_ifindex; /* Interface index */ 129 int imr_ifindex; /* Interface index */
@@ -149,21 +147,18 @@ struct ip_msfilter {
149 (sizeof(struct ip_msfilter) - sizeof(__u32) \ 147 (sizeof(struct ip_msfilter) - sizeof(__u32) \
150 + (numsrc) * sizeof(__u32)) 148 + (numsrc) * sizeof(__u32))
151 149
152struct group_req 150struct group_req {
153{
154 __u32 gr_interface; /* interface index */ 151 __u32 gr_interface; /* interface index */
155 struct __kernel_sockaddr_storage gr_group; /* group address */ 152 struct __kernel_sockaddr_storage gr_group; /* group address */
156}; 153};
157 154
158struct group_source_req 155struct group_source_req {
159{
160 __u32 gsr_interface; /* interface index */ 156 __u32 gsr_interface; /* interface index */
161 struct __kernel_sockaddr_storage gsr_group; /* group address */ 157 struct __kernel_sockaddr_storage gsr_group; /* group address */
162 struct __kernel_sockaddr_storage gsr_source; /* source address */ 158 struct __kernel_sockaddr_storage gsr_source; /* source address */
163}; 159};
164 160
165struct group_filter 161struct group_filter {
166{
167 __u32 gf_interface; /* interface index */ 162 __u32 gf_interface; /* interface index */
168 struct __kernel_sockaddr_storage gf_group; /* multicast address */ 163 struct __kernel_sockaddr_storage gf_group; /* multicast address */
169 __u32 gf_fmode; /* filter mode */ 164 __u32 gf_fmode; /* filter mode */
@@ -175,8 +170,7 @@ struct group_filter
175 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \ 170 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
176 + (numsrc) * sizeof(struct __kernel_sockaddr_storage)) 171 + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
177 172
178struct in_pktinfo 173struct in_pktinfo {
179{
180 int ipi_ifindex; 174 int ipi_ifindex;
181 struct in_addr ipi_spec_dst; 175 struct in_addr ipi_spec_dst;
182 struct in_addr ipi_addr; 176 struct in_addr ipi_addr;
diff --git a/include/linux/in6.h b/include/linux/in6.h
index 718bf21c5754..bd55c6e46b2e 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -27,10 +27,8 @@
27 * IPv6 address structure 27 * IPv6 address structure
28 */ 28 */
29 29
30struct in6_addr 30struct in6_addr {
31{ 31 union {
32 union
33 {
34 __u8 u6_addr8[16]; 32 __u8 u6_addr8[16];
35 __be16 u6_addr16[8]; 33 __be16 u6_addr16[8];
36 __be32 u6_addr32[4]; 34 __be32 u6_addr32[4];
@@ -75,8 +73,7 @@ struct ipv6_mreq {
75 73
76#define ipv6mr_acaddr ipv6mr_multiaddr 74#define ipv6mr_acaddr ipv6mr_multiaddr
77 75
78struct in6_flowlabel_req 76struct in6_flowlabel_req {
79{
80 struct in6_addr flr_dst; 77 struct in6_addr flr_dst;
81 __be32 flr_label; 78 __be32 flr_label;
82 __u8 flr_action; 79 __u8 flr_action;
@@ -113,7 +110,7 @@ struct in6_flowlabel_req
113#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff 110#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
114#define IPV6_FLOWINFO_PRIORITY 0x0ff00000 111#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
115 112
116/* These defintions are obsolete */ 113/* These definitions are obsolete */
117#define IPV6_PRIORITY_UNCHARACTERIZED 0x0000 114#define IPV6_PRIORITY_UNCHARACTERIZED 0x0000
118#define IPV6_PRIORITY_FILLER 0x0100 115#define IPV6_PRIORITY_FILLER 0x0100
119#define IPV6_PRIORITY_UNATTENDED 0x0200 116#define IPV6_PRIORITY_UNATTENDED 0x0200
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index ad27c7da8798..699e85c01a4d 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -10,15 +10,13 @@
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h> 11#include <linux/sysctl.h>
12 12
13struct ipv4_devconf 13struct ipv4_devconf {
14{
15 void *sysctl; 14 void *sysctl;
16 int data[__NET_IPV4_CONF_MAX - 1]; 15 int data[__NET_IPV4_CONF_MAX - 1];
17 DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); 16 DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1);
18}; 17};
19 18
20struct in_device 19struct in_device {
21{
22 struct net_device *dev; 20 struct net_device *dev;
23 atomic_t refcnt; 21 atomic_t refcnt;
24 int dead; 22 int dead;
@@ -85,6 +83,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
85#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) 83#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER)
86#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ 84#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \
87 ACCEPT_SOURCE_ROUTE) 85 ACCEPT_SOURCE_ROUTE)
86#define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL)
88#define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) 87#define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY)
89 88
90#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) 89#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)
@@ -110,8 +109,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
110#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) 109#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
111#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) 110#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
112 111
113struct in_ifaddr 112struct in_ifaddr {
114{
115 struct in_ifaddr *ifa_next; 113 struct in_ifaddr *ifa_next;
116 struct in_device *ifa_dev; 114 struct in_device *ifa_dev;
117 struct rcu_head rcu_head; 115 struct rcu_head rcu_head;
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 21a6f5d9af22..8d10aa7fd4c9 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -83,16 +83,12 @@ extern struct group_info init_groups;
83#define INIT_IDS 83#define INIT_IDS
84#endif 84#endif
85 85
86#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
87/* 86/*
88 * Because of the reduced scope of CAP_SETPCAP when filesystem 87 * Because of the reduced scope of CAP_SETPCAP when filesystem
89 * capabilities are in effect, it is safe to allow CAP_SETPCAP to 88 * capabilities are in effect, it is safe to allow CAP_SETPCAP to
90 * be available in the default configuration. 89 * be available in the default configuration.
91 */ 90 */
92# define CAP_INIT_BSET CAP_FULL_SET 91# define CAP_INIT_BSET CAP_FULL_SET
93#else
94# define CAP_INIT_BSET CAP_INIT_EFF_SET
95#endif
96 92
97#ifdef CONFIG_TREE_PREEMPT_RCU 93#ifdef CONFIG_TREE_PREEMPT_RCU
98#define INIT_TASK_RCU_PREEMPT(tsk) \ 94#define INIT_TASK_RCU_PREEMPT(tsk) \
diff --git a/include/linux/input/sh_keysc.h b/include/linux/input/sh_keysc.h
new file mode 100644
index 000000000000..c211b5cf08e6
--- /dev/null
+++ b/include/linux/input/sh_keysc.h
@@ -0,0 +1,14 @@
1#ifndef __SH_KEYSC_H__
2#define __SH_KEYSC_H__
3
4#define SH_KEYSC_MAXKEYS 30
5
6struct sh_keysc_info {
7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode;
8 int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */
9 int delay;
10 int kycr2_delay;
11 int keycodes[SH_KEYSC_MAXKEYS];
12};
13
14#endif /* __SH_KEYSC_H__ */
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 7ca72b74eec7..75f3f00ac1e5 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -603,12 +603,6 @@ static inline void init_irq_proc(void)
603} 603}
604#endif 604#endif
605 605
606#if defined(CONFIG_GENERIC_HARDIRQS) && defined(CONFIG_DEBUG_SHIRQ)
607extern void debug_poll_all_shared_irqs(void);
608#else
609static inline void debug_poll_all_shared_irqs(void) { }
610#endif
611
612struct seq_file; 606struct seq_file;
613int show_interrupts(struct seq_file *p, void *v); 607int show_interrupts(struct seq_file *p, void *v);
614 608
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index 4da4a75c3f1e..a63235996309 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -40,16 +40,11 @@ struct cfq_io_context {
40 struct io_context *ioc; 40 struct io_context *ioc;
41 41
42 unsigned long last_end_request; 42 unsigned long last_end_request;
43 sector_t last_request_pos;
44 43
45 unsigned long ttime_total; 44 unsigned long ttime_total;
46 unsigned long ttime_samples; 45 unsigned long ttime_samples;
47 unsigned long ttime_mean; 46 unsigned long ttime_mean;
48 47
49 unsigned int seek_samples;
50 u64 seek_total;
51 sector_t seek_mean;
52
53 struct list_head queue_list; 48 struct list_head queue_list;
54 struct hlist_node cic_list; 49 struct hlist_node cic_list;
55 50
@@ -73,6 +68,10 @@ struct io_context {
73 unsigned short ioprio; 68 unsigned short ioprio;
74 unsigned short ioprio_changed; 69 unsigned short ioprio_changed;
75 70
71#ifdef CONFIG_BLK_CGROUP
72 unsigned short cgroup_changed;
73#endif
74
76 /* 75 /*
77 * For request batching 76 * For request batching
78 */ 77 */
@@ -99,14 +98,15 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
99 return NULL; 98 return NULL;
100} 99}
101 100
101struct task_struct;
102#ifdef CONFIG_BLOCK 102#ifdef CONFIG_BLOCK
103int put_io_context(struct io_context *ioc); 103int put_io_context(struct io_context *ioc);
104void exit_io_context(void); 104void exit_io_context(struct task_struct *task);
105struct io_context *get_io_context(gfp_t gfp_flags, int node); 105struct io_context *get_io_context(gfp_t gfp_flags, int node);
106struct io_context *alloc_io_context(gfp_t gfp_flags, int node); 106struct io_context *alloc_io_context(gfp_t gfp_flags, int node);
107void copy_io_context(struct io_context **pdst, struct io_context **psrc); 107void copy_io_context(struct io_context **pdst, struct io_context **psrc);
108#else 108#else
109static inline void exit_io_context(void) 109static inline void exit_io_context(struct task_struct *task)
110{ 110{
111} 111}
112 112
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
index 148265e63e8d..dfc170362842 100644
--- a/include/linux/ip_vs.h
+++ b/include/linux/ip_vs.h
@@ -127,8 +127,7 @@ struct ip_vs_dest_user {
127/* 127/*
128 * IPVS statistics object (for user space) 128 * IPVS statistics object (for user space)
129 */ 129 */
130struct ip_vs_stats_user 130struct ip_vs_stats_user {
131{
132 __u32 conns; /* connections scheduled */ 131 __u32 conns; /* connections scheduled */
133 __u32 inpkts; /* incoming packets */ 132 __u32 inpkts; /* incoming packets */
134 __u32 outpkts; /* outgoing packets */ 133 __u32 outpkts; /* outgoing packets */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c662efa68289..e0cc9a7db2b5 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -167,6 +167,7 @@ struct ipv6_devconf {
167#endif 167#endif
168 __s32 disable_ipv6; 168 __s32 disable_ipv6;
169 __s32 accept_dad; 169 __s32 accept_dad;
170 __s32 force_tllao;
170 void *sysctl; 171 void *sysctl;
171}; 172};
172 173
@@ -207,6 +208,7 @@ enum {
207 DEVCONF_MC_FORWARDING, 208 DEVCONF_MC_FORWARDING,
208 DEVCONF_DISABLE_IPV6, 209 DEVCONF_DISABLE_IPV6,
209 DEVCONF_ACCEPT_DAD, 210 DEVCONF_ACCEPT_DAD,
211 DEVCONF_FORCE_TLLAO,
210 DEVCONF_MAX 212 DEVCONF_MAX
211}; 213};
212 214
@@ -503,7 +505,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
503 505
504#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ 506#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\
505 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 507 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \
506 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 508 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \
507 ((__sk)->sk_family == AF_INET6) && \ 509 ((__sk)->sk_family == AF_INET6) && \
508 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ 510 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
509 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ 511 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
diff --git a/include/linux/irq.h b/include/linux/irq.h
index ae9653dbcd78..a287cfc0b1a6 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -282,7 +282,7 @@ extern irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action);
282 282
283/* 283/*
284 * Built-in IRQ handlers for various IRQ types, 284 * Built-in IRQ handlers for various IRQ types,
285 * callable via desc->chip->handle_irq() 285 * callable via desc->handle_irq()
286 */ 286 */
287extern void handle_level_irq(unsigned int irq, struct irq_desc *desc); 287extern void handle_level_irq(unsigned int irq, struct irq_desc *desc);
288extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); 288extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc);
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index b02a3f1d46a0..006bf45eae30 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -124,6 +124,6 @@
124 typecheck(unsigned long, flags); \ 124 typecheck(unsigned long, flags); \
125 raw_irqs_disabled_flags(flags); \ 125 raw_irqs_disabled_flags(flags); \
126}) 126})
127#endif /* CONFIG_X86 */ 127#endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */
128 128
129#endif 129#endif
diff --git a/include/linux/isicom.h b/include/linux/isicom.h
index bbd42197298f..b92e05650639 100644
--- a/include/linux/isicom.h
+++ b/include/linux/isicom.h
@@ -67,6 +67,7 @@
67 67
68#define FIRMWARE_LOADED 0x0001 68#define FIRMWARE_LOADED 0x0001
69#define BOARD_ACTIVE 0x0002 69#define BOARD_ACTIVE 0x0002
70#define BOARD_INIT 0x0004
70 71
71 /* isi_port status bitmap */ 72 /* isi_port status bitmap */
72 73
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 1a9cf78bfce5..6811f4bfc6e7 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -307,6 +307,7 @@ extern clock_t jiffies_to_clock_t(long x);
307extern unsigned long clock_t_to_jiffies(unsigned long x); 307extern unsigned long clock_t_to_jiffies(unsigned long x);
308extern u64 jiffies_64_to_clock_t(u64 x); 308extern u64 jiffies_64_to_clock_t(u64 x);
309extern u64 nsec_to_clock_t(u64 x); 309extern u64 nsec_to_clock_t(u64 x);
310extern unsigned long nsecs_to_jiffies(u64 n);
310 311
311#define TIMESTAMP_SIZE 30 312#define TIMESTAMP_SIZE 30
312 313
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f4e3184fa054..3fa4c590cf12 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -15,7 +15,6 @@
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/log2.h> 16#include <linux/log2.h>
17#include <linux/typecheck.h> 17#include <linux/typecheck.h>
18#include <linux/ratelimit.h>
19#include <linux/dynamic_debug.h> 18#include <linux/dynamic_debug.h>
20#include <asm/byteorder.h> 19#include <asm/byteorder.h>
21#include <asm/bug.h> 20#include <asm/bug.h>
@@ -241,8 +240,8 @@ asmlinkage int vprintk(const char *fmt, va_list args)
241asmlinkage int printk(const char * fmt, ...) 240asmlinkage int printk(const char * fmt, ...)
242 __attribute__ ((format (printf, 1, 2))) __cold; 241 __attribute__ ((format (printf, 1, 2))) __cold;
243 242
244extern struct ratelimit_state printk_ratelimit_state; 243extern int __printk_ratelimit(const char *func);
245extern int printk_ratelimit(void); 244#define printk_ratelimit() __printk_ratelimit(__func__)
246extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, 245extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
247 unsigned int interval_msec); 246 unsigned int interval_msec);
248 247
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 348fa8874b52..c059044bc6dc 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -25,6 +25,7 @@ struct cpu_usage_stat {
25 cputime64_t iowait; 25 cputime64_t iowait;
26 cputime64_t steal; 26 cputime64_t steal;
27 cputime64_t guest; 27 cputime64_t guest;
28 cputime64_t guest_nice;
28}; 29};
29 30
30struct kernel_stat { 31struct kernel_stat {
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 3a46b7b7abb2..1b672f74a32f 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -296,6 +296,8 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
296int disable_kprobe(struct kprobe *kp); 296int disable_kprobe(struct kprobe *kp);
297int enable_kprobe(struct kprobe *kp); 297int enable_kprobe(struct kprobe *kp);
298 298
299void dump_kprobe(struct kprobe *kp);
300
299#else /* !CONFIG_KPROBES: */ 301#else /* !CONFIG_KPROBES: */
300 302
301static inline int kprobes_built_in(void) 303static inline int kprobes_built_in(void)
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index f8f8900fc5ec..a24de0b1858e 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -14,12 +14,76 @@
14 14
15#define KVM_API_VERSION 12 15#define KVM_API_VERSION 12
16 16
17/* for KVM_TRACE_ENABLE, deprecated */ 17/* *** Deprecated interfaces *** */
18
19#define KVM_TRC_SHIFT 16
20
21#define KVM_TRC_ENTRYEXIT (1 << KVM_TRC_SHIFT)
22#define KVM_TRC_HANDLER (1 << (KVM_TRC_SHIFT + 1))
23
24#define KVM_TRC_VMENTRY (KVM_TRC_ENTRYEXIT + 0x01)
25#define KVM_TRC_VMEXIT (KVM_TRC_ENTRYEXIT + 0x02)
26#define KVM_TRC_PAGE_FAULT (KVM_TRC_HANDLER + 0x01)
27
28#define KVM_TRC_HEAD_SIZE 12
29#define KVM_TRC_CYCLE_SIZE 8
30#define KVM_TRC_EXTRA_MAX 7
31
32#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
33#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
34#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
35#define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05)
36#define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06)
37#define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07)
38#define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08)
39#define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09)
40#define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A)
41#define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B)
42#define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C)
43#define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D)
44#define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E)
45#define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F)
46#define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10)
47#define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11)
48#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
49#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
50#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
51#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
52#define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16)
53#define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17)
54#define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18)
55#define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19)
56
18struct kvm_user_trace_setup { 57struct kvm_user_trace_setup {
19 __u32 buf_size; /* sub_buffer size of each per-cpu */ 58 __u32 buf_size;
20 __u32 buf_nr; /* the number of sub_buffers of each per-cpu */ 59 __u32 buf_nr;
60};
61
62#define __KVM_DEPRECATED_MAIN_W_0x06 \
63 _IOW(KVMIO, 0x06, struct kvm_user_trace_setup)
64#define __KVM_DEPRECATED_MAIN_0x07 _IO(KVMIO, 0x07)
65#define __KVM_DEPRECATED_MAIN_0x08 _IO(KVMIO, 0x08)
66
67#define __KVM_DEPRECATED_VM_R_0x70 _IOR(KVMIO, 0x70, struct kvm_assigned_irq)
68
69struct kvm_breakpoint {
70 __u32 enabled;
71 __u32 padding;
72 __u64 address;
73};
74
75struct kvm_debug_guest {
76 __u32 enabled;
77 __u32 pad;
78 struct kvm_breakpoint breakpoints[4];
79 __u32 singlestep;
21}; 80};
22 81
82#define __KVM_DEPRECATED_VCPU_W_0x87 _IOW(KVMIO, 0x87, struct kvm_debug_guest)
83
84/* *** End of deprecated interfaces *** */
85
86
23/* for KVM_CREATE_MEMORY_REGION */ 87/* for KVM_CREATE_MEMORY_REGION */
24struct kvm_memory_region { 88struct kvm_memory_region {
25 __u32 slot; 89 __u32 slot;
@@ -99,6 +163,7 @@ struct kvm_pit_config {
99 163
100/* For KVM_EXIT_INTERNAL_ERROR */ 164/* For KVM_EXIT_INTERNAL_ERROR */
101#define KVM_INTERNAL_ERROR_EMULATION 1 165#define KVM_INTERNAL_ERROR_EMULATION 1
166#define KVM_INTERNAL_ERROR_SIMUL_EX 2
102 167
103/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ 168/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
104struct kvm_run { 169struct kvm_run {
@@ -116,6 +181,11 @@ struct kvm_run {
116 __u64 cr8; 181 __u64 cr8;
117 __u64 apic_base; 182 __u64 apic_base;
118 183
184#ifdef __KVM_S390
185 /* the processor status word for s390 */
186 __u64 psw_mask; /* psw upper half */
187 __u64 psw_addr; /* psw lower half */
188#endif
119 union { 189 union {
120 /* KVM_EXIT_UNKNOWN */ 190 /* KVM_EXIT_UNKNOWN */
121 struct { 191 struct {
@@ -167,8 +237,6 @@ struct kvm_run {
167 /* KVM_EXIT_S390_SIEIC */ 237 /* KVM_EXIT_S390_SIEIC */
168 struct { 238 struct {
169 __u8 icptcode; 239 __u8 icptcode;
170 __u64 mask; /* psw upper half */
171 __u64 addr; /* psw lower half */
172 __u16 ipa; 240 __u16 ipa;
173 __u32 ipb; 241 __u32 ipb;
174 } s390_sieic; 242 } s390_sieic;
@@ -187,6 +255,9 @@ struct kvm_run {
187 } dcr; 255 } dcr;
188 struct { 256 struct {
189 __u32 suberror; 257 __u32 suberror;
258 /* Available with KVM_CAP_INTERNAL_ERROR_DATA: */
259 __u32 ndata;
260 __u64 data[16];
190 } internal; 261 } internal;
191 /* Fix the size of the union. */ 262 /* Fix the size of the union. */
192 char padding[256]; 263 char padding[256];
@@ -329,24 +400,6 @@ struct kvm_ioeventfd {
329 __u8 pad[36]; 400 __u8 pad[36];
330}; 401};
331 402
332#define KVM_TRC_SHIFT 16
333/*
334 * kvm trace categories
335 */
336#define KVM_TRC_ENTRYEXIT (1 << KVM_TRC_SHIFT)
337#define KVM_TRC_HANDLER (1 << (KVM_TRC_SHIFT + 1)) /* only 12 bits */
338
339/*
340 * kvm trace action
341 */
342#define KVM_TRC_VMENTRY (KVM_TRC_ENTRYEXIT + 0x01)
343#define KVM_TRC_VMEXIT (KVM_TRC_ENTRYEXIT + 0x02)
344#define KVM_TRC_PAGE_FAULT (KVM_TRC_HANDLER + 0x01)
345
346#define KVM_TRC_HEAD_SIZE 12
347#define KVM_TRC_CYCLE_SIZE 8
348#define KVM_TRC_EXTRA_MAX 7
349
350#define KVMIO 0xAE 403#define KVMIO 0xAE
351 404
352/* 405/*
@@ -367,12 +420,10 @@ struct kvm_ioeventfd {
367 */ 420 */
368#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */ 421#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */
369#define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2) 422#define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2)
370/* 423#define KVM_TRACE_ENABLE __KVM_DEPRECATED_MAIN_W_0x06
371 * ioctls for kvm trace 424#define KVM_TRACE_PAUSE __KVM_DEPRECATED_MAIN_0x07
372 */ 425#define KVM_TRACE_DISABLE __KVM_DEPRECATED_MAIN_0x08
373#define KVM_TRACE_ENABLE _IOW(KVMIO, 0x06, struct kvm_user_trace_setup) 426
374#define KVM_TRACE_PAUSE _IO(KVMIO, 0x07)
375#define KVM_TRACE_DISABLE _IO(KVMIO, 0x08)
376/* 427/*
377 * Extension capability list. 428 * Extension capability list.
378 */ 429 */
@@ -436,6 +487,16 @@ struct kvm_ioeventfd {
436#endif 487#endif
437#define KVM_CAP_IOEVENTFD 36 488#define KVM_CAP_IOEVENTFD 36
438#define KVM_CAP_SET_IDENTITY_MAP_ADDR 37 489#define KVM_CAP_SET_IDENTITY_MAP_ADDR 37
490#ifdef __KVM_HAVE_XEN_HVM
491#define KVM_CAP_XEN_HVM 38
492#endif
493#define KVM_CAP_ADJUST_CLOCK 39
494#define KVM_CAP_INTERNAL_ERROR_DATA 40
495#ifdef __KVM_HAVE_VCPU_EVENTS
496#define KVM_CAP_VCPU_EVENTS 41
497#endif
498#define KVM_CAP_S390_PSW 42
499#define KVM_CAP_PPC_SEGSTATE 43
439 500
440#ifdef KVM_CAP_IRQ_ROUTING 501#ifdef KVM_CAP_IRQ_ROUTING
441 502
@@ -488,6 +549,18 @@ struct kvm_x86_mce {
488}; 549};
489#endif 550#endif
490 551
552#ifdef KVM_CAP_XEN_HVM
553struct kvm_xen_hvm_config {
554 __u32 flags;
555 __u32 msr;
556 __u64 blob_addr_32;
557 __u64 blob_addr_64;
558 __u8 blob_size_32;
559 __u8 blob_size_64;
560 __u8 pad2[30];
561};
562#endif
563
491#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) 564#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
492 565
493struct kvm_irqfd { 566struct kvm_irqfd {
@@ -497,55 +570,66 @@ struct kvm_irqfd {
497 __u8 pad[20]; 570 __u8 pad[20];
498}; 571};
499 572
573struct kvm_clock_data {
574 __u64 clock;
575 __u32 flags;
576 __u32 pad[9];
577};
578
500/* 579/*
501 * ioctls for VM fds 580 * ioctls for VM fds
502 */ 581 */
503#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) 582#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
504/* 583/*
505 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns 584 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
506 * a vcpu fd. 585 * a vcpu fd.
507 */ 586 */
508#define KVM_CREATE_VCPU _IO(KVMIO, 0x41) 587#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
509#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) 588#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
510#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) 589#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
511#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) 590#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
512#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) 591#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
513#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\ 592#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \
514 struct kvm_userspace_memory_region) 593 struct kvm_userspace_memory_region)
515#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) 594#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
516#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64) 595#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64)
517/* Device model IOC */ 596/* Device model IOC */
518#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) 597#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)
519#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) 598#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level)
520#define KVM_GET_IRQCHIP _IOWR(KVMIO, 0x62, struct kvm_irqchip) 599#define KVM_GET_IRQCHIP _IOWR(KVMIO, 0x62, struct kvm_irqchip)
521#define KVM_SET_IRQCHIP _IOR(KVMIO, 0x63, struct kvm_irqchip) 600#define KVM_SET_IRQCHIP _IOR(KVMIO, 0x63, struct kvm_irqchip)
522#define KVM_CREATE_PIT _IO(KVMIO, 0x64) 601#define KVM_CREATE_PIT _IO(KVMIO, 0x64)
523#define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) 602#define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state)
524#define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) 603#define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state)
525#define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level) 604#define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level)
526#define KVM_REGISTER_COALESCED_MMIO \ 605#define KVM_REGISTER_COALESCED_MMIO \
527 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) 606 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone)
528#define KVM_UNREGISTER_COALESCED_MMIO \ 607#define KVM_UNREGISTER_COALESCED_MMIO \
529 _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) 608 _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone)
530#define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ 609#define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \
531 struct kvm_assigned_pci_dev) 610 struct kvm_assigned_pci_dev)
532#define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing) 611#define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing)
533/* deprecated, replaced by KVM_ASSIGN_DEV_IRQ */ 612/* deprecated, replaced by KVM_ASSIGN_DEV_IRQ */
534#define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ 613#define KVM_ASSIGN_IRQ __KVM_DEPRECATED_VM_R_0x70
535 struct kvm_assigned_irq) 614#define KVM_ASSIGN_DEV_IRQ _IOW(KVMIO, 0x70, struct kvm_assigned_irq)
536#define KVM_ASSIGN_DEV_IRQ _IOW(KVMIO, 0x70, struct kvm_assigned_irq) 615#define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71)
537#define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) 616#define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \
538#define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \ 617 struct kvm_assigned_pci_dev)
539 struct kvm_assigned_pci_dev) 618#define KVM_ASSIGN_SET_MSIX_NR _IOW(KVMIO, 0x73, \
540#define KVM_ASSIGN_SET_MSIX_NR \ 619 struct kvm_assigned_msix_nr)
541 _IOW(KVMIO, 0x73, struct kvm_assigned_msix_nr) 620#define KVM_ASSIGN_SET_MSIX_ENTRY _IOW(KVMIO, 0x74, \
542#define KVM_ASSIGN_SET_MSIX_ENTRY \ 621 struct kvm_assigned_msix_entry)
543 _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) 622#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) 623#define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd)
545#define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd) 624#define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config)
546#define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config) 625#define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78)
547#define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78) 626#define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd)
548#define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd) 627#define KVM_XEN_HVM_CONFIG _IOW(KVMIO, 0x7a, struct kvm_xen_hvm_config)
628#define KVM_SET_CLOCK _IOW(KVMIO, 0x7b, struct kvm_clock_data)
629#define KVM_GET_CLOCK _IOR(KVMIO, 0x7c, struct kvm_clock_data)
630/* Available with KVM_CAP_PIT_STATE2 */
631#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2)
632#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
549 633
550/* 634/*
551 * ioctls for vcpu fds 635 * ioctls for vcpu fds
@@ -558,7 +642,7 @@ struct kvm_irqfd {
558#define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) 642#define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation)
559#define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) 643#define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt)
560/* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */ 644/* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */
561#define KVM_DEBUG_GUEST __KVM_DEPRECATED_DEBUG_GUEST 645#define KVM_DEBUG_GUEST __KVM_DEPRECATED_VCPU_W_0x87
562#define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) 646#define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs)
563#define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) 647#define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs)
564#define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) 648#define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid)
@@ -570,7 +654,7 @@ struct kvm_irqfd {
570#define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2) 654#define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2)
571#define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2) 655#define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2)
572/* Available with KVM_CAP_VAPIC */ 656/* Available with KVM_CAP_VAPIC */
573#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl) 657#define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl)
574/* Available with KVM_CAP_VAPIC */ 658/* Available with KVM_CAP_VAPIC */
575#define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr) 659#define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr)
576/* valid for virtual machine (for floating interrupt)_and_ vcpu */ 660/* valid for virtual machine (for floating interrupt)_and_ vcpu */
@@ -582,66 +666,23 @@ struct kvm_irqfd {
582/* initial ipl psw for s390 */ 666/* initial ipl psw for s390 */
583#define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw) 667#define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw)
584/* initial reset for s390 */ 668/* initial reset for s390 */
585#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) 669#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97)
586#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) 670#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state)
587#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) 671#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state)
588/* Available with KVM_CAP_NMI */ 672/* Available with KVM_CAP_NMI */
589#define KVM_NMI _IO(KVMIO, 0x9a) 673#define KVM_NMI _IO(KVMIO, 0x9a)
590/* Available with KVM_CAP_SET_GUEST_DEBUG */ 674/* Available with KVM_CAP_SET_GUEST_DEBUG */
591#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) 675#define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug)
592/* MCE for x86 */ 676/* MCE for x86 */
593#define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64) 677#define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64)
594#define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64) 678#define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64)
595#define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce) 679#define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce)
596 680/* IA64 stack access */
597/*
598 * Deprecated interfaces
599 */
600struct kvm_breakpoint {
601 __u32 enabled;
602 __u32 padding;
603 __u64 address;
604};
605
606struct kvm_debug_guest {
607 __u32 enabled;
608 __u32 pad;
609 struct kvm_breakpoint breakpoints[4];
610 __u32 singlestep;
611};
612
613#define __KVM_DEPRECATED_DEBUG_GUEST _IOW(KVMIO, 0x87, struct kvm_debug_guest)
614
615#define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) 681#define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *)
616#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) 682#define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *)
617 683/* Available with KVM_CAP_VCPU_EVENTS */
618#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2) 684#define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events)
619#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) 685#define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events)
620
621#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
622#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
623#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
624#define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05)
625#define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06)
626#define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07)
627#define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08)
628#define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09)
629#define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A)
630#define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B)
631#define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C)
632#define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D)
633#define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E)
634#define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F)
635#define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10)
636#define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11)
637#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
638#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
639#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
640#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
641#define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16)
642#define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17)
643#define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18)
644#define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19)
645 686
646#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 687#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
647 688
@@ -696,4 +737,4 @@ struct kvm_assigned_msix_entry {
696 __u16 padding[3]; 737 __u16 padding[3];
697}; 738};
698 739
699#endif 740#endif /* __LINUX_KVM_H */
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index b7bbb5ddd7ae..bd5a616d9373 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -120,7 +120,7 @@ struct kvm_kernel_irq_routing_entry {
120 u32 gsi; 120 u32 gsi;
121 u32 type; 121 u32 type;
122 int (*set)(struct kvm_kernel_irq_routing_entry *e, 122 int (*set)(struct kvm_kernel_irq_routing_entry *e,
123 struct kvm *kvm, int level); 123 struct kvm *kvm, int irq_source_id, int level);
124 union { 124 union {
125 struct { 125 struct {
126 unsigned irqchip; 126 unsigned irqchip;
@@ -128,9 +128,28 @@ struct kvm_kernel_irq_routing_entry {
128 } irqchip; 128 } irqchip;
129 struct msi_msg msi; 129 struct msi_msg msi;
130 }; 130 };
131 struct list_head link; 131 struct hlist_node link;
132};
133
134#ifdef __KVM_HAVE_IOAPIC
135
136struct kvm_irq_routing_table {
137 int chip[KVM_NR_IRQCHIPS][KVM_IOAPIC_NUM_PINS];
138 struct kvm_kernel_irq_routing_entry *rt_entries;
139 u32 nr_rt_entries;
140 /*
141 * Array indexed by gsi. Each entry contains list of irq chips
142 * the gsi is connected to.
143 */
144 struct hlist_head map[0];
132}; 145};
133 146
147#else
148
149struct kvm_irq_routing_table {};
150
151#endif
152
134struct kvm { 153struct kvm {
135 spinlock_t mmu_lock; 154 spinlock_t mmu_lock;
136 spinlock_t requests_lock; 155 spinlock_t requests_lock;
@@ -166,8 +185,9 @@ struct kvm {
166 185
167 struct mutex irq_lock; 186 struct mutex irq_lock;
168#ifdef CONFIG_HAVE_KVM_IRQCHIP 187#ifdef CONFIG_HAVE_KVM_IRQCHIP
169 struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ 188 struct kvm_irq_routing_table *irq_routing;
170 struct hlist_head mask_notifier_list; 189 struct hlist_head mask_notifier_list;
190 struct hlist_head irq_ack_notifier_list;
171#endif 191#endif
172 192
173#ifdef KVM_ARCH_WANT_MMU_NOTIFIER 193#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
@@ -266,6 +286,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
266void mark_page_dirty(struct kvm *kvm, gfn_t gfn); 286void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
267 287
268void kvm_vcpu_block(struct kvm_vcpu *vcpu); 288void kvm_vcpu_block(struct kvm_vcpu *vcpu);
289void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu);
269void kvm_resched(struct kvm_vcpu *vcpu); 290void kvm_resched(struct kvm_vcpu *vcpu);
270void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); 291void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
271void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); 292void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
@@ -325,7 +346,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu);
325void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); 346void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);
326 347
327int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu); 348int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu);
328void kvm_arch_hardware_enable(void *garbage); 349int kvm_arch_hardware_enable(void *garbage);
329void kvm_arch_hardware_disable(void *garbage); 350void kvm_arch_hardware_disable(void *garbage);
330int kvm_arch_hardware_setup(void); 351int kvm_arch_hardware_setup(void);
331void kvm_arch_hardware_unsetup(void); 352void kvm_arch_hardware_unsetup(void);
@@ -390,7 +411,12 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
390 struct kvm_irq_mask_notifier *kimn); 411 struct kvm_irq_mask_notifier *kimn);
391void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); 412void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask);
392 413
393int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); 414#ifdef __KVM_HAVE_IOAPIC
415void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic,
416 union kvm_ioapic_redirect_entry *entry,
417 unsigned long *deliver_bitmask);
418#endif
419int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level);
394void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); 420void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
395void kvm_register_irq_ack_notifier(struct kvm *kvm, 421void kvm_register_irq_ack_notifier(struct kvm *kvm,
396 struct kvm_irq_ack_notifier *kian); 422 struct kvm_irq_ack_notifier *kian);
@@ -552,4 +578,21 @@ static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu)
552 return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id; 578 return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id;
553} 579}
554#endif 580#endif
581
582#ifdef __KVM_HAVE_DEVICE_ASSIGNMENT
583
584long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
585 unsigned long arg);
586
587#else
588
589static inline long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
590 unsigned long arg)
591{
592 return -ENOTTY;
593}
594
555#endif 595#endif
596
597#endif
598
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 87698640c091..6a9c4ddd3d95 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -365,7 +365,7 @@ enum {
365 /* This should match the actual table size of 365 /* This should match the actual table size of
366 * ata_eh_cmd_timeout_table in libata-eh.c. 366 * ata_eh_cmd_timeout_table in libata-eh.c.
367 */ 367 */
368 ATA_EH_CMD_TIMEOUT_TABLE_SIZE = 5, 368 ATA_EH_CMD_TIMEOUT_TABLE_SIZE = 6,
369 369
370 /* Horkage types. May be set by libata or controller on drives 370 /* Horkage types. May be set by libata or controller on drives
371 (some horkage may be drive/controller pair dependant */ 371 (some horkage may be drive/controller pair dependant */
@@ -595,6 +595,7 @@ struct ata_device {
595 unsigned int horkage; /* List of broken features */ 595 unsigned int horkage; /* List of broken features */
596 unsigned long flags; /* ATA_DFLAG_xxx */ 596 unsigned long flags; /* ATA_DFLAG_xxx */
597 struct scsi_device *sdev; /* attached SCSI device */ 597 struct scsi_device *sdev; /* attached SCSI device */
598 void *private_data;
598#ifdef CONFIG_ATA_ACPI 599#ifdef CONFIG_ATA_ACPI
599 acpi_handle acpi_handle; 600 acpi_handle acpi_handle;
600 union acpi_object *gtf_cache; 601 union acpi_object *gtf_cache;
@@ -1023,7 +1024,7 @@ extern int ata_std_bios_param(struct scsi_device *sdev,
1023extern int ata_scsi_slave_config(struct scsi_device *sdev); 1024extern int ata_scsi_slave_config(struct scsi_device *sdev);
1024extern void ata_scsi_slave_destroy(struct scsi_device *sdev); 1025extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
1025extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, 1026extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
1026 int queue_depth); 1027 int queue_depth, int reason);
1027extern struct ata_device *ata_dev_pair(struct ata_device *adev); 1028extern struct ata_device *ata_dev_pair(struct ata_device *adev);
1028extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); 1029extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
1029 1030
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h
new file mode 100644
index 000000000000..3a2b2d9b0472
--- /dev/null
+++ b/include/linux/lru_cache.h
@@ -0,0 +1,294 @@
1/*
2 lru_cache.c
3
4 This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
5
6 Copyright (C) 2003-2008, LINBIT Information Technologies GmbH.
7 Copyright (C) 2003-2008, Philipp Reisner <philipp.reisner@linbit.com>.
8 Copyright (C) 2003-2008, Lars Ellenberg <lars.ellenberg@linbit.com>.
9
10 drbd is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
13 any later version.
14
15 drbd is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with drbd; see the file COPYING. If not, write to
22 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23
24 */
25
26#ifndef LRU_CACHE_H
27#define LRU_CACHE_H
28
29#include <linux/list.h>
30#include <linux/slab.h>
31#include <linux/bitops.h>
32#include <linux/string.h> /* for memset */
33#include <linux/seq_file.h>
34
35/*
36This header file (and its .c file; kernel-doc of functions see there)
37 define a helper framework to easily keep track of index:label associations,
38 and changes to an "active set" of objects, as well as pending transactions,
39 to persistently record those changes.
40
41 We use an LRU policy if it is necessary to "cool down" a region currently in
42 the active set before we can "heat" a previously unused region.
43
44 Because of this later property, it is called "lru_cache".
45 As it actually Tracks Objects in an Active SeT, we could also call it
46 toast (incidentally that is what may happen to the data on the
47 backend storage uppon next resync, if we don't get it right).
48
49What for?
50
51We replicate IO (more or less synchronously) to local and remote disk.
52
53For crash recovery after replication node failure,
54 we need to resync all regions that have been target of in-flight WRITE IO
55 (in use, or "hot", regions), as we don't know wether or not those WRITEs have
56 made it to stable storage.
57
58 To avoid a "full resync", we need to persistently track these regions.
59
60 This is known as "write intent log", and can be implemented as on-disk
61 (coarse or fine grained) bitmap, or other meta data.
62
63 To avoid the overhead of frequent extra writes to this meta data area,
64 usually the condition is softened to regions that _may_ have been target of
65 in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent
66 bitmap, trading frequency of meta data transactions against amount of
67 (possibly unneccessary) resync traffic.
68
69 If we set a hard limit on the area that may be "hot" at any given time, we
70 limit the amount of resync traffic needed for crash recovery.
71
72For recovery after replication link failure,
73 we need to resync all blocks that have been changed on the other replica
74 in the mean time, or, if both replica have been changed independently [*],
75 all blocks that have been changed on either replica in the mean time.
76 [*] usually as a result of a cluster split-brain and insufficient protection.
77 but there are valid use cases to do this on purpose.
78
79 Tracking those blocks can be implemented as "dirty bitmap".
80 Having it fine-grained reduces the amount of resync traffic.
81 It should also be persistent, to allow for reboots (or crashes)
82 while the replication link is down.
83
84There are various possible implementations for persistently storing
85write intent log information, three of which are mentioned here.
86
87"Chunk dirtying"
88 The on-disk "dirty bitmap" may be re-used as "write-intent" bitmap as well.
89 To reduce the frequency of bitmap updates for write-intent log purposes,
90 one could dirty "chunks" (of some size) at a time of the (fine grained)
91 on-disk bitmap, while keeping the in-memory "dirty" bitmap as clean as
92 possible, flushing it to disk again when a previously "hot" (and on-disk
93 dirtied as full chunk) area "cools down" again (no IO in flight anymore,
94 and none expected in the near future either).
95
96"Explicit (coarse) write intent bitmap"
97 An other implementation could chose a (probably coarse) explicit bitmap,
98 for write-intent log purposes, additionally to the fine grained dirty bitmap.
99
100"Activity log"
101 Yet an other implementation may keep track of the hot regions, by starting
102 with an empty set, and writing down a journal of region numbers that have
103 become "hot", or have "cooled down" again.
104
105 To be able to use a ring buffer for this journal of changes to the active
106 set, we not only record the actual changes to that set, but also record the
107 not changing members of the set in a round robin fashion. To do so, we use a
108 fixed (but configurable) number of slots which we can identify by index, and
109 associate region numbers (labels) with these indices.
110 For each transaction recording a change to the active set, we record the
111 change itself (index: -old_label, +new_label), and which index is associated
112 with which label (index: current_label) within a certain sliding window that
113 is moved further over the available indices with each such transaction.
114
115 Thus, for crash recovery, if the ringbuffer is sufficiently large, we can
116 accurately reconstruct the active set.
117
118 Sufficiently large depends only on maximum number of active objects, and the
119 size of the sliding window recording "index: current_label" associations within
120 each transaction.
121
122 This is what we call the "activity log".
123
124 Currently we need one activity log transaction per single label change, which
125 does not give much benefit over the "dirty chunks of bitmap" approach, other
126 than potentially less seeks.
127
128 We plan to change the transaction format to support multiple changes per
129 transaction, which then would reduce several (disjoint, "random") updates to
130 the bitmap into one transaction to the activity log ring buffer.
131*/
132
133/* this defines an element in a tracked set
134 * .colision is for hash table lookup.
135 * When we process a new IO request, we know its sector, thus can deduce the
136 * region number (label) easily. To do the label -> object lookup without a
137 * full list walk, we use a simple hash table.
138 *
139 * .list is on one of three lists:
140 * in_use: currently in use (refcnt > 0, lc_number != LC_FREE)
141 * lru: unused but ready to be reused or recycled
142 * (ts_refcnt == 0, lc_number != LC_FREE),
143 * free: unused but ready to be recycled
144 * (ts_refcnt == 0, lc_number == LC_FREE),
145 *
146 * an element is said to be "in the active set",
147 * if either on "in_use" or "lru", i.e. lc_number != LC_FREE.
148 *
149 * DRBD currently (May 2009) only uses 61 elements on the resync lru_cache
150 * (total memory usage 2 pages), and up to 3833 elements on the act_log
151 * lru_cache, totalling ~215 kB for 64bit architechture, ~53 pages.
152 *
153 * We usually do not actually free these objects again, but only "recycle"
154 * them, as the change "index: -old_label, +LC_FREE" would need a transaction
155 * as well. Which also means that using a kmem_cache to allocate the objects
156 * from wastes some resources.
157 * But it avoids high order page allocations in kmalloc.
158 */
159struct lc_element {
160 struct hlist_node colision;
161 struct list_head list; /* LRU list or free list */
162 unsigned refcnt;
163 /* back "pointer" into ts_cache->element[index],
164 * for paranoia, and for "ts_element_to_index" */
165 unsigned lc_index;
166 /* if we want to track a larger set of objects,
167 * it needs to become arch independend u64 */
168 unsigned lc_number;
169
170 /* special label when on free list */
171#define LC_FREE (~0U)
172};
173
174struct lru_cache {
175 /* the least recently used item is kept at lru->prev */
176 struct list_head lru;
177 struct list_head free;
178 struct list_head in_use;
179
180 /* the pre-created kmem cache to allocate the objects from */
181 struct kmem_cache *lc_cache;
182
183 /* size of tracked objects, used to memset(,0,) them in lc_reset */
184 size_t element_size;
185 /* offset of struct lc_element member in the tracked object */
186 size_t element_off;
187
188 /* number of elements (indices) */
189 unsigned int nr_elements;
190 /* Arbitrary limit on maximum tracked objects. Practical limit is much
191 * lower due to allocation failures, probably. For typical use cases,
192 * nr_elements should be a few thousand at most.
193 * This also limits the maximum value of ts_element.ts_index, allowing the
194 * 8 high bits of .ts_index to be overloaded with flags in the future. */
195#define LC_MAX_ACTIVE (1<<24)
196
197 /* statistics */
198 unsigned used; /* number of lelements currently on in_use list */
199 unsigned long hits, misses, starving, dirty, changed;
200
201 /* see below: flag-bits for lru_cache */
202 unsigned long flags;
203
204 /* when changing the label of an index element */
205 unsigned int new_number;
206
207 /* for paranoia when changing the label of an index element */
208 struct lc_element *changing_element;
209
210 void *lc_private;
211 const char *name;
212
213 /* nr_elements there */
214 struct hlist_head *lc_slot;
215 struct lc_element **lc_element;
216};
217
218
219/* flag-bits for lru_cache */
220enum {
221 /* debugging aid, to catch concurrent access early.
222 * user needs to guarantee exclusive access by proper locking! */
223 __LC_PARANOIA,
224 /* if we need to change the set, but currently there is a changing
225 * transaction pending, we are "dirty", and must deferr further
226 * changing requests */
227 __LC_DIRTY,
228 /* if we need to change the set, but currently there is no free nor
229 * unused element available, we are "starving", and must not give out
230 * further references, to guarantee that eventually some refcnt will
231 * drop to zero and we will be able to make progress again, changing
232 * the set, writing the transaction.
233 * if the statistics say we are frequently starving,
234 * nr_elements is too small. */
235 __LC_STARVING,
236};
237#define LC_PARANOIA (1<<__LC_PARANOIA)
238#define LC_DIRTY (1<<__LC_DIRTY)
239#define LC_STARVING (1<<__LC_STARVING)
240
241extern struct lru_cache *lc_create(const char *name, struct kmem_cache *cache,
242 unsigned e_count, size_t e_size, size_t e_off);
243extern void lc_reset(struct lru_cache *lc);
244extern void lc_destroy(struct lru_cache *lc);
245extern void lc_set(struct lru_cache *lc, unsigned int enr, int index);
246extern void lc_del(struct lru_cache *lc, struct lc_element *element);
247
248extern struct lc_element *lc_try_get(struct lru_cache *lc, unsigned int enr);
249extern struct lc_element *lc_find(struct lru_cache *lc, unsigned int enr);
250extern struct lc_element *lc_get(struct lru_cache *lc, unsigned int enr);
251extern unsigned int lc_put(struct lru_cache *lc, struct lc_element *e);
252extern void lc_changed(struct lru_cache *lc, struct lc_element *e);
253
254struct seq_file;
255extern size_t lc_seq_printf_stats(struct seq_file *seq, struct lru_cache *lc);
256
257extern void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char *utext,
258 void (*detail) (struct seq_file *, struct lc_element *));
259
260/**
261 * lc_try_lock - can be used to stop lc_get() from changing the tracked set
262 * @lc: the lru cache to operate on
263 *
264 * Note that the reference counts and order on the active and lru lists may
265 * still change. Returns true if we aquired the lock.
266 */
267static inline int lc_try_lock(struct lru_cache *lc)
268{
269 return !test_and_set_bit(__LC_DIRTY, &lc->flags);
270}
271
272/**
273 * lc_unlock - unlock @lc, allow lc_get() to change the set again
274 * @lc: the lru cache to operate on
275 */
276static inline void lc_unlock(struct lru_cache *lc)
277{
278 clear_bit(__LC_DIRTY, &lc->flags);
279 smp_mb__after_clear_bit();
280}
281
282static inline int lc_is_used(struct lru_cache *lc, unsigned int enr)
283{
284 struct lc_element *e = lc_find(lc, enr);
285 return e && e->refcnt;
286}
287
288#define lc_entry(ptr, type, member) \
289 container_of(ptr, type, member)
290
291extern struct lc_element *lc_element_by_index(struct lru_cache *lc, unsigned i);
292extern unsigned int lc_index_of(struct lru_cache *lc, struct lc_element *e);
293
294#endif
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h
index 190c37854870..f78f83d7663f 100644
--- a/include/linux/lsm_audit.h
+++ b/include/linux/lsm_audit.h
@@ -26,14 +26,15 @@
26 26
27/* Auxiliary data to use in generating the audit record. */ 27/* Auxiliary data to use in generating the audit record. */
28struct common_audit_data { 28struct common_audit_data {
29 char type; 29 char type;
30#define LSM_AUDIT_DATA_FS 1 30#define LSM_AUDIT_DATA_FS 1
31#define LSM_AUDIT_DATA_NET 2 31#define LSM_AUDIT_DATA_NET 2
32#define LSM_AUDIT_DATA_CAP 3 32#define LSM_AUDIT_DATA_CAP 3
33#define LSM_AUDIT_DATA_IPC 4 33#define LSM_AUDIT_DATA_IPC 4
34#define LSM_AUDIT_DATA_TASK 5 34#define LSM_AUDIT_DATA_TASK 5
35#define LSM_AUDIT_DATA_KEY 6 35#define LSM_AUDIT_DATA_KEY 6
36#define LSM_AUDIT_NO_AUDIT 7 36#define LSM_AUDIT_NO_AUDIT 7
37#define LSM_AUDIT_DATA_KMOD 8
37 struct task_struct *tsk; 38 struct task_struct *tsk;
38 union { 39 union {
39 struct { 40 struct {
@@ -66,6 +67,7 @@ struct common_audit_data {
66 char *key_desc; 67 char *key_desc;
67 } key_struct; 68 } key_struct;
68#endif 69#endif
70 char *kmod_name;
69 } u; 71 } u;
70 /* this union contains LSM specific data */ 72 /* this union contains LSM specific data */
71 union { 73 union {
diff --git a/include/linux/mfd/88pm8607.h b/include/linux/mfd/88pm8607.h
new file mode 100644
index 000000000000..f41b428d2cec
--- /dev/null
+++ b/include/linux/mfd/88pm8607.h
@@ -0,0 +1,217 @@
1/*
2 * Marvell 88PM8607 Interface
3 *
4 * Copyright (C) 2009 Marvell International Ltd.
5 * Haojian Zhuang <haojian.zhuang@marvell.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 version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_MFD_88PM8607_H
13#define __LINUX_MFD_88PM8607_H
14
15enum {
16 PM8607_ID_BUCK1 = 0,
17 PM8607_ID_BUCK2,
18 PM8607_ID_BUCK3,
19
20 PM8607_ID_LDO1,
21 PM8607_ID_LDO2,
22 PM8607_ID_LDO3,
23 PM8607_ID_LDO4,
24 PM8607_ID_LDO5,
25 PM8607_ID_LDO6,
26 PM8607_ID_LDO7,
27 PM8607_ID_LDO8,
28 PM8607_ID_LDO9,
29 PM8607_ID_LDO10,
30 PM8607_ID_LDO12,
31 PM8607_ID_LDO14,
32
33 PM8607_ID_RG_MAX,
34};
35
36#define CHIP_ID (0x40)
37#define CHIP_ID_MASK (0xF8)
38
39/* Interrupt Registers */
40#define PM8607_STATUS_1 (0x01)
41#define PM8607_STATUS_2 (0x02)
42#define PM8607_INT_STATUS1 (0x03)
43#define PM8607_INT_STATUS2 (0x04)
44#define PM8607_INT_STATUS3 (0x05)
45#define PM8607_INT_MASK_1 (0x06)
46#define PM8607_INT_MASK_2 (0x07)
47#define PM8607_INT_MASK_3 (0x08)
48
49/* Regulator Control Registers */
50#define PM8607_LDO1 (0x10)
51#define PM8607_LDO2 (0x11)
52#define PM8607_LDO3 (0x12)
53#define PM8607_LDO4 (0x13)
54#define PM8607_LDO5 (0x14)
55#define PM8607_LDO6 (0x15)
56#define PM8607_LDO7 (0x16)
57#define PM8607_LDO8 (0x17)
58#define PM8607_LDO9 (0x18)
59#define PM8607_LDO10 (0x19)
60#define PM8607_LDO12 (0x1A)
61#define PM8607_LDO14 (0x1B)
62#define PM8607_SLEEP_MODE1 (0x1C)
63#define PM8607_SLEEP_MODE2 (0x1D)
64#define PM8607_SLEEP_MODE3 (0x1E)
65#define PM8607_SLEEP_MODE4 (0x1F)
66#define PM8607_GO (0x20)
67#define PM8607_SLEEP_BUCK1 (0x21)
68#define PM8607_SLEEP_BUCK2 (0x22)
69#define PM8607_SLEEP_BUCK3 (0x23)
70#define PM8607_BUCK1 (0x24)
71#define PM8607_BUCK2 (0x25)
72#define PM8607_BUCK3 (0x26)
73#define PM8607_BUCK_CONTROLS (0x27)
74#define PM8607_SUPPLIES_EN11 (0x2B)
75#define PM8607_SUPPLIES_EN12 (0x2C)
76#define PM8607_GROUP1 (0x2D)
77#define PM8607_GROUP2 (0x2E)
78#define PM8607_GROUP3 (0x2F)
79#define PM8607_GROUP4 (0x30)
80#define PM8607_GROUP5 (0x31)
81#define PM8607_GROUP6 (0x32)
82#define PM8607_SUPPLIES_EN21 (0x33)
83#define PM8607_SUPPLIES_EN22 (0x34)
84
85/* RTC Control Registers */
86#define PM8607_RTC1 (0xA0)
87#define PM8607_RTC_COUNTER1 (0xA1)
88#define PM8607_RTC_COUNTER2 (0xA2)
89#define PM8607_RTC_COUNTER3 (0xA3)
90#define PM8607_RTC_COUNTER4 (0xA4)
91#define PM8607_RTC_EXPIRE1 (0xA5)
92#define PM8607_RTC_EXPIRE2 (0xA6)
93#define PM8607_RTC_EXPIRE3 (0xA7)
94#define PM8607_RTC_EXPIRE4 (0xA8)
95#define PM8607_RTC_TRIM1 (0xA9)
96#define PM8607_RTC_TRIM2 (0xAA)
97#define PM8607_RTC_TRIM3 (0xAB)
98#define PM8607_RTC_TRIM4 (0xAC)
99#define PM8607_RTC_MISC1 (0xAD)
100#define PM8607_RTC_MISC2 (0xAE)
101#define PM8607_RTC_MISC3 (0xAF)
102
103/* Misc Registers */
104#define PM8607_CHIP_ID (0x00)
105#define PM8607_LDO1 (0x10)
106#define PM8607_DVC3 (0x26)
107#define PM8607_MISC1 (0x40)
108
109/* bit definitions for PM8607 events */
110#define PM8607_EVENT_ONKEY (1 << 0)
111#define PM8607_EVENT_EXTON (1 << 1)
112#define PM8607_EVENT_CHG (1 << 2)
113#define PM8607_EVENT_BAT (1 << 3)
114#define PM8607_EVENT_RTC (1 << 4)
115#define PM8607_EVENT_CC (1 << 5)
116#define PM8607_EVENT_VBAT (1 << 8)
117#define PM8607_EVENT_VCHG (1 << 9)
118#define PM8607_EVENT_VSYS (1 << 10)
119#define PM8607_EVENT_TINT (1 << 11)
120#define PM8607_EVENT_GPADC0 (1 << 12)
121#define PM8607_EVENT_GPADC1 (1 << 13)
122#define PM8607_EVENT_GPADC2 (1 << 14)
123#define PM8607_EVENT_GPADC3 (1 << 15)
124#define PM8607_EVENT_AUDIO_SHORT (1 << 16)
125#define PM8607_EVENT_PEN (1 << 17)
126#define PM8607_EVENT_HEADSET (1 << 18)
127#define PM8607_EVENT_HOOK (1 << 19)
128#define PM8607_EVENT_MICIN (1 << 20)
129#define PM8607_EVENT_CHG_TIMEOUT (1 << 21)
130#define PM8607_EVENT_CHG_DONE (1 << 22)
131#define PM8607_EVENT_CHG_FAULT (1 << 23)
132
133/* bit definitions of Status Query Interface */
134#define PM8607_STATUS_CC (1 << 3)
135#define PM8607_STATUS_PEN (1 << 4)
136#define PM8607_STATUS_HEADSET (1 << 5)
137#define PM8607_STATUS_HOOK (1 << 6)
138#define PM8607_STATUS_MICIN (1 << 7)
139#define PM8607_STATUS_ONKEY (1 << 8)
140#define PM8607_STATUS_EXTON (1 << 9)
141#define PM8607_STATUS_CHG (1 << 10)
142#define PM8607_STATUS_BAT (1 << 11)
143#define PM8607_STATUS_VBUS (1 << 12)
144#define PM8607_STATUS_OV (1 << 13)
145
146/* bit definitions of BUCK3 */
147#define PM8607_BUCK3_DOUBLE (1 << 6)
148
149/* bit definitions of Misc1 */
150#define PM8607_MISC1_PI2C (1 << 0)
151
152/* Interrupt Number in 88PM8607 */
153enum {
154 PM8607_IRQ_ONKEY = 0,
155 PM8607_IRQ_EXTON,
156 PM8607_IRQ_CHG,
157 PM8607_IRQ_BAT,
158 PM8607_IRQ_RTC,
159 PM8607_IRQ_VBAT = 8,
160 PM8607_IRQ_VCHG,
161 PM8607_IRQ_VSYS,
162 PM8607_IRQ_TINT,
163 PM8607_IRQ_GPADC0,
164 PM8607_IRQ_GPADC1,
165 PM8607_IRQ_GPADC2,
166 PM8607_IRQ_GPADC3,
167 PM8607_IRQ_AUDIO_SHORT = 16,
168 PM8607_IRQ_PEN,
169 PM8607_IRQ_HEADSET,
170 PM8607_IRQ_HOOK,
171 PM8607_IRQ_MICIN,
172 PM8607_IRQ_CHG_FAIL,
173 PM8607_IRQ_CHG_DONE,
174 PM8607_IRQ_CHG_FAULT,
175};
176
177enum {
178 PM8607_CHIP_A0 = 0x40,
179 PM8607_CHIP_A1 = 0x41,
180 PM8607_CHIP_B0 = 0x48,
181};
182
183
184struct pm8607_chip {
185 struct device *dev;
186 struct mutex io_lock;
187 struct i2c_client *client;
188
189 int (*read)(struct pm8607_chip *chip, int reg, int bytes, void *dest);
190 int (*write)(struct pm8607_chip *chip, int reg, int bytes, void *src);
191
192 int buck3_double; /* DVC ramp slope double */
193 unsigned char chip_id;
194
195};
196
197#define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */
198
199enum {
200 GI2C_PORT = 0,
201 PI2C_PORT,
202};
203
204struct pm8607_platform_data {
205 int i2c_port; /* Controlled by GI2C or PI2C */
206 struct regulator_init_data *regulator[PM8607_MAX_REGULATOR];
207};
208
209extern int pm8607_reg_read(struct pm8607_chip *, int);
210extern int pm8607_reg_write(struct pm8607_chip *, int, unsigned char);
211extern int pm8607_bulk_read(struct pm8607_chip *, int, int,
212 unsigned char *);
213extern int pm8607_bulk_write(struct pm8607_chip *, int, int,
214 unsigned char *);
215extern int pm8607_set_bits(struct pm8607_chip *, int, unsigned char,
216 unsigned char);
217#endif /* __LINUX_MFD_88PM8607_H */
diff --git a/include/linux/mfd/ab4500.h b/include/linux/mfd/ab4500.h
new file mode 100644
index 000000000000..a42a7033ae53
--- /dev/null
+++ b/include/linux/mfd/ab4500.h
@@ -0,0 +1,262 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 *
10 * AB4500 device core funtions, for client access
11 */
12#ifndef MFD_AB4500_H
13#define MFD_AB4500_H
14
15#include <linux/device.h>
16
17/*
18 * AB4500 bank addresses
19 */
20#define AB4500_SYS_CTRL1_BLOCK 0x1
21#define AB4500_SYS_CTRL2_BLOCK 0x2
22#define AB4500_REGU_CTRL1 0x3
23#define AB4500_REGU_CTRL2 0x4
24#define AB4500_USB 0x5
25#define AB4500_TVOUT 0x6
26#define AB4500_DBI 0x7
27#define AB4500_ECI_AV_ACC 0x8
28#define AB4500_RESERVED 0x9
29#define AB4500_GPADC 0xA
30#define AB4500_CHARGER 0xB
31#define AB4500_GAS_GAUGE 0xC
32#define AB4500_AUDIO 0xD
33#define AB4500_INTERRUPT 0xE
34#define AB4500_RTC 0xF
35#define AB4500_MISC 0x10
36#define AB4500_DEBUG 0x12
37#define AB4500_PROD_TEST 0x13
38#define AB4500_OTP_EMUL 0x15
39
40/*
41 * System control 1 register offsets.
42 * Bank = 0x01
43 */
44#define AB4500_TURNON_STAT_REG 0x0100
45#define AB4500_RESET_STAT_REG 0x0101
46#define AB4500_PONKEY1_PRESS_STAT_REG 0x0102
47
48#define AB4500_FSM_STAT1_REG 0x0140
49#define AB4500_FSM_STAT2_REG 0x0141
50#define AB4500_SYSCLK_REQ_STAT_REG 0x0142
51#define AB4500_USB_STAT1_REG 0x0143
52#define AB4500_USB_STAT2_REG 0x0144
53#define AB4500_STATUS_SPARE1_REG 0x0145
54#define AB4500_STATUS_SPARE2_REG 0x0146
55
56#define AB4500_CTRL1_REG 0x0180
57#define AB4500_CTRL2_REG 0x0181
58
59/*
60 * System control 2 register offsets.
61 * bank = 0x02
62 */
63#define AB4500_CTRL3_REG 0x0200
64#define AB4500_MAIN_WDOG_CTRL_REG 0x0201
65#define AB4500_MAIN_WDOG_TIMER_REG 0x0202
66#define AB4500_LOW_BAT_REG 0x0203
67#define AB4500_BATT_OK_REG 0x0204
68#define AB4500_SYSCLK_TIMER_REG 0x0205
69#define AB4500_SMPSCLK_CTRL_REG 0x0206
70#define AB4500_SMPSCLK_SEL1_REG 0x0207
71#define AB4500_SMPSCLK_SEL2_REG 0x0208
72#define AB4500_SMPSCLK_SEL3_REG 0x0209
73#define AB4500_SYSULPCLK_CONF_REG 0x020A
74#define AB4500_SYSULPCLK_CTRL1_REG 0x020B
75#define AB4500_SYSCLK_CTRL_REG 0x020C
76#define AB4500_SYSCLK_REQ1_VALID_REG 0x020D
77#define AB4500_SYSCLK_REQ_VALID_REG 0x020E
78#define AB4500_SYSCTRL_SPARE_REG 0x020F
79#define AB4500_PAD_CONF_REG 0x0210
80
81/*
82 * Regu control1 register offsets
83 * Bank = 0x03
84 */
85#define AB4500_REGU_SERIAL_CTRL1_REG 0x0300
86#define AB4500_REGU_SERIAL_CTRL2_REG 0x0301
87#define AB4500_REGU_SERIAL_CTRL3_REG 0x0302
88#define AB4500_REGU_REQ_CTRL1_REG 0x0303
89#define AB4500_REGU_REQ_CTRL2_REG 0x0304
90#define AB4500_REGU_REQ_CTRL3_REG 0x0305
91#define AB4500_REGU_REQ_CTRL4_REG 0x0306
92#define AB4500_REGU_MISC1_REG 0x0380
93#define AB4500_REGU_OTGSUPPLY_CTRL_REG 0x0381
94#define AB4500_REGU_VUSB_CTRL_REG 0x0382
95#define AB4500_REGU_VAUDIO_SUPPLY_REG 0x0383
96#define AB4500_REGU_CTRL1_SPARE_REG 0x0384
97
98/*
99 * Regu control2 Vmod register offsets
100 */
101#define AB4500_REGU_VMOD_REGU_REG 0x0440
102#define AB4500_REGU_VMOD_SEL1_REG 0x0441
103#define AB4500_REGU_VMOD_SEL2_REG 0x0442
104#define AB4500_REGU_CTRL_DISCH_REG 0x0443
105#define AB4500_REGU_CTRL_DISCH2_REG 0x0444
106
107/*
108 * USB/ULPI register offsets
109 * Bank : 0x5
110 */
111#define AB4500_USB_LINE_STAT_REG 0x0580
112#define AB4500_USB_LINE_CTRL1_REG 0x0581
113#define AB4500_USB_LINE_CTRL2_REG 0x0582
114#define AB4500_USB_LINE_CTRL3_REG 0x0583
115#define AB4500_USB_LINE_CTRL4_REG 0x0584
116#define AB4500_USB_LINE_CTRL5_REG 0x0585
117#define AB4500_USB_OTG_CTRL_REG 0x0587
118#define AB4500_USB_OTG_STAT_REG 0x0588
119#define AB4500_USB_OTG_STAT_REG 0x0588
120#define AB4500_USB_CTRL_SPARE_REG 0x0589
121#define AB4500_USB_PHY_CTRL_REG 0x058A
122
123/*
124 * TVOUT / CTRL register offsets
125 * Bank : 0x06
126 */
127#define AB4500_TVOUT_CTRL_REG 0x0680
128
129/*
130 * DBI register offsets
131 * Bank : 0x07
132 */
133#define AB4500_DBI_REG1_REG 0x0700
134#define AB4500_DBI_REG2_REG 0x0701
135
136/*
137 * ECI regsiter offsets
138 * Bank : 0x08
139 */
140#define AB4500_ECI_CTRL_REG 0x0800
141#define AB4500_ECI_HOOKLEVEL_REG 0x0801
142#define AB4500_ECI_DATAOUT_REG 0x0802
143#define AB4500_ECI_DATAIN_REG 0x0803
144
145/*
146 * AV Connector register offsets
147 * Bank : 0x08
148 */
149#define AB4500_AV_CONN_REG 0x0840
150
151/*
152 * Accessory detection register offsets
153 * Bank : 0x08
154 */
155#define AB4500_ACC_DET_DB1_REG 0x0880
156#define AB4500_ACC_DET_DB2_REG 0x0881
157
158/*
159 * GPADC register offsets
160 * Bank : 0x0A
161 */
162#define AB4500_GPADC_CTRL1_REG 0x0A00
163#define AB4500_GPADC_CTRL2_REG 0x0A01
164#define AB4500_GPADC_CTRL3_REG 0x0A02
165#define AB4500_GPADC_AUTO_TIMER_REG 0x0A03
166#define AB4500_GPADC_STAT_REG 0x0A04
167#define AB4500_GPADC_MANDATAL_REG 0x0A05
168#define AB4500_GPADC_MANDATAH_REG 0x0A06
169#define AB4500_GPADC_AUTODATAL_REG 0x0A07
170#define AB4500_GPADC_AUTODATAH_REG 0x0A08
171#define AB4500_GPADC_MUX_CTRL_REG 0x0A09
172
173/*
174 * Charger / status register offfsets
175 * Bank : 0x0B
176 */
177#define AB4500_CH_STATUS1_REG 0x0B00
178#define AB4500_CH_STATUS2_REG 0x0B01
179#define AB4500_CH_USBCH_STAT1_REG 0x0B02
180#define AB4500_CH_USBCH_STAT2_REG 0x0B03
181#define AB4500_CH_FSM_STAT_REG 0x0B04
182#define AB4500_CH_STAT_REG 0x0B05
183
184/*
185 * Charger / control register offfsets
186 * Bank : 0x0B
187 */
188#define AB4500_CH_VOLT_LVL_REG 0x0B40
189
190/*
191 * Charger / main control register offfsets
192 * Bank : 0x0B
193 */
194#define AB4500_MCH_CTRL1 0x0B80
195#define AB4500_MCH_CTRL2 0x0B81
196#define AB4500_MCH_IPT_CURLVL_REG 0x0B82
197#define AB4500_CH_WD_REG 0x0B83
198
199/*
200 * Charger / USB control register offsets
201 * Bank : 0x0B
202 */
203#define AB4500_USBCH_CTRL1_REG 0x0BC0
204#define AB4500_USBCH_CTRL2_REG 0x0BC1
205#define AB4500_USBCH_IPT_CRNTLVL_REG 0x0BC2
206
207/*
208 * RTC bank register offsets
209 * Bank : 0xF
210 */
211#define AB4500_RTC_SOFF_STAT_REG 0x0F00
212#define AB4500_RTC_CC_CONF_REG 0x0F01
213#define AB4500_RTC_READ_REQ_REG 0x0F02
214#define AB4500_RTC_WATCH_TSECMID_REG 0x0F03
215#define AB4500_RTC_WATCH_TSECHI_REG 0x0F04
216#define AB4500_RTC_WATCH_TMIN_LOW_REG 0x0F05
217#define AB4500_RTC_WATCH_TMIN_MID_REG 0x0F06
218#define AB4500_RTC_WATCH_TMIN_HI_REG 0x0F07
219#define AB4500_RTC_ALRM_MIN_LOW_REG 0x0F08
220#define AB4500_RTC_ALRM_MIN_MID_REG 0x0F09
221#define AB4500_RTC_ALRM_MIN_HI_REG 0x0F0A
222#define AB4500_RTC_STAT_REG 0x0F0B
223#define AB4500_RTC_BKUP_CHG_REG 0x0F0C
224#define AB4500_RTC_FORCE_BKUP_REG 0x0F0D
225#define AB4500_RTC_CALIB_REG 0x0F0E
226#define AB4500_RTC_SWITCH_STAT_REG 0x0F0F
227
228/*
229 * PWM Out generators
230 * Bank: 0x10
231 */
232#define AB4500_PWM_OUT_CTRL1_REG 0x1060
233#define AB4500_PWM_OUT_CTRL2_REG 0x1061
234#define AB4500_PWM_OUT_CTRL3_REG 0x1062
235#define AB4500_PWM_OUT_CTRL4_REG 0x1063
236#define AB4500_PWM_OUT_CTRL5_REG 0x1064
237#define AB4500_PWM_OUT_CTRL6_REG 0x1065
238#define AB4500_PWM_OUT_CTRL7_REG 0x1066
239
240#define AB4500_I2C_PAD_CTRL_REG 0x1067
241#define AB4500_REV_REG 0x1080
242
243/**
244 * struct ab4500
245 * @spi: spi device structure
246 * @tx_buf: transmit buffer
247 * @rx_buf: receive buffer
248 * @lock: sync primitive
249 */
250struct ab4500 {
251 struct spi_device *spi;
252 unsigned long tx_buf[4];
253 unsigned long rx_buf[4];
254 struct mutex lock;
255};
256
257int ab4500_write(struct ab4500 *ab4500, unsigned char block,
258 unsigned long addr, unsigned char data);
259int ab4500_read(struct ab4500 *ab4500, unsigned char block,
260 unsigned long addr);
261
262#endif /* MFD_AB4500_H */
diff --git a/include/linux/mfd/adp5520.h b/include/linux/mfd/adp5520.h
new file mode 100644
index 000000000000..ac37558a4673
--- /dev/null
+++ b/include/linux/mfd/adp5520.h
@@ -0,0 +1,299 @@
1/*
2 * Definitions and platform data for Analog Devices
3 * ADP5520/ADP5501 MFD PMICs (Backlight, LED, GPIO and Keys)
4 *
5 * Copyright 2009 Analog Devices Inc.
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10
11#ifndef __LINUX_MFD_ADP5520_H
12#define __LINUX_MFD_ADP5520_H
13
14#define ID_ADP5520 5520
15#define ID_ADP5501 5501
16
17/*
18 * ADP5520/ADP5501 Register Map
19 */
20
21#define ADP5520_MODE_STATUS 0x00
22#define ADP5520_INTERRUPT_ENABLE 0x01
23#define ADP5520_BL_CONTROL 0x02
24#define ADP5520_BL_TIME 0x03
25#define ADP5520_BL_FADE 0x04
26#define ADP5520_DAYLIGHT_MAX 0x05
27#define ADP5520_DAYLIGHT_DIM 0x06
28#define ADP5520_OFFICE_MAX 0x07
29#define ADP5520_OFFICE_DIM 0x08
30#define ADP5520_DARK_MAX 0x09
31#define ADP5520_DARK_DIM 0x0A
32#define ADP5520_BL_VALUE 0x0B
33#define ADP5520_ALS_CMPR_CFG 0x0C
34#define ADP5520_L2_TRIP 0x0D
35#define ADP5520_L2_HYS 0x0E
36#define ADP5520_L3_TRIP 0x0F
37#define ADP5520_L3_HYS 0x10
38#define ADP5520_LED_CONTROL 0x11
39#define ADP5520_LED_TIME 0x12
40#define ADP5520_LED_FADE 0x13
41#define ADP5520_LED1_CURRENT 0x14
42#define ADP5520_LED2_CURRENT 0x15
43#define ADP5520_LED3_CURRENT 0x16
44
45/*
46 * ADP5520 Register Map
47 */
48
49#define ADP5520_GPIO_CFG_1 0x17
50#define ADP5520_GPIO_CFG_2 0x18
51#define ADP5520_GPIO_IN 0x19
52#define ADP5520_GPIO_OUT 0x1A
53#define ADP5520_GPIO_INT_EN 0x1B
54#define ADP5520_GPIO_INT_STAT 0x1C
55#define ADP5520_GPIO_INT_LVL 0x1D
56#define ADP5520_GPIO_DEBOUNCE 0x1E
57#define ADP5520_GPIO_PULLUP 0x1F
58#define ADP5520_KP_INT_STAT_1 0x20
59#define ADP5520_KP_INT_STAT_2 0x21
60#define ADP5520_KR_INT_STAT_1 0x22
61#define ADP5520_KR_INT_STAT_2 0x23
62#define ADP5520_KEY_STAT_1 0x24
63#define ADP5520_KEY_STAT_2 0x25
64
65/*
66 * MODE_STATUS bits
67 */
68
69#define ADP5520_nSTNBY (1 << 7)
70#define ADP5520_BL_EN (1 << 6)
71#define ADP5520_DIM_EN (1 << 5)
72#define ADP5520_OVP_INT (1 << 4)
73#define ADP5520_CMPR_INT (1 << 3)
74#define ADP5520_GPI_INT (1 << 2)
75#define ADP5520_KR_INT (1 << 1)
76#define ADP5520_KP_INT (1 << 0)
77
78/*
79 * INTERRUPT_ENABLE bits
80 */
81
82#define ADP5520_AUTO_LD_EN (1 << 4)
83#define ADP5520_CMPR_IEN (1 << 3)
84#define ADP5520_OVP_IEN (1 << 2)
85#define ADP5520_KR_IEN (1 << 1)
86#define ADP5520_KP_IEN (1 << 0)
87
88/*
89 * BL_CONTROL bits
90 */
91
92#define ADP5520_BL_LVL ((x) << 5)
93#define ADP5520_BL_LAW ((x) << 4)
94#define ADP5520_BL_AUTO_ADJ (1 << 3)
95#define ADP5520_OVP_EN (1 << 2)
96#define ADP5520_FOVR (1 << 1)
97#define ADP5520_KP_BL_EN (1 << 0)
98
99/*
100 * ALS_CMPR_CFG bits
101 */
102
103#define ADP5520_L3_OUT (1 << 3)
104#define ADP5520_L2_OUT (1 << 2)
105#define ADP5520_L3_EN (1 << 1)
106
107#define ADP5020_MAX_BRIGHTNESS 0x7F
108
109#define FADE_VAL(in, out) ((0xF & (in)) | ((0xF & (out)) << 4))
110#define BL_CTRL_VAL(law, auto) (((1 & (auto)) << 3) | ((0x3 & (law)) << 4))
111#define ALS_CMPR_CFG_VAL(filt, l3_en) (((0x7 & filt) << 5) | l3_en)
112
113/*
114 * LEDs subdevice bits and masks
115 */
116
117#define ADP5520_01_MAXLEDS 3
118
119#define ADP5520_FLAG_LED_MASK 0x3
120#define ADP5520_FLAG_OFFT_SHIFT 8
121#define ADP5520_FLAG_OFFT_MASK 0x3
122
123#define ADP5520_R3_MODE (1 << 5)
124#define ADP5520_C3_MODE (1 << 4)
125#define ADP5520_LED_LAW (1 << 3)
126#define ADP5520_LED3_EN (1 << 2)
127#define ADP5520_LED2_EN (1 << 1)
128#define ADP5520_LED1_EN (1 << 0)
129
130/*
131 * GPIO subdevice bits and masks
132 */
133
134#define ADP5520_MAXGPIOS 8
135
136#define ADP5520_GPIO_C3 (1 << 7) /* LED2 or GPIO7 aka C3 */
137#define ADP5520_GPIO_C2 (1 << 6)
138#define ADP5520_GPIO_C1 (1 << 5)
139#define ADP5520_GPIO_C0 (1 << 4)
140#define ADP5520_GPIO_R3 (1 << 3) /* LED3 or GPIO3 aka R3 */
141#define ADP5520_GPIO_R2 (1 << 2)
142#define ADP5520_GPIO_R1 (1 << 1)
143#define ADP5520_GPIO_R0 (1 << 0)
144
145struct adp5520_gpio_platform_data {
146 unsigned gpio_start;
147 u8 gpio_en_mask;
148 u8 gpio_pullup_mask;
149};
150
151/*
152 * Keypad subdevice bits and masks
153 */
154
155#define ADP5520_MAXKEYS 16
156
157#define ADP5520_COL_C3 (1 << 7) /* LED2 or GPIO7 aka C3 */
158#define ADP5520_COL_C2 (1 << 6)
159#define ADP5520_COL_C1 (1 << 5)
160#define ADP5520_COL_C0 (1 << 4)
161#define ADP5520_ROW_R3 (1 << 3) /* LED3 or GPIO3 aka R3 */
162#define ADP5520_ROW_R2 (1 << 2)
163#define ADP5520_ROW_R1 (1 << 1)
164#define ADP5520_ROW_R0 (1 << 0)
165
166#define ADP5520_KEY(row, col) (col + row * 4)
167#define ADP5520_KEYMAPSIZE ADP5520_MAXKEYS
168
169struct adp5520_keys_platform_data {
170 int rows_en_mask; /* Number of rows */
171 int cols_en_mask; /* Number of columns */
172 const unsigned short *keymap; /* Pointer to keymap */
173 unsigned short keymapsize; /* Keymap size */
174 unsigned repeat:1; /* Enable key repeat */
175};
176
177
178/*
179 * LEDs subdevice platform data
180 */
181
182#define FLAG_ID_ADP5520_LED1_ADP5501_LED0 1 /* ADP5520 PIN ILED */
183#define FLAG_ID_ADP5520_LED2_ADP5501_LED1 2 /* ADP5520 PIN C3 */
184#define FLAG_ID_ADP5520_LED3_ADP5501_LED2 3 /* ADP5520 PIN R3 */
185
186#define ADP5520_LED_DIS_BLINK (0 << ADP5520_FLAG_OFFT_SHIFT)
187#define ADP5520_LED_OFFT_600ms (1 << ADP5520_FLAG_OFFT_SHIFT)
188#define ADP5520_LED_OFFT_800ms (2 << ADP5520_FLAG_OFFT_SHIFT)
189#define ADP5520_LED_OFFT_1200ms (3 << ADP5520_FLAG_OFFT_SHIFT)
190
191#define ADP5520_LED_ONT_200ms 0
192#define ADP5520_LED_ONT_600ms 1
193#define ADP5520_LED_ONT_800ms 2
194#define ADP5520_LED_ONT_1200ms 3
195
196struct adp5520_leds_platform_data {
197 int num_leds;
198 struct led_info *leds;
199 u8 fade_in; /* Backlight Fade-In Timer */
200 u8 fade_out; /* Backlight Fade-Out Timer */
201 u8 led_on_time;
202};
203
204/*
205 * Backlight subdevice platform data
206 */
207
208#define ADP5520_FADE_T_DIS 0 /* Fade Timer Disabled */
209#define ADP5520_FADE_T_300ms 1 /* 0.3 Sec */
210#define ADP5520_FADE_T_600ms 2
211#define ADP5520_FADE_T_900ms 3
212#define ADP5520_FADE_T_1200ms 4
213#define ADP5520_FADE_T_1500ms 5
214#define ADP5520_FADE_T_1800ms 6
215#define ADP5520_FADE_T_2100ms 7
216#define ADP5520_FADE_T_2400ms 8
217#define ADP5520_FADE_T_2700ms 9
218#define ADP5520_FADE_T_3000ms 10
219#define ADP5520_FADE_T_3500ms 11
220#define ADP5520_FADE_T_4000ms 12
221#define ADP5520_FADE_T_4500ms 13
222#define ADP5520_FADE_T_5000ms 14
223#define ADP5520_FADE_T_5500ms 15 /* 5.5 Sec */
224
225#define ADP5520_BL_LAW_LINEAR 0
226#define ADP5520_BL_LAW_SQUARE 1
227#define ADP5520_BL_LAW_CUBIC1 2
228#define ADP5520_BL_LAW_CUBIC2 3
229
230#define ADP5520_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */
231#define ADP5520_BL_AMBL_FILT_160ms 1
232#define ADP5520_BL_AMBL_FILT_320ms 2
233#define ADP5520_BL_AMBL_FILT_640ms 3
234#define ADP5520_BL_AMBL_FILT_1280ms 4
235#define ADP5520_BL_AMBL_FILT_2560ms 5
236#define ADP5520_BL_AMBL_FILT_5120ms 6
237#define ADP5520_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */
238
239 /*
240 * Blacklight current 0..30mA
241 */
242#define ADP5520_BL_CUR_mA(I) ((I * 127) / 30)
243
244 /*
245 * L2 comparator current 0..1000uA
246 */
247#define ADP5520_L2_COMP_CURR_uA(I) ((I * 255) / 1000)
248
249 /*
250 * L3 comparator current 0..127uA
251 */
252#define ADP5520_L3_COMP_CURR_uA(I) ((I * 255) / 127)
253
254struct adp5520_backlight_platform_data {
255 u8 fade_in; /* Backlight Fade-In Timer */
256 u8 fade_out; /* Backlight Fade-Out Timer */
257 u8 fade_led_law; /* fade-on/fade-off transfer characteristic */
258
259 u8 en_ambl_sens; /* 1 = enable ambient light sensor */
260 u8 abml_filt; /* Light sensor filter time */
261 u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
262 u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
263 u8 l2_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
264 u8 l2_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
265 u8 l3_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
266 u8 l3_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
267 u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1000 uA */
268 u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1000 uA */
269 u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 127 uA */
270 u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 127 uA */
271};
272
273/*
274 * MFD chip platform data
275 */
276
277struct adp5520_platform_data {
278 struct adp5520_keys_platform_data *keys;
279 struct adp5520_gpio_platform_data *gpio;
280 struct adp5520_leds_platform_data *leds;
281 struct adp5520_backlight_platform_data *backlight;
282};
283
284/*
285 * MFD chip functions
286 */
287
288extern int adp5520_read(struct device *dev, int reg, uint8_t *val);
289extern int adp5520_write(struct device *dev, int reg, u8 val);
290extern int adp5520_clr_bits(struct device *dev, int reg, uint8_t bit_mask);
291extern int adp5520_set_bits(struct device *dev, int reg, uint8_t bit_mask);
292
293extern int adp5520_register_notifier(struct device *dev,
294 struct notifier_block *nb, unsigned int events);
295
296extern int adp5520_unregister_notifier(struct device *dev,
297 struct notifier_block *nb, unsigned int events);
298
299#endif /* __LINUX_MFD_ADP5520_H */
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h
index c63b65c94429..0aa3a1a49ee3 100644
--- a/include/linux/mfd/da903x.h
+++ b/include/linux/mfd/da903x.h
@@ -96,6 +96,10 @@ struct da9034_touch_pdata {
96 int y_inverted; 96 int y_inverted;
97}; 97};
98 98
99struct da9034_backlight_pdata {
100 int output_current; /* output current of WLED, from 0-31 (in mA) */
101};
102
99/* DA9030 battery charger data */ 103/* DA9030 battery charger data */
100struct power_supply_info; 104struct power_supply_info;
101 105
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h
index e5124ceea769..40c372165f3e 100644
--- a/include/linux/mfd/ezx-pcap.h
+++ b/include/linux/mfd/ezx-pcap.h
@@ -45,7 +45,7 @@ void pcap_set_ts_bits(struct pcap_chip *, u32);
45#define PCAP_CLEAR_INTERRUPT_REGISTER 0x01ffffff 45#define PCAP_CLEAR_INTERRUPT_REGISTER 0x01ffffff
46#define PCAP_MASK_ALL_INTERRUPT 0x01ffffff 46#define PCAP_MASK_ALL_INTERRUPT 0x01ffffff
47 47
48/* registers acessible by both pcap ports */ 48/* registers accessible by both pcap ports */
49#define PCAP_REG_ISR 0x0 /* Interrupt Status */ 49#define PCAP_REG_ISR 0x0 /* Interrupt Status */
50#define PCAP_REG_MSR 0x1 /* Interrupt Mask */ 50#define PCAP_REG_MSR 0x1 /* Interrupt Mask */
51#define PCAP_REG_PSTAT 0x2 /* Processor Status */ 51#define PCAP_REG_PSTAT 0x2 /* Processor Status */
@@ -67,7 +67,7 @@ void pcap_set_ts_bits(struct pcap_chip *, u32);
67#define PCAP_REG_VENDOR_TEST1 0x1e 67#define PCAP_REG_VENDOR_TEST1 0x1e
68#define PCAP_REG_VENDOR_TEST2 0x1f 68#define PCAP_REG_VENDOR_TEST2 0x1f
69 69
70/* registers acessible by pcap port 1 only (a1200, e2 & e6) */ 70/* registers accessible by pcap port 1 only (a1200, e2 & e6) */
71#define PCAP_REG_INT_SEL 0x3 /* Interrupt Select */ 71#define PCAP_REG_INT_SEL 0x3 /* Interrupt Select */
72#define PCAP_REG_SWCTRL 0x4 /* Switching Regulator Control */ 72#define PCAP_REG_SWCTRL 0x4 /* Switching Regulator Control */
73#define PCAP_REG_VREG1 0x5 /* Regulator Bank 1 Control */ 73#define PCAP_REG_VREG1 0x5 /* Regulator Bank 1 Control */
@@ -231,9 +231,6 @@ void pcap_set_ts_bits(struct pcap_chip *, u32);
231#define PCAP_LED_4MA 1 231#define PCAP_LED_4MA 1
232#define PCAP_LED_5MA 2 232#define PCAP_LED_5MA 2
233#define PCAP_LED_9MA 3 233#define PCAP_LED_9MA 3
234#define PCAP_LED_GPIO_VAL_MASK 0x00ffffff
235#define PCAP_LED_GPIO_EN 0x01000000
236#define PCAP_LED_GPIO_INVERT 0x02000000
237#define PCAP_LED_T_MASK 0xf 234#define PCAP_LED_T_MASK 0xf
238#define PCAP_LED_C_MASK 0x3 235#define PCAP_LED_C_MASK 0x3
239#define PCAP_BL_MASK 0x1f 236#define PCAP_BL_MASK 0x1f
diff --git a/include/linux/mfd/mc13783-private.h b/include/linux/mfd/mc13783-private.h
index 47e698cb0f16..95cf9360553f 100644
--- a/include/linux/mfd/mc13783-private.h
+++ b/include/linux/mfd/mc13783-private.h
@@ -24,52 +24,23 @@
24 24
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/mfd/mc13783.h> 26#include <linux/mfd/mc13783.h>
27#include <linux/workqueue.h>
28#include <linux/mutex.h> 27#include <linux/mutex.h>
29 28#include <linux/interrupt.h>
30struct mc13783_irq {
31 void (*handler)(int, void *);
32 void *data;
33};
34
35#define MC13783_NUM_IRQ 2
36#define MC13783_IRQ_TS 0
37#define MC13783_IRQ_REGULATOR 1
38
39#define MC13783_ADC_MODE_TS 1
40#define MC13783_ADC_MODE_SINGLE_CHAN 2
41#define MC13783_ADC_MODE_MULT_CHAN 3
42 29
43struct mc13783 { 30struct mc13783 {
44 int revision; 31 struct spi_device *spidev;
45 struct device *dev; 32 struct mutex lock;
46 struct spi_device *spi_device;
47
48 int (*read_dev)(void *data, char reg, int count, u32 *dst);
49 int (*write_dev)(void *data, char reg, int count, const u32 *src);
50
51 struct mutex io_lock;
52 void *io_data;
53 int irq; 33 int irq;
54 unsigned int flags; 34 int flags;
55 35
56 struct mc13783_irq irq_handler[MC13783_NUM_IRQ]; 36 irq_handler_t irqhandler[MC13783_NUM_IRQ];
57 struct work_struct work; 37 void *irqdata[MC13783_NUM_IRQ];
58 struct completion adc_done;
59 unsigned int ts_active;
60 struct mutex adc_conv_lock;
61 38
39 /* XXX these should go as platformdata to the regulator subdevice */
62 struct mc13783_regulator_init_data *regulators; 40 struct mc13783_regulator_init_data *regulators;
63 int num_regulators; 41 int num_regulators;
64}; 42};
65 43
66int mc13783_reg_read(struct mc13783 *, int reg_num, u32 *);
67int mc13783_reg_write(struct mc13783 *, int, u32);
68int mc13783_set_bits(struct mc13783 *, int, u32, u32);
69int mc13783_free_irq(struct mc13783 *mc13783, int irq);
70int mc13783_register_irq(struct mc13783 *mc13783, int irq,
71 void (*handler) (int, void *), void *data);
72
73#define MC13783_REG_INTERRUPT_STATUS_0 0 44#define MC13783_REG_INTERRUPT_STATUS_0 0
74#define MC13783_REG_INTERRUPT_MASK_0 1 45#define MC13783_REG_INTERRUPT_MASK_0 1
75#define MC13783_REG_INTERRUPT_SENSE_0 2 46#define MC13783_REG_INTERRUPT_SENSE_0 2
@@ -136,55 +107,6 @@ int mc13783_register_irq(struct mc13783 *mc13783, int irq,
136#define MC13783_REG_TEST_3 63 107#define MC13783_REG_TEST_3 63
137#define MC13783_REG_NB 64 108#define MC13783_REG_NB 64
138 109
139
140/*
141 * Interrupt Status
142 */
143#define MC13783_INT_STAT_ADCDONEI (1 << 0)
144#define MC13783_INT_STAT_ADCBISDONEI (1 << 1)
145#define MC13783_INT_STAT_TSI (1 << 2)
146#define MC13783_INT_STAT_WHIGHI (1 << 3)
147#define MC13783_INT_STAT_WLOWI (1 << 4)
148#define MC13783_INT_STAT_CHGDETI (1 << 6)
149#define MC13783_INT_STAT_CHGOVI (1 << 7)
150#define MC13783_INT_STAT_CHGREVI (1 << 8)
151#define MC13783_INT_STAT_CHGSHORTI (1 << 9)
152#define MC13783_INT_STAT_CCCVI (1 << 10)
153#define MC13783_INT_STAT_CHGCURRI (1 << 11)
154#define MC13783_INT_STAT_BPONI (1 << 12)
155#define MC13783_INT_STAT_LOBATLI (1 << 13)
156#define MC13783_INT_STAT_LOBATHI (1 << 14)
157#define MC13783_INT_STAT_UDPI (1 << 15)
158#define MC13783_INT_STAT_USBI (1 << 16)
159#define MC13783_INT_STAT_IDI (1 << 19)
160#define MC13783_INT_STAT_Unused (1 << 20)
161#define MC13783_INT_STAT_SE1I (1 << 21)
162#define MC13783_INT_STAT_CKDETI (1 << 22)
163#define MC13783_INT_STAT_UDMI (1 << 23)
164
165/*
166 * Interrupt Mask
167 */
168#define MC13783_INT_MASK_ADCDONEM (1 << 0)
169#define MC13783_INT_MASK_ADCBISDONEM (1 << 1)
170#define MC13783_INT_MASK_TSM (1 << 2)
171#define MC13783_INT_MASK_WHIGHM (1 << 3)
172#define MC13783_INT_MASK_WLOWM (1 << 4)
173#define MC13783_INT_MASK_CHGDETM (1 << 6)
174#define MC13783_INT_MASK_CHGOVM (1 << 7)
175#define MC13783_INT_MASK_CHGREVM (1 << 8)
176#define MC13783_INT_MASK_CHGSHORTM (1 << 9)
177#define MC13783_INT_MASK_CCCVM (1 << 10)
178#define MC13783_INT_MASK_CHGCURRM (1 << 11)
179#define MC13783_INT_MASK_BPONM (1 << 12)
180#define MC13783_INT_MASK_LOBATLM (1 << 13)
181#define MC13783_INT_MASK_LOBATHM (1 << 14)
182#define MC13783_INT_MASK_UDPM (1 << 15)
183#define MC13783_INT_MASK_USBM (1 << 16)
184#define MC13783_INT_MASK_IDM (1 << 19)
185#define MC13783_INT_MASK_SE1M (1 << 21)
186#define MC13783_INT_MASK_CKDETM (1 << 22)
187
188/* 110/*
189 * Reg Regulator Mode 0 111 * Reg Regulator Mode 0
190 */ 112 */
@@ -284,113 +206,15 @@ int mc13783_register_irq(struct mc13783 *mc13783, int irq,
284#define MC13783_SWCTRL_SW3_STBY (1 << 21) 206#define MC13783_SWCTRL_SW3_STBY (1 << 21)
285#define MC13783_SWCTRL_SW3_MODE (1 << 22) 207#define MC13783_SWCTRL_SW3_MODE (1 << 22)
286 208
287/* 209static inline int mc13783_set_bits(struct mc13783 *mc13783, unsigned int offset,
288 * ADC/Touch 210 u32 mask, u32 val)
289 */ 211{
290#define MC13783_ADC0_LICELLCON (1 << 0) 212 int ret;
291#define MC13783_ADC0_CHRGICON (1 << 1) 213 mc13783_lock(mc13783);
292#define MC13783_ADC0_BATICON (1 << 2) 214 ret = mc13783_reg_rmw(mc13783, offset, mask, val);
293#define MC13783_ADC0_RTHEN (1 << 3) 215 mc13783_unlock(mc13783);
294#define MC13783_ADC0_DTHEN (1 << 4)
295#define MC13783_ADC0_UIDEN (1 << 5)
296#define MC13783_ADC0_ADOUTEN (1 << 6)
297#define MC13783_ADC0_ADOUTPER (1 << 7)
298#define MC13783_ADC0_ADREFEN (1 << 10)
299#define MC13783_ADC0_ADREFMODE (1 << 11)
300#define MC13783_ADC0_TSMOD0 (1 << 12)
301#define MC13783_ADC0_TSMOD1 (1 << 13)
302#define MC13783_ADC0_TSMOD2 (1 << 14)
303#define MC13783_ADC0_CHRGRAWDIV (1 << 15)
304#define MC13783_ADC0_ADINC1 (1 << 16)
305#define MC13783_ADC0_ADINC2 (1 << 17)
306#define MC13783_ADC0_WCOMP (1 << 18)
307#define MC13783_ADC0_ADCBIS0 (1 << 23)
308
309#define MC13783_ADC1_ADEN (1 << 0)
310#define MC13783_ADC1_RAND (1 << 1)
311#define MC13783_ADC1_ADSEL (1 << 3)
312#define MC13783_ADC1_TRIGMASK (1 << 4)
313#define MC13783_ADC1_ADA10 (1 << 5)
314#define MC13783_ADC1_ADA11 (1 << 6)
315#define MC13783_ADC1_ADA12 (1 << 7)
316#define MC13783_ADC1_ADA20 (1 << 8)
317#define MC13783_ADC1_ADA21 (1 << 9)
318#define MC13783_ADC1_ADA22 (1 << 10)
319#define MC13783_ADC1_ATO0 (1 << 11)
320#define MC13783_ADC1_ATO1 (1 << 12)
321#define MC13783_ADC1_ATO2 (1 << 13)
322#define MC13783_ADC1_ATO3 (1 << 14)
323#define MC13783_ADC1_ATO4 (1 << 15)
324#define MC13783_ADC1_ATO5 (1 << 16)
325#define MC13783_ADC1_ATO6 (1 << 17)
326#define MC13783_ADC1_ATO7 (1 << 18)
327#define MC13783_ADC1_ATOX (1 << 19)
328#define MC13783_ADC1_ASC (1 << 20)
329#define MC13783_ADC1_ADTRIGIGN (1 << 21)
330#define MC13783_ADC1_ADONESHOT (1 << 22)
331#define MC13783_ADC1_ADCBIS1 (1 << 23)
332
333#define MC13783_ADC1_CHAN0_SHIFT 5
334#define MC13783_ADC1_CHAN1_SHIFT 8
335
336#define MC13783_ADC2_ADD10 (1 << 2)
337#define MC13783_ADC2_ADD11 (1 << 3)
338#define MC13783_ADC2_ADD12 (1 << 4)
339#define MC13783_ADC2_ADD13 (1 << 5)
340#define MC13783_ADC2_ADD14 (1 << 6)
341#define MC13783_ADC2_ADD15 (1 << 7)
342#define MC13783_ADC2_ADD16 (1 << 8)
343#define MC13783_ADC2_ADD17 (1 << 9)
344#define MC13783_ADC2_ADD18 (1 << 10)
345#define MC13783_ADC2_ADD19 (1 << 11)
346#define MC13783_ADC2_ADD20 (1 << 14)
347#define MC13783_ADC2_ADD21 (1 << 15)
348#define MC13783_ADC2_ADD22 (1 << 16)
349#define MC13783_ADC2_ADD23 (1 << 17)
350#define MC13783_ADC2_ADD24 (1 << 18)
351#define MC13783_ADC2_ADD25 (1 << 19)
352#define MC13783_ADC2_ADD26 (1 << 20)
353#define MC13783_ADC2_ADD27 (1 << 21)
354#define MC13783_ADC2_ADD28 (1 << 22)
355#define MC13783_ADC2_ADD29 (1 << 23)
356 216
357#define MC13783_ADC3_WHIGH0 (1 << 0) 217 return ret;
358#define MC13783_ADC3_WHIGH1 (1 << 1) 218}
359#define MC13783_ADC3_WHIGH2 (1 << 2)
360#define MC13783_ADC3_WHIGH3 (1 << 3)
361#define MC13783_ADC3_WHIGH4 (1 << 4)
362#define MC13783_ADC3_WHIGH5 (1 << 5)
363#define MC13783_ADC3_ICID0 (1 << 6)
364#define MC13783_ADC3_ICID1 (1 << 7)
365#define MC13783_ADC3_ICID2 (1 << 8)
366#define MC13783_ADC3_WLOW0 (1 << 9)
367#define MC13783_ADC3_WLOW1 (1 << 10)
368#define MC13783_ADC3_WLOW2 (1 << 11)
369#define MC13783_ADC3_WLOW3 (1 << 12)
370#define MC13783_ADC3_WLOW4 (1 << 13)
371#define MC13783_ADC3_WLOW5 (1 << 14)
372#define MC13783_ADC3_ADCBIS2 (1 << 23)
373
374#define MC13783_ADC4_ADDBIS10 (1 << 2)
375#define MC13783_ADC4_ADDBIS11 (1 << 3)
376#define MC13783_ADC4_ADDBIS12 (1 << 4)
377#define MC13783_ADC4_ADDBIS13 (1 << 5)
378#define MC13783_ADC4_ADDBIS14 (1 << 6)
379#define MC13783_ADC4_ADDBIS15 (1 << 7)
380#define MC13783_ADC4_ADDBIS16 (1 << 8)
381#define MC13783_ADC4_ADDBIS17 (1 << 9)
382#define MC13783_ADC4_ADDBIS18 (1 << 10)
383#define MC13783_ADC4_ADDBIS19 (1 << 11)
384#define MC13783_ADC4_ADDBIS20 (1 << 14)
385#define MC13783_ADC4_ADDBIS21 (1 << 15)
386#define MC13783_ADC4_ADDBIS22 (1 << 16)
387#define MC13783_ADC4_ADDBIS23 (1 << 17)
388#define MC13783_ADC4_ADDBIS24 (1 << 18)
389#define MC13783_ADC4_ADDBIS25 (1 << 19)
390#define MC13783_ADC4_ADDBIS26 (1 << 20)
391#define MC13783_ADC4_ADDBIS27 (1 << 21)
392#define MC13783_ADC4_ADDBIS28 (1 << 22)
393#define MC13783_ADC4_ADDBIS29 (1 << 23)
394 219
395#endif /* __LINUX_MFD_MC13783_PRIV_H */ 220#endif /* __LINUX_MFD_MC13783_PRIV_H */
396
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index b3a2a7243573..35680409b8cf 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -1,28 +1,50 @@
1/* 1/*
2 * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> 2 * Copyright 2009 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
3 * 4 *
4 * Initial development of this code was funded by 5 * This program is free software; you can redistribute it and/or modify it under
5 * Phytec Messtechnik GmbH, http://www.phytec.de 6 * the terms of the GNU General Public License version 2 as published by the
6 * 7 * Free Software Foundation.
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 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 8 */
9#ifndef __LINUX_MFD_MC13783_H
10#define __LINUX_MFD_MC13783_H
21 11
22#ifndef __INCLUDE_LINUX_MFD_MC13783_H 12#include <linux/interrupt.h>
23#define __INCLUDE_LINUX_MFD_MC13783_H
24 13
25struct mc13783; 14struct mc13783;
15
16void mc13783_lock(struct mc13783 *mc13783);
17void mc13783_unlock(struct mc13783 *mc13783);
18
19int mc13783_reg_read(struct mc13783 *mc13783, unsigned int offset, u32 *val);
20int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val);
21int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset,
22 u32 mask, u32 val);
23
24int mc13783_irq_request(struct mc13783 *mc13783, int irq,
25 irq_handler_t handler, const char *name, void *dev);
26int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
27 irq_handler_t handler, const char *name, void *dev);
28int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev);
29int mc13783_ackirq(struct mc13783 *mc13783, int irq);
30
31int mc13783_mask(struct mc13783 *mc13783, int irq);
32int mc13783_unmask(struct mc13783 *mc13783, int irq);
33
34#define MC13783_ADC0 43
35#define MC13783_ADC0_ADREFEN (1 << 10)
36#define MC13783_ADC0_ADREFMODE (1 << 11)
37#define MC13783_ADC0_TSMOD0 (1 << 12)
38#define MC13783_ADC0_TSMOD1 (1 << 13)
39#define MC13783_ADC0_TSMOD2 (1 << 14)
40#define MC13783_ADC0_ADINC1 (1 << 16)
41#define MC13783_ADC0_ADINC2 (1 << 17)
42
43#define MC13783_ADC0_TSMOD_MASK (MC13783_ADC0_TSMOD0 | \
44 MC13783_ADC0_TSMOD1 | \
45 MC13783_ADC0_TSMOD2)
46
47/* to be cleaned up */
26struct regulator_init_data; 48struct regulator_init_data;
27 49
28struct mc13783_regulator_init_data { 50struct mc13783_regulator_init_data {
@@ -30,23 +52,30 @@ struct mc13783_regulator_init_data {
30 struct regulator_init_data *init_data; 52 struct regulator_init_data *init_data;
31}; 53};
32 54
33struct mc13783_platform_data { 55struct mc13783_regulator_platform_data {
34 struct mc13783_regulator_init_data *regulators;
35 int num_regulators; 56 int num_regulators;
36 unsigned int flags; 57 struct mc13783_regulator_init_data *regulators;
37}; 58};
38 59
39/* mc13783_platform_data flags */ 60struct mc13783_platform_data {
61 int num_regulators;
62 struct mc13783_regulator_init_data *regulators;
63
40#define MC13783_USE_TOUCHSCREEN (1 << 0) 64#define MC13783_USE_TOUCHSCREEN (1 << 0)
41#define MC13783_USE_CODEC (1 << 1) 65#define MC13783_USE_CODEC (1 << 1)
42#define MC13783_USE_ADC (1 << 2) 66#define MC13783_USE_ADC (1 << 2)
43#define MC13783_USE_RTC (1 << 3) 67#define MC13783_USE_RTC (1 << 3)
44#define MC13783_USE_REGULATOR (1 << 4) 68#define MC13783_USE_REGULATOR (1 << 4)
69 unsigned int flags;
70};
71
72#define MC13783_ADC_MODE_TS 1
73#define MC13783_ADC_MODE_SINGLE_CHAN 2
74#define MC13783_ADC_MODE_MULT_CHAN 3
45 75
46int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, 76int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
47 unsigned int channel, unsigned int *sample); 77 unsigned int channel, unsigned int *sample);
48 78
49void mc13783_adc_set_ts_status(struct mc13783 *mc13783, unsigned int status);
50 79
51#define MC13783_SW_SW1A 0 80#define MC13783_SW_SW1A 0
52#define MC13783_SW_SW1B 1 81#define MC13783_SW_SW1B 1
@@ -80,5 +109,46 @@ void mc13783_adc_set_ts_status(struct mc13783 *mc13783, unsigned int status);
80#define MC13783_REGU_V3 29 109#define MC13783_REGU_V3 29
81#define MC13783_REGU_V4 30 110#define MC13783_REGU_V4 30
82 111
83#endif /* __INCLUDE_LINUX_MFD_MC13783_H */ 112#define MC13783_IRQ_ADCDONE 0
113#define MC13783_IRQ_ADCBISDONE 1
114#define MC13783_IRQ_TS 2
115#define MC13783_IRQ_WHIGH 3
116#define MC13783_IRQ_WLOW 4
117#define MC13783_IRQ_CHGDET 6
118#define MC13783_IRQ_CHGOV 7
119#define MC13783_IRQ_CHGREV 8
120#define MC13783_IRQ_CHGSHORT 9
121#define MC13783_IRQ_CCCV 10
122#define MC13783_IRQ_CHGCURR 11
123#define MC13783_IRQ_BPON 12
124#define MC13783_IRQ_LOBATL 13
125#define MC13783_IRQ_LOBATH 14
126#define MC13783_IRQ_UDP 15
127#define MC13783_IRQ_USB 16
128#define MC13783_IRQ_ID 19
129#define MC13783_IRQ_SE1 21
130#define MC13783_IRQ_CKDET 22
131#define MC13783_IRQ_UDM 23
132#define MC13783_IRQ_1HZ 24
133#define MC13783_IRQ_TODA 25
134#define MC13783_IRQ_ONOFD1 27
135#define MC13783_IRQ_ONOFD2 28
136#define MC13783_IRQ_ONOFD3 29
137#define MC13783_IRQ_SYSRST 30
138#define MC13783_IRQ_RTCRST 31
139#define MC13783_IRQ_PC 32
140#define MC13783_IRQ_WARM 33
141#define MC13783_IRQ_MEMHLD 34
142#define MC13783_IRQ_PWRRDY 35
143#define MC13783_IRQ_THWARNL 36
144#define MC13783_IRQ_THWARNH 37
145#define MC13783_IRQ_CLK 38
146#define MC13783_IRQ_SEMAF 39
147#define MC13783_IRQ_MC2B 41
148#define MC13783_IRQ_HSDET 42
149#define MC13783_IRQ_HSL 43
150#define MC13783_IRQ_ALSPTH 44
151#define MC13783_IRQ_AHSSHORT 45
152#define MC13783_NUM_IRQ 46
84 153
154#endif /* __LINUX_MFD_MC13783_H */
diff --git a/include/linux/mfd/mcp.h b/include/linux/mfd/mcp.h
new file mode 100644
index 000000000000..ee496708e38b
--- /dev/null
+++ b/include/linux/mfd/mcp.h
@@ -0,0 +1,69 @@
1/*
2 * linux/drivers/mfd/mcp.h
3 *
4 * Copyright (C) 2001 Russell King, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License.
9 */
10#ifndef MCP_H
11#define MCP_H
12
13#include <mach/dma.h>
14
15struct mcp_ops;
16
17struct mcp {
18 struct module *owner;
19 struct mcp_ops *ops;
20 spinlock_t lock;
21 int use_count;
22 unsigned int sclk_rate;
23 unsigned int rw_timeout;
24 dma_device_t dma_audio_rd;
25 dma_device_t dma_audio_wr;
26 dma_device_t dma_telco_rd;
27 dma_device_t dma_telco_wr;
28 struct device attached_device;
29 int gpio_base;
30};
31
32struct mcp_ops {
33 void (*set_telecom_divisor)(struct mcp *, unsigned int);
34 void (*set_audio_divisor)(struct mcp *, unsigned int);
35 void (*reg_write)(struct mcp *, unsigned int, unsigned int);
36 unsigned int (*reg_read)(struct mcp *, unsigned int);
37 void (*enable)(struct mcp *);
38 void (*disable)(struct mcp *);
39};
40
41void mcp_set_telecom_divisor(struct mcp *, unsigned int);
42void mcp_set_audio_divisor(struct mcp *, unsigned int);
43void mcp_reg_write(struct mcp *, unsigned int, unsigned int);
44unsigned int mcp_reg_read(struct mcp *, unsigned int);
45void mcp_enable(struct mcp *);
46void mcp_disable(struct mcp *);
47#define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate)
48
49struct mcp *mcp_host_alloc(struct device *, size_t);
50int mcp_host_register(struct mcp *);
51void mcp_host_unregister(struct mcp *);
52
53struct mcp_driver {
54 struct device_driver drv;
55 int (*probe)(struct mcp *);
56 void (*remove)(struct mcp *);
57 int (*suspend)(struct mcp *, pm_message_t);
58 int (*resume)(struct mcp *);
59};
60
61int mcp_driver_register(struct mcp_driver *);
62void mcp_driver_unregister(struct mcp_driver *);
63
64#define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device)
65#define mcp_set_drvdata(mcp,d) dev_set_drvdata(&(mcp)->attached_device, d)
66
67#define mcp_priv(mcp) ((void *)((mcp)+1))
68
69#endif
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index 9aba7b779fbc..d9034cc87f18 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -40,10 +40,6 @@ struct pcf50633_platform_data {
40 u8 resumers[5]; 40 u8 resumers[5];
41}; 41};
42 42
43struct pcf50633_subdev_pdata {
44 struct pcf50633 *pcf;
45};
46
47struct pcf50633_irq { 43struct pcf50633_irq {
48 void (*handler) (int, void *); 44 void (*handler) (int, void *);
49 void *data; 45 void *data;
@@ -217,5 +213,9 @@ enum pcf50633_reg_int5 {
217#define PCF50633_REG_LEDCTL 0x2a 213#define PCF50633_REG_LEDCTL 0x2a
218#define PCF50633_REG_LEDDIM 0x2b 214#define PCF50633_REG_LEDDIM 0x2b
219 215
220#endif 216static inline struct pcf50633 *dev_to_pcf50633(struct device *dev)
217{
218 return dev_get_drvdata(dev);
219}
221 220
221#endif
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
new file mode 100644
index 000000000000..3bcd7163485c
--- /dev/null
+++ b/include/linux/mfd/sh_mobile_sdhi.h
@@ -0,0 +1,8 @@
1#ifndef __SH_MOBILE_SDHI_H__
2#define __SH_MOBILE_SDHI_H__
3
4struct sh_mobile_sdhi_info {
5 void (*set_pwr)(struct platform_device *pdev, int state);
6};
7
8#endif /* __SH_MOBILE_SDHI_H__ */
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-codec.h
new file mode 100644
index 000000000000..2ec317c68e59
--- /dev/null
+++ b/include/linux/mfd/twl4030-codec.h
@@ -0,0 +1,272 @@
1/*
2 * MFD driver for twl4030 codec submodule
3 *
4 * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com>
5 *
6 * Copyright: (C) 2009 Nokia Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
24#ifndef __TWL4030_CODEC_H__
25#define __TWL4030_CODEC_H__
26
27/* Codec registers */
28#define TWL4030_REG_CODEC_MODE 0x01
29#define TWL4030_REG_OPTION 0x02
30#define TWL4030_REG_UNKNOWN 0x03
31#define TWL4030_REG_MICBIAS_CTL 0x04
32#define TWL4030_REG_ANAMICL 0x05
33#define TWL4030_REG_ANAMICR 0x06
34#define TWL4030_REG_AVADC_CTL 0x07
35#define TWL4030_REG_ADCMICSEL 0x08
36#define TWL4030_REG_DIGMIXING 0x09
37#define TWL4030_REG_ATXL1PGA 0x0A
38#define TWL4030_REG_ATXR1PGA 0x0B
39#define TWL4030_REG_AVTXL2PGA 0x0C
40#define TWL4030_REG_AVTXR2PGA 0x0D
41#define TWL4030_REG_AUDIO_IF 0x0E
42#define TWL4030_REG_VOICE_IF 0x0F
43#define TWL4030_REG_ARXR1PGA 0x10
44#define TWL4030_REG_ARXL1PGA 0x11
45#define TWL4030_REG_ARXR2PGA 0x12
46#define TWL4030_REG_ARXL2PGA 0x13
47#define TWL4030_REG_VRXPGA 0x14
48#define TWL4030_REG_VSTPGA 0x15
49#define TWL4030_REG_VRX2ARXPGA 0x16
50#define TWL4030_REG_AVDAC_CTL 0x17
51#define TWL4030_REG_ARX2VTXPGA 0x18
52#define TWL4030_REG_ARXL1_APGA_CTL 0x19
53#define TWL4030_REG_ARXR1_APGA_CTL 0x1A
54#define TWL4030_REG_ARXL2_APGA_CTL 0x1B
55#define TWL4030_REG_ARXR2_APGA_CTL 0x1C
56#define TWL4030_REG_ATX2ARXPGA 0x1D
57#define TWL4030_REG_BT_IF 0x1E
58#define TWL4030_REG_BTPGA 0x1F
59#define TWL4030_REG_BTSTPGA 0x20
60#define TWL4030_REG_EAR_CTL 0x21
61#define TWL4030_REG_HS_SEL 0x22
62#define TWL4030_REG_HS_GAIN_SET 0x23
63#define TWL4030_REG_HS_POPN_SET 0x24
64#define TWL4030_REG_PREDL_CTL 0x25
65#define TWL4030_REG_PREDR_CTL 0x26
66#define TWL4030_REG_PRECKL_CTL 0x27
67#define TWL4030_REG_PRECKR_CTL 0x28
68#define TWL4030_REG_HFL_CTL 0x29
69#define TWL4030_REG_HFR_CTL 0x2A
70#define TWL4030_REG_ALC_CTL 0x2B
71#define TWL4030_REG_ALC_SET1 0x2C
72#define TWL4030_REG_ALC_SET2 0x2D
73#define TWL4030_REG_BOOST_CTL 0x2E
74#define TWL4030_REG_SOFTVOL_CTL 0x2F
75#define TWL4030_REG_DTMF_FREQSEL 0x30
76#define TWL4030_REG_DTMF_TONEXT1H 0x31
77#define TWL4030_REG_DTMF_TONEXT1L 0x32
78#define TWL4030_REG_DTMF_TONEXT2H 0x33
79#define TWL4030_REG_DTMF_TONEXT2L 0x34
80#define TWL4030_REG_DTMF_TONOFF 0x35
81#define TWL4030_REG_DTMF_WANONOFF 0x36
82#define TWL4030_REG_I2S_RX_SCRAMBLE_H 0x37
83#define TWL4030_REG_I2S_RX_SCRAMBLE_M 0x38
84#define TWL4030_REG_I2S_RX_SCRAMBLE_L 0x39
85#define TWL4030_REG_APLL_CTL 0x3A
86#define TWL4030_REG_DTMF_CTL 0x3B
87#define TWL4030_REG_DTMF_PGA_CTL2 0x3C
88#define TWL4030_REG_DTMF_PGA_CTL1 0x3D
89#define TWL4030_REG_MISC_SET_1 0x3E
90#define TWL4030_REG_PCMBTMUX 0x3F
91#define TWL4030_REG_RX_PATH_SEL 0x43
92#define TWL4030_REG_VDL_APGA_CTL 0x44
93#define TWL4030_REG_VIBRA_CTL 0x45
94#define TWL4030_REG_VIBRA_SET 0x46
95#define TWL4030_REG_VIBRA_PWM_SET 0x47
96#define TWL4030_REG_ANAMIC_GAIN 0x48
97#define TWL4030_REG_MISC_SET_2 0x49
98
99/* Bitfield Definitions */
100
101/* TWL4030_CODEC_MODE (0x01) Fields */
102#define TWL4030_APLL_RATE 0xF0
103#define TWL4030_APLL_RATE_8000 0x00
104#define TWL4030_APLL_RATE_11025 0x10
105#define TWL4030_APLL_RATE_12000 0x20
106#define TWL4030_APLL_RATE_16000 0x40
107#define TWL4030_APLL_RATE_22050 0x50
108#define TWL4030_APLL_RATE_24000 0x60
109#define TWL4030_APLL_RATE_32000 0x80
110#define TWL4030_APLL_RATE_44100 0x90
111#define TWL4030_APLL_RATE_48000 0xA0
112#define TWL4030_APLL_RATE_96000 0xE0
113#define TWL4030_SEL_16K 0x08
114#define TWL4030_CODECPDZ 0x02
115#define TWL4030_OPT_MODE 0x01
116#define TWL4030_OPTION_1 (1 << 0)
117#define TWL4030_OPTION_2 (0 << 0)
118
119/* TWL4030_OPTION (0x02) Fields */
120#define TWL4030_ATXL1_EN (1 << 0)
121#define TWL4030_ATXR1_EN (1 << 1)
122#define TWL4030_ATXL2_VTXL_EN (1 << 2)
123#define TWL4030_ATXR2_VTXR_EN (1 << 3)
124#define TWL4030_ARXL1_VRX_EN (1 << 4)
125#define TWL4030_ARXR1_EN (1 << 5)
126#define TWL4030_ARXL2_EN (1 << 6)
127#define TWL4030_ARXR2_EN (1 << 7)
128
129/* TWL4030_REG_MICBIAS_CTL (0x04) Fields */
130#define TWL4030_MICBIAS2_CTL 0x40
131#define TWL4030_MICBIAS1_CTL 0x20
132#define TWL4030_HSMICBIAS_EN 0x04
133#define TWL4030_MICBIAS2_EN 0x02
134#define TWL4030_MICBIAS1_EN 0x01
135
136/* ANAMICL (0x05) Fields */
137#define TWL4030_CNCL_OFFSET_START 0x80
138#define TWL4030_OFFSET_CNCL_SEL 0x60
139#define TWL4030_OFFSET_CNCL_SEL_ARX1 0x00
140#define TWL4030_OFFSET_CNCL_SEL_ARX2 0x20
141#define TWL4030_OFFSET_CNCL_SEL_VRX 0x40
142#define TWL4030_OFFSET_CNCL_SEL_ALL 0x60
143#define TWL4030_MICAMPL_EN 0x10
144#define TWL4030_CKMIC_EN 0x08
145#define TWL4030_AUXL_EN 0x04
146#define TWL4030_HSMIC_EN 0x02
147#define TWL4030_MAINMIC_EN 0x01
148
149/* ANAMICR (0x06) Fields */
150#define TWL4030_MICAMPR_EN 0x10
151#define TWL4030_AUXR_EN 0x04
152#define TWL4030_SUBMIC_EN 0x01
153
154/* AVADC_CTL (0x07) Fields */
155#define TWL4030_ADCL_EN 0x08
156#define TWL4030_AVADC_CLK_PRIORITY 0x04
157#define TWL4030_ADCR_EN 0x02
158
159/* TWL4030_REG_ADCMICSEL (0x08) Fields */
160#define TWL4030_DIGMIC1_EN 0x08
161#define TWL4030_TX2IN_SEL 0x04
162#define TWL4030_DIGMIC0_EN 0x02
163#define TWL4030_TX1IN_SEL 0x01
164
165/* AUDIO_IF (0x0E) Fields */
166#define TWL4030_AIF_SLAVE_EN 0x80
167#define TWL4030_DATA_WIDTH 0x60
168#define TWL4030_DATA_WIDTH_16S_16W 0x00
169#define TWL4030_DATA_WIDTH_32S_16W 0x40
170#define TWL4030_DATA_WIDTH_32S_24W 0x60
171#define TWL4030_AIF_FORMAT 0x18
172#define TWL4030_AIF_FORMAT_CODEC 0x00
173#define TWL4030_AIF_FORMAT_LEFT 0x08
174#define TWL4030_AIF_FORMAT_RIGHT 0x10
175#define TWL4030_AIF_FORMAT_TDM 0x18
176#define TWL4030_AIF_TRI_EN 0x04
177#define TWL4030_CLK256FS_EN 0x02
178#define TWL4030_AIF_EN 0x01
179
180/* VOICE_IF (0x0F) Fields */
181#define TWL4030_VIF_SLAVE_EN 0x80
182#define TWL4030_VIF_DIN_EN 0x40
183#define TWL4030_VIF_DOUT_EN 0x20
184#define TWL4030_VIF_SWAP 0x10
185#define TWL4030_VIF_FORMAT 0x08
186#define TWL4030_VIF_TRI_EN 0x04
187#define TWL4030_VIF_SUB_EN 0x02
188#define TWL4030_VIF_EN 0x01
189
190/* EAR_CTL (0x21) */
191#define TWL4030_EAR_GAIN 0x30
192
193/* HS_GAIN_SET (0x23) Fields */
194#define TWL4030_HSR_GAIN 0x0C
195#define TWL4030_HSR_GAIN_PWR_DOWN 0x00
196#define TWL4030_HSR_GAIN_PLUS_6DB 0x04
197#define TWL4030_HSR_GAIN_0DB 0x08
198#define TWL4030_HSR_GAIN_MINUS_6DB 0x0C
199#define TWL4030_HSL_GAIN 0x03
200#define TWL4030_HSL_GAIN_PWR_DOWN 0x00
201#define TWL4030_HSL_GAIN_PLUS_6DB 0x01
202#define TWL4030_HSL_GAIN_0DB 0x02
203#define TWL4030_HSL_GAIN_MINUS_6DB 0x03
204
205/* HS_POPN_SET (0x24) Fields */
206#define TWL4030_VMID_EN 0x40
207#define TWL4030_EXTMUTE 0x20
208#define TWL4030_RAMP_DELAY 0x1C
209#define TWL4030_RAMP_DELAY_20MS 0x00
210#define TWL4030_RAMP_DELAY_40MS 0x04
211#define TWL4030_RAMP_DELAY_81MS 0x08
212#define TWL4030_RAMP_DELAY_161MS 0x0C
213#define TWL4030_RAMP_DELAY_323MS 0x10
214#define TWL4030_RAMP_DELAY_645MS 0x14
215#define TWL4030_RAMP_DELAY_1291MS 0x18
216#define TWL4030_RAMP_DELAY_2581MS 0x1C
217#define TWL4030_RAMP_EN 0x02
218
219/* PREDL_CTL (0x25) */
220#define TWL4030_PREDL_GAIN 0x30
221
222/* PREDR_CTL (0x26) */
223#define TWL4030_PREDR_GAIN 0x30
224
225/* PRECKL_CTL (0x27) */
226#define TWL4030_PRECKL_GAIN 0x30
227
228/* PRECKR_CTL (0x28) */
229#define TWL4030_PRECKR_GAIN 0x30
230
231/* HFL_CTL (0x29, 0x2A) Fields */
232#define TWL4030_HF_CTL_HB_EN 0x04
233#define TWL4030_HF_CTL_LOOP_EN 0x08
234#define TWL4030_HF_CTL_RAMP_EN 0x10
235#define TWL4030_HF_CTL_REF_EN 0x20
236
237/* APLL_CTL (0x3A) Fields */
238#define TWL4030_APLL_EN 0x10
239#define TWL4030_APLL_INFREQ 0x0F
240#define TWL4030_APLL_INFREQ_19200KHZ 0x05
241#define TWL4030_APLL_INFREQ_26000KHZ 0x06
242#define TWL4030_APLL_INFREQ_38400KHZ 0x0F
243
244/* REG_MISC_SET_1 (0x3E) Fields */
245#define TWL4030_CLK64_EN 0x80
246#define TWL4030_SCRAMBLE_EN 0x40
247#define TWL4030_FMLOOP_EN 0x20
248#define TWL4030_SMOOTH_ANAVOL_EN 0x02
249#define TWL4030_DIGMIC_LR_SWAP_EN 0x01
250
251/* VIBRA_CTL (0x45) */
252#define TWL4030_VIBRA_EN 0x01
253#define TWL4030_VIBRA_DIR 0x02
254#define TWL4030_VIBRA_AUDIO_SEL_L1 (0x00 << 2)
255#define TWL4030_VIBRA_AUDIO_SEL_R1 (0x01 << 2)
256#define TWL4030_VIBRA_AUDIO_SEL_L2 (0x02 << 2)
257#define TWL4030_VIBRA_AUDIO_SEL_R2 (0x03 << 2)
258#define TWL4030_VIBRA_SEL 0x10
259#define TWL4030_VIBRA_DIR_SEL 0x20
260
261/* TWL4030 codec resource IDs */
262enum twl4030_codec_res {
263 TWL4030_CODEC_RES_POWER = 0,
264 TWL4030_CODEC_RES_APLL,
265 TWL4030_CODEC_RES_MAX,
266};
267
268int twl4030_codec_disable_resource(enum twl4030_codec_res id);
269int twl4030_codec_enable_resource(enum twl4030_codec_res id);
270unsigned int twl4030_codec_get_mclk(void);
271
272#endif /* End of __TWL4030_CODEC_H__ */
diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h
new file mode 100644
index 000000000000..aa9c3789bed4
--- /dev/null
+++ b/include/linux/mfd/ucb1x00.h
@@ -0,0 +1,258 @@
1/*
2 * linux/include/mfd/ucb1x00.h
3 *
4 * Copyright (C) 2001 Russell King, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License.
9 */
10#ifndef UCB1200_H
11#define UCB1200_H
12
13#include <linux/mfd/mcp.h>
14#include <linux/gpio.h>
15
16#define UCB_IO_DATA 0x00
17#define UCB_IO_DIR 0x01
18
19#define UCB_IO_0 (1 << 0)
20#define UCB_IO_1 (1 << 1)
21#define UCB_IO_2 (1 << 2)
22#define UCB_IO_3 (1 << 3)
23#define UCB_IO_4 (1 << 4)
24#define UCB_IO_5 (1 << 5)
25#define UCB_IO_6 (1 << 6)
26#define UCB_IO_7 (1 << 7)
27#define UCB_IO_8 (1 << 8)
28#define UCB_IO_9 (1 << 9)
29
30#define UCB_IE_RIS 0x02
31#define UCB_IE_FAL 0x03
32#define UCB_IE_STATUS 0x04
33#define UCB_IE_CLEAR 0x04
34#define UCB_IE_ADC (1 << 11)
35#define UCB_IE_TSPX (1 << 12)
36#define UCB_IE_TSMX (1 << 13)
37#define UCB_IE_TCLIP (1 << 14)
38#define UCB_IE_ACLIP (1 << 15)
39
40#define UCB_IRQ_TSPX 12
41
42#define UCB_TC_A 0x05
43#define UCB_TC_A_LOOP (1 << 7) /* UCB1200 */
44#define UCB_TC_A_AMPL (1 << 7) /* UCB1300 */
45
46#define UCB_TC_B 0x06
47#define UCB_TC_B_VOICE_ENA (1 << 3)
48#define UCB_TC_B_CLIP (1 << 4)
49#define UCB_TC_B_ATT (1 << 6)
50#define UCB_TC_B_SIDE_ENA (1 << 11)
51#define UCB_TC_B_MUTE (1 << 13)
52#define UCB_TC_B_IN_ENA (1 << 14)
53#define UCB_TC_B_OUT_ENA (1 << 15)
54
55#define UCB_AC_A 0x07
56#define UCB_AC_B 0x08
57#define UCB_AC_B_LOOP (1 << 8)
58#define UCB_AC_B_MUTE (1 << 13)
59#define UCB_AC_B_IN_ENA (1 << 14)
60#define UCB_AC_B_OUT_ENA (1 << 15)
61
62#define UCB_TS_CR 0x09
63#define UCB_TS_CR_TSMX_POW (1 << 0)
64#define UCB_TS_CR_TSPX_POW (1 << 1)
65#define UCB_TS_CR_TSMY_POW (1 << 2)
66#define UCB_TS_CR_TSPY_POW (1 << 3)
67#define UCB_TS_CR_TSMX_GND (1 << 4)
68#define UCB_TS_CR_TSPX_GND (1 << 5)
69#define UCB_TS_CR_TSMY_GND (1 << 6)
70#define UCB_TS_CR_TSPY_GND (1 << 7)
71#define UCB_TS_CR_MODE_INT (0 << 8)
72#define UCB_TS_CR_MODE_PRES (1 << 8)
73#define UCB_TS_CR_MODE_POS (2 << 8)
74#define UCB_TS_CR_BIAS_ENA (1 << 11)
75#define UCB_TS_CR_TSPX_LOW (1 << 12)
76#define UCB_TS_CR_TSMX_LOW (1 << 13)
77
78#define UCB_ADC_CR 0x0a
79#define UCB_ADC_SYNC_ENA (1 << 0)
80#define UCB_ADC_VREFBYP_CON (1 << 1)
81#define UCB_ADC_INP_TSPX (0 << 2)
82#define UCB_ADC_INP_TSMX (1 << 2)
83#define UCB_ADC_INP_TSPY (2 << 2)
84#define UCB_ADC_INP_TSMY (3 << 2)
85#define UCB_ADC_INP_AD0 (4 << 2)
86#define UCB_ADC_INP_AD1 (5 << 2)
87#define UCB_ADC_INP_AD2 (6 << 2)
88#define UCB_ADC_INP_AD3 (7 << 2)
89#define UCB_ADC_EXT_REF (1 << 5)
90#define UCB_ADC_START (1 << 7)
91#define UCB_ADC_ENA (1 << 15)
92
93#define UCB_ADC_DATA 0x0b
94#define UCB_ADC_DAT_VAL (1 << 15)
95#define UCB_ADC_DAT(x) (((x) & 0x7fe0) >> 5)
96
97#define UCB_ID 0x0c
98#define UCB_ID_1200 0x1004
99#define UCB_ID_1300 0x1005
100#define UCB_ID_TC35143 0x9712
101
102#define UCB_MODE 0x0d
103#define UCB_MODE_DYN_VFLAG_ENA (1 << 12)
104#define UCB_MODE_AUD_OFF_CAN (1 << 13)
105
106
107struct ucb1x00_irq {
108 void *devid;
109 void (*fn)(int, void *);
110};
111
112struct ucb1x00 {
113 spinlock_t lock;
114 struct mcp *mcp;
115 unsigned int irq;
116 struct semaphore adc_sem;
117 spinlock_t io_lock;
118 u16 id;
119 u16 io_dir;
120 u16 io_out;
121 u16 adc_cr;
122 u16 irq_fal_enbl;
123 u16 irq_ris_enbl;
124 struct ucb1x00_irq irq_handler[16];
125 struct device dev;
126 struct list_head node;
127 struct list_head devs;
128 struct gpio_chip gpio;
129};
130
131struct ucb1x00_driver;
132
133struct ucb1x00_dev {
134 struct list_head dev_node;
135 struct list_head drv_node;
136 struct ucb1x00 *ucb;
137 struct ucb1x00_driver *drv;
138 void *priv;
139};
140
141struct ucb1x00_driver {
142 struct list_head node;
143 struct list_head devs;
144 int (*add)(struct ucb1x00_dev *dev);
145 void (*remove)(struct ucb1x00_dev *dev);
146 int (*suspend)(struct ucb1x00_dev *dev, pm_message_t state);
147 int (*resume)(struct ucb1x00_dev *dev);
148};
149
150#define classdev_to_ucb1x00(cd) container_of(cd, struct ucb1x00, dev)
151
152int ucb1x00_register_driver(struct ucb1x00_driver *);
153void ucb1x00_unregister_driver(struct ucb1x00_driver *);
154
155/**
156 * ucb1x00_clkrate - return the UCB1x00 SIB clock rate
157 * @ucb: UCB1x00 structure describing chip
158 *
159 * Return the SIB clock rate in Hz.
160 */
161static inline unsigned int ucb1x00_clkrate(struct ucb1x00 *ucb)
162{
163 return mcp_get_sclk_rate(ucb->mcp);
164}
165
166/**
167 * ucb1x00_enable - enable the UCB1x00 SIB clock
168 * @ucb: UCB1x00 structure describing chip
169 *
170 * Enable the SIB clock. This can be called multiple times.
171 */
172static inline void ucb1x00_enable(struct ucb1x00 *ucb)
173{
174 mcp_enable(ucb->mcp);
175}
176
177/**
178 * ucb1x00_disable - disable the UCB1x00 SIB clock
179 * @ucb: UCB1x00 structure describing chip
180 *
181 * Disable the SIB clock. The SIB clock will only be disabled
182 * when the number of ucb1x00_enable calls match the number of
183 * ucb1x00_disable calls.
184 */
185static inline void ucb1x00_disable(struct ucb1x00 *ucb)
186{
187 mcp_disable(ucb->mcp);
188}
189
190/**
191 * ucb1x00_reg_write - write a UCB1x00 register
192 * @ucb: UCB1x00 structure describing chip
193 * @reg: UCB1x00 4-bit register index to write
194 * @val: UCB1x00 16-bit value to write
195 *
196 * Write the UCB1x00 register @reg with value @val. The SIB
197 * clock must be running for this function to return.
198 */
199static inline void ucb1x00_reg_write(struct ucb1x00 *ucb, unsigned int reg, unsigned int val)
200{
201 mcp_reg_write(ucb->mcp, reg, val);
202}
203
204/**
205 * ucb1x00_reg_read - read a UCB1x00 register
206 * @ucb: UCB1x00 structure describing chip
207 * @reg: UCB1x00 4-bit register index to write
208 *
209 * Read the UCB1x00 register @reg and return its value. The SIB
210 * clock must be running for this function to return.
211 */
212static inline unsigned int ucb1x00_reg_read(struct ucb1x00 *ucb, unsigned int reg)
213{
214 return mcp_reg_read(ucb->mcp, reg);
215}
216/**
217 * ucb1x00_set_audio_divisor -
218 * @ucb: UCB1x00 structure describing chip
219 * @div: SIB clock divisor
220 */
221static inline void ucb1x00_set_audio_divisor(struct ucb1x00 *ucb, unsigned int div)
222{
223 mcp_set_audio_divisor(ucb->mcp, div);
224}
225
226/**
227 * ucb1x00_set_telecom_divisor -
228 * @ucb: UCB1x00 structure describing chip
229 * @div: SIB clock divisor
230 */
231static inline void ucb1x00_set_telecom_divisor(struct ucb1x00 *ucb, unsigned int div)
232{
233 mcp_set_telecom_divisor(ucb->mcp, div);
234}
235
236void ucb1x00_io_set_dir(struct ucb1x00 *ucb, unsigned int, unsigned int);
237void ucb1x00_io_write(struct ucb1x00 *ucb, unsigned int, unsigned int);
238unsigned int ucb1x00_io_read(struct ucb1x00 *ucb);
239
240#define UCB_NOSYNC (0)
241#define UCB_SYNC (1)
242
243unsigned int ucb1x00_adc_read(struct ucb1x00 *ucb, int adc_channel, int sync);
244void ucb1x00_adc_enable(struct ucb1x00 *ucb);
245void ucb1x00_adc_disable(struct ucb1x00 *ucb);
246
247/*
248 * Which edges of the IRQ do you want to control today?
249 */
250#define UCB_RISING (1 << 0)
251#define UCB_FALLING (1 << 1)
252
253int ucb1x00_hook_irq(struct ucb1x00 *ucb, unsigned int idx, void (*fn)(int, void *), void *devid);
254void ucb1x00_enable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges);
255void ucb1x00_disable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges);
256int ucb1x00_free_irq(struct ucb1x00 *ucb, unsigned int idx, void *devid);
257
258#endif
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index 91eb493bf14c..5184b79c700b 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -16,7 +16,6 @@
16#define __MFD_WM831X_CORE_H__ 16#define __MFD_WM831X_CORE_H__
17 17
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/workqueue.h>
20 19
21/* 20/*
22 * Register values. 21 * Register values.
@@ -117,6 +116,7 @@
117#define WM831X_DC3_SLEEP_CONTROL 0x4063 116#define WM831X_DC3_SLEEP_CONTROL 0x4063
118#define WM831X_DC4_CONTROL 0x4064 117#define WM831X_DC4_CONTROL 0x4064
119#define WM831X_DC4_SLEEP_CONTROL 0x4065 118#define WM831X_DC4_SLEEP_CONTROL 0x4065
119#define WM832X_DC4_SLEEP_CONTROL 0x4067
120#define WM831X_EPE1_CONTROL 0x4066 120#define WM831X_EPE1_CONTROL 0x4066
121#define WM831X_EPE2_CONTROL 0x4067 121#define WM831X_EPE2_CONTROL 0x4067
122#define WM831X_LDO1_CONTROL 0x4068 122#define WM831X_LDO1_CONTROL 0x4068
@@ -235,6 +235,8 @@
235 235
236struct regulator_dev; 236struct regulator_dev;
237 237
238#define WM831X_NUM_IRQ_REGS 5
239
238struct wm831x { 240struct wm831x {
239 struct mutex io_lock; 241 struct mutex io_lock;
240 242
@@ -248,10 +250,11 @@ struct wm831x {
248 250
249 int irq; /* Our chip IRQ */ 251 int irq; /* Our chip IRQ */
250 struct mutex irq_lock; 252 struct mutex irq_lock;
251 struct workqueue_struct *irq_wq;
252 struct work_struct irq_work;
253 unsigned int irq_base; 253 unsigned int irq_base;
254 int irq_masks[5]; 254 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */
255 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
256
257 int num_gpio;
255 258
256 struct mutex auxadc_lock; 259 struct mutex auxadc_lock;
257 260
@@ -278,12 +281,30 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
278int wm831x_irq_init(struct wm831x *wm831x, int irq); 281int wm831x_irq_init(struct wm831x *wm831x, int irq);
279void wm831x_irq_exit(struct wm831x *wm831x); 282void wm831x_irq_exit(struct wm831x *wm831x);
280 283
281int __must_check wm831x_request_irq(struct wm831x *wm831x, 284static inline int __must_check wm831x_request_irq(struct wm831x *wm831x,
282 unsigned int irq, irq_handler_t handler, 285 unsigned int irq,
283 unsigned long flags, const char *name, 286 irq_handler_t handler,
284 void *dev); 287 unsigned long flags,
285void wm831x_free_irq(struct wm831x *wm831x, unsigned int, void *); 288 const char *name,
286void wm831x_disable_irq(struct wm831x *wm831x, int irq); 289 void *dev)
287void wm831x_enable_irq(struct wm831x *wm831x, int irq); 290{
291 return request_threaded_irq(irq, NULL, handler, flags, name, dev);
292}
293
294static inline void wm831x_free_irq(struct wm831x *wm831x,
295 unsigned int irq, void *dev)
296{
297 free_irq(irq, dev);
298}
299
300static inline void wm831x_disable_irq(struct wm831x *wm831x, int irq)
301{
302 disable_irq(irq);
303}
304
305static inline void wm831x_enable_irq(struct wm831x *wm831x, int irq)
306{
307 enable_irq(irq);
308}
288 309
289#endif 310#endif
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index 90d820260aad..415c228743d5 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -91,6 +91,7 @@ struct wm831x_pdata {
91 /** Called after subdevices are set up */ 91 /** Called after subdevices are set up */
92 int (*post_init)(struct wm831x *wm831x); 92 int (*post_init)(struct wm831x *wm831x);
93 93
94 int irq_base;
94 int gpio_base; 95 int gpio_base;
95 struct wm831x_backlight_pdata *backlight; 96 struct wm831x_backlight_pdata *backlight;
96 struct wm831x_backup_pdata *backup; 97 struct wm831x_backup_pdata *backup;
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index 1d595de6a055..43868899bf49 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -15,7 +15,7 @@
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/workqueue.h> 18#include <linux/interrupt.h>
19 19
20#include <linux/mfd/wm8350/audio.h> 20#include <linux/mfd/wm8350/audio.h>
21#include <linux/mfd/wm8350/gpio.h> 21#include <linux/mfd/wm8350/gpio.h>
@@ -601,7 +601,7 @@ extern const u16 wm8352_mode3_defaults[];
601struct wm8350; 601struct wm8350;
602 602
603struct wm8350_irq { 603struct wm8350_irq {
604 void (*handler) (struct wm8350 *, int, void *); 604 irq_handler_t handler;
605 void *data; 605 void *data;
606}; 606};
607 607
@@ -646,10 +646,12 @@ struct wm8350 {
646 * @init: Function called during driver initialisation. Should be 646 * @init: Function called during driver initialisation. Should be
647 * used by the platform to configure GPIO functions and similar. 647 * used by the platform to configure GPIO functions and similar.
648 * @irq_high: Set if WM8350 IRQ is active high. 648 * @irq_high: Set if WM8350 IRQ is active high.
649 * @irq_base: Base IRQ for genirq (not currently used).
649 */ 650 */
650struct wm8350_platform_data { 651struct wm8350_platform_data {
651 int (*init)(struct wm8350 *wm8350); 652 int (*init)(struct wm8350 *wm8350);
652 int irq_high; 653 int irq_high;
654 int irq_base;
653}; 655};
654 656
655 657
@@ -676,11 +678,13 @@ int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src);
676 * WM8350 internal interrupts 678 * WM8350 internal interrupts
677 */ 679 */
678int wm8350_register_irq(struct wm8350 *wm8350, int irq, 680int wm8350_register_irq(struct wm8350 *wm8350, int irq,
679 void (*handler) (struct wm8350 *, int, void *), 681 irq_handler_t handler, unsigned long flags,
680 void *data); 682 const char *name, void *data);
681int wm8350_free_irq(struct wm8350 *wm8350, int irq); 683int wm8350_free_irq(struct wm8350 *wm8350, int irq);
682int wm8350_mask_irq(struct wm8350 *wm8350, int irq); 684int wm8350_mask_irq(struct wm8350 *wm8350, int irq);
683int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); 685int wm8350_unmask_irq(struct wm8350 *wm8350, int irq);
684 686int wm8350_irq_init(struct wm8350 *wm8350, int irq,
687 struct wm8350_platform_data *pdata);
688int wm8350_irq_exit(struct wm8350 *wm8350);
685 689
686#endif 690#endif
diff --git a/include/linux/mfd/wm8350/gpio.h b/include/linux/mfd/wm8350/gpio.h
index ed91e8f5d298..71af3d6ebe9d 100644
--- a/include/linux/mfd/wm8350/gpio.h
+++ b/include/linux/mfd/wm8350/gpio.h
@@ -173,6 +173,24 @@
173#define WM8350_GPIO_DEBOUNCE_ON 1 173#define WM8350_GPIO_DEBOUNCE_ON 1
174 174
175/* 175/*
176 * R30 (0x1E) - GPIO Interrupt Status
177 */
178#define WM8350_GP12_EINT 0x1000
179#define WM8350_GP11_EINT 0x0800
180#define WM8350_GP10_EINT 0x0400
181#define WM8350_GP9_EINT 0x0200
182#define WM8350_GP8_EINT 0x0100
183#define WM8350_GP7_EINT 0x0080
184#define WM8350_GP6_EINT 0x0040
185#define WM8350_GP5_EINT 0x0020
186#define WM8350_GP4_EINT 0x0010
187#define WM8350_GP3_EINT 0x0008
188#define WM8350_GP2_EINT 0x0004
189#define WM8350_GP1_EINT 0x0002
190#define WM8350_GP0_EINT 0x0001
191
192
193/*
176 * R128 (0x80) - GPIO Debounce 194 * R128 (0x80) - GPIO Debounce
177 */ 195 */
178#define WM8350_GP12_DB 0x1000 196#define WM8350_GP12_DB 0x1000
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 2dbfb5a05994..33b2ea09a4ad 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -28,6 +28,7 @@
28#define SDIO_DEVICE_ID_INTEL_IWMC3200TOP 0x1404 28#define SDIO_DEVICE_ID_INTEL_IWMC3200TOP 0x1404
29#define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405 29#define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405
30#define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406 30#define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406
31#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX_2G5 0x1407
31 32
32#define SDIO_VENDOR_ID_MARVELL 0x02df 33#define SDIO_VENDOR_ID_MARVELL 0x02df
33#define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 34#define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index 08bc776d05e2..c5f3d53548e2 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -59,20 +59,24 @@ struct vifctl {
59 unsigned char vifc_flags; /* VIFF_ flags */ 59 unsigned char vifc_flags; /* VIFF_ flags */
60 unsigned char vifc_threshold; /* ttl limit */ 60 unsigned char vifc_threshold; /* ttl limit */
61 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */ 61 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */
62 struct in_addr vifc_lcl_addr; /* Our address */ 62 union {
63 struct in_addr vifc_lcl_addr; /* Local interface address */
64 int vifc_lcl_ifindex; /* Local interface index */
65 };
63 struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */ 66 struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */
64}; 67};
65 68
66#define VIFF_TUNNEL 0x1 /* IPIP tunnel */ 69#define VIFF_TUNNEL 0x1 /* IPIP tunnel */
67#define VIFF_SRCRT 0x2 /* NI */ 70#define VIFF_SRCRT 0x2 /* NI */
68#define VIFF_REGISTER 0x4 /* register vif */ 71#define VIFF_REGISTER 0x4 /* register vif */
72#define VIFF_USE_IFINDEX 0x8 /* use vifc_lcl_ifindex instead of
73 vifc_lcl_addr to find an interface */
69 74
70/* 75/*
71 * Cache manipulation structures for mrouted and PIMd 76 * Cache manipulation structures for mrouted and PIMd
72 */ 77 */
73 78
74struct mfcctl 79struct mfcctl {
75{
76 struct in_addr mfcc_origin; /* Origin of mcast */ 80 struct in_addr mfcc_origin; /* Origin of mcast */
77 struct in_addr mfcc_mcastgrp; /* Group in question */ 81 struct in_addr mfcc_mcastgrp; /* Group in question */
78 vifi_t mfcc_parent; /* Where it arrived */ 82 vifi_t mfcc_parent; /* Where it arrived */
@@ -87,8 +91,7 @@ struct mfcctl
87 * Group count retrieval for mrouted 91 * Group count retrieval for mrouted
88 */ 92 */
89 93
90struct sioc_sg_req 94struct sioc_sg_req {
91{
92 struct in_addr src; 95 struct in_addr src;
93 struct in_addr grp; 96 struct in_addr grp;
94 unsigned long pktcnt; 97 unsigned long pktcnt;
@@ -100,8 +103,7 @@ struct sioc_sg_req
100 * To get vif packet counts 103 * To get vif packet counts
101 */ 104 */
102 105
103struct sioc_vif_req 106struct sioc_vif_req {
104{
105 vifi_t vifi; /* Which iface */ 107 vifi_t vifi; /* Which iface */
106 unsigned long icount; /* In packets */ 108 unsigned long icount; /* In packets */
107 unsigned long ocount; /* Out packets */ 109 unsigned long ocount; /* Out packets */
@@ -114,8 +116,7 @@ struct sioc_vif_req
114 * data. Magically happens to be like an IP packet as per the original 116 * data. Magically happens to be like an IP packet as per the original
115 */ 117 */
116 118
117struct igmpmsg 119struct igmpmsg {
118{
119 __u32 unused1,unused2; 120 __u32 unused1,unused2;
120 unsigned char im_msgtype; /* What is this */ 121 unsigned char im_msgtype; /* What is this */
121 unsigned char im_mbz; /* Must be zero */ 122 unsigned char im_mbz; /* Must be zero */
@@ -176,8 +177,7 @@ static inline int ip_mr_init(void)
176} 177}
177#endif 178#endif
178 179
179struct vif_device 180struct vif_device {
180{
181 struct net_device *dev; /* Device we are using */ 181 struct net_device *dev; /* Device we are using */
182 unsigned long bytes_in,bytes_out; 182 unsigned long bytes_in,bytes_out;
183 unsigned long pkt_in,pkt_out; /* Statistics */ 183 unsigned long pkt_in,pkt_out; /* Statistics */
@@ -190,8 +190,7 @@ struct vif_device
190 190
191#define VIFF_STATIC 0x8000 191#define VIFF_STATIC 0x8000
192 192
193struct mfc_cache 193struct mfc_cache {
194{
195 struct mfc_cache *next; /* Next entry on cache line */ 194 struct mfc_cache *next; /* Next entry on cache line */
196#ifdef CONFIG_NET_NS 195#ifdef CONFIG_NET_NS
197 struct net *mfc_net; 196 struct net *mfc_net;
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index b191865a6ca3..2caa1a8e525d 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -75,8 +75,7 @@ struct mif6ctl {
75 * Cache manipulation structures for mrouted and PIMd 75 * Cache manipulation structures for mrouted and PIMd
76 */ 76 */
77 77
78struct mf6cctl 78struct mf6cctl {
79{
80 struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */ 79 struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */
81 struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */ 80 struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */
82 mifi_t mf6cc_parent; /* Where it arrived */ 81 mifi_t mf6cc_parent; /* Where it arrived */
@@ -87,8 +86,7 @@ struct mf6cctl
87 * Group count retrieval for pim6sd 86 * Group count retrieval for pim6sd
88 */ 87 */
89 88
90struct sioc_sg_req6 89struct sioc_sg_req6 {
91{
92 struct sockaddr_in6 src; 90 struct sockaddr_in6 src;
93 struct sockaddr_in6 grp; 91 struct sockaddr_in6 grp;
94 unsigned long pktcnt; 92 unsigned long pktcnt;
@@ -100,8 +98,7 @@ struct sioc_sg_req6
100 * To get vif packet counts 98 * To get vif packet counts
101 */ 99 */
102 100
103struct sioc_mif_req6 101struct sioc_mif_req6 {
104{
105 mifi_t mifi; /* Which iface */ 102 mifi_t mifi; /* Which iface */
106 unsigned long icount; /* In packets */ 103 unsigned long icount; /* In packets */
107 unsigned long ocount; /* Out packets */ 104 unsigned long ocount; /* Out packets */
@@ -172,8 +169,7 @@ static inline void ip6_mr_cleanup(void)
172} 169}
173#endif 170#endif
174 171
175struct mif_device 172struct mif_device {
176{
177 struct net_device *dev; /* Device we are using */ 173 struct net_device *dev; /* Device we are using */
178 unsigned long bytes_in,bytes_out; 174 unsigned long bytes_in,bytes_out;
179 unsigned long pkt_in,pkt_out; /* Statistics */ 175 unsigned long pkt_in,pkt_out; /* Statistics */
@@ -185,8 +181,7 @@ struct mif_device
185 181
186#define VIFF_STATIC 0x8000 182#define VIFF_STATIC 0x8000
187 183
188struct mfc6_cache 184struct mfc6_cache {
189{
190 struct mfc6_cache *next; /* Next entry on cache line */ 185 struct mfc6_cache *next; /* Next entry on cache line */
191#ifdef CONFIG_NET_NS 186#ifdef CONFIG_NET_NS
192 struct net *mfc6_net; 187 struct net *mfc6_net;
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
index 6913b71d9ab2..b31bd9e9bca3 100644
--- a/include/linux/mtd/ubi.h
+++ b/include/linux/mtd/ubi.h
@@ -174,6 +174,8 @@ void ubi_get_volume_info(struct ubi_volume_desc *desc,
174struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); 174struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode);
175struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, 175struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name,
176 int mode); 176 int mode);
177struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode);
178
177int ubi_register_volume_notifier(struct notifier_block *nb, 179int ubi_register_volume_notifier(struct notifier_block *nb,
178 int ignore_existing); 180 int ignore_existing);
179int ubi_unregister_volume_notifier(struct notifier_block *nb); 181int ubi_unregister_volume_notifier(struct notifier_block *nb);
diff --git a/include/linux/namei.h b/include/linux/namei.h
index ec0f607b364a..028946750289 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -76,7 +76,6 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
76extern void release_open_intent(struct nameidata *); 76extern void release_open_intent(struct nameidata *);
77 77
78extern struct dentry *lookup_one_len(const char *, struct dentry *, int); 78extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
79extern struct dentry *lookup_one_noperm(const char *, struct dentry *);
80 79
81extern int follow_down(struct path *); 80extern int follow_down(struct path *);
82extern int follow_up(struct path *); 81extern int follow_up(struct path *);
diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h
index 12c9de138451..a7003b7a695d 100644
--- a/include/linux/neighbour.h
+++ b/include/linux/neighbour.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netlink.h> 5#include <linux/netlink.h>
6 6
7struct ndmsg 7struct ndmsg {
8{
9 __u8 ndm_family; 8 __u8 ndm_family;
10 __u8 ndm_pad1; 9 __u8 ndm_pad1;
11 __u16 ndm_pad2; 10 __u16 ndm_pad2;
@@ -15,8 +14,7 @@ struct ndmsg
15 __u8 ndm_type; 14 __u8 ndm_type;
16}; 15};
17 16
18enum 17enum {
19{
20 NDA_UNSPEC, 18 NDA_UNSPEC,
21 NDA_DST, 19 NDA_DST,
22 NDA_LLADDR, 20 NDA_LLADDR,
@@ -56,8 +54,7 @@ enum
56 NUD_PERMANENT is also cannot be deleted by garbage collectors. 54 NUD_PERMANENT is also cannot be deleted by garbage collectors.
57 */ 55 */
58 56
59struct nda_cacheinfo 57struct nda_cacheinfo {
60{
61 __u32 ndm_confirmed; 58 __u32 ndm_confirmed;
62 __u32 ndm_used; 59 __u32 ndm_used;
63 __u32 ndm_updated; 60 __u32 ndm_updated;
@@ -89,8 +86,7 @@ struct nda_cacheinfo
89 * device. 86 * device.
90 ****/ 87 ****/
91 88
92struct ndt_stats 89struct ndt_stats {
93{
94 __u64 ndts_allocs; 90 __u64 ndts_allocs;
95 __u64 ndts_destroys; 91 __u64 ndts_destroys;
96 __u64 ndts_hash_grows; 92 __u64 ndts_hash_grows;
@@ -124,15 +120,13 @@ enum {
124}; 120};
125#define NDTPA_MAX (__NDTPA_MAX - 1) 121#define NDTPA_MAX (__NDTPA_MAX - 1)
126 122
127struct ndtmsg 123struct ndtmsg {
128{
129 __u8 ndtm_family; 124 __u8 ndtm_family;
130 __u8 ndtm_pad1; 125 __u8 ndtm_pad1;
131 __u16 ndtm_pad2; 126 __u16 ndtm_pad2;
132}; 127};
133 128
134struct ndt_config 129struct ndt_config {
135{
136 __u16 ndtc_key_len; 130 __u16 ndtc_key_len;
137 __u16 ndtc_entry_size; 131 __u16 ndtc_entry_size;
138 __u32 ndtc_entries; 132 __u32 ndtc_entries;
diff --git a/include/linux/net.h b/include/linux/net.h
index 529a0931711d..5e8083cacc8b 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -41,6 +41,7 @@
41#define SYS_SENDMSG 16 /* sys_sendmsg(2) */ 41#define SYS_SENDMSG 16 /* sys_sendmsg(2) */
42#define SYS_RECVMSG 17 /* sys_recvmsg(2) */ 42#define SYS_RECVMSG 17 /* sys_recvmsg(2) */
43#define SYS_ACCEPT4 18 /* sys_accept4(2) */ 43#define SYS_ACCEPT4 18 /* sys_accept4(2) */
44#define SYS_RECVMMSG 19 /* sys_recvmmsg(2) */
44 45
45typedef enum { 46typedef enum {
46 SS_FREE = 0, /* not allocated */ 47 SS_FREE = 0, /* not allocated */
@@ -198,9 +199,13 @@ struct proto_ops {
198 struct pipe_inode_info *pipe, size_t len, unsigned int flags); 199 struct pipe_inode_info *pipe, size_t len, unsigned int flags);
199}; 200};
200 201
202#define DECLARE_SOCKADDR(type, dst, src) \
203 type dst = ({ __sockaddr_check_size(sizeof(*dst)); (type) src; })
204
201struct net_proto_family { 205struct net_proto_family {
202 int family; 206 int family;
203 int (*create)(struct net *net, struct socket *sock, int protocol); 207 int (*create)(struct net *net, struct socket *sock,
208 int protocol, int kern);
204 struct module *owner; 209 struct module *owner;
205}; 210};
206 211
@@ -263,89 +268,6 @@ extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg);
263extern int kernel_sock_shutdown(struct socket *sock, 268extern int kernel_sock_shutdown(struct socket *sock,
264 enum sock_shutdown_cmd how); 269 enum sock_shutdown_cmd how);
265 270
266#ifndef CONFIG_SMP
267#define SOCKOPS_WRAPPED(name) name
268#define SOCKOPS_WRAP(name, fam)
269#else
270
271#define SOCKOPS_WRAPPED(name) __unlocked_##name
272
273#define SOCKCALL_WRAP(name, call, parms, args) \
274static int __lock_##name##_##call parms \
275{ \
276 int ret; \
277 lock_kernel(); \
278 ret = __unlocked_##name##_ops.call args ;\
279 unlock_kernel(); \
280 return ret; \
281}
282
283#define SOCKCALL_UWRAP(name, call, parms, args) \
284static unsigned int __lock_##name##_##call parms \
285{ \
286 int ret; \
287 lock_kernel(); \
288 ret = __unlocked_##name##_ops.call args ;\
289 unlock_kernel(); \
290 return ret; \
291}
292
293
294#define SOCKOPS_WRAP(name, fam) \
295SOCKCALL_WRAP(name, release, (struct socket *sock), (sock)) \
296SOCKCALL_WRAP(name, bind, (struct socket *sock, struct sockaddr *uaddr, int addr_len), \
297 (sock, uaddr, addr_len)) \
298SOCKCALL_WRAP(name, connect, (struct socket *sock, struct sockaddr * uaddr, \
299 int addr_len, int flags), \
300 (sock, uaddr, addr_len, flags)) \
301SOCKCALL_WRAP(name, socketpair, (struct socket *sock1, struct socket *sock2), \
302 (sock1, sock2)) \
303SOCKCALL_WRAP(name, accept, (struct socket *sock, struct socket *newsock, \
304 int flags), (sock, newsock, flags)) \
305SOCKCALL_WRAP(name, getname, (struct socket *sock, struct sockaddr *uaddr, \
306 int *addr_len, int peer), (sock, uaddr, addr_len, peer)) \
307SOCKCALL_UWRAP(name, poll, (struct file *file, struct socket *sock, struct poll_table_struct *wait), \
308 (file, sock, wait)) \
309SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \
310 unsigned long arg), (sock, cmd, arg)) \
311SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int cmd, \
312 unsigned long arg), (sock, cmd, arg)) \
313SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \
314SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \
315SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \
316 char __user *optval, unsigned int optlen), (sock, level, optname, optval, optlen)) \
317SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \
318 char __user *optval, int __user *optlen), (sock, level, optname, optval, optlen)) \
319SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len), \
320 (iocb, sock, m, len)) \
321SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len, int flags), \
322 (iocb, sock, m, len, flags)) \
323SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \
324 (file, sock, vma)) \
325 \
326static const struct proto_ops name##_ops = { \
327 .family = fam, \
328 .owner = THIS_MODULE, \
329 .release = __lock_##name##_release, \
330 .bind = __lock_##name##_bind, \
331 .connect = __lock_##name##_connect, \
332 .socketpair = __lock_##name##_socketpair, \
333 .accept = __lock_##name##_accept, \
334 .getname = __lock_##name##_getname, \
335 .poll = __lock_##name##_poll, \
336 .ioctl = __lock_##name##_ioctl, \
337 .compat_ioctl = __lock_##name##_compat_ioctl, \
338 .listen = __lock_##name##_listen, \
339 .shutdown = __lock_##name##_shutdown, \
340 .setsockopt = __lock_##name##_setsockopt, \
341 .getsockopt = __lock_##name##_getsockopt, \
342 .sendmsg = __lock_##name##_sendmsg, \
343 .recvmsg = __lock_##name##_recvmsg, \
344 .mmap = __lock_##name##_mmap, \
345};
346
347#endif
348
349#define MODULE_ALIAS_NETPROTO(proto) \ 271#define MODULE_ALIAS_NETPROTO(proto) \
350 MODULE_ALIAS("net-pf-" __stringify(proto)) 272 MODULE_ALIAS("net-pf-" __stringify(proto))
351 273
@@ -358,6 +280,7 @@ static const struct proto_ops name##_ops = { \
358 280
359#ifdef CONFIG_SYSCTL 281#ifdef CONFIG_SYSCTL
360#include <linux/sysctl.h> 282#include <linux/sysctl.h>
283#include <linux/ratelimit.h>
361extern struct ratelimit_state net_ratelimit_state; 284extern struct ratelimit_state net_ratelimit_state;
362#endif 285#endif
363 286
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 812a5f3c2abe..a3fccc85b1a0 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -63,30 +63,69 @@ struct wireless_dev;
63#define HAVE_FREE_NETDEV /* free_netdev() */ 63#define HAVE_FREE_NETDEV /* free_netdev() */
64#define HAVE_NETDEV_PRIV /* netdev_priv() */ 64#define HAVE_NETDEV_PRIV /* netdev_priv() */
65 65
66#define NET_XMIT_SUCCESS 0
67#define NET_XMIT_DROP 1 /* skb dropped */
68#define NET_XMIT_CN 2 /* congestion notification */
69#define NET_XMIT_POLICED 3 /* skb is shot by police */
70#define NET_XMIT_MASK 0xFFFF /* qdisc flags in net/sch_generic.h */
71
72/* Backlog congestion levels */ 66/* Backlog congestion levels */
73#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ 67#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
74#define NET_RX_DROP 1 /* packet dropped */ 68#define NET_RX_DROP 1 /* packet dropped */
69
70/*
71 * Transmit return codes: transmit return codes originate from three different
72 * namespaces:
73 *
74 * - qdisc return codes
75 * - driver transmit return codes
76 * - errno values
77 *
78 * Drivers are allowed to return any one of those in their hard_start_xmit()
79 * function. Real network devices commonly used with qdiscs should only return
80 * the driver transmit return codes though - when qdiscs are used, the actual
81 * transmission happens asynchronously, so the value is not propagated to
82 * higher layers. Virtual network devices transmit synchronously, in this case
83 * the driver transmit return codes are consumed by dev_queue_xmit(), all
84 * others are propagated to higher layers.
85 */
86
87/* qdisc ->enqueue() return codes. */
88#define NET_XMIT_SUCCESS 0x00
89#define NET_XMIT_DROP 0x01 /* skb dropped */
90#define NET_XMIT_CN 0x02 /* congestion notification */
91#define NET_XMIT_POLICED 0x03 /* skb is shot by police */
92#define NET_XMIT_MASK 0x0f /* qdisc flags in net/sch_generic.h */
75 93
76/* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It 94/* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It
77 * indicates that the device will soon be dropping packets, or already drops 95 * indicates that the device will soon be dropping packets, or already drops
78 * some packets of the same priority; prompting us to send less aggressively. */ 96 * some packets of the same priority; prompting us to send less aggressively. */
79#define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) 97#define net_xmit_eval(e) ((e) == NET_XMIT_CN ? 0 : (e))
80#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) 98#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
81 99
82/* Driver transmit return codes */ 100/* Driver transmit return codes */
101#define NETDEV_TX_MASK 0xf0
102
83enum netdev_tx { 103enum netdev_tx {
84 NETDEV_TX_OK = 0, /* driver took care of packet */ 104 __NETDEV_TX_MIN = INT_MIN, /* make sure enum is signed */
85 NETDEV_TX_BUSY, /* driver tx path was busy*/ 105 NETDEV_TX_OK = 0x00, /* driver took care of packet */
86 NETDEV_TX_LOCKED = -1, /* driver tx lock was already taken */ 106 NETDEV_TX_BUSY = 0x10, /* driver tx path was busy*/
107 NETDEV_TX_LOCKED = 0x20, /* driver tx lock was already taken */
87}; 108};
88typedef enum netdev_tx netdev_tx_t; 109typedef enum netdev_tx netdev_tx_t;
89 110
111/*
112 * Current order: NETDEV_TX_MASK > NET_XMIT_MASK >= 0 is significant;
113 * hard_start_xmit() return < NET_XMIT_MASK means skb was consumed.
114 */
115static inline bool dev_xmit_complete(int rc)
116{
117 /*
118 * Positive cases with an skb consumed by a driver:
119 * - successful transmission (rc == NETDEV_TX_OK)
120 * - error while transmitting (rc < 0)
121 * - error while queueing to a different device (rc & NET_XMIT_MASK)
122 */
123 if (likely(rc < NET_XMIT_MASK))
124 return true;
125
126 return false;
127}
128
90#endif 129#endif
91 130
92#define MAX_ADDR_LEN 32 /* Largest hardware address length */ 131#define MAX_ADDR_LEN 32 /* Largest hardware address length */
@@ -125,8 +164,7 @@ typedef enum netdev_tx netdev_tx_t;
125 * with byte counters. 164 * with byte counters.
126 */ 165 */
127 166
128struct net_device_stats 167struct net_device_stats {
129{
130 unsigned long rx_packets; /* total packets received */ 168 unsigned long rx_packets; /* total packets received */
131 unsigned long tx_packets; /* total packets transmitted */ 169 unsigned long tx_packets; /* total packets transmitted */
132 unsigned long rx_bytes; /* total bytes received */ 170 unsigned long rx_bytes; /* total bytes received */
@@ -179,8 +217,7 @@ struct neighbour;
179struct neigh_parms; 217struct neigh_parms;
180struct sk_buff; 218struct sk_buff;
181 219
182struct netif_rx_stats 220struct netif_rx_stats {
183{
184 unsigned total; 221 unsigned total;
185 unsigned dropped; 222 unsigned dropped;
186 unsigned time_squeeze; 223 unsigned time_squeeze;
@@ -189,8 +226,7 @@ struct netif_rx_stats
189 226
190DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); 227DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat);
191 228
192struct dev_addr_list 229struct dev_addr_list {
193{
194 struct dev_addr_list *next; 230 struct dev_addr_list *next;
195 u8 da_addr[MAX_ADDR_LEN]; 231 u8 da_addr[MAX_ADDR_LEN];
196 u8 da_addrlen; 232 u8 da_addrlen;
@@ -227,8 +263,7 @@ struct netdev_hw_addr_list {
227 int count; 263 int count;
228}; 264};
229 265
230struct hh_cache 266struct hh_cache {
231{
232 struct hh_cache *hh_next; /* Next entry */ 267 struct hh_cache *hh_next; /* Next entry */
233 atomic_t hh_refcnt; /* number of users */ 268 atomic_t hh_refcnt; /* number of users */
234/* 269/*
@@ -291,8 +326,7 @@ struct header_ops {
291 * code. 326 * code.
292 */ 327 */
293 328
294enum netdev_state_t 329enum netdev_state_t {
295{
296 __LINK_STATE_START, 330 __LINK_STATE_START,
297 __LINK_STATE_PRESENT, 331 __LINK_STATE_PRESENT,
298 __LINK_STATE_NOCARRIER, 332 __LINK_STATE_NOCARRIER,
@@ -341,20 +375,20 @@ struct napi_struct {
341 struct sk_buff *skb; 375 struct sk_buff *skb;
342}; 376};
343 377
344enum 378enum {
345{
346 NAPI_STATE_SCHED, /* Poll is scheduled */ 379 NAPI_STATE_SCHED, /* Poll is scheduled */
347 NAPI_STATE_DISABLE, /* Disable pending */ 380 NAPI_STATE_DISABLE, /* Disable pending */
348 NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ 381 NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */
349}; 382};
350 383
351enum { 384enum gro_result {
352 GRO_MERGED, 385 GRO_MERGED,
353 GRO_MERGED_FREE, 386 GRO_MERGED_FREE,
354 GRO_HELD, 387 GRO_HELD,
355 GRO_NORMAL, 388 GRO_NORMAL,
356 GRO_DROP, 389 GRO_DROP,
357}; 390};
391typedef enum gro_result gro_result_t;
358 392
359extern void __napi_schedule(struct napi_struct *n); 393extern void __napi_schedule(struct napi_struct *n);
360 394
@@ -457,8 +491,7 @@ static inline void napi_synchronize(const struct napi_struct *n)
457# define napi_synchronize(n) barrier() 491# define napi_synchronize(n) barrier()
458#endif 492#endif
459 493
460enum netdev_queue_state_t 494enum netdev_queue_state_t {
461{
462 __QUEUE_STATE_XOFF, 495 __QUEUE_STATE_XOFF,
463 __QUEUE_STATE_FROZEN, 496 __QUEUE_STATE_FROZEN,
464}; 497};
@@ -635,6 +668,10 @@ struct net_device_ops {
635 unsigned int sgc); 668 unsigned int sgc);
636 int (*ndo_fcoe_ddp_done)(struct net_device *dev, 669 int (*ndo_fcoe_ddp_done)(struct net_device *dev,
637 u16 xid); 670 u16 xid);
671#define NETDEV_FCOE_WWNN 0
672#define NETDEV_FCOE_WWPN 1
673 int (*ndo_fcoe_get_wwn)(struct net_device *dev,
674 u64 *wwn, int type);
638#endif 675#endif
639}; 676};
640 677
@@ -648,8 +685,7 @@ struct net_device_ops {
648 * moves out. 685 * moves out.
649 */ 686 */
650 687
651struct net_device 688struct net_device {
652{
653 689
654 /* 690 /*
655 * This is the first field of the "visible" part of this structure 691 * This is the first field of the "visible" part of this structure
@@ -683,6 +719,7 @@ struct net_device
683 719
684 struct list_head dev_list; 720 struct list_head dev_list;
685 struct list_head napi_list; 721 struct list_head napi_list;
722 struct list_head unreg_list;
686 723
687 /* Net device features */ 724 /* Net device features */
688 unsigned long features; 725 unsigned long features;
@@ -859,7 +896,7 @@ struct net_device
859 /* device index hash chain */ 896 /* device index hash chain */
860 struct hlist_node index_hlist; 897 struct hlist_node index_hlist;
861 898
862 struct net_device *link_watch_next; 899 struct list_head link_watch_list;
863 900
864 /* register/unregister state machine */ 901 /* register/unregister state machine */
865 enum { NETREG_UNINITIALIZED=0, 902 enum { NETREG_UNINITIALIZED=0,
@@ -894,8 +931,8 @@ struct net_device
894 931
895 /* class/net/name entry */ 932 /* class/net/name entry */
896 struct device dev; 933 struct device dev;
897 /* space for optional statistics and wireless sysfs groups */ 934 /* space for optional device, statistics, and wireless sysfs groups */
898 const struct attribute_group *sysfs_groups[3]; 935 const struct attribute_group *sysfs_groups[4];
899 936
900 /* rtnetlink link ops */ 937 /* rtnetlink link ops */
901 const struct rtnl_link_ops *rtnl_link_ops; 938 const struct rtnl_link_ops *rtnl_link_ops;
@@ -909,7 +946,7 @@ struct net_device
909 946
910#ifdef CONFIG_DCB 947#ifdef CONFIG_DCB
911 /* Data Center Bridging netlink ops */ 948 /* Data Center Bridging netlink ops */
912 struct dcbnl_rtnl_ops *dcbnl_ops; 949 const struct dcbnl_rtnl_ops *dcbnl_ops;
913#endif 950#endif
914 951
915#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) 952#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
@@ -1075,10 +1112,16 @@ extern rwlock_t dev_base_lock; /* Device list lock */
1075 1112
1076#define for_each_netdev(net, d) \ 1113#define for_each_netdev(net, d) \
1077 list_for_each_entry(d, &(net)->dev_base_head, dev_list) 1114 list_for_each_entry(d, &(net)->dev_base_head, dev_list)
1115#define for_each_netdev_reverse(net, d) \
1116 list_for_each_entry_reverse(d, &(net)->dev_base_head, dev_list)
1117#define for_each_netdev_rcu(net, d) \
1118 list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
1078#define for_each_netdev_safe(net, d, n) \ 1119#define for_each_netdev_safe(net, d, n) \
1079 list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list) 1120 list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list)
1080#define for_each_netdev_continue(net, d) \ 1121#define for_each_netdev_continue(net, d) \
1081 list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list) 1122 list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list)
1123#define for_each_netdev_continue_rcu(net, d) \
1124 list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list)
1082#define net_device_entry(lh) list_entry(lh, struct net_device, dev_list) 1125#define net_device_entry(lh) list_entry(lh, struct net_device, dev_list)
1083 1126
1084static inline struct net_device *next_net_device(struct net_device *dev) 1127static inline struct net_device *next_net_device(struct net_device *dev)
@@ -1091,6 +1134,16 @@ static inline struct net_device *next_net_device(struct net_device *dev)
1091 return lh == &net->dev_base_head ? NULL : net_device_entry(lh); 1134 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1092} 1135}
1093 1136
1137static inline struct net_device *next_net_device_rcu(struct net_device *dev)
1138{
1139 struct list_head *lh;
1140 struct net *net;
1141
1142 net = dev_net(dev);
1143 lh = rcu_dereference(dev->dev_list.next);
1144 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1145}
1146
1094static inline struct net_device *first_net_device(struct net *net) 1147static inline struct net_device *first_net_device(struct net *net)
1095{ 1148{
1096 return list_empty(&net->dev_base_head) ? NULL : 1149 return list_empty(&net->dev_base_head) ? NULL :
@@ -1109,6 +1162,7 @@ extern void __dev_remove_pack(struct packet_type *pt);
1109extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags, 1162extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags,
1110 unsigned short mask); 1163 unsigned short mask);
1111extern struct net_device *dev_get_by_name(struct net *net, const char *name); 1164extern struct net_device *dev_get_by_name(struct net *net, const char *name);
1165extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name);
1112extern struct net_device *__dev_get_by_name(struct net *net, const char *name); 1166extern struct net_device *__dev_get_by_name(struct net *net, const char *name);
1113extern int dev_alloc_name(struct net_device *dev, const char *name); 1167extern int dev_alloc_name(struct net_device *dev, const char *name);
1114extern int dev_open(struct net_device *dev); 1168extern int dev_open(struct net_device *dev);
@@ -1116,7 +1170,14 @@ extern int dev_close(struct net_device *dev);
1116extern void dev_disable_lro(struct net_device *dev); 1170extern void dev_disable_lro(struct net_device *dev);
1117extern int dev_queue_xmit(struct sk_buff *skb); 1171extern int dev_queue_xmit(struct sk_buff *skb);
1118extern int register_netdevice(struct net_device *dev); 1172extern int register_netdevice(struct net_device *dev);
1119extern void unregister_netdevice(struct net_device *dev); 1173extern void unregister_netdevice_queue(struct net_device *dev,
1174 struct list_head *head);
1175extern void unregister_netdevice_many(struct list_head *head);
1176static inline void unregister_netdevice(struct net_device *dev)
1177{
1178 unregister_netdevice_queue(dev, NULL);
1179}
1180
1120extern void free_netdev(struct net_device *dev); 1181extern void free_netdev(struct net_device *dev);
1121extern void synchronize_net(void); 1182extern void synchronize_net(void);
1122extern int register_netdevice_notifier(struct notifier_block *nb); 1183extern int register_netdevice_notifier(struct notifier_block *nb);
@@ -1127,6 +1188,7 @@ extern void netdev_resync_ops(struct net_device *dev);
1127extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); 1188extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1128extern struct net_device *dev_get_by_index(struct net *net, int ifindex); 1189extern struct net_device *dev_get_by_index(struct net *net, int ifindex);
1129extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); 1190extern struct net_device *__dev_get_by_index(struct net *net, int ifindex);
1191extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
1130extern int dev_restart(struct net_device *dev); 1192extern int dev_restart(struct net_device *dev);
1131#ifdef CONFIG_NETPOLL_TRAP 1193#ifdef CONFIG_NETPOLL_TRAP
1132extern int netpoll_trap(void); 1194extern int netpoll_trap(void);
@@ -1212,8 +1274,7 @@ static inline int unregister_gifconf(unsigned int family)
1212 * Incoming packets are placed on per-cpu queues so that 1274 * Incoming packets are placed on per-cpu queues so that
1213 * no locking is needed. 1275 * no locking is needed.
1214 */ 1276 */
1215struct softnet_data 1277struct softnet_data {
1216{
1217 struct Qdisc *output_queue; 1278 struct Qdisc *output_queue;
1218 struct sk_buff_head input_pkt_queue; 1279 struct sk_buff_head input_pkt_queue;
1219 struct list_head poll_list; 1280 struct list_head poll_list;
@@ -1467,18 +1528,19 @@ extern int netif_rx_ni(struct sk_buff *skb);
1467#define HAVE_NETIF_RECEIVE_SKB 1 1528#define HAVE_NETIF_RECEIVE_SKB 1
1468extern int netif_receive_skb(struct sk_buff *skb); 1529extern int netif_receive_skb(struct sk_buff *skb);
1469extern void napi_gro_flush(struct napi_struct *napi); 1530extern void napi_gro_flush(struct napi_struct *napi);
1470extern int dev_gro_receive(struct napi_struct *napi, 1531extern gro_result_t dev_gro_receive(struct napi_struct *napi,
1471 struct sk_buff *skb); 1532 struct sk_buff *skb);
1472extern int napi_skb_finish(int ret, struct sk_buff *skb); 1533extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
1473extern int napi_gro_receive(struct napi_struct *napi, 1534extern gro_result_t napi_gro_receive(struct napi_struct *napi,
1474 struct sk_buff *skb); 1535 struct sk_buff *skb);
1475extern void napi_reuse_skb(struct napi_struct *napi, 1536extern void napi_reuse_skb(struct napi_struct *napi,
1476 struct sk_buff *skb); 1537 struct sk_buff *skb);
1477extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 1538extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
1478extern int napi_frags_finish(struct napi_struct *napi, 1539extern gro_result_t napi_frags_finish(struct napi_struct *napi,
1479 struct sk_buff *skb, int ret); 1540 struct sk_buff *skb,
1541 gro_result_t ret);
1480extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); 1542extern struct sk_buff * napi_frags_skb(struct napi_struct *napi);
1481extern int napi_gro_frags(struct napi_struct *napi); 1543extern gro_result_t napi_gro_frags(struct napi_struct *napi);
1482 1544
1483static inline void napi_free_frags(struct napi_struct *napi) 1545static inline void napi_free_frags(struct napi_struct *napi)
1484{ 1546{
@@ -1502,6 +1564,8 @@ extern int dev_set_mac_address(struct net_device *,
1502extern int dev_hard_start_xmit(struct sk_buff *skb, 1564extern int dev_hard_start_xmit(struct sk_buff *skb,
1503 struct net_device *dev, 1565 struct net_device *dev,
1504 struct netdev_queue *txq); 1566 struct netdev_queue *txq);
1567extern int dev_forward_skb(struct net_device *dev,
1568 struct sk_buff *skb);
1505 1569
1506extern int netdev_budget; 1570extern int netdev_budget;
1507 1571
@@ -1540,6 +1604,7 @@ static inline void dev_hold(struct net_device *dev)
1540 */ 1604 */
1541 1605
1542extern void linkwatch_fire_event(struct net_device *dev); 1606extern void linkwatch_fire_event(struct net_device *dev);
1607extern void linkwatch_forget_dev(struct net_device *dev);
1543 1608
1544/** 1609/**
1545 * netif_carrier_ok - test if carrier present 1610 * netif_carrier_ok - test if carrier present
@@ -1609,7 +1674,8 @@ static inline int netif_dormant(const struct net_device *dev)
1609 * 1674 *
1610 * Check if carrier is operational 1675 * Check if carrier is operational
1611 */ 1676 */
1612static inline int netif_oper_up(const struct net_device *dev) { 1677static inline int netif_oper_up(const struct net_device *dev)
1678{
1613 return (dev->operstate == IF_OPER_UP || 1679 return (dev->operstate == IF_OPER_UP ||
1614 dev->operstate == IF_OPER_UNKNOWN /* backward compat */); 1680 dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
1615} 1681}
@@ -1880,6 +1946,7 @@ extern void netdev_features_change(struct net_device *dev);
1880extern void dev_load(struct net *net, const char *name); 1946extern void dev_load(struct net *net, const char *name);
1881extern void dev_mcast_init(void); 1947extern void dev_mcast_init(void);
1882extern const struct net_device_stats *dev_get_stats(struct net_device *dev); 1948extern const struct net_device_stats *dev_get_stats(struct net_device *dev);
1949extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats);
1883 1950
1884extern int netdev_max_backlog; 1951extern int netdev_max_backlog;
1885extern int weight_p; 1952extern int weight_p;
@@ -1914,6 +1981,9 @@ unsigned long netdev_increment_features(unsigned long all, unsigned long one,
1914 unsigned long mask); 1981 unsigned long mask);
1915unsigned long netdev_fix_features(unsigned long features, const char *name); 1982unsigned long netdev_fix_features(unsigned long features, const char *name);
1916 1983
1984void netif_stacked_transfer_operstate(const struct net_device *rootdev,
1985 struct net_device *dev);
1986
1917static inline int net_gso_ok(int features, int gso_type) 1987static inline int net_gso_ok(int features, int gso_type)
1918{ 1988{
1919 int feature = gso_type << NETIF_F_GSO_SHIFT; 1989 int feature = gso_type << NETIF_F_GSO_SHIFT;
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 6132b5e6d9d3..48c54960773c 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -93,8 +93,7 @@ typedef unsigned int nf_hookfn(unsigned int hooknum,
93 const struct net_device *out, 93 const struct net_device *out,
94 int (*okfn)(struct sk_buff *)); 94 int (*okfn)(struct sk_buff *));
95 95
96struct nf_hook_ops 96struct nf_hook_ops {
97{
98 struct list_head list; 97 struct list_head list;
99 98
100 /* User fills in from here down. */ 99 /* User fills in from here down. */
@@ -106,8 +105,7 @@ struct nf_hook_ops
106 int priority; 105 int priority;
107}; 106};
108 107
109struct nf_sockopt_ops 108struct nf_sockopt_ops {
110{
111 struct list_head list; 109 struct list_head list;
112 110
113 u_int8_t pf; 111 u_int8_t pf;
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index a8248ee422b7..a374787ed9b0 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -3,8 +3,7 @@
3/* Connection state tracking for netfilter. This is separated from, 3/* Connection state tracking for netfilter. This is separated from,
4 but required by, the NAT layer; it can also be used by an iptables 4 but required by, the NAT layer; it can also be used by an iptables
5 extension. */ 5 extension. */
6enum ip_conntrack_info 6enum ip_conntrack_info {
7{
8 /* Part of an established connection (either direction). */ 7 /* Part of an established connection (either direction). */
9 IP_CT_ESTABLISHED, 8 IP_CT_ESTABLISHED,
10 9
@@ -76,8 +75,7 @@ enum ip_conntrack_status {
76}; 75};
77 76
78#ifdef __KERNEL__ 77#ifdef __KERNEL__
79struct ip_conntrack_stat 78struct ip_conntrack_stat {
80{
81 unsigned int searched; 79 unsigned int searched;
82 unsigned int found; 80 unsigned int found;
83 unsigned int new; 81 unsigned int new;
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
index 47727d7546ea..3e3aa08980c3 100644
--- a/include/linux/netfilter/nf_conntrack_ftp.h
+++ b/include/linux/netfilter/nf_conntrack_ftp.h
@@ -3,8 +3,7 @@
3/* FTP tracking. */ 3/* FTP tracking. */
4 4
5/* This enum is exposed to userspace */ 5/* This enum is exposed to userspace */
6enum nf_ct_ftp_type 6enum nf_ct_ftp_type {
7{
8 /* PORT command from client */ 7 /* PORT command from client */
9 NF_CT_FTP_PORT, 8 NF_CT_FTP_PORT,
10 /* PASV response from server */ 9 /* PASV response from server */
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h
index 768f78c4ac53..ceeefe6681b5 100644
--- a/include/linux/netfilter/nf_conntrack_sctp.h
+++ b/include/linux/netfilter/nf_conntrack_sctp.h
@@ -16,8 +16,7 @@ enum sctp_conntrack {
16 SCTP_CONNTRACK_MAX 16 SCTP_CONNTRACK_MAX
17}; 17};
18 18
19struct ip_ct_sctp 19struct ip_ct_sctp {
20{
21 enum sctp_conntrack state; 20 enum sctp_conntrack state;
22 21
23 __be32 vtag[IP_CT_DIR_MAX]; 22 __be32 vtag[IP_CT_DIR_MAX];
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 4352feed2377..6e135f97e59a 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -55,8 +55,7 @@ struct ip_ct_tcp_state {
55 u_int8_t flags; /* per direction options */ 55 u_int8_t flags; /* per direction options */
56}; 56};
57 57
58struct ip_ct_tcp 58struct ip_ct_tcp {
59{
60 struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */ 59 struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */
61 u_int8_t state; /* state of the connection (enum tcp_conntrack) */ 60 u_int8_t state; /* state of the connection (enum tcp_conntrack) */
62 /* For detecting stale connections */ 61 /* For detecting stale connections */
@@ -67,6 +66,9 @@ struct ip_ct_tcp
67 u_int32_t last_ack; /* Last sequence number seen in opposite dir */ 66 u_int32_t last_ack; /* Last sequence number seen in opposite dir */
68 u_int32_t last_end; /* Last seq + len */ 67 u_int32_t last_end; /* Last seq + len */
69 u_int16_t last_win; /* Last window advertisement seen in dir */ 68 u_int16_t last_win; /* Last window advertisement seen in dir */
69 /* For SYN packets while we may be out-of-sync */
70 u_int8_t last_wscale; /* Last window scaling factor seen */
71 u_int8_t last_flags; /* Last flags set */
70}; 72};
71 73
72#endif /* __KERNEL__ */ 74#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 9f00da287f2c..49d321f3ccd2 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -55,8 +55,7 @@ struct nfgenmsg {
55#include <linux/capability.h> 55#include <linux/capability.h>
56#include <net/netlink.h> 56#include <net/netlink.h>
57 57
58struct nfnl_callback 58struct nfnl_callback {
59{
60 int (*call)(struct sock *nl, struct sk_buff *skb, 59 int (*call)(struct sock *nl, struct sk_buff *skb,
61 const struct nlmsghdr *nlh, 60 const struct nlmsghdr *nlh,
62 const struct nlattr * const cda[]); 61 const struct nlattr * const cda[]);
@@ -64,8 +63,7 @@ struct nfnl_callback
64 const u_int16_t attr_count; /* number of nlattr's */ 63 const u_int16_t attr_count; /* number of nlattr's */
65}; 64};
66 65
67struct nfnetlink_subsystem 66struct nfnetlink_subsystem {
68{
69 const char *name; 67 const char *name;
70 __u8 subsys_id; /* nfnetlink subsystem ID */ 68 __u8 subsys_id; /* nfnetlink subsystem ID */
71 __u8 cb_count; /* number of callbacks */ 69 __u8 cb_count; /* number of callbacks */
diff --git a/include/linux/netfilter/nfnetlink_compat.h b/include/linux/netfilter/nfnetlink_compat.h
index eda55cabceec..ffb95036bbd4 100644
--- a/include/linux/netfilter/nfnetlink_compat.h
+++ b/include/linux/netfilter/nfnetlink_compat.h
@@ -21,8 +21,7 @@
21 * ! nfnetlink use the same attributes methods. - J. Schulist. 21 * ! nfnetlink use the same attributes methods. - J. Schulist.
22 */ 22 */
23 23
24struct nfattr 24struct nfattr {
25{
26 __u16 nfa_len; 25 __u16 nfa_len;
27 __u16 nfa_type; /* we use 15 bits for the type, and the highest 26 __u16 nfa_type; /* we use 15 bits for the type, and the highest
28 * bit to indicate whether the payload is nested */ 27 * bit to indicate whether the payload is nested */
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 812cb153cabb..378f27ae7772 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -6,8 +6,7 @@
6#define XT_FUNCTION_MAXNAMELEN 30 6#define XT_FUNCTION_MAXNAMELEN 30
7#define XT_TABLE_MAXNAMELEN 32 7#define XT_TABLE_MAXNAMELEN 32
8 8
9struct xt_entry_match 9struct xt_entry_match {
10{
11 union { 10 union {
12 struct { 11 struct {
13 __u16 match_size; 12 __u16 match_size;
@@ -31,8 +30,7 @@ struct xt_entry_match
31 unsigned char data[0]; 30 unsigned char data[0];
32}; 31};
33 32
34struct xt_entry_target 33struct xt_entry_target {
35{
36 union { 34 union {
37 struct { 35 struct {
38 __u16 target_size; 36 __u16 target_size;
@@ -64,16 +62,14 @@ struct xt_entry_target
64 }, \ 62 }, \
65} 63}
66 64
67struct xt_standard_target 65struct xt_standard_target {
68{
69 struct xt_entry_target target; 66 struct xt_entry_target target;
70 int verdict; 67 int verdict;
71}; 68};
72 69
73/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision 70/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
74 * kernel supports, if >= revision. */ 71 * kernel supports, if >= revision. */
75struct xt_get_revision 72struct xt_get_revision {
76{
77 char name[XT_FUNCTION_MAXNAMELEN-1]; 73 char name[XT_FUNCTION_MAXNAMELEN-1];
78 74
79 __u8 revision; 75 __u8 revision;
@@ -90,8 +86,7 @@ struct xt_get_revision
90 * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my 86 * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my
91 * personal pleasure to remove it -HW 87 * personal pleasure to remove it -HW
92 */ 88 */
93struct _xt_align 89struct _xt_align {
94{
95 __u8 u8; 90 __u8 u8;
96 __u16 u16; 91 __u16 u16;
97 __u32 u32; 92 __u32 u32;
@@ -109,14 +104,12 @@ struct _xt_align
109#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) 104#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
110#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) 105#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
111 106
112struct xt_counters 107struct xt_counters {
113{
114 __u64 pcnt, bcnt; /* Packet and byte counters */ 108 __u64 pcnt, bcnt; /* Packet and byte counters */
115}; 109};
116 110
117/* The argument to IPT_SO_ADD_COUNTERS. */ 111/* The argument to IPT_SO_ADD_COUNTERS. */
118struct xt_counters_info 112struct xt_counters_info {
119{
120 /* Which table. */ 113 /* Which table. */
121 char name[XT_TABLE_MAXNAMELEN]; 114 char name[XT_TABLE_MAXNAMELEN];
122 115
@@ -269,8 +262,7 @@ struct xt_tgdtor_param {
269 u_int8_t family; 262 u_int8_t family;
270}; 263};
271 264
272struct xt_match 265struct xt_match {
273{
274 struct list_head list; 266 struct list_head list;
275 267
276 const char name[XT_FUNCTION_MAXNAMELEN-1]; 268 const char name[XT_FUNCTION_MAXNAMELEN-1];
@@ -310,8 +302,7 @@ struct xt_match
310}; 302};
311 303
312/* Registration hooks for targets. */ 304/* Registration hooks for targets. */
313struct xt_target 305struct xt_target {
314{
315 struct list_head list; 306 struct list_head list;
316 307
317 const char name[XT_FUNCTION_MAXNAMELEN-1]; 308 const char name[XT_FUNCTION_MAXNAMELEN-1];
@@ -349,8 +340,7 @@ struct xt_target
349}; 340};
350 341
351/* Furniture shopping... */ 342/* Furniture shopping... */
352struct xt_table 343struct xt_table {
353{
354 struct list_head list; 344 struct list_head list;
355 345
356 /* What hooks you will enter on */ 346 /* What hooks you will enter on */
@@ -371,8 +361,7 @@ struct xt_table
371#include <linux/netfilter_ipv4.h> 361#include <linux/netfilter_ipv4.h>
372 362
373/* The table itself */ 363/* The table itself */
374struct xt_table_info 364struct xt_table_info {
375{
376 /* Size per table */ 365 /* Size per table */
377 unsigned int size; 366 unsigned int size;
378 /* Number of entries: FIXME. --RR */ 367 /* Number of entries: FIXME. --RR */
@@ -528,8 +517,7 @@ static inline unsigned long ifname_compare_aligned(const char *_a,
528#ifdef CONFIG_COMPAT 517#ifdef CONFIG_COMPAT
529#include <net/compat.h> 518#include <net/compat.h>
530 519
531struct compat_xt_entry_match 520struct compat_xt_entry_match {
532{
533 union { 521 union {
534 struct { 522 struct {
535 u_int16_t match_size; 523 u_int16_t match_size;
@@ -545,8 +533,7 @@ struct compat_xt_entry_match
545 unsigned char data[0]; 533 unsigned char data[0];
546}; 534};
547 535
548struct compat_xt_entry_target 536struct compat_xt_entry_target {
549{
550 union { 537 union {
551 struct { 538 struct {
552 u_int16_t target_size; 539 u_int16_t target_size;
@@ -566,8 +553,7 @@ struct compat_xt_entry_target
566 * need to change whole approach in order to calculate align as function of 553 * need to change whole approach in order to calculate align as function of
567 * current task alignment */ 554 * current task alignment */
568 555
569struct compat_xt_counters 556struct compat_xt_counters {
570{
571#if defined(CONFIG_X86_64) || defined(CONFIG_IA64) 557#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
572 u_int32_t cnt[4]; 558 u_int32_t cnt[4];
573#else 559#else
@@ -575,8 +561,7 @@ struct compat_xt_counters
575#endif 561#endif
576}; 562};
577 563
578struct compat_xt_counters_info 564struct compat_xt_counters_info {
579{
580 char name[XT_TABLE_MAXNAMELEN]; 565 char name[XT_TABLE_MAXNAMELEN];
581 compat_uint_t num_counters; 566 compat_uint_t num_counters;
582 struct compat_xt_counters counters[0]; 567 struct compat_xt_counters counters[0];
diff --git a/include/linux/netfilter/xt_connbytes.h b/include/linux/netfilter/xt_connbytes.h
index 52bd6153b996..92fcbb0d193e 100644
--- a/include/linux/netfilter/xt_connbytes.h
+++ b/include/linux/netfilter/xt_connbytes.h
@@ -15,8 +15,7 @@ enum xt_connbytes_direction {
15 XT_CONNBYTES_DIR_BOTH, 15 XT_CONNBYTES_DIR_BOTH,
16}; 16};
17 17
18struct xt_connbytes_info 18struct xt_connbytes_info {
19{
20 struct { 19 struct {
21 aligned_u64 from; /* count to be matched */ 20 aligned_u64 from; /* count to be matched */
22 aligned_u64 to; /* count to be matched */ 21 aligned_u64 to; /* count to be matched */
diff --git a/include/linux/netfilter/xt_esp.h b/include/linux/netfilter/xt_esp.h
index ef6fa4747d0a..ee6882408000 100644
--- a/include/linux/netfilter/xt_esp.h
+++ b/include/linux/netfilter/xt_esp.h
@@ -3,8 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct xt_esp 6struct xt_esp {
7{
8 __u32 spis[2]; /* Security Parameter Index */ 7 __u32 spis[2]; /* Security Parameter Index */
9 __u8 invflags; /* Inverse flags */ 8 __u8 invflags; /* Inverse flags */
10}; 9};
diff --git a/include/linux/netfilter/xt_multiport.h b/include/linux/netfilter/xt_multiport.h
index 185db499fcbc..5b7e72dfffc5 100644
--- a/include/linux/netfilter/xt_multiport.h
+++ b/include/linux/netfilter/xt_multiport.h
@@ -3,8 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6enum xt_multiport_flags 6enum xt_multiport_flags {
7{
8 XT_MULTIPORT_SOURCE, 7 XT_MULTIPORT_SOURCE,
9 XT_MULTIPORT_DESTINATION, 8 XT_MULTIPORT_DESTINATION,
10 XT_MULTIPORT_EITHER 9 XT_MULTIPORT_EITHER
@@ -13,15 +12,13 @@ enum xt_multiport_flags
13#define XT_MULTI_PORTS 15 12#define XT_MULTI_PORTS 15
14 13
15/* Must fit inside union xt_matchinfo: 16 bytes */ 14/* Must fit inside union xt_matchinfo: 16 bytes */
16struct xt_multiport 15struct xt_multiport {
17{
18 __u8 flags; /* Type of comparison */ 16 __u8 flags; /* Type of comparison */
19 __u8 count; /* Number of ports */ 17 __u8 count; /* Number of ports */
20 __u16 ports[XT_MULTI_PORTS]; /* Ports */ 18 __u16 ports[XT_MULTI_PORTS]; /* Ports */
21}; 19};
22 20
23struct xt_multiport_v1 21struct xt_multiport_v1 {
24{
25 __u8 flags; /* Type of comparison */ 22 __u8 flags; /* Type of comparison */
26 __u8 count; /* Number of ports */ 23 __u8 count; /* Number of ports */
27 __u16 ports[XT_MULTI_PORTS]; /* Ports */ 24 __u16 ports[XT_MULTI_PORTS]; /* Ports */
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h
index 7bb64e7c853d..be8ead05c316 100644
--- a/include/linux/netfilter/xt_policy.h
+++ b/include/linux/netfilter/xt_policy.h
@@ -5,22 +5,19 @@
5 5
6#define XT_POLICY_MAX_ELEM 4 6#define XT_POLICY_MAX_ELEM 4
7 7
8enum xt_policy_flags 8enum xt_policy_flags {
9{
10 XT_POLICY_MATCH_IN = 0x1, 9 XT_POLICY_MATCH_IN = 0x1,
11 XT_POLICY_MATCH_OUT = 0x2, 10 XT_POLICY_MATCH_OUT = 0x2,
12 XT_POLICY_MATCH_NONE = 0x4, 11 XT_POLICY_MATCH_NONE = 0x4,
13 XT_POLICY_MATCH_STRICT = 0x8, 12 XT_POLICY_MATCH_STRICT = 0x8,
14}; 13};
15 14
16enum xt_policy_modes 15enum xt_policy_modes {
17{
18 XT_POLICY_MODE_TRANSPORT, 16 XT_POLICY_MODE_TRANSPORT,
19 XT_POLICY_MODE_TUNNEL 17 XT_POLICY_MODE_TUNNEL
20}; 18};
21 19
22struct xt_policy_spec 20struct xt_policy_spec {
23{
24 __u8 saddr:1, 21 __u8 saddr:1,
25 daddr:1, 22 daddr:1,
26 proto:1, 23 proto:1,
@@ -30,15 +27,13 @@ struct xt_policy_spec
30}; 27};
31 28
32#ifndef __KERNEL__ 29#ifndef __KERNEL__
33union xt_policy_addr 30union xt_policy_addr {
34{
35 struct in_addr a4; 31 struct in_addr a4;
36 struct in6_addr a6; 32 struct in6_addr a6;
37}; 33};
38#endif 34#endif
39 35
40struct xt_policy_elem 36struct xt_policy_elem {
41{
42 union { 37 union {
43#ifdef __KERNEL__ 38#ifdef __KERNEL__
44 struct { 39 struct {
@@ -65,8 +60,7 @@ struct xt_policy_elem
65 struct xt_policy_spec invert; 60 struct xt_policy_spec invert;
66}; 61};
67 62
68struct xt_policy_info 63struct xt_policy_info {
69{
70 struct xt_policy_elem pol[XT_POLICY_MAX_ELEM]; 64 struct xt_policy_elem pol[XT_POLICY_MAX_ELEM];
71 __u16 flags; 65 __u16 flags;
72 __u16 len; 66 __u16 len;
diff --git a/include/linux/netfilter/xt_state.h b/include/linux/netfilter/xt_state.h
index c06f32edee07..7b32de886613 100644
--- a/include/linux/netfilter/xt_state.h
+++ b/include/linux/netfilter/xt_state.h
@@ -6,8 +6,7 @@
6 6
7#define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1)) 7#define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1))
8 8
9struct xt_state_info 9struct xt_state_info {
10{
11 unsigned int statemask; 10 unsigned int statemask;
12}; 11};
13#endif /*_XT_STATE_H*/ 12#endif /*_XT_STATE_H*/
diff --git a/include/linux/netfilter/xt_string.h b/include/linux/netfilter/xt_string.h
index ecbb95fc89ed..235347c02eab 100644
--- a/include/linux/netfilter/xt_string.h
+++ b/include/linux/netfilter/xt_string.h
@@ -11,8 +11,7 @@ enum {
11 XT_STRING_FLAG_IGNORECASE = 0x02 11 XT_STRING_FLAG_IGNORECASE = 0x02
12}; 12};
13 13
14struct xt_string_info 14struct xt_string_info {
15{
16 __u16 from_offset; 15 __u16 from_offset;
17 __u16 to_offset; 16 __u16 to_offset;
18 char algo[XT_STRING_MAX_ALGO_NAME_SIZE]; 17 char algo[XT_STRING_MAX_ALGO_NAME_SIZE];
diff --git a/include/linux/netfilter/xt_tcpudp.h b/include/linux/netfilter/xt_tcpudp.h
index a490a0bc1d29..38aa7b399021 100644
--- a/include/linux/netfilter/xt_tcpudp.h
+++ b/include/linux/netfilter/xt_tcpudp.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6/* TCP matching stuff */ 6/* TCP matching stuff */
7struct xt_tcp 7struct xt_tcp {
8{
9 __u16 spts[2]; /* Source port range. */ 8 __u16 spts[2]; /* Source port range. */
10 __u16 dpts[2]; /* Destination port range. */ 9 __u16 dpts[2]; /* Destination port range. */
11 __u8 option; /* TCP Option iff non-zero*/ 10 __u8 option; /* TCP Option iff non-zero*/
@@ -22,8 +21,7 @@ struct xt_tcp
22#define XT_TCP_INV_MASK 0x0F /* All possible flags. */ 21#define XT_TCP_INV_MASK 0x0F /* All possible flags. */
23 22
24/* UDP matching stuff */ 23/* UDP matching stuff */
25struct xt_udp 24struct xt_udp {
26{
27 __u16 spts[2]; /* Source port range. */ 25 __u16 spts[2]; /* Source port range. */
28 __u16 dpts[2]; /* Destination port range. */ 26 __u16 dpts[2]; /* Destination port range. */
29 __u8 invflags; /* Inverse flags */ 27 __u8 invflags; /* Inverse flags */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 6fe3e6aa10db..f2336523a9df 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -132,8 +132,7 @@ struct arpt_entry
132#define ARPT_RETURN XT_RETURN 132#define ARPT_RETURN XT_RETURN
133 133
134/* The argument to ARPT_SO_GET_INFO */ 134/* The argument to ARPT_SO_GET_INFO */
135struct arpt_getinfo 135struct arpt_getinfo {
136{
137 /* Which table: caller fills this in. */ 136 /* Which table: caller fills this in. */
138 char name[ARPT_TABLE_MAXNAMELEN]; 137 char name[ARPT_TABLE_MAXNAMELEN];
139 138
@@ -155,8 +154,7 @@ struct arpt_getinfo
155}; 154};
156 155
157/* The argument to ARPT_SO_SET_REPLACE. */ 156/* The argument to ARPT_SO_SET_REPLACE. */
158struct arpt_replace 157struct arpt_replace {
159{
160 /* Which table. */ 158 /* Which table. */
161 char name[ARPT_TABLE_MAXNAMELEN]; 159 char name[ARPT_TABLE_MAXNAMELEN];
162 160
@@ -191,8 +189,7 @@ struct arpt_replace
191#define arpt_counters xt_counters 189#define arpt_counters xt_counters
192 190
193/* The argument to ARPT_SO_GET_ENTRIES. */ 191/* The argument to ARPT_SO_GET_ENTRIES. */
194struct arpt_get_entries 192struct arpt_get_entries {
195{
196 /* Which table: user fills this in. */ 193 /* Which table: user fills this in. */
197 char name[ARPT_TABLE_MAXNAMELEN]; 194 char name[ARPT_TABLE_MAXNAMELEN];
198 195
@@ -224,20 +221,17 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e
224#ifdef __KERNEL__ 221#ifdef __KERNEL__
225 222
226/* Standard entry. */ 223/* Standard entry. */
227struct arpt_standard 224struct arpt_standard {
228{
229 struct arpt_entry entry; 225 struct arpt_entry entry;
230 struct arpt_standard_target target; 226 struct arpt_standard_target target;
231}; 227};
232 228
233struct arpt_error_target 229struct arpt_error_target {
234{
235 struct arpt_entry_target target; 230 struct arpt_entry_target target;
236 char errorname[ARPT_FUNCTION_MAXNAMELEN]; 231 char errorname[ARPT_FUNCTION_MAXNAMELEN];
237}; 232};
238 233
239struct arpt_error 234struct arpt_error {
240{
241 struct arpt_entry entry; 235 struct arpt_entry entry;
242 struct arpt_error_target target; 236 struct arpt_error_target target;
243}; 237};
@@ -279,8 +273,7 @@ extern unsigned int arpt_do_table(struct sk_buff *skb,
279#ifdef CONFIG_COMPAT 273#ifdef CONFIG_COMPAT
280#include <net/compat.h> 274#include <net/compat.h>
281 275
282struct compat_arpt_entry 276struct compat_arpt_entry {
283{
284 struct arpt_arp arp; 277 struct arpt_arp arp;
285 u_int16_t target_offset; 278 u_int16_t target_offset;
286 u_int16_t next_offset; 279 u_int16_t next_offset;
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h
index a11b0c2017fd..c73ef0b18bdc 100644
--- a/include/linux/netfilter_bridge/ebt_802_3.h
+++ b/include/linux/netfilter_bridge/ebt_802_3.h
@@ -58,8 +58,7 @@ static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
58} 58}
59#endif 59#endif
60 60
61struct ebt_802_3_info 61struct ebt_802_3_info {
62{
63 uint8_t sap; 62 uint8_t sap;
64 __be16 type; 63 __be16 type;
65 uint8_t bitmask; 64 uint8_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_among.h b/include/linux/netfilter_bridge/ebt_among.h
index 7654069233ca..0009558609a7 100644
--- a/include/linux/netfilter_bridge/ebt_among.h
+++ b/include/linux/netfilter_bridge/ebt_among.h
@@ -29,14 +29,12 @@
29 * Yes, it is a memory overhead, but in 2003 AD, who cares? 29 * Yes, it is a memory overhead, but in 2003 AD, who cares?
30 */ 30 */
31 31
32struct ebt_mac_wormhash_tuple 32struct ebt_mac_wormhash_tuple {
33{
34 uint32_t cmp[2]; 33 uint32_t cmp[2];
35 __be32 ip; 34 __be32 ip;
36}; 35};
37 36
38struct ebt_mac_wormhash 37struct ebt_mac_wormhash {
39{
40 int table[257]; 38 int table[257];
41 int poolsize; 39 int poolsize;
42 struct ebt_mac_wormhash_tuple pool[0]; 40 struct ebt_mac_wormhash_tuple pool[0];
@@ -45,8 +43,7 @@ struct ebt_mac_wormhash
45#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \ 43#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
46 + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0) 44 + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0)
47 45
48struct ebt_among_info 46struct ebt_among_info {
49{
50 int wh_dst_ofs; 47 int wh_dst_ofs;
51 int wh_src_ofs; 48 int wh_src_ofs;
52 int bitmask; 49 int bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_arpreply.h b/include/linux/netfilter_bridge/ebt_arpreply.h
index 96a8339960e0..7e77896e1fbf 100644
--- a/include/linux/netfilter_bridge/ebt_arpreply.h
+++ b/include/linux/netfilter_bridge/ebt_arpreply.h
@@ -1,8 +1,7 @@
1#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H 1#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H
2#define __LINUX_BRIDGE_EBT_ARPREPLY_H 2#define __LINUX_BRIDGE_EBT_ARPREPLY_H
3 3
4struct ebt_arpreply_info 4struct ebt_arpreply_info {
5{
6 unsigned char mac[ETH_ALEN]; 5 unsigned char mac[ETH_ALEN];
7 int target; 6 int target;
8}; 7};
diff --git a/include/linux/netfilter_bridge/ebt_ip.h b/include/linux/netfilter_bridge/ebt_ip.h
index d6847475bf2e..6a708fb92241 100644
--- a/include/linux/netfilter_bridge/ebt_ip.h
+++ b/include/linux/netfilter_bridge/ebt_ip.h
@@ -26,8 +26,7 @@
26#define EBT_IP_MATCH "ip" 26#define EBT_IP_MATCH "ip"
27 27
28/* the same values are used for the invflags */ 28/* the same values are used for the invflags */
29struct ebt_ip_info 29struct ebt_ip_info {
30{
31 __be32 saddr; 30 __be32 saddr;
32 __be32 daddr; 31 __be32 daddr;
33 __be32 smsk; 32 __be32 smsk;
diff --git a/include/linux/netfilter_bridge/ebt_ip6.h b/include/linux/netfilter_bridge/ebt_ip6.h
index 2273c3ae33ca..e5de98701519 100644
--- a/include/linux/netfilter_bridge/ebt_ip6.h
+++ b/include/linux/netfilter_bridge/ebt_ip6.h
@@ -23,8 +23,7 @@
23#define EBT_IP6_MATCH "ip6" 23#define EBT_IP6_MATCH "ip6"
24 24
25/* the same values are used for the invflags */ 25/* the same values are used for the invflags */
26struct ebt_ip6_info 26struct ebt_ip6_info {
27{
28 struct in6_addr saddr; 27 struct in6_addr saddr;
29 struct in6_addr daddr; 28 struct in6_addr daddr;
30 struct in6_addr smsk; 29 struct in6_addr smsk;
diff --git a/include/linux/netfilter_bridge/ebt_limit.h b/include/linux/netfilter_bridge/ebt_limit.h
index d8b65000afe4..4bf76b751676 100644
--- a/include/linux/netfilter_bridge/ebt_limit.h
+++ b/include/linux/netfilter_bridge/ebt_limit.h
@@ -9,8 +9,7 @@
9/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 9/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
10 seconds, or one every 59 hours. */ 10 seconds, or one every 59 hours. */
11 11
12struct ebt_limit_info 12struct ebt_limit_info {
13{
14 u_int32_t avg; /* Average secs between packets * scale */ 13 u_int32_t avg; /* Average secs between packets * scale */
15 u_int32_t burst; /* Period multiplier for upper limit. */ 14 u_int32_t burst; /* Period multiplier for upper limit. */
16 15
diff --git a/include/linux/netfilter_bridge/ebt_log.h b/include/linux/netfilter_bridge/ebt_log.h
index b76e653157e5..cc2cdfb764bc 100644
--- a/include/linux/netfilter_bridge/ebt_log.h
+++ b/include/linux/netfilter_bridge/ebt_log.h
@@ -9,8 +9,7 @@
9#define EBT_LOG_PREFIX_SIZE 30 9#define EBT_LOG_PREFIX_SIZE 30
10#define EBT_LOG_WATCHER "log" 10#define EBT_LOG_WATCHER "log"
11 11
12struct ebt_log_info 12struct ebt_log_info {
13{
14 uint8_t loglevel; 13 uint8_t loglevel;
15 uint8_t prefix[EBT_LOG_PREFIX_SIZE]; 14 uint8_t prefix[EBT_LOG_PREFIX_SIZE];
16 uint32_t bitmask; 15 uint32_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_mark_m.h b/include/linux/netfilter_bridge/ebt_mark_m.h
index 301524ff1065..9ceb10ec0ed6 100644
--- a/include/linux/netfilter_bridge/ebt_mark_m.h
+++ b/include/linux/netfilter_bridge/ebt_mark_m.h
@@ -4,8 +4,7 @@
4#define EBT_MARK_AND 0x01 4#define EBT_MARK_AND 0x01
5#define EBT_MARK_OR 0x02 5#define EBT_MARK_OR 0x02
6#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR) 6#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
7struct ebt_mark_m_info 7struct ebt_mark_m_info {
8{
9 unsigned long mark, mask; 8 unsigned long mark, mask;
10 uint8_t invert; 9 uint8_t invert;
11 uint8_t bitmask; 10 uint8_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_mark_t.h b/include/linux/netfilter_bridge/ebt_mark_t.h
index 6270f6f33693..7d5a268a4311 100644
--- a/include/linux/netfilter_bridge/ebt_mark_t.h
+++ b/include/linux/netfilter_bridge/ebt_mark_t.h
@@ -13,8 +13,7 @@
13#define MARK_AND_VALUE (0xffffffd0) 13#define MARK_AND_VALUE (0xffffffd0)
14#define MARK_XOR_VALUE (0xffffffc0) 14#define MARK_XOR_VALUE (0xffffffc0)
15 15
16struct ebt_mark_t_info 16struct ebt_mark_t_info {
17{
18 unsigned long mark; 17 unsigned long mark;
19 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ 18 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
20 int target; 19 int target;
diff --git a/include/linux/netfilter_bridge/ebt_nat.h b/include/linux/netfilter_bridge/ebt_nat.h
index 435b886a51aa..5e74e3b03bd6 100644
--- a/include/linux/netfilter_bridge/ebt_nat.h
+++ b/include/linux/netfilter_bridge/ebt_nat.h
@@ -2,8 +2,7 @@
2#define __LINUX_BRIDGE_EBT_NAT_H 2#define __LINUX_BRIDGE_EBT_NAT_H
3 3
4#define NAT_ARP_BIT (0x00000010) 4#define NAT_ARP_BIT (0x00000010)
5struct ebt_nat_info 5struct ebt_nat_info {
6{
7 unsigned char mac[ETH_ALEN]; 6 unsigned char mac[ETH_ALEN];
8 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ 7 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
9 int target; 8 int target;
diff --git a/include/linux/netfilter_bridge/ebt_pkttype.h b/include/linux/netfilter_bridge/ebt_pkttype.h
index 0d64bbb29c66..51a799840931 100644
--- a/include/linux/netfilter_bridge/ebt_pkttype.h
+++ b/include/linux/netfilter_bridge/ebt_pkttype.h
@@ -1,8 +1,7 @@
1#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H 1#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H
2#define __LINUX_BRIDGE_EBT_PKTTYPE_H 2#define __LINUX_BRIDGE_EBT_PKTTYPE_H
3 3
4struct ebt_pkttype_info 4struct ebt_pkttype_info {
5{
6 uint8_t pkt_type; 5 uint8_t pkt_type;
7 uint8_t invert; 6 uint8_t invert;
8}; 7};
diff --git a/include/linux/netfilter_bridge/ebt_redirect.h b/include/linux/netfilter_bridge/ebt_redirect.h
index 5c67990fce39..dd9622ce8488 100644
--- a/include/linux/netfilter_bridge/ebt_redirect.h
+++ b/include/linux/netfilter_bridge/ebt_redirect.h
@@ -1,8 +1,7 @@
1#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H 1#ifndef __LINUX_BRIDGE_EBT_REDIRECT_H
2#define __LINUX_BRIDGE_EBT_REDIRECT_H 2#define __LINUX_BRIDGE_EBT_REDIRECT_H
3 3
4struct ebt_redirect_info 4struct ebt_redirect_info {
5{
6 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ 5 /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */
7 int target; 6 int target;
8}; 7};
diff --git a/include/linux/netfilter_bridge/ebt_stp.h b/include/linux/netfilter_bridge/ebt_stp.h
index e5fd67850f4d..e503a0aa2728 100644
--- a/include/linux/netfilter_bridge/ebt_stp.h
+++ b/include/linux/netfilter_bridge/ebt_stp.h
@@ -20,8 +20,7 @@
20 20
21#define EBT_STP_MATCH "stp" 21#define EBT_STP_MATCH "stp"
22 22
23struct ebt_stp_config_info 23struct ebt_stp_config_info {
24{
25 uint8_t flags; 24 uint8_t flags;
26 uint16_t root_priol, root_priou; 25 uint16_t root_priol, root_priou;
27 char root_addr[6], root_addrmsk[6]; 26 char root_addr[6], root_addrmsk[6];
@@ -35,8 +34,7 @@ struct ebt_stp_config_info
35 uint16_t forward_delayl, forward_delayu; 34 uint16_t forward_delayl, forward_delayu;
36}; 35};
37 36
38struct ebt_stp_info 37struct ebt_stp_info {
39{
40 uint8_t type; 38 uint8_t type;
41 struct ebt_stp_config_info config; 39 struct ebt_stp_config_info config;
42 uint16_t bitmask; 40 uint16_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index ea281e6a2048..3cc40c131cc3 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -34,14 +34,12 @@
34struct xt_match; 34struct xt_match;
35struct xt_target; 35struct xt_target;
36 36
37struct ebt_counter 37struct ebt_counter {
38{
39 uint64_t pcnt; 38 uint64_t pcnt;
40 uint64_t bcnt; 39 uint64_t bcnt;
41}; 40};
42 41
43struct ebt_replace 42struct ebt_replace {
44{
45 char name[EBT_TABLE_MAXNAMELEN]; 43 char name[EBT_TABLE_MAXNAMELEN];
46 unsigned int valid_hooks; 44 unsigned int valid_hooks;
47 /* nr of rules in the table */ 45 /* nr of rules in the table */
@@ -57,8 +55,7 @@ struct ebt_replace
57 char __user *entries; 55 char __user *entries;
58}; 56};
59 57
60struct ebt_replace_kernel 58struct ebt_replace_kernel {
61{
62 char name[EBT_TABLE_MAXNAMELEN]; 59 char name[EBT_TABLE_MAXNAMELEN];
63 unsigned int valid_hooks; 60 unsigned int valid_hooks;
64 /* nr of rules in the table */ 61 /* nr of rules in the table */
@@ -120,8 +117,7 @@ struct ebt_entries {
120#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \ 117#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
121 | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST) 118 | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
122 119
123struct ebt_entry_match 120struct ebt_entry_match {
124{
125 union { 121 union {
126 char name[EBT_FUNCTION_MAXNAMELEN]; 122 char name[EBT_FUNCTION_MAXNAMELEN];
127 struct xt_match *match; 123 struct xt_match *match;
@@ -131,8 +127,7 @@ struct ebt_entry_match
131 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); 127 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
132}; 128};
133 129
134struct ebt_entry_watcher 130struct ebt_entry_watcher {
135{
136 union { 131 union {
137 char name[EBT_FUNCTION_MAXNAMELEN]; 132 char name[EBT_FUNCTION_MAXNAMELEN];
138 struct xt_target *watcher; 133 struct xt_target *watcher;
@@ -142,8 +137,7 @@ struct ebt_entry_watcher
142 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); 137 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
143}; 138};
144 139
145struct ebt_entry_target 140struct ebt_entry_target {
146{
147 union { 141 union {
148 char name[EBT_FUNCTION_MAXNAMELEN]; 142 char name[EBT_FUNCTION_MAXNAMELEN];
149 struct xt_target *target; 143 struct xt_target *target;
@@ -154,8 +148,7 @@ struct ebt_entry_target
154}; 148};
155 149
156#define EBT_STANDARD_TARGET "standard" 150#define EBT_STANDARD_TARGET "standard"
157struct ebt_standard_target 151struct ebt_standard_target {
158{
159 struct ebt_entry_target target; 152 struct ebt_entry_target target;
160 int verdict; 153 int verdict;
161}; 154};
@@ -206,8 +199,7 @@ struct ebt_entry {
206#define EBT_MATCH 0 199#define EBT_MATCH 0
207#define EBT_NOMATCH 1 200#define EBT_NOMATCH 1
208 201
209struct ebt_match 202struct ebt_match {
210{
211 struct list_head list; 203 struct list_head list;
212 const char name[EBT_FUNCTION_MAXNAMELEN]; 204 const char name[EBT_FUNCTION_MAXNAMELEN];
213 bool (*match)(const struct sk_buff *skb, const struct net_device *in, 205 bool (*match)(const struct sk_buff *skb, const struct net_device *in,
@@ -224,8 +216,7 @@ struct ebt_match
224 struct module *me; 216 struct module *me;
225}; 217};
226 218
227struct ebt_watcher 219struct ebt_watcher {
228{
229 struct list_head list; 220 struct list_head list;
230 const char name[EBT_FUNCTION_MAXNAMELEN]; 221 const char name[EBT_FUNCTION_MAXNAMELEN];
231 unsigned int (*target)(struct sk_buff *skb, 222 unsigned int (*target)(struct sk_buff *skb,
@@ -242,8 +233,7 @@ struct ebt_watcher
242 struct module *me; 233 struct module *me;
243}; 234};
244 235
245struct ebt_target 236struct ebt_target {
246{
247 struct list_head list; 237 struct list_head list;
248 const char name[EBT_FUNCTION_MAXNAMELEN]; 238 const char name[EBT_FUNCTION_MAXNAMELEN];
249 /* returns one of the standard EBT_* verdicts */ 239 /* returns one of the standard EBT_* verdicts */
@@ -262,15 +252,13 @@ struct ebt_target
262}; 252};
263 253
264/* used for jumping from and into user defined chains (udc) */ 254/* used for jumping from and into user defined chains (udc) */
265struct ebt_chainstack 255struct ebt_chainstack {
266{
267 struct ebt_entries *chaininfo; /* pointer to chain data */ 256 struct ebt_entries *chaininfo; /* pointer to chain data */
268 struct ebt_entry *e; /* pointer to entry data */ 257 struct ebt_entry *e; /* pointer to entry data */
269 unsigned int n; /* n'th entry */ 258 unsigned int n; /* n'th entry */
270}; 259};
271 260
272struct ebt_table_info 261struct ebt_table_info {
273{
274 /* total size of the entries */ 262 /* total size of the entries */
275 unsigned int entries_size; 263 unsigned int entries_size;
276 unsigned int nentries; 264 unsigned int nentries;
@@ -282,8 +270,7 @@ struct ebt_table_info
282 struct ebt_counter counters[0] ____cacheline_aligned; 270 struct ebt_counter counters[0] ____cacheline_aligned;
283}; 271};
284 272
285struct ebt_table 273struct ebt_table {
286{
287 struct list_head list; 274 struct list_head list;
288 char name[EBT_TABLE_MAXNAMELEN]; 275 char name[EBT_TABLE_MAXNAMELEN];
289 struct ebt_replace_kernel *table; 276 struct ebt_replace_kernel *table;
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 61fafc868a7b..27b3f5807305 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -76,8 +76,7 @@ struct ipt_ip {
76/* This structure defines each of the firewall rules. Consists of 3 76/* This structure defines each of the firewall rules. Consists of 3
77 parts which are 1) general IP header stuff 2) match specific 77 parts which are 1) general IP header stuff 2) match specific
78 stuff 3) the target to perform if the rule matches */ 78 stuff 3) the target to perform if the rule matches */
79struct ipt_entry 79struct ipt_entry {
80{
81 struct ipt_ip ip; 80 struct ipt_ip ip;
82 81
83 /* Mark with fields that we care about. */ 82 /* Mark with fields that we care about. */
@@ -135,8 +134,7 @@ struct ipt_entry
135#define IPT_UDP_INV_MASK XT_UDP_INV_MASK 134#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
136 135
137/* ICMP matching stuff */ 136/* ICMP matching stuff */
138struct ipt_icmp 137struct ipt_icmp {
139{
140 u_int8_t type; /* type to match */ 138 u_int8_t type; /* type to match */
141 u_int8_t code[2]; /* range of code */ 139 u_int8_t code[2]; /* range of code */
142 u_int8_t invflags; /* Inverse flags */ 140 u_int8_t invflags; /* Inverse flags */
@@ -146,8 +144,7 @@ struct ipt_icmp
146#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */ 144#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */
147 145
148/* The argument to IPT_SO_GET_INFO */ 146/* The argument to IPT_SO_GET_INFO */
149struct ipt_getinfo 147struct ipt_getinfo {
150{
151 /* Which table: caller fills this in. */ 148 /* Which table: caller fills this in. */
152 char name[IPT_TABLE_MAXNAMELEN]; 149 char name[IPT_TABLE_MAXNAMELEN];
153 150
@@ -169,8 +166,7 @@ struct ipt_getinfo
169}; 166};
170 167
171/* The argument to IPT_SO_SET_REPLACE. */ 168/* The argument to IPT_SO_SET_REPLACE. */
172struct ipt_replace 169struct ipt_replace {
173{
174 /* Which table. */ 170 /* Which table. */
175 char name[IPT_TABLE_MAXNAMELEN]; 171 char name[IPT_TABLE_MAXNAMELEN];
176 172
@@ -204,8 +200,7 @@ struct ipt_replace
204#define ipt_counters_info xt_counters_info 200#define ipt_counters_info xt_counters_info
205 201
206/* The argument to IPT_SO_GET_ENTRIES. */ 202/* The argument to IPT_SO_GET_ENTRIES. */
207struct ipt_get_entries 203struct ipt_get_entries {
208{
209 /* Which table: user fills this in. */ 204 /* Which table: user fills this in. */
210 char name[IPT_TABLE_MAXNAMELEN]; 205 char name[IPT_TABLE_MAXNAMELEN];
211 206
@@ -250,20 +245,17 @@ extern struct xt_table *ipt_register_table(struct net *net,
250extern void ipt_unregister_table(struct xt_table *table); 245extern void ipt_unregister_table(struct xt_table *table);
251 246
252/* Standard entry. */ 247/* Standard entry. */
253struct ipt_standard 248struct ipt_standard {
254{
255 struct ipt_entry entry; 249 struct ipt_entry entry;
256 struct ipt_standard_target target; 250 struct ipt_standard_target target;
257}; 251};
258 252
259struct ipt_error_target 253struct ipt_error_target {
260{
261 struct ipt_entry_target target; 254 struct ipt_entry_target target;
262 char errorname[IPT_FUNCTION_MAXNAMELEN]; 255 char errorname[IPT_FUNCTION_MAXNAMELEN];
263}; 256};
264 257
265struct ipt_error 258struct ipt_error {
266{
267 struct ipt_entry entry; 259 struct ipt_entry entry;
268 struct ipt_error_target target; 260 struct ipt_error_target target;
269}; 261};
@@ -301,8 +293,7 @@ extern unsigned int ipt_do_table(struct sk_buff *skb,
301#ifdef CONFIG_COMPAT 293#ifdef CONFIG_COMPAT
302#include <net/compat.h> 294#include <net/compat.h>
303 295
304struct compat_ipt_entry 296struct compat_ipt_entry {
305{
306 struct ipt_ip ip; 297 struct ipt_ip ip;
307 compat_uint_t nfcache; 298 compat_uint_t nfcache;
308 u_int16_t target_offset; 299 u_int16_t target_offset;
diff --git a/include/linux/netfilter_ipv4/ipt_SAME.h b/include/linux/netfilter_ipv4/ipt_SAME.h
index be6e682a85ec..2529660c5b38 100644
--- a/include/linux/netfilter_ipv4/ipt_SAME.h
+++ b/include/linux/netfilter_ipv4/ipt_SAME.h
@@ -5,8 +5,7 @@
5 5
6#define IPT_SAME_NODST 0x01 6#define IPT_SAME_NODST 0x01
7 7
8struct ipt_same_info 8struct ipt_same_info {
9{
10 unsigned char info; 9 unsigned char info;
11 u_int32_t rangesize; 10 u_int32_t rangesize;
12 u_int32_t ipnum; 11 u_int32_t ipnum;
diff --git a/include/linux/netfilter_ipv4/ipt_ah.h b/include/linux/netfilter_ipv4/ipt_ah.h
index 7b9a2ac7adb9..2e555b4d05e3 100644
--- a/include/linux/netfilter_ipv4/ipt_ah.h
+++ b/include/linux/netfilter_ipv4/ipt_ah.h
@@ -1,8 +1,7 @@
1#ifndef _IPT_AH_H 1#ifndef _IPT_AH_H
2#define _IPT_AH_H 2#define _IPT_AH_H
3 3
4struct ipt_ah 4struct ipt_ah {
5{
6 u_int32_t spis[2]; /* Security Parameter Index */ 5 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int8_t invflags; /* Inverse flags */ 6 u_int8_t invflags; /* Inverse flags */
8}; 7};
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index a64e1451ac38..b31050d20ae4 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -88,8 +88,7 @@ struct ip6t_ip6 {
88/* This structure defines each of the firewall rules. Consists of 3 88/* This structure defines each of the firewall rules. Consists of 3
89 parts which are 1) general IP header stuff 2) match specific 89 parts which are 1) general IP header stuff 2) match specific
90 stuff 3) the target to perform if the rule matches */ 90 stuff 3) the target to perform if the rule matches */
91struct ip6t_entry 91struct ip6t_entry {
92{
93 struct ip6t_ip6 ipv6; 92 struct ip6t_ip6 ipv6;
94 93
95 /* Mark with fields that we care about. */ 94 /* Mark with fields that we care about. */
@@ -111,20 +110,17 @@ struct ip6t_entry
111}; 110};
112 111
113/* Standard entry */ 112/* Standard entry */
114struct ip6t_standard 113struct ip6t_standard {
115{
116 struct ip6t_entry entry; 114 struct ip6t_entry entry;
117 struct ip6t_standard_target target; 115 struct ip6t_standard_target target;
118}; 116};
119 117
120struct ip6t_error_target 118struct ip6t_error_target {
121{
122 struct ip6t_entry_target target; 119 struct ip6t_entry_target target;
123 char errorname[IP6T_FUNCTION_MAXNAMELEN]; 120 char errorname[IP6T_FUNCTION_MAXNAMELEN];
124}; 121};
125 122
126struct ip6t_error 123struct ip6t_error {
127{
128 struct ip6t_entry entry; 124 struct ip6t_entry entry;
129 struct ip6t_error_target target; 125 struct ip6t_error_target target;
130}; 126};
@@ -195,8 +191,7 @@ struct ip6t_error
195#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK 191#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
196 192
197/* ICMP matching stuff */ 193/* ICMP matching stuff */
198struct ip6t_icmp 194struct ip6t_icmp {
199{
200 u_int8_t type; /* type to match */ 195 u_int8_t type; /* type to match */
201 u_int8_t code[2]; /* range of code */ 196 u_int8_t code[2]; /* range of code */
202 u_int8_t invflags; /* Inverse flags */ 197 u_int8_t invflags; /* Inverse flags */
@@ -206,8 +201,7 @@ struct ip6t_icmp
206#define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */ 201#define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */
207 202
208/* The argument to IP6T_SO_GET_INFO */ 203/* The argument to IP6T_SO_GET_INFO */
209struct ip6t_getinfo 204struct ip6t_getinfo {
210{
211 /* Which table: caller fills this in. */ 205 /* Which table: caller fills this in. */
212 char name[IP6T_TABLE_MAXNAMELEN]; 206 char name[IP6T_TABLE_MAXNAMELEN];
213 207
@@ -229,8 +223,7 @@ struct ip6t_getinfo
229}; 223};
230 224
231/* The argument to IP6T_SO_SET_REPLACE. */ 225/* The argument to IP6T_SO_SET_REPLACE. */
232struct ip6t_replace 226struct ip6t_replace {
233{
234 /* Which table. */ 227 /* Which table. */
235 char name[IP6T_TABLE_MAXNAMELEN]; 228 char name[IP6T_TABLE_MAXNAMELEN];
236 229
@@ -264,8 +257,7 @@ struct ip6t_replace
264#define ip6t_counters_info xt_counters_info 257#define ip6t_counters_info xt_counters_info
265 258
266/* The argument to IP6T_SO_GET_ENTRIES. */ 259/* The argument to IP6T_SO_GET_ENTRIES. */
267struct ip6t_get_entries 260struct ip6t_get_entries {
268{
269 /* Which table: user fills this in. */ 261 /* Which table: user fills this in. */
270 char name[IP6T_TABLE_MAXNAMELEN]; 262 char name[IP6T_TABLE_MAXNAMELEN];
271 263
@@ -330,8 +322,7 @@ extern int ip6_masked_addrcmp(const struct in6_addr *addr1,
330#ifdef CONFIG_COMPAT 322#ifdef CONFIG_COMPAT
331#include <net/compat.h> 323#include <net/compat.h>
332 324
333struct compat_ip6t_entry 325struct compat_ip6t_entry {
334{
335 struct ip6t_ip6 ipv6; 326 struct ip6t_ip6 ipv6;
336 compat_uint_t nfcache; 327 compat_uint_t nfcache;
337 u_int16_t target_offset; 328 u_int16_t target_offset;
diff --git a/include/linux/netfilter_ipv6/ip6t_ah.h b/include/linux/netfilter_ipv6/ip6t_ah.h
index 8531879eb464..17a745cfb2c7 100644
--- a/include/linux/netfilter_ipv6/ip6t_ah.h
+++ b/include/linux/netfilter_ipv6/ip6t_ah.h
@@ -1,8 +1,7 @@
1#ifndef _IP6T_AH_H 1#ifndef _IP6T_AH_H
2#define _IP6T_AH_H 2#define _IP6T_AH_H
3 3
4struct ip6t_ah 4struct ip6t_ah {
5{
6 u_int32_t spis[2]; /* Security Parameter Index */ 5 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int32_t hdrlen; /* Header Length */ 6 u_int32_t hdrlen; /* Header Length */
8 u_int8_t hdrres; /* Test of the Reserved Filed */ 7 u_int8_t hdrres; /* Test of the Reserved Filed */
diff --git a/include/linux/netfilter_ipv6/ip6t_frag.h b/include/linux/netfilter_ipv6/ip6t_frag.h
index 66070a0d6dfc..3724d0850920 100644
--- a/include/linux/netfilter_ipv6/ip6t_frag.h
+++ b/include/linux/netfilter_ipv6/ip6t_frag.h
@@ -1,8 +1,7 @@
1#ifndef _IP6T_FRAG_H 1#ifndef _IP6T_FRAG_H
2#define _IP6T_FRAG_H 2#define _IP6T_FRAG_H
3 3
4struct ip6t_frag 4struct ip6t_frag {
5{
6 u_int32_t ids[2]; /* Security Parameter Index */ 5 u_int32_t ids[2]; /* Security Parameter Index */
7 u_int32_t hdrlen; /* Header Length */ 6 u_int32_t hdrlen; /* Header Length */
8 u_int8_t flags; /* */ 7 u_int8_t flags; /* */
diff --git a/include/linux/netfilter_ipv6/ip6t_ipv6header.h b/include/linux/netfilter_ipv6/ip6t_ipv6header.h
index 51c53fc9c44a..01dfd445596a 100644
--- a/include/linux/netfilter_ipv6/ip6t_ipv6header.h
+++ b/include/linux/netfilter_ipv6/ip6t_ipv6header.h
@@ -8,8 +8,7 @@ on whether they contain certain headers */
8#ifndef __IPV6HEADER_H 8#ifndef __IPV6HEADER_H
9#define __IPV6HEADER_H 9#define __IPV6HEADER_H
10 10
11struct ip6t_ipv6header_info 11struct ip6t_ipv6header_info {
12{
13 u_int8_t matchflags; 12 u_int8_t matchflags;
14 u_int8_t invflags; 13 u_int8_t invflags;
15 u_int8_t modeflag; 14 u_int8_t modeflag;
diff --git a/include/linux/netfilter_ipv6/ip6t_mh.h b/include/linux/netfilter_ipv6/ip6t_mh.h
index b9ca9a5f74d0..18549bca2d1f 100644
--- a/include/linux/netfilter_ipv6/ip6t_mh.h
+++ b/include/linux/netfilter_ipv6/ip6t_mh.h
@@ -2,8 +2,7 @@
2#define _IP6T_MH_H 2#define _IP6T_MH_H
3 3
4/* MH matching stuff */ 4/* MH matching stuff */
5struct ip6t_mh 5struct ip6t_mh {
6{
7 u_int8_t types[2]; /* MH type range */ 6 u_int8_t types[2]; /* MH type range */
8 u_int8_t invflags; /* Inverse flags */ 7 u_int8_t invflags; /* Inverse flags */
9}; 8};
diff --git a/include/linux/netfilter_ipv6/ip6t_opts.h b/include/linux/netfilter_ipv6/ip6t_opts.h
index a07e36380ae8..62d89bcd9f9c 100644
--- a/include/linux/netfilter_ipv6/ip6t_opts.h
+++ b/include/linux/netfilter_ipv6/ip6t_opts.h
@@ -3,8 +3,7 @@
3 3
4#define IP6T_OPTS_OPTSNR 16 4#define IP6T_OPTS_OPTSNR 16
5 5
6struct ip6t_opts 6struct ip6t_opts {
7{
8 u_int32_t hdrlen; /* Header Length */ 7 u_int32_t hdrlen; /* Header Length */
9 u_int8_t flags; /* */ 8 u_int8_t flags; /* */
10 u_int8_t invflags; /* Inverse flags */ 9 u_int8_t invflags; /* Inverse flags */
diff --git a/include/linux/netfilter_ipv6/ip6t_rt.h b/include/linux/netfilter_ipv6/ip6t_rt.h
index 52156023e8db..ab91bfd2cd00 100644
--- a/include/linux/netfilter_ipv6/ip6t_rt.h
+++ b/include/linux/netfilter_ipv6/ip6t_rt.h
@@ -5,8 +5,7 @@
5 5
6#define IP6T_RT_HOPS 16 6#define IP6T_RT_HOPS 16
7 7
8struct ip6t_rt 8struct ip6t_rt {
9{
10 u_int32_t rt_type; /* Routing Type */ 9 u_int32_t rt_type; /* Routing Type */
11 u_int32_t segsleft[2]; /* Segments Left */ 10 u_int32_t segsleft[2]; /* Segments Left */
12 u_int32_t hdrlen; /* Header Length */ 11 u_int32_t hdrlen; /* Header Length */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index ab5d3126831f..fde27c017326 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -29,16 +29,14 @@
29 29
30struct net; 30struct net;
31 31
32struct sockaddr_nl 32struct sockaddr_nl {
33{
34 sa_family_t nl_family; /* AF_NETLINK */ 33 sa_family_t nl_family; /* AF_NETLINK */
35 unsigned short nl_pad; /* zero */ 34 unsigned short nl_pad; /* zero */
36 __u32 nl_pid; /* port ID */ 35 __u32 nl_pid; /* port ID */
37 __u32 nl_groups; /* multicast groups mask */ 36 __u32 nl_groups; /* multicast groups mask */
38}; 37};
39 38
40struct nlmsghdr 39struct nlmsghdr {
41{
42 __u32 nlmsg_len; /* Length of message including header */ 40 __u32 nlmsg_len; /* Length of message including header */
43 __u16 nlmsg_type; /* Message content */ 41 __u16 nlmsg_type; /* Message content */
44 __u16 nlmsg_flags; /* Additional flags */ 42 __u16 nlmsg_flags; /* Additional flags */
@@ -94,8 +92,7 @@ struct nlmsghdr
94 92
95#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */ 93#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
96 94
97struct nlmsgerr 95struct nlmsgerr {
98{
99 int error; 96 int error;
100 struct nlmsghdr msg; 97 struct nlmsghdr msg;
101}; 98};
@@ -106,8 +103,7 @@ struct nlmsgerr
106#define NETLINK_BROADCAST_ERROR 4 103#define NETLINK_BROADCAST_ERROR 4
107#define NETLINK_NO_ENOBUFS 5 104#define NETLINK_NO_ENOBUFS 5
108 105
109struct nl_pktinfo 106struct nl_pktinfo {
110{
111 __u32 group; 107 __u32 group;
112}; 108};
113 109
@@ -127,8 +123,7 @@ enum {
127 * <-------------- nlattr->nla_len --------------> 123 * <-------------- nlattr->nla_len -------------->
128 */ 124 */
129 125
130struct nlattr 126struct nlattr {
131{
132 __u16 nla_len; 127 __u16 nla_len;
133 __u16 nla_type; 128 __u16 nla_type;
134}; 129};
@@ -161,8 +156,7 @@ static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
161 return (struct nlmsghdr *)skb->data; 156 return (struct nlmsghdr *)skb->data;
162} 157}
163 158
164struct netlink_skb_parms 159struct netlink_skb_parms {
165{
166 struct ucred creds; /* Skb credentials */ 160 struct ucred creds; /* Skb credentials */
167 __u32 pid; 161 __u32 pid;
168 __u32 dst_group; 162 __u32 dst_group;
@@ -220,8 +214,7 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
220#define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) 214#define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN)
221 215
222 216
223struct netlink_callback 217struct netlink_callback {
224{
225 struct sk_buff *skb; 218 struct sk_buff *skb;
226 const struct nlmsghdr *nlh; 219 const struct nlmsghdr *nlh;
227 int (*dump)(struct sk_buff * skb, 220 int (*dump)(struct sk_buff * skb,
@@ -231,8 +224,7 @@ struct netlink_callback
231 long args[6]; 224 long args[6];
232}; 225};
233 226
234struct netlink_notify 227struct netlink_notify {
235{
236 struct net *net; 228 struct net *net;
237 int pid; 229 int pid;
238 int protocol; 230 int protocol;
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index c4c060208109..9b8299af3741 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -128,6 +128,8 @@
128#define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040 128#define SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040
129#define SEQ4_STATUS_LEASE_MOVED 0x00000080 129#define SEQ4_STATUS_LEASE_MOVED 0x00000080
130#define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100 130#define SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100
131#define SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200
132#define SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400
131 133
132#define NFS4_MAX_UINT64 (~(u64)0) 134#define NFS4_MAX_UINT64 (~(u64)0)
133 135
@@ -528,6 +530,7 @@ enum {
528 NFSPROC4_CLNT_DESTROY_SESSION, 530 NFSPROC4_CLNT_DESTROY_SESSION,
529 NFSPROC4_CLNT_SEQUENCE, 531 NFSPROC4_CLNT_SEQUENCE,
530 NFSPROC4_CLNT_GET_LEASE_TIME, 532 NFSPROC4_CLNT_GET_LEASE_TIME,
533 NFSPROC4_CLNT_RECLAIM_COMPLETE,
531}; 534};
532 535
533/* nfs41 types */ 536/* nfs41 types */
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 320569eabe3b..34fc6be5bfcf 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -209,6 +209,7 @@ struct nfs4_session {
209 unsigned long session_state; 209 unsigned long session_state;
210 u32 hash_alg; 210 u32 hash_alg;
211 u32 ssv_len; 211 u32 ssv_len;
212 struct completion complete;
212 213
213 /* The fore and back channel */ 214 /* The fore and back channel */
214 struct nfs4_channel_attrs fc_attrs; 215 struct nfs4_channel_attrs fc_attrs;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 62f63fb0c4c8..51071b335751 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -170,8 +170,9 @@ struct nfs4_sequence_args {
170struct nfs4_sequence_res { 170struct nfs4_sequence_res {
171 struct nfs4_session *sr_session; 171 struct nfs4_session *sr_session;
172 u8 sr_slotid; /* slot used to send request */ 172 u8 sr_slotid; /* slot used to send request */
173 unsigned long sr_renewal_time;
174 int sr_status; /* sequence operation status */ 173 int sr_status; /* sequence operation status */
174 unsigned long sr_renewal_time;
175 u32 sr_status_flags;
175}; 176};
176 177
177struct nfs4_get_lease_time_args { 178struct nfs4_get_lease_time_args {
@@ -938,6 +939,16 @@ struct nfs41_create_session_args {
938struct nfs41_create_session_res { 939struct nfs41_create_session_res {
939 struct nfs_client *client; 940 struct nfs_client *client;
940}; 941};
942
943struct nfs41_reclaim_complete_args {
944 /* In the future extend to include curr_fh for use with migration */
945 unsigned char one_fs:1;
946 struct nfs4_sequence_args seq_args;
947};
948
949struct nfs41_reclaim_complete_res {
950 struct nfs4_sequence_res seq_res;
951};
941#endif /* CONFIG_NFS_V4_1 */ 952#endif /* CONFIG_NFS_V4_1 */
942 953
943struct nfs_page; 954struct nfs_page;
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h
index ce520402e840..3fe02cf8b65a 100644
--- a/include/linux/nilfs2_fs.h
+++ b/include/linux/nilfs2_fs.h
@@ -151,6 +151,8 @@ struct nilfs_super_root {
151#define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ 151#define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */
152#define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order 152#define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order
153 semantics also for data */ 153 semantics also for data */
154#define NILFS_MOUNT_NORECOVERY 0x4000 /* Disable write access during
155 mount-time recovery */
154 156
155 157
156/** 158/**
@@ -403,6 +405,28 @@ struct nilfs_segment_summary {
403#define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */ 405#define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */
404 406
405/** 407/**
408 * struct nilfs_btree_node - B-tree node
409 * @bn_flags: flags
410 * @bn_level: level
411 * @bn_nchildren: number of children
412 * @bn_pad: padding
413 */
414struct nilfs_btree_node {
415 __u8 bn_flags;
416 __u8 bn_level;
417 __le16 bn_nchildren;
418 __le32 bn_pad;
419};
420
421/* flags */
422#define NILFS_BTREE_NODE_ROOT 0x01
423
424/* level */
425#define NILFS_BTREE_LEVEL_DATA 0
426#define NILFS_BTREE_LEVEL_NODE_MIN (NILFS_BTREE_LEVEL_DATA + 1)
427#define NILFS_BTREE_LEVEL_MAX 14
428
429/**
406 * struct nilfs_palloc_group_desc - block group descriptor 430 * struct nilfs_palloc_group_desc - block group descriptor
407 * @pg_nfrees: number of free entries in block group 431 * @pg_nfrees: number of free entries in block group
408 */ 432 */
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index a8d71ed43a0e..da8ea2e19273 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -160,6 +160,11 @@
160 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, 160 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
161 * partial scan results may be available 161 * partial scan results may be available
162 * 162 *
163 * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation
164 * or noise level
165 * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
166 * NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
167 *
163 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain 168 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
164 * has been changed and provides details of the request information 169 * has been changed and provides details of the request information
165 * that caused the change such as who initiated the regulatory request 170 * that caused the change such as who initiated the regulatory request
@@ -341,6 +346,13 @@ enum nl80211_commands {
341 346
342 NL80211_CMD_SET_WIPHY_NETNS, 347 NL80211_CMD_SET_WIPHY_NETNS,
343 348
349 NL80211_CMD_GET_SURVEY,
350 NL80211_CMD_NEW_SURVEY_RESULTS,
351
352 NL80211_CMD_SET_PMKSA,
353 NL80211_CMD_DEL_PMKSA,
354 NL80211_CMD_FLUSH_PMKSA,
355
344 /* add new commands above here */ 356 /* add new commands above here */
345 357
346 /* used to define NL80211_CMD_MAX below */ 358 /* used to define NL80211_CMD_MAX below */
@@ -584,6 +596,16 @@ enum nl80211_commands {
584 * changed then the list changed and the dump should be repeated 596 * changed then the list changed and the dump should be repeated
585 * completely from scratch. 597 * completely from scratch.
586 * 598 *
599 * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface
600 *
601 * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of
602 * the survey response for %NL80211_CMD_GET_SURVEY, nested attribute
603 * containing info as possible, see &enum survey_info.
604 *
605 * @NL80211_ATTR_PMKID: PMK material for PMKSA caching.
606 * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
607 * cache, a wiphy attribute.
608 *
587 * @NL80211_ATTR_MAX: highest attribute number currently defined 609 * @NL80211_ATTR_MAX: highest attribute number currently defined
588 * @__NL80211_ATTR_AFTER_LAST: internal use 610 * @__NL80211_ATTR_AFTER_LAST: internal use
589 */ 611 */
@@ -714,6 +736,13 @@ enum nl80211_attrs {
714 736
715 NL80211_ATTR_PID, 737 NL80211_ATTR_PID,
716 738
739 NL80211_ATTR_4ADDR,
740
741 NL80211_ATTR_SURVEY_INFO,
742
743 NL80211_ATTR_PMKID,
744 NL80211_ATTR_MAX_NUM_PMKIDS,
745
717 /* add attributes here, update the policy in nl80211.c */ 746 /* add attributes here, update the policy in nl80211.c */
718 747
719 __NL80211_ATTR_AFTER_LAST, 748 __NL80211_ATTR_AFTER_LAST,
@@ -895,14 +924,14 @@ enum nl80211_sta_info {
895 * 924 *
896 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active 925 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
897 * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running 926 * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
898 * @NL80211_MPATH_FLAG_DSN_VALID: the mesh path contains a valid DSN 927 * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN
899 * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set 928 * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
900 * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded 929 * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
901 */ 930 */
902enum nl80211_mpath_flags { 931enum nl80211_mpath_flags {
903 NL80211_MPATH_FLAG_ACTIVE = 1<<0, 932 NL80211_MPATH_FLAG_ACTIVE = 1<<0,
904 NL80211_MPATH_FLAG_RESOLVING = 1<<1, 933 NL80211_MPATH_FLAG_RESOLVING = 1<<1,
905 NL80211_MPATH_FLAG_DSN_VALID = 1<<2, 934 NL80211_MPATH_FLAG_SN_VALID = 1<<2,
906 NL80211_MPATH_FLAG_FIXED = 1<<3, 935 NL80211_MPATH_FLAG_FIXED = 1<<3,
907 NL80211_MPATH_FLAG_RESOLVED = 1<<4, 936 NL80211_MPATH_FLAG_RESOLVED = 1<<4,
908}; 937};
@@ -915,7 +944,7 @@ enum nl80211_mpath_flags {
915 * 944 *
916 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved 945 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
917 * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination 946 * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination
918 * @NL80211_ATTR_MPATH_DSN: destination sequence number 947 * @NL80211_ATTR_MPATH_SN: destination sequence number
919 * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path 948 * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path
920 * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now 949 * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now
921 * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in 950 * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in
@@ -926,7 +955,7 @@ enum nl80211_mpath_flags {
926enum nl80211_mpath_info { 955enum nl80211_mpath_info {
927 __NL80211_MPATH_INFO_INVALID, 956 __NL80211_MPATH_INFO_INVALID,
928 NL80211_MPATH_INFO_FRAME_QLEN, 957 NL80211_MPATH_INFO_FRAME_QLEN,
929 NL80211_MPATH_INFO_DSN, 958 NL80211_MPATH_INFO_SN,
930 NL80211_MPATH_INFO_METRIC, 959 NL80211_MPATH_INFO_METRIC,
931 NL80211_MPATH_INFO_EXPTIME, 960 NL80211_MPATH_INFO_EXPTIME,
932 NL80211_MPATH_INFO_FLAGS, 961 NL80211_MPATH_INFO_FLAGS,
@@ -1117,6 +1146,26 @@ enum nl80211_reg_rule_flags {
1117}; 1146};
1118 1147
1119/** 1148/**
1149 * enum nl80211_survey_info - survey information
1150 *
1151 * These attribute types are used with %NL80211_ATTR_SURVEY_INFO
1152 * when getting information about a survey.
1153 *
1154 * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
1155 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
1156 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
1157 */
1158enum nl80211_survey_info {
1159 __NL80211_SURVEY_INFO_INVALID,
1160 NL80211_SURVEY_INFO_FREQUENCY,
1161 NL80211_SURVEY_INFO_NOISE,
1162
1163 /* keep last */
1164 __NL80211_SURVEY_INFO_AFTER_LAST,
1165 NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1
1166};
1167
1168/**
1120 * enum nl80211_mntr_flags - monitor configuration flags 1169 * enum nl80211_mntr_flags - monitor configuration flags
1121 * 1170 *
1122 * Monitor configuration flags. 1171 * Monitor configuration flags.
@@ -1196,6 +1245,8 @@ enum nl80211_mntr_flags {
1196 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) 1245 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
1197 * that it takes for an HWMP information element to propagate across the mesh 1246 * that it takes for an HWMP information element to propagate across the mesh
1198 * 1247 *
1248 * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not
1249 *
1199 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute 1250 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
1200 * 1251 *
1201 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 1252 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
@@ -1215,6 +1266,7 @@ enum nl80211_meshconf_params {
1215 NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, 1266 NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
1216 NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, 1267 NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
1217 NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, 1268 NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
1269 NL80211_MESHCONF_HWMP_ROOTMODE,
1218 1270
1219 /* keep last */ 1271 /* keep last */
1220 __NL80211_MESHCONF_ATTR_AFTER_LAST, 1272 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -1277,6 +1329,7 @@ enum nl80211_channel_type {
1277 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon 1329 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
1278 * in unspecified units, scaled to 0..100 (u8) 1330 * in unspecified units, scaled to 0..100 (u8)
1279 * @NL80211_BSS_STATUS: status, if this BSS is "used" 1331 * @NL80211_BSS_STATUS: status, if this BSS is "used"
1332 * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
1280 * @__NL80211_BSS_AFTER_LAST: internal 1333 * @__NL80211_BSS_AFTER_LAST: internal
1281 * @NL80211_BSS_MAX: highest BSS attribute 1334 * @NL80211_BSS_MAX: highest BSS attribute
1282 */ 1335 */
@@ -1291,6 +1344,7 @@ enum nl80211_bss {
1291 NL80211_BSS_SIGNAL_MBM, 1344 NL80211_BSS_SIGNAL_MBM,
1292 NL80211_BSS_SIGNAL_UNSPEC, 1345 NL80211_BSS_SIGNAL_UNSPEC,
1293 NL80211_BSS_STATUS, 1346 NL80211_BSS_STATUS,
1347 NL80211_BSS_SEEN_MS_AGO,
1294 1348
1295 /* keep last */ 1349 /* keep last */
1296 __NL80211_BSS_AFTER_LAST, 1350 __NL80211_BSS_AFTER_LAST,
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h
index b7d9435d5a9f..33d9f5175109 100644
--- a/include/linux/nl802154.h
+++ b/include/linux/nl802154.h
@@ -65,6 +65,9 @@ enum {
65 IEEE802154_ATTR_SEC, 65 IEEE802154_ATTR_SEC,
66 66
67 IEEE802154_ATTR_PAGE, 67 IEEE802154_ATTR_PAGE,
68 IEEE802154_ATTR_CHANNEL_PAGE_LIST,
69
70 IEEE802154_ATTR_PHY_NAME,
68 71
69 __IEEE802154_ATTR_MAX, 72 __IEEE802154_ATTR_MAX,
70}; 73};
@@ -114,6 +117,9 @@ enum {
114 IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ 117 IEEE802154_RX_ENABLE_CONF, /* Not supported yet */
115 118
116 IEEE802154_LIST_IFACE, 119 IEEE802154_LIST_IFACE,
120 IEEE802154_LIST_PHY,
121 IEEE802154_ADD_IFACE,
122 IEEE802154_DEL_IFACE,
117 123
118 __IEEE802154_CMD_MAX, 124 __IEEE802154_CMD_MAX,
119}; 125};
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 44428d247dbe..fee6c2f68075 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -201,6 +201,8 @@ static inline int notifier_to_errno(int ret)
201#define NETDEV_PRE_UP 0x000D 201#define NETDEV_PRE_UP 0x000D
202#define NETDEV_BONDING_OLDTYPE 0x000E 202#define NETDEV_BONDING_OLDTYPE 0x000E
203#define NETDEV_BONDING_NEWTYPE 0x000F 203#define NETDEV_BONDING_NEWTYPE 0x000F
204#define NETDEV_POST_INIT 0x0010
205#define NETDEV_UNREGISTER_BATCH 0x0011
204 206
205#define SYS_DOWN 0x0001 /* Notify of system down */ 207#define SYS_DOWN 0x0001 /* Notify of system down */
206#define SYS_RESTART SYS_DOWN 208#define SYS_RESTART SYS_DOWN
diff --git a/include/linux/of.h b/include/linux/of.h
index 7be2d1043c16..e7facd8fbce8 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -17,14 +17,117 @@
17 */ 17 */
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/kref.h>
20#include <linux/mod_devicetable.h> 21#include <linux/mod_devicetable.h>
21 22
23typedef u32 phandle;
24typedef u32 ihandle;
25
26struct property {
27 char *name;
28 int length;
29 void *value;
30 struct property *next;
31 unsigned long _flags;
32 unsigned int unique_id;
33};
34
35#if defined(CONFIG_SPARC)
36struct of_irq_controller;
37#endif
38
39struct device_node {
40 const char *name;
41 const char *type;
42 phandle node;
43#if !defined(CONFIG_SPARC)
44 phandle linux_phandle;
45#endif
46 char *full_name;
47
48 struct property *properties;
49 struct property *deadprops; /* removed properties */
50 struct device_node *parent;
51 struct device_node *child;
52 struct device_node *sibling;
53 struct device_node *next; /* next device of same type */
54 struct device_node *allnext; /* next in list of all nodes */
55 struct proc_dir_entry *pde; /* this node's proc directory */
56 struct kref kref;
57 unsigned long _flags;
58 void *data;
59#if defined(CONFIG_SPARC)
60 char *path_component_name;
61 unsigned int unique_id;
62 struct of_irq_controller *irq_trans;
63#endif
64};
65
66static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
67{
68 return test_bit(flag, &n->_flags);
69}
70
71static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
72{
73 set_bit(flag, &n->_flags);
74}
75
76static inline void
77set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
78{
79 dn->pde = de;
80}
81
82extern struct device_node *of_find_all_nodes(struct device_node *prev);
83
84#if defined(CONFIG_SPARC)
85/* Dummy ref counting routines - to be implemented later */
86static inline struct device_node *of_node_get(struct device_node *node)
87{
88 return node;
89}
90static inline void of_node_put(struct device_node *node)
91{
92}
93
94#else
95extern struct device_node *of_node_get(struct device_node *node);
96extern void of_node_put(struct device_node *node);
97#endif
98
99/*
100 * OF address retreival & translation
101 */
102
103/* Helper to read a big number; size is in cells (not bytes) */
104static inline u64 of_read_number(const u32 *cell, int size)
105{
106 u64 r = 0;
107 while (size--)
108 r = (r << 32) | *(cell++);
109 return r;
110}
111
112/* Like of_read_number, but we want an unsigned long result */
113#ifdef CONFIG_PPC32
114static inline unsigned long of_read_ulong(const u32 *cell, int size)
115{
116 return cell[size-1];
117}
118#else
119#define of_read_ulong(cell, size) of_read_number(cell, size)
120#endif
121
22#include <asm/prom.h> 122#include <asm/prom.h>
23 123
24/* flag descriptions */ 124/* flag descriptions */
25#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ 125#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
26#define OF_DETACHED 2 /* node has been detached from the device tree */ 126#define OF_DETACHED 2 /* node has been detached from the device tree */
27 127
128#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
129#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
130
28#define OF_BAD_ADDR ((u64)-1) 131#define OF_BAD_ADDR ((u64)-1)
29 132
30extern struct device_node *of_find_node_by_name(struct device_node *from, 133extern struct device_node *of_find_node_by_name(struct device_node *from,
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
new file mode 100644
index 000000000000..41d432b13553
--- /dev/null
+++ b/include/linux/of_fdt.h
@@ -0,0 +1,86 @@
1/*
2 * Definitions for working with the Flattened Device Tree data format
3 *
4 * Copyright 2009 Benjamin Herrenschmidt, IBM Corp
5 * benh@kernel.crashing.org
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 */
11
12#ifndef _LINUX_OF_FDT_H
13#define _LINUX_OF_FDT_H
14
15#include <linux/types.h>
16#include <linux/init.h>
17
18/* Definitions used by the flattened device tree */
19#define OF_DT_HEADER 0xd00dfeed /* marker */
20#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
21#define OF_DT_END_NODE 0x2 /* End node */
22#define OF_DT_PROP 0x3 /* Property: name off, size,
23 * content */
24#define OF_DT_NOP 0x4 /* nop */
25#define OF_DT_END 0x9
26
27#define OF_DT_VERSION 0x10
28
29#ifndef __ASSEMBLY__
30/*
31 * This is what gets passed to the kernel by prom_init or kexec
32 *
33 * The dt struct contains the device tree structure, full pathes and
34 * property contents. The dt strings contain a separate block with just
35 * the strings for the property names, and is fully page aligned and
36 * self contained in a page, so that it can be kept around by the kernel,
37 * each property name appears only once in this page (cheap compression)
38 *
39 * the mem_rsvmap contains a map of reserved ranges of physical memory,
40 * passing it here instead of in the device-tree itself greatly simplifies
41 * the job of everybody. It's just a list of u64 pairs (base/size) that
42 * ends when size is 0
43 */
44struct boot_param_header {
45 u32 magic; /* magic word OF_DT_HEADER */
46 u32 totalsize; /* total size of DT block */
47 u32 off_dt_struct; /* offset to structure */
48 u32 off_dt_strings; /* offset to strings */
49 u32 off_mem_rsvmap; /* offset to memory reserve map */
50 u32 version; /* format version */
51 u32 last_comp_version; /* last compatible version */
52 /* version 2 fields below */
53 u32 boot_cpuid_phys; /* Physical CPU id we're booting on */
54 /* version 3 fields below */
55 u32 dt_strings_size; /* size of the DT strings block */
56 /* version 17 fields below */
57 u32 dt_struct_size; /* size of the DT structure block */
58};
59
60/* For scanning the flat device-tree at boot time */
61extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
62 const char *uname, int depth,
63 void *data),
64 void *data);
65extern void __init *of_get_flat_dt_prop(unsigned long node, const char *name,
66 unsigned long *size);
67extern int __init of_flat_dt_is_compatible(unsigned long node,
68 const char *name);
69extern unsigned long __init of_get_flat_dt_root(void);
70
71/* Other Prototypes */
72extern void finish_device_tree(void);
73extern void unflatten_device_tree(void);
74extern void early_init_devtree(void *);
75extern int machine_is_compatible(const char *compat);
76extern void print_properties(struct device_node *node);
77extern int prom_n_intr_cells(struct device_node* np);
78extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
79extern int prom_add_property(struct device_node* np, struct property* prop);
80extern int prom_remove_property(struct device_node *np, struct property *prop);
81extern int prom_update_property(struct device_node *np,
82 struct property *newprop,
83 struct property *oldprop);
84
85#endif /* __ASSEMBLY__ */
86#endif /* _LINUX_OF_FDT_H */
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
new file mode 100644
index 000000000000..f46c40ac6d45
--- /dev/null
+++ b/include/linux/omapfb.h
@@ -0,0 +1,251 @@
1/*
2 * File: include/linux/omapfb.h
3 *
4 * Framebuffer driver for TI OMAP boards
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 * Author: Imre Deak <imre.deak@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __LINUX_OMAPFB_H__
25#define __LINUX_OMAPFB_H__
26
27#include <linux/fb.h>
28#include <linux/ioctl.h>
29#include <linux/types.h>
30
31/* IOCTL commands. */
32
33#define OMAP_IOW(num, dtype) _IOW('O', num, dtype)
34#define OMAP_IOR(num, dtype) _IOR('O', num, dtype)
35#define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype)
36#define OMAP_IO(num) _IO('O', num)
37
38#define OMAPFB_MIRROR OMAP_IOW(31, int)
39#define OMAPFB_SYNC_GFX OMAP_IO(37)
40#define OMAPFB_VSYNC OMAP_IO(38)
41#define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int)
42#define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps)
43#define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int)
44#define OMAPFB_LCD_TEST OMAP_IOW(45, int)
45#define OMAPFB_CTRL_TEST OMAP_IOW(46, int)
46#define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old)
47#define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key)
48#define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key)
49#define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info)
50#define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info)
51#define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window)
52#define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info)
53#define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info)
54#define OMAPFB_WAITFORVSYNC OMAP_IO(57)
55#define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read)
56#define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode)
57#define OMAPFB_WAITFORGO OMAP_IO(60)
58#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info)
59#define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info)
60
61#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
62#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
63#define OMAPFB_CAPS_PANEL_MASK 0xff000000
64
65#define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000
66#define OMAPFB_CAPS_TEARSYNC 0x00002000
67#define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000
68#define OMAPFB_CAPS_PLANE_SCALE 0x00008000
69#define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000
70#define OMAPFB_CAPS_WINDOW_SCALE 0x00020000
71#define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000
72#define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000
73#define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000
74
75/* Values from DSP must map to lower 16-bits */
76#define OMAPFB_FORMAT_MASK 0x00ff
77#define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100
78#define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200
79#define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400
80#define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800
81#define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000
82
83#define OMAPFB_MEMTYPE_SDRAM 0
84#define OMAPFB_MEMTYPE_SRAM 1
85#define OMAPFB_MEMTYPE_MAX 1
86
87enum omapfb_color_format {
88 OMAPFB_COLOR_RGB565 = 0,
89 OMAPFB_COLOR_YUV422,
90 OMAPFB_COLOR_YUV420,
91 OMAPFB_COLOR_CLUT_8BPP,
92 OMAPFB_COLOR_CLUT_4BPP,
93 OMAPFB_COLOR_CLUT_2BPP,
94 OMAPFB_COLOR_CLUT_1BPP,
95 OMAPFB_COLOR_RGB444,
96 OMAPFB_COLOR_YUY422,
97
98 OMAPFB_COLOR_ARGB16,
99 OMAPFB_COLOR_RGB24U, /* RGB24, 32-bit container */
100 OMAPFB_COLOR_RGB24P, /* RGB24, 24-bit container */
101 OMAPFB_COLOR_ARGB32,
102 OMAPFB_COLOR_RGBA32,
103 OMAPFB_COLOR_RGBX32,
104};
105
106struct omapfb_update_window {
107 __u32 x, y;
108 __u32 width, height;
109 __u32 format;
110 __u32 out_x, out_y;
111 __u32 out_width, out_height;
112 __u32 reserved[8];
113};
114
115struct omapfb_update_window_old {
116 __u32 x, y;
117 __u32 width, height;
118 __u32 format;
119};
120
121enum omapfb_plane {
122 OMAPFB_PLANE_GFX = 0,
123 OMAPFB_PLANE_VID1,
124 OMAPFB_PLANE_VID2,
125};
126
127enum omapfb_channel_out {
128 OMAPFB_CHANNEL_OUT_LCD = 0,
129 OMAPFB_CHANNEL_OUT_DIGIT,
130};
131
132struct omapfb_plane_info {
133 __u32 pos_x;
134 __u32 pos_y;
135 __u8 enabled;
136 __u8 channel_out;
137 __u8 mirror;
138 __u8 reserved1;
139 __u32 out_width;
140 __u32 out_height;
141 __u32 reserved2[12];
142};
143
144struct omapfb_mem_info {
145 __u32 size;
146 __u8 type;
147 __u8 reserved[3];
148};
149
150struct omapfb_caps {
151 __u32 ctrl;
152 __u32 plane_color;
153 __u32 wnd_color;
154};
155
156enum omapfb_color_key_type {
157 OMAPFB_COLOR_KEY_DISABLED = 0,
158 OMAPFB_COLOR_KEY_GFX_DST,
159 OMAPFB_COLOR_KEY_VID_SRC,
160};
161
162struct omapfb_color_key {
163 __u8 channel_out;
164 __u32 background;
165 __u32 trans_key;
166 __u8 key_type;
167};
168
169enum omapfb_update_mode {
170 OMAPFB_UPDATE_DISABLED = 0,
171 OMAPFB_AUTO_UPDATE,
172 OMAPFB_MANUAL_UPDATE
173};
174
175struct omapfb_memory_read {
176 __u16 x;
177 __u16 y;
178 __u16 w;
179 __u16 h;
180 size_t buffer_size;
181 void __user *buffer;
182};
183
184struct omapfb_ovl_colormode {
185 __u8 overlay_idx;
186 __u8 mode_idx;
187 __u32 bits_per_pixel;
188 __u32 nonstd;
189 struct fb_bitfield red;
190 struct fb_bitfield green;
191 struct fb_bitfield blue;
192 struct fb_bitfield transp;
193};
194
195struct omapfb_vram_info {
196 __u32 total;
197 __u32 free;
198 __u32 largest_free_block;
199 __u32 reserved[5];
200};
201
202struct omapfb_tearsync_info {
203 __u8 enabled;
204 __u8 reserved1[3];
205 __u16 line;
206 __u16 reserved2;
207};
208
209#ifdef __KERNEL__
210
211#include <plat/board.h>
212
213#ifdef CONFIG_ARCH_OMAP1
214#define OMAPFB_PLANE_NUM 1
215#else
216#define OMAPFB_PLANE_NUM 3
217#endif
218
219struct omapfb_mem_region {
220 u32 paddr;
221 void __iomem *vaddr;
222 unsigned long size;
223 u8 type; /* OMAPFB_PLANE_MEM_* */
224 enum omapfb_color_format format;/* OMAPFB_COLOR_* */
225 unsigned format_used:1; /* Must be set when format is set.
226 * Needed b/c of the badly chosen 0
227 * base for OMAPFB_COLOR_* values
228 */
229 unsigned alloc:1; /* allocated by the driver */
230 unsigned map:1; /* kernel mapped by the driver */
231};
232
233struct omapfb_mem_desc {
234 int region_cnt;
235 struct omapfb_mem_region region[OMAPFB_PLANE_NUM];
236};
237
238struct omapfb_platform_data {
239 struct omap_lcd_config lcd;
240 struct omapfb_mem_desc mem_desc;
241 void *ctrl_platform_data;
242};
243
244/* in arch/arm/plat-omap/fb.c */
245extern void omapfb_set_platform_data(struct omapfb_platform_data *data);
246extern void omapfb_set_ctrl_platform_data(void *pdata);
247extern void omapfb_reserve_sdram(void);
248
249#endif
250
251#endif /* __OMAPFB_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index f5c7cd343e56..bf1e67080849 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -218,6 +218,7 @@ struct pci_dev {
218 unsigned int class; /* 3 bytes: (base,sub,prog-if) */ 218 unsigned int class; /* 3 bytes: (base,sub,prog-if) */
219 u8 revision; /* PCI revision, low byte of class word */ 219 u8 revision; /* PCI revision, low byte of class word */
220 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 220 u8 hdr_type; /* PCI header type (`multi' flag masked out) */
221 u8 pcie_cap; /* PCI-E capability offset */
221 u8 pcie_type; /* PCI-E device/port type */ 222 u8 pcie_type; /* PCI-E device/port type */
222 u8 rom_base_reg; /* which config register controls the ROM */ 223 u8 rom_base_reg; /* which config register controls the ROM */
223 u8 pin; /* which interrupt pin this device uses */ 224 u8 pin; /* which interrupt pin this device uses */
@@ -280,6 +281,7 @@ struct pci_dev {
280 unsigned int is_virtfn:1; 281 unsigned int is_virtfn:1;
281 unsigned int reset_fn:1; 282 unsigned int reset_fn:1;
282 unsigned int is_hotplug_bridge:1; 283 unsigned int is_hotplug_bridge:1;
284 unsigned int aer_firmware_first:1;
283 pci_dev_flags_t dev_flags; 285 pci_dev_flags_t dev_flags;
284 atomic_t enable_cnt; /* pci_enable_device has been called */ 286 atomic_t enable_cnt; /* pci_enable_device has been called */
285 287
@@ -635,7 +637,13 @@ struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
635 unsigned int ss_vendor, unsigned int ss_device, 637 unsigned int ss_vendor, unsigned int ss_device,
636 struct pci_dev *from); 638 struct pci_dev *from);
637struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); 639struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
638struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); 640struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus,
641 unsigned int devfn);
642static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
643 unsigned int devfn)
644{
645 return pci_get_domain_bus_and_slot(0, bus, devfn);
646}
639struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); 647struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
640int pci_dev_present(const struct pci_device_id *ids); 648int pci_dev_present(const struct pci_device_id *ids);
641 649
@@ -701,6 +709,7 @@ void pci_disable_device(struct pci_dev *dev);
701void pci_set_master(struct pci_dev *dev); 709void pci_set_master(struct pci_dev *dev);
702void pci_clear_master(struct pci_dev *dev); 710void pci_clear_master(struct pci_dev *dev);
703int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); 711int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state);
712int pci_set_cacheline_size(struct pci_dev *dev);
704#define HAVE_PCI_SET_MWI 713#define HAVE_PCI_SET_MWI
705int __must_check pci_set_mwi(struct pci_dev *dev); 714int __must_check pci_set_mwi(struct pci_dev *dev);
706int pci_try_set_mwi(struct pci_dev *dev); 715int pci_try_set_mwi(struct pci_dev *dev);
@@ -1246,6 +1255,8 @@ extern int pci_pci_problems;
1246 1255
1247extern unsigned long pci_cardbus_io_size; 1256extern unsigned long pci_cardbus_io_size;
1248extern unsigned long pci_cardbus_mem_size; 1257extern unsigned long pci_cardbus_mem_size;
1258extern u8 __devinitdata pci_dfl_cache_line_size;
1259extern u8 pci_cache_line_size;
1249 1260
1250extern unsigned long pci_hotplug_io_size; 1261extern unsigned long pci_hotplug_io_size;
1251extern unsigned long pci_hotplug_mem_size; 1262extern unsigned long pci_hotplug_mem_size;
@@ -1290,5 +1301,34 @@ extern void pci_hp_create_module_link(struct pci_slot *pci_slot);
1290extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); 1301extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
1291#endif 1302#endif
1292 1303
1304/**
1305 * pci_pcie_cap - get the saved PCIe capability offset
1306 * @dev: PCI device
1307 *
1308 * PCIe capability offset is calculated at PCI device initialization
1309 * time and saved in the data structure. This function returns saved
1310 * PCIe capability offset. Using this instead of pci_find_capability()
1311 * reduces unnecessary search in the PCI configuration space. If you
1312 * need to calculate PCIe capability offset from raw device for some
1313 * reasons, please use pci_find_capability() instead.
1314 */
1315static inline int pci_pcie_cap(struct pci_dev *dev)
1316{
1317 return dev->pcie_cap;
1318}
1319
1320/**
1321 * pci_is_pcie - check if the PCI device is PCI Express capable
1322 * @dev: PCI device
1323 *
1324 * Retrun true if the PCI device is PCI Express capable, false otherwise.
1325 */
1326static inline bool pci_is_pcie(struct pci_dev *dev)
1327{
1328 return !!pci_pcie_cap(dev);
1329}
1330
1331void pci_request_acs(void);
1332
1293#endif /* __KERNEL__ */ 1333#endif /* __KERNEL__ */
1294#endif /* LINUX_PCI_H */ 1334#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 84cf1f3b7838..cca8a044e2b6 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1496,9 +1496,10 @@
1496#define PCI_DEVICE_ID_SBE_WANXL400 0x0104 1496#define PCI_DEVICE_ID_SBE_WANXL400 0x0104
1497 1497
1498#define PCI_VENDOR_ID_TOSHIBA 0x1179 1498#define PCI_VENDOR_ID_TOSHIBA 0x1179
1499#define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102 1499#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0101
1500#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103 1500#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0102
1501#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105 1501#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_3 0x0103
1502#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_5 0x0105
1502#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a 1503#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a
1503#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f 1504#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f
1504#define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617 1505#define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617
@@ -1586,6 +1587,8 @@
1586#define PCI_VENDOR_ID_COMPEX 0x11f6 1587#define PCI_VENDOR_ID_COMPEX 0x11f6
1587#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 1588#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112
1588 1589
1590#define PCI_VENDOR_ID_PMC_Sierra 0x11f8
1591
1589#define PCI_VENDOR_ID_RP 0x11fe 1592#define PCI_VENDOR_ID_RP 0x11fe
1590#define PCI_DEVICE_ID_RP32INTF 0x0001 1593#define PCI_DEVICE_ID_RP32INTF 0x0001
1591#define PCI_DEVICE_ID_RP8INTF 0x0002 1594#define PCI_DEVICE_ID_RP8INTF 0x0002
@@ -1633,6 +1636,8 @@
1633#define PCI_DEVICE_ID_O2_6730 0x673a 1636#define PCI_DEVICE_ID_O2_6730 0x673a
1634#define PCI_DEVICE_ID_O2_6832 0x6832 1637#define PCI_DEVICE_ID_O2_6832 0x6832
1635#define PCI_DEVICE_ID_O2_6836 0x6836 1638#define PCI_DEVICE_ID_O2_6836 0x6836
1639#define PCI_DEVICE_ID_O2_6812 0x6872
1640#define PCI_DEVICE_ID_O2_6933 0x6933
1636 1641
1637#define PCI_VENDOR_ID_3DFX 0x121a 1642#define PCI_VENDOR_ID_3DFX 0x121a
1638#define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 1643#define PCI_DEVICE_ID_3DFX_VOODOO 0x0001
@@ -2290,6 +2295,20 @@
2290#define PCI_DEVICE_ID_MPC8536 0x0051 2295#define PCI_DEVICE_ID_MPC8536 0x0051
2291#define PCI_DEVICE_ID_P2020E 0x0070 2296#define PCI_DEVICE_ID_P2020E 0x0070
2292#define PCI_DEVICE_ID_P2020 0x0071 2297#define PCI_DEVICE_ID_P2020 0x0071
2298#define PCI_DEVICE_ID_P2010E 0x0078
2299#define PCI_DEVICE_ID_P2010 0x0079
2300#define PCI_DEVICE_ID_P1020E 0x0100
2301#define PCI_DEVICE_ID_P1020 0x0101
2302#define PCI_DEVICE_ID_P1011E 0x0108
2303#define PCI_DEVICE_ID_P1011 0x0109
2304#define PCI_DEVICE_ID_P1022E 0x0110
2305#define PCI_DEVICE_ID_P1022 0x0111
2306#define PCI_DEVICE_ID_P1013E 0x0118
2307#define PCI_DEVICE_ID_P1013 0x0119
2308#define PCI_DEVICE_ID_P4080E 0x0400
2309#define PCI_DEVICE_ID_P4080 0x0401
2310#define PCI_DEVICE_ID_P4040E 0x0408
2311#define PCI_DEVICE_ID_P4040 0x0409
2293#define PCI_DEVICE_ID_MPC8641 0x7010 2312#define PCI_DEVICE_ID_MPC8641 0x7010
2294#define PCI_DEVICE_ID_MPC8641D 0x7011 2313#define PCI_DEVICE_ID_MPC8641D 0x7011
2295#define PCI_DEVICE_ID_MPC8610 0x7018 2314#define PCI_DEVICE_ID_MPC8610 0x7018
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index dd0bed4f1cf0..9f2ad0aa3c39 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -365,6 +365,11 @@
365#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ 365#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
366#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ 366#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
367 367
368/* PCI Bridge Subsystem ID registers */
369
370#define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */
371#define PCI_SSVID_DEVICE_ID 6 /* PCI-Bridge subsystem device id register */
372
368/* PCI Express capability registers */ 373/* PCI Express capability registers */
369 374
370#define PCI_EXP_FLAGS 2 /* Capabilities register */ 375#define PCI_EXP_FLAGS 2 /* Capabilities register */
@@ -502,6 +507,7 @@
502#define PCI_EXT_CAP_ID_VC 2 507#define PCI_EXT_CAP_ID_VC 2
503#define PCI_EXT_CAP_ID_DSN 3 508#define PCI_EXT_CAP_ID_DSN 3
504#define PCI_EXT_CAP_ID_PWR 4 509#define PCI_EXT_CAP_ID_PWR 4
510#define PCI_EXT_CAP_ID_ACS 13
505#define PCI_EXT_CAP_ID_ARI 14 511#define PCI_EXT_CAP_ID_ARI 14
506#define PCI_EXT_CAP_ID_ATS 15 512#define PCI_EXT_CAP_ID_ATS 15
507#define PCI_EXT_CAP_ID_SRIOV 16 513#define PCI_EXT_CAP_ID_SRIOV 16
@@ -662,4 +668,16 @@
662#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ 668#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */
663#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ 669#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */
664 670
671/* Access Control Service */
672#define PCI_ACS_CAP 0x04 /* ACS Capability Register */
673#define PCI_ACS_SV 0x01 /* Source Validation */
674#define PCI_ACS_TB 0x02 /* Translation Blocking */
675#define PCI_ACS_RR 0x04 /* P2P Request Redirect */
676#define PCI_ACS_CR 0x08 /* P2P Completion Redirect */
677#define PCI_ACS_UF 0x10 /* Upstream Forwarding */
678#define PCI_ACS_EC 0x20 /* P2P Egress Control */
679#define PCI_ACS_DT 0x40 /* Direct Translated P2P */
680#define PCI_ACS_CTRL 0x06 /* ACS Control Register */
681#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */
682
665#endif /* LINUX_PCI_REGS_H */ 683#endif /* LINUX_PCI_REGS_H */
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h
index b4c79545330b..6775532b92a9 100644
--- a/include/linux/pcieport_if.h
+++ b/include/linux/pcieport_if.h
@@ -10,10 +10,7 @@
10#define _PCIEPORT_IF_H_ 10#define _PCIEPORT_IF_H_
11 11
12/* Port Type */ 12/* Port Type */
13#define PCIE_RC_PORT 4 /* Root port of RC */ 13#define PCIE_ANY_PORT (~0)
14#define PCIE_SW_UPSTREAM_PORT 5 /* Upstream port of Switch */
15#define PCIE_SW_DOWNSTREAM_PORT 6 /* Downstream port of Switch */
16#define PCIE_ANY_PORT 7
17 14
18/* Service Type */ 15/* Service Type */
19#define PCIE_PORT_SERVICE_PME_SHIFT 0 /* Power Management Event */ 16#define PCIE_PORT_SERVICE_PME_SHIFT 0 /* Power Management Event */
@@ -25,17 +22,6 @@
25#define PCIE_PORT_SERVICE_VC_SHIFT 3 /* Virtual Channel */ 22#define PCIE_PORT_SERVICE_VC_SHIFT 3 /* Virtual Channel */
26#define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) 23#define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT)
27 24
28/* Root/Upstream/Downstream Port's Interrupt Mode */
29#define PCIE_PORT_NO_IRQ (-1)
30#define PCIE_PORT_INTx_MODE 0
31#define PCIE_PORT_MSI_MODE 1
32#define PCIE_PORT_MSIX_MODE 2
33
34struct pcie_port_data {
35 int port_type; /* Type of the port */
36 int port_irq_mode; /* [0:INTx | 1:MSI | 2:MSI-X] */
37};
38
39struct pcie_device { 25struct pcie_device {
40 int irq; /* Service IRQ/MSI/MSI-X Vector */ 26 int irq; /* Service IRQ/MSI/MSI-X Vector */
41 struct pci_dev *port; /* Root/Upstream/Downstream Port */ 27 struct pci_dev *port; /* Root/Upstream/Downstream Port */
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 9bd03193ecd4..5a5d6ce4bd55 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -60,6 +60,7 @@
60 60
61#define DEFINE_PER_CPU_SECTION(type, name, sec) \ 61#define DEFINE_PER_CPU_SECTION(type, name, sec) \
62 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ 62 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
63 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
63 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ 64 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
64 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ 65 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \
65 __typeof__(type) per_cpu__##name 66 __typeof__(type) per_cpu__##name
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 878836ca999c..cf5efbcf716c 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -34,8 +34,6 @@
34 34
35#ifdef CONFIG_SMP 35#ifdef CONFIG_SMP
36 36
37#ifndef CONFIG_HAVE_LEGACY_PER_CPU_AREA
38
39/* minimum unit size, also is the maximum supported allocation size */ 37/* minimum unit size, also is the maximum supported allocation size */
40#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10) 38#define PCPU_MIN_UNIT_SIZE PFN_ALIGN(64 << 10)
41 39
@@ -130,30 +128,9 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size,
130#define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) 128#define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu)))
131 129
132extern void *__alloc_reserved_percpu(size_t size, size_t align); 130extern void *__alloc_reserved_percpu(size_t size, size_t align);
133
134#else /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */
135
136struct percpu_data {
137 void *ptrs[1];
138};
139
140/* pointer disguising messes up the kmemleak objects tracking */
141#ifndef CONFIG_DEBUG_KMEMLEAK
142#define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata)
143#else
144#define __percpu_disguise(pdata) (struct percpu_data *)(pdata)
145#endif
146
147#define per_cpu_ptr(ptr, cpu) \
148({ \
149 struct percpu_data *__p = __percpu_disguise(ptr); \
150 (__typeof__(ptr))__p->ptrs[(cpu)]; \
151})
152
153#endif /* CONFIG_HAVE_LEGACY_PER_CPU_AREA */
154
155extern void *__alloc_percpu(size_t size, size_t align); 131extern void *__alloc_percpu(size_t size, size_t align);
156extern void free_percpu(void *__pdata); 132extern void free_percpu(void *__pdata);
133extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
157 134
158#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA 135#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
159extern void __init setup_per_cpu_areas(void); 136extern void __init setup_per_cpu_areas(void);
@@ -179,6 +156,11 @@ static inline void free_percpu(void *p)
179 kfree(p); 156 kfree(p);
180} 157}
181 158
159static inline phys_addr_t per_cpu_ptr_to_phys(void *addr)
160{
161 return __pa(addr);
162}
163
182static inline void __init setup_per_cpu_areas(void) { } 164static inline void __init setup_per_cpu_areas(void) { }
183 165
184static inline void *pcpu_lpage_remapped(void *kaddr) 166static inline void *pcpu_lpage_remapped(void *kaddr)
@@ -188,8 +170,8 @@ static inline void *pcpu_lpage_remapped(void *kaddr)
188 170
189#endif /* CONFIG_SMP */ 171#endif /* CONFIG_SMP */
190 172
191#define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ 173#define alloc_percpu(type) \
192 __alignof__(type)) 174 (typeof(type) *)__alloc_percpu(sizeof(type), __alignof__(type))
193 175
194/* 176/*
195 * Optional methods for optimized non-lvalue per-cpu variable access. 177 * Optional methods for optimized non-lvalue per-cpu variable access.
@@ -243,4 +225,404 @@ do { \
243# define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=) 225# define percpu_xor(var, val) __percpu_generic_to_op(var, (val), ^=)
244#endif 226#endif
245 227
228/*
229 * Branching function to split up a function into a set of functions that
230 * are called for different scalar sizes of the objects handled.
231 */
232
233extern void __bad_size_call_parameter(void);
234
235#define __pcpu_size_call_return(stem, variable) \
236({ typeof(variable) pscr_ret__; \
237 switch(sizeof(variable)) { \
238 case 1: pscr_ret__ = stem##1(variable);break; \
239 case 2: pscr_ret__ = stem##2(variable);break; \
240 case 4: pscr_ret__ = stem##4(variable);break; \
241 case 8: pscr_ret__ = stem##8(variable);break; \
242 default: \
243 __bad_size_call_parameter();break; \
244 } \
245 pscr_ret__; \
246})
247
248#define __pcpu_size_call(stem, variable, ...) \
249do { \
250 switch(sizeof(variable)) { \
251 case 1: stem##1(variable, __VA_ARGS__);break; \
252 case 2: stem##2(variable, __VA_ARGS__);break; \
253 case 4: stem##4(variable, __VA_ARGS__);break; \
254 case 8: stem##8(variable, __VA_ARGS__);break; \
255 default: \
256 __bad_size_call_parameter();break; \
257 } \
258} while (0)
259
260/*
261 * Optimized manipulation for memory allocated through the per cpu
262 * allocator or for addresses of per cpu variables (can be determined
263 * using per_cpu_var(xx).
264 *
265 * These operation guarantee exclusivity of access for other operations
266 * on the *same* processor. The assumption is that per cpu data is only
267 * accessed by a single processor instance (the current one).
268 *
269 * The first group is used for accesses that must be done in a
270 * preemption safe way since we know that the context is not preempt
271 * safe. Interrupts may occur. If the interrupt modifies the variable
272 * too then RMW actions will not be reliable.
273 *
274 * The arch code can provide optimized functions in two ways:
275 *
276 * 1. Override the function completely. F.e. define this_cpu_add().
277 * The arch must then ensure that the various scalar format passed
278 * are handled correctly.
279 *
280 * 2. Provide functions for certain scalar sizes. F.e. provide
281 * this_cpu_add_2() to provide per cpu atomic operations for 2 byte
282 * sized RMW actions. If arch code does not provide operations for
283 * a scalar size then the fallback in the generic code will be
284 * used.
285 */
286
287#define _this_cpu_generic_read(pcp) \
288({ typeof(pcp) ret__; \
289 preempt_disable(); \
290 ret__ = *this_cpu_ptr(&(pcp)); \
291 preempt_enable(); \
292 ret__; \
293})
294
295#ifndef this_cpu_read
296# ifndef this_cpu_read_1
297# define this_cpu_read_1(pcp) _this_cpu_generic_read(pcp)
298# endif
299# ifndef this_cpu_read_2
300# define this_cpu_read_2(pcp) _this_cpu_generic_read(pcp)
301# endif
302# ifndef this_cpu_read_4
303# define this_cpu_read_4(pcp) _this_cpu_generic_read(pcp)
304# endif
305# ifndef this_cpu_read_8
306# define this_cpu_read_8(pcp) _this_cpu_generic_read(pcp)
307# endif
308# define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, (pcp))
309#endif
310
311#define _this_cpu_generic_to_op(pcp, val, op) \
312do { \
313 preempt_disable(); \
314 *__this_cpu_ptr(&pcp) op val; \
315 preempt_enable(); \
316} while (0)
317
318#ifndef this_cpu_write
319# ifndef this_cpu_write_1
320# define this_cpu_write_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), =)
321# endif
322# ifndef this_cpu_write_2
323# define this_cpu_write_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), =)
324# endif
325# ifndef this_cpu_write_4
326# define this_cpu_write_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), =)
327# endif
328# ifndef this_cpu_write_8
329# define this_cpu_write_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), =)
330# endif
331# define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, (pcp), (val))
332#endif
333
334#ifndef this_cpu_add
335# ifndef this_cpu_add_1
336# define this_cpu_add_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=)
337# endif
338# ifndef this_cpu_add_2
339# define this_cpu_add_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=)
340# endif
341# ifndef this_cpu_add_4
342# define this_cpu_add_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=)
343# endif
344# ifndef this_cpu_add_8
345# define this_cpu_add_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=)
346# endif
347# define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, (pcp), (val))
348#endif
349
350#ifndef this_cpu_sub
351# define this_cpu_sub(pcp, val) this_cpu_add((pcp), -(val))
352#endif
353
354#ifndef this_cpu_inc
355# define this_cpu_inc(pcp) this_cpu_add((pcp), 1)
356#endif
357
358#ifndef this_cpu_dec
359# define this_cpu_dec(pcp) this_cpu_sub((pcp), 1)
360#endif
361
362#ifndef this_cpu_and
363# ifndef this_cpu_and_1
364# define this_cpu_and_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=)
365# endif
366# ifndef this_cpu_and_2
367# define this_cpu_and_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=)
368# endif
369# ifndef this_cpu_and_4
370# define this_cpu_and_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=)
371# endif
372# ifndef this_cpu_and_8
373# define this_cpu_and_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=)
374# endif
375# define this_cpu_and(pcp, val) __pcpu_size_call(this_cpu_and_, (pcp), (val))
376#endif
377
378#ifndef this_cpu_or
379# ifndef this_cpu_or_1
380# define this_cpu_or_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=)
381# endif
382# ifndef this_cpu_or_2
383# define this_cpu_or_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=)
384# endif
385# ifndef this_cpu_or_4
386# define this_cpu_or_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=)
387# endif
388# ifndef this_cpu_or_8
389# define this_cpu_or_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=)
390# endif
391# define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val))
392#endif
393
394#ifndef this_cpu_xor
395# ifndef this_cpu_xor_1
396# define this_cpu_xor_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=)
397# endif
398# ifndef this_cpu_xor_2
399# define this_cpu_xor_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=)
400# endif
401# ifndef this_cpu_xor_4
402# define this_cpu_xor_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=)
403# endif
404# ifndef this_cpu_xor_8
405# define this_cpu_xor_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=)
406# endif
407# define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val))
408#endif
409
410/*
411 * Generic percpu operations that do not require preemption handling.
412 * Either we do not care about races or the caller has the
413 * responsibility of handling preemptions issues. Arch code can still
414 * override these instructions since the arch per cpu code may be more
415 * efficient and may actually get race freeness for free (that is the
416 * case for x86 for example).
417 *
418 * If there is no other protection through preempt disable and/or
419 * disabling interupts then one of these RMW operations can show unexpected
420 * behavior because the execution thread was rescheduled on another processor
421 * or an interrupt occurred and the same percpu variable was modified from
422 * the interrupt context.
423 */
424#ifndef __this_cpu_read
425# ifndef __this_cpu_read_1
426# define __this_cpu_read_1(pcp) (*__this_cpu_ptr(&(pcp)))
427# endif
428# ifndef __this_cpu_read_2
429# define __this_cpu_read_2(pcp) (*__this_cpu_ptr(&(pcp)))
430# endif
431# ifndef __this_cpu_read_4
432# define __this_cpu_read_4(pcp) (*__this_cpu_ptr(&(pcp)))
433# endif
434# ifndef __this_cpu_read_8
435# define __this_cpu_read_8(pcp) (*__this_cpu_ptr(&(pcp)))
436# endif
437# define __this_cpu_read(pcp) __pcpu_size_call_return(__this_cpu_read_, (pcp))
438#endif
439
440#define __this_cpu_generic_to_op(pcp, val, op) \
441do { \
442 *__this_cpu_ptr(&(pcp)) op val; \
443} while (0)
444
445#ifndef __this_cpu_write
446# ifndef __this_cpu_write_1
447# define __this_cpu_write_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), =)
448# endif
449# ifndef __this_cpu_write_2
450# define __this_cpu_write_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), =)
451# endif
452# ifndef __this_cpu_write_4
453# define __this_cpu_write_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), =)
454# endif
455# ifndef __this_cpu_write_8
456# define __this_cpu_write_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), =)
457# endif
458# define __this_cpu_write(pcp, val) __pcpu_size_call(__this_cpu_write_, (pcp), (val))
459#endif
460
461#ifndef __this_cpu_add
462# ifndef __this_cpu_add_1
463# define __this_cpu_add_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=)
464# endif
465# ifndef __this_cpu_add_2
466# define __this_cpu_add_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=)
467# endif
468# ifndef __this_cpu_add_4
469# define __this_cpu_add_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=)
470# endif
471# ifndef __this_cpu_add_8
472# define __this_cpu_add_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), +=)
473# endif
474# define __this_cpu_add(pcp, val) __pcpu_size_call(__this_cpu_add_, (pcp), (val))
475#endif
476
477#ifndef __this_cpu_sub
478# define __this_cpu_sub(pcp, val) __this_cpu_add((pcp), -(val))
479#endif
480
481#ifndef __this_cpu_inc
482# define __this_cpu_inc(pcp) __this_cpu_add((pcp), 1)
483#endif
484
485#ifndef __this_cpu_dec
486# define __this_cpu_dec(pcp) __this_cpu_sub((pcp), 1)
487#endif
488
489#ifndef __this_cpu_and
490# ifndef __this_cpu_and_1
491# define __this_cpu_and_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=)
492# endif
493# ifndef __this_cpu_and_2
494# define __this_cpu_and_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=)
495# endif
496# ifndef __this_cpu_and_4
497# define __this_cpu_and_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=)
498# endif
499# ifndef __this_cpu_and_8
500# define __this_cpu_and_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), &=)
501# endif
502# define __this_cpu_and(pcp, val) __pcpu_size_call(__this_cpu_and_, (pcp), (val))
503#endif
504
505#ifndef __this_cpu_or
506# ifndef __this_cpu_or_1
507# define __this_cpu_or_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=)
508# endif
509# ifndef __this_cpu_or_2
510# define __this_cpu_or_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=)
511# endif
512# ifndef __this_cpu_or_4
513# define __this_cpu_or_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=)
514# endif
515# ifndef __this_cpu_or_8
516# define __this_cpu_or_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), |=)
517# endif
518# define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val))
519#endif
520
521#ifndef __this_cpu_xor
522# ifndef __this_cpu_xor_1
523# define __this_cpu_xor_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=)
524# endif
525# ifndef __this_cpu_xor_2
526# define __this_cpu_xor_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=)
527# endif
528# ifndef __this_cpu_xor_4
529# define __this_cpu_xor_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=)
530# endif
531# ifndef __this_cpu_xor_8
532# define __this_cpu_xor_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=)
533# endif
534# define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val))
535#endif
536
537/*
538 * IRQ safe versions of the per cpu RMW operations. Note that these operations
539 * are *not* safe against modification of the same variable from another
540 * processors (which one gets when using regular atomic operations)
541 . They are guaranteed to be atomic vs. local interrupts and
542 * preemption only.
543 */
544#define irqsafe_cpu_generic_to_op(pcp, val, op) \
545do { \
546 unsigned long flags; \
547 local_irq_save(flags); \
548 *__this_cpu_ptr(&(pcp)) op val; \
549 local_irq_restore(flags); \
550} while (0)
551
552#ifndef irqsafe_cpu_add
553# ifndef irqsafe_cpu_add_1
554# define irqsafe_cpu_add_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=)
555# endif
556# ifndef irqsafe_cpu_add_2
557# define irqsafe_cpu_add_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=)
558# endif
559# ifndef irqsafe_cpu_add_4
560# define irqsafe_cpu_add_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=)
561# endif
562# ifndef irqsafe_cpu_add_8
563# define irqsafe_cpu_add_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), +=)
564# endif
565# define irqsafe_cpu_add(pcp, val) __pcpu_size_call(irqsafe_cpu_add_, (pcp), (val))
566#endif
567
568#ifndef irqsafe_cpu_sub
569# define irqsafe_cpu_sub(pcp, val) irqsafe_cpu_add((pcp), -(val))
570#endif
571
572#ifndef irqsafe_cpu_inc
573# define irqsafe_cpu_inc(pcp) irqsafe_cpu_add((pcp), 1)
574#endif
575
576#ifndef irqsafe_cpu_dec
577# define irqsafe_cpu_dec(pcp) irqsafe_cpu_sub((pcp), 1)
578#endif
579
580#ifndef irqsafe_cpu_and
581# ifndef irqsafe_cpu_and_1
582# define irqsafe_cpu_and_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=)
583# endif
584# ifndef irqsafe_cpu_and_2
585# define irqsafe_cpu_and_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=)
586# endif
587# ifndef irqsafe_cpu_and_4
588# define irqsafe_cpu_and_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=)
589# endif
590# ifndef irqsafe_cpu_and_8
591# define irqsafe_cpu_and_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), &=)
592# endif
593# define irqsafe_cpu_and(pcp, val) __pcpu_size_call(irqsafe_cpu_and_, (val))
594#endif
595
596#ifndef irqsafe_cpu_or
597# ifndef irqsafe_cpu_or_1
598# define irqsafe_cpu_or_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=)
599# endif
600# ifndef irqsafe_cpu_or_2
601# define irqsafe_cpu_or_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=)
602# endif
603# ifndef irqsafe_cpu_or_4
604# define irqsafe_cpu_or_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=)
605# endif
606# ifndef irqsafe_cpu_or_8
607# define irqsafe_cpu_or_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), |=)
608# endif
609# define irqsafe_cpu_or(pcp, val) __pcpu_size_call(irqsafe_cpu_or_, (val))
610#endif
611
612#ifndef irqsafe_cpu_xor
613# ifndef irqsafe_cpu_xor_1
614# define irqsafe_cpu_xor_1(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=)
615# endif
616# ifndef irqsafe_cpu_xor_2
617# define irqsafe_cpu_xor_2(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=)
618# endif
619# ifndef irqsafe_cpu_xor_4
620# define irqsafe_cpu_xor_4(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=)
621# endif
622# ifndef irqsafe_cpu_xor_8
623# define irqsafe_cpu_xor_8(pcp, val) irqsafe_cpu_generic_to_op((pcp), (val), ^=)
624# endif
625# define irqsafe_cpu_xor(pcp, val) __pcpu_size_call(irqsafe_cpu_xor_, (val))
626#endif
627
246#endif /* __LINUX_PERCPU_H */ 628#endif /* __LINUX_PERCPU_H */
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 7b7fbf433cff..e3fb25606706 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -106,6 +106,8 @@ enum perf_sw_ids {
106 PERF_COUNT_SW_CPU_MIGRATIONS = 4, 106 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
107 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, 107 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
108 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, 108 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
109 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
110 PERF_COUNT_SW_EMULATION_FAULTS = 8,
109 111
110 PERF_COUNT_SW_MAX, /* non-ABI */ 112 PERF_COUNT_SW_MAX, /* non-ABI */
111}; 113};
@@ -225,6 +227,7 @@ struct perf_counter_attr {
225#define PERF_COUNTER_IOC_RESET _IO ('$', 3) 227#define PERF_COUNTER_IOC_RESET _IO ('$', 3)
226#define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) 228#define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64)
227#define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5) 229#define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5)
230#define PERF_COUNTER_IOC_SET_FILTER _IOW('$', 6, char *)
228 231
229enum perf_counter_ioc_flags { 232enum perf_counter_ioc_flags {
230 PERF_IOC_FLAG_GROUP = 1U << 0, 233 PERF_IOC_FLAG_GROUP = 1U << 0,
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 9e7012689a84..64a53f74c9a9 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -31,6 +31,7 @@ enum perf_type_id {
31 PERF_TYPE_TRACEPOINT = 2, 31 PERF_TYPE_TRACEPOINT = 2,
32 PERF_TYPE_HW_CACHE = 3, 32 PERF_TYPE_HW_CACHE = 3,
33 PERF_TYPE_RAW = 4, 33 PERF_TYPE_RAW = 4,
34 PERF_TYPE_BREAKPOINT = 5,
34 35
35 PERF_TYPE_MAX, /* non-ABI */ 36 PERF_TYPE_MAX, /* non-ABI */
36}; 37};
@@ -102,6 +103,8 @@ enum perf_sw_ids {
102 PERF_COUNT_SW_CPU_MIGRATIONS = 4, 103 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
103 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, 104 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
104 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, 105 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
106 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
107 PERF_COUNT_SW_EMULATION_FAULTS = 8,
105 108
106 PERF_COUNT_SW_MAX, /* non-ABI */ 109 PERF_COUNT_SW_MAX, /* non-ABI */
107}; 110};
@@ -207,6 +210,15 @@ struct perf_event_attr {
207 __u32 wakeup_events; /* wakeup every n events */ 210 __u32 wakeup_events; /* wakeup every n events */
208 __u32 wakeup_watermark; /* bytes before wakeup */ 211 __u32 wakeup_watermark; /* bytes before wakeup */
209 }; 212 };
213
214 struct { /* Hardware breakpoint info */
215 __u64 bp_addr;
216 __u32 bp_type;
217 __u32 bp_len;
218 __u64 __bp_reserved_1;
219 __u64 __bp_reserved_2;
220 };
221
210 __u32 __reserved_2; 222 __u32 __reserved_2;
211 223
212 __u64 __reserved_3; 224 __u64 __reserved_3;
@@ -219,8 +231,9 @@ struct perf_event_attr {
219#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) 231#define PERF_EVENT_IOC_DISABLE _IO ('$', 1)
220#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) 232#define PERF_EVENT_IOC_REFRESH _IO ('$', 2)
221#define PERF_EVENT_IOC_RESET _IO ('$', 3) 233#define PERF_EVENT_IOC_RESET _IO ('$', 3)
222#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, u64) 234#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
223#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) 235#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
236#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
224 237
225enum perf_event_ioc_flags { 238enum perf_event_ioc_flags {
226 PERF_IOC_FLAG_GROUP = 1U << 0, 239 PERF_IOC_FLAG_GROUP = 1U << 0,
@@ -434,6 +447,10 @@ enum perf_callchain_context {
434# include <asm/perf_event.h> 447# include <asm/perf_event.h>
435#endif 448#endif
436 449
450#ifdef CONFIG_HAVE_HW_BREAKPOINT
451#include <asm/hw_breakpoint.h>
452#endif
453
437#include <linux/list.h> 454#include <linux/list.h>
438#include <linux/mutex.h> 455#include <linux/mutex.h>
439#include <linux/rculist.h> 456#include <linux/rculist.h>
@@ -475,6 +492,11 @@ struct hw_perf_event {
475 s64 remaining; 492 s64 remaining;
476 struct hrtimer hrtimer; 493 struct hrtimer hrtimer;
477 }; 494 };
495#ifdef CONFIG_HAVE_HW_BREAKPOINT
496 union { /* breakpoint */
497 struct arch_hw_breakpoint info;
498 };
499#endif
478 }; 500 };
479 atomic64_t prev_count; 501 atomic64_t prev_count;
480 u64 sample_period; 502 u64 sample_period;
@@ -543,6 +565,12 @@ struct perf_pending_entry {
543 void (*func)(struct perf_pending_entry *); 565 void (*func)(struct perf_pending_entry *);
544}; 566};
545 567
568struct perf_sample_data;
569
570typedef void (*perf_overflow_handler_t)(struct perf_event *, int,
571 struct perf_sample_data *,
572 struct pt_regs *regs);
573
546/** 574/**
547 * struct perf_event - performance event kernel representation: 575 * struct perf_event - performance event kernel representation:
548 */ 576 */
@@ -585,7 +613,7 @@ struct perf_event {
585 u64 tstamp_running; 613 u64 tstamp_running;
586 u64 tstamp_stopped; 614 u64 tstamp_stopped;
587 615
588 struct perf_event_attr attr; 616 struct perf_event_attr attr;
589 struct hw_perf_event hw; 617 struct hw_perf_event hw;
590 618
591 struct perf_event_context *ctx; 619 struct perf_event_context *ctx;
@@ -633,7 +661,14 @@ struct perf_event {
633 661
634 struct pid_namespace *ns; 662 struct pid_namespace *ns;
635 u64 id; 663 u64 id;
664
665 perf_overflow_handler_t overflow_handler;
666
667#ifdef CONFIG_EVENT_PROFILE
668 struct event_filter *filter;
636#endif 669#endif
670
671#endif /* CONFIG_PERF_EVENTS */
637}; 672};
638 673
639/** 674/**
@@ -706,7 +741,6 @@ struct perf_output_handle {
706 int nmi; 741 int nmi;
707 int sample; 742 int sample;
708 int locked; 743 int locked;
709 unsigned long flags;
710}; 744};
711 745
712#ifdef CONFIG_PERF_EVENTS 746#ifdef CONFIG_PERF_EVENTS
@@ -738,6 +772,14 @@ extern int hw_perf_group_sched_in(struct perf_event *group_leader,
738 struct perf_cpu_context *cpuctx, 772 struct perf_cpu_context *cpuctx,
739 struct perf_event_context *ctx, int cpu); 773 struct perf_event_context *ctx, int cpu);
740extern void perf_event_update_userpage(struct perf_event *event); 774extern void perf_event_update_userpage(struct perf_event *event);
775extern int perf_event_release_kernel(struct perf_event *event);
776extern struct perf_event *
777perf_event_create_kernel_counter(struct perf_event_attr *attr,
778 int cpu,
779 pid_t pid,
780 perf_overflow_handler_t callback);
781extern u64 perf_event_read_value(struct perf_event *event,
782 u64 *enabled, u64 *running);
741 783
742struct perf_sample_data { 784struct perf_sample_data {
743 u64 type; 785 u64 type;
@@ -814,6 +856,7 @@ extern int sysctl_perf_event_sample_rate;
814extern void perf_event_init(void); 856extern void perf_event_init(void);
815extern void perf_tp_event(int event_id, u64 addr, u64 count, 857extern void perf_tp_event(int event_id, u64 addr, u64 count,
816 void *record, int entry_size); 858 void *record, int entry_size);
859extern void perf_bp_event(struct perf_event *event, void *data);
817 860
818#ifndef perf_misc_flags 861#ifndef perf_misc_flags
819#define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \ 862#define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \
@@ -827,6 +870,10 @@ extern int perf_output_begin(struct perf_output_handle *handle,
827extern void perf_output_end(struct perf_output_handle *handle); 870extern void perf_output_end(struct perf_output_handle *handle);
828extern void perf_output_copy(struct perf_output_handle *handle, 871extern void perf_output_copy(struct perf_output_handle *handle,
829 const void *buf, unsigned int len); 872 const void *buf, unsigned int len);
873extern int perf_swevent_get_recursion_context(void);
874extern void perf_swevent_put_recursion_context(int rctx);
875extern void perf_event_enable(struct perf_event *event);
876extern void perf_event_disable(struct perf_event *event);
830#else 877#else
831static inline void 878static inline void
832perf_event_task_sched_in(struct task_struct *task, int cpu) { } 879perf_event_task_sched_in(struct task_struct *task, int cpu) { }
@@ -848,12 +895,17 @@ static inline int perf_event_task_enable(void) { return -EINVAL; }
848static inline void 895static inline void
849perf_sw_event(u32 event_id, u64 nr, int nmi, 896perf_sw_event(u32 event_id, u64 nr, int nmi,
850 struct pt_regs *regs, u64 addr) { } 897 struct pt_regs *regs, u64 addr) { }
898static inline void
899perf_bp_event(struct perf_event *event, void *data) { }
851 900
852static inline void perf_event_mmap(struct vm_area_struct *vma) { } 901static inline void perf_event_mmap(struct vm_area_struct *vma) { }
853static inline void perf_event_comm(struct task_struct *tsk) { } 902static inline void perf_event_comm(struct task_struct *tsk) { }
854static inline void perf_event_fork(struct task_struct *tsk) { } 903static inline void perf_event_fork(struct task_struct *tsk) { }
855static inline void perf_event_init(void) { } 904static inline void perf_event_init(void) { }
856 905static inline int perf_swevent_get_recursion_context(void) { return -1; }
906static inline void perf_swevent_put_recursion_context(int rctx) { }
907static inline void perf_event_enable(struct perf_event *event) { }
908static inline void perf_event_disable(struct perf_event *event) { }
857#endif 909#endif
858 910
859#define perf_output_put(handle, x) \ 911#define perf_output_put(handle, x) \
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 3c842edff388..7f6ba8658abe 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -75,8 +75,7 @@ bits 9,10,11: redirect counter - redirect TTL. Loop avoidance
75#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT)) 75#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))
76 76
77/* Action attributes */ 77/* Action attributes */
78enum 78enum {
79{
80 TCA_ACT_UNSPEC, 79 TCA_ACT_UNSPEC,
81 TCA_ACT_KIND, 80 TCA_ACT_KIND,
82 TCA_ACT_OPTIONS, 81 TCA_ACT_OPTIONS,
@@ -108,8 +107,7 @@ enum
108#define TC_ACT_JUMP 0x10000000 107#define TC_ACT_JUMP 0x10000000
109 108
110/* Action type identifiers*/ 109/* Action type identifiers*/
111enum 110enum {
112{
113 TCA_ID_UNSPEC=0, 111 TCA_ID_UNSPEC=0,
114 TCA_ID_POLICE=1, 112 TCA_ID_POLICE=1,
115 /* other actions go here */ 113 /* other actions go here */
@@ -118,8 +116,7 @@ enum
118 116
119#define TCA_ID_MAX __TCA_ID_MAX 117#define TCA_ID_MAX __TCA_ID_MAX
120 118
121struct tc_police 119struct tc_police {
122{
123 __u32 index; 120 __u32 index;
124 int action; 121 int action;
125#define TC_POLICE_UNSPEC TC_ACT_UNSPEC 122#define TC_POLICE_UNSPEC TC_ACT_UNSPEC
@@ -138,15 +135,13 @@ struct tc_police
138 __u32 capab; 135 __u32 capab;
139}; 136};
140 137
141struct tcf_t 138struct tcf_t {
142{
143 __u64 install; 139 __u64 install;
144 __u64 lastuse; 140 __u64 lastuse;
145 __u64 expires; 141 __u64 expires;
146}; 142};
147 143
148struct tc_cnt 144struct tc_cnt {
149{
150 int refcnt; 145 int refcnt;
151 int bindcnt; 146 int bindcnt;
152}; 147};
@@ -158,8 +153,7 @@ struct tc_cnt
158 int refcnt; \ 153 int refcnt; \
159 int bindcnt 154 int bindcnt
160 155
161enum 156enum {
162{
163 TCA_POLICE_UNSPEC, 157 TCA_POLICE_UNSPEC,
164 TCA_POLICE_TBF, 158 TCA_POLICE_TBF,
165 TCA_POLICE_RATE, 159 TCA_POLICE_RATE,
@@ -182,8 +176,7 @@ enum
182#define TC_U32_UNSPEC 0 176#define TC_U32_UNSPEC 0
183#define TC_U32_ROOT (0xFFF00000) 177#define TC_U32_ROOT (0xFFF00000)
184 178
185enum 179enum {
186{
187 TCA_U32_UNSPEC, 180 TCA_U32_UNSPEC,
188 TCA_U32_CLASSID, 181 TCA_U32_CLASSID,
189 TCA_U32_HASH, 182 TCA_U32_HASH,
@@ -200,16 +193,14 @@ enum
200 193
201#define TCA_U32_MAX (__TCA_U32_MAX - 1) 194#define TCA_U32_MAX (__TCA_U32_MAX - 1)
202 195
203struct tc_u32_key 196struct tc_u32_key {
204{
205 __be32 mask; 197 __be32 mask;
206 __be32 val; 198 __be32 val;
207 int off; 199 int off;
208 int offmask; 200 int offmask;
209}; 201};
210 202
211struct tc_u32_sel 203struct tc_u32_sel {
212{
213 unsigned char flags; 204 unsigned char flags;
214 unsigned char offshift; 205 unsigned char offshift;
215 unsigned char nkeys; 206 unsigned char nkeys;
@@ -223,15 +214,13 @@ struct tc_u32_sel
223 struct tc_u32_key keys[0]; 214 struct tc_u32_key keys[0];
224}; 215};
225 216
226struct tc_u32_mark 217struct tc_u32_mark {
227{
228 __u32 val; 218 __u32 val;
229 __u32 mask; 219 __u32 mask;
230 __u32 success; 220 __u32 success;
231}; 221};
232 222
233struct tc_u32_pcnt 223struct tc_u32_pcnt {
234{
235 __u64 rcnt; 224 __u64 rcnt;
236 __u64 rhit; 225 __u64 rhit;
237 __u64 kcnts[0]; 226 __u64 kcnts[0];
@@ -249,8 +238,7 @@ struct tc_u32_pcnt
249 238
250/* RSVP filter */ 239/* RSVP filter */
251 240
252enum 241enum {
253{
254 TCA_RSVP_UNSPEC, 242 TCA_RSVP_UNSPEC,
255 TCA_RSVP_CLASSID, 243 TCA_RSVP_CLASSID,
256 TCA_RSVP_DST, 244 TCA_RSVP_DST,
@@ -263,15 +251,13 @@ enum
263 251
264#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 ) 252#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
265 253
266struct tc_rsvp_gpi 254struct tc_rsvp_gpi {
267{
268 __u32 key; 255 __u32 key;
269 __u32 mask; 256 __u32 mask;
270 int offset; 257 int offset;
271}; 258};
272 259
273struct tc_rsvp_pinfo 260struct tc_rsvp_pinfo {
274{
275 struct tc_rsvp_gpi dpi; 261 struct tc_rsvp_gpi dpi;
276 struct tc_rsvp_gpi spi; 262 struct tc_rsvp_gpi spi;
277 __u8 protocol; 263 __u8 protocol;
@@ -282,8 +268,7 @@ struct tc_rsvp_pinfo
282 268
283/* ROUTE filter */ 269/* ROUTE filter */
284 270
285enum 271enum {
286{
287 TCA_ROUTE4_UNSPEC, 272 TCA_ROUTE4_UNSPEC,
288 TCA_ROUTE4_CLASSID, 273 TCA_ROUTE4_CLASSID,
289 TCA_ROUTE4_TO, 274 TCA_ROUTE4_TO,
@@ -299,8 +284,7 @@ enum
299 284
300/* FW filter */ 285/* FW filter */
301 286
302enum 287enum {
303{
304 TCA_FW_UNSPEC, 288 TCA_FW_UNSPEC,
305 TCA_FW_CLASSID, 289 TCA_FW_CLASSID,
306 TCA_FW_POLICE, 290 TCA_FW_POLICE,
@@ -314,8 +298,7 @@ enum
314 298
315/* TC index filter */ 299/* TC index filter */
316 300
317enum 301enum {
318{
319 TCA_TCINDEX_UNSPEC, 302 TCA_TCINDEX_UNSPEC,
320 TCA_TCINDEX_HASH, 303 TCA_TCINDEX_HASH,
321 TCA_TCINDEX_MASK, 304 TCA_TCINDEX_MASK,
@@ -331,8 +314,7 @@ enum
331 314
332/* Flow filter */ 315/* Flow filter */
333 316
334enum 317enum {
335{
336 FLOW_KEY_SRC, 318 FLOW_KEY_SRC,
337 FLOW_KEY_DST, 319 FLOW_KEY_DST,
338 FLOW_KEY_PROTO, 320 FLOW_KEY_PROTO,
@@ -355,14 +337,12 @@ enum
355 337
356#define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1) 338#define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1)
357 339
358enum 340enum {
359{
360 FLOW_MODE_MAP, 341 FLOW_MODE_MAP,
361 FLOW_MODE_HASH, 342 FLOW_MODE_HASH,
362}; 343};
363 344
364enum 345enum {
365{
366 TCA_FLOW_UNSPEC, 346 TCA_FLOW_UNSPEC,
367 TCA_FLOW_KEYS, 347 TCA_FLOW_KEYS,
368 TCA_FLOW_MODE, 348 TCA_FLOW_MODE,
@@ -383,8 +363,7 @@ enum
383 363
384/* Basic filter */ 364/* Basic filter */
385 365
386enum 366enum {
387{
388 TCA_BASIC_UNSPEC, 367 TCA_BASIC_UNSPEC,
389 TCA_BASIC_CLASSID, 368 TCA_BASIC_CLASSID,
390 TCA_BASIC_EMATCHES, 369 TCA_BASIC_EMATCHES,
@@ -398,8 +377,7 @@ enum
398 377
399/* Cgroup classifier */ 378/* Cgroup classifier */
400 379
401enum 380enum {
402{
403 TCA_CGROUP_UNSPEC, 381 TCA_CGROUP_UNSPEC,
404 TCA_CGROUP_ACT, 382 TCA_CGROUP_ACT,
405 TCA_CGROUP_POLICE, 383 TCA_CGROUP_POLICE,
@@ -411,14 +389,12 @@ enum
411 389
412/* Extended Matches */ 390/* Extended Matches */
413 391
414struct tcf_ematch_tree_hdr 392struct tcf_ematch_tree_hdr {
415{
416 __u16 nmatches; 393 __u16 nmatches;
417 __u16 progid; 394 __u16 progid;
418}; 395};
419 396
420enum 397enum {
421{
422 TCA_EMATCH_TREE_UNSPEC, 398 TCA_EMATCH_TREE_UNSPEC,
423 TCA_EMATCH_TREE_HDR, 399 TCA_EMATCH_TREE_HDR,
424 TCA_EMATCH_TREE_LIST, 400 TCA_EMATCH_TREE_LIST,
@@ -426,8 +402,7 @@ enum
426}; 402};
427#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) 403#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1)
428 404
429struct tcf_ematch_hdr 405struct tcf_ematch_hdr {
430{
431 __u16 matchid; 406 __u16 matchid;
432 __u16 kind; 407 __u16 kind;
433 __u16 flags; 408 __u16 flags;
@@ -457,8 +432,7 @@ struct tcf_ematch_hdr
457#define TCF_EM_REL_MASK 3 432#define TCF_EM_REL_MASK 3
458#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK) 433#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK)
459 434
460enum 435enum {
461{
462 TCF_LAYER_LINK, 436 TCF_LAYER_LINK,
463 TCF_LAYER_NETWORK, 437 TCF_LAYER_NETWORK,
464 TCF_LAYER_TRANSPORT, 438 TCF_LAYER_TRANSPORT,
@@ -479,13 +453,11 @@ enum
479#define TCF_EM_VLAN 6 453#define TCF_EM_VLAN 6
480#define TCF_EM_MAX 6 454#define TCF_EM_MAX 6
481 455
482enum 456enum {
483{
484 TCF_EM_PROG_TC 457 TCF_EM_PROG_TC
485}; 458};
486 459
487enum 460enum {
488{
489 TCF_EM_OPND_EQ, 461 TCF_EM_OPND_EQ,
490 TCF_EM_OPND_GT, 462 TCF_EM_OPND_GT,
491 TCF_EM_OPND_LT 463 TCF_EM_OPND_LT
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index d51a2b3e221e..2cfa4bc8dea6 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -29,8 +29,7 @@
29 Particular schedulers may have also their private records. 29 Particular schedulers may have also their private records.
30 */ 30 */
31 31
32struct tc_stats 32struct tc_stats {
33{
34 __u64 bytes; /* NUmber of enqueues bytes */ 33 __u64 bytes; /* NUmber of enqueues bytes */
35 __u32 packets; /* Number of enqueued packets */ 34 __u32 packets; /* Number of enqueued packets */
36 __u32 drops; /* Packets dropped because of lack of resources */ 35 __u32 drops; /* Packets dropped because of lack of resources */
@@ -42,8 +41,7 @@ struct tc_stats
42 __u32 backlog; 41 __u32 backlog;
43}; 42};
44 43
45struct tc_estimator 44struct tc_estimator {
46{
47 signed char interval; 45 signed char interval;
48 unsigned char ewma_log; 46 unsigned char ewma_log;
49}; 47};
@@ -75,8 +73,7 @@ struct tc_estimator
75#define TC_H_ROOT (0xFFFFFFFFU) 73#define TC_H_ROOT (0xFFFFFFFFU)
76#define TC_H_INGRESS (0xFFFFFFF1U) 74#define TC_H_INGRESS (0xFFFFFFF1U)
77 75
78struct tc_ratespec 76struct tc_ratespec {
79{
80 unsigned char cell_log; 77 unsigned char cell_log;
81 unsigned char __reserved; 78 unsigned char __reserved;
82 unsigned short overhead; 79 unsigned short overhead;
@@ -109,8 +106,7 @@ enum {
109 106
110/* FIFO section */ 107/* FIFO section */
111 108
112struct tc_fifo_qopt 109struct tc_fifo_qopt {
113{
114 __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ 110 __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */
115}; 111};
116 112
@@ -119,8 +115,7 @@ struct tc_fifo_qopt
119#define TCQ_PRIO_BANDS 16 115#define TCQ_PRIO_BANDS 16
120#define TCQ_MIN_PRIO_BANDS 2 116#define TCQ_MIN_PRIO_BANDS 2
121 117
122struct tc_prio_qopt 118struct tc_prio_qopt {
123{
124 int bands; /* Number of bands */ 119 int bands; /* Number of bands */
125 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 120 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
126}; 121};
@@ -134,8 +129,7 @@ struct tc_multiq_qopt {
134 129
135/* TBF section */ 130/* TBF section */
136 131
137struct tc_tbf_qopt 132struct tc_tbf_qopt {
138{
139 struct tc_ratespec rate; 133 struct tc_ratespec rate;
140 struct tc_ratespec peakrate; 134 struct tc_ratespec peakrate;
141 __u32 limit; 135 __u32 limit;
@@ -143,8 +137,7 @@ struct tc_tbf_qopt
143 __u32 mtu; 137 __u32 mtu;
144}; 138};
145 139
146enum 140enum {
147{
148 TCA_TBF_UNSPEC, 141 TCA_TBF_UNSPEC,
149 TCA_TBF_PARMS, 142 TCA_TBF_PARMS,
150 TCA_TBF_RTAB, 143 TCA_TBF_RTAB,
@@ -161,8 +154,7 @@ enum
161 154
162/* SFQ section */ 155/* SFQ section */
163 156
164struct tc_sfq_qopt 157struct tc_sfq_qopt {
165{
166 unsigned quantum; /* Bytes per round allocated to flow */ 158 unsigned quantum; /* Bytes per round allocated to flow */
167 int perturb_period; /* Period of hash perturbation */ 159 int perturb_period; /* Period of hash perturbation */
168 __u32 limit; /* Maximal packets in queue */ 160 __u32 limit; /* Maximal packets in queue */
@@ -170,8 +162,7 @@ struct tc_sfq_qopt
170 unsigned flows; /* Maximal number of flows */ 162 unsigned flows; /* Maximal number of flows */
171}; 163};
172 164
173struct tc_sfq_xstats 165struct tc_sfq_xstats {
174{
175 __s32 allot; 166 __s32 allot;
176}; 167};
177 168
@@ -186,8 +177,7 @@ struct tc_sfq_xstats
186 177
187/* RED section */ 178/* RED section */
188 179
189enum 180enum {
190{
191 TCA_RED_UNSPEC, 181 TCA_RED_UNSPEC,
192 TCA_RED_PARMS, 182 TCA_RED_PARMS,
193 TCA_RED_STAB, 183 TCA_RED_STAB,
@@ -196,8 +186,7 @@ enum
196 186
197#define TCA_RED_MAX (__TCA_RED_MAX - 1) 187#define TCA_RED_MAX (__TCA_RED_MAX - 1)
198 188
199struct tc_red_qopt 189struct tc_red_qopt {
200{
201 __u32 limit; /* HARD maximal queue length (bytes) */ 190 __u32 limit; /* HARD maximal queue length (bytes) */
202 __u32 qth_min; /* Min average length threshold (bytes) */ 191 __u32 qth_min; /* Min average length threshold (bytes) */
203 __u32 qth_max; /* Max average length threshold (bytes) */ 192 __u32 qth_max; /* Max average length threshold (bytes) */
@@ -209,8 +198,7 @@ struct tc_red_qopt
209#define TC_RED_HARDDROP 2 198#define TC_RED_HARDDROP 2
210}; 199};
211 200
212struct tc_red_xstats 201struct tc_red_xstats {
213{
214 __u32 early; /* Early drops */ 202 __u32 early; /* Early drops */
215 __u32 pdrop; /* Drops due to queue limits */ 203 __u32 pdrop; /* Drops due to queue limits */
216 __u32 other; /* Drops due to drop() calls */ 204 __u32 other; /* Drops due to drop() calls */
@@ -221,8 +209,7 @@ struct tc_red_xstats
221 209
222#define MAX_DPs 16 210#define MAX_DPs 16
223 211
224enum 212enum {
225{
226 TCA_GRED_UNSPEC, 213 TCA_GRED_UNSPEC,
227 TCA_GRED_PARMS, 214 TCA_GRED_PARMS,
228 TCA_GRED_STAB, 215 TCA_GRED_STAB,
@@ -232,8 +219,7 @@ enum
232 219
233#define TCA_GRED_MAX (__TCA_GRED_MAX - 1) 220#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
234 221
235struct tc_gred_qopt 222struct tc_gred_qopt {
236{
237 __u32 limit; /* HARD maximal queue length (bytes) */ 223 __u32 limit; /* HARD maximal queue length (bytes) */
238 __u32 qth_min; /* Min average length threshold (bytes) */ 224 __u32 qth_min; /* Min average length threshold (bytes) */
239 __u32 qth_max; /* Max average length threshold (bytes) */ 225 __u32 qth_max; /* Max average length threshold (bytes) */
@@ -253,8 +239,7 @@ struct tc_gred_qopt
253}; 239};
254 240
255/* gred setup */ 241/* gred setup */
256struct tc_gred_sopt 242struct tc_gred_sopt {
257{
258 __u32 DPs; 243 __u32 DPs;
259 __u32 def_DP; 244 __u32 def_DP;
260 __u8 grio; 245 __u8 grio;
@@ -267,8 +252,7 @@ struct tc_gred_sopt
267#define TC_HTB_MAXDEPTH 8 252#define TC_HTB_MAXDEPTH 8
268#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ 253#define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */
269 254
270struct tc_htb_opt 255struct tc_htb_opt {
271{
272 struct tc_ratespec rate; 256 struct tc_ratespec rate;
273 struct tc_ratespec ceil; 257 struct tc_ratespec ceil;
274 __u32 buffer; 258 __u32 buffer;
@@ -277,8 +261,7 @@ struct tc_htb_opt
277 __u32 level; /* out only */ 261 __u32 level; /* out only */
278 __u32 prio; 262 __u32 prio;
279}; 263};
280struct tc_htb_glob 264struct tc_htb_glob {
281{
282 __u32 version; /* to match HTB/TC */ 265 __u32 version; /* to match HTB/TC */
283 __u32 rate2quantum; /* bps->quantum divisor */ 266 __u32 rate2quantum; /* bps->quantum divisor */
284 __u32 defcls; /* default class number */ 267 __u32 defcls; /* default class number */
@@ -287,8 +270,7 @@ struct tc_htb_glob
287 /* stats */ 270 /* stats */
288 __u32 direct_pkts; /* count of non shapped packets */ 271 __u32 direct_pkts; /* count of non shapped packets */
289}; 272};
290enum 273enum {
291{
292 TCA_HTB_UNSPEC, 274 TCA_HTB_UNSPEC,
293 TCA_HTB_PARMS, 275 TCA_HTB_PARMS,
294 TCA_HTB_INIT, 276 TCA_HTB_INIT,
@@ -299,8 +281,7 @@ enum
299 281
300#define TCA_HTB_MAX (__TCA_HTB_MAX - 1) 282#define TCA_HTB_MAX (__TCA_HTB_MAX - 1)
301 283
302struct tc_htb_xstats 284struct tc_htb_xstats {
303{
304 __u32 lends; 285 __u32 lends;
305 __u32 borrows; 286 __u32 borrows;
306 __u32 giants; /* too big packets (rate will not be accurate) */ 287 __u32 giants; /* too big packets (rate will not be accurate) */
@@ -310,28 +291,24 @@ struct tc_htb_xstats
310 291
311/* HFSC section */ 292/* HFSC section */
312 293
313struct tc_hfsc_qopt 294struct tc_hfsc_qopt {
314{
315 __u16 defcls; /* default class */ 295 __u16 defcls; /* default class */
316}; 296};
317 297
318struct tc_service_curve 298struct tc_service_curve {
319{
320 __u32 m1; /* slope of the first segment in bps */ 299 __u32 m1; /* slope of the first segment in bps */
321 __u32 d; /* x-projection of the first segment in us */ 300 __u32 d; /* x-projection of the first segment in us */
322 __u32 m2; /* slope of the second segment in bps */ 301 __u32 m2; /* slope of the second segment in bps */
323}; 302};
324 303
325struct tc_hfsc_stats 304struct tc_hfsc_stats {
326{
327 __u64 work; /* total work done */ 305 __u64 work; /* total work done */
328 __u64 rtwork; /* work done by real-time criteria */ 306 __u64 rtwork; /* work done by real-time criteria */
329 __u32 period; /* current period */ 307 __u32 period; /* current period */
330 __u32 level; /* class level in hierarchy */ 308 __u32 level; /* class level in hierarchy */
331}; 309};
332 310
333enum 311enum {
334{
335 TCA_HFSC_UNSPEC, 312 TCA_HFSC_UNSPEC,
336 TCA_HFSC_RSC, 313 TCA_HFSC_RSC,
337 TCA_HFSC_FSC, 314 TCA_HFSC_FSC,
@@ -348,8 +325,7 @@ enum
348#define TC_CBQ_MAXLEVEL 8 325#define TC_CBQ_MAXLEVEL 8
349#define TC_CBQ_DEF_EWMA 5 326#define TC_CBQ_DEF_EWMA 5
350 327
351struct tc_cbq_lssopt 328struct tc_cbq_lssopt {
352{
353 unsigned char change; 329 unsigned char change;
354 unsigned char flags; 330 unsigned char flags;
355#define TCF_CBQ_LSS_BOUNDED 1 331#define TCF_CBQ_LSS_BOUNDED 1
@@ -368,8 +344,7 @@ struct tc_cbq_lssopt
368 __u32 avpkt; 344 __u32 avpkt;
369}; 345};
370 346
371struct tc_cbq_wrropt 347struct tc_cbq_wrropt {
372{
373 unsigned char flags; 348 unsigned char flags;
374 unsigned char priority; 349 unsigned char priority;
375 unsigned char cpriority; 350 unsigned char cpriority;
@@ -378,8 +353,7 @@ struct tc_cbq_wrropt
378 __u32 weight; 353 __u32 weight;
379}; 354};
380 355
381struct tc_cbq_ovl 356struct tc_cbq_ovl {
382{
383 unsigned char strategy; 357 unsigned char strategy;
384#define TC_CBQ_OVL_CLASSIC 0 358#define TC_CBQ_OVL_CLASSIC 0
385#define TC_CBQ_OVL_DELAY 1 359#define TC_CBQ_OVL_DELAY 1
@@ -391,30 +365,26 @@ struct tc_cbq_ovl
391 __u32 penalty; 365 __u32 penalty;
392}; 366};
393 367
394struct tc_cbq_police 368struct tc_cbq_police {
395{
396 unsigned char police; 369 unsigned char police;
397 unsigned char __res1; 370 unsigned char __res1;
398 unsigned short __res2; 371 unsigned short __res2;
399}; 372};
400 373
401struct tc_cbq_fopt 374struct tc_cbq_fopt {
402{
403 __u32 split; 375 __u32 split;
404 __u32 defmap; 376 __u32 defmap;
405 __u32 defchange; 377 __u32 defchange;
406}; 378};
407 379
408struct tc_cbq_xstats 380struct tc_cbq_xstats {
409{
410 __u32 borrows; 381 __u32 borrows;
411 __u32 overactions; 382 __u32 overactions;
412 __s32 avgidle; 383 __s32 avgidle;
413 __s32 undertime; 384 __s32 undertime;
414}; 385};
415 386
416enum 387enum {
417{
418 TCA_CBQ_UNSPEC, 388 TCA_CBQ_UNSPEC,
419 TCA_CBQ_LSSOPT, 389 TCA_CBQ_LSSOPT,
420 TCA_CBQ_WRROPT, 390 TCA_CBQ_WRROPT,
@@ -459,8 +429,7 @@ enum {
459 429
460/* Network emulator */ 430/* Network emulator */
461 431
462enum 432enum {
463{
464 TCA_NETEM_UNSPEC, 433 TCA_NETEM_UNSPEC,
465 TCA_NETEM_CORR, 434 TCA_NETEM_CORR,
466 TCA_NETEM_DELAY_DIST, 435 TCA_NETEM_DELAY_DIST,
@@ -471,8 +440,7 @@ enum
471 440
472#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1) 441#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1)
473 442
474struct tc_netem_qopt 443struct tc_netem_qopt {
475{
476 __u32 latency; /* added delay (us) */ 444 __u32 latency; /* added delay (us) */
477 __u32 limit; /* fifo limit (packets) */ 445 __u32 limit; /* fifo limit (packets) */
478 __u32 loss; /* random packet loss (0=none ~0=100%) */ 446 __u32 loss; /* random packet loss (0=none ~0=100%) */
@@ -481,21 +449,18 @@ struct tc_netem_qopt
481 __u32 jitter; /* random jitter in latency (us) */ 449 __u32 jitter; /* random jitter in latency (us) */
482}; 450};
483 451
484struct tc_netem_corr 452struct tc_netem_corr {
485{
486 __u32 delay_corr; /* delay correlation */ 453 __u32 delay_corr; /* delay correlation */
487 __u32 loss_corr; /* packet loss correlation */ 454 __u32 loss_corr; /* packet loss correlation */
488 __u32 dup_corr; /* duplicate correlation */ 455 __u32 dup_corr; /* duplicate correlation */
489}; 456};
490 457
491struct tc_netem_reorder 458struct tc_netem_reorder {
492{
493 __u32 probability; 459 __u32 probability;
494 __u32 correlation; 460 __u32 correlation;
495}; 461};
496 462
497struct tc_netem_corrupt 463struct tc_netem_corrupt {
498{
499 __u32 probability; 464 __u32 probability;
500 __u32 correlation; 465 __u32 correlation;
501}; 466};
@@ -504,8 +469,7 @@ struct tc_netem_corrupt
504 469
505/* DRR */ 470/* DRR */
506 471
507enum 472enum {
508{
509 TCA_DRR_UNSPEC, 473 TCA_DRR_UNSPEC,
510 TCA_DRR_QUANTUM, 474 TCA_DRR_QUANTUM,
511 __TCA_DRR_MAX 475 __TCA_DRR_MAX
@@ -513,8 +477,7 @@ enum
513 477
514#define TCA_DRR_MAX (__TCA_DRR_MAX - 1) 478#define TCA_DRR_MAX (__TCA_DRR_MAX - 1)
515 479
516struct tc_drr_stats 480struct tc_drr_stats {
517{
518 __u32 deficit; 481 __u32 deficit;
519}; 482};
520 483
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index d745f5b6c7b0..76e5053e1fac 100644
--- a/include/linux/pktcdvd.h
+++ b/include/linux/pktcdvd.h
@@ -30,7 +30,7 @@
30 30
31/* 31/*
32 * use drive write caching -- we need deferred error handling to be 32 * use drive write caching -- we need deferred error handling to be
33 * able to sucessfully recover with this option (drive will return good 33 * able to successfully recover with this option (drive will return good
34 * status as soon as the cdb is validated). 34 * status as soon as the cdb is validated).
35 */ 35 */
36#if defined(CONFIG_CDROM_PKTCDVD_WCACHE) 36#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 3c6675c2444b..71ff887ca44e 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -83,6 +83,8 @@ struct early_platform_driver {
83 struct platform_driver *pdrv; 83 struct platform_driver *pdrv;
84 struct list_head list; 84 struct list_head list;
85 int requested_id; 85 int requested_id;
86 char *buffer;
87 int bufsize;
86}; 88};
87 89
88#define EARLY_PLATFORM_ID_UNSET -2 90#define EARLY_PLATFORM_ID_UNSET -2
@@ -102,21 +104,29 @@ extern int early_platform_driver_probe(char *class_str,
102 int nr_probe, int user_only); 104 int nr_probe, int user_only);
103extern void early_platform_cleanup(void); 105extern void early_platform_cleanup(void);
104 106
107#define early_platform_init(class_string, platdrv) \
108 early_platform_init_buffer(class_string, platdrv, NULL, 0)
105 109
106#ifndef MODULE 110#ifndef MODULE
107#define early_platform_init(class_string, platform_driver) \ 111#define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \
108static __initdata struct early_platform_driver early_driver = { \ 112static __initdata struct early_platform_driver early_driver = { \
109 .class_str = class_string, \ 113 .class_str = class_string, \
110 .pdrv = platform_driver, \ 114 .buffer = buf, \
115 .bufsize = bufsiz, \
116 .pdrv = platdrv, \
111 .requested_id = EARLY_PLATFORM_ID_UNSET, \ 117 .requested_id = EARLY_PLATFORM_ID_UNSET, \
112}; \ 118}; \
113static int __init early_platform_driver_setup_func(char *buf) \ 119static int __init early_platform_driver_setup_func(char *buffer) \
114{ \ 120{ \
115 return early_platform_driver_register(&early_driver, buf); \ 121 return early_platform_driver_register(&early_driver, buffer); \
116} \ 122} \
117early_param(class_string, early_platform_driver_setup_func) 123early_param(class_string, early_platform_driver_setup_func)
118#else /* MODULE */ 124#else /* MODULE */
119#define early_platform_init(class_string, platform_driver) 125#define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \
126static inline char *early_platform_driver_setup_func(void) \
127{ \
128 return bufsiz ? buf : NULL; \
129}
120#endif /* MODULE */ 130#endif /* MODULE */
121 131
122#endif /* _PLATFORM_DEVICE_H_ */ 132#endif /* _PLATFORM_DEVICE_H_ */
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 3b7e04b95bd2..0d65934246af 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -178,9 +178,10 @@ typedef struct pm_message {
178 * This need not mean that the device should be put into a low power state. 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 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 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 181 * power and is capable of generating run-time wake-up events, remote
182 * hardware mechanism allowing the device to request a change of its power 182 * wake-up (i.e., a hardware mechanism allowing the device to request a
183 * state, such as PCI PME) should be enabled for it. 183 * change of its power state via a wake-up event, such as PCI PME) should
184 * be enabled for it.
184 * 185 *
185 * @runtime_resume: Put the device into the fully active state in response to a 186 * @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 * wake-up event generated by hardware or at the request of software. If
@@ -428,6 +429,7 @@ struct dev_pm_info {
428 unsigned int idle_notification:1; 429 unsigned int idle_notification:1;
429 unsigned int request_pending:1; 430 unsigned int request_pending:1;
430 unsigned int deferred_resume:1; 431 unsigned int deferred_resume:1;
432 unsigned int run_wake:1;
431 enum rpm_request request; 433 enum rpm_request request;
432 enum rpm_status runtime_status; 434 enum rpm_status runtime_status;
433 int runtime_error; 435 int runtime_error;
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 44087044910f..370ce0a6fe4a 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -50,6 +50,16 @@ static inline void pm_runtime_put_noidle(struct device *dev)
50 atomic_add_unless(&dev->power.usage_count, -1, 0); 50 atomic_add_unless(&dev->power.usage_count, -1, 0);
51} 51}
52 52
53static inline bool device_run_wake(struct device *dev)
54{
55 return dev->power.run_wake;
56}
57
58static inline void device_set_run_wake(struct device *dev, bool enable)
59{
60 dev->power.run_wake = enable;
61}
62
53#else /* !CONFIG_PM_RUNTIME */ 63#else /* !CONFIG_PM_RUNTIME */
54 64
55static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } 65static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; }
@@ -73,6 +83,8 @@ static inline bool pm_children_suspended(struct device *dev) { return false; }
73static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} 83static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
74static inline void pm_runtime_get_noresume(struct device *dev) {} 84static inline void pm_runtime_get_noresume(struct device *dev) {}
75static inline void pm_runtime_put_noidle(struct device *dev) {} 85static inline void pm_runtime_put_noidle(struct device *dev) {}
86static inline bool device_run_wake(struct device *dev) { return false; }
87static inline void device_set_run_wake(struct device *dev, bool enable) {}
76 88
77#endif /* !CONFIG_PM_RUNTIME */ 89#endif /* !CONFIG_PM_RUNTIME */
78 90
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 065a3652a3ea..67608161df6b 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -147,6 +147,20 @@ static inline void forget_cached_acl(struct inode *inode, int type)
147 if (old != ACL_NOT_CACHED) 147 if (old != ACL_NOT_CACHED)
148 posix_acl_release(old); 148 posix_acl_release(old);
149} 149}
150
151static inline void forget_all_cached_acls(struct inode *inode)
152{
153 struct posix_acl *old_access, *old_default;
154 spin_lock(&inode->i_lock);
155 old_access = inode->i_acl;
156 old_default = inode->i_default_acl;
157 inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED;
158 spin_unlock(&inode->i_lock);
159 if (old_access != ACL_NOT_CACHED)
160 posix_acl_release(old_access);
161 if (old_default != ACL_NOT_CACHED)
162 posix_acl_release(old_default);
163}
150#endif 164#endif
151 165
152static inline void cache_no_acl(struct inode *inode) 166static inline void cache_no_acl(struct inode *inode)
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 72b1a10a59b6..2e681d9555bd 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -105,6 +105,11 @@ struct preempt_notifier;
105 * @sched_out: we've just been preempted 105 * @sched_out: we've just been preempted
106 * notifier: struct preempt_notifier for the task being preempted 106 * notifier: struct preempt_notifier for the task being preempted
107 * next: the task that's kicking us out 107 * next: the task that's kicking us out
108 *
109 * Please note that sched_in and out are called under different
110 * contexts. sched_out is called with rq lock held and irq disabled
111 * while sched_in is called without rq lock and irq enabled. This
112 * difference is intentional and depended upon by its users.
108 */ 113 */
109struct preempt_ops { 114struct preempt_ops {
110 void (*sched_in)(struct preempt_notifier *notifier, int cpu); 115 void (*sched_in)(struct preempt_notifier *notifier, int cpu);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 78c48895b12a..e70e62194243 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -73,6 +73,8 @@
73/* Quota format type IDs */ 73/* Quota format type IDs */
74#define QFMT_VFS_OLD 1 74#define QFMT_VFS_OLD 1
75#define QFMT_VFS_V0 2 75#define QFMT_VFS_V0 2
76#define QFMT_OCFS2 3
77#define QFMT_VFS_V1 4
76 78
77/* Size of block in which space limits are passed through the quota 79/* Size of block in which space limits are passed through the quota
78 * interface */ 80 * interface */
@@ -334,7 +336,7 @@ struct quotactl_ops {
334 336
335struct quota_format_type { 337struct quota_format_type {
336 int qf_fmt_id; /* Quota format id */ 338 int qf_fmt_id; /* Quota format id */
337 struct quota_format_ops *qf_ops; /* Operations of format */ 339 const struct quota_format_ops *qf_ops; /* Operations of format */
338 struct module *qf_owner; /* Module implementing quota format */ 340 struct module *qf_owner; /* Module implementing quota format */
339 struct quota_format_type *qf_next; 341 struct quota_format_type *qf_next;
340}; 342};
@@ -376,6 +378,17 @@ static inline unsigned int dquot_generic_flag(unsigned int flags, int type)
376 return flags >> _DQUOT_STATE_FLAGS; 378 return flags >> _DQUOT_STATE_FLAGS;
377} 379}
378 380
381#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
382extern void quota_send_warning(short type, unsigned int id, dev_t dev,
383 const char warntype);
384#else
385static inline void quota_send_warning(short type, unsigned int id, dev_t dev,
386 const char warntype)
387{
388 return;
389}
390#endif /* CONFIG_QUOTA_NETLINK_INTERFACE */
391
379struct quota_info { 392struct quota_info {
380 unsigned int flags; /* Flags for diskquotas on this device */ 393 unsigned int flags; /* Flags for diskquotas on this device */
381 struct mutex dqio_mutex; /* lock device while I/O in progress */ 394 struct mutex dqio_mutex; /* lock device while I/O in progress */
@@ -383,7 +396,7 @@ struct quota_info {
383 struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ 396 struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */
384 struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ 397 struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */
385 struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ 398 struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */
386 struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ 399 const struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
387}; 400};
388 401
389int register_quota_format(struct quota_format_type *fmt); 402int register_quota_format(struct quota_format_type *fmt);
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index d92480f8285c..1cbbd2c11aa9 100644
--- a/include/linux/raid/pq.h
+++ b/include/linux/raid/pq.h
@@ -78,6 +78,25 @@ struct raid6_calls {
78/* Selected algorithm */ 78/* Selected algorithm */
79extern struct raid6_calls raid6_call; 79extern struct raid6_calls raid6_call;
80 80
81/* Various routine sets */
82extern const struct raid6_calls raid6_intx1;
83extern const struct raid6_calls raid6_intx2;
84extern const struct raid6_calls raid6_intx4;
85extern const struct raid6_calls raid6_intx8;
86extern const struct raid6_calls raid6_intx16;
87extern const struct raid6_calls raid6_intx32;
88extern const struct raid6_calls raid6_mmxx1;
89extern const struct raid6_calls raid6_mmxx2;
90extern const struct raid6_calls raid6_sse1x1;
91extern const struct raid6_calls raid6_sse1x2;
92extern const struct raid6_calls raid6_sse2x1;
93extern const struct raid6_calls raid6_sse2x2;
94extern const struct raid6_calls raid6_sse2x4;
95extern const struct raid6_calls raid6_altivec1;
96extern const struct raid6_calls raid6_altivec2;
97extern const struct raid6_calls raid6_altivec4;
98extern const struct raid6_calls raid6_altivec8;
99
81/* Algorithm list */ 100/* Algorithm list */
82extern const struct raid6_calls * const raid6_algos[]; 101extern const struct raid6_calls * const raid6_algos[];
83int raid6_select_algo(void); 102int raid6_select_algo(void);
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 00044b856453..668cf1bef030 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -1,20 +1,31 @@
1#ifndef _LINUX_RATELIMIT_H 1#ifndef _LINUX_RATELIMIT_H
2#define _LINUX_RATELIMIT_H 2#define _LINUX_RATELIMIT_H
3
3#include <linux/param.h> 4#include <linux/param.h>
5#include <linux/spinlock_types.h>
4 6
5#define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) 7#define DEFAULT_RATELIMIT_INTERVAL (5 * HZ)
6#define DEFAULT_RATELIMIT_BURST 10 8#define DEFAULT_RATELIMIT_BURST 10
7 9
8struct ratelimit_state { 10struct ratelimit_state {
9 int interval; 11 spinlock_t lock; /* protect the state */
10 int burst; 12
11 int printed; 13 int interval;
12 int missed; 14 int burst;
13 unsigned long begin; 15 int printed;
16 int missed;
17 unsigned long begin;
14}; 18};
15 19
16#define DEFINE_RATELIMIT_STATE(name, interval, burst) \ 20#define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \
17 struct ratelimit_state name = {interval, burst,} 21 \
22 struct ratelimit_state name = { \
23 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \
24 .interval = interval_init, \
25 .burst = burst_init, \
26 }
27
28extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
29#define __ratelimit(state) ___ratelimit(state, __func__)
18 30
19extern int __ratelimit(struct ratelimit_state *rs); 31#endif /* _LINUX_RATELIMIT_H */
20#endif
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 5710f43bbc9e..1bf0f708c4fc 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -262,6 +262,20 @@ static inline void list_splice_init_rcu(struct list_head *list,
262 (pos) = rcu_dereference((pos)->next)) 262 (pos) = rcu_dereference((pos)->next))
263 263
264/** 264/**
265 * list_for_each_entry_continue_rcu - continue iteration over list of given type
266 * @pos: the type * to use as a loop cursor.
267 * @head: the head for your list.
268 * @member: the name of the list_struct within the struct.
269 *
270 * Continue to iterate over list of given type, continuing after
271 * the current position.
272 */
273#define list_for_each_entry_continue_rcu(pos, head, member) \
274 for (pos = list_entry_rcu(pos->member.next, typeof(*pos), member); \
275 prefetch(pos->member.next), &pos->member != (head); \
276 pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
277
278/**
265 * hlist_del_rcu - deletes entry from hash list without re-initialization 279 * hlist_del_rcu - deletes entry from hash list without re-initialization
266 * @n: the element to delete from the hash list. 280 * @n: the element to delete from the hash list.
267 * 281 *
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 3ebd0b7bcb08..24440f4bf476 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -52,11 +52,6 @@ struct rcu_head {
52}; 52};
53 53
54/* Exported common interfaces */ 54/* Exported common interfaces */
55#ifdef CONFIG_TREE_PREEMPT_RCU
56extern void synchronize_rcu(void);
57#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
58#define synchronize_rcu synchronize_sched
59#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */
60extern void synchronize_rcu_bh(void); 55extern void synchronize_rcu_bh(void);
61extern void synchronize_sched(void); 56extern void synchronize_sched(void);
62extern void rcu_barrier(void); 57extern void rcu_barrier(void);
@@ -67,12 +62,11 @@ extern int sched_expedited_torture_stats(char *page);
67 62
68/* Internal to kernel */ 63/* Internal to kernel */
69extern void rcu_init(void); 64extern void rcu_init(void);
70extern void rcu_scheduler_starting(void);
71extern int rcu_needs_cpu(int cpu);
72extern int rcu_scheduler_active;
73 65
74#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 66#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
75#include <linux/rcutree.h> 67#include <linux/rcutree.h>
68#elif defined(CONFIG_TINY_RCU)
69#include <linux/rcutiny.h>
76#else 70#else
77#error "Unknown RCU implementation specified to kernel configuration" 71#error "Unknown RCU implementation specified to kernel configuration"
78#endif 72#endif
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
new file mode 100644
index 000000000000..c4ba9a78721e
--- /dev/null
+++ b/include/linux/rcutiny.h
@@ -0,0 +1,104 @@
1/*
2 * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition.
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 as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright IBM Corporation, 2008
19 *
20 * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
21 *
22 * For detailed explanation of Read-Copy Update mechanism see -
23 * Documentation/RCU
24 */
25#ifndef __LINUX_TINY_H
26#define __LINUX_TINY_H
27
28#include <linux/cache.h>
29
30void rcu_sched_qs(int cpu);
31void rcu_bh_qs(int cpu);
32
33#define __rcu_read_lock() preempt_disable()
34#define __rcu_read_unlock() preempt_enable()
35#define __rcu_read_lock_bh() local_bh_disable()
36#define __rcu_read_unlock_bh() local_bh_enable()
37#define call_rcu_sched call_rcu
38
39#define rcu_init_sched() do { } while (0)
40extern void rcu_check_callbacks(int cpu, int user);
41
42static inline int rcu_needs_cpu(int cpu)
43{
44 return 0;
45}
46
47/*
48 * Return the number of grace periods.
49 */
50static inline long rcu_batches_completed(void)
51{
52 return 0;
53}
54
55/*
56 * Return the number of bottom-half grace periods.
57 */
58static inline long rcu_batches_completed_bh(void)
59{
60 return 0;
61}
62
63extern int rcu_expedited_torture_stats(char *page);
64
65#define synchronize_rcu synchronize_sched
66
67static inline void synchronize_rcu_expedited(void)
68{
69 synchronize_sched();
70}
71
72static inline void synchronize_rcu_bh_expedited(void)
73{
74 synchronize_sched();
75}
76
77struct notifier_block;
78
79#ifdef CONFIG_NO_HZ
80
81extern void rcu_enter_nohz(void);
82extern void rcu_exit_nohz(void);
83
84#else /* #ifdef CONFIG_NO_HZ */
85
86static inline void rcu_enter_nohz(void)
87{
88}
89
90static inline void rcu_exit_nohz(void)
91{
92}
93
94#endif /* #else #ifdef CONFIG_NO_HZ */
95
96static inline void rcu_scheduler_starting(void)
97{
98}
99
100static inline void exit_rcu(void)
101{
102}
103
104#endif /* __LINUX_RCUTINY_H */
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 9642c6bcb399..c93eee5911b0 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -34,15 +34,15 @@ struct notifier_block;
34 34
35extern void rcu_sched_qs(int cpu); 35extern void rcu_sched_qs(int cpu);
36extern void rcu_bh_qs(int cpu); 36extern void rcu_bh_qs(int cpu);
37extern int rcu_cpu_notify(struct notifier_block *self,
38 unsigned long action, void *hcpu);
39extern int rcu_needs_cpu(int cpu); 37extern int rcu_needs_cpu(int cpu);
38extern void rcu_scheduler_starting(void);
40extern int rcu_expedited_torture_stats(char *page); 39extern int rcu_expedited_torture_stats(char *page);
41 40
42#ifdef CONFIG_TREE_PREEMPT_RCU 41#ifdef CONFIG_TREE_PREEMPT_RCU
43 42
44extern void __rcu_read_lock(void); 43extern void __rcu_read_lock(void);
45extern void __rcu_read_unlock(void); 44extern void __rcu_read_unlock(void);
45extern void synchronize_rcu(void);
46extern void exit_rcu(void); 46extern void exit_rcu(void);
47 47
48#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 48#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
@@ -57,7 +57,7 @@ static inline void __rcu_read_unlock(void)
57 preempt_enable(); 57 preempt_enable();
58} 58}
59 59
60#define __synchronize_sched() synchronize_rcu() 60#define synchronize_rcu synchronize_sched
61 61
62static inline void exit_rcu(void) 62static inline void exit_rcu(void)
63{ 63{
@@ -83,7 +83,6 @@ static inline void synchronize_rcu_bh_expedited(void)
83 synchronize_sched_expedited(); 83 synchronize_sched_expedited();
84} 84}
85 85
86extern void __rcu_init(void);
87extern void rcu_check_callbacks(int cpu, int user); 86extern void rcu_check_callbacks(int cpu, int user);
88 87
89extern long rcu_batches_completed(void); 88extern long rcu_batches_completed(void);
diff --git a/include/linux/rds.h b/include/linux/rds.h
index 89d46e1afbb1..cab4994c2f63 100644
--- a/include/linux/rds.h
+++ b/include/linux/rds.h
@@ -56,6 +56,7 @@
56/* deprecated: RDS_BARRIER 4 */ 56/* deprecated: RDS_BARRIER 4 */
57#define RDS_RECVERR 5 57#define RDS_RECVERR 5
58#define RDS_CONG_MONITOR 6 58#define RDS_CONG_MONITOR 6
59#define RDS_GET_MR_FOR_DEST 7
59 60
60/* 61/*
61 * Control message types for SOL_RDS. 62 * Control message types for SOL_RDS.
@@ -224,6 +225,13 @@ struct rds_get_mr_args {
224 uint64_t flags; 225 uint64_t flags;
225}; 226};
226 227
228struct rds_get_mr_for_dest_args {
229 struct sockaddr_storage dest_addr;
230 struct rds_iovec vec;
231 u_int64_t cookie_addr;
232 uint64_t flags;
233};
234
227struct rds_free_mr_args { 235struct rds_free_mr_args {
228 rds_rdma_cookie_t cookie; 236 rds_rdma_cookie_t cookie;
229 u_int64_t flags; 237 u_int64_t flags;
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index dd31e7bae35c..a05b4a20768d 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -52,11 +52,63 @@
52#define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION 52#define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION
53#define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION 53#define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION
54 54
55/* Locking primitives */ 55/*
56/* Right now we are still falling back to (un)lock_kernel, but eventually that 56 * Locking primitives. The write lock is a per superblock
57 would evolve into real per-fs locks */ 57 * special mutex that has properties close to the Big Kernel Lock
58#define reiserfs_write_lock( sb ) lock_kernel() 58 * which was used in the previous locking scheme.
59#define reiserfs_write_unlock( sb ) unlock_kernel() 59 */
60void reiserfs_write_lock(struct super_block *s);
61void reiserfs_write_unlock(struct super_block *s);
62int reiserfs_write_lock_once(struct super_block *s);
63void reiserfs_write_unlock_once(struct super_block *s, int lock_depth);
64
65/*
66 * Several mutexes depend on the write lock.
67 * However sometimes we want to relax the write lock while we hold
68 * these mutexes, according to the release/reacquire on schedule()
69 * properties of the Bkl that were used.
70 * Reiserfs performances and locking were based on this scheme.
71 * Now that the write lock is a mutex and not the bkl anymore, doing so
72 * may result in a deadlock:
73 *
74 * A acquire write_lock
75 * A acquire j_commit_mutex
76 * A release write_lock and wait for something
77 * B acquire write_lock
78 * B can't acquire j_commit_mutex and sleep
79 * A can't acquire write lock anymore
80 * deadlock
81 *
82 * What we do here is avoiding such deadlock by playing the same game
83 * than the Bkl: if we can't acquire a mutex that depends on the write lock,
84 * we release the write lock, wait a bit and then retry.
85 *
86 * The mutexes concerned by this hack are:
87 * - The commit mutex of a journal list
88 * - The flush mutex
89 * - The journal lock
90 * - The inode mutex
91 */
92static inline void reiserfs_mutex_lock_safe(struct mutex *m,
93 struct super_block *s)
94{
95 reiserfs_write_unlock(s);
96 mutex_lock(m);
97 reiserfs_write_lock(s);
98}
99
100/*
101 * When we schedule, we usually want to also release the write lock,
102 * according to the previous bkl based locking scheme of reiserfs.
103 */
104static inline void reiserfs_cond_resched(struct super_block *s)
105{
106 if (need_resched()) {
107 reiserfs_write_unlock(s);
108 schedule();
109 reiserfs_write_lock(s);
110 }
111}
60 112
61struct fid; 113struct fid;
62 114
@@ -1329,7 +1381,11 @@ static inline loff_t max_reiserfs_offset(struct inode *inode)
1329#define get_generation(s) atomic_read (&fs_generation(s)) 1381#define get_generation(s) atomic_read (&fs_generation(s))
1330#define FILESYSTEM_CHANGED_TB(tb) (get_generation((tb)->tb_sb) != (tb)->fs_gen) 1382#define FILESYSTEM_CHANGED_TB(tb) (get_generation((tb)->tb_sb) != (tb)->fs_gen)
1331#define __fs_changed(gen,s) (gen != get_generation (s)) 1383#define __fs_changed(gen,s) (gen != get_generation (s))
1332#define fs_changed(gen,s) ({cond_resched(); __fs_changed(gen, s);}) 1384#define fs_changed(gen,s) \
1385({ \
1386 reiserfs_cond_resched(s); \
1387 __fs_changed(gen, s); \
1388})
1333 1389
1334/***************************************************************************/ 1390/***************************************************************************/
1335/* FIXATE NODES */ 1391/* FIXATE NODES */
@@ -2258,8 +2314,7 @@ __u32 r5_hash(const signed char *msg, int len);
2258#define SPARE_SPACE 500 2314#define SPARE_SPACE 500
2259 2315
2260/* prototypes from ioctl.c */ 2316/* prototypes from ioctl.c */
2261int reiserfs_ioctl(struct inode *inode, struct file *filp, 2317long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
2262 unsigned int cmd, unsigned long arg);
2263long reiserfs_compat_ioctl(struct file *filp, 2318long reiserfs_compat_ioctl(struct file *filp,
2264 unsigned int cmd, unsigned long arg); 2319 unsigned int cmd, unsigned long arg);
2265int reiserfs_unpack(struct inode *inode, struct file *filp); 2320int reiserfs_unpack(struct inode *inode, struct file *filp);
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index dab68bbed675..52c83b6a758a 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -7,6 +7,8 @@
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <linux/workqueue.h> 8#include <linux/workqueue.h>
9#include <linux/rwsem.h> 9#include <linux/rwsem.h>
10#include <linux/mutex.h>
11#include <linux/sched.h>
10#endif 12#endif
11 13
12typedef enum { 14typedef enum {
@@ -355,6 +357,13 @@ struct reiserfs_sb_info {
355 struct reiserfs_journal *s_journal; /* pointer to journal information */ 357 struct reiserfs_journal *s_journal; /* pointer to journal information */
356 unsigned short s_mount_state; /* reiserfs state (valid, invalid) */ 358 unsigned short s_mount_state; /* reiserfs state (valid, invalid) */
357 359
360 /* Serialize writers access, replace the old bkl */
361 struct mutex lock;
362 /* Owner of the lock (can be recursive) */
363 struct task_struct *lock_owner;
364 /* Depth of the lock, start from -1 like the bkl */
365 int lock_depth;
366
358 /* Comment? -Hans */ 367 /* Comment? -Hans */
359 void (*end_io_handler) (struct buffer_head *, int); 368 void (*end_io_handler) (struct buffer_head *, int);
360 hashf_t s_hash_function; /* pointer to function which is used 369 hashf_t s_hash_function; /* pointer to function which is used
@@ -408,6 +417,17 @@ struct reiserfs_sb_info {
408 char *s_qf_names[MAXQUOTAS]; 417 char *s_qf_names[MAXQUOTAS];
409 int s_jquota_fmt; 418 int s_jquota_fmt;
410#endif 419#endif
420#ifdef CONFIG_REISERFS_CHECK
421
422 struct tree_balance *cur_tb; /*
423 * Detects whether more than one
424 * copy of tb exists per superblock
425 * as a means of checking whether
426 * do_balance is executing concurrently
427 * against another tree reader/writer
428 * on a same mount point.
429 */
430#endif
411}; 431};
412 432
413/* Definitions of reiserfs on-disk properties: */ 433/* Definitions of reiserfs on-disk properties: */
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 3392c59d2706..97059d08a626 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -35,6 +35,8 @@
35 * @RFKILL_TYPE_UWB: switch is on a ultra wideband device. 35 * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
36 * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device. 36 * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
37 * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device. 37 * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
38 * @RFKILL_TYPE_GPS: switch is on a GPS device.
39 * @RFKILL_TYPE_FM: switch is on a FM radio device.
38 * @NUM_RFKILL_TYPES: number of defined rfkill types 40 * @NUM_RFKILL_TYPES: number of defined rfkill types
39 */ 41 */
40enum rfkill_type { 42enum rfkill_type {
@@ -45,6 +47,7 @@ enum rfkill_type {
45 RFKILL_TYPE_WIMAX, 47 RFKILL_TYPE_WIMAX,
46 RFKILL_TYPE_WWAN, 48 RFKILL_TYPE_WWAN,
47 RFKILL_TYPE_GPS, 49 RFKILL_TYPE_GPS,
50 RFKILL_TYPE_FM,
48 NUM_RFKILL_TYPES, 51 NUM_RFKILL_TYPES,
49}; 52};
50 53
diff --git a/include/linux/route.h b/include/linux/route.h
index f7ed35d5e653..6600708311c8 100644
--- a/include/linux/route.h
+++ b/include/linux/route.h
@@ -27,8 +27,7 @@
27#include <linux/compiler.h> 27#include <linux/compiler.h>
28 28
29/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */ 29/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
30struct rtentry 30struct rtentry {
31{
32 unsigned long rt_pad1; 31 unsigned long rt_pad1;
33 struct sockaddr rt_dst; /* target address */ 32 struct sockaddr rt_dst; /* target address */
34 struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */ 33 struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index adf2068d12b5..14fc906ed602 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -127,8 +127,7 @@ enum {
127 with attribute type. 127 with attribute type.
128 */ 128 */
129 129
130struct rtattr 130struct rtattr {
131{
132 unsigned short rta_len; 131 unsigned short rta_len;
133 unsigned short rta_type; 132 unsigned short rta_type;
134}; 133};
@@ -154,8 +153,7 @@ struct rtattr
154 * Definitions used in routing table administration. 153 * Definitions used in routing table administration.
155 ****/ 154 ****/
156 155
157struct rtmsg 156struct rtmsg {
158{
159 unsigned char rtm_family; 157 unsigned char rtm_family;
160 unsigned char rtm_dst_len; 158 unsigned char rtm_dst_len;
161 unsigned char rtm_src_len; 159 unsigned char rtm_src_len;
@@ -171,8 +169,7 @@ struct rtmsg
171 169
172/* rtm_type */ 170/* rtm_type */
173 171
174enum 172enum {
175{
176 RTN_UNSPEC, 173 RTN_UNSPEC,
177 RTN_UNICAST, /* Gateway or direct route */ 174 RTN_UNICAST, /* Gateway or direct route */
178 RTN_LOCAL, /* Accept locally */ 175 RTN_LOCAL, /* Accept locally */
@@ -230,8 +227,7 @@ enum
230 could be assigned a value between UNIVERSE and LINK. 227 could be assigned a value between UNIVERSE and LINK.
231*/ 228*/
232 229
233enum rt_scope_t 230enum rt_scope_t {
234{
235 RT_SCOPE_UNIVERSE=0, 231 RT_SCOPE_UNIVERSE=0,
236/* User defined values */ 232/* User defined values */
237 RT_SCOPE_SITE=200, 233 RT_SCOPE_SITE=200,
@@ -249,8 +245,7 @@ enum rt_scope_t
249 245
250/* Reserved table identifiers */ 246/* Reserved table identifiers */
251 247
252enum rt_class_t 248enum rt_class_t {
253{
254 RT_TABLE_UNSPEC=0, 249 RT_TABLE_UNSPEC=0,
255/* User defined values */ 250/* User defined values */
256 RT_TABLE_COMPAT=252, 251 RT_TABLE_COMPAT=252,
@@ -263,8 +258,7 @@ enum rt_class_t
263 258
264/* Routing message attributes */ 259/* Routing message attributes */
265 260
266enum rtattr_type_t 261enum rtattr_type_t {
267{
268 RTA_UNSPEC, 262 RTA_UNSPEC,
269 RTA_DST, 263 RTA_DST,
270 RTA_SRC, 264 RTA_SRC,
@@ -298,8 +292,7 @@ enum rtattr_type_t
298 * and rtt for different paths from multipath. 292 * and rtt for different paths from multipath.
299 */ 293 */
300 294
301struct rtnexthop 295struct rtnexthop {
302{
303 unsigned short rtnh_len; 296 unsigned short rtnh_len;
304 unsigned char rtnh_flags; 297 unsigned char rtnh_flags;
305 unsigned char rtnh_hops; 298 unsigned char rtnh_hops;
@@ -325,8 +318,7 @@ struct rtnexthop
325 318
326/* RTM_CACHEINFO */ 319/* RTM_CACHEINFO */
327 320
328struct rta_cacheinfo 321struct rta_cacheinfo {
329{
330 __u32 rta_clntref; 322 __u32 rta_clntref;
331 __u32 rta_lastuse; 323 __u32 rta_lastuse;
332 __s32 rta_expires; 324 __s32 rta_expires;
@@ -341,8 +333,7 @@ struct rta_cacheinfo
341 333
342/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */ 334/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
343 335
344enum 336enum {
345{
346 RTAX_UNSPEC, 337 RTAX_UNSPEC,
347#define RTAX_UNSPEC RTAX_UNSPEC 338#define RTAX_UNSPEC RTAX_UNSPEC
348 RTAX_LOCK, 339 RTAX_LOCK,
@@ -377,12 +368,13 @@ enum
377#define RTAX_MAX (__RTAX_MAX - 1) 368#define RTAX_MAX (__RTAX_MAX - 1)
378 369
379#define RTAX_FEATURE_ECN 0x00000001 370#define RTAX_FEATURE_ECN 0x00000001
380#define RTAX_FEATURE_SACK 0x00000002 371#define RTAX_FEATURE_NO_SACK 0x00000002
381#define RTAX_FEATURE_TIMESTAMP 0x00000004 372#define RTAX_FEATURE_NO_TSTAMP 0x00000004
382#define RTAX_FEATURE_ALLFRAG 0x00000008 373#define RTAX_FEATURE_ALLFRAG 0x00000008
374#define RTAX_FEATURE_NO_WSCALE 0x00000010
375#define RTAX_FEATURE_NO_DSACK 0x00000020
383 376
384struct rta_session 377struct rta_session {
385{
386 __u8 proto; 378 __u8 proto;
387 __u8 pad1; 379 __u8 pad1;
388 __u16 pad2; 380 __u16 pad2;
@@ -407,8 +399,7 @@ struct rta_session
407 * General form of address family dependent message. 399 * General form of address family dependent message.
408 ****/ 400 ****/
409 401
410struct rtgenmsg 402struct rtgenmsg {
411{
412 unsigned char rtgen_family; 403 unsigned char rtgen_family;
413}; 404};
414 405
@@ -421,8 +412,7 @@ struct rtgenmsg
421 * on network protocol. 412 * on network protocol.
422 */ 413 */
423 414
424struct ifinfomsg 415struct ifinfomsg {
425{
426 unsigned char ifi_family; 416 unsigned char ifi_family;
427 unsigned char __ifi_pad; 417 unsigned char __ifi_pad;
428 unsigned short ifi_type; /* ARPHRD_* */ 418 unsigned short ifi_type; /* ARPHRD_* */
@@ -435,8 +425,7 @@ struct ifinfomsg
435 * prefix information 425 * prefix information
436 ****/ 426 ****/
437 427
438struct prefixmsg 428struct prefixmsg {
439{
440 unsigned char prefix_family; 429 unsigned char prefix_family;
441 unsigned char prefix_pad1; 430 unsigned char prefix_pad1;
442 unsigned short prefix_pad2; 431 unsigned short prefix_pad2;
@@ -457,8 +446,7 @@ enum
457 446
458#define PREFIX_MAX (__PREFIX_MAX - 1) 447#define PREFIX_MAX (__PREFIX_MAX - 1)
459 448
460struct prefix_cacheinfo 449struct prefix_cacheinfo {
461{
462 __u32 preferred_time; 450 __u32 preferred_time;
463 __u32 valid_time; 451 __u32 valid_time;
464}; 452};
@@ -468,8 +456,7 @@ struct prefix_cacheinfo
468 * Traffic control messages. 456 * Traffic control messages.
469 ****/ 457 ****/
470 458
471struct tcmsg 459struct tcmsg {
472{
473 unsigned char tcm_family; 460 unsigned char tcm_family;
474 unsigned char tcm__pad1; 461 unsigned char tcm__pad1;
475 unsigned short tcm__pad2; 462 unsigned short tcm__pad2;
@@ -479,8 +466,7 @@ struct tcmsg
479 __u32 tcm_info; 466 __u32 tcm_info;
480}; 467};
481 468
482enum 469enum {
483{
484 TCA_UNSPEC, 470 TCA_UNSPEC,
485 TCA_KIND, 471 TCA_KIND,
486 TCA_OPTIONS, 472 TCA_OPTIONS,
@@ -502,8 +488,7 @@ enum
502 * Neighbor Discovery userland options 488 * Neighbor Discovery userland options
503 ****/ 489 ****/
504 490
505struct nduseroptmsg 491struct nduseroptmsg {
506{
507 unsigned char nduseropt_family; 492 unsigned char nduseropt_family;
508 unsigned char nduseropt_pad1; 493 unsigned char nduseropt_pad1;
509 unsigned short nduseropt_opts_len; /* Total length of options */ 494 unsigned short nduseropt_opts_len; /* Total length of options */
@@ -515,8 +500,7 @@ struct nduseroptmsg
515 /* Followed by one or more ND options */ 500 /* Followed by one or more ND options */
516}; 501};
517 502
518enum 503enum {
519{
520 NDUSEROPT_UNSPEC, 504 NDUSEROPT_UNSPEC,
521 NDUSEROPT_SRCADDR, 505 NDUSEROPT_SRCADDR,
522 __NDUSEROPT_MAX 506 __NDUSEROPT_MAX
@@ -598,8 +582,7 @@ enum rtnetlink_groups {
598#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) 582#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
599 583
600/* TC action piece */ 584/* TC action piece */
601struct tcamsg 585struct tcamsg {
602{
603 unsigned char tca_family; 586 unsigned char tca_family;
604 unsigned char tca__pad1; 587 unsigned char tca__pad1;
605 unsigned short tca__pad2; 588 unsigned short tca__pad2;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 75e6e60bf583..294eb2f80144 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -145,7 +145,6 @@ extern unsigned long this_cpu_load(void);
145 145
146 146
147extern void calc_global_load(void); 147extern void calc_global_load(void);
148extern u64 cpu_nr_migrations(int cpu);
149 148
150extern unsigned long get_parent_ip(unsigned long addr); 149extern unsigned long get_parent_ip(unsigned long addr);
151 150
@@ -171,8 +170,6 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
171} 170}
172#endif 171#endif
173 172
174extern unsigned long long time_sync_thresh;
175
176/* 173/*
177 * Task state bitmask. NOTE! These bits are also 174 * Task state bitmask. NOTE! These bits are also
178 * encoded in fs/proc/array.c: get_task_state(). 175 * encoded in fs/proc/array.c: get_task_state().
@@ -349,7 +346,6 @@ extern signed long schedule_timeout(signed long timeout);
349extern signed long schedule_timeout_interruptible(signed long timeout); 346extern signed long schedule_timeout_interruptible(signed long timeout);
350extern signed long schedule_timeout_killable(signed long timeout); 347extern signed long schedule_timeout_killable(signed long timeout);
351extern signed long schedule_timeout_uninterruptible(signed long timeout); 348extern signed long schedule_timeout_uninterruptible(signed long timeout);
352asmlinkage void __schedule(void);
353asmlinkage void schedule(void); 349asmlinkage void schedule(void);
354extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); 350extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner);
355 351
@@ -628,6 +624,9 @@ struct signal_struct {
628 cputime_t utime, stime, cutime, cstime; 624 cputime_t utime, stime, cutime, cstime;
629 cputime_t gtime; 625 cputime_t gtime;
630 cputime_t cgtime; 626 cputime_t cgtime;
627#ifndef CONFIG_VIRT_CPU_ACCOUNTING
628 cputime_t prev_utime, prev_stime;
629#endif
631 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 630 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
632 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; 631 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
633 unsigned long inblock, oublock, cinblock, coublock; 632 unsigned long inblock, oublock, cinblock, coublock;
@@ -1013,9 +1012,13 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
1013 return to_cpumask(sd->span); 1012 return to_cpumask(sd->span);
1014} 1013}
1015 1014
1016extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, 1015extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
1017 struct sched_domain_attr *dattr_new); 1016 struct sched_domain_attr *dattr_new);
1018 1017
1018/* Allocate an array of sched domains, for partition_sched_domains(). */
1019cpumask_var_t *alloc_sched_domains(unsigned int ndoms);
1020void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms);
1021
1019/* Test a flag in parent sched domain */ 1022/* Test a flag in parent sched domain */
1020static inline int test_sd_parent(struct sched_domain *sd, int flag) 1023static inline int test_sd_parent(struct sched_domain *sd, int flag)
1021{ 1024{
@@ -1033,7 +1036,7 @@ unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu);
1033struct sched_domain_attr; 1036struct sched_domain_attr;
1034 1037
1035static inline void 1038static inline void
1036partition_sched_domains(int ndoms_new, struct cpumask *doms_new, 1039partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
1037 struct sched_domain_attr *dattr_new) 1040 struct sched_domain_attr *dattr_new)
1038{ 1041{
1039} 1042}
@@ -1099,7 +1102,7 @@ struct sched_class {
1099 1102
1100 void (*set_curr_task) (struct rq *rq); 1103 void (*set_curr_task) (struct rq *rq);
1101 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); 1104 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued);
1102 void (*task_new) (struct rq *rq, struct task_struct *p); 1105 void (*task_fork) (struct task_struct *p);
1103 1106
1104 void (*switched_from) (struct rq *this_rq, struct task_struct *task, 1107 void (*switched_from) (struct rq *this_rq, struct task_struct *task,
1105 int running); 1108 int running);
@@ -1108,7 +1111,8 @@ struct sched_class {
1108 void (*prio_changed) (struct rq *this_rq, struct task_struct *task, 1111 void (*prio_changed) (struct rq *this_rq, struct task_struct *task,
1109 int oldprio, int running); 1112 int oldprio, int running);
1110 1113
1111 unsigned int (*get_rr_interval) (struct task_struct *task); 1114 unsigned int (*get_rr_interval) (struct rq *rq,
1115 struct task_struct *task);
1112 1116
1113#ifdef CONFIG_FAIR_GROUP_SCHED 1117#ifdef CONFIG_FAIR_GROUP_SCHED
1114 void (*moved_group) (struct task_struct *p); 1118 void (*moved_group) (struct task_struct *p);
@@ -1148,8 +1152,6 @@ struct sched_entity {
1148 u64 start_runtime; 1152 u64 start_runtime;
1149 u64 avg_wakeup; 1153 u64 avg_wakeup;
1150 1154
1151 u64 avg_running;
1152
1153#ifdef CONFIG_SCHEDSTATS 1155#ifdef CONFIG_SCHEDSTATS
1154 u64 wait_start; 1156 u64 wait_start;
1155 u64 wait_max; 1157 u64 wait_max;
@@ -1172,7 +1174,6 @@ struct sched_entity {
1172 u64 nr_failed_migrations_running; 1174 u64 nr_failed_migrations_running;
1173 u64 nr_failed_migrations_hot; 1175 u64 nr_failed_migrations_hot;
1174 u64 nr_forced_migrations; 1176 u64 nr_forced_migrations;
1175 u64 nr_forced2_migrations;
1176 1177
1177 u64 nr_wakeups; 1178 u64 nr_wakeups;
1178 u64 nr_wakeups_sync; 1179 u64 nr_wakeups_sync;
@@ -1331,7 +1332,9 @@ struct task_struct {
1331 1332
1332 cputime_t utime, stime, utimescaled, stimescaled; 1333 cputime_t utime, stime, utimescaled, stimescaled;
1333 cputime_t gtime; 1334 cputime_t gtime;
1335#ifndef CONFIG_VIRT_CPU_ACCOUNTING
1334 cputime_t prev_utime, prev_stime; 1336 cputime_t prev_utime, prev_stime;
1337#endif
1335 unsigned long nvcsw, nivcsw; /* context switch counts */ 1338 unsigned long nvcsw, nivcsw; /* context switch counts */
1336 struct timespec start_time; /* monotonic time */ 1339 struct timespec start_time; /* monotonic time */
1337 struct timespec real_start_time; /* boot based time */ 1340 struct timespec real_start_time; /* boot based time */
@@ -1421,17 +1424,17 @@ struct task_struct {
1421#endif 1424#endif
1422#ifdef CONFIG_TRACE_IRQFLAGS 1425#ifdef CONFIG_TRACE_IRQFLAGS
1423 unsigned int irq_events; 1426 unsigned int irq_events;
1424 int hardirqs_enabled;
1425 unsigned long hardirq_enable_ip; 1427 unsigned long hardirq_enable_ip;
1426 unsigned int hardirq_enable_event;
1427 unsigned long hardirq_disable_ip; 1428 unsigned long hardirq_disable_ip;
1429 unsigned int hardirq_enable_event;
1428 unsigned int hardirq_disable_event; 1430 unsigned int hardirq_disable_event;
1429 int softirqs_enabled; 1431 int hardirqs_enabled;
1432 int hardirq_context;
1430 unsigned long softirq_disable_ip; 1433 unsigned long softirq_disable_ip;
1431 unsigned int softirq_disable_event;
1432 unsigned long softirq_enable_ip; 1434 unsigned long softirq_enable_ip;
1435 unsigned int softirq_disable_event;
1433 unsigned int softirq_enable_event; 1436 unsigned int softirq_enable_event;
1434 int hardirq_context; 1437 int softirqs_enabled;
1435 int softirq_context; 1438 int softirq_context;
1436#endif 1439#endif
1437#ifdef CONFIG_LOCKDEP 1440#ifdef CONFIG_LOCKDEP
@@ -1720,9 +1723,8 @@ static inline void put_task_struct(struct task_struct *t)
1720 __put_task_struct(t); 1723 __put_task_struct(t);
1721} 1724}
1722 1725
1723extern cputime_t task_utime(struct task_struct *p); 1726extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
1724extern cputime_t task_stime(struct task_struct *p); 1727extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
1725extern cputime_t task_gtime(struct task_struct *p);
1726 1728
1727/* 1729/*
1728 * Per process flags 1730 * Per process flags
@@ -1836,7 +1838,8 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1836extern int sched_clock_stable; 1838extern int sched_clock_stable;
1837#endif 1839#endif
1838 1840
1839extern unsigned long long sched_clock(void); 1841/* ftrace calls sched_clock() directly */
1842extern unsigned long long notrace sched_clock(void);
1840 1843
1841extern void sched_clock_init(void); 1844extern void sched_clock_init(void);
1842extern u64 sched_clock_cpu(int cpu); 1845extern u64 sched_clock_cpu(int cpu);
@@ -1899,14 +1902,22 @@ extern unsigned int sysctl_sched_wakeup_granularity;
1899extern unsigned int sysctl_sched_shares_ratelimit; 1902extern unsigned int sysctl_sched_shares_ratelimit;
1900extern unsigned int sysctl_sched_shares_thresh; 1903extern unsigned int sysctl_sched_shares_thresh;
1901extern unsigned int sysctl_sched_child_runs_first; 1904extern unsigned int sysctl_sched_child_runs_first;
1905
1906enum sched_tunable_scaling {
1907 SCHED_TUNABLESCALING_NONE,
1908 SCHED_TUNABLESCALING_LOG,
1909 SCHED_TUNABLESCALING_LINEAR,
1910 SCHED_TUNABLESCALING_END,
1911};
1912extern enum sched_tunable_scaling sysctl_sched_tunable_scaling;
1913
1902#ifdef CONFIG_SCHED_DEBUG 1914#ifdef CONFIG_SCHED_DEBUG
1903extern unsigned int sysctl_sched_features;
1904extern unsigned int sysctl_sched_migration_cost; 1915extern unsigned int sysctl_sched_migration_cost;
1905extern unsigned int sysctl_sched_nr_migrate; 1916extern unsigned int sysctl_sched_nr_migrate;
1906extern unsigned int sysctl_sched_time_avg; 1917extern unsigned int sysctl_sched_time_avg;
1907extern unsigned int sysctl_timer_migration; 1918extern unsigned int sysctl_timer_migration;
1908 1919
1909int sched_nr_latency_handler(struct ctl_table *table, int write, 1920int sched_proc_update_handler(struct ctl_table *table, int write,
1910 void __user *buffer, size_t *length, 1921 void __user *buffer, size_t *length,
1911 loff_t *ppos); 1922 loff_t *ppos);
1912#endif 1923#endif
@@ -2086,11 +2097,18 @@ static inline int is_si_special(const struct siginfo *info)
2086 return info <= SEND_SIG_FORCED; 2097 return info <= SEND_SIG_FORCED;
2087} 2098}
2088 2099
2089/* True if we are on the alternate signal stack. */ 2100/*
2090 2101 * True if we are on the alternate signal stack.
2102 */
2091static inline int on_sig_stack(unsigned long sp) 2103static inline int on_sig_stack(unsigned long sp)
2092{ 2104{
2093 return (sp - current->sas_ss_sp < current->sas_ss_size); 2105#ifdef CONFIG_STACK_GROWSUP
2106 return sp >= current->sas_ss_sp &&
2107 sp - current->sas_ss_sp < current->sas_ss_size;
2108#else
2109 return sp > current->sas_ss_sp &&
2110 sp - current->sas_ss_sp <= current->sas_ss_size;
2111#endif
2094} 2112}
2095 2113
2096static inline int sas_ss_flags(unsigned long sp) 2114static inline int sas_ss_flags(unsigned long sp)
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index 1ee2c05142f6..899fbb487c94 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -14,7 +14,8 @@ struct screen_info {
14 __u16 orig_video_page; /* 0x04 */ 14 __u16 orig_video_page; /* 0x04 */
15 __u8 orig_video_mode; /* 0x06 */ 15 __u8 orig_video_mode; /* 0x06 */
16 __u8 orig_video_cols; /* 0x07 */ 16 __u8 orig_video_cols; /* 0x07 */
17 __u16 unused2; /* 0x08 */ 17 __u8 flags; /* 0x08 */
18 __u8 unused2; /* 0x09 */
18 __u16 orig_video_ega_bx;/* 0x0a */ 19 __u16 orig_video_ega_bx;/* 0x0a */
19 __u16 unused3; /* 0x0c */ 20 __u16 unused3; /* 0x0c */
20 __u8 orig_video_lines; /* 0x0e */ 21 __u8 orig_video_lines; /* 0x0e */
@@ -65,6 +66,8 @@ struct screen_info {
65 66
66#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */ 67#define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */
67 68
69#define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */
70
68#ifdef __KERNEL__ 71#ifdef __KERNEL__
69extern struct screen_info screen_info; 72extern struct screen_info screen_info;
70 73
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index b464b9d3d242..c20d3ce673c0 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -242,6 +242,7 @@ enum {
242 SCTP_DATA_FIRST_FRAG = 0x02, 242 SCTP_DATA_FIRST_FRAG = 0x02,
243 SCTP_DATA_NOT_FRAG = 0x03, 243 SCTP_DATA_NOT_FRAG = 0x03,
244 SCTP_DATA_UNORDERED = 0x04, 244 SCTP_DATA_UNORDERED = 0x04,
245 SCTP_DATA_SACK_IMM = 0x08,
245}; 246};
246enum { SCTP_DATA_FRAG_MASK = 0x03, }; 247enum { SCTP_DATA_FRAG_MASK = 0x03, };
247 248
diff --git a/include/linux/securebits.h b/include/linux/securebits.h
index d2c5ed845bcc..33406174cbe8 100644
--- a/include/linux/securebits.h
+++ b/include/linux/securebits.h
@@ -1,6 +1,15 @@
1#ifndef _LINUX_SECUREBITS_H 1#ifndef _LINUX_SECUREBITS_H
2#define _LINUX_SECUREBITS_H 1 2#define _LINUX_SECUREBITS_H 1
3 3
4/* Each securesetting is implemented using two bits. One bit specifies
5 whether the setting is on or off. The other bit specify whether the
6 setting is locked or not. A setting which is locked cannot be
7 changed from user-level. */
8#define issecure_mask(X) (1 << (X))
9#ifdef __KERNEL__
10#define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits))
11#endif
12
4#define SECUREBITS_DEFAULT 0x00000000 13#define SECUREBITS_DEFAULT 0x00000000
5 14
6/* When set UID 0 has no special privileges. When unset, we support 15/* When set UID 0 has no special privileges. When unset, we support
@@ -12,6 +21,9 @@
12#define SECURE_NOROOT 0 21#define SECURE_NOROOT 0
13#define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ 22#define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */
14 23
24#define SECBIT_NOROOT (issecure_mask(SECURE_NOROOT))
25#define SECBIT_NOROOT_LOCKED (issecure_mask(SECURE_NOROOT_LOCKED))
26
15/* When set, setuid to/from uid 0 does not trigger capability-"fixup". 27/* When set, setuid to/from uid 0 does not trigger capability-"fixup".
16 When unset, to provide compatiblility with old programs relying on 28 When unset, to provide compatiblility with old programs relying on
17 set*uid to gain/lose privilege, transitions to/from uid 0 cause 29 set*uid to gain/lose privilege, transitions to/from uid 0 cause
@@ -19,6 +31,10 @@
19#define SECURE_NO_SETUID_FIXUP 2 31#define SECURE_NO_SETUID_FIXUP 2
20#define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ 32#define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */
21 33
34#define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP))
35#define SECBIT_NO_SETUID_FIXUP_LOCKED \
36 (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED))
37
22/* When set, a process can retain its capabilities even after 38/* When set, a process can retain its capabilities even after
23 transitioning to a non-root user (the set-uid fixup suppressed by 39 transitioning to a non-root user (the set-uid fixup suppressed by
24 bit 2). Bit-4 is cleared when a process calls exec(); setting both 40 bit 2). Bit-4 is cleared when a process calls exec(); setting both
@@ -27,12 +43,8 @@
27#define SECURE_KEEP_CAPS 4 43#define SECURE_KEEP_CAPS 4
28#define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ 44#define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */
29 45
30/* Each securesetting is implemented using two bits. One bit specifies 46#define SECBIT_KEEP_CAPS (issecure_mask(SECURE_KEEP_CAPS))
31 whether the setting is on or off. The other bit specify whether the 47#define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED))
32 setting is locked or not. A setting which is locked cannot be
33 changed from user-level. */
34#define issecure_mask(X) (1 << (X))
35#define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits))
36 48
37#define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ 49#define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \
38 issecure_mask(SECURE_NO_SETUID_FIXUP) | \ 50 issecure_mask(SECURE_NO_SETUID_FIXUP) | \
diff --git a/include/linux/security.h b/include/linux/security.h
index 239e40d0450b..466cbadbd1ef 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -447,6 +447,22 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
447 * @new_dir contains the path structure for parent of the new link. 447 * @new_dir contains the path structure for parent of the new link.
448 * @new_dentry contains the dentry structure of the new link. 448 * @new_dentry contains the dentry structure of the new link.
449 * Return 0 if permission is granted. 449 * Return 0 if permission is granted.
450 * @path_chmod:
451 * Check for permission to change DAC's permission of a file or directory.
452 * @dentry contains the dentry structure.
453 * @mnt contains the vfsmnt structure.
454 * @mode contains DAC's mode.
455 * Return 0 if permission is granted.
456 * @path_chown:
457 * Check for permission to change owner/group of a file or directory.
458 * @path contains the path structure.
459 * @uid contains new owner's ID.
460 * @gid contains new group's ID.
461 * Return 0 if permission is granted.
462 * @path_chroot:
463 * Check for permission to change root directory.
464 * @path contains the path structure.
465 * Return 0 if permission is granted.
450 * @inode_readlink: 466 * @inode_readlink:
451 * Check the permission to read the symbolic link. 467 * Check the permission to read the symbolic link.
452 * @dentry contains the dentry structure for the file link. 468 * @dentry contains the dentry structure for the file link.
@@ -690,6 +706,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
690 * @kernel_module_request: 706 * @kernel_module_request:
691 * Ability to trigger the kernel to automatically upcall to userspace for 707 * Ability to trigger the kernel to automatically upcall to userspace for
692 * userspace to load a kernel module with the given name. 708 * userspace to load a kernel module with the given name.
709 * @kmod_name name of the module requested by the kernel
693 * Return 0 if successful. 710 * Return 0 if successful.
694 * @task_setuid: 711 * @task_setuid:
695 * Check permission before setting one or more of the user identity 712 * Check permission before setting one or more of the user identity
@@ -1488,6 +1505,10 @@ struct security_operations {
1488 struct dentry *new_dentry); 1505 struct dentry *new_dentry);
1489 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, 1506 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry,
1490 struct path *new_dir, struct dentry *new_dentry); 1507 struct path *new_dir, struct dentry *new_dentry);
1508 int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt,
1509 mode_t mode);
1510 int (*path_chown) (struct path *path, uid_t uid, gid_t gid);
1511 int (*path_chroot) (struct path *path);
1491#endif 1512#endif
1492 1513
1493 int (*inode_alloc_security) (struct inode *inode); 1514 int (*inode_alloc_security) (struct inode *inode);
@@ -1557,7 +1578,7 @@ struct security_operations {
1557 void (*cred_transfer)(struct cred *new, const struct cred *old); 1578 void (*cred_transfer)(struct cred *new, const struct cred *old);
1558 int (*kernel_act_as)(struct cred *new, u32 secid); 1579 int (*kernel_act_as)(struct cred *new, u32 secid);
1559 int (*kernel_create_files_as)(struct cred *new, struct inode *inode); 1580 int (*kernel_create_files_as)(struct cred *new, struct inode *inode);
1560 int (*kernel_module_request)(void); 1581 int (*kernel_module_request)(char *kmod_name);
1561 int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); 1582 int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags);
1562 int (*task_fix_setuid) (struct cred *new, const struct cred *old, 1583 int (*task_fix_setuid) (struct cred *new, const struct cred *old,
1563 int flags); 1584 int flags);
@@ -1822,7 +1843,7 @@ void security_commit_creds(struct cred *new, const struct cred *old);
1822void security_transfer_creds(struct cred *new, const struct cred *old); 1843void security_transfer_creds(struct cred *new, const struct cred *old);
1823int security_kernel_act_as(struct cred *new, u32 secid); 1844int security_kernel_act_as(struct cred *new, u32 secid);
1824int security_kernel_create_files_as(struct cred *new, struct inode *inode); 1845int security_kernel_create_files_as(struct cred *new, struct inode *inode);
1825int security_kernel_module_request(void); 1846int security_kernel_module_request(char *kmod_name);
1826int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); 1847int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags);
1827int security_task_fix_setuid(struct cred *new, const struct cred *old, 1848int security_task_fix_setuid(struct cred *new, const struct cred *old,
1828 int flags); 1849 int flags);
@@ -2387,7 +2408,7 @@ static inline int security_kernel_create_files_as(struct cred *cred,
2387 return 0; 2408 return 0;
2388} 2409}
2389 2410
2390static inline int security_kernel_module_request(void) 2411static inline int security_kernel_module_request(char *kmod_name)
2391{ 2412{
2392 return 0; 2413 return 0;
2393} 2414}
@@ -2952,6 +2973,10 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
2952 struct dentry *new_dentry); 2973 struct dentry *new_dentry);
2953int security_path_rename(struct path *old_dir, struct dentry *old_dentry, 2974int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
2954 struct path *new_dir, struct dentry *new_dentry); 2975 struct path *new_dir, struct dentry *new_dentry);
2976int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
2977 mode_t mode);
2978int security_path_chown(struct path *path, uid_t uid, gid_t gid);
2979int security_path_chroot(struct path *path);
2955#else /* CONFIG_SECURITY_PATH */ 2980#else /* CONFIG_SECURITY_PATH */
2956static inline int security_path_unlink(struct path *dir, struct dentry *dentry) 2981static inline int security_path_unlink(struct path *dir, struct dentry *dentry)
2957{ 2982{
@@ -3001,6 +3026,23 @@ static inline int security_path_rename(struct path *old_dir,
3001{ 3026{
3002 return 0; 3027 return 0;
3003} 3028}
3029
3030static inline int security_path_chmod(struct dentry *dentry,
3031 struct vfsmount *mnt,
3032 mode_t mode)
3033{
3034 return 0;
3035}
3036
3037static inline int security_path_chown(struct path *path, uid_t uid, gid_t gid)
3038{
3039 return 0;
3040}
3041
3042static inline int security_path_chroot(struct path *path)
3043{
3044 return 0;
3045}
3004#endif /* CONFIG_SECURITY_PATH */ 3046#endif /* CONFIG_SECURITY_PATH */
3005 3047
3006#ifdef CONFIG_KEYS 3048#ifdef CONFIG_KEYS
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index db532ce288be..8c3dd36fe91a 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -179,6 +179,9 @@
179/* BCM63xx family SoCs */ 179/* BCM63xx family SoCs */
180#define PORT_BCM63XX 89 180#define PORT_BCM63XX 89
181 181
182/* Aeroflex Gaisler GRLIB APBUART */
183#define PORT_APBUART 90
184
182#ifdef __KERNEL__ 185#ifdef __KERNEL__
183 186
184#include <linux/compiler.h> 187#include <linux/compiler.h>
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index 850db2e80510..cf9327c051ad 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -216,10 +216,10 @@
216 216
217#define UART_IIR_TOD 0x08 /* Character Timeout Indication Detected */ 217#define UART_IIR_TOD 0x08 /* Character Timeout Indication Detected */
218 218
219#define UART_FCR_PXAR1 0x00 /* receive FIFO treshold = 1 */ 219#define UART_FCR_PXAR1 0x00 /* receive FIFO threshold = 1 */
220#define UART_FCR_PXAR8 0x40 /* receive FIFO treshold = 8 */ 220#define UART_FCR_PXAR8 0x40 /* receive FIFO threshold = 8 */
221#define UART_FCR_PXAR16 0x80 /* receive FIFO treshold = 16 */ 221#define UART_FCR_PXAR16 0x80 /* receive FIFO threshold = 16 */
222#define UART_FCR_PXAR32 0xc0 /* receive FIFO treshold = 32 */ 222#define UART_FCR_PXAR32 0xc0 /* receive FIFO threshold = 32 */
223 223
224 224
225 225
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
index 68e212ff9dde..4ef246f14654 100644
--- a/include/linux/sh_intc.h
+++ b/include/linux/sh_intc.h
@@ -57,10 +57,8 @@ struct intc_desc {
57 struct intc_sense_reg *sense_regs; 57 struct intc_sense_reg *sense_regs;
58 unsigned int nr_sense_regs; 58 unsigned int nr_sense_regs;
59 char *name; 59 char *name;
60#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
61 struct intc_mask_reg *ack_regs; 60 struct intc_mask_reg *ack_regs;
62 unsigned int nr_ack_regs; 61 unsigned int nr_ack_regs;
63#endif
64}; 62};
65 63
66#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) 64#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a)
@@ -73,7 +71,6 @@ struct intc_desc symbol __initdata = { \
73 chipname, \ 71 chipname, \
74} 72}
75 73
76#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
77#define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \ 74#define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \
78 mask_regs, prio_regs, sense_regs, ack_regs) \ 75 mask_regs, prio_regs, sense_regs, ack_regs) \
79struct intc_desc symbol __initdata = { \ 76struct intc_desc symbol __initdata = { \
@@ -83,9 +80,11 @@ struct intc_desc symbol __initdata = { \
83 chipname, \ 80 chipname, \
84 _INTC_ARRAY(ack_regs), \ 81 _INTC_ARRAY(ack_regs), \
85} 82}
86#endif
87 83
88void __init register_intc_controller(struct intc_desc *desc); 84void __init register_intc_controller(struct intc_desc *desc);
89int intc_set_priority(unsigned int irq, unsigned int prio); 85int intc_set_priority(unsigned int irq, unsigned int prio);
90 86
87int reserve_irq_vector(unsigned int irq);
88void reserve_irq_legacy(void);
89
91#endif /* __SH_INTC_H */ 90#endif /* __SH_INTC_H */
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
new file mode 100644
index 000000000000..07c08af9f8f6
--- /dev/null
+++ b/include/linux/sh_pfc.h
@@ -0,0 +1,96 @@
1/*
2 * SuperH Pin Function Controller Support
3 *
4 * Copyright (c) 2008 Magnus Damm
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef __SH_PFC_H
12#define __SH_PFC_H
13
14#include <asm-generic/gpio.h>
15
16typedef unsigned short pinmux_enum_t;
17typedef unsigned short pinmux_flag_t;
18
19#define PINMUX_TYPE_NONE 0
20#define PINMUX_TYPE_FUNCTION 1
21#define PINMUX_TYPE_GPIO 2
22#define PINMUX_TYPE_OUTPUT 3
23#define PINMUX_TYPE_INPUT 4
24#define PINMUX_TYPE_INPUT_PULLUP 5
25#define PINMUX_TYPE_INPUT_PULLDOWN 6
26
27#define PINMUX_FLAG_TYPE (0x7)
28#define PINMUX_FLAG_WANT_PULLUP (1 << 3)
29#define PINMUX_FLAG_WANT_PULLDOWN (1 << 4)
30
31#define PINMUX_FLAG_DBIT_SHIFT 5
32#define PINMUX_FLAG_DBIT (0x1f << PINMUX_FLAG_DBIT_SHIFT)
33#define PINMUX_FLAG_DREG_SHIFT 10
34#define PINMUX_FLAG_DREG (0x3f << PINMUX_FLAG_DREG_SHIFT)
35
36struct pinmux_gpio {
37 pinmux_enum_t enum_id;
38 pinmux_flag_t flags;
39};
40
41#define PINMUX_GPIO(gpio, data_or_mark) [gpio] = { data_or_mark }
42#define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0
43
44struct pinmux_cfg_reg {
45 unsigned long reg, reg_width, field_width;
46 unsigned long *cnt;
47 pinmux_enum_t *enum_ids;
48};
49
50#define PINMUX_CFG_REG(name, r, r_width, f_width) \
51 .reg = r, .reg_width = r_width, .field_width = f_width, \
52 .cnt = (unsigned long [r_width / f_width]) {}, \
53 .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)]) \
54
55struct pinmux_data_reg {
56 unsigned long reg, reg_width, reg_shadow;
57 pinmux_enum_t *enum_ids;
58};
59
60#define PINMUX_DATA_REG(name, r, r_width) \
61 .reg = r, .reg_width = r_width, \
62 .enum_ids = (pinmux_enum_t [r_width]) \
63
64struct pinmux_range {
65 pinmux_enum_t begin;
66 pinmux_enum_t end;
67 pinmux_enum_t force;
68};
69
70struct pinmux_info {
71 char *name;
72 pinmux_enum_t reserved_id;
73 struct pinmux_range data;
74 struct pinmux_range input;
75 struct pinmux_range input_pd;
76 struct pinmux_range input_pu;
77 struct pinmux_range output;
78 struct pinmux_range mark;
79 struct pinmux_range function;
80
81 unsigned first_gpio, last_gpio;
82
83 struct pinmux_gpio *gpios;
84 struct pinmux_cfg_reg *cfg_regs;
85 struct pinmux_data_reg *data_regs;
86
87 pinmux_enum_t *gpio_data;
88 unsigned int gpio_data_size;
89
90 unsigned long *gpio_in_use;
91 struct gpio_chip chip;
92};
93
94int register_pinmux(struct pinmux_info *pip);
95
96#endif /* __SH_PFC_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index bcdd6606f468..ae836fded530 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -299,7 +299,7 @@ typedef unsigned char *sk_buff_data_t;
299 * @nfctinfo: Relationship of this skb to the connection 299 * @nfctinfo: Relationship of this skb to the connection
300 * @nfct_reasm: netfilter conntrack re-assembly pointer 300 * @nfct_reasm: netfilter conntrack re-assembly pointer
301 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 301 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
302 * @iif: ifindex of device we arrived on 302 * @skb_iif: ifindex of device we arrived on
303 * @queue_mapping: Queue mapping for multiqueue devices 303 * @queue_mapping: Queue mapping for multiqueue devices
304 * @tc_index: Traffic control index 304 * @tc_index: Traffic control index
305 * @tc_verd: traffic control verdict 305 * @tc_verd: traffic control verdict
@@ -366,7 +366,7 @@ struct sk_buff {
366 struct nf_bridge_info *nf_bridge; 366 struct nf_bridge_info *nf_bridge;
367#endif 367#endif
368 368
369 int iif; 369 int skb_iif;
370#ifdef CONFIG_NET_SCHED 370#ifdef CONFIG_NET_SCHED
371 __u16 tc_index; /* traffic control index */ 371 __u16 tc_index; /* traffic control index */
372#ifdef CONFIG_NET_CLS_ACT 372#ifdef CONFIG_NET_CLS_ACT
@@ -389,8 +389,10 @@ struct sk_buff {
389#ifdef CONFIG_NETWORK_SECMARK 389#ifdef CONFIG_NETWORK_SECMARK
390 __u32 secmark; 390 __u32 secmark;
391#endif 391#endif
392 392 union {
393 __u32 mark; 393 __u32 mark;
394 __u32 dropcount;
395 };
394 396
395 __u16 vlan_tci; 397 __u16 vlan_tci;
396 398
@@ -414,14 +416,6 @@ struct sk_buff {
414 416
415#include <asm/system.h> 417#include <asm/system.h>
416 418
417#ifdef CONFIG_HAS_DMA
418#include <linux/dma-mapping.h>
419extern int skb_dma_map(struct device *dev, struct sk_buff *skb,
420 enum dma_data_direction dir);
421extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb,
422 enum dma_data_direction dir);
423#endif
424
425static inline struct dst_entry *skb_dst(const struct sk_buff *skb) 419static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
426{ 420{
427 return (struct dst_entry *)skb->_skb_dst; 421 return (struct dst_entry *)skb->_skb_dst;
@@ -489,8 +483,7 @@ extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
489 int len,int odd, struct sk_buff *skb), 483 int len,int odd, struct sk_buff *skb),
490 void *from, int length); 484 void *from, int length);
491 485
492struct skb_seq_state 486struct skb_seq_state {
493{
494 __u32 lower_offset; 487 __u32 lower_offset;
495 __u32 upper_offset; 488 __u32 upper_offset;
496 __u32 frag_idx; 489 __u32 frag_idx;
@@ -1489,6 +1482,16 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1489 return __netdev_alloc_skb(dev, length, GFP_ATOMIC); 1482 return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
1490} 1483}
1491 1484
1485static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1486 unsigned int length)
1487{
1488 struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
1489
1490 if (NET_IP_ALIGN && skb)
1491 skb_reserve(skb, NET_IP_ALIGN);
1492 return skb;
1493}
1494
1492extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); 1495extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask);
1493 1496
1494/** 1497/**
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 850d057500de..ca6b2b317991 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -110,7 +110,7 @@ extern struct cache_sizes malloc_sizes[];
110void *kmem_cache_alloc(struct kmem_cache *, gfp_t); 110void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
111void *__kmalloc(size_t size, gfp_t flags); 111void *__kmalloc(size_t size, gfp_t flags);
112 112
113#ifdef CONFIG_KMEMTRACE 113#ifdef CONFIG_TRACING
114extern void *kmem_cache_alloc_notrace(struct kmem_cache *cachep, gfp_t flags); 114extern void *kmem_cache_alloc_notrace(struct kmem_cache *cachep, gfp_t flags);
115extern size_t slab_buffer_size(struct kmem_cache *cachep); 115extern size_t slab_buffer_size(struct kmem_cache *cachep);
116#else 116#else
@@ -166,7 +166,7 @@ found:
166extern void *__kmalloc_node(size_t size, gfp_t flags, int node); 166extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
167extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 167extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
168 168
169#ifdef CONFIG_KMEMTRACE 169#ifdef CONFIG_TRACING
170extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *cachep, 170extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *cachep,
171 gfp_t flags, 171 gfp_t flags,
172 int nodeid); 172 int nodeid);
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 5ad70a60fd74..1e14beb23f9b 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -217,7 +217,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
217void *kmem_cache_alloc(struct kmem_cache *, gfp_t); 217void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
218void *__kmalloc(size_t size, gfp_t flags); 218void *__kmalloc(size_t size, gfp_t flags);
219 219
220#ifdef CONFIG_KMEMTRACE 220#ifdef CONFIG_TRACING
221extern void *kmem_cache_alloc_notrace(struct kmem_cache *s, gfp_t gfpflags); 221extern void *kmem_cache_alloc_notrace(struct kmem_cache *s, gfp_t gfpflags);
222#else 222#else
223static __always_inline void * 223static __always_inline void *
@@ -266,7 +266,7 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags)
266void *__kmalloc_node(size_t size, gfp_t flags, int node); 266void *__kmalloc_node(size_t size, gfp_t flags, int node);
267void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 267void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
268 268
269#ifdef CONFIG_KMEMTRACE 269#ifdef CONFIG_TRACING
270extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *s, 270extern void *kmem_cache_alloc_node_notrace(struct kmem_cache *s,
271 gfp_t gfpflags, 271 gfp_t gfpflags,
272 int node); 272 int node);
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 39c64bae776d..7a0570e6a596 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -76,6 +76,9 @@ void smp_call_function_many(const struct cpumask *mask,
76void __smp_call_function_single(int cpuid, struct call_single_data *data, 76void __smp_call_function_single(int cpuid, struct call_single_data *data,
77 int wait); 77 int wait);
78 78
79int smp_call_function_any(const struct cpumask *mask,
80 void (*func)(void *info), void *info, int wait);
81
79/* 82/*
80 * Generic and arch helpers 83 * Generic and arch helpers
81 */ 84 */
@@ -137,9 +140,15 @@ static inline void smp_send_reschedule(int cpu) { }
137#define smp_prepare_boot_cpu() do {} while (0) 140#define smp_prepare_boot_cpu() do {} while (0)
138#define smp_call_function_many(mask, func, info, wait) \ 141#define smp_call_function_many(mask, func, info, wait) \
139 (up_smp_call_function(func, info)) 142 (up_smp_call_function(func, info))
140static inline void init_call_single_data(void) 143static inline void init_call_single_data(void) { }
144
145static inline int
146smp_call_function_any(const struct cpumask *mask, void (*func)(void *info),
147 void *info, int wait)
141{ 148{
149 return smp_call_function_single(0, func, info, wait);
142} 150}
151
143#endif /* !SMP */ 152#endif /* !SMP */
144 153
145/* 154/*
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index 813be59bf345..2ea1dd1ba21c 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -24,8 +24,21 @@ static inline int reacquire_kernel_lock(struct task_struct *task)
24 return 0; 24 return 0;
25} 25}
26 26
27extern void __lockfunc lock_kernel(void) __acquires(kernel_lock); 27extern void __lockfunc
28extern void __lockfunc unlock_kernel(void) __releases(kernel_lock); 28_lock_kernel(const char *func, const char *file, int line)
29__acquires(kernel_lock);
30
31extern void __lockfunc
32_unlock_kernel(const char *func, const char *file, int line)
33__releases(kernel_lock);
34
35#define lock_kernel() do { \
36 _lock_kernel(__func__, __FILE__, __LINE__); \
37} while (0)
38
39#define unlock_kernel() do { \
40 _unlock_kernel(__func__, __FILE__, __LINE__); \
41} while (0)
29 42
30/* 43/*
31 * Various legacy drivers don't really need the BKL in a specific 44 * Various legacy drivers don't really need the BKL in a specific
@@ -41,8 +54,8 @@ static inline void cycle_kernel_lock(void)
41 54
42#else 55#else
43 56
44#define lock_kernel() do { } while(0) 57#define lock_kernel()
45#define unlock_kernel() do { } while(0) 58#define unlock_kernel()
46#define release_kernel_lock(task) do { } while(0) 59#define release_kernel_lock(task) do { } while(0)
47#define cycle_kernel_lock() do { } while(0) 60#define cycle_kernel_lock() do { } while(0)
48#define reacquire_kernel_lock(task) 0 61#define reacquire_kernel_lock(task) 0
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h
index 5241e4fb4eca..7144e8aa1e41 100644
--- a/include/linux/smsc911x.h
+++ b/include/linux/smsc911x.h
@@ -30,6 +30,7 @@ struct smsc911x_platform_config {
30 unsigned int irq_type; 30 unsigned int irq_type;
31 unsigned int flags; 31 unsigned int flags;
32 phy_interface_t phy_interface; 32 phy_interface_t phy_interface;
33 unsigned char mac[6];
33}; 34};
34 35
35/* Constants for platform_device irq polarity configuration */ 36/* Constants for platform_device irq polarity configuration */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 3273a0c5043b..7b3aae2052a6 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -24,6 +24,9 @@ struct __kernel_sockaddr_storage {
24#include <linux/types.h> /* pid_t */ 24#include <linux/types.h> /* pid_t */
25#include <linux/compiler.h> /* __user */ 25#include <linux/compiler.h> /* __user */
26 26
27#define __sockaddr_check_size(size) \
28 BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage)))
29
27#ifdef __KERNEL__ 30#ifdef __KERNEL__
28# ifdef CONFIG_PROC_FS 31# ifdef CONFIG_PROC_FS
29struct seq_file; 32struct seq_file;
@@ -65,6 +68,12 @@ struct msghdr {
65 unsigned msg_flags; 68 unsigned msg_flags;
66}; 69};
67 70
71/* For recvmmsg/sendmmsg */
72struct mmsghdr {
73 struct msghdr msg_hdr;
74 unsigned msg_len;
75};
76
68/* 77/*
69 * POSIX 1003.1g - ancillary data object information 78 * POSIX 1003.1g - ancillary data object information
70 * Ancillary data consits of a sequence of pairs of 79 * Ancillary data consits of a sequence of pairs of
@@ -312,6 +321,10 @@ extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uadd
312extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); 321extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr);
313extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); 322extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
314 323
324struct timespec;
325
326extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
327 unsigned int flags, struct timespec *timeout);
315#endif 328#endif
316#endif /* not kernel and not glibc */ 329#endif /* not kernel and not glibc */
317#endif /* _LINUX_SOCKET_H */ 330#endif /* _LINUX_SOCKET_H */
diff --git a/include/linux/spi/sh_msiof.h b/include/linux/spi/sh_msiof.h
new file mode 100644
index 000000000000..2e8db3d2d2e5
--- /dev/null
+++ b/include/linux/spi/sh_msiof.h
@@ -0,0 +1,10 @@
1#ifndef __SPI_SH_MSIOF_H__
2#define __SPI_SH_MSIOF_H__
3
4struct sh_msiof_spi_info {
5 int tx_fifo_override;
6 int rx_fifo_override;
7 u16 num_chipselect;
8};
9
10#endif /* __SPI_SH_MSIOF_H__ */
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index eed4254bd503..3274c507b8a9 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -15,7 +15,7 @@
15 * Some hardware works well with requests at spi_transfer scope: 15 * Some hardware works well with requests at spi_transfer scope:
16 * 16 *
17 * - Drivers leveraging smarter hardware, with fifos or DMA; or for half 17 * - Drivers leveraging smarter hardware, with fifos or DMA; or for half
18 * duplex (MicroWire) controllers. Provide chipslect() and txrx_bufs(), 18 * duplex (MicroWire) controllers. Provide chipselect() and txrx_bufs(),
19 * and custom setup()/cleanup() methods. 19 * and custom setup()/cleanup() methods.
20 */ 20 */
21 21
diff --git a/include/linux/spi/wl12xx.h b/include/linux/spi/wl12xx.h
index 11430cab2aad..aed64ed3dc8a 100644
--- a/include/linux/spi/wl12xx.h
+++ b/include/linux/spi/wl12xx.h
@@ -26,6 +26,7 @@
26 26
27struct wl12xx_platform_data { 27struct wl12xx_platform_data {
28 void (*set_power)(bool enable); 28 void (*set_power)(bool enable);
29 bool use_eeprom;
29}; 30};
30 31
31#endif 32#endif
diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h
new file mode 100644
index 000000000000..6f17278810b0
--- /dev/null
+++ b/include/linux/spi/xilinx_spi.h
@@ -0,0 +1,20 @@
1#ifndef __LINUX_SPI_XILINX_SPI_H
2#define __LINUX_SPI_XILINX_SPI_H
3
4/**
5 * struct xspi_platform_data - Platform data of the Xilinx SPI driver
6 * @num_chipselect: Number of chip select by the IP.
7 * @little_endian: If registers should be accessed little endian or not.
8 * @bits_per_word: Number of bits per word.
9 * @devices: Devices to add when the driver is probed.
10 * @num_devices: Number of devices in the devices array.
11 */
12struct xspi_platform_data {
13 u16 num_chipselect;
14 bool little_endian;
15 u8 bits_per_word;
16 struct spi_board_info *devices;
17 u8 num_devices;
18};
19
20#endif /* __LINUX_SPI_XILINX_SPI_H */
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index f0ca7a7a1757..71dccfeb0d88 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -79,8 +79,6 @@
79 */ 79 */
80#include <linux/spinlock_types.h> 80#include <linux/spinlock_types.h>
81 81
82extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
83
84/* 82/*
85 * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): 83 * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them):
86 */ 84 */
@@ -102,7 +100,7 @@ do { \
102 100
103#else 101#else
104# define spin_lock_init(lock) \ 102# define spin_lock_init(lock) \
105 do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0) 103 do { *(lock) = __SPIN_LOCK_UNLOCKED(lock); } while (0)
106#endif 104#endif
107 105
108#ifdef CONFIG_DEBUG_SPINLOCK 106#ifdef CONFIG_DEBUG_SPINLOCK
@@ -116,7 +114,7 @@ do { \
116} while (0) 114} while (0)
117#else 115#else
118# define rwlock_init(lock) \ 116# define rwlock_init(lock) \
119 do { *(lock) = RW_LOCK_UNLOCKED; } while (0) 117 do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0)
120#endif 118#endif
121 119
122#define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) 120#define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock)
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index 7a7e18fc2415..8264a7f459bc 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -60,137 +60,118 @@ void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
60void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) 60void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
61 __releases(lock); 61 __releases(lock);
62 62
63/* 63#ifdef CONFIG_INLINE_SPIN_LOCK
64 * We inline the unlock functions in the nondebug case:
65 */
66#if !defined(CONFIG_DEBUG_SPINLOCK) && !defined(CONFIG_PREEMPT)
67#define __always_inline__spin_unlock
68#define __always_inline__read_unlock
69#define __always_inline__write_unlock
70#define __always_inline__spin_unlock_irq
71#define __always_inline__read_unlock_irq
72#define __always_inline__write_unlock_irq
73#endif
74
75#ifndef CONFIG_DEBUG_SPINLOCK
76#ifndef CONFIG_GENERIC_LOCKBREAK
77
78#ifdef __always_inline__spin_lock
79#define _spin_lock(lock) __spin_lock(lock) 64#define _spin_lock(lock) __spin_lock(lock)
80#endif 65#endif
81 66
82#ifdef __always_inline__read_lock 67#ifdef CONFIG_INLINE_READ_LOCK
83#define _read_lock(lock) __read_lock(lock) 68#define _read_lock(lock) __read_lock(lock)
84#endif 69#endif
85 70
86#ifdef __always_inline__write_lock 71#ifdef CONFIG_INLINE_WRITE_LOCK
87#define _write_lock(lock) __write_lock(lock) 72#define _write_lock(lock) __write_lock(lock)
88#endif 73#endif
89 74
90#ifdef __always_inline__spin_lock_bh 75#ifdef CONFIG_INLINE_SPIN_LOCK_BH
91#define _spin_lock_bh(lock) __spin_lock_bh(lock) 76#define _spin_lock_bh(lock) __spin_lock_bh(lock)
92#endif 77#endif
93 78
94#ifdef __always_inline__read_lock_bh 79#ifdef CONFIG_INLINE_READ_LOCK_BH
95#define _read_lock_bh(lock) __read_lock_bh(lock) 80#define _read_lock_bh(lock) __read_lock_bh(lock)
96#endif 81#endif
97 82
98#ifdef __always_inline__write_lock_bh 83#ifdef CONFIG_INLINE_WRITE_LOCK_BH
99#define _write_lock_bh(lock) __write_lock_bh(lock) 84#define _write_lock_bh(lock) __write_lock_bh(lock)
100#endif 85#endif
101 86
102#ifdef __always_inline__spin_lock_irq 87#ifdef CONFIG_INLINE_SPIN_LOCK_IRQ
103#define _spin_lock_irq(lock) __spin_lock_irq(lock) 88#define _spin_lock_irq(lock) __spin_lock_irq(lock)
104#endif 89#endif
105 90
106#ifdef __always_inline__read_lock_irq 91#ifdef CONFIG_INLINE_READ_LOCK_IRQ
107#define _read_lock_irq(lock) __read_lock_irq(lock) 92#define _read_lock_irq(lock) __read_lock_irq(lock)
108#endif 93#endif
109 94
110#ifdef __always_inline__write_lock_irq 95#ifdef CONFIG_INLINE_WRITE_LOCK_IRQ
111#define _write_lock_irq(lock) __write_lock_irq(lock) 96#define _write_lock_irq(lock) __write_lock_irq(lock)
112#endif 97#endif
113 98
114#ifdef __always_inline__spin_lock_irqsave 99#ifdef CONFIG_INLINE_SPIN_LOCK_IRQSAVE
115#define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) 100#define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock)
116#endif 101#endif
117 102
118#ifdef __always_inline__read_lock_irqsave 103#ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE
119#define _read_lock_irqsave(lock) __read_lock_irqsave(lock) 104#define _read_lock_irqsave(lock) __read_lock_irqsave(lock)
120#endif 105#endif
121 106
122#ifdef __always_inline__write_lock_irqsave 107#ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE
123#define _write_lock_irqsave(lock) __write_lock_irqsave(lock) 108#define _write_lock_irqsave(lock) __write_lock_irqsave(lock)
124#endif 109#endif
125 110
126#endif /* !CONFIG_GENERIC_LOCKBREAK */ 111#ifdef CONFIG_INLINE_SPIN_TRYLOCK
127
128#ifdef __always_inline__spin_trylock
129#define _spin_trylock(lock) __spin_trylock(lock) 112#define _spin_trylock(lock) __spin_trylock(lock)
130#endif 113#endif
131 114
132#ifdef __always_inline__read_trylock 115#ifdef CONFIG_INLINE_READ_TRYLOCK
133#define _read_trylock(lock) __read_trylock(lock) 116#define _read_trylock(lock) __read_trylock(lock)
134#endif 117#endif
135 118
136#ifdef __always_inline__write_trylock 119#ifdef CONFIG_INLINE_WRITE_TRYLOCK
137#define _write_trylock(lock) __write_trylock(lock) 120#define _write_trylock(lock) __write_trylock(lock)
138#endif 121#endif
139 122
140#ifdef __always_inline__spin_trylock_bh 123#ifdef CONFIG_INLINE_SPIN_TRYLOCK_BH
141#define _spin_trylock_bh(lock) __spin_trylock_bh(lock) 124#define _spin_trylock_bh(lock) __spin_trylock_bh(lock)
142#endif 125#endif
143 126
144#ifdef __always_inline__spin_unlock 127#ifdef CONFIG_INLINE_SPIN_UNLOCK
145#define _spin_unlock(lock) __spin_unlock(lock) 128#define _spin_unlock(lock) __spin_unlock(lock)
146#endif 129#endif
147 130
148#ifdef __always_inline__read_unlock 131#ifdef CONFIG_INLINE_READ_UNLOCK
149#define _read_unlock(lock) __read_unlock(lock) 132#define _read_unlock(lock) __read_unlock(lock)
150#endif 133#endif
151 134
152#ifdef __always_inline__write_unlock 135#ifdef CONFIG_INLINE_WRITE_UNLOCK
153#define _write_unlock(lock) __write_unlock(lock) 136#define _write_unlock(lock) __write_unlock(lock)
154#endif 137#endif
155 138
156#ifdef __always_inline__spin_unlock_bh 139#ifdef CONFIG_INLINE_SPIN_UNLOCK_BH
157#define _spin_unlock_bh(lock) __spin_unlock_bh(lock) 140#define _spin_unlock_bh(lock) __spin_unlock_bh(lock)
158#endif 141#endif
159 142
160#ifdef __always_inline__read_unlock_bh 143#ifdef CONFIG_INLINE_READ_UNLOCK_BH
161#define _read_unlock_bh(lock) __read_unlock_bh(lock) 144#define _read_unlock_bh(lock) __read_unlock_bh(lock)
162#endif 145#endif
163 146
164#ifdef __always_inline__write_unlock_bh 147#ifdef CONFIG_INLINE_WRITE_UNLOCK_BH
165#define _write_unlock_bh(lock) __write_unlock_bh(lock) 148#define _write_unlock_bh(lock) __write_unlock_bh(lock)
166#endif 149#endif
167 150
168#ifdef __always_inline__spin_unlock_irq 151#ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQ
169#define _spin_unlock_irq(lock) __spin_unlock_irq(lock) 152#define _spin_unlock_irq(lock) __spin_unlock_irq(lock)
170#endif 153#endif
171 154
172#ifdef __always_inline__read_unlock_irq 155#ifdef CONFIG_INLINE_READ_UNLOCK_IRQ
173#define _read_unlock_irq(lock) __read_unlock_irq(lock) 156#define _read_unlock_irq(lock) __read_unlock_irq(lock)
174#endif 157#endif
175 158
176#ifdef __always_inline__write_unlock_irq 159#ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ
177#define _write_unlock_irq(lock) __write_unlock_irq(lock) 160#define _write_unlock_irq(lock) __write_unlock_irq(lock)
178#endif 161#endif
179 162
180#ifdef __always_inline__spin_unlock_irqrestore 163#ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE
181#define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) 164#define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags)
182#endif 165#endif
183 166
184#ifdef __always_inline__read_unlock_irqrestore 167#ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE
185#define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) 168#define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags)
186#endif 169#endif
187 170
188#ifdef __always_inline__write_unlock_irqrestore 171#ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE
189#define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) 172#define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags)
190#endif 173#endif
191 174
192#endif /* CONFIG_DEBUG_SPINLOCK */
193
194static inline int __spin_trylock(spinlock_t *lock) 175static inline int __spin_trylock(spinlock_t *lock)
195{ 176{
196 preempt_disable(); 177 preempt_disable();
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index aca0eee53930..4765d97dcafb 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -48,6 +48,7 @@ void cleanup_srcu_struct(struct srcu_struct *sp);
48int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); 48int srcu_read_lock(struct srcu_struct *sp) __acquires(sp);
49void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); 49void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp);
50void synchronize_srcu(struct srcu_struct *sp); 50void synchronize_srcu(struct srcu_struct *sp);
51void synchronize_srcu_expedited(struct srcu_struct *sp);
51long srcu_batches_completed(struct srcu_struct *sp); 52long srcu_batches_completed(struct srcu_struct *sp);
52 53
53#endif 54#endif
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 3d0a9ff24f01..24f988547361 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -269,7 +269,8 @@ struct ssb_bus {
269 269
270 const struct ssb_bus_ops *ops; 270 const struct ssb_bus_ops *ops;
271 271
272 /* The core in the basic address register window. (PCI bus only) */ 272 /* The core currently mapped into the MMIO window.
273 * Not valid on all host-buses. So don't use outside of SSB. */
273 struct ssb_device *mapped_device; 274 struct ssb_device *mapped_device;
274 union { 275 union {
275 /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ 276 /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */
@@ -281,14 +282,17 @@ struct ssb_bus {
281 * On PCMCIA-host busses this is used to protect the whole MMIO access. */ 282 * On PCMCIA-host busses this is used to protect the whole MMIO access. */
282 spinlock_t bar_lock; 283 spinlock_t bar_lock;
283 284
284 /* The bus this backplane is running on. */ 285 /* The host-bus this backplane is running on. */
285 enum ssb_bustype bustype; 286 enum ssb_bustype bustype;
286 /* Pointer to the PCI bus (only valid if bustype == SSB_BUSTYPE_PCI). */ 287 /* Pointers to the host-bus. Check bustype before using any of these pointers. */
287 struct pci_dev *host_pci; 288 union {
288 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ 289 /* Pointer to the PCI bus (only valid if bustype == SSB_BUSTYPE_PCI). */
289 struct pcmcia_device *host_pcmcia; 290 struct pci_dev *host_pci;
290 /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */ 291 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */
291 struct sdio_func *host_sdio; 292 struct pcmcia_device *host_pcmcia;
293 /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */
294 struct sdio_func *host_sdio;
295 };
292 296
293 /* See enum ssb_quirks */ 297 /* See enum ssb_quirks */
294 unsigned int quirks; 298 unsigned int quirks;
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 401097781fc0..1906782ec86b 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -130,12 +130,14 @@ struct rpc_task_setup {
130#define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ 130#define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */
131#define RPC_TASK_KILLED 0x0100 /* task was killed */ 131#define RPC_TASK_KILLED 0x0100 /* task was killed */
132#define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */ 132#define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */
133#define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */
133 134
134#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) 135#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
135#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) 136#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
136#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) 137#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
137#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) 138#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
138#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) 139#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT)
140#define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN)
139 141
140#define RPC_TASK_RUNNING 0 142#define RPC_TASK_RUNNING 0
141#define RPC_TASK_QUEUED 1 143#define RPC_TASK_QUEUED 1
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 73b1f1cec423..febedcf67c7e 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -7,6 +7,8 @@ struct device;
7struct dma_attrs; 7struct dma_attrs;
8struct scatterlist; 8struct scatterlist;
9 9
10extern int swiotlb_force;
11
10/* 12/*
11 * Maximum allowable number of contiguous slabs to map, 13 * Maximum allowable number of contiguous slabs to map,
12 * must be a power of 2. What is the appropriate value ? 14 * must be a power of 2. What is the appropriate value ?
@@ -20,8 +22,7 @@ struct scatterlist;
20 */ 22 */
21#define IO_TLB_SHIFT 11 23#define IO_TLB_SHIFT 11
22 24
23extern void 25extern void swiotlb_init(int verbose);
24swiotlb_init(void);
25 26
26extern void 27extern void
27*swiotlb_alloc_coherent(struct device *hwdev, size_t size, 28*swiotlb_alloc_coherent(struct device *hwdev, size_t size,
@@ -88,4 +89,11 @@ swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
88extern int 89extern int
89swiotlb_dma_supported(struct device *hwdev, u64 mask); 90swiotlb_dma_supported(struct device *hwdev, u64 mask);
90 91
92#ifdef CONFIG_SWIOTLB
93extern void __init swiotlb_free(void);
94#else
95static inline void swiotlb_free(void) { }
96#endif
97
98extern void swiotlb_print_info(void);
91#endif /* __LINUX_SWIOTLB_H */ 99#endif /* __LINUX_SWIOTLB_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index a990ace1a838..939a61507ac5 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -25,6 +25,7 @@ struct linux_dirent64;
25struct list_head; 25struct list_head;
26struct msgbuf; 26struct msgbuf;
27struct msghdr; 27struct msghdr;
28struct mmsghdr;
28struct msqid_ds; 29struct msqid_ds;
29struct new_utsname; 30struct new_utsname;
30struct nfsctl_arg; 31struct nfsctl_arg;
@@ -99,37 +100,16 @@ struct perf_event_attr;
99#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) 100#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
100 101
101#ifdef CONFIG_EVENT_PROFILE 102#ifdef CONFIG_EVENT_PROFILE
102#define TRACE_SYS_ENTER_PROFILE(sname) \
103static int prof_sysenter_enable_##sname(void) \
104{ \
105 return reg_prof_syscall_enter("sys"#sname); \
106} \
107 \
108static void prof_sysenter_disable_##sname(void) \
109{ \
110 unreg_prof_syscall_enter("sys"#sname); \
111}
112
113#define TRACE_SYS_EXIT_PROFILE(sname) \
114static int prof_sysexit_enable_##sname(void) \
115{ \
116 return reg_prof_syscall_exit("sys"#sname); \
117} \
118 \
119static void prof_sysexit_disable_##sname(void) \
120{ \
121 unreg_prof_syscall_exit("sys"#sname); \
122}
123 103
124#define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ 104#define TRACE_SYS_ENTER_PROFILE_INIT(sname) \
125 .profile_count = ATOMIC_INIT(-1), \ 105 .profile_count = ATOMIC_INIT(-1), \
126 .profile_enable = prof_sysenter_enable_##sname, \ 106 .profile_enable = prof_sysenter_enable, \
127 .profile_disable = prof_sysenter_disable_##sname, 107 .profile_disable = prof_sysenter_disable,
128 108
129#define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ 109#define TRACE_SYS_EXIT_PROFILE_INIT(sname) \
130 .profile_count = ATOMIC_INIT(-1), \ 110 .profile_count = ATOMIC_INIT(-1), \
131 .profile_enable = prof_sysexit_enable_##sname, \ 111 .profile_enable = prof_sysexit_enable, \
132 .profile_disable = prof_sysexit_disable_##sname, 112 .profile_disable = prof_sysexit_disable,
133#else 113#else
134#define TRACE_SYS_ENTER_PROFILE(sname) 114#define TRACE_SYS_ENTER_PROFILE(sname)
135#define TRACE_SYS_ENTER_PROFILE_INIT(sname) 115#define TRACE_SYS_ENTER_PROFILE_INIT(sname)
@@ -153,74 +133,46 @@ static void prof_sysexit_disable_##sname(void) \
153#define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) 133#define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__)
154 134
155#define SYSCALL_TRACE_ENTER_EVENT(sname) \ 135#define SYSCALL_TRACE_ENTER_EVENT(sname) \
136 static const struct syscall_metadata __syscall_meta_##sname; \
156 static struct ftrace_event_call event_enter_##sname; \ 137 static struct ftrace_event_call event_enter_##sname; \
157 struct trace_event enter_syscall_print_##sname = { \ 138 static struct trace_event enter_syscall_print_##sname = { \
158 .trace = print_syscall_enter, \ 139 .trace = print_syscall_enter, \
159 }; \ 140 }; \
160 static int init_enter_##sname(void) \
161 { \
162 int num, id; \
163 num = syscall_name_to_nr("sys"#sname); \
164 if (num < 0) \
165 return -ENOSYS; \
166 id = register_ftrace_event(&enter_syscall_print_##sname);\
167 if (!id) \
168 return -ENODEV; \
169 event_enter_##sname.id = id; \
170 set_syscall_enter_id(num, id); \
171 INIT_LIST_HEAD(&event_enter_##sname.fields); \
172 return 0; \
173 } \
174 TRACE_SYS_ENTER_PROFILE(sname); \
175 static struct ftrace_event_call __used \ 141 static struct ftrace_event_call __used \
176 __attribute__((__aligned__(4))) \ 142 __attribute__((__aligned__(4))) \
177 __attribute__((section("_ftrace_events"))) \ 143 __attribute__((section("_ftrace_events"))) \
178 event_enter_##sname = { \ 144 event_enter_##sname = { \
179 .name = "sys_enter"#sname, \ 145 .name = "sys_enter"#sname, \
180 .system = "syscalls", \ 146 .system = "syscalls", \
181 .event = &event_syscall_enter, \ 147 .event = &enter_syscall_print_##sname, \
182 .raw_init = init_enter_##sname, \ 148 .raw_init = init_syscall_trace, \
183 .show_format = syscall_enter_format, \ 149 .show_format = syscall_enter_format, \
184 .define_fields = syscall_enter_define_fields, \ 150 .define_fields = syscall_enter_define_fields, \
185 .regfunc = reg_event_syscall_enter, \ 151 .regfunc = reg_event_syscall_enter, \
186 .unregfunc = unreg_event_syscall_enter, \ 152 .unregfunc = unreg_event_syscall_enter, \
187 .data = "sys"#sname, \ 153 .data = (void *)&__syscall_meta_##sname,\
188 TRACE_SYS_ENTER_PROFILE_INIT(sname) \ 154 TRACE_SYS_ENTER_PROFILE_INIT(sname) \
189 } 155 }
190 156
191#define SYSCALL_TRACE_EXIT_EVENT(sname) \ 157#define SYSCALL_TRACE_EXIT_EVENT(sname) \
158 static const struct syscall_metadata __syscall_meta_##sname; \
192 static struct ftrace_event_call event_exit_##sname; \ 159 static struct ftrace_event_call event_exit_##sname; \
193 struct trace_event exit_syscall_print_##sname = { \ 160 static struct trace_event exit_syscall_print_##sname = { \
194 .trace = print_syscall_exit, \ 161 .trace = print_syscall_exit, \
195 }; \ 162 }; \
196 static int init_exit_##sname(void) \
197 { \
198 int num, id; \
199 num = syscall_name_to_nr("sys"#sname); \
200 if (num < 0) \
201 return -ENOSYS; \
202 id = register_ftrace_event(&exit_syscall_print_##sname);\
203 if (!id) \
204 return -ENODEV; \
205 event_exit_##sname.id = id; \
206 set_syscall_exit_id(num, id); \
207 INIT_LIST_HEAD(&event_exit_##sname.fields); \
208 return 0; \
209 } \
210 TRACE_SYS_EXIT_PROFILE(sname); \
211 static struct ftrace_event_call __used \ 163 static struct ftrace_event_call __used \
212 __attribute__((__aligned__(4))) \ 164 __attribute__((__aligned__(4))) \
213 __attribute__((section("_ftrace_events"))) \ 165 __attribute__((section("_ftrace_events"))) \
214 event_exit_##sname = { \ 166 event_exit_##sname = { \
215 .name = "sys_exit"#sname, \ 167 .name = "sys_exit"#sname, \
216 .system = "syscalls", \ 168 .system = "syscalls", \
217 .event = &event_syscall_exit, \ 169 .event = &exit_syscall_print_##sname, \
218 .raw_init = init_exit_##sname, \ 170 .raw_init = init_syscall_trace, \
219 .show_format = syscall_exit_format, \ 171 .show_format = syscall_exit_format, \
220 .define_fields = syscall_exit_define_fields, \ 172 .define_fields = syscall_exit_define_fields, \
221 .regfunc = reg_event_syscall_exit, \ 173 .regfunc = reg_event_syscall_exit, \
222 .unregfunc = unreg_event_syscall_exit, \ 174 .unregfunc = unreg_event_syscall_exit, \
223 .data = "sys"#sname, \ 175 .data = (void *)&__syscall_meta_##sname,\
224 TRACE_SYS_EXIT_PROFILE_INIT(sname) \ 176 TRACE_SYS_EXIT_PROFILE_INIT(sname) \
225 } 177 }
226 178
@@ -677,6 +629,9 @@ asmlinkage long sys_recv(int, void __user *, size_t, unsigned);
677asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned, 629asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned,
678 struct sockaddr __user *, int __user *); 630 struct sockaddr __user *, int __user *);
679asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags); 631asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags);
632asmlinkage long sys_recvmmsg(int fd, struct mmsghdr __user *msg,
633 unsigned int vlen, unsigned flags,
634 struct timespec __user *timeout);
680asmlinkage long sys_socket(int, int, int); 635asmlinkage long sys_socket(int, int, int);
681asmlinkage long sys_socketpair(int, int, int, int __user *); 636asmlinkage long sys_socketpair(int, int, int, int __user *);
682asmlinkage long sys_socketcall(int call, unsigned long __user *args); 637asmlinkage long sys_socketcall(int call, unsigned long __user *args);
@@ -879,4 +834,8 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
879asmlinkage long sys_perf_event_open( 834asmlinkage long sys_perf_event_open(
880 struct perf_event_attr __user *attr_uptr, 835 struct perf_event_attr __user *attr_uptr,
881 pid_t pid, int cpu, int group_fd, unsigned long flags); 836 pid_t pid, int cpu, int group_fd, unsigned long flags);
837
838asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len,
839 unsigned long prot, unsigned long flags,
840 unsigned long fd, unsigned long pgoff);
882#endif 841#endif
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 1e4743ee6831..877ba039e6a4 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -15,9 +15,6 @@
15 ** The kernel will then return -ENOTDIR to any application using 15 ** The kernel will then return -ENOTDIR to any application using
16 ** the old binary interface. 16 ** the old binary interface.
17 ** 17 **
18 ** For new interfaces unless you really need a binary number
19 ** please use CTL_UNNUMBERED.
20 **
21 **************************************************************** 18 ****************************************************************
22 **************************************************************** 19 ****************************************************************
23 */ 20 */
@@ -50,12 +47,6 @@ struct __sysctl_args {
50 47
51/* Top-level names: */ 48/* Top-level names: */
52 49
53/* For internal pattern-matching use only: */
54#ifdef __KERNEL__
55#define CTL_NONE 0
56#define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */
57#endif
58
59enum 50enum
60{ 51{
61 CTL_KERN=1, /* General kernel info and control */ 52 CTL_KERN=1, /* General kernel info and control */
@@ -98,8 +89,8 @@ enum
98 KERN_VERSION=4, /* string: compile time info */ 89 KERN_VERSION=4, /* string: compile time info */
99 KERN_SECUREMASK=5, /* struct: maximum rights mask */ 90 KERN_SECUREMASK=5, /* struct: maximum rights mask */
100 KERN_PROF=6, /* table: profiling information */ 91 KERN_PROF=6, /* table: profiling information */
101 KERN_NODENAME=7, 92 KERN_NODENAME=7, /* string: hostname */
102 KERN_DOMAINNAME=8, 93 KERN_DOMAINNAME=8, /* string: domainname */
103 94
104 KERN_PANIC=15, /* int: panic timeout */ 95 KERN_PANIC=15, /* int: panic timeout */
105 KERN_REALROOTDEV=16, /* real root device to mount after initrd */ 96 KERN_REALROOTDEV=16, /* real root device to mount after initrd */
@@ -111,8 +102,8 @@ enum
111 KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */ 102 KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */
112 KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */ 103 KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */
113 KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */ 104 KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */
114 KERN_MODPROBE=28, 105 KERN_MODPROBE=28, /* string: modprobe path */
115 KERN_SG_BIG_BUFF=29, 106 KERN_SG_BIG_BUFF=29, /* int: sg driver reserved buffer size */
116 KERN_ACCT=30, /* BSD process accounting parameters */ 107 KERN_ACCT=30, /* BSD process accounting parameters */
117 KERN_PPC_L2CR=31, /* l2cr register on PPC */ 108 KERN_PPC_L2CR=31, /* l2cr register on PPC */
118 109
@@ -159,7 +150,7 @@ enum
159 KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ 150 KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
160 KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ 151 KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
161 KERN_COMPAT_LOG=73, /* int: print compat layer messages */ 152 KERN_COMPAT_LOG=73, /* int: print compat layer messages */
162 KERN_MAX_LOCK_DEPTH=74, 153 KERN_MAX_LOCK_DEPTH=74, /* int: rtmutex's maximum lock depth */
163 KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */ 154 KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
164 KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ 155 KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
165}; 156};
@@ -490,6 +481,7 @@ enum
490 NET_IPV4_CONF_PROMOTE_SECONDARIES=20, 481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
491 NET_IPV4_CONF_ARP_ACCEPT=21, 482 NET_IPV4_CONF_ARP_ACCEPT=21,
492 NET_IPV4_CONF_ARP_NOTIFY=22, 483 NET_IPV4_CONF_ARP_NOTIFY=22,
484 NET_IPV4_CONF_ACCEPT_LOCAL=23,
493 __NET_IPV4_CONF_MAX 485 __NET_IPV4_CONF_MAX
494}; 486};
495 487
@@ -972,10 +964,6 @@ extern int sysctl_perm(struct ctl_table_root *root,
972 964
973typedef struct ctl_table ctl_table; 965typedef struct ctl_table ctl_table;
974 966
975typedef int ctl_handler (struct ctl_table *table,
976 void __user *oldval, size_t __user *oldlenp,
977 void __user *newval, size_t newlen);
978
979typedef int proc_handler (struct ctl_table *ctl, int write, 967typedef int proc_handler (struct ctl_table *ctl, int write,
980 void __user *buffer, size_t *lenp, loff_t *ppos); 968 void __user *buffer, size_t *lenp, loff_t *ppos);
981 969
@@ -996,21 +984,10 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int,
996extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, 984extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
997 void __user *, size_t *, loff_t *); 985 void __user *, size_t *, loff_t *);
998 986
999extern int do_sysctl (int __user *name, int nlen,
1000 void __user *oldval, size_t __user *oldlenp,
1001 void __user *newval, size_t newlen);
1002
1003extern ctl_handler sysctl_data;
1004extern ctl_handler sysctl_string;
1005extern ctl_handler sysctl_intvec;
1006extern ctl_handler sysctl_jiffies;
1007extern ctl_handler sysctl_ms_jiffies;
1008
1009
1010/* 987/*
1011 * Register a set of sysctl names by calling register_sysctl_table 988 * Register a set of sysctl names by calling register_sysctl_table
1012 * with an initialised array of struct ctl_table's. An entry with zero 989 * with an initialised array of struct ctl_table's. An entry with
1013 * ctl_name and NULL procname terminates the table. table->de will be 990 * NULL procname terminates the table. table->de will be
1014 * set up by the registration and need not be initialised in advance. 991 * set up by the registration and need not be initialised in advance.
1015 * 992 *
1016 * sysctl names can be mirrored automatically under /proc/sys. The 993 * sysctl names can be mirrored automatically under /proc/sys. The
@@ -1023,24 +1000,11 @@ extern ctl_handler sysctl_ms_jiffies;
1023 * under /proc; non-leaf nodes will be represented by directories. A 1000 * under /proc; non-leaf nodes will be represented by directories. A
1024 * null procname disables /proc mirroring at this node. 1001 * null procname disables /proc mirroring at this node.
1025 * 1002 *
1026 * sysctl entries with a zero ctl_name will not be available through
1027 * the binary sysctl interface.
1028 *
1029 * sysctl(2) can automatically manage read and write requests through 1003 * sysctl(2) can automatically manage read and write requests through
1030 * the sysctl table. The data and maxlen fields of the ctl_table 1004 * the sysctl table. The data and maxlen fields of the ctl_table
1031 * struct enable minimal validation of the values being written to be 1005 * struct enable minimal validation of the values being written to be
1032 * performed, and the mode field allows minimal authentication. 1006 * performed, and the mode field allows minimal authentication.
1033 * 1007 *
1034 * More sophisticated management can be enabled by the provision of a
1035 * strategy routine with the table entry. This will be called before
1036 * any automatic read or write of the data is performed.
1037 *
1038 * The strategy routine may return:
1039 * <0: Error occurred (error is passed to user process)
1040 * 0: OK - proceed with automatic read or write.
1041 * >0: OK - read or write has been done by the strategy routine, so
1042 * return immediately.
1043 *
1044 * There must be a proc_handler routine for any terminal nodes 1008 * There must be a proc_handler routine for any terminal nodes
1045 * mirrored under /proc/sys (non-terminals are handled by a built-in 1009 * mirrored under /proc/sys (non-terminals are handled by a built-in
1046 * directory handler). Several default handlers are available to 1010 * directory handler). Several default handlers are available to
@@ -1050,7 +1014,6 @@ extern ctl_handler sysctl_ms_jiffies;
1050/* A sysctl table is an array of struct ctl_table: */ 1014/* A sysctl table is an array of struct ctl_table: */
1051struct ctl_table 1015struct ctl_table
1052{ 1016{
1053 int ctl_name; /* Binary ID */
1054 const char *procname; /* Text ID for /proc/sys, or zero */ 1017 const char *procname; /* Text ID for /proc/sys, or zero */
1055 void *data; 1018 void *data;
1056 int maxlen; 1019 int maxlen;
@@ -1058,7 +1021,6 @@ struct ctl_table
1058 struct ctl_table *child; 1021 struct ctl_table *child;
1059 struct ctl_table *parent; /* Automatically set */ 1022 struct ctl_table *parent; /* Automatically set */
1060 proc_handler *proc_handler; /* Callback for text formatting */ 1023 proc_handler *proc_handler; /* Callback for text formatting */
1061 ctl_handler *strategy; /* Callback function for all r/w */
1062 void *extra1; 1024 void *extra1;
1063 void *extra2; 1025 void *extra2;
1064}; 1026};
@@ -1092,7 +1054,6 @@ struct ctl_table_header
1092/* struct ctl_path describes where in the hierarchy a table is added */ 1054/* struct ctl_path describes where in the hierarchy a table is added */
1093struct ctl_path { 1055struct ctl_path {
1094 const char *procname; 1056 const char *procname;
1095 int ctl_name;
1096}; 1057};
1097 1058
1098void register_sysctl_root(struct ctl_table_root *root); 1059void register_sysctl_root(struct ctl_table_root *root);
diff --git a/include/linux/tc_act/tc_defact.h b/include/linux/tc_act/tc_defact.h
index 964f473af0f0..6f65d07c7ce2 100644
--- a/include/linux/tc_act/tc_defact.h
+++ b/include/linux/tc_act/tc_defact.h
@@ -3,13 +3,11 @@
3 3
4#include <linux/pkt_cls.h> 4#include <linux/pkt_cls.h>
5 5
6struct tc_defact 6struct tc_defact {
7{
8 tc_gen; 7 tc_gen;
9}; 8};
10 9
11enum 10enum {
12{
13 TCA_DEF_UNSPEC, 11 TCA_DEF_UNSPEC,
14 TCA_DEF_TM, 12 TCA_DEF_TM,
15 TCA_DEF_PARMS, 13 TCA_DEF_PARMS,
diff --git a/include/linux/tc_act/tc_gact.h b/include/linux/tc_act/tc_gact.h
index e895c0a39629..f7bf94eed510 100644
--- a/include/linux/tc_act/tc_gact.h
+++ b/include/linux/tc_act/tc_gact.h
@@ -5,14 +5,12 @@
5#include <linux/pkt_cls.h> 5#include <linux/pkt_cls.h>
6 6
7#define TCA_ACT_GACT 5 7#define TCA_ACT_GACT 5
8struct tc_gact 8struct tc_gact {
9{
10 tc_gen; 9 tc_gen;
11 10
12}; 11};
13 12
14struct tc_gact_p 13struct tc_gact_p {
15{
16#define PGACT_NONE 0 14#define PGACT_NONE 0
17#define PGACT_NETRAND 1 15#define PGACT_NETRAND 1
18#define PGACT_DETERM 2 16#define PGACT_DETERM 2
@@ -22,8 +20,7 @@ struct tc_gact_p
22 int paction; 20 int paction;
23}; 21};
24 22
25enum 23enum {
26{
27 TCA_GACT_UNSPEC, 24 TCA_GACT_UNSPEC,
28 TCA_GACT_TM, 25 TCA_GACT_TM,
29 TCA_GACT_PARMS, 26 TCA_GACT_PARMS,
diff --git a/include/linux/tc_act/tc_ipt.h b/include/linux/tc_act/tc_ipt.h
index 4b6f7b6c7a79..a2335563d21f 100644
--- a/include/linux/tc_act/tc_ipt.h
+++ b/include/linux/tc_act/tc_ipt.h
@@ -5,8 +5,7 @@
5 5
6#define TCA_ACT_IPT 6 6#define TCA_ACT_IPT 6
7 7
8enum 8enum {
9{
10 TCA_IPT_UNSPEC, 9 TCA_IPT_UNSPEC,
11 TCA_IPT_TABLE, 10 TCA_IPT_TABLE,
12 TCA_IPT_HOOK, 11 TCA_IPT_HOOK,
diff --git a/include/linux/tc_act/tc_mirred.h b/include/linux/tc_act/tc_mirred.h
index 0a99ab60d610..7561750e8fd6 100644
--- a/include/linux/tc_act/tc_mirred.h
+++ b/include/linux/tc_act/tc_mirred.h
@@ -10,15 +10,13 @@
10#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/ 10#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/
11#define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */ 11#define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */
12 12
13struct tc_mirred 13struct tc_mirred {
14{
15 tc_gen; 14 tc_gen;
16 int eaction; /* one of IN/EGRESS_MIRROR/REDIR */ 15 int eaction; /* one of IN/EGRESS_MIRROR/REDIR */
17 __u32 ifindex; /* ifindex of egress port */ 16 __u32 ifindex; /* ifindex of egress port */
18}; 17};
19 18
20enum 19enum {
21{
22 TCA_MIRRED_UNSPEC, 20 TCA_MIRRED_UNSPEC,
23 TCA_MIRRED_TM, 21 TCA_MIRRED_TM,
24 TCA_MIRRED_PARMS, 22 TCA_MIRRED_PARMS,
diff --git a/include/linux/tc_act/tc_nat.h b/include/linux/tc_act/tc_nat.h
index e7cf31e8ba79..6663aeba0b9a 100644
--- a/include/linux/tc_act/tc_nat.h
+++ b/include/linux/tc_act/tc_nat.h
@@ -6,8 +6,7 @@
6 6
7#define TCA_ACT_NAT 9 7#define TCA_ACT_NAT 9
8 8
9enum 9enum {
10{
11 TCA_NAT_UNSPEC, 10 TCA_NAT_UNSPEC,
12 TCA_NAT_PARMS, 11 TCA_NAT_PARMS,
13 TCA_NAT_TM, 12 TCA_NAT_TM,
@@ -17,8 +16,7 @@ enum
17 16
18#define TCA_NAT_FLAG_EGRESS 1 17#define TCA_NAT_FLAG_EGRESS 1
19 18
20struct tc_nat 19struct tc_nat {
21{
22 tc_gen; 20 tc_gen;
23 __be32 old_addr; 21 __be32 old_addr;
24 __be32 new_addr; 22 __be32 new_addr;
diff --git a/include/linux/tc_act/tc_pedit.h b/include/linux/tc_act/tc_pedit.h
index 54ce9064115a..716cfabcd5b2 100644
--- a/include/linux/tc_act/tc_pedit.h
+++ b/include/linux/tc_act/tc_pedit.h
@@ -6,8 +6,7 @@
6 6
7#define TCA_ACT_PEDIT 7 7#define TCA_ACT_PEDIT 7
8 8
9enum 9enum {
10{
11 TCA_PEDIT_UNSPEC, 10 TCA_PEDIT_UNSPEC,
12 TCA_PEDIT_TM, 11 TCA_PEDIT_TM,
13 TCA_PEDIT_PARMS, 12 TCA_PEDIT_PARMS,
@@ -15,8 +14,7 @@ enum
15}; 14};
16#define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) 15#define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1)
17 16
18struct tc_pedit_key 17struct tc_pedit_key {
19{
20 __u32 mask; /* AND */ 18 __u32 mask; /* AND */
21 __u32 val; /*XOR */ 19 __u32 val; /*XOR */
22 __u32 off; /*offset */ 20 __u32 off; /*offset */
@@ -25,8 +23,7 @@ struct tc_pedit_key
25 __u32 shift; 23 __u32 shift;
26}; 24};
27 25
28struct tc_pedit_sel 26struct tc_pedit_sel {
29{
30 tc_gen; 27 tc_gen;
31 unsigned char nkeys; 28 unsigned char nkeys;
32 unsigned char flags; 29 unsigned char flags;
diff --git a/include/linux/tc_act/tc_skbedit.h b/include/linux/tc_act/tc_skbedit.h
index a14e461a7af7..7a2e910a5f08 100644
--- a/include/linux/tc_act/tc_skbedit.h
+++ b/include/linux/tc_act/tc_skbedit.h
@@ -26,6 +26,7 @@
26 26
27#define SKBEDIT_F_PRIORITY 0x1 27#define SKBEDIT_F_PRIORITY 0x1
28#define SKBEDIT_F_QUEUE_MAPPING 0x2 28#define SKBEDIT_F_QUEUE_MAPPING 0x2
29#define SKBEDIT_F_MARK 0x4
29 30
30struct tc_skbedit { 31struct tc_skbedit {
31 tc_gen; 32 tc_gen;
@@ -37,6 +38,7 @@ enum {
37 TCA_SKBEDIT_PARMS, 38 TCA_SKBEDIT_PARMS,
38 TCA_SKBEDIT_PRIORITY, 39 TCA_SKBEDIT_PRIORITY,
39 TCA_SKBEDIT_QUEUE_MAPPING, 40 TCA_SKBEDIT_QUEUE_MAPPING,
41 TCA_SKBEDIT_MARK,
40 __TCA_SKBEDIT_MAX 42 __TCA_SKBEDIT_MAX
41}; 43};
42#define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1) 44#define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)
diff --git a/include/linux/tc_ematch/tc_em_cmp.h b/include/linux/tc_ematch/tc_em_cmp.h
index 38e7f7b25ec2..f34bb1bae083 100644
--- a/include/linux/tc_ematch/tc_em_cmp.h
+++ b/include/linux/tc_ematch/tc_em_cmp.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/pkt_cls.h> 5#include <linux/pkt_cls.h>
6 6
7struct tcf_em_cmp 7struct tcf_em_cmp {
8{
9 __u32 val; 8 __u32 val;
10 __u32 mask; 9 __u32 mask;
11 __u16 off; 10 __u16 off;
@@ -15,8 +14,7 @@ struct tcf_em_cmp
15 __u8 opnd:4; 14 __u8 opnd:4;
16}; 15};
17 16
18enum 17enum {
19{
20 TCF_EM_ALIGN_U8 = 1, 18 TCF_EM_ALIGN_U8 = 1,
21 TCF_EM_ALIGN_U16 = 2, 19 TCF_EM_ALIGN_U16 = 2,
22 TCF_EM_ALIGN_U32 = 4 20 TCF_EM_ALIGN_U32 = 4
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index dcfb733fa1f6..0864206ec1a3 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/pkt_cls.h> 5#include <linux/pkt_cls.h>
6 6
7enum 7enum {
8{
9 TCA_EM_META_UNSPEC, 8 TCA_EM_META_UNSPEC,
10 TCA_EM_META_HDR, 9 TCA_EM_META_HDR,
11 TCA_EM_META_LVALUE, 10 TCA_EM_META_LVALUE,
@@ -14,8 +13,7 @@ enum
14}; 13};
15#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) 14#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1)
16 15
17struct tcf_meta_val 16struct tcf_meta_val {
18{
19 __u16 kind; 17 __u16 kind;
20 __u8 shift; 18 __u8 shift;
21 __u8 op; 19 __u8 op;
@@ -26,16 +24,14 @@ struct tcf_meta_val
26#define TCF_META_ID_MASK 0x7ff 24#define TCF_META_ID_MASK 0x7ff
27#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) 25#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK)
28 26
29enum 27enum {
30{
31 TCF_META_TYPE_VAR, 28 TCF_META_TYPE_VAR,
32 TCF_META_TYPE_INT, 29 TCF_META_TYPE_INT,
33 __TCF_META_TYPE_MAX 30 __TCF_META_TYPE_MAX
34}; 31};
35#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) 32#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1)
36 33
37enum 34enum {
38{
39 TCF_META_ID_VALUE, 35 TCF_META_ID_VALUE,
40 TCF_META_ID_RANDOM, 36 TCF_META_ID_RANDOM,
41 TCF_META_ID_LOADAVG_0, 37 TCF_META_ID_LOADAVG_0,
@@ -87,8 +83,7 @@ enum
87}; 83};
88#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) 84#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
89 85
90struct tcf_meta_hdr 86struct tcf_meta_hdr {
91{
92 struct tcf_meta_val left; 87 struct tcf_meta_val left;
93 struct tcf_meta_val right; 88 struct tcf_meta_val right;
94}; 89};
diff --git a/include/linux/tc_ematch/tc_em_nbyte.h b/include/linux/tc_ematch/tc_em_nbyte.h
index 9ed8c2e58488..7172cfb999c1 100644
--- a/include/linux/tc_ematch/tc_em_nbyte.h
+++ b/include/linux/tc_ematch/tc_em_nbyte.h
@@ -4,8 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/pkt_cls.h> 5#include <linux/pkt_cls.h>
6 6
7struct tcf_em_nbyte 7struct tcf_em_nbyte {
8{
9 __u16 off; 8 __u16 off;
10 __u16 len:12; 9 __u16 len:12;
11 __u8 layer:4; 10 __u8 layer:4;
diff --git a/include/linux/tc_ematch/tc_em_text.h b/include/linux/tc_ematch/tc_em_text.h
index d12a73a225fc..5aac4045ba88 100644
--- a/include/linux/tc_ematch/tc_em_text.h
+++ b/include/linux/tc_ematch/tc_em_text.h
@@ -6,8 +6,7 @@
6 6
7#define TC_EM_TEXT_ALGOSIZ 16 7#define TC_EM_TEXT_ALGOSIZ 16
8 8
9struct tcf_em_text 9struct tcf_em_text {
10{
11 char algo[TC_EM_TEXT_ALGOSIZ]; 10 char algo[TC_EM_TEXT_ALGOSIZ];
12 __u16 from_offset; 11 __u16 from_offset;
13 __u16 to_offset; 12 __u16 to_offset;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 61723a7c21fe..7fee8a4df931 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -81,6 +81,12 @@ enum {
81 TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000) 81 TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
82}; 82};
83 83
84/*
85 * TCP general constants
86 */
87#define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */
88#define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */
89
84/* TCP socket options */ 90/* TCP socket options */
85#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */ 91#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
86#define TCP_MAXSEG 2 /* Limit MSS */ 92#define TCP_MAXSEG 2 /* Limit MSS */
@@ -96,14 +102,15 @@ enum {
96#define TCP_QUICKACK 12 /* Block/reenable quick acks */ 102#define TCP_QUICKACK 12 /* Block/reenable quick acks */
97#define TCP_CONGESTION 13 /* Congestion control algorithm */ 103#define TCP_CONGESTION 13 /* Congestion control algorithm */
98#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ 104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
99 106
107/* for TCP_INFO socket option */
100#define TCPI_OPT_TIMESTAMPS 1 108#define TCPI_OPT_TIMESTAMPS 1
101#define TCPI_OPT_SACK 2 109#define TCPI_OPT_SACK 2
102#define TCPI_OPT_WSCALE 4 110#define TCPI_OPT_WSCALE 4
103#define TCPI_OPT_ECN 8 111#define TCPI_OPT_ECN 8
104 112
105enum tcp_ca_state 113enum tcp_ca_state {
106{
107 TCP_CA_Open = 0, 114 TCP_CA_Open = 0,
108#define TCPF_CA_Open (1<<TCP_CA_Open) 115#define TCPF_CA_Open (1<<TCP_CA_Open)
109 TCP_CA_Disorder = 1, 116 TCP_CA_Disorder = 1,
@@ -116,8 +123,7 @@ enum tcp_ca_state
116#define TCPF_CA_Loss (1<<TCP_CA_Loss) 123#define TCPF_CA_Loss (1<<TCP_CA_Loss)
117}; 124};
118 125
119struct tcp_info 126struct tcp_info {
120{
121 __u8 tcpi_state; 127 __u8 tcpi_state;
122 __u8 tcpi_ca_state; 128 __u8 tcpi_ca_state;
123 __u8 tcpi_retransmits; 129 __u8 tcpi_retransmits;
@@ -170,6 +176,30 @@ struct tcp_md5sig {
170 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */ 176 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
171}; 177};
172 178
179/* for TCP_COOKIE_TRANSACTIONS (TCPCT) socket option */
180#define TCP_COOKIE_MIN 8 /* 64-bits */
181#define TCP_COOKIE_MAX 16 /* 128-bits */
182#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX)
183
184/* Flags for both getsockopt and setsockopt */
185#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
186#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
187 * supercedes everything. */
188
189/* Flags for getsockopt */
190#define TCP_S_DATA_IN (1 << 2) /* Was data received? */
191#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */
192
193/* TCP_COOKIE_TRANSACTIONS data */
194struct tcp_cookie_transactions {
195 __u16 tcpct_flags; /* see above */
196 __u8 __tcpct_pad1; /* zero */
197 __u8 tcpct_cookie_desired; /* bytes */
198 __u16 tcpct_s_data_desired; /* bytes of variable data */
199 __u16 tcpct_used; /* bytes in value */
200 __u8 tcpct_value[TCP_MSS_DEFAULT];
201};
202
173#ifdef __KERNEL__ 203#ifdef __KERNEL__
174 204
175#include <linux/skbuff.h> 205#include <linux/skbuff.h>
@@ -217,26 +247,38 @@ struct tcp_options_received {
217 sack_ok : 4, /* SACK seen on SYN packet */ 247 sack_ok : 4, /* SACK seen on SYN packet */
218 snd_wscale : 4, /* Window scaling received from sender */ 248 snd_wscale : 4, /* Window scaling received from sender */
219 rcv_wscale : 4; /* Window scaling to send to receiver */ 249 rcv_wscale : 4; /* Window scaling to send to receiver */
220/* SACKs data */ 250 u8 cookie_plus:6, /* bytes in authenticator/cookie option */
251 cookie_out_never:1,
252 cookie_in_always:1;
221 u8 num_sacks; /* Number of SACK blocks */ 253 u8 num_sacks; /* Number of SACK blocks */
222 u16 user_mss; /* mss requested by user in ioctl */ 254 u16 user_mss; /* mss requested by user in ioctl */
223 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ 255 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
224}; 256};
225 257
258static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
259{
260 rx_opt->tstamp_ok = rx_opt->sack_ok = 0;
261 rx_opt->wscale_ok = rx_opt->snd_wscale = 0;
262 rx_opt->cookie_plus = 0;
263}
264
226/* This is the max number of SACKS that we'll generate and process. It's safe 265/* This is the max number of SACKS that we'll generate and process. It's safe
227 * to increse this, although since: 266 * to increase this, although since:
228 * size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8) 267 * size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8)
229 * only four options will fit in a standard TCP header */ 268 * only four options will fit in a standard TCP header */
230#define TCP_NUM_SACKS 4 269#define TCP_NUM_SACKS 4
231 270
271struct tcp_cookie_values;
272struct tcp_request_sock_ops;
273
232struct tcp_request_sock { 274struct tcp_request_sock {
233 struct inet_request_sock req; 275 struct inet_request_sock req;
234#ifdef CONFIG_TCP_MD5SIG 276#ifdef CONFIG_TCP_MD5SIG
235 /* Only used by TCP MD5 Signature so far. */ 277 /* Only used by TCP MD5 Signature so far. */
236 const struct tcp_request_sock_ops *af_specific; 278 const struct tcp_request_sock_ops *af_specific;
237#endif 279#endif
238 u32 rcv_isn; 280 u32 rcv_isn;
239 u32 snt_isn; 281 u32 snt_isn;
240}; 282};
241 283
242static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) 284static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
@@ -406,6 +448,12 @@ struct tcp_sock {
406/* TCP MD5 Signature Option information */ 448/* TCP MD5 Signature Option information */
407 struct tcp_md5sig_info *md5sig_info; 449 struct tcp_md5sig_info *md5sig_info;
408#endif 450#endif
451
452 /* When the cookie options are generated and exchanged, then this
453 * object holds a reference to them (cookie_values->kref). Also
454 * contains related tcp_cookie_transactions fields.
455 */
456 struct tcp_cookie_values *cookie_values;
409}; 457};
410 458
411static inline struct tcp_sock *tcp_sk(const struct sock *sk) 459static inline struct tcp_sock *tcp_sk(const struct sock *sk)
@@ -424,6 +472,10 @@ struct tcp_timewait_sock {
424 u16 tw_md5_keylen; 472 u16 tw_md5_keylen;
425 u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN]; 473 u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN];
426#endif 474#endif
475 /* Few sockets in timewait have cookies; in that case, then this
476 * object holds a reference to them (tw_cookie_values->kref).
477 */
478 struct tcp_cookie_values *tw_cookie_values;
427}; 479};
428 480
429static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) 481static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
@@ -431,6 +483,6 @@ static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
431 return (struct tcp_timewait_sock *)sk; 483 return (struct tcp_timewait_sock *)sk;
432} 484}
433 485
434#endif 486#endif /* __KERNEL__ */
435 487
436#endif /* _LINUX_TCP_H */ 488#endif /* _LINUX_TCP_H */
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 0482229c07db..d2ae79e21be3 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -43,6 +43,7 @@ enum tick_nohz_mode {
43 * @idle_exittime: Time when the idle state was left 43 * @idle_exittime: Time when the idle state was left
44 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped 44 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped
45 * @sleep_length: Duration of the current idle sleep 45 * @sleep_length: Duration of the current idle sleep
46 * @do_timer_lst: CPU was the last one doing do_timer before going idle
46 */ 47 */
47struct tick_sched { 48struct tick_sched {
48 struct hrtimer sched_timer; 49 struct hrtimer sched_timer;
@@ -64,6 +65,7 @@ struct tick_sched {
64 unsigned long last_jiffies; 65 unsigned long last_jiffies;
65 unsigned long next_jiffies; 66 unsigned long next_jiffies;
66 ktime_t idle_expires; 67 ktime_t idle_expires;
68 int do_timer_last;
67}; 69};
68 70
69extern void __init tick_init(void); 71extern void __init tick_init(void);
@@ -98,6 +100,9 @@ extern int tick_check_oneshot_change(int allow_nohz);
98extern struct tick_sched *tick_get_tick_sched(int cpu); 100extern struct tick_sched *tick_get_tick_sched(int cpu);
99extern void tick_check_idle(int cpu); 101extern void tick_check_idle(int cpu);
100extern int tick_oneshot_mode_active(void); 102extern int tick_oneshot_mode_active(void);
103# ifndef arch_needs_cpu
104# define arch_needs_cpu(cpu) (0)
105# endif
101# else 106# else
102static inline void tick_clock_notify(void) { } 107static inline void tick_clock_notify(void) { }
103static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } 108static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
diff --git a/include/linux/time.h b/include/linux/time.h
index fe04e5ef6a59..6e026e45a179 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -148,6 +148,7 @@ extern void monotonic_to_bootbased(struct timespec *ts);
148 148
149extern struct timespec timespec_trunc(struct timespec t, unsigned gran); 149extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
150extern int timekeeping_valid_for_hres(void); 150extern int timekeeping_valid_for_hres(void);
151extern u64 timekeeping_max_deferment(void);
151extern void update_wall_time(void); 152extern void update_wall_time(void);
152extern void update_xtime_cache(u64 nsec); 153extern void update_xtime_cache(u64 nsec);
153extern void timekeeping_leap_insert(int leapsecond); 154extern void timekeeping_leap_insert(int leapsecond);
diff --git a/include/linux/timex.h b/include/linux/timex.h
index e6967d10d9e5..94f8faecdcbc 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -115,13 +115,16 @@ struct timex {
115#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ 115#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */
116#endif 116#endif
117 117
118/* xntp 3.4 compatibility names */ 118/* NTP userland likes the MOD_ prefix better */
119#define MOD_OFFSET ADJ_OFFSET 119#define MOD_OFFSET ADJ_OFFSET
120#define MOD_FREQUENCY ADJ_FREQUENCY 120#define MOD_FREQUENCY ADJ_FREQUENCY
121#define MOD_MAXERROR ADJ_MAXERROR 121#define MOD_MAXERROR ADJ_MAXERROR
122#define MOD_ESTERROR ADJ_ESTERROR 122#define MOD_ESTERROR ADJ_ESTERROR
123#define MOD_STATUS ADJ_STATUS 123#define MOD_STATUS ADJ_STATUS
124#define MOD_TIMECONST ADJ_TIMECONST 124#define MOD_TIMECONST ADJ_TIMECONST
125#define MOD_TAI ADJ_TAI
126#define MOD_MICRO ADJ_MICRO
127#define MOD_NANO ADJ_NANO
125 128
126 129
127/* 130/*
@@ -261,11 +264,7 @@ static inline int ntp_synced(void)
261 264
262#define NTP_SCALE_SHIFT 32 265#define NTP_SCALE_SHIFT 32
263 266
264#ifdef CONFIG_NO_HZ
265#define NTP_INTERVAL_FREQ (2)
266#else
267#define NTP_INTERVAL_FREQ (HZ) 267#define NTP_INTERVAL_FREQ (HZ)
268#endif
269#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) 268#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ)
270 269
271/* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */ 270/* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */
diff --git a/include/linux/tpm.h b/include/linux/tpm.h
index 3338b3f5c21a..ac5d1c1285d9 100644
--- a/include/linux/tpm.h
+++ b/include/linux/tpm.h
@@ -27,9 +27,16 @@
27 */ 27 */
28#define TPM_ANY_NUM 0xFFFF 28#define TPM_ANY_NUM 0xFFFF
29 29
30#if defined(CONFIG_TCG_TPM) 30#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
31 31
32extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); 32extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
33extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); 33extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash);
34#else
35static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) {
36 return -ENODEV;
37}
38static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) {
39 return -ENODEV;
40}
34#endif 41#endif
35#endif 42#endif
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h
index 09077f6ed128..5cf397ceb726 100644
--- a/include/linux/trace_seq.h
+++ b/include/linux/trace_seq.h
@@ -14,6 +14,7 @@ struct trace_seq {
14 unsigned char buffer[PAGE_SIZE]; 14 unsigned char buffer[PAGE_SIZE];
15 unsigned int len; 15 unsigned int len;
16 unsigned int readpos; 16 unsigned int readpos;
17 int full;
17}; 18};
18 19
19static inline void 20static inline void
@@ -21,6 +22,7 @@ trace_seq_init(struct trace_seq *s)
21{ 22{
22 s->len = 0; 23 s->len = 0;
23 s->readpos = 0; 24 s->readpos = 0;
25 s->full = 0;
24} 26}
25 27
26/* 28/*
@@ -33,7 +35,7 @@ extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args)
33 __attribute__ ((format (printf, 2, 0))); 35 __attribute__ ((format (printf, 2, 0)));
34extern int 36extern int
35trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); 37trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary);
36extern void trace_print_seq(struct seq_file *m, struct trace_seq *s); 38extern int trace_print_seq(struct seq_file *m, struct trace_seq *s);
37extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, 39extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf,
38 size_t cnt); 40 size_t cnt);
39extern int trace_seq_puts(struct trace_seq *s, const char *str); 41extern int trace_seq_puts(struct trace_seq *s, const char *str);
@@ -55,8 +57,9 @@ trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary)
55 return 0; 57 return 0;
56} 58}
57 59
58static inline void trace_print_seq(struct seq_file *m, struct trace_seq *s) 60static inline int trace_print_seq(struct seq_file *m, struct trace_seq *s)
59{ 61{
62 return 0;
60} 63}
61static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, 64static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf,
62 size_t cnt) 65 size_t cnt)
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 2aac8a83e89b..f59604ed0ec6 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -280,6 +280,12 @@ static inline void tracepoint_synchronize_unregister(void)
280 * TRACE_EVENT_FN to perform any (un)registration work. 280 * TRACE_EVENT_FN to perform any (un)registration work.
281 */ 281 */
282 282
283#define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print)
284#define DEFINE_EVENT(template, name, proto, args) \
285 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
286#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
287 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
288
283#define TRACE_EVENT(name, proto, args, struct, assign, print) \ 289#define TRACE_EVENT(name, proto, args, struct, assign, print) \
284 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) 290 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
285#define TRACE_EVENT_FN(name, proto, args, struct, \ 291#define TRACE_EVENT_FN(name, proto, args, struct, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index f0f43d08d8b8..405a9035fe40 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -190,9 +190,17 @@ struct tty_port_operations {
190 /* Control the DTR line */ 190 /* Control the DTR line */
191 void (*dtr_rts)(struct tty_port *port, int raise); 191 void (*dtr_rts)(struct tty_port *port, int raise);
192 /* Called when the last close completes or a hangup finishes 192 /* Called when the last close completes or a hangup finishes
193 IFF the port was initialized. Do not use to free resources */ 193 IFF the port was initialized. Do not use to free resources. Called
194 under the port mutex to serialize against activate/shutdowns */
194 void (*shutdown)(struct tty_port *port); 195 void (*shutdown)(struct tty_port *port);
195 void (*drop)(struct tty_port *port); 196 void (*drop)(struct tty_port *port);
197 /* Called under the port mutex from tty_port_open, serialized using
198 the port mutex */
199 /* FIXME: long term getting the tty argument *out* of this would be
200 good for consoles */
201 int (*activate)(struct tty_port *port, struct tty_struct *tty);
202 /* Called on the final put of a port */
203 void (*destruct)(struct tty_port *port);
196}; 204};
197 205
198struct tty_port { 206struct tty_port {
@@ -206,12 +214,14 @@ struct tty_port {
206 wait_queue_head_t delta_msr_wait; /* Modem status change */ 214 wait_queue_head_t delta_msr_wait; /* Modem status change */
207 unsigned long flags; /* TTY flags ASY_*/ 215 unsigned long flags; /* TTY flags ASY_*/
208 struct mutex mutex; /* Locking */ 216 struct mutex mutex; /* Locking */
217 struct mutex buf_mutex; /* Buffer alloc lock */
209 unsigned char *xmit_buf; /* Optional buffer */ 218 unsigned char *xmit_buf; /* Optional buffer */
210 unsigned int close_delay; /* Close port delay */ 219 unsigned int close_delay; /* Close port delay */
211 unsigned int closing_wait; /* Delay for output */ 220 unsigned int closing_wait; /* Delay for output */
212 int drain_delay; /* Set to zero if no pure time 221 int drain_delay; /* Set to zero if no pure time
213 based drain is needed else 222 based drain is needed else
214 set to size of fifo */ 223 set to size of fifo */
224 struct kref kref; /* Ref counter */
215}; 225};
216 226
217/* 227/*
@@ -439,7 +449,7 @@ extern void initialize_tty_struct(struct tty_struct *tty,
439 struct tty_driver *driver, int idx); 449 struct tty_driver *driver, int idx);
440extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx, 450extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx,
441 int first_ok); 451 int first_ok);
442extern void tty_release_dev(struct file *filp); 452extern int tty_release(struct inode *inode, struct file *filp);
443extern int tty_init_termios(struct tty_struct *tty); 453extern int tty_init_termios(struct tty_struct *tty);
444 454
445extern struct tty_struct *tty_pair_get_tty(struct tty_struct *tty); 455extern struct tty_struct *tty_pair_get_tty(struct tty_struct *tty);
@@ -454,6 +464,15 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay);
454extern void tty_port_init(struct tty_port *port); 464extern void tty_port_init(struct tty_port *port);
455extern int tty_port_alloc_xmit_buf(struct tty_port *port); 465extern int tty_port_alloc_xmit_buf(struct tty_port *port);
456extern void tty_port_free_xmit_buf(struct tty_port *port); 466extern void tty_port_free_xmit_buf(struct tty_port *port);
467extern void tty_port_put(struct tty_port *port);
468
469extern inline struct tty_port *tty_port_get(struct tty_port *port)
470{
471 if (port)
472 kref_get(&port->kref);
473 return port;
474}
475
457extern struct tty_struct *tty_port_tty_get(struct tty_port *port); 476extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
458extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); 477extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
459extern int tty_port_carrier_raised(struct tty_port *port); 478extern int tty_port_carrier_raised(struct tty_port *port);
@@ -467,6 +486,8 @@ extern int tty_port_close_start(struct tty_port *port,
467extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); 486extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty);
468extern void tty_port_close(struct tty_port *port, 487extern void tty_port_close(struct tty_port *port,
469 struct tty_struct *tty, struct file *filp); 488 struct tty_struct *tty, struct file *filp);
489extern int tty_port_open(struct tty_port *port,
490 struct tty_struct *tty, struct file *filp);
470extern inline int tty_port_users(struct tty_port *port) 491extern inline int tty_port_users(struct tty_port *port)
471{ 492{
472 return port->count + port->blocked_open; 493 return port->count + port->blocked_open;
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 0cf5c4c0ec81..03f72a2ba028 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -45,16 +45,19 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
45 return (struct udphdr *)skb_transport_header(skb); 45 return (struct udphdr *)skb_transport_header(skb);
46} 46}
47 47
48#define UDP_HTABLE_SIZE 128 48#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256)
49 49
50static inline int udp_hashfn(struct net *net, const unsigned num) 50static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask)
51{ 51{
52 return (num + net_hash_mix(net)) & (UDP_HTABLE_SIZE - 1); 52 return (num + net_hash_mix(net)) & mask;
53} 53}
54 54
55struct udp_sock { 55struct udp_sock {
56 /* inet_sock has to be the first member */ 56 /* inet_sock has to be the first member */
57 struct inet_sock inet; 57 struct inet_sock inet;
58#define udp_port_hash inet.sk.__sk_common.skc_u16hashes[0]
59#define udp_portaddr_hash inet.sk.__sk_common.skc_u16hashes[1]
60#define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node
58 int pending; /* Any pending frames ? */ 61 int pending; /* Any pending frames ? */
59 unsigned int corkflag; /* Cork is required */ 62 unsigned int corkflag; /* Cork is required */
60 __u16 encap_type; /* Is this an Encapsulation socket? */ 63 __u16 encap_type; /* Is this an Encapsulation socket? */
@@ -85,6 +88,12 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
85 return (struct udp_sock *)sk; 88 return (struct udp_sock *)sk;
86} 89}
87 90
91#define udp_portaddr_for_each_entry(__sk, node, list) \
92 hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node)
93
94#define udp_portaddr_for_each_entry_rcu(__sk, node, list) \
95 hlist_nulls_for_each_entry_rcu(__sk, node, list, __sk_common.skc_portaddr_node)
96
88#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) 97#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
89 98
90#endif 99#endif
diff --git a/include/linux/usb.h b/include/linux/usb.h
index a34fa89f1474..e101a2d04d75 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -331,6 +331,7 @@ struct usb_bus {
331 u8 otg_port; /* 0, or number of OTG/HNP port */ 331 u8 otg_port; /* 0, or number of OTG/HNP port */
332 unsigned is_b_host:1; /* true during some HNP roleswitches */ 332 unsigned is_b_host:1; /* true during some HNP roleswitches */
333 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ 333 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
334 unsigned sg_tablesize; /* 0 or largest number of sg list entries */
334 335
335 int devnum_next; /* Next open device number in 336 int devnum_next; /* Next open device number in
336 * round-robin allocation */ 337 * round-robin allocation */
@@ -428,11 +429,9 @@ struct usb_tt;
428 * @last_busy: time of last use 429 * @last_busy: time of last use
429 * @autosuspend_delay: in jiffies 430 * @autosuspend_delay: in jiffies
430 * @connect_time: time device was first connected 431 * @connect_time: time device was first connected
431 * @auto_pm: autosuspend/resume in progress
432 * @do_remote_wakeup: remote wakeup should be enabled 432 * @do_remote_wakeup: remote wakeup should be enabled
433 * @reset_resume: needs reset instead of resume 433 * @reset_resume: needs reset instead of resume
434 * @autosuspend_disabled: autosuspend disabled by the user 434 * @autosuspend_disabled: autosuspend disabled by the user
435 * @autoresume_disabled: autoresume disabled by the user
436 * @skip_sys_resume: skip the next system resume 435 * @skip_sys_resume: skip the next system resume
437 * @wusb_dev: if this is a Wireless USB device, link to the WUSB 436 * @wusb_dev: if this is a Wireless USB device, link to the WUSB
438 * specific data for the device. 437 * specific data for the device.
@@ -513,11 +512,9 @@ struct usb_device {
513 int autosuspend_delay; 512 int autosuspend_delay;
514 unsigned long connect_time; 513 unsigned long connect_time;
515 514
516 unsigned auto_pm:1;
517 unsigned do_remote_wakeup:1; 515 unsigned do_remote_wakeup:1;
518 unsigned reset_resume:1; 516 unsigned reset_resume:1;
519 unsigned autosuspend_disabled:1; 517 unsigned autosuspend_disabled:1;
520 unsigned autoresume_disabled:1;
521 unsigned skip_sys_resume:1; 518 unsigned skip_sys_resume:1;
522#endif 519#endif
523 struct wusb_dev *wusb_dev; 520 struct wusb_dev *wusb_dev;
@@ -543,22 +540,20 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
543 540
544/* USB autosuspend and autoresume */ 541/* USB autosuspend and autoresume */
545#ifdef CONFIG_USB_SUSPEND 542#ifdef CONFIG_USB_SUSPEND
546extern int usb_autopm_set_interface(struct usb_interface *intf);
547extern int usb_autopm_get_interface(struct usb_interface *intf); 543extern int usb_autopm_get_interface(struct usb_interface *intf);
548extern void usb_autopm_put_interface(struct usb_interface *intf); 544extern void usb_autopm_put_interface(struct usb_interface *intf);
549extern int usb_autopm_get_interface_async(struct usb_interface *intf); 545extern int usb_autopm_get_interface_async(struct usb_interface *intf);
550extern void usb_autopm_put_interface_async(struct usb_interface *intf); 546extern void usb_autopm_put_interface_async(struct usb_interface *intf);
551 547
552static inline void usb_autopm_enable(struct usb_interface *intf) 548static inline void usb_autopm_get_interface_no_resume(
549 struct usb_interface *intf)
553{ 550{
554 atomic_set(&intf->pm_usage_cnt, 0); 551 atomic_inc(&intf->pm_usage_cnt);
555 usb_autopm_set_interface(intf);
556} 552}
557 553static inline void usb_autopm_put_interface_no_suspend(
558static inline void usb_autopm_disable(struct usb_interface *intf) 554 struct usb_interface *intf)
559{ 555{
560 atomic_set(&intf->pm_usage_cnt, 1); 556 atomic_dec(&intf->pm_usage_cnt);
561 usb_autopm_set_interface(intf);
562} 557}
563 558
564static inline void usb_mark_last_busy(struct usb_device *udev) 559static inline void usb_mark_last_busy(struct usb_device *udev)
@@ -568,12 +563,8 @@ static inline void usb_mark_last_busy(struct usb_device *udev)
568 563
569#else 564#else
570 565
571static inline int usb_autopm_set_interface(struct usb_interface *intf)
572{ return 0; }
573
574static inline int usb_autopm_get_interface(struct usb_interface *intf) 566static inline int usb_autopm_get_interface(struct usb_interface *intf)
575{ return 0; } 567{ return 0; }
576
577static inline int usb_autopm_get_interface_async(struct usb_interface *intf) 568static inline int usb_autopm_get_interface_async(struct usb_interface *intf)
578{ return 0; } 569{ return 0; }
579 570
@@ -581,9 +572,11 @@ static inline void usb_autopm_put_interface(struct usb_interface *intf)
581{ } 572{ }
582static inline void usb_autopm_put_interface_async(struct usb_interface *intf) 573static inline void usb_autopm_put_interface_async(struct usb_interface *intf)
583{ } 574{ }
584static inline void usb_autopm_enable(struct usb_interface *intf) 575static inline void usb_autopm_get_interface_no_resume(
576 struct usb_interface *intf)
585{ } 577{ }
586static inline void usb_autopm_disable(struct usb_interface *intf) 578static inline void usb_autopm_put_interface_no_suspend(
579 struct usb_interface *intf)
587{ } 580{ }
588static inline void usb_mark_last_busy(struct usb_device *udev) 581static inline void usb_mark_last_busy(struct usb_device *udev)
589{ } 582{ }
@@ -626,6 +619,10 @@ extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev,
626 unsigned ifnum); 619 unsigned ifnum);
627extern struct usb_host_interface *usb_altnum_to_altsetting( 620extern struct usb_host_interface *usb_altnum_to_altsetting(
628 const struct usb_interface *intf, unsigned int altnum); 621 const struct usb_interface *intf, unsigned int altnum);
622extern struct usb_host_interface *usb_find_alt_setting(
623 struct usb_host_config *config,
624 unsigned int iface_num,
625 unsigned int alt_num);
629 626
630 627
631/** 628/**
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 4f6bb3d2160e..738ea1a691cb 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -127,6 +127,7 @@ struct usb_function {
127 /* private: */ 127 /* private: */
128 /* internals */ 128 /* internals */
129 struct list_head list; 129 struct list_head list;
130 DECLARE_BITMAP(endpoints, 32);
130}; 131};
131 132
132int usb_add_function(struct usb_configuration *, struct usb_function *); 133int usb_add_function(struct usb_configuration *, struct usb_function *);
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 2443c0e7a80c..52bb917641f0 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -33,6 +33,23 @@ enum usb_otg_state {
33 OTG_STATE_A_VBUS_ERR, 33 OTG_STATE_A_VBUS_ERR,
34}; 34};
35 35
36#define USB_OTG_PULLUP_ID (1 << 0)
37#define USB_OTG_PULLDOWN_DP (1 << 1)
38#define USB_OTG_PULLDOWN_DM (1 << 2)
39#define USB_OTG_EXT_VBUS_INDICATOR (1 << 3)
40#define USB_OTG_DRV_VBUS (1 << 4)
41#define USB_OTG_DRV_VBUS_EXT (1 << 5)
42
43struct otg_transceiver;
44
45/* for transceivers connected thru an ULPI interface, the user must
46 * provide access ops
47 */
48struct otg_io_access_ops {
49 int (*read)(struct otg_transceiver *otg, u32 reg);
50 int (*write)(struct otg_transceiver *otg, u32 val, u32 reg);
51};
52
36/* 53/*
37 * the otg driver needs to interact with both device side and host side 54 * the otg driver needs to interact with both device side and host side
38 * usb controllers. it decides which controller is active at a given 55 * usb controllers. it decides which controller is active at a given
@@ -42,6 +59,7 @@ enum usb_otg_state {
42struct otg_transceiver { 59struct otg_transceiver {
43 struct device *dev; 60 struct device *dev;
44 const char *label; 61 const char *label;
62 unsigned int flags;
45 63
46 u8 default_a; 64 u8 default_a;
47 enum usb_otg_state state; 65 enum usb_otg_state state;
@@ -49,10 +67,17 @@ struct otg_transceiver {
49 struct usb_bus *host; 67 struct usb_bus *host;
50 struct usb_gadget *gadget; 68 struct usb_gadget *gadget;
51 69
70 struct otg_io_access_ops *io_ops;
71 void __iomem *io_priv;
72
52 /* to pass extra port status to the root hub */ 73 /* to pass extra port status to the root hub */
53 u16 port_status; 74 u16 port_status;
54 u16 port_change; 75 u16 port_change;
55 76
77 /* initialize/shutdown the OTG controller */
78 int (*init)(struct otg_transceiver *otg);
79 void (*shutdown)(struct otg_transceiver *otg);
80
56 /* bind/unbind the host controller */ 81 /* bind/unbind the host controller */
57 int (*set_host)(struct otg_transceiver *otg, 82 int (*set_host)(struct otg_transceiver *otg,
58 struct usb_bus *host); 83 struct usb_bus *host);
@@ -65,6 +90,10 @@ struct otg_transceiver {
65 int (*set_power)(struct otg_transceiver *otg, 90 int (*set_power)(struct otg_transceiver *otg,
66 unsigned mA); 91 unsigned mA);
67 92
93 /* effective for A-peripheral, ignored for B devices */
94 int (*set_vbus)(struct otg_transceiver *otg,
95 bool enabled);
96
68 /* for non-OTG B devices: set transceiver into suspend mode */ 97 /* for non-OTG B devices: set transceiver into suspend mode */
69 int (*set_suspend)(struct otg_transceiver *otg, 98 int (*set_suspend)(struct otg_transceiver *otg,
70 int suspend); 99 int suspend);
@@ -85,6 +114,38 @@ extern int otg_set_transceiver(struct otg_transceiver *);
85extern void usb_nop_xceiv_register(void); 114extern void usb_nop_xceiv_register(void);
86extern void usb_nop_xceiv_unregister(void); 115extern void usb_nop_xceiv_unregister(void);
87 116
117/* helpers for direct access thru low-level io interface */
118static inline int otg_io_read(struct otg_transceiver *otg, u32 reg)
119{
120 if (otg->io_ops && otg->io_ops->read)
121 return otg->io_ops->read(otg, reg);
122
123 return -EINVAL;
124}
125
126static inline int otg_io_write(struct otg_transceiver *otg, u32 reg, u32 val)
127{
128 if (otg->io_ops && otg->io_ops->write)
129 return otg->io_ops->write(otg, reg, val);
130
131 return -EINVAL;
132}
133
134static inline int
135otg_init(struct otg_transceiver *otg)
136{
137 if (otg->init)
138 return otg->init(otg);
139
140 return 0;
141}
142
143static inline void
144otg_shutdown(struct otg_transceiver *otg)
145{
146 if (otg->shutdown)
147 otg->shutdown(otg);
148}
88 149
89/* for usb host and peripheral controller drivers */ 150/* for usb host and peripheral controller drivers */
90extern struct otg_transceiver *otg_get_transceiver(void); 151extern struct otg_transceiver *otg_get_transceiver(void);
@@ -97,6 +158,12 @@ otg_start_hnp(struct otg_transceiver *otg)
97 return otg->start_hnp(otg); 158 return otg->start_hnp(otg);
98} 159}
99 160
161/* Context: can sleep */
162static inline int
163otg_set_vbus(struct otg_transceiver *otg, bool enabled)
164{
165 return otg->set_vbus(otg, enabled);
166}
100 167
101/* for HCDs */ 168/* for HCDs */
102static inline int 169static inline int
@@ -105,7 +172,6 @@ otg_set_host(struct otg_transceiver *otg, struct usb_bus *host)
105 return otg->set_host(otg, host); 172 return otg->set_host(otg, host);
106} 173}
107 174
108
109/* for usb peripheral controller drivers */ 175/* for usb peripheral controller drivers */
110 176
111/* Context: can sleep */ 177/* Context: can sleep */
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index ce911ebf91e8..acf6e457c04b 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -39,8 +39,6 @@ enum port_dev_state {
39 * @serial: pointer back to the struct usb_serial owner of this port. 39 * @serial: pointer back to the struct usb_serial owner of this port.
40 * @port: pointer to the corresponding tty_port for this port. 40 * @port: pointer to the corresponding tty_port for this port.
41 * @lock: spinlock to grab when updating portions of this structure. 41 * @lock: spinlock to grab when updating portions of this structure.
42 * @mutex: mutex used to synchronize serial_open() and serial_close()
43 * access for this port.
44 * @number: the number of the port (the minor number). 42 * @number: the number of the port (the minor number).
45 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. 43 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port.
46 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. 44 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port.
@@ -77,7 +75,6 @@ struct usb_serial_port {
77 struct usb_serial *serial; 75 struct usb_serial *serial;
78 struct tty_port port; 76 struct tty_port port;
79 spinlock_t lock; 77 spinlock_t lock;
80 struct mutex mutex;
81 unsigned char number; 78 unsigned char number;
82 79
83 unsigned char *interrupt_in_buffer; 80 unsigned char *interrupt_in_buffer;
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h
new file mode 100644
index 000000000000..20675c6ebc4d
--- /dev/null
+++ b/include/linux/usb/ulpi.h
@@ -0,0 +1,7 @@
1#ifndef __LINUX_USB_ULPI_H
2#define __LINUX_USB_ULPI_H
3
4struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops,
5 unsigned int flags);
6
7#endif /* __LINUX_USB_ULPI_H */
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index f81473052059..8ce61359bf73 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -55,6 +55,7 @@ struct usbnet {
55 struct sk_buff_head done; 55 struct sk_buff_head done;
56 struct sk_buff_head rxq_pause; 56 struct sk_buff_head rxq_pause;
57 struct urb *interrupt; 57 struct urb *interrupt;
58 struct usb_anchor deferred;
58 struct tasklet_struct bh; 59 struct tasklet_struct bh;
59 60
60 struct work_struct kevent; 61 struct work_struct kevent;
@@ -65,6 +66,8 @@ struct usbnet {
65# define EVENT_STS_SPLIT 3 66# define EVENT_STS_SPLIT 3
66# define EVENT_LINK_RESET 4 67# define EVENT_LINK_RESET 4
67# define EVENT_RX_PAUSED 5 68# define EVENT_RX_PAUSED 5
69# define EVENT_DEV_WAKING 6
70# define EVENT_DEV_ASLEEP 7
68}; 71};
69 72
70static inline struct usb_driver *driver_of(struct usb_interface *intf) 73static inline struct usb_driver *driver_of(struct usb_interface *intf)
@@ -90,7 +93,9 @@ struct driver_info {
90#define FLAG_WLAN 0x0080 /* use "wlan%d" names */ 93#define FLAG_WLAN 0x0080 /* use "wlan%d" names */
91#define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */ 94#define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */
92#define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */ 95#define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */
96#define FLAG_WWAN 0x0400 /* use "wwan%d" names */
93 97
98#define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */
94 99
95 /* init device ... can sleep, or cause probe() failure */ 100 /* init device ... can sleep, or cause probe() failure */
96 int (*bind)(struct usbnet *, struct usb_interface *); 101 int (*bind)(struct usbnet *, struct usb_interface *);
@@ -107,6 +112,9 @@ struct driver_info {
107 /* see if peer is connected ... can sleep */ 112 /* see if peer is connected ... can sleep */
108 int (*check_connect)(struct usbnet *); 113 int (*check_connect)(struct usbnet *);
109 114
115 /* (dis)activate runtime power management */
116 int (*manage_power)(struct usbnet *, int);
117
110 /* for status polling */ 118 /* for status polling */
111 void (*status)(struct usbnet *, struct urb *); 119 void (*status)(struct usbnet *, struct urb *);
112 120
diff --git a/include/linux/usb/wusb.h b/include/linux/usb/wusb.h
index 429c631d2aad..63ebdcc5dda6 100644
--- a/include/linux/usb/wusb.h
+++ b/include/linux/usb/wusb.h
@@ -74,7 +74,7 @@ enum {
74 * WUSB defines that CHIDs, CDIDs and CKs are a 16 byte string of 74 * WUSB defines that CHIDs, CDIDs and CKs are a 16 byte string of
75 * data. In order to avoid confusion and enforce types, we wrap it. 75 * data. In order to avoid confusion and enforce types, we wrap it.
76 * 76 *
77 * Make it packed, as we use it in some hw defintions. 77 * Make it packed, as we use it in some hw definitions.
78 */ 78 */
79struct wusb_ckhdid { 79struct wusb_ckhdid {
80 u8 data[16]; 80 u8 data[16];
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 3d15fb9bc116..a4b947e470a5 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -56,7 +56,9 @@
56 US_FLAG(SANE_SENSE, 0x00008000) \ 56 US_FLAG(SANE_SENSE, 0x00008000) \
57 /* Sane Sense (> 18 bytes) */ \ 57 /* Sane Sense (> 18 bytes) */ \
58 US_FLAG(CAPACITY_OK, 0x00010000) \ 58 US_FLAG(CAPACITY_OK, 0x00010000) \
59 /* READ CAPACITY response is correct */ 59 /* READ CAPACITY response is correct */ \
60 US_FLAG(BAD_SENSE, 0x00020000) \
61 /* Bad Sense (never more than 18 bytes) */
60 62
61#define US_FLAG(name, value) US_FL_##name = value , 63#define US_FLAG(name, value) US_FL_##name = value ,
62enum { US_DO_ALL_FLAGS }; 64enum { US_DO_ALL_FLAGS };
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index b2a7d8ba6ee3..15591d2ea400 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -128,6 +128,29 @@ struct usbdevfs_hub_portinfo {
128#ifdef __KERNEL__ 128#ifdef __KERNEL__
129#ifdef CONFIG_COMPAT 129#ifdef CONFIG_COMPAT
130#include <linux/compat.h> 130#include <linux/compat.h>
131
132struct usbdevfs_ctrltransfer32 {
133 u8 bRequestType;
134 u8 bRequest;
135 u16 wValue;
136 u16 wIndex;
137 u16 wLength;
138 u32 timeout; /* in milliseconds */
139 compat_caddr_t data;
140};
141
142struct usbdevfs_bulktransfer32 {
143 compat_uint_t ep;
144 compat_uint_t len;
145 compat_uint_t timeout; /* in milliseconds */
146 compat_caddr_t data;
147};
148
149struct usbdevfs_disconnectsignal32 {
150 compat_int_t signr;
151 compat_caddr_t context;
152};
153
131struct usbdevfs_urb32 { 154struct usbdevfs_urb32 {
132 unsigned char type; 155 unsigned char type;
133 unsigned char endpoint; 156 unsigned char endpoint;
@@ -153,7 +176,9 @@ struct usbdevfs_ioctl32 {
153#endif /* __KERNEL__ */ 176#endif /* __KERNEL__ */
154 177
155#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) 178#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
179#define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
156#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) 180#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
181#define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32)
157#define USBDEVFS_RESETEP _IOR('U', 3, unsigned int) 182#define USBDEVFS_RESETEP _IOR('U', 3, unsigned int)
158#define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface) 183#define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface)
159#define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int) 184#define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
@@ -166,6 +191,7 @@ struct usbdevfs_ioctl32 {
166#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) 191#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *)
167#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) 192#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32)
168#define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) 193#define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal)
194#define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32)
169#define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) 195#define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
170#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) 196#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
171#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) 197#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
diff --git a/include/linux/user-return-notifier.h b/include/linux/user-return-notifier.h
new file mode 100644
index 000000000000..9c4a445bb43c
--- /dev/null
+++ b/include/linux/user-return-notifier.h
@@ -0,0 +1,49 @@
1#ifndef _LINUX_USER_RETURN_NOTIFIER_H
2#define _LINUX_USER_RETURN_NOTIFIER_H
3
4#ifdef CONFIG_USER_RETURN_NOTIFIER
5
6#include <linux/list.h>
7#include <linux/sched.h>
8
9struct user_return_notifier {
10 void (*on_user_return)(struct user_return_notifier *urn);
11 struct hlist_node link;
12};
13
14
15void user_return_notifier_register(struct user_return_notifier *urn);
16void user_return_notifier_unregister(struct user_return_notifier *urn);
17
18static inline void propagate_user_return_notify(struct task_struct *prev,
19 struct task_struct *next)
20{
21 if (test_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY)) {
22 clear_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY);
23 set_tsk_thread_flag(next, TIF_USER_RETURN_NOTIFY);
24 }
25}
26
27void fire_user_return_notifiers(void);
28
29static inline void clear_user_return_notifier(struct task_struct *p)
30{
31 clear_tsk_thread_flag(p, TIF_USER_RETURN_NOTIFY);
32}
33
34#else
35
36struct user_return_notifier {};
37
38static inline void propagate_user_return_notify(struct task_struct *prev,
39 struct task_struct *next)
40{
41}
42
43static inline void fire_user_return_notifiers(void) {}
44
45static inline void clear_user_return_notifier(struct task_struct *p) {}
46
47#endif
48
49#endif
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index b59e78c57161..32b92298fd79 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -361,6 +361,7 @@ struct v4l2_pix_format {
361#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 */
362#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 */
363#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 */
364#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
364 365
365/* 366/*
366 * F O R M A T E N U M E R A T I O N 367 * F O R M A T E N U M E R A T I O N
@@ -490,7 +491,7 @@ struct v4l2_jpegcompression {
490 * you do, leave them untouched. 491 * you do, leave them untouched.
491 * Inluding less markers will make the 492 * Inluding less markers will make the
492 * resulting code smaller, but there will 493 * resulting code smaller, but there will
493 * be fewer aplications which can read it. 494 * be fewer applications which can read it.
494 * The presence of the APP and COM marker 495 * The presence of the APP and COM marker
495 * is influenced by APP_len and COM_len 496 * is influenced by APP_len and COM_len
496 * ONLY, not by this property! */ 497 * ONLY, not by this property! */
@@ -563,6 +564,7 @@ struct v4l2_framebuffer {
563#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 564#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
564#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 565#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
565#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 566#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
567#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
566/* Flags for the 'flags' field. */ 568/* Flags for the 'flags' field. */
567#define V4L2_FBUF_FLAG_PRIMARY 0x0001 569#define V4L2_FBUF_FLAG_PRIMARY 0x0001
568#define V4L2_FBUF_FLAG_OVERLAY 0x0002 570#define V4L2_FBUF_FLAG_OVERLAY 0x0002
@@ -570,6 +572,7 @@ struct v4l2_framebuffer {
570#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 572#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
571#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 573#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
572#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 574#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
575#define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040
573 576
574struct v4l2_clip { 577struct v4l2_clip {
575 struct v4l2_rect c; 578 struct v4l2_rect c;
@@ -912,8 +915,10 @@ enum v4l2_colorfx {
912#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) 915#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
913#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) 916#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
914 917
918#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
919#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
915/* last CID + 1 */ 920/* last CID + 1 */
916#define V4L2_CID_LASTP1 (V4L2_CID_BASE+34) 921#define V4L2_CID_LASTP1 (V4L2_CID_BASE+36)
917 922
918/* MPEG-class control IDs defined by V4L2 */ 923/* MPEG-class control IDs defined by V4L2 */
919#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 924#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 2d0f222388a8..d85889710f9b 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -76,24 +76,22 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
76 76
77static inline void __count_vm_event(enum vm_event_item item) 77static inline void __count_vm_event(enum vm_event_item item)
78{ 78{
79 __get_cpu_var(vm_event_states).event[item]++; 79 __this_cpu_inc(per_cpu_var(vm_event_states).event[item]);
80} 80}
81 81
82static inline void count_vm_event(enum vm_event_item item) 82static inline void count_vm_event(enum vm_event_item item)
83{ 83{
84 get_cpu_var(vm_event_states).event[item]++; 84 this_cpu_inc(per_cpu_var(vm_event_states).event[item]);
85 put_cpu();
86} 85}
87 86
88static inline void __count_vm_events(enum vm_event_item item, long delta) 87static inline void __count_vm_events(enum vm_event_item item, long delta)
89{ 88{
90 __get_cpu_var(vm_event_states).event[item] += delta; 89 __this_cpu_add(per_cpu_var(vm_event_states).event[item], delta);
91} 90}
92 91
93static inline void count_vm_events(enum vm_event_item item, long delta) 92static inline void count_vm_events(enum vm_event_item item, long delta)
94{ 93{
95 get_cpu_var(vm_event_states).event[item] += delta; 94 this_cpu_add(per_cpu_var(vm_event_states).event[item], delta);
96 put_cpu();
97} 95}
98 96
99extern void all_vm_events(unsigned long *); 97extern void all_vm_events(unsigned long *);
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index c0c4e1103a73..7f56db4a79f0 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -110,6 +110,7 @@ extern char con_buf[CON_BUF_SIZE];
110extern struct mutex con_buf_mtx; 110extern struct mutex con_buf_mtx;
111extern char vt_dont_switch; 111extern char vt_dont_switch;
112extern int default_utf8; 112extern int default_utf8;
113extern int global_cursor_default;
113 114
114struct vt_spawn_console { 115struct vt_spawn_console {
115 spinlock_t lock; 116 spinlock_t lock;
@@ -130,4 +131,6 @@ struct vt_notifier_param {
130extern int register_vt_notifier(struct notifier_block *nb); 131extern int register_vt_notifier(struct notifier_block *nb);
131extern int unregister_vt_notifier(struct notifier_block *nb); 132extern int unregister_vt_notifier(struct notifier_block *nb);
132 133
134extern void hide_boot_cursor(bool hide);
135
133#endif /* _VT_KERN_H */ 136#endif /* _VT_KERN_H */
diff --git a/include/linux/wimax/debug.h b/include/linux/wimax/debug.h
index c703e0340423..db8096e88533 100644
--- a/include/linux/wimax/debug.h
+++ b/include/linux/wimax/debug.h
@@ -450,4 +450,76 @@ do { \
450}) 450})
451 451
452 452
453static inline
454void d_submodule_set(struct d_level *d_level, size_t d_level_size,
455 const char *submodule, u8 level, const char *tag)
456{
457 struct d_level *itr, *top;
458 int index = -1;
459
460 for (itr = d_level, top = itr + d_level_size; itr < top; itr++) {
461 index++;
462 if (itr->name == NULL) {
463 printk(KERN_ERR "%s: itr->name NULL?? (%p, #%d)\n",
464 tag, itr, index);
465 continue;
466 }
467 if (!strcmp(itr->name, submodule)) {
468 itr->level = level;
469 return;
470 }
471 }
472 printk(KERN_ERR "%s: unknown submodule %s\n", tag, submodule);
473}
474
475
476/**
477 * d_parse_params - Parse a string with debug parameters from the
478 * command line
479 *
480 * @d_level: level structure (D_LEVEL)
481 * @d_level_size: number of items in the level structure
482 * (D_LEVEL_SIZE).
483 * @_params: string with the parameters; this is a space (not tab!)
484 * separated list of NAME:VALUE, where value is the debug level
485 * and NAME is the name of the submodule.
486 * @tag: string for error messages (example: MODULE.ARGNAME).
487 */
488static inline
489void d_parse_params(struct d_level *d_level, size_t d_level_size,
490 const char *_params, const char *tag)
491{
492 char submodule[130], *params, *params_orig, *token, *colon;
493 unsigned level, tokens;
494
495 if (_params == NULL)
496 return;
497 params_orig = kstrdup(_params, GFP_KERNEL);
498 params = params_orig;
499 while (1) {
500 token = strsep(&params, " ");
501 if (token == NULL)
502 break;
503 if (*token == '\0') /* eat joint spaces */
504 continue;
505 /* kernel's sscanf %s eats until whitespace, so we
506 * replace : by \n so it doesn't get eaten later by
507 * strsep */
508 colon = strchr(token, ':');
509 if (colon != NULL)
510 *colon = '\n';
511 tokens = sscanf(token, "%s\n%u", submodule, &level);
512 if (colon != NULL)
513 *colon = ':'; /* set back, for error messages */
514 if (tokens == 2)
515 d_submodule_set(d_level, d_level_size,
516 submodule, level, tag);
517 else
518 printk(KERN_ERR "%s: can't parse '%s' as a "
519 "SUBMODULE:LEVEL (%d tokens)\n",
520 tag, token, tokens);
521 }
522 kfree(params_orig);
523}
524
453#endif /* #ifndef __debug__h__ */ 525#endif /* #ifndef __debug__h__ */
diff --git a/include/linux/wimax/i2400m.h b/include/linux/wimax/i2400m.h
index 433693ef2bb0..62d356153565 100644
--- a/include/linux/wimax/i2400m.h
+++ b/include/linux/wimax/i2400m.h
@@ -138,7 +138,7 @@ struct i2400m_bcf_hdr {
138 __le32 module_id; 138 __le32 module_id;
139 __le32 module_vendor; 139 __le32 module_vendor;
140 __le32 date; /* BCD YYYMMDD */ 140 __le32 date; /* BCD YYYMMDD */
141 __le32 size; 141 __le32 size; /* in dwords */
142 __le32 key_size; /* in dwords */ 142 __le32 key_size; /* in dwords */
143 __le32 modulus_size; /* in dwords */ 143 __le32 modulus_size; /* in dwords */
144 __le32 exponent_size; /* in dwords */ 144 __le32 exponent_size; /* in dwords */
@@ -168,16 +168,6 @@ enum i2400m_brh {
168}; 168};
169 169
170 170
171/* Constants for bcf->module_id */
172enum i2400m_bcf_mod_id {
173 /* Firmware file carries its own pokes -- pokes are a set of
174 * magical values that have to be written in certain memory
175 * addresses to get the device up and ready for firmware
176 * download when it is in non-signed boot mode. */
177 I2400M_BCF_MOD_ID_POKES = 0x000000001,
178};
179
180
181/** 171/**
182 * i2400m_bootrom_header - Header for a boot-mode command 172 * i2400m_bootrom_header - Header for a boot-mode command
183 * 173 *
@@ -276,6 +266,7 @@ enum {
276 I2400M_WARM_RESET_BARKER = 0x50f750f7, 266 I2400M_WARM_RESET_BARKER = 0x50f750f7,
277 I2400M_NBOOT_BARKER = 0xdeadbeef, 267 I2400M_NBOOT_BARKER = 0xdeadbeef,
278 I2400M_SBOOT_BARKER = 0x0ff1c1a1, 268 I2400M_SBOOT_BARKER = 0x0ff1c1a1,
269 I2400M_SBOOT_BARKER_6050 = 0x80000001,
279 I2400M_ACK_BARKER = 0xfeedbabe, 270 I2400M_ACK_BARKER = 0xfeedbabe,
280 I2400M_D2H_MSG_BARKER = 0xbeefbabe, 271 I2400M_D2H_MSG_BARKER = 0xbeefbabe,
281}; 272};
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index cf24c20de9e4..9466e860d8c2 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -25,6 +25,7 @@ typedef void (*work_func_t)(struct work_struct *work);
25struct work_struct { 25struct work_struct {
26 atomic_long_t data; 26 atomic_long_t data;
27#define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ 27#define WORK_STRUCT_PENDING 0 /* T if work item pending execution */
28#define WORK_STRUCT_STATIC 1 /* static initializer (debugobjects) */
28#define WORK_STRUCT_FLAG_MASK (3UL) 29#define WORK_STRUCT_FLAG_MASK (3UL)
29#define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) 30#define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK)
30 struct list_head entry; 31 struct list_head entry;
@@ -35,6 +36,7 @@ struct work_struct {
35}; 36};
36 37
37#define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) 38#define WORK_DATA_INIT() ATOMIC_LONG_INIT(0)
39#define WORK_DATA_STATIC_INIT() ATOMIC_LONG_INIT(2)
38 40
39struct delayed_work { 41struct delayed_work {
40 struct work_struct work; 42 struct work_struct work;
@@ -63,7 +65,7 @@ struct execute_work {
63#endif 65#endif
64 66
65#define __WORK_INITIALIZER(n, f) { \ 67#define __WORK_INITIALIZER(n, f) { \
66 .data = WORK_DATA_INIT(), \ 68 .data = WORK_DATA_STATIC_INIT(), \
67 .entry = { &(n).entry, &(n).entry }, \ 69 .entry = { &(n).entry, &(n).entry }, \
68 .func = (f), \ 70 .func = (f), \
69 __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ 71 __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \
@@ -91,6 +93,14 @@ struct execute_work {
91#define PREPARE_DELAYED_WORK(_work, _func) \ 93#define PREPARE_DELAYED_WORK(_work, _func) \
92 PREPARE_WORK(&(_work)->work, (_func)) 94 PREPARE_WORK(&(_work)->work, (_func))
93 95
96#ifdef CONFIG_DEBUG_OBJECTS_WORK
97extern void __init_work(struct work_struct *work, int onstack);
98extern void destroy_work_on_stack(struct work_struct *work);
99#else
100static inline void __init_work(struct work_struct *work, int onstack) { }
101static inline void destroy_work_on_stack(struct work_struct *work) { }
102#endif
103
94/* 104/*
95 * initialize all of a work item in one go 105 * initialize all of a work item in one go
96 * 106 *
@@ -99,24 +109,36 @@ struct execute_work {
99 * to generate better code. 109 * to generate better code.
100 */ 110 */
101#ifdef CONFIG_LOCKDEP 111#ifdef CONFIG_LOCKDEP
102#define INIT_WORK(_work, _func) \ 112#define __INIT_WORK(_work, _func, _onstack) \
103 do { \ 113 do { \
104 static struct lock_class_key __key; \ 114 static struct lock_class_key __key; \
105 \ 115 \
116 __init_work((_work), _onstack); \
106 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ 117 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
107 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ 118 lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\
108 INIT_LIST_HEAD(&(_work)->entry); \ 119 INIT_LIST_HEAD(&(_work)->entry); \
109 PREPARE_WORK((_work), (_func)); \ 120 PREPARE_WORK((_work), (_func)); \
110 } while (0) 121 } while (0)
111#else 122#else
112#define INIT_WORK(_work, _func) \ 123#define __INIT_WORK(_work, _func, _onstack) \
113 do { \ 124 do { \
125 __init_work((_work), _onstack); \
114 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ 126 (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
115 INIT_LIST_HEAD(&(_work)->entry); \ 127 INIT_LIST_HEAD(&(_work)->entry); \
116 PREPARE_WORK((_work), (_func)); \ 128 PREPARE_WORK((_work), (_func)); \
117 } while (0) 129 } while (0)
118#endif 130#endif
119 131
132#define INIT_WORK(_work, _func) \
133 do { \
134 __INIT_WORK((_work), (_func), 0); \
135 } while (0)
136
137#define INIT_WORK_ON_STACK(_work, _func) \
138 do { \
139 __INIT_WORK((_work), (_func), 1); \
140 } while (0)
141
120#define INIT_DELAYED_WORK(_work, _func) \ 142#define INIT_DELAYED_WORK(_work, _func) \
121 do { \ 143 do { \
122 INIT_WORK(&(_work)->work, (_func)); \ 144 INIT_WORK(&(_work)->work, (_func)); \
@@ -125,22 +147,16 @@ struct execute_work {
125 147
126#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ 148#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \
127 do { \ 149 do { \
128 INIT_WORK(&(_work)->work, (_func)); \ 150 INIT_WORK_ON_STACK(&(_work)->work, (_func)); \
129 init_timer_on_stack(&(_work)->timer); \ 151 init_timer_on_stack(&(_work)->timer); \
130 } while (0) 152 } while (0)
131 153
132#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ 154#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \
133 do { \ 155 do { \
134 INIT_WORK(&(_work)->work, (_func)); \ 156 INIT_WORK(&(_work)->work, (_func)); \
135 init_timer_deferrable(&(_work)->timer); \ 157 init_timer_deferrable(&(_work)->timer); \
136 } while (0) 158 } while (0)
137 159
138#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \
139 do { \
140 INIT_WORK(&(_work)->work, (_func)); \
141 init_timer_on_stack(&(_work)->timer); \
142 } while (0)
143
144/** 160/**
145 * work_pending - Find out whether a work item is currently pending 161 * work_pending - Find out whether a work item is currently pending
146 * @work: The work item in question 162 * @work: The work item in question
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 66ebddcff664..705f01fe413a 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -49,6 +49,7 @@ struct writeback_control {
49 unsigned nonblocking:1; /* Don't get stuck on request queues */ 49 unsigned nonblocking:1; /* Don't get stuck on request queues */
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_background:1; /* A background writeback */
52 unsigned for_reclaim:1; /* Invoked from the page allocator */ 53 unsigned for_reclaim:1; /* Invoked from the page allocator */
53 unsigned range_cyclic:1; /* range_start is cyclic */ 54 unsigned range_cyclic:1; /* range_start is cyclic */
54 unsigned more_io:1; /* more io to be dispatched */ 55 unsigned more_io:1; /* more io to be dispatched */
diff --git a/include/linux/x25.h b/include/linux/x25.h
index d035e4e87d07..6450a7f12074 100644
--- a/include/linux/x25.h
+++ b/include/linux/x25.h
@@ -25,6 +25,7 @@
25#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) 25#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9)
26#define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) 26#define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10)
27#define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) 27#define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11)
28#define SIOCX25SCAUSEDIAG (SIOCPROTOPRIVATE + 12)
28 29
29/* 30/*
30 * Values for {get,set}sockopt. 31 * Values for {get,set}sockopt.
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 2d4ec15abaca..29e04beb1fc9 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -10,8 +10,7 @@
10/* Structure to encapsulate addresses. I do not want to use 10/* Structure to encapsulate addresses. I do not want to use
11 * "standard" structure. My apologies. 11 * "standard" structure. My apologies.
12 */ 12 */
13typedef union 13typedef union {
14{
15 __be32 a4; 14 __be32 a4;
16 __be32 a6[4]; 15 __be32 a6[4];
17} xfrm_address_t; 16} xfrm_address_t;
@@ -20,8 +19,7 @@ typedef union
20 * the state by (spi,daddr,ah/esp) or to store information about 19 * the state by (spi,daddr,ah/esp) or to store information about
21 * spi, protocol and tunnel address on output. 20 * spi, protocol and tunnel address on output.
22 */ 21 */
23struct xfrm_id 22struct xfrm_id {
24{
25 xfrm_address_t daddr; 23 xfrm_address_t daddr;
26 __be32 spi; 24 __be32 spi;
27 __u8 proto; 25 __u8 proto;
@@ -45,8 +43,7 @@ struct xfrm_sec_ctx {
45 43
46/* Selector, used as selector both on policy rules (SPD) and SAs. */ 44/* Selector, used as selector both on policy rules (SPD) and SAs. */
47 45
48struct xfrm_selector 46struct xfrm_selector {
49{
50 xfrm_address_t daddr; 47 xfrm_address_t daddr;
51 xfrm_address_t saddr; 48 xfrm_address_t saddr;
52 __be16 dport; 49 __be16 dport;
@@ -63,8 +60,7 @@ struct xfrm_selector
63 60
64#define XFRM_INF (~(__u64)0) 61#define XFRM_INF (~(__u64)0)
65 62
66struct xfrm_lifetime_cfg 63struct xfrm_lifetime_cfg {
67{
68 __u64 soft_byte_limit; 64 __u64 soft_byte_limit;
69 __u64 hard_byte_limit; 65 __u64 hard_byte_limit;
70 __u64 soft_packet_limit; 66 __u64 soft_packet_limit;
@@ -75,16 +71,14 @@ struct xfrm_lifetime_cfg
75 __u64 hard_use_expires_seconds; 71 __u64 hard_use_expires_seconds;
76}; 72};
77 73
78struct xfrm_lifetime_cur 74struct xfrm_lifetime_cur {
79{
80 __u64 bytes; 75 __u64 bytes;
81 __u64 packets; 76 __u64 packets;
82 __u64 add_time; 77 __u64 add_time;
83 __u64 use_time; 78 __u64 use_time;
84}; 79};
85 80
86struct xfrm_replay_state 81struct xfrm_replay_state {
87{
88 __u32 oseq; 82 __u32 oseq;
89 __u32 seq; 83 __u32 seq;
90 __u32 bitmap; 84 __u32 bitmap;
@@ -96,6 +90,13 @@ struct xfrm_algo {
96 char alg_key[0]; 90 char alg_key[0];
97}; 91};
98 92
93struct xfrm_algo_auth {
94 char alg_name[64];
95 unsigned int alg_key_len; /* in bits */
96 unsigned int alg_trunc_len; /* in bits */
97 char alg_key[0];
98};
99
99struct xfrm_algo_aead { 100struct xfrm_algo_aead {
100 char alg_name[64]; 101 char alg_name[64];
101 unsigned int alg_key_len; /* in bits */ 102 unsigned int alg_key_len; /* in bits */
@@ -109,16 +110,14 @@ struct xfrm_stats {
109 __u32 integrity_failed; 110 __u32 integrity_failed;
110}; 111};
111 112
112enum 113enum {
113{
114 XFRM_POLICY_TYPE_MAIN = 0, 114 XFRM_POLICY_TYPE_MAIN = 0,
115 XFRM_POLICY_TYPE_SUB = 1, 115 XFRM_POLICY_TYPE_SUB = 1,
116 XFRM_POLICY_TYPE_MAX = 2, 116 XFRM_POLICY_TYPE_MAX = 2,
117 XFRM_POLICY_TYPE_ANY = 255 117 XFRM_POLICY_TYPE_ANY = 255
118}; 118};
119 119
120enum 120enum {
121{
122 XFRM_POLICY_IN = 0, 121 XFRM_POLICY_IN = 0,
123 XFRM_POLICY_OUT = 1, 122 XFRM_POLICY_OUT = 1,
124 XFRM_POLICY_FWD = 2, 123 XFRM_POLICY_FWD = 2,
@@ -126,8 +125,7 @@ enum
126 XFRM_POLICY_MAX = 3 125 XFRM_POLICY_MAX = 3
127}; 126};
128 127
129enum 128enum {
130{
131 XFRM_SHARE_ANY, /* No limitations */ 129 XFRM_SHARE_ANY, /* No limitations */
132 XFRM_SHARE_SESSION, /* For this session only */ 130 XFRM_SHARE_SESSION, /* For this session only */
133 XFRM_SHARE_USER, /* For this user only */ 131 XFRM_SHARE_USER, /* For this user only */
@@ -283,6 +281,7 @@ enum xfrm_attr_type_t {
283 XFRMA_MIGRATE, 281 XFRMA_MIGRATE,
284 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ 282 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */
285 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ 283 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */
284 XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */
286 __XFRMA_MAX 285 __XFRMA_MAX
287 286
288#define XFRMA_MAX (__XFRMA_MAX - 1) 287#define XFRMA_MAX (__XFRMA_MAX - 1)