aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h14
-rw-r--r--include/acpi/acpi_drivers.h2
-rw-r--r--include/acpi/acpiosxf.h14
-rw-r--r--include/acpi/acpixf.h11
-rw-r--r--include/acpi/actypes.h30
-rw-r--r--include/acpi/platform/acenv.h6
-rw-r--r--include/acpi/platform/acgcc.h2
-rw-r--r--include/acpi/platform/aclinux.h7
-rw-r--r--include/asm-generic/audit_change_attr.h4
-rw-r--r--include/asm-generic/cputime.h6
-rw-r--r--include/asm-generic/gpio.h4
-rw-r--r--include/asm-generic/pgtable.h2
-rw-r--r--include/asm-generic/stat.h14
-rw-r--r--include/asm-generic/vmlinux.lds.h6
-rw-r--r--include/crypto/cryptd.h24
-rw-r--r--include/crypto/gf128mul.h4
-rw-r--r--include/drm/drmP.h45
-rw-r--r--include/drm/drm_crtc.h4
-rw-r--r--include/drm/drm_crtc_helper.h8
-rw-r--r--include/drm/drm_dp_helper.h3
-rw-r--r--include/drm/i915_drm.h6
-rw-r--r--include/drm/intel-gtt.h18
-rw-r--r--include/drm/ttm/ttm_bo_api.h3
-rw-r--r--include/drm/ttm/ttm_bo_driver.h27
-rw-r--r--include/drm/vmwgfx_drm.h1
-rw-r--r--include/linux/Kbuild7
-rw-r--r--include/linux/acpi.h11
-rw-r--r--include/linux/amba/pl08x.h222
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/audit.h9
-rw-r--r--include/linux/backing-dev.h3
-rw-r--r--include/linux/basic_mmio_gpio.h20
-rw-r--r--include/linux/bfin_mac.h29
-rw-r--r--include/linux/blkdev.h9
-rw-r--r--include/linux/buffer_head.h1
-rw-r--r--include/linux/can/platform/mcp251x.h4
-rw-r--r--include/linux/cgroup.h4
-rw-r--r--include/linux/coda_fs_i.h13
-rw-r--r--include/linux/coda_linux.h6
-rw-r--r--include/linux/coda_psdev.h4
-rw-r--r--include/linux/completion.h10
-rw-r--r--include/linux/connector.h8
-rw-r--r--include/linux/davinci_emac.h16
-rw-r--r--include/linux/dccp.h10
-rw-r--r--include/linux/dmaengine.h60
-rw-r--r--include/linux/elevator.h2
-rw-r--r--include/linux/etherdevice.h22
-rw-r--r--include/linux/ethtool.h190
-rw-r--r--include/linux/exportfs.h13
-rw-r--r--include/linux/fanotify.h36
-rw-r--r--include/linux/fb.h6
-rw-r--r--include/linux/fdreg.h2
-rw-r--r--include/linux/fs.h92
-rw-r--r--include/linux/fsnotify.h38
-rw-r--r--include/linux/fsnotify_backend.h26
-rw-r--r--include/linux/gameport.h4
-rw-r--r--include/linux/genhd.h1
-rw-r--r--include/linux/gfp.h105
-rw-r--r--include/linux/gpio-fan.h36
-rw-r--r--include/linux/hardirq.h8
-rw-r--r--include/linux/hid.h5
-rw-r--r--include/linux/hiddev.h4
-rw-r--r--include/linux/highmem.h74
-rw-r--r--include/linux/hugetlb.h17
-rw-r--r--include/linux/i2c.h14
-rw-r--r--include/linux/i2c/adp5588.h21
-rw-r--r--include/linux/i2c/apds990x.h79
-rw-r--r--include/linux/i2c/bh1770glc.h53
-rw-r--r--include/linux/i2c/twl.h83
-rw-r--r--include/linux/idr.h8
-rw-r--r--include/linux/ieee80211.h71
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_bonding.h3
-rw-r--r--include/linux/if_ether.h2
-rw-r--r--include/linux/if_infiniband.h2
-rw-r--r--include/linux/if_macvlan.h9
-rw-r--r--include/linux/if_pppox.h52
-rw-r--r--include/linux/if_vlan.h31
-rw-r--r--include/linux/in.h19
-rw-r--r--include/linux/in6.h4
-rw-r--r--include/linux/inetdevice.h21
-rw-r--r--include/linux/init_task.h4
-rw-r--r--include/linux/input.h57
-rw-r--r--include/linux/input/bu21013.h44
-rw-r--r--include/linux/intel_mid_dma.h16
-rw-r--r--include/linux/interrupt.h3
-rw-r--r--include/linux/io-mapping.h14
-rw-r--r--include/linux/ioport.h1
-rw-r--r--include/linux/ip_vs.h15
-rw-r--r--include/linux/ipv6.h4
-rw-r--r--include/linux/irq.h5
-rw-r--r--include/linux/irqnr.h2
-rw-r--r--include/linux/jbd2.h2
-rw-r--r--include/linux/jhash.h2
-rw-r--r--include/linux/jump_label.h7
-rw-r--r--include/linux/kernel.h36
-rw-r--r--include/linux/kernel_stat.h18
-rw-r--r--include/linux/kfifo.h28
-rw-r--r--include/linux/kgdb.h13
-rw-r--r--include/linux/kvm.h12
-rw-r--r--include/linux/kvm_host.h22
-rw-r--r--include/linux/kvm_para.h7
-rw-r--r--include/linux/lis3lv02d.h55
-rw-r--r--include/linux/list.h6
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/marvell_phy.h2
-rw-r--r--include/linux/math64.h12
-rw-r--r--include/linux/memory_hotplug.h4
-rw-r--r--include/linux/mfd/88pm860x.h2
-rw-r--r--include/linux/mfd/ab8500.h28
-rw-r--r--include/linux/mfd/abx500.h4
-rw-r--r--include/linux/mfd/core.h3
-rw-r--r--include/linux/mfd/max8998-private.h129
-rw-r--r--include/linux/mfd/max8998.h23
-rw-r--r--include/linux/mfd/mc13783.h239
-rw-r--r--include/linux/mfd/mc13xxx.h154
-rw-r--r--include/linux/mfd/pcf50633/core.h7
-rw-r--r--include/linux/mfd/sh_mobile_sdhi.h2
-rw-r--r--include/linux/mfd/stmpe.h6
-rw-r--r--include/linux/mfd/tmio.h6
-rw-r--r--include/linux/mfd/tps6586x.h31
-rw-r--r--include/linux/mfd/wm831x/core.h12
-rw-r--r--include/linux/migrate.h16
-rw-r--r--include/linux/mlx4/cmd.h3
-rw-r--r--include/linux/mlx4/device.h42
-rw-r--r--include/linux/mlx4/driver.h9
-rw-r--r--include/linux/mlx4/qp.h9
-rw-r--r--include/linux/mm.h29
-rw-r--r--include/linux/mm_types.h2
-rw-r--r--include/linux/mmc/card.h6
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmc/host.h48
-rw-r--r--include/linux/mmc/mmc.h10
-rw-r--r--include/linux/mmc/sdhci-pltfm.h (renamed from include/linux/sdhci-pltfm.h)2
-rw-r--r--include/linux/mmc/sdhci.h144
-rw-r--r--include/linux/mmc/sdio_ids.h1
-rw-r--r--include/linux/mmc/sh_mmcif.h1
-rw-r--r--include/linux/mmu_notifier.h2
-rw-r--r--include/linux/mmzone.h10
-rw-r--r--include/linux/moduleparam.h4
-rw-r--r--include/linux/mroute.h1
-rw-r--r--include/linux/mtd/bbm.h4
-rw-r--r--include/linux/mtd/cfi.h1
-rw-r--r--include/linux/mtd/fsmc.h181
-rw-r--r--include/linux/mtd/inftl.h14
-rw-r--r--include/linux/mtd/mtd.h15
-rw-r--r--include/linux/mtd/nand.h426
-rw-r--r--include/linux/mtd/partitions.h7
-rw-r--r--include/linux/mtd/super.h5
-rw-r--r--include/linux/n_r3964.h1
-rw-r--r--include/linux/net.h2
-rw-r--r--include/linux/netdevice.h136
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h6
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h1
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h1
-rw-r--r--include/linux/netfilter/x_tables.h5
-rw-r--r--include/linux/netfilter/xt_TPROXY.h13
-rw-r--r--include/linux/netfilter_arp/arp_tables.h68
-rw-r--r--include/linux/netfilter_bridge/Kbuild2
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h107
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h110
-rw-r--r--include/linux/netpoll.h9
-rw-r--r--include/linux/nfs4.h65
-rw-r--r--include/linux/nfs_fs.h19
-rw-r--r--include/linux/nfs_fs_sb.h4
-rw-r--r--include/linux/nfs_idmap.h31
-rw-r--r--include/linux/nfs_mount.h3
-rw-r--r--include/linux/nfs_xdr.h128
-rw-r--r--include/linux/nilfs2_fs.h18
-rw-r--r--include/linux/nl80211.h210
-rw-r--r--include/linux/of_device.h13
-rw-r--r--include/linux/of_fdt.h2
-rw-r--r--include/linux/of_irq.h4
-rw-r--r--include/linux/of_pdt.h45
-rw-r--r--include/linux/padata.h4
-rw-r--r--include/linux/page-flags.h2
-rw-r--r--include/linux/pageblock-flags.h5
-rw-r--r--include/linux/pagemap.h13
-rw-r--r--include/linux/pci.h5
-rw-r--r--include/linux/pci_ids.h58
-rw-r--r--include/linux/pci_regs.h6
-rw-r--r--include/linux/percpu-defs.h12
-rw-r--r--include/linux/percpu_counter.h10
-rw-r--r--include/linux/phonet.h5
-rw-r--r--include/linux/phy.h16
-rw-r--r--include/linux/pkt_cls.h1
-rw-r--r--include/linux/poll.h2
-rw-r--r--include/linux/power_supply.h6
-rw-r--r--include/linux/ptrace.h12
-rw-r--r--include/linux/ramfs.h4
-rw-r--r--include/linux/ramoops.h15
-rw-r--r--include/linux/ratelimit.h2
-rw-r--r--include/linux/rds.h115
-rw-r--r--include/linux/regulator/lp3972.h48
-rw-r--r--include/linux/regulator/machine.h5
-rw-r--r--include/linux/regulator/max8952.h135
-rw-r--r--include/linux/reiserfs_fs.h2
-rw-r--r--include/linux/ring_buffer.h12
-rw-r--r--include/linux/rio.h17
-rw-r--r--include/linux/rio_ids.h2
-rw-r--r--include/linux/rio_regs.h18
-rw-r--r--include/linux/rmap.h30
-rw-r--r--include/linux/rtnetlink.h30
-rw-r--r--include/linux/sched.h22
-rw-r--r--include/linux/semaphore.h6
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/serio.h10
-rw-r--r--include/linux/sfi.h24
-rw-r--r--include/linux/sh_clk.h17
-rw-r--r--include/linux/sh_intc.h19
-rw-r--r--include/linux/sh_pfc.h1
-rw-r--r--include/linux/signalfd.h3
-rw-r--r--include/linux/skbuff.h117
-rw-r--r--include/linux/slub_def.h14
-rw-r--r--include/linux/smb.h118
-rw-r--r--include/linux/smb_fs.h153
-rw-r--r--include/linux/smb_fs_i.h37
-rw-r--r--include/linux/smb_fs_sb.h100
-rw-r--r--include/linux/smb_mount.h65
-rw-r--r--include/linux/smbno.h363
-rw-r--r--include/linux/smp.h19
-rw-r--r--include/linux/socket.h3
-rw-r--r--include/linux/spi/74x164.h11
-rw-r--r--include/linux/spi/spi.h3
-rw-r--r--include/linux/ssb/ssb_regs.h1
-rw-r--r--include/linux/stmmac.h6
-rw-r--r--include/linux/sunrpc/auth.h4
-rw-r--r--include/linux/sunrpc/cache.h37
-rw-r--r--include/linux/sunrpc/clnt.h2
-rw-r--r--include/linux/sunrpc/gss_spkm3.h55
-rw-r--r--include/linux/sunrpc/stats.h23
-rw-r--r--include/linux/sunrpc/svc_xprt.h32
-rw-r--r--include/linux/sunrpc/svcauth.h17
-rw-r--r--include/linux/sunrpc/xdr.h9
-rw-r--r--include/linux/sunrpc/xprt.h4
-rw-r--r--include/linux/swap.h10
-rw-r--r--include/linux/synclink.h5
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--include/linux/tc_act/Kbuild1
-rw-r--r--include/linux/tc_act/tc_csum.h32
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h1
-rw-r--r--include/linux/tcp.h1
-rw-r--r--include/linux/ti_wilink_st.h400
-rw-r--r--include/linux/tipc.h30
-rw-r--r--include/linux/tracehook.h2
-rw-r--r--include/linux/tty.h10
-rw-r--r--include/linux/types.h20
-rw-r--r--include/linux/via-core.h4
-rw-r--r--include/linux/videodev2.h12
-rw-r--r--include/linux/videotext.h125
-rw-r--r--include/linux/virtio_9p.h1
-rw-r--r--include/linux/vmalloc.h2
-rw-r--r--include/linux/wireless.h2
-rw-r--r--include/linux/wl12xx.h (renamed from include/linux/spi/wl12xx.h)23
-rw-r--r--include/linux/wlp.h736
-rw-r--r--include/linux/workqueue.h6
-rw-r--r--include/linux/writeback.h8
-rw-r--r--include/media/ir-core.h41
-rw-r--r--include/media/ir-kbd-i2c.h10
-rw-r--r--include/media/lirc_dev.h6
-rw-r--r--include/media/omap1_camera.h35
-rw-r--r--include/media/rc-map.h21
-rw-r--r--include/media/s3c_fimc.h60
-rw-r--r--include/media/sh_vou.h1
-rw-r--r--include/media/soc_camera.h9
-rw-r--r--include/media/sr030pc30.h21
-rw-r--r--include/media/v4l2-chip-ident.h8
-rw-r--r--include/media/v4l2-common.h10
-rw-r--r--include/media/v4l2-dev.h8
-rw-r--r--include/media/v4l2-device.h57
-rw-r--r--include/media/v4l2-i2c-drv.h80
-rw-r--r--include/media/v4l2-mediabus.h8
-rw-r--r--include/media/v4l2-subdev.h24
-rw-r--r--include/media/videobuf-core.h19
-rw-r--r--include/media/videobuf-dma-contig.h3
-rw-r--r--include/media/videobuf-dma-sg.h3
-rw-r--r--include/media/videobuf-vmalloc.h3
-rw-r--r--include/media/wm8775.h3
-rw-r--r--include/mtd/mtd-abi.h16
-rw-r--r--include/mtd/mtd-user.h2
-rw-r--r--include/net/9p/9p.h54
-rw-r--r--include/net/9p/client.h7
-rw-r--r--include/net/addrconf.h65
-rw-r--r--include/net/arp.h2
-rw-r--r--include/net/bluetooth/bluetooth.h2
-rw-r--r--include/net/bluetooth/hci.h2
-rw-r--r--include/net/bluetooth/hci_core.h2
-rw-r--r--include/net/bluetooth/l2cap.h2
-rw-r--r--include/net/bluetooth/rfcomm.h5
-rw-r--r--include/net/caif/caif_dev.h4
-rw-r--r--include/net/caif/caif_shm.h26
-rw-r--r--include/net/caif/caif_spi.h2
-rw-r--r--include/net/caif/cfcnfg.h8
-rw-r--r--include/net/cfg80211.h296
-rw-r--r--include/net/dst.h35
-rw-r--r--include/net/dst_ops.h37
-rw-r--r--include/net/fib_rules.h5
-rw-r--r--include/net/flow.h1
-rw-r--r--include/net/garp.h2
-rw-r--r--include/net/genetlink.h18
-rw-r--r--include/net/gre.h18
-rw-r--r--include/net/inet_connection_sock.h1
-rw-r--r--include/net/inet_ecn.h2
-rw-r--r--include/net/inet_hashtables.h2
-rw-r--r--include/net/inetpeer.h2
-rw-r--r--include/net/ip.h10
-rw-r--r--include/net/ip6_tunnel.h2
-rw-r--r--include/net/ip_fib.h19
-rw-r--r--include/net/ip_vs.h180
-rw-r--r--include/net/ipip.h18
-rw-r--r--include/net/ipv6.h35
-rw-r--r--include/net/irda/irlan_common.h1
-rw-r--r--include/net/irda/irlan_event.h2
-rw-r--r--include/net/irda/irlap.h2
-rw-r--r--include/net/irda/irlmp.h2
-rw-r--r--include/net/irda/irttp.h2
-rw-r--r--include/net/mac80211.h195
-rw-r--r--include/net/neighbour.h47
-rw-r--r--include/net/net_namespace.h19
-rw-r--r--include/net/netfilter/ipv6/nf_defrag_ipv6.h6
-rw-r--r--include/net/netfilter/nf_conntrack_expect.h12
-rw-r--r--include/net/netfilter/nf_nat_protocol.h3
-rw-r--r--include/net/netfilter/nf_tproxy_core.h192
-rw-r--r--include/net/netfilter/xt_log.h54
-rw-r--r--include/net/netlink.h2
-rw-r--r--include/net/netns/xfrm.h9
-rw-r--r--include/net/phonet/pep.h26
-rw-r--r--include/net/phonet/phonet.h5
-rw-r--r--include/net/phonet/pn_dev.h1
-rw-r--r--include/net/protocol.h4
-rw-r--r--include/net/raw.h5
-rw-r--r--include/net/rtnetlink.h1
-rw-r--r--include/net/sch_generic.h5
-rw-r--r--include/net/sctp/sctp.h60
-rw-r--r--include/net/sctp/sm.h10
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--include/net/sctp/tsnmap.h2
-rw-r--r--include/net/sock.h16
-rw-r--r--include/net/tc_act/tc_csum.h15
-rw-r--r--include/net/tcp.h11
-rw-r--r--include/net/tipc/tipc.h71
-rw-r--r--include/net/tipc/tipc_msg.h10
-rw-r--r--include/net/tipc/tipc_port.h2
-rw-r--r--include/net/udp.h3
-rw-r--r--include/net/xfrm.h7
-rw-r--r--include/rdma/ib_addr.h134
-rw-r--r--include/rdma/ib_pack.h39
-rw-r--r--include/rdma/ib_user_verbs.h3
-rw-r--r--include/rdma/ib_verbs.h11
-rw-r--r--include/scsi/libfc.h2
-rw-r--r--include/scsi/osd_initiator.h16
-rw-r--r--include/scsi/osd_protocol.h42
-rw-r--r--include/scsi/osd_types.h5
-rw-r--r--include/scsi/srp.h38
-rw-r--r--include/sound/core.h2
-rw-r--r--include/sound/emu10k1.h2
-rw-r--r--include/sound/jack.h5
-rw-r--r--include/sound/max98088.h50
-rw-r--r--include/sound/pcm.h1
-rw-r--r--include/sound/sh_fsi.h3
-rw-r--r--include/sound/soc-dai.h98
-rw-r--r--include/sound/soc-dapm.h18
-rw-r--r--include/sound/soc-of-simple.h25
-rw-r--r--include/sound/soc.h245
-rw-r--r--include/sound/tlv.h4
-rw-r--r--include/sound/tlv320aic3x.h43
-rw-r--r--include/sound/wm8962.h32
-rw-r--r--include/trace/events/ext4.h385
-rw-r--r--include/trace/events/irq.h54
-rw-r--r--include/trace/events/jbd2.h78
-rw-r--r--include/trace/events/vmscan.h44
-rw-r--r--include/trace/events/writeback.h37
-rw-r--r--include/video/sh_mobile_hdmi.h16
-rw-r--r--include/video/sh_mobile_lcdc.h5
-rw-r--r--include/video/vga.h2
-rw-r--r--include/xen/Kbuild1
-rw-r--r--include/xen/events.h26
-rw-r--r--include/xen/interface/features.h3
-rw-r--r--include/xen/interface/io/pciif.h112
-rw-r--r--include/xen/interface/io/xenbus.h8
-rw-r--r--include/xen/interface/memory.h29
-rw-r--r--include/xen/interface/physdev.h67
-rw-r--r--include/xen/privcmd.h80
-rw-r--r--include/xen/xen-ops.h5
384 files changed, 7911 insertions, 4202 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 4de84ce3a92..359ef11725a 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -184,7 +184,7 @@ struct acpi_device_pnp {
184 184
185#define acpi_device_bid(d) ((d)->pnp.bus_id) 185#define acpi_device_bid(d) ((d)->pnp.bus_id)
186#define acpi_device_adr(d) ((d)->pnp.bus_address) 186#define acpi_device_adr(d) ((d)->pnp.bus_address)
187char *acpi_device_hid(struct acpi_device *device); 187const char *acpi_device_hid(struct acpi_device *device);
188#define acpi_device_name(d) ((d)->pnp.device_name) 188#define acpi_device_name(d) ((d)->pnp.device_name)
189#define acpi_device_class(d) ((d)->pnp.device_class) 189#define acpi_device_class(d) ((d)->pnp.device_class)
190 190
@@ -389,21 +389,25 @@ struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
389int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); 389int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
390int acpi_disable_wakeup_device_power(struct acpi_device *dev); 390int acpi_disable_wakeup_device_power(struct acpi_device *dev);
391 391
392#ifdef CONFIG_PM_SLEEP 392#ifdef CONFIG_PM_OPS
393int acpi_pm_device_sleep_state(struct device *, int *); 393int acpi_pm_device_sleep_state(struct device *, int *);
394int acpi_pm_device_sleep_wake(struct device *, bool); 394#else
395#else /* !CONFIG_PM_SLEEP */
396static inline int acpi_pm_device_sleep_state(struct device *d, int *p) 395static inline int acpi_pm_device_sleep_state(struct device *d, int *p)
397{ 396{
398 if (p) 397 if (p)
399 *p = ACPI_STATE_D0; 398 *p = ACPI_STATE_D0;
400 return ACPI_STATE_D3; 399 return ACPI_STATE_D3;
401} 400}
401#endif
402
403#ifdef CONFIG_PM_SLEEP
404int acpi_pm_device_sleep_wake(struct device *, bool);
405#else
402static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) 406static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
403{ 407{
404 return -ENODEV; 408 return -ENODEV;
405} 409}
406#endif /* !CONFIG_PM_SLEEP */ 410#endif
407 411
408#endif /* CONFIG_ACPI */ 412#endif /* CONFIG_ACPI */
409 413
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 23d78b4d088..3090471b2a5 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -115,8 +115,6 @@ void pci_acpi_crs_quirks(void);
115#define ACPI_PROCESSOR_LIMIT_INCREMENT 0x01 115#define ACPI_PROCESSOR_LIMIT_INCREMENT 0x01
116#define ACPI_PROCESSOR_LIMIT_DECREMENT 0x02 116#define ACPI_PROCESSOR_LIMIT_DECREMENT 0x02
117 117
118int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
119
120/*-------------------------------------------------------------------------- 118/*--------------------------------------------------------------------------
121 Dock Station 119 Dock Station
122 -------------------------------------------------------------------------- */ 120 -------------------------------------------------------------------------- */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 29bf945143e..65b3f5888f4 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -98,8 +98,6 @@ acpi_os_table_override(struct acpi_table_header *existing_table,
98/* 98/*
99 * Spinlock primitives 99 * Spinlock primitives
100 */ 100 */
101acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
102
103void acpi_os_delete_lock(acpi_spinlock handle); 101void acpi_os_delete_lock(acpi_spinlock handle);
104 102
105acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); 103acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
@@ -223,25 +221,15 @@ acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width);
223 */ 221 */
224acpi_status 222acpi_status
225acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, 223acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
226 u32 reg, u32 *value, u32 width); 224 u32 reg, u64 *value, u32 width);
227 225
228acpi_status 226acpi_status
229acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, 227acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
230 u32 reg, u64 value, u32 width); 228 u32 reg, u64 value, u32 width);
231 229
232/* 230/*
233 * Interim function needed for PCI IRQ routing
234 */
235void
236acpi_os_derive_pci_id(acpi_handle device,
237 acpi_handle region, struct acpi_pci_id **pci_id);
238
239/*
240 * Miscellaneous 231 * Miscellaneous
241 */ 232 */
242acpi_status acpi_os_validate_interface(char *interface);
243acpi_status acpi_osi_invalidate(char* interface);
244
245acpi_status 233acpi_status
246acpi_os_validate_address(u8 space_id, acpi_physical_address address, 234acpi_os_validate_address(u8 space_id, acpi_physical_address address,
247 acpi_size length, char *name); 235 acpi_size length, char *name);
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 984cdc62e30..53b7cfd924a 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -47,7 +47,7 @@
47 47
48/* Current ACPICA subsystem version in YYYYMMDD format */ 48/* Current ACPICA subsystem version in YYYYMMDD format */
49 49
50#define ACPI_CA_VERSION 0x20100702 50#define ACPI_CA_VERSION 0x20101013
51 51
52#include "actypes.h" 52#include "actypes.h"
53#include "actbl.h" 53#include "actbl.h"
@@ -72,6 +72,7 @@ extern u8 acpi_gbl_truncate_io_addresses;
72 72
73extern u32 acpi_current_gpe_count; 73extern u32 acpi_current_gpe_count;
74extern struct acpi_table_fadt acpi_gbl_FADT; 74extern struct acpi_table_fadt acpi_gbl_FADT;
75extern u8 acpi_gbl_system_awake_and_running;
75 76
76extern u32 acpi_rsdt_forced; 77extern u32 acpi_rsdt_forced;
77/* 78/*
@@ -105,6 +106,10 @@ const char *acpi_format_exception(acpi_status exception);
105 106
106acpi_status acpi_purge_cached_objects(void); 107acpi_status acpi_purge_cached_objects(void);
107 108
109acpi_status acpi_install_interface(acpi_string interface_name);
110
111acpi_status acpi_remove_interface(acpi_string interface_name);
112
108/* 113/*
109 * ACPI Memory management 114 * ACPI Memory management
110 */ 115 */
@@ -263,6 +268,8 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
263acpi_status acpi_install_exception_handler(acpi_exception_handler handler); 268acpi_status acpi_install_exception_handler(acpi_exception_handler handler);
264#endif 269#endif
265 270
271acpi_status acpi_install_interface_handler(acpi_interface_handler handler);
272
266/* 273/*
267 * Event interfaces 274 * Event interfaces
268 */ 275 */
@@ -308,6 +315,8 @@ acpi_install_gpe_block(acpi_handle gpe_device,
308 315
309acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); 316acpi_status acpi_remove_gpe_block(acpi_handle gpe_device);
310 317
318acpi_status acpi_update_gpes(void);
319
311/* 320/*
312 * Resource interfaces 321 * Resource interfaces
313 */ 322 */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 5db8f472fec..2b134b691e3 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -115,7 +115,6 @@
115 * 115 *
116 * ACPI_SIZE 16/32/64-bit unsigned value 116 * ACPI_SIZE 16/32/64-bit unsigned value
117 * ACPI_NATIVE_INT 16/32/64-bit signed value 117 * ACPI_NATIVE_INT 16/32/64-bit signed value
118 *
119 */ 118 */
120 119
121/******************************************************************************* 120/*******************************************************************************
@@ -132,6 +131,16 @@ typedef COMPILER_DEPENDENT_INT64 INT64;
132 131
133/*! [End] no source code translation !*/ 132/*! [End] no source code translation !*/
134 133
134/*
135 * Value returned by acpi_os_get_thread_id. There is no standard "thread_id"
136 * across operating systems or even the various UNIX systems. Since ACPICA
137 * only needs the thread ID as a unique thread identifier, we use a u64
138 * as the only common data type - it will accommodate any type of pointer or
139 * any type of integer. It is up to the host-dependent OSL to cast the
140 * native thread ID type to a u64 (in acpi_os_get_thread_id).
141 */
142#define acpi_thread_id u64
143
135/******************************************************************************* 144/*******************************************************************************
136 * 145 *
137 * Types specific to 64-bit targets 146 * Types specific to 64-bit targets
@@ -211,12 +220,6 @@ typedef u32 acpi_physical_address;
211 * 220 *
212 ******************************************************************************/ 221 ******************************************************************************/
213 222
214/* Value returned by acpi_os_get_thread_id */
215
216#ifndef acpi_thread_id
217#define acpi_thread_id acpi_size
218#endif
219
220/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */ 223/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */
221 224
222#ifndef acpi_cpu_flags 225#ifndef acpi_cpu_flags
@@ -375,16 +378,6 @@ typedef void *acpi_handle; /* Actually a ptr to a NS Node */
375typedef u8 acpi_owner_id; 378typedef u8 acpi_owner_id;
376#define ACPI_OWNER_ID_MAX 0xFF 379#define ACPI_OWNER_ID_MAX 0xFF
377 380
378struct uint64_struct {
379 u32 lo;
380 u32 hi;
381};
382
383union uint64_overlay {
384 u64 full;
385 struct uint64_struct part;
386};
387
388#define ACPI_INTEGER_BIT_SIZE 64 381#define ACPI_INTEGER_BIT_SIZE 64
389#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ 382#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */
390 383
@@ -950,6 +943,9 @@ acpi_status(*acpi_walk_callback) (acpi_handle object,
950 u32 nesting_level, 943 u32 nesting_level,
951 void *context, void **return_value); 944 void *context, void **return_value);
952 945
946typedef
947u32 (*acpi_interface_handler) (acpi_string interface_name, u32 supported);
948
953/* Interrupt handler return values */ 949/* Interrupt handler return values */
954 950
955#define ACPI_INTERRUPT_NOT_HANDLED 0x00 951#define ACPI_INTERRUPT_NOT_HANDLED 0x00
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index c05aeba9e8f..a3e334ab111 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -193,6 +193,12 @@
193#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE 193#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
194#endif 194#endif
195 195
196/* "inline" keywords - configurable since inline is not standardized */
197
198#ifndef ACPI_INLINE
199#define ACPI_INLINE
200#endif
201
196/* 202/*
197 * Debugger threading model 203 * Debugger threading model
198 * Use single threaded if the entire subsystem is contained in an application 204 * Use single threaded if the entire subsystem is contained in an application
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 0cd53e3cd1a..5dcb9537343 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -44,6 +44,8 @@
44#ifndef __ACGCC_H__ 44#ifndef __ACGCC_H__
45#define __ACGCC_H__ 45#define __ACGCC_H__
46 46
47#define ACPI_INLINE __inline__
48
47/* Function name is used for debug output. Non-ANSI, compiler-dependent */ 49/* Function name is used for debug output. Non-ANSI, compiler-dependent */
48 50
49#define ACPI_GET_FUNCTION_NAME __func__ 51#define ACPI_GET_FUNCTION_NAME __func__
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 103f08aca76..572189e3713 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -75,7 +75,6 @@
75#define acpi_cache_t struct kmem_cache 75#define acpi_cache_t struct kmem_cache
76#define acpi_spinlock spinlock_t * 76#define acpi_spinlock spinlock_t *
77#define acpi_cpu_flags unsigned long 77#define acpi_cpu_flags unsigned long
78#define acpi_thread_id struct task_struct *
79 78
80#else /* !__KERNEL__ */ 79#else /* !__KERNEL__ */
81 80
@@ -88,7 +87,7 @@
88/* Host-dependent types and defines for user-space ACPICA */ 87/* Host-dependent types and defines for user-space ACPICA */
89 88
90#define ACPI_FLUSH_CPU_CACHE() 89#define ACPI_FLUSH_CPU_CACHE()
91#define acpi_thread_id pthread_t 90#define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread))
92 91
93#if defined(__ia64__) || defined(__x86_64__) 92#if defined(__ia64__) || defined(__x86_64__)
94#define ACPI_MACHINE_WIDTH 64 93#define ACPI_MACHINE_WIDTH 64
@@ -113,12 +112,13 @@
113 112
114 113
115#ifdef __KERNEL__ 114#ifdef __KERNEL__
115#include <acpi/actypes.h>
116/* 116/*
117 * Overrides for in-kernel ACPICA 117 * Overrides for in-kernel ACPICA
118 */ 118 */
119static inline acpi_thread_id acpi_os_get_thread_id(void) 119static inline acpi_thread_id acpi_os_get_thread_id(void)
120{ 120{
121 return current; 121 return (acpi_thread_id)(unsigned long)current;
122} 122}
123 123
124/* 124/*
@@ -127,7 +127,6 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)
127 * However, boot has (system_state != SYSTEM_RUNNING) 127 * However, boot has (system_state != SYSTEM_RUNNING)
128 * to quiet __might_sleep() in kmalloc() and resume does not. 128 * to quiet __might_sleep() in kmalloc() and resume does not.
129 */ 129 */
130#include <acpi/actypes.h>
131static inline void *acpi_os_allocate(acpi_size size) 130static inline void *acpi_os_allocate(acpi_size size)
132{ 131{
133 return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); 132 return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h
index 50764550a60..bcbab3e4a3b 100644
--- a/include/asm-generic/audit_change_attr.h
+++ b/include/asm-generic/audit_change_attr.h
@@ -20,3 +20,7 @@ __NR_chown32,
20__NR_fchown32, 20__NR_fchown32,
21__NR_lchown32, 21__NR_lchown32,
22#endif 22#endif
23__NR_link,
24#ifdef __NR_linkat
25__NR_linkat,
26#endif
diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h
index ca0f239f0e1..2bcc5c7c22a 100644
--- a/include/asm-generic/cputime.h
+++ b/include/asm-generic/cputime.h
@@ -33,10 +33,10 @@ typedef u64 cputime64_t;
33 33
34 34
35/* 35/*
36 * Convert cputime to milliseconds and back. 36 * Convert cputime to microseconds and back.
37 */ 37 */
38#define cputime_to_msecs(__ct) jiffies_to_msecs(__ct) 38#define cputime_to_usecs(__ct) jiffies_to_usecs(__ct);
39#define msecs_to_cputime(__msecs) msecs_to_jiffies(__msecs) 39#define usecs_to_cputime(__msecs) usecs_to_jiffies(__msecs);
40 40
41/* 41/*
42 * Convert cputime to seconds and back. 42 * Convert cputime to seconds and back.
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 8ca18e26d7e..ff5c66080c8 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -210,7 +210,7 @@ extern void gpio_unexport(unsigned gpio);
210 210
211#endif /* CONFIG_GPIO_SYSFS */ 211#endif /* CONFIG_GPIO_SYSFS */
212 212
213#else /* !CONFIG_HAVE_GPIO_LIB */ 213#else /* !CONFIG_GPIOLIB */
214 214
215static inline int gpio_is_valid(int number) 215static inline int gpio_is_valid(int number)
216{ 216{
@@ -239,7 +239,7 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value)
239 gpio_set_value(gpio, value); 239 gpio_set_value(gpio, value);
240} 240}
241 241
242#endif /* !CONFIG_HAVE_GPIO_LIB */ 242#endif /* !CONFIG_GPIOLIB */
243 243
244#ifndef CONFIG_GPIO_SYSFS 244#ifndef CONFIG_GPIO_SYSFS
245 245
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index f4d4120e512..6f3c6ae4fe0 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -108,7 +108,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
108#endif 108#endif
109 109
110#ifndef __HAVE_ARCH_PAGE_CLEAR_DIRTY 110#ifndef __HAVE_ARCH_PAGE_CLEAR_DIRTY
111#define page_clear_dirty(page) do { } while (0) 111#define page_clear_dirty(page, mapped) do { } while (0)
112#endif 112#endif
113 113
114#ifndef __HAVE_ARCH_PAGE_TEST_DIRTY 114#ifndef __HAVE_ARCH_PAGE_TEST_DIRTY
diff --git a/include/asm-generic/stat.h b/include/asm-generic/stat.h
index 47e64170305..bd8cad21998 100644
--- a/include/asm-generic/stat.h
+++ b/include/asm-generic/stat.h
@@ -33,18 +33,18 @@ struct stat {
33 int st_blksize; /* Optimal block size for I/O. */ 33 int st_blksize; /* Optimal block size for I/O. */
34 int __pad2; 34 int __pad2;
35 long st_blocks; /* Number 512-byte blocks allocated. */ 35 long st_blocks; /* Number 512-byte blocks allocated. */
36 int st_atime; /* Time of last access. */ 36 long st_atime; /* Time of last access. */
37 unsigned int st_atime_nsec; 37 unsigned long st_atime_nsec;
38 int st_mtime; /* Time of last modification. */ 38 long st_mtime; /* Time of last modification. */
39 unsigned int st_mtime_nsec; 39 unsigned long st_mtime_nsec;
40 int st_ctime; /* Time of last status change. */ 40 long st_ctime; /* Time of last status change. */
41 unsigned int st_ctime_nsec; 41 unsigned long st_ctime_nsec;
42 unsigned int __unused4; 42 unsigned int __unused4;
43 unsigned int __unused5; 43 unsigned int __unused5;
44}; 44};
45 45
46#if __BITS_PER_LONG != 64
47/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */ 46/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
47#if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64)
48struct stat64 { 48struct stat64 {
49 unsigned long long st_dev; /* Device. */ 49 unsigned long long st_dev; /* Device. */
50 unsigned long long st_ino; /* File serial number. */ 50 unsigned long long st_ino; /* File serial number. */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f4229fb315e..bd69d79208d 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -150,6 +150,7 @@
150#define DATA_DATA \ 150#define DATA_DATA \
151 *(.data) \ 151 *(.data) \
152 *(.ref.data) \ 152 *(.ref.data) \
153 *(.data..shared_aligned) /* percpu related */ \
153 DEV_KEEP(init.data) \ 154 DEV_KEEP(init.data) \
154 DEV_KEEP(exit.data) \ 155 DEV_KEEP(exit.data) \
155 CPU_KEEP(init.data) \ 156 CPU_KEEP(init.data) \
@@ -636,10 +637,11 @@
636 637
637#ifdef CONFIG_BLK_DEV_INITRD 638#ifdef CONFIG_BLK_DEV_INITRD
638#define INIT_RAM_FS \ 639#define INIT_RAM_FS \
639 . = ALIGN(PAGE_SIZE); \ 640 . = ALIGN(4); \
640 VMLINUX_SYMBOL(__initramfs_start) = .; \ 641 VMLINUX_SYMBOL(__initramfs_start) = .; \
641 *(.init.ramfs) \ 642 *(.init.ramfs) \
642 VMLINUX_SYMBOL(__initramfs_end) = .; 643 . = ALIGN(8); \
644 *(.init.ramfs.info)
643#else 645#else
644#define INIT_RAM_FS 646#define INIT_RAM_FS
645#endif 647#endif
diff --git a/include/crypto/cryptd.h b/include/crypto/cryptd.h
index 1c96b255017..ba98918bbd9 100644
--- a/include/crypto/cryptd.h
+++ b/include/crypto/cryptd.h
@@ -1,5 +1,12 @@
1/* 1/*
2 * Software async crypto daemon 2 * Software async crypto daemon
3 *
4 * Added AEAD support to cryptd.
5 * Authors: Tadeusz Struk (tadeusz.struk@intel.com)
6 * Adrian Hoban <adrian.hoban@intel.com>
7 * Gabriele Paoloni <gabriele.paoloni@intel.com>
8 * Aidan O'Mahony (aidan.o.mahony@intel.com)
9 * Copyright (c) 2010, Intel Corporation.
3 */ 10 */
4 11
5#ifndef _CRYPTO_CRYPT_H 12#ifndef _CRYPTO_CRYPT_H
@@ -42,4 +49,21 @@ struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm);
42struct shash_desc *cryptd_shash_desc(struct ahash_request *req); 49struct shash_desc *cryptd_shash_desc(struct ahash_request *req);
43void cryptd_free_ahash(struct cryptd_ahash *tfm); 50void cryptd_free_ahash(struct cryptd_ahash *tfm);
44 51
52struct cryptd_aead {
53 struct crypto_aead base;
54};
55
56static inline struct cryptd_aead *__cryptd_aead_cast(
57 struct crypto_aead *tfm)
58{
59 return (struct cryptd_aead *)tfm;
60}
61
62struct cryptd_aead *cryptd_alloc_aead(const char *alg_name,
63 u32 type, u32 mask);
64
65struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm);
66
67void cryptd_free_aead(struct cryptd_aead *tfm);
68
45#endif 69#endif
diff --git a/include/crypto/gf128mul.h b/include/crypto/gf128mul.h
index 4086b8ebfaf..da2530e34b2 100644
--- a/include/crypto/gf128mul.h
+++ b/include/crypto/gf128mul.h
@@ -54,8 +54,8 @@
54 54
55/* Comment by Rik: 55/* Comment by Rik:
56 * 56 *
57 * For some background on GF(2^128) see for example: http://- 57 * For some background on GF(2^128) see for example:
58 * csrc.nist.gov/CryptoToolkit/modes/proposedmodes/gcm/gcm-revised-spec.pdf 58 * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-revised-spec.pdf
59 * 59 *
60 * The elements of GF(2^128) := GF(2)[X]/(X^128-X^7-X^2-X^1-1) can 60 * The elements of GF(2^128) := GF(2)[X]/(X^128-X^7-X^2-X^1-1) can
61 * be mapped to computer memory in a variety of ways. Let's examine 61 * be mapped to computer memory in a variety of ways. Let's examine
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 4c9461a4f9e..274eaaa15c3 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -699,13 +699,8 @@ struct drm_driver {
699 int (*suspend) (struct drm_device *, pm_message_t state); 699 int (*suspend) (struct drm_device *, pm_message_t state);
700 int (*resume) (struct drm_device *); 700 int (*resume) (struct drm_device *);
701 int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv); 701 int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
702 void (*dma_ready) (struct drm_device *);
703 int (*dma_quiescent) (struct drm_device *); 702 int (*dma_quiescent) (struct drm_device *);
704 int (*context_ctor) (struct drm_device *dev, int context);
705 int (*context_dtor) (struct drm_device *dev, int context); 703 int (*context_dtor) (struct drm_device *dev, int context);
706 int (*kernel_context_switch) (struct drm_device *dev, int old,
707 int new);
708 void (*kernel_context_switch_unlock) (struct drm_device *dev);
709 704
710 /** 705 /**
711 * get_vblank_counter - get raw hardware vblank counter 706 * get_vblank_counter - get raw hardware vblank counter
@@ -777,8 +772,6 @@ struct drm_driver {
777 struct drm_file *file_priv); 772 struct drm_file *file_priv);
778 void (*reclaim_buffers_idlelocked) (struct drm_device *dev, 773 void (*reclaim_buffers_idlelocked) (struct drm_device *dev,
779 struct drm_file *file_priv); 774 struct drm_file *file_priv);
780 resource_size_t (*get_map_ofs) (struct drm_local_map * map);
781 resource_size_t (*get_reg_ofs) (struct drm_device *dev);
782 void (*set_version) (struct drm_device *dev, 775 void (*set_version) (struct drm_device *dev,
783 struct drm_set_version *sv); 776 struct drm_set_version *sv);
784 777
@@ -795,8 +788,6 @@ struct drm_driver {
795 void (*master_drop)(struct drm_device *dev, struct drm_file *file_priv, 788 void (*master_drop)(struct drm_device *dev, struct drm_file *file_priv,
796 bool from_release); 789 bool from_release);
797 790
798 int (*proc_init)(struct drm_minor *minor);
799 void (*proc_cleanup)(struct drm_minor *minor);
800 int (*debugfs_init)(struct drm_minor *minor); 791 int (*debugfs_init)(struct drm_minor *minor);
801 void (*debugfs_cleanup)(struct drm_minor *minor); 792 void (*debugfs_cleanup)(struct drm_minor *minor);
802 793
@@ -972,7 +963,6 @@ struct drm_device {
972 __volatile__ long context_flag; /**< Context swapping flag */ 963 __volatile__ long context_flag; /**< Context swapping flag */
973 __volatile__ long interrupt_flag; /**< Interruption handler flag */ 964 __volatile__ long interrupt_flag; /**< Interruption handler flag */
974 __volatile__ long dma_flag; /**< DMA dispatch flag */ 965 __volatile__ long dma_flag; /**< DMA dispatch flag */
975 struct timer_list timer; /**< Timer for delaying ctx switch */
976 wait_queue_head_t context_wait; /**< Processes waiting on ctx switch */ 966 wait_queue_head_t context_wait; /**< Processes waiting on ctx switch */
977 int last_checked; /**< Last context checked for DMA */ 967 int last_checked; /**< Last context checked for DMA */
978 int last_context; /**< Last current context */ 968 int last_context; /**< Last current context */
@@ -1045,25 +1035,12 @@ struct drm_device {
1045 struct drm_minor *control; /**< Control node for card */ 1035 struct drm_minor *control; /**< Control node for card */
1046 struct drm_minor *primary; /**< render type primary screen head */ 1036 struct drm_minor *primary; /**< render type primary screen head */
1047 1037
1048 /** \name Drawable information */
1049 /*@{ */
1050 spinlock_t drw_lock;
1051 struct idr drw_idr;
1052 /*@} */
1053
1054 struct drm_mode_config mode_config; /**< Current mode config */ 1038 struct drm_mode_config mode_config; /**< Current mode config */
1055 1039
1056 /** \name GEM information */ 1040 /** \name GEM information */
1057 /*@{ */ 1041 /*@{ */
1058 spinlock_t object_name_lock; 1042 spinlock_t object_name_lock;
1059 struct idr object_name_idr; 1043 struct idr object_name_idr;
1060 atomic_t object_count;
1061 atomic_t object_memory;
1062 atomic_t pin_count;
1063 atomic_t pin_memory;
1064 atomic_t gtt_count;
1065 atomic_t gtt_memory;
1066 uint32_t gtt_total;
1067 uint32_t invalidate_domains; /* domains pending invalidation */ 1044 uint32_t invalidate_domains; /* domains pending invalidation */
1068 uint32_t flush_domains; /* domains pending flush */ 1045 uint32_t flush_domains; /* domains pending flush */
1069 /*@} */ 1046 /*@} */
@@ -1175,8 +1152,6 @@ extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
1175extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); 1152extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
1176extern void drm_vm_open_locked(struct vm_area_struct *vma); 1153extern void drm_vm_open_locked(struct vm_area_struct *vma);
1177extern void drm_vm_close_locked(struct vm_area_struct *vma); 1154extern void drm_vm_close_locked(struct vm_area_struct *vma);
1178extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map);
1179extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev);
1180extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); 1155extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
1181 1156
1182 /* Memory management support (drm_memory.h) */ 1157 /* Memory management support (drm_memory.h) */
@@ -1186,8 +1161,7 @@ extern int drm_mem_info(char *buf, char **start, off_t offset,
1186 int request, int *eof, void *data); 1161 int request, int *eof, void *data);
1187extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area); 1162extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
1188 1163
1189extern DRM_AGP_MEM *drm_alloc_agp(struct drm_device *dev, int pages, u32 type); 1164extern void drm_free_agp(DRM_AGP_MEM * handle, int pages);
1190extern int drm_free_agp(DRM_AGP_MEM * handle, int pages);
1191extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start); 1165extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
1192extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev, 1166extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
1193 struct page **pages, 1167 struct page **pages,
@@ -1239,17 +1213,6 @@ extern int drm_setsareactx(struct drm_device *dev, void *data,
1239extern int drm_getsareactx(struct drm_device *dev, void *data, 1213extern int drm_getsareactx(struct drm_device *dev, void *data,
1240 struct drm_file *file_priv); 1214 struct drm_file *file_priv);
1241 1215
1242 /* Drawable IOCTL support (drm_drawable.h) */
1243extern int drm_adddraw(struct drm_device *dev, void *data,
1244 struct drm_file *file_priv);
1245extern int drm_rmdraw(struct drm_device *dev, void *data,
1246 struct drm_file *file_priv);
1247extern int drm_update_drawable_info(struct drm_device *dev, void *data,
1248 struct drm_file *file_priv);
1249extern struct drm_drawable_info *drm_get_drawable_info(struct drm_device *dev,
1250 drm_drawable_t id);
1251extern void drm_drawable_free_all(struct drm_device *dev);
1252
1253 /* Authentication IOCTL support (drm_auth.h) */ 1216 /* Authentication IOCTL support (drm_auth.h) */
1254extern int drm_getmagic(struct drm_device *dev, void *data, 1217extern int drm_getmagic(struct drm_device *dev, void *data,
1255 struct drm_file *file_priv); 1218 struct drm_file *file_priv);
@@ -1264,7 +1227,6 @@ extern int drm_lock(struct drm_device *dev, void *data,
1264 struct drm_file *file_priv); 1227 struct drm_file *file_priv);
1265extern int drm_unlock(struct drm_device *dev, void *data, 1228extern int drm_unlock(struct drm_device *dev, void *data,
1266 struct drm_file *file_priv); 1229 struct drm_file *file_priv);
1267extern int drm_lock_take(struct drm_lock_data *lock_data, unsigned int context);
1268extern int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context); 1230extern int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context);
1269extern void drm_idlelock_take(struct drm_lock_data *lock_data); 1231extern void drm_idlelock_take(struct drm_lock_data *lock_data);
1270extern void drm_idlelock_release(struct drm_lock_data *lock_data); 1232extern void drm_idlelock_release(struct drm_lock_data *lock_data);
@@ -1359,10 +1321,6 @@ extern int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
1359extern int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request); 1321extern int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
1360extern int drm_agp_bind_ioctl(struct drm_device *dev, void *data, 1322extern int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
1361 struct drm_file *file_priv); 1323 struct drm_file *file_priv);
1362extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size_t pages, u32 type);
1363extern int drm_agp_free_memory(DRM_AGP_MEM * handle);
1364extern int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start);
1365extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle);
1366extern void drm_agp_chipset_flush(struct drm_device *dev); 1324extern void drm_agp_chipset_flush(struct drm_device *dev);
1367 1325
1368 /* Stub support (drm_stub.h) */ 1326 /* Stub support (drm_stub.h) */
@@ -1414,7 +1372,6 @@ extern int drm_bufs_info(struct seq_file *m, void *data);
1414extern int drm_vblank_info(struct seq_file *m, void *data); 1372extern int drm_vblank_info(struct seq_file *m, void *data);
1415extern int drm_clients_info(struct seq_file *m, void* data); 1373extern int drm_clients_info(struct seq_file *m, void* data);
1416extern int drm_gem_name_info(struct seq_file *m, void *data); 1374extern int drm_gem_name_info(struct seq_file *m, void *data);
1417extern int drm_gem_object_info(struct seq_file *m, void* data);
1418 1375
1419#if DRM_DEBUG_CODE 1376#if DRM_DEBUG_CODE
1420extern int drm_vma_info(struct seq_file *m, void *data); 1377extern int drm_vma_info(struct seq_file *m, void *data);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 3e5a51af757..029aa688e78 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -221,7 +221,8 @@ struct drm_framebuffer_funcs {
221 * the semantics and arguments have a one to one mapping 221 * the semantics and arguments have a one to one mapping
222 * on this function. 222 * on this function.
223 */ 223 */
224 int (*dirty)(struct drm_framebuffer *framebuffer, unsigned flags, 224 int (*dirty)(struct drm_framebuffer *framebuffer,
225 struct drm_file *file_priv, unsigned flags,
225 unsigned color, struct drm_clip_rect *clips, 226 unsigned color, struct drm_clip_rect *clips,
226 unsigned num_clips); 227 unsigned num_clips);
227}; 228};
@@ -762,6 +763,7 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
762extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, 763extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
763 void *data, struct drm_file *file_priv); 764 void *data, struct drm_file *file_priv);
764extern bool drm_detect_hdmi_monitor(struct edid *edid); 765extern bool drm_detect_hdmi_monitor(struct edid *edid);
766extern bool drm_detect_monitor_audio(struct edid *edid);
765extern int drm_mode_page_flip_ioctl(struct drm_device *dev, 767extern int drm_mode_page_flip_ioctl(struct drm_device *dev,
766 void *data, struct drm_file *file_priv); 768 void *data, struct drm_file *file_priv);
767extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, 769extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index 59b7073b13f..73b071203dc 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -39,6 +39,11 @@
39 39
40#include <linux/fb.h> 40#include <linux/fb.h>
41 41
42enum mode_set_atomic {
43 LEAVE_ATOMIC_MODE_SET,
44 ENTER_ATOMIC_MODE_SET,
45};
46
42struct drm_crtc_helper_funcs { 47struct drm_crtc_helper_funcs {
43 /* 48 /*
44 * Control power levels on the CRTC. If the mode passed in is 49 * Control power levels on the CRTC. If the mode passed in is
@@ -61,7 +66,8 @@ struct drm_crtc_helper_funcs {
61 int (*mode_set_base)(struct drm_crtc *crtc, int x, int y, 66 int (*mode_set_base)(struct drm_crtc *crtc, int x, int y,
62 struct drm_framebuffer *old_fb); 67 struct drm_framebuffer *old_fb);
63 int (*mode_set_base_atomic)(struct drm_crtc *crtc, 68 int (*mode_set_base_atomic)(struct drm_crtc *crtc,
64 struct drm_framebuffer *fb, int x, int y); 69 struct drm_framebuffer *fb, int x, int y,
70 enum mode_set_atomic);
65 71
66 /* reload the current crtc LUT */ 72 /* reload the current crtc LUT */
67 void (*load_lut)(struct drm_crtc *crtc); 73 void (*load_lut)(struct drm_crtc *crtc);
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index a49e791db0b..83a389e4454 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -23,6 +23,9 @@
23#ifndef _DRM_DP_HELPER_H_ 23#ifndef _DRM_DP_HELPER_H_
24#define _DRM_DP_HELPER_H_ 24#define _DRM_DP_HELPER_H_
25 25
26#include <linux/types.h>
27#include <linux/i2c.h>
28
26/* From the VESA DisplayPort spec */ 29/* From the VESA DisplayPort spec */
27 30
28#define AUX_NATIVE_WRITE 0x8 31#define AUX_NATIVE_WRITE 0x8
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index e41c74facb6..8c641bed9bb 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -286,6 +286,7 @@ typedef struct drm_i915_irq_wait {
286#define I915_PARAM_HAS_PAGEFLIPPING 8 286#define I915_PARAM_HAS_PAGEFLIPPING 8
287#define I915_PARAM_HAS_EXECBUF2 9 287#define I915_PARAM_HAS_EXECBUF2 9
288#define I915_PARAM_HAS_BSD 10 288#define I915_PARAM_HAS_BSD 10
289#define I915_PARAM_HAS_BLT 11
289 290
290typedef struct drm_i915_getparam { 291typedef struct drm_i915_getparam {
291 int param; 292 int param;
@@ -627,8 +628,11 @@ struct drm_i915_gem_execbuffer2 {
627 __u32 num_cliprects; 628 __u32 num_cliprects;
628 /** This is a struct drm_clip_rect *cliprects */ 629 /** This is a struct drm_clip_rect *cliprects */
629 __u64 cliprects_ptr; 630 __u64 cliprects_ptr;
631#define I915_EXEC_RING_MASK (7<<0)
632#define I915_EXEC_DEFAULT (0<<0)
630#define I915_EXEC_RENDER (1<<0) 633#define I915_EXEC_RENDER (1<<0)
631#define I915_EXEC_BSD (1<<1) 634#define I915_EXEC_BSD (2<<0)
635#define I915_EXEC_BLT (3<<0)
632 __u64 flags; 636 __u64 flags;
633 __u64 rsvd1; 637 __u64 rsvd1;
634 __u64 rsvd2; 638 __u64 rsvd2;
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h
new file mode 100644
index 00000000000..d3c81946f61
--- /dev/null
+++ b/include/drm/intel-gtt.h
@@ -0,0 +1,18 @@
1/* Common header for intel-gtt.ko and i915.ko */
2
3#ifndef _DRM_INTEL_GTT_H
4#define _DRM_INTEL_GTT_H
5struct intel_gtt {
6 /* Number of stolen gtt entries at the beginning. */
7 unsigned int gtt_stolen_entries;
8 /* Total number of gtt entries. */
9 unsigned int gtt_total_entries;
10 /* Part of the gtt that is mappable by the cpu, for those chips where
11 * this is not the full gtt. */
12 unsigned int gtt_mappable_entries;
13};
14
15struct intel_gtt *intel_gtt_get(void);
16
17#endif
18
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 2040e6c4f17..5afa5b52063 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -102,7 +102,8 @@ struct ttm_bus_placement {
102 */ 102 */
103 103
104struct ttm_mem_reg { 104struct ttm_mem_reg {
105 struct drm_mm_node *mm_node; 105 void *mm_node;
106 unsigned long start;
106 unsigned long size; 107 unsigned long size;
107 unsigned long num_pages; 108 unsigned long num_pages;
108 uint32_t page_alignment; 109 uint32_t page_alignment;
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index b87504235f1..d01b4ddbdc5 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -203,7 +203,22 @@ struct ttm_tt {
203 * It's set up by the ttm_bo_driver::init_mem_type method. 203 * It's set up by the ttm_bo_driver::init_mem_type method.
204 */ 204 */
205 205
206struct ttm_mem_type_manager;
207
208struct ttm_mem_type_manager_func {
209 int (*init)(struct ttm_mem_type_manager *man, unsigned long p_size);
210 int (*takedown)(struct ttm_mem_type_manager *man);
211 int (*get_node)(struct ttm_mem_type_manager *man,
212 struct ttm_buffer_object *bo,
213 struct ttm_placement *placement,
214 struct ttm_mem_reg *mem);
215 void (*put_node)(struct ttm_mem_type_manager *man,
216 struct ttm_mem_reg *mem);
217 void (*debug)(struct ttm_mem_type_manager *man, const char *prefix);
218};
219
206struct ttm_mem_type_manager { 220struct ttm_mem_type_manager {
221 struct ttm_bo_device *bdev;
207 222
208 /* 223 /*
209 * No protection. Constant from start. 224 * No protection. Constant from start.
@@ -222,8 +237,8 @@ struct ttm_mem_type_manager {
222 * TODO: Consider one lru_lock per ttm_mem_type_manager. 237 * TODO: Consider one lru_lock per ttm_mem_type_manager.
223 * Plays ill with list removal, though. 238 * Plays ill with list removal, though.
224 */ 239 */
225 240 const struct ttm_mem_type_manager_func *func;
226 struct drm_mm manager; 241 void *priv;
227 struct list_head lru; 242 struct list_head lru;
228}; 243};
229 244
@@ -649,6 +664,12 @@ extern int ttm_bo_mem_space(struct ttm_buffer_object *bo,
649 struct ttm_mem_reg *mem, 664 struct ttm_mem_reg *mem,
650 bool interruptible, 665 bool interruptible,
651 bool no_wait_reserve, bool no_wait_gpu); 666 bool no_wait_reserve, bool no_wait_gpu);
667
668extern void ttm_bo_mem_put(struct ttm_buffer_object *bo,
669 struct ttm_mem_reg *mem);
670extern void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo,
671 struct ttm_mem_reg *mem);
672
652/** 673/**
653 * ttm_bo_wait_for_cpu 674 * ttm_bo_wait_for_cpu
654 * 675 *
@@ -891,6 +912,8 @@ extern int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
891 */ 912 */
892extern pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); 913extern pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp);
893 914
915extern const struct ttm_mem_type_manager_func ttm_bo_manager_func;
916
894#if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) 917#if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
895#define TTM_HAS_AGP 918#define TTM_HAS_AGP
896#include <linux/agp_backend.h> 919#include <linux/agp_backend.h>
diff --git a/include/drm/vmwgfx_drm.h b/include/drm/vmwgfx_drm.h
index 4d0842391ed..650e6bf6f69 100644
--- a/include/drm/vmwgfx_drm.h
+++ b/include/drm/vmwgfx_drm.h
@@ -72,6 +72,7 @@
72#define DRM_VMW_PARAM_FIFO_OFFSET 3 72#define DRM_VMW_PARAM_FIFO_OFFSET 3
73#define DRM_VMW_PARAM_HW_CAPS 4 73#define DRM_VMW_PARAM_HW_CAPS 4
74#define DRM_VMW_PARAM_FIFO_CAPS 5 74#define DRM_VMW_PARAM_FIFO_CAPS 5
75#define DRM_VMW_PARAM_MAX_FB_SIZE 6
75 76
76/** 77/**
77 * struct drm_vmw_getparam_arg 78 * struct drm_vmw_getparam_arg
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4e8ea8c8ec1..97319a8fc1e 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -118,6 +118,7 @@ header-y += eventpoll.h
118header-y += ext2_fs.h 118header-y += ext2_fs.h
119header-y += fadvise.h 119header-y += fadvise.h
120header-y += falloc.h 120header-y += falloc.h
121header-y += fanotify.h
121header-y += fb.h 122header-y += fb.h
122header-y += fcntl.h 123header-y += fcntl.h
123header-y += fd.h 124header-y += fd.h
@@ -301,6 +302,7 @@ header-y += quota.h
301header-y += radeonfb.h 302header-y += radeonfb.h
302header-y += random.h 303header-y += random.h
303header-y += raw.h 304header-y += raw.h
305header-y += rds.h
304header-y += reboot.h 306header-y += reboot.h
305header-y += reiserfs_fs.h 307header-y += reiserfs_fs.h
306header-y += reiserfs_xattr.h 308header-y += reiserfs_xattr.h
@@ -325,10 +327,6 @@ header-y += serio.h
325header-y += shm.h 327header-y += shm.h
326header-y += signal.h 328header-y += signal.h
327header-y += signalfd.h 329header-y += signalfd.h
328header-y += smb.h
329header-y += smb_fs.h
330header-y += smb_mount.h
331header-y += smbno.h
332header-y += snmp.h 330header-y += snmp.h
333header-y += socket.h 331header-y += socket.h
334header-y += sockios.h 332header-y += sockios.h
@@ -371,7 +369,6 @@ header-y += veth.h
371header-y += vhost.h 369header-y += vhost.h
372header-y += videodev.h 370header-y += videodev.h
373header-y += videodev2.h 371header-y += videodev2.h
374header-y += videotext.h
375header-y += virtio_9p.h 372header-y += virtio_9p.h
376header-y += virtio_balloon.h 373header-y += virtio_balloon.h
377header-y += virtio_blk.h 374header-y += virtio_blk.h
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index c227757feb0..050a7bccb83 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -245,8 +245,6 @@ int acpi_check_resource_conflict(const struct resource *res);
245 245
246int acpi_check_region(resource_size_t start, resource_size_t n, 246int acpi_check_region(resource_size_t start, resource_size_t n,
247 const char *name); 247 const char *name);
248int acpi_check_mem_region(resource_size_t start, resource_size_t n,
249 const char *name);
250 248
251int acpi_resources_are_enforced(void); 249int acpi_resources_are_enforced(void);
252 250
@@ -308,6 +306,9 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
308 u32 *mask, u32 req); 306 u32 *mask, u32 req);
309extern void acpi_early_init(void); 307extern void acpi_early_init(void);
310 308
309int acpi_os_map_generic_address(struct acpi_generic_address *addr);
310void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);
311
311#else /* !CONFIG_ACPI */ 312#else /* !CONFIG_ACPI */
312 313
313#define acpi_disabled 1 314#define acpi_disabled 1
@@ -344,12 +345,6 @@ static inline int acpi_check_region(resource_size_t start, resource_size_t n,
344 return 0; 345 return 0;
345} 346}
346 347
347static inline int acpi_check_mem_region(resource_size_t start,
348 resource_size_t n, const char *name)
349{
350 return 0;
351}
352
353struct acpi_table_header; 348struct acpi_table_header;
354static inline int acpi_table_parse(char *id, 349static inline int acpi_table_parse(char *id,
355 int (*handler)(struct acpi_table_header *)) 350 int (*handler)(struct acpi_table_header *))
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
new file mode 100644
index 00000000000..521a0f8974a
--- /dev/null
+++ b/include/linux/amba/pl08x.h
@@ -0,0 +1,222 @@
1/*
2 * linux/amba/pl08x.h - ARM PrimeCell DMA Controller driver
3 *
4 * Copyright (C) 2005 ARM Ltd
5 * Copyright (C) 2010 ST-Ericsson SA
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 * pl08x information required by platform code
12 *
13 * Please credit ARM.com
14 * Documentation: ARM DDI 0196D
15 *
16 */
17
18#ifndef AMBA_PL08X_H
19#define AMBA_PL08X_H
20
21/* We need sizes of structs from this header */
22#include <linux/dmaengine.h>
23#include <linux/interrupt.h>
24
25/**
26 * struct pl08x_channel_data - data structure to pass info between
27 * platform and PL08x driver regarding channel configuration
28 * @bus_id: name of this device channel, not just a device name since
29 * devices may have more than one channel e.g. "foo_tx"
30 * @min_signal: the minimum DMA signal number to be muxed in for this
31 * channel (for platforms supporting muxed signals). If you have
32 * static assignments, make sure this is set to the assigned signal
33 * number, PL08x have 16 possible signals in number 0 thru 15 so
34 * when these are not enough they often get muxed (in hardware)
35 * disabling simultaneous use of the same channel for two devices.
36 * @max_signal: the maximum DMA signal number to be muxed in for
37 * the channel. Set to the same as min_signal for
38 * devices with static assignments
39 * @muxval: a number usually used to poke into some mux regiser to
40 * mux in the signal to this channel
41 * @cctl_opt: default options for the channel control register
42 * @addr: source/target address in physical memory for this DMA channel,
43 * can be the address of a FIFO register for burst requests for example.
44 * This can be left undefined if the PrimeCell API is used for configuring
45 * this.
46 * @circular_buffer: whether the buffer passed in is circular and
47 * shall simply be looped round round (like a record baby round
48 * round round round)
49 * @single: the device connected to this channel will request single
50 * DMA transfers, not bursts. (Bursts are default.)
51 */
52struct pl08x_channel_data {
53 char *bus_id;
54 int min_signal;
55 int max_signal;
56 u32 muxval;
57 u32 cctl;
58 u32 ccfg;
59 dma_addr_t addr;
60 bool circular_buffer;
61 bool single;
62};
63
64/**
65 * Struct pl08x_bus_data - information of source or destination
66 * busses for a transfer
67 * @addr: current address
68 * @maxwidth: the maximum width of a transfer on this bus
69 * @buswidth: the width of this bus in bytes: 1, 2 or 4
70 * @fill_bytes: bytes required to fill to the next bus memory
71 * boundary
72 */
73struct pl08x_bus_data {
74 dma_addr_t addr;
75 u8 maxwidth;
76 u8 buswidth;
77 u32 fill_bytes;
78};
79
80/**
81 * struct pl08x_phy_chan - holder for the physical channels
82 * @id: physical index to this channel
83 * @lock: a lock to use when altering an instance of this struct
84 * @signal: the physical signal (aka channel) serving this
85 * physical channel right now
86 * @serving: the virtual channel currently being served by this
87 * physical channel
88 */
89struct pl08x_phy_chan {
90 unsigned int id;
91 void __iomem *base;
92 spinlock_t lock;
93 int signal;
94 struct pl08x_dma_chan *serving;
95 u32 csrc;
96 u32 cdst;
97 u32 clli;
98 u32 cctl;
99 u32 ccfg;
100};
101
102/**
103 * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor
104 * @llis_bus: DMA memory address (physical) start for the LLIs
105 * @llis_va: virtual memory address start for the LLIs
106 */
107struct pl08x_txd {
108 struct dma_async_tx_descriptor tx;
109 struct list_head node;
110 enum dma_data_direction direction;
111 struct pl08x_bus_data srcbus;
112 struct pl08x_bus_data dstbus;
113 int len;
114 dma_addr_t llis_bus;
115 void *llis_va;
116 struct pl08x_channel_data *cd;
117 bool active;
118 /*
119 * Settings to be put into the physical channel when we
120 * trigger this txd
121 */
122 u32 csrc;
123 u32 cdst;
124 u32 clli;
125 u32 cctl;
126};
127
128/**
129 * struct pl08x_dma_chan_state - holds the PL08x specific virtual
130 * channel states
131 * @PL08X_CHAN_IDLE: the channel is idle
132 * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport
133 * channel and is running a transfer on it
134 * @PL08X_CHAN_PAUSED: the channel has allocated a physical transport
135 * channel, but the transfer is currently paused
136 * @PL08X_CHAN_WAITING: the channel is waiting for a physical transport
137 * channel to become available (only pertains to memcpy channels)
138 */
139enum pl08x_dma_chan_state {
140 PL08X_CHAN_IDLE,
141 PL08X_CHAN_RUNNING,
142 PL08X_CHAN_PAUSED,
143 PL08X_CHAN_WAITING,
144};
145
146/**
147 * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel
148 * @chan: wrappped abstract channel
149 * @phychan: the physical channel utilized by this channel, if there is one
150 * @tasklet: tasklet scheduled by the IRQ to handle actual work etc
151 * @name: name of channel
152 * @cd: channel platform data
153 * @runtime_addr: address for RX/TX according to the runtime config
154 * @runtime_direction: current direction of this channel according to
155 * runtime config
156 * @lc: last completed transaction on this channel
157 * @desc_list: queued transactions pending on this channel
158 * @at: active transaction on this channel
159 * @lockflags: sometimes we let a lock last between two function calls,
160 * especially prep/submit, and then we need to store the IRQ flags
161 * in the channel state, here
162 * @lock: a lock for this channel data
163 * @host: a pointer to the host (internal use)
164 * @state: whether the channel is idle, paused, running etc
165 * @slave: whether this channel is a device (slave) or for memcpy
166 * @waiting: a TX descriptor on this channel which is waiting for
167 * a physical channel to become available
168 */
169struct pl08x_dma_chan {
170 struct dma_chan chan;
171 struct pl08x_phy_chan *phychan;
172 struct tasklet_struct tasklet;
173 char *name;
174 struct pl08x_channel_data *cd;
175 dma_addr_t runtime_addr;
176 enum dma_data_direction runtime_direction;
177 atomic_t last_issued;
178 dma_cookie_t lc;
179 struct list_head desc_list;
180 struct pl08x_txd *at;
181 unsigned long lockflags;
182 spinlock_t lock;
183 void *host;
184 enum pl08x_dma_chan_state state;
185 bool slave;
186 struct pl08x_txd *waiting;
187};
188
189/**
190 * struct pl08x_platform_data - the platform configuration for the
191 * PL08x PrimeCells.
192 * @slave_channels: the channels defined for the different devices on the
193 * platform, all inclusive, including multiplexed channels. The available
194 * physical channels will be multiplexed around these signals as they
195 * are requested, just enumerate all possible channels.
196 * @get_signal: request a physical signal to be used for a DMA
197 * transfer immediately: if there is some multiplexing or similar blocking
198 * the use of the channel the transfer can be denied by returning
199 * less than zero, else it returns the allocated signal number
200 * @put_signal: indicate to the platform that this physical signal is not
201 * running any DMA transfer and multiplexing can be recycled
202 * @bus_bit_lli: Bit[0] of the address indicated which AHB bus master the
203 * LLI addresses are on 0/1 Master 1/2.
204 */
205struct pl08x_platform_data {
206 struct pl08x_channel_data *slave_channels;
207 unsigned int num_slave_channels;
208 struct pl08x_channel_data memcpy_channel;
209 int (*get_signal)(struct pl08x_dma_chan *);
210 void (*put_signal)(struct pl08x_dma_chan *);
211};
212
213#ifdef CONFIG_AMBA_PL08X
214bool pl08x_filter_id(struct dma_chan *chan, void *chan_id);
215#else
216static inline bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
217{
218 return false;
219}
220#endif
221
222#endif /* AMBA_PL08X_H */
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index f6481daf6e5..a8e4e832cdb 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -449,7 +449,7 @@ void vcc_insert_socket(struct sock *sk);
449 449
450static inline int atm_guess_pdu2truesize(int size) 450static inline int atm_guess_pdu2truesize(int size)
451{ 451{
452 return (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info)); 452 return SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info);
453} 453}
454 454
455 455
diff --git a/include/linux/audit.h b/include/linux/audit.h
index e24afabc548..8b5c0620abf 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -102,6 +102,7 @@
102#define AUDIT_EOE 1320 /* End of multi-record event */ 102#define AUDIT_EOE 1320 /* End of multi-record event */
103#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */ 103#define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */
104#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */ 104#define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */
105#define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */
105 106
106#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 107#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
107#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 108#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -478,6 +479,7 @@ extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
478 const struct cred *new, 479 const struct cred *new,
479 const struct cred *old); 480 const struct cred *old);
480extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); 481extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old);
482extern void __audit_mmap_fd(int fd, int flags);
481 483
482static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) 484static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
483{ 485{
@@ -531,6 +533,12 @@ static inline void audit_log_capset(pid_t pid, const struct cred *new,
531 __audit_log_capset(pid, new, old); 533 __audit_log_capset(pid, new, old);
532} 534}
533 535
536static inline void audit_mmap_fd(int fd, int flags)
537{
538 if (unlikely(!audit_dummy_context()))
539 __audit_mmap_fd(fd, flags);
540}
541
534extern int audit_n_rules; 542extern int audit_n_rules;
535extern int audit_signals; 543extern int audit_signals;
536#else 544#else
@@ -564,6 +572,7 @@ extern int audit_signals;
564#define audit_mq_getsetattr(d,s) ((void)0) 572#define audit_mq_getsetattr(d,s) ((void)0)
565#define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) 573#define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; })
566#define audit_log_capset(pid, ncr, ocr) ((void)0) 574#define audit_log_capset(pid, ncr, ocr) ((void)0)
575#define audit_mmap_fd(fd, flags) ((void)0)
567#define audit_ptrace(t) ((void)0) 576#define audit_ptrace(t) ((void)0)
568#define audit_n_rules 0 577#define audit_n_rules 0
569#define audit_signals 0 578#define audit_signals 0
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 35b00746c71..4ce34fa937d 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -111,6 +111,7 @@ void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi);
111 111
112extern spinlock_t bdi_lock; 112extern spinlock_t bdi_lock;
113extern struct list_head bdi_list; 113extern struct list_head bdi_list;
114extern struct list_head bdi_pending_list;
114 115
115static inline int wb_has_dirty_io(struct bdi_writeback *wb) 116static inline int wb_has_dirty_io(struct bdi_writeback *wb)
116{ 117{
@@ -285,7 +286,7 @@ enum {
285void clear_bdi_congested(struct backing_dev_info *bdi, int sync); 286void clear_bdi_congested(struct backing_dev_info *bdi, int sync);
286void set_bdi_congested(struct backing_dev_info *bdi, int sync); 287void set_bdi_congested(struct backing_dev_info *bdi, int sync);
287long congestion_wait(int sync, long timeout); 288long congestion_wait(int sync, long timeout);
288 289long wait_iff_congested(struct zone *zone, int sync, long timeout);
289 290
290static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) 291static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi)
291{ 292{
diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h
new file mode 100644
index 00000000000..198087a16fc
--- /dev/null
+++ b/include/linux/basic_mmio_gpio.h
@@ -0,0 +1,20 @@
1/*
2 * Basic memory-mapped GPIO controllers.
3 *
4 * Copyright 2008 MontaVista Software, Inc.
5 * Copyright 2008,2010 Anton Vorontsov <cbouatmailru@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef __BASIC_MMIO_GPIO_H
14#define __BASIC_MMIO_GPIO_H
15
16struct bgpio_pdata {
17 int base;
18};
19
20#endif /* __BASIC_MMIO_GPIO_H */
diff --git a/include/linux/bfin_mac.h b/include/linux/bfin_mac.h
new file mode 100644
index 00000000000..904dec7d03a
--- /dev/null
+++ b/include/linux/bfin_mac.h
@@ -0,0 +1,29 @@
1/*
2 * Blackfin On-Chip MAC Driver
3 *
4 * Copyright 2004-2010 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 */
10
11#ifndef _LINUX_BFIN_MAC_H_
12#define _LINUX_BFIN_MAC_H_
13
14#include <linux/phy.h>
15
16struct bfin_phydev_platform_data {
17 unsigned short addr;
18 int irq;
19};
20
21struct bfin_mii_bus_platform_data {
22 int phydev_number;
23 struct bfin_phydev_platform_data *phydev_data;
24 const unsigned short *mac_peripherals;
25 int phy_mode;
26 unsigned int phy_mask;
27};
28
29#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 009b80e49f5..5027a599077 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -115,7 +115,6 @@ struct request {
115 void *elevator_private3; 115 void *elevator_private3;
116 116
117 struct gendisk *rq_disk; 117 struct gendisk *rq_disk;
118 struct hd_struct *part;
119 unsigned long start_time; 118 unsigned long start_time;
120#ifdef CONFIG_BLK_CGROUP 119#ifdef CONFIG_BLK_CGROUP
121 unsigned long long start_time_ns; 120 unsigned long long start_time_ns;
@@ -892,6 +891,14 @@ static inline int sb_issue_discard(struct super_block *sb, sector_t block,
892 nr_blocks << (sb->s_blocksize_bits - 9), 891 nr_blocks << (sb->s_blocksize_bits - 9),
893 gfp_mask, flags); 892 gfp_mask, flags);
894} 893}
894static inline int sb_issue_zeroout(struct super_block *sb, sector_t block,
895 sector_t nr_blocks, gfp_t gfp_mask)
896{
897 return blkdev_issue_zeroout(sb->s_bdev,
898 block << (sb->s_blocksize_bits - 9),
899 nr_blocks << (sb->s_blocksize_bits - 9),
900 gfp_mask);
901}
895 902
896extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); 903extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
897 904
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index dd1b25b2641..68d1fe7b877 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -212,7 +212,6 @@ int generic_write_end(struct file *, struct address_space *,
212 loff_t, unsigned, unsigned, 212 loff_t, unsigned, unsigned,
213 struct page *, void *); 213 struct page *, void *);
214void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); 214void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
215int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
216int cont_write_begin(struct file *, struct address_space *, loff_t, 215int cont_write_begin(struct file *, struct address_space *, loff_t,
217 unsigned, unsigned, struct page **, void **, 216 unsigned, unsigned, struct page **, void **,
218 get_block_t *, loff_t *); 217 get_block_t *, loff_t *);
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h
index dba28268e65..8e20540043f 100644
--- a/include/linux/can/platform/mcp251x.h
+++ b/include/linux/can/platform/mcp251x.h
@@ -12,7 +12,6 @@
12/** 12/**
13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data 13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data
14 * @oscillator_frequency: - oscillator frequency in Hz 14 * @oscillator_frequency: - oscillator frequency in Hz
15 * @model: - actual type of chip
16 * @board_specific_setup: - called before probing the chip (power,reset) 15 * @board_specific_setup: - called before probing the chip (power,reset)
17 * @transceiver_enable: - called to power on/off the transceiver 16 * @transceiver_enable: - called to power on/off the transceiver
18 * @power_enable: - called to power on/off the mcp *and* the 17 * @power_enable: - called to power on/off the mcp *and* the
@@ -25,9 +24,6 @@
25 24
26struct mcp251x_platform_data { 25struct mcp251x_platform_data {
27 unsigned long oscillator_frequency; 26 unsigned long oscillator_frequency;
28 int model;
29#define CAN_MCP251X_MCP2510 0x2510
30#define CAN_MCP251X_MCP2515 0x2515
31 int (*board_specific_setup)(struct spi_device *spi); 27 int (*board_specific_setup)(struct spi_device *spi);
32 int (*transceiver_enable)(int enable); 28 int (*transceiver_enable)(int enable);
33 int (*power_enable) (int enable); 29 int (*power_enable) (int enable);
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 709dfb901d1..ed4ba111bc8 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -154,6 +154,10 @@ enum {
154 * A thread in rmdir() is wating for this cgroup. 154 * A thread in rmdir() is wating for this cgroup.
155 */ 155 */
156 CGRP_WAIT_ON_RMDIR, 156 CGRP_WAIT_ON_RMDIR,
157 /*
158 * Clone cgroup values when creating a new child cgroup
159 */
160 CGRP_CLONE_CHILDREN,
157}; 161};
158 162
159/* which pidlist file are we talking about? */ 163/* which pidlist file are we talking about? */
diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h
index b3ef0c46157..e35071b1de0 100644
--- a/include/linux/coda_fs_i.h
+++ b/include/linux/coda_fs_i.h
@@ -10,19 +10,24 @@
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/spinlock.h>
13#include <linux/coda.h> 14#include <linux/coda.h>
14 15
15/* 16/*
16 * coda fs inode data 17 * coda fs inode data
18 * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and
19 * c_cached_perm.
20 * vfs_inode is set only when the inode is created and never changes.
21 * c_fid is set when the inode is created and should be considered immutable.
17 */ 22 */
18struct coda_inode_info { 23struct coda_inode_info {
19 struct CodaFid c_fid; /* Coda identifier */ 24 struct CodaFid c_fid; /* Coda identifier */
20 u_short c_flags; /* flags (see below) */ 25 u_short c_flags; /* flags (see below) */
21 struct list_head c_cilist; /* list of all coda inodes */
22 unsigned int c_mapcount; /* nr of times this inode is mapped */ 26 unsigned int c_mapcount; /* nr of times this inode is mapped */
23 unsigned int c_cached_epoch; /* epoch for cached permissions */ 27 unsigned int c_cached_epoch; /* epoch for cached permissions */
24 vuid_t c_uid; /* fsuid for cached permissions */ 28 vuid_t c_uid; /* fsuid for cached permissions */
25 unsigned int c_cached_perm; /* cached access permissions */ 29 unsigned int c_cached_perm; /* cached access permissions */
30 spinlock_t c_lock;
26 struct inode vfs_inode; 31 struct inode vfs_inode;
27}; 32};
28 33
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index dcc228aa335..2e914d0771b 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -89,7 +89,11 @@ static __inline__ char *coda_i2s(struct inode *inode)
89/* this will not zap the inode away */ 89/* this will not zap the inode away */
90static __inline__ void coda_flag_inode(struct inode *inode, int flag) 90static __inline__ void coda_flag_inode(struct inode *inode, int flag)
91{ 91{
92 ITOC(inode)->c_flags |= flag; 92 struct coda_inode_info *cii = ITOC(inode);
93
94 spin_lock(&cii->c_lock);
95 cii->c_flags |= flag;
96 spin_unlock(&cii->c_lock);
93} 97}
94 98
95#endif 99#endif
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 284b520934a..72f2d2f0af9 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -8,6 +8,7 @@
8 8
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10#include <linux/backing-dev.h> 10#include <linux/backing-dev.h>
11#include <linux/mutex.h>
11 12
12struct kstatfs; 13struct kstatfs;
13 14
@@ -20,6 +21,7 @@ struct venus_comm {
20 int vc_inuse; 21 int vc_inuse;
21 struct super_block *vc_sb; 22 struct super_block *vc_sb;
22 struct backing_dev_info bdi; 23 struct backing_dev_info bdi;
24 struct mutex vc_mutex;
23}; 25};
24 26
25 27
@@ -63,7 +65,7 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid,
63int venus_access(struct super_block *sb, struct CodaFid *fid, int mask); 65int venus_access(struct super_block *sb, struct CodaFid *fid, int mask);
64int venus_pioctl(struct super_block *sb, struct CodaFid *fid, 66int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
65 unsigned int cmd, struct PioctlData *data); 67 unsigned int cmd, struct PioctlData *data);
66int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); 68int coda_downcall(struct venus_comm *vcp, int opcode, union outputArgs *out);
67int venus_fsync(struct super_block *sb, struct CodaFid *fid); 69int venus_fsync(struct super_block *sb, struct CodaFid *fid);
68int venus_statfs(struct dentry *dentry, struct kstatfs *sfs); 70int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
69 71
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 51e3145196f..36d57f74cd0 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -10,7 +10,7 @@
10 10
11#include <linux/wait.h> 11#include <linux/wait.h>
12 12
13/** 13/*
14 * struct completion - structure used to maintain state for a "completion" 14 * struct completion - structure used to maintain state for a "completion"
15 * 15 *
16 * This is the opaque structure used to maintain the state for a "completion". 16 * This is the opaque structure used to maintain the state for a "completion".
@@ -34,7 +34,7 @@ struct completion {
34 ({ init_completion(&work); work; }) 34 ({ init_completion(&work); work; })
35 35
36/** 36/**
37 * DECLARE_COMPLETION: - declare and initialize a completion structure 37 * DECLARE_COMPLETION - declare and initialize a completion structure
38 * @work: identifier for the completion structure 38 * @work: identifier for the completion structure
39 * 39 *
40 * This macro declares and initializes a completion structure. Generally used 40 * This macro declares and initializes a completion structure. Generally used
@@ -50,7 +50,7 @@ struct completion {
50 * are on the kernel stack: 50 * are on the kernel stack:
51 */ 51 */
52/** 52/**
53 * DECLARE_COMPLETION_ONSTACK: - declare and initialize a completion structure 53 * DECLARE_COMPLETION_ONSTACK - declare and initialize a completion structure
54 * @work: identifier for the completion structure 54 * @work: identifier for the completion structure
55 * 55 *
56 * This macro declares and initializes a completion structure on the kernel 56 * This macro declares and initializes a completion structure on the kernel
@@ -64,7 +64,7 @@ struct completion {
64#endif 64#endif
65 65
66/** 66/**
67 * init_completion: - Initialize a dynamically allocated completion 67 * init_completion - Initialize a dynamically allocated completion
68 * @x: completion structure that is to be initialized 68 * @x: completion structure that is to be initialized
69 * 69 *
70 * This inline function will initialize a dynamically created completion 70 * This inline function will initialize a dynamically created completion
@@ -92,7 +92,7 @@ extern void complete(struct completion *);
92extern void complete_all(struct completion *); 92extern void complete_all(struct completion *);
93 93
94/** 94/**
95 * INIT_COMPLETION: - reinitialize a completion structure 95 * INIT_COMPLETION - reinitialize a completion structure
96 * @x: completion structure to be reinitialized 96 * @x: completion structure to be reinitialized
97 * 97 *
98 * This macro should be used to reinitialize a completion structure so it can 98 * This macro should be used to reinitialize a completion structure so it can
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 3a779ffba60..7e8ca75d2da 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -88,12 +88,6 @@ struct cn_queue_dev {
88 unsigned char name[CN_CBQ_NAMELEN]; 88 unsigned char name[CN_CBQ_NAMELEN];
89 89
90 struct workqueue_struct *cn_queue; 90 struct workqueue_struct *cn_queue;
91 /* Sent to kevent to create cn_queue only when needed */
92 struct work_struct wq_creation;
93 /* Tell if the wq_creation job is pending/completed */
94 atomic_t wq_requested;
95 /* Wait for cn_queue to be created */
96 wait_queue_head_t wq_created;
97 91
98 struct list_head queue_list; 92 struct list_head queue_list;
99 spinlock_t queue_lock; 93 spinlock_t queue_lock;
@@ -141,8 +135,6 @@ int cn_netlink_send(struct cn_msg *, u32, gfp_t);
141int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); 135int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *));
142void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); 136void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
143 137
144int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work);
145
146struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); 138struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *);
147void cn_queue_free_dev(struct cn_queue_dev *dev); 139void cn_queue_free_dev(struct cn_queue_dev *dev);
148 140
diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h
index 7c930dba477..5dd428532f7 100644
--- a/include/linux/davinci_emac.h
+++ b/include/linux/davinci_emac.h
@@ -14,16 +14,26 @@
14#include <linux/if_ether.h> 14#include <linux/if_ether.h>
15#include <linux/memory.h> 15#include <linux/memory.h>
16 16
17struct mdio_platform_data {
18 unsigned long bus_freq;
19};
20
17struct emac_platform_data { 21struct emac_platform_data {
18 char mac_addr[ETH_ALEN]; 22 char mac_addr[ETH_ALEN];
19 u32 ctrl_reg_offset; 23 u32 ctrl_reg_offset;
20 u32 ctrl_mod_reg_offset; 24 u32 ctrl_mod_reg_offset;
21 u32 ctrl_ram_offset; 25 u32 ctrl_ram_offset;
22 u32 hw_ram_addr; 26 u32 hw_ram_addr;
23 u32 mdio_reg_offset;
24 u32 ctrl_ram_size; 27 u32 ctrl_ram_size;
25 u32 phy_mask; 28
26 u32 mdio_max_freq; 29 /*
30 * phy_id can be one of the following:
31 * - NULL : use the first phy on the bus,
32 * - "" : force to 100/full, no mdio control
33 * - "<bus>:<addr>" : use the specified bus and phy
34 */
35 const char *phy_id;
36
27 u8 rmii_en; 37 u8 rmii_en;
28 u8 version; 38 u8 version;
29 void (*interrupt_enable) (void); 39 void (*interrupt_enable) (void);
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 7434a8353e2..749f01ccd26 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -165,8 +165,10 @@ enum {
165 DCCPO_TIMESTAMP_ECHO = 42, 165 DCCPO_TIMESTAMP_ECHO = 42,
166 DCCPO_ELAPSED_TIME = 43, 166 DCCPO_ELAPSED_TIME = 43,
167 DCCPO_MAX = 45, 167 DCCPO_MAX = 45,
168 DCCPO_MIN_CCID_SPECIFIC = 128, 168 DCCPO_MIN_RX_CCID_SPECIFIC = 128, /* from sender to receiver */
169 DCCPO_MAX_CCID_SPECIFIC = 255, 169 DCCPO_MAX_RX_CCID_SPECIFIC = 191,
170 DCCPO_MIN_TX_CCID_SPECIFIC = 192, /* from receiver to sender */
171 DCCPO_MAX_TX_CCID_SPECIFIC = 255,
170}; 172};
171/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */ 173/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
172#define DCCP_SINGLE_OPT_MAXLEN 253 174#define DCCP_SINGLE_OPT_MAXLEN 253
@@ -460,7 +462,8 @@ struct dccp_ackvec;
460 * @dccps_hc_rx_insert_options - receiver wants to add options when acking 462 * @dccps_hc_rx_insert_options - receiver wants to add options when acking
461 * @dccps_hc_tx_insert_options - sender wants to add options when sending 463 * @dccps_hc_tx_insert_options - sender wants to add options when sending
462 * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) 464 * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3)
463 * @dccps_xmit_timer - timer for when CCID is not ready to send 465 * @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets
466 * @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing)
464 * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) 467 * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs)
465 */ 468 */
466struct dccp_sock { 469struct dccp_sock {
@@ -500,6 +503,7 @@ struct dccp_sock {
500 __u8 dccps_hc_rx_insert_options:1; 503 __u8 dccps_hc_rx_insert_options:1;
501 __u8 dccps_hc_tx_insert_options:1; 504 __u8 dccps_hc_tx_insert_options:1;
502 __u8 dccps_server_timewait:1; 505 __u8 dccps_server_timewait:1;
506 struct tasklet_struct dccps_xmitlet;
503 struct timer_list dccps_xmit_timer; 507 struct timer_list dccps_xmit_timer;
504}; 508};
505 509
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index e2106495cc1..9d8688b92d8 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -64,13 +64,15 @@ enum dma_transaction_type {
64 DMA_PQ_VAL, 64 DMA_PQ_VAL,
65 DMA_MEMSET, 65 DMA_MEMSET,
66 DMA_INTERRUPT, 66 DMA_INTERRUPT,
67 DMA_SG,
67 DMA_PRIVATE, 68 DMA_PRIVATE,
68 DMA_ASYNC_TX, 69 DMA_ASYNC_TX,
69 DMA_SLAVE, 70 DMA_SLAVE,
71 DMA_CYCLIC,
70}; 72};
71 73
72/* last transaction type for creation of the capabilities mask */ 74/* last transaction type for creation of the capabilities mask */
73#define DMA_TX_TYPE_END (DMA_SLAVE + 1) 75#define DMA_TX_TYPE_END (DMA_CYCLIC + 1)
74 76
75 77
76/** 78/**
@@ -119,12 +121,15 @@ enum dma_ctrl_flags {
119 * configuration data in statically from the platform). An additional 121 * configuration data in statically from the platform). An additional
120 * argument of struct dma_slave_config must be passed in with this 122 * argument of struct dma_slave_config must be passed in with this
121 * command. 123 * command.
124 * @FSLDMA_EXTERNAL_START: this command will put the Freescale DMA controller
125 * into external start mode.
122 */ 126 */
123enum dma_ctrl_cmd { 127enum dma_ctrl_cmd {
124 DMA_TERMINATE_ALL, 128 DMA_TERMINATE_ALL,
125 DMA_PAUSE, 129 DMA_PAUSE,
126 DMA_RESUME, 130 DMA_RESUME,
127 DMA_SLAVE_CONFIG, 131 DMA_SLAVE_CONFIG,
132 FSLDMA_EXTERNAL_START,
128}; 133};
129 134
130/** 135/**
@@ -316,14 +321,14 @@ struct dma_async_tx_descriptor {
316 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); 321 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
317 dma_async_tx_callback callback; 322 dma_async_tx_callback callback;
318 void *callback_param; 323 void *callback_param;
319#ifndef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH 324#ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH
320 struct dma_async_tx_descriptor *next; 325 struct dma_async_tx_descriptor *next;
321 struct dma_async_tx_descriptor *parent; 326 struct dma_async_tx_descriptor *parent;
322 spinlock_t lock; 327 spinlock_t lock;
323#endif 328#endif
324}; 329};
325 330
326#ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH 331#ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH
327static inline void txd_lock(struct dma_async_tx_descriptor *txd) 332static inline void txd_lock(struct dma_async_tx_descriptor *txd)
328{ 333{
329} 334}
@@ -422,6 +427,9 @@ struct dma_tx_state {
422 * @device_prep_dma_memset: prepares a memset operation 427 * @device_prep_dma_memset: prepares a memset operation
423 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation 428 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation
424 * @device_prep_slave_sg: prepares a slave dma operation 429 * @device_prep_slave_sg: prepares a slave dma operation
430 * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio.
431 * The function takes a buffer of size buf_len. The callback function will
432 * be called after period_len bytes have been transferred.
425 * @device_control: manipulate all pending operations on a channel, returns 433 * @device_control: manipulate all pending operations on a channel, returns
426 * zero or error code 434 * zero or error code
427 * @device_tx_status: poll for transaction completion, the optional 435 * @device_tx_status: poll for transaction completion, the optional
@@ -473,11 +481,19 @@ struct dma_device {
473 unsigned long flags); 481 unsigned long flags);
474 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( 482 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
475 struct dma_chan *chan, unsigned long flags); 483 struct dma_chan *chan, unsigned long flags);
484 struct dma_async_tx_descriptor *(*device_prep_dma_sg)(
485 struct dma_chan *chan,
486 struct scatterlist *dst_sg, unsigned int dst_nents,
487 struct scatterlist *src_sg, unsigned int src_nents,
488 unsigned long flags);
476 489
477 struct dma_async_tx_descriptor *(*device_prep_slave_sg)( 490 struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
478 struct dma_chan *chan, struct scatterlist *sgl, 491 struct dma_chan *chan, struct scatterlist *sgl,
479 unsigned int sg_len, enum dma_data_direction direction, 492 unsigned int sg_len, enum dma_data_direction direction,
480 unsigned long flags); 493 unsigned long flags);
494 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
495 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
496 size_t period_len, enum dma_data_direction direction);
481 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, 497 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
482 unsigned long arg); 498 unsigned long arg);
483 499
@@ -487,6 +503,40 @@ struct dma_device {
487 void (*device_issue_pending)(struct dma_chan *chan); 503 void (*device_issue_pending)(struct dma_chan *chan);
488}; 504};
489 505
506static inline int dmaengine_device_control(struct dma_chan *chan,
507 enum dma_ctrl_cmd cmd,
508 unsigned long arg)
509{
510 return chan->device->device_control(chan, cmd, arg);
511}
512
513static inline int dmaengine_slave_config(struct dma_chan *chan,
514 struct dma_slave_config *config)
515{
516 return dmaengine_device_control(chan, DMA_SLAVE_CONFIG,
517 (unsigned long)config);
518}
519
520static inline int dmaengine_terminate_all(struct dma_chan *chan)
521{
522 return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
523}
524
525static inline int dmaengine_pause(struct dma_chan *chan)
526{
527 return dmaengine_device_control(chan, DMA_PAUSE, 0);
528}
529
530static inline int dmaengine_resume(struct dma_chan *chan)
531{
532 return dmaengine_device_control(chan, DMA_RESUME, 0);
533}
534
535static inline int dmaengine_submit(struct dma_async_tx_descriptor *desc)
536{
537 return desc->tx_submit(desc);
538}
539
490static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len) 540static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len)
491{ 541{
492 size_t mask; 542 size_t mask;
@@ -606,11 +656,11 @@ static inline void net_dmaengine_put(void)
606#ifdef CONFIG_ASYNC_TX_DMA 656#ifdef CONFIG_ASYNC_TX_DMA
607#define async_dmaengine_get() dmaengine_get() 657#define async_dmaengine_get() dmaengine_get()
608#define async_dmaengine_put() dmaengine_put() 658#define async_dmaengine_put() dmaengine_put()
609#ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH 659#ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH
610#define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX) 660#define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX)
611#else 661#else
612#define async_dma_find_channel(type) dma_find_channel(type) 662#define async_dma_find_channel(type) dma_find_channel(type)
613#endif /* CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH */ 663#endif /* CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH */
614#else 664#else
615static inline void async_dmaengine_get(void) 665static inline void async_dmaengine_get(void)
616{ 666{
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 80a0ece8f7e..4fd978e7eb8 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -122,8 +122,6 @@ extern void elv_completed_request(struct request_queue *, struct request *);
122extern int elv_set_request(struct request_queue *, struct request *, gfp_t); 122extern int elv_set_request(struct request_queue *, struct request *, gfp_t);
123extern void elv_put_request(struct request_queue *, struct request *); 123extern void elv_put_request(struct request_queue *, struct request *);
124extern void elv_drain_elevator(struct request_queue *); 124extern void elv_drain_elevator(struct request_queue *);
125extern void elv_quiesce_start(struct request_queue *);
126extern void elv_quiesce_end(struct request_queue *);
127 125
128/* 126/*
129 * io scheduler registration 127 * io scheduler registration
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 2308fbb4523..f16a01081e1 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -71,7 +71,7 @@ static inline int is_zero_ether_addr(const u8 *addr)
71 */ 71 */
72static inline int is_multicast_ether_addr(const u8 *addr) 72static inline int is_multicast_ether_addr(const u8 *addr)
73{ 73{
74 return (0x01 & addr[0]); 74 return 0x01 & addr[0];
75} 75}
76 76
77/** 77/**
@@ -82,7 +82,7 @@ static inline int is_multicast_ether_addr(const u8 *addr)
82 */ 82 */
83static inline int is_local_ether_addr(const u8 *addr) 83static inline int is_local_ether_addr(const u8 *addr)
84{ 84{
85 return (0x02 & addr[0]); 85 return 0x02 & addr[0];
86} 86}
87 87
88/** 88/**
@@ -237,13 +237,29 @@ static inline bool is_etherdev_addr(const struct net_device *dev,
237 * entry points. 237 * entry points.
238 */ 238 */
239 239
240static inline int compare_ether_header(const void *a, const void *b) 240static inline unsigned long compare_ether_header(const void *a, const void *b)
241{ 241{
242#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
243 unsigned long fold;
244
245 /*
246 * We want to compare 14 bytes:
247 * [a0 ... a13] ^ [b0 ... b13]
248 * Use two long XOR, ORed together, with an overlap of two bytes.
249 * [a0 a1 a2 a3 a4 a5 a6 a7 ] ^ [b0 b1 b2 b3 b4 b5 b6 b7 ] |
250 * [a6 a7 a8 a9 a10 a11 a12 a13] ^ [b6 b7 b8 b9 b10 b11 b12 b13]
251 * This means the [a6 a7] ^ [b6 b7] part is done two times.
252 */
253 fold = *(unsigned long *)a ^ *(unsigned long *)b;
254 fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6);
255 return fold;
256#else
242 u32 *a32 = (u32 *)((u8 *)a + 2); 257 u32 *a32 = (u32 *)((u8 *)a + 2);
243 u32 *b32 = (u32 *)((u8 *)b + 2); 258 u32 *b32 = (u32 *)((u8 *)b + 2);
244 259
245 return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) | 260 return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) |
246 (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]); 261 (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]);
262#endif
247} 263}
248 264
249#endif /* _LINUX_ETHERDEVICE_H */ 265#endif /* _LINUX_ETHERDEVICE_H */
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 991269e5b15..6628a507fd3 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -14,6 +14,7 @@
14#define _LINUX_ETHTOOL_H 14#define _LINUX_ETHTOOL_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/if_ether.h>
17 18
18/* This should work for both 32 and 64 bit userland. */ 19/* This should work for both 32 and 64 bit userland. */
19struct ethtool_cmd { 20struct ethtool_cmd {
@@ -308,15 +309,28 @@ struct ethtool_perm_addr {
308 * flag differs from the read-only value. 309 * flag differs from the read-only value.
309 */ 310 */
310enum ethtool_flags { 311enum ethtool_flags {
312 ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
313 ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
311 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ 314 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
312 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ 315 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
313 ETH_FLAG_RXHASH = (1 << 28), 316 ETH_FLAG_RXHASH = (1 << 28),
314}; 317};
315 318
316/* The following structures are for supporting RX network flow 319/* The following structures are for supporting RX network flow
317 * classification configuration. Note, all multibyte fields, e.g., 320 * classification and RX n-tuple configuration. Note, all multibyte
318 * ip4src, ip4dst, psrc, pdst, spi, etc. are expected to be in network 321 * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
319 * byte order. 322 * be in network byte order.
323 */
324
325/**
326 * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
327 * @ip4src: Source host
328 * @ip4dst: Destination host
329 * @psrc: Source port
330 * @pdst: Destination port
331 * @tos: Type-of-service
332 *
333 * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
320 */ 334 */
321struct ethtool_tcpip4_spec { 335struct ethtool_tcpip4_spec {
322 __be32 ip4src; 336 __be32 ip4src;
@@ -326,6 +340,15 @@ struct ethtool_tcpip4_spec {
326 __u8 tos; 340 __u8 tos;
327}; 341};
328 342
343/**
344 * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
345 * @ip4src: Source host
346 * @ip4dst: Destination host
347 * @spi: Security parameters index
348 * @tos: Type-of-service
349 *
350 * This can be used to specify an IPsec transport or tunnel over IPv4.
351 */
329struct ethtool_ah_espip4_spec { 352struct ethtool_ah_espip4_spec {
330 __be32 ip4src; 353 __be32 ip4src;
331 __be32 ip4dst; 354 __be32 ip4dst;
@@ -333,21 +356,17 @@ struct ethtool_ah_espip4_spec {
333 __u8 tos; 356 __u8 tos;
334}; 357};
335 358
336struct ethtool_rawip4_spec {
337 __be32 ip4src;
338 __be32 ip4dst;
339 __u8 hdata[64];
340};
341
342struct ethtool_ether_spec {
343 __be16 ether_type;
344 __u8 frame_size;
345 __u8 eframe[16];
346};
347
348#define ETH_RX_NFC_IP4 1 359#define ETH_RX_NFC_IP4 1
349#define ETH_RX_NFC_IP6 2
350 360
361/**
362 * struct ethtool_usrip4_spec - general flow specification for IPv4
363 * @ip4src: Source host
364 * @ip4dst: Destination host
365 * @l4_4_bytes: First 4 bytes of transport (layer 4) header
366 * @tos: Type-of-service
367 * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
368 * @proto: Transport protocol number; mask must be 0
369 */
351struct ethtool_usrip4_spec { 370struct ethtool_usrip4_spec {
352 __be32 ip4src; 371 __be32 ip4src;
353 __be32 ip4dst; 372 __be32 ip4dst;
@@ -357,6 +376,15 @@ struct ethtool_usrip4_spec {
357 __u8 proto; 376 __u8 proto;
358}; 377};
359 378
379/**
380 * struct ethtool_rx_flow_spec - specification for RX flow filter
381 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
382 * @h_u: Flow fields to match (dependent on @flow_type)
383 * @m_u: Masks for flow field bits to be ignored
384 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
385 * if packets should be discarded
386 * @location: Index of filter in hardware table
387 */
360struct ethtool_rx_flow_spec { 388struct ethtool_rx_flow_spec {
361 __u32 flow_type; 389 __u32 flow_type;
362 union { 390 union {
@@ -365,36 +393,91 @@ struct ethtool_rx_flow_spec {
365 struct ethtool_tcpip4_spec sctp_ip4_spec; 393 struct ethtool_tcpip4_spec sctp_ip4_spec;
366 struct ethtool_ah_espip4_spec ah_ip4_spec; 394 struct ethtool_ah_espip4_spec ah_ip4_spec;
367 struct ethtool_ah_espip4_spec esp_ip4_spec; 395 struct ethtool_ah_espip4_spec esp_ip4_spec;
368 struct ethtool_rawip4_spec raw_ip4_spec;
369 struct ethtool_ether_spec ether_spec;
370 struct ethtool_usrip4_spec usr_ip4_spec; 396 struct ethtool_usrip4_spec usr_ip4_spec;
371 __u8 hdata[64]; 397 struct ethhdr ether_spec;
372 } h_u, m_u; /* entry, mask */ 398 __u8 hdata[72];
399 } h_u, m_u;
373 __u64 ring_cookie; 400 __u64 ring_cookie;
374 __u32 location; 401 __u32 location;
375}; 402};
376 403
404/**
405 * struct ethtool_rxnfc - command to get or set RX flow classification rules
406 * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
407 * %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
408 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
409 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
410 * @data: Command-dependent value
411 * @fs: Flow filter specification
412 * @rule_cnt: Number of rules to be affected
413 * @rule_locs: Array of valid rule indices
414 *
415 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
416 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
417 * structure fields must not be used.
418 *
419 * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
420 * on return.
421 *
422 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
423 * rules on return.
424 *
425 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the index of an
426 * existing filter rule on entry and @fs contains the rule on return.
427 *
428 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
429 * user buffer for @rule_locs on entry. On return, @data is the size
430 * of the filter table and @rule_locs contains the indices of the
431 * defined rules.
432 *
433 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the filter rule to add or
434 * update. @fs.@location specifies the index to use and must not be
435 * ignored.
436 *
437 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the index of an
438 * existing filter rule on entry.
439 *
440 * Implementation of indexed classification rules generally requires a
441 * TCAM.
442 */
377struct ethtool_rxnfc { 443struct ethtool_rxnfc {
378 __u32 cmd; 444 __u32 cmd;
379 __u32 flow_type; 445 __u32 flow_type;
380 /* The rx flow hash value or the rule DB size */
381 __u64 data; 446 __u64 data;
382 /* The following fields are not valid and must not be used for
383 * the ETHTOOL_{G,X}RXFH commands. */
384 struct ethtool_rx_flow_spec fs; 447 struct ethtool_rx_flow_spec fs;
385 __u32 rule_cnt; 448 __u32 rule_cnt;
386 __u32 rule_locs[0]; 449 __u32 rule_locs[0];
387}; 450};
388 451
452/**
453 * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
454 * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
455 * @size: On entry, the array size of the user buffer. On return from
456 * %ETHTOOL_GRXFHINDIR, the array size of the hardware indirection table.
457 * @ring_index: RX ring/queue index for each hash value
458 */
389struct ethtool_rxfh_indir { 459struct ethtool_rxfh_indir {
390 __u32 cmd; 460 __u32 cmd;
391 /* On entry, this is the array size of the user buffer. On
392 * return from ETHTOOL_GRXFHINDIR, this is the array size of
393 * the hardware indirection table. */
394 __u32 size; 461 __u32 size;
395 __u32 ring_index[0]; /* ring/queue index for each hash value */ 462 __u32 ring_index[0];
396}; 463};
397 464
465/**
466 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
467 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
468 * @h_u: Flow field values to match (dependent on @flow_type)
469 * @m_u: Masks for flow field value bits to be ignored
470 * @vlan_tag: VLAN tag to match
471 * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
472 * @data: Driver-dependent data to match
473 * @data_mask: Mask for driver-dependent data bits to be ignored
474 * @action: RX ring/queue index to deliver to (non-negative) or other action
475 * (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
476 *
477 * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
478 * a field value and mask are both zero this is treated as if all mask
479 * bits are set i.e. the field is ignored.
480 */
398struct ethtool_rx_ntuple_flow_spec { 481struct ethtool_rx_ntuple_flow_spec {
399 __u32 flow_type; 482 __u32 flow_type;
400 union { 483 union {
@@ -403,22 +486,26 @@ struct ethtool_rx_ntuple_flow_spec {
403 struct ethtool_tcpip4_spec sctp_ip4_spec; 486 struct ethtool_tcpip4_spec sctp_ip4_spec;
404 struct ethtool_ah_espip4_spec ah_ip4_spec; 487 struct ethtool_ah_espip4_spec ah_ip4_spec;
405 struct ethtool_ah_espip4_spec esp_ip4_spec; 488 struct ethtool_ah_espip4_spec esp_ip4_spec;
406 struct ethtool_rawip4_spec raw_ip4_spec;
407 struct ethtool_ether_spec ether_spec;
408 struct ethtool_usrip4_spec usr_ip4_spec; 489 struct ethtool_usrip4_spec usr_ip4_spec;
409 __u8 hdata[64]; 490 struct ethhdr ether_spec;
410 } h_u, m_u; /* entry, mask */ 491 __u8 hdata[72];
492 } h_u, m_u;
411 493
412 __u16 vlan_tag; 494 __u16 vlan_tag;
413 __u16 vlan_tag_mask; 495 __u16 vlan_tag_mask;
414 __u64 data; /* user-defined flow spec data */ 496 __u64 data;
415 __u64 data_mask; /* user-defined flow spec mask */ 497 __u64 data_mask;
416 498
417 /* signed to distinguish between queue and actions (DROP) */
418 __s32 action; 499 __s32 action;
419#define ETHTOOL_RXNTUPLE_ACTION_DROP -1 500#define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */
501#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */
420}; 502};
421 503
504/**
505 * struct ethtool_rx_ntuple - command to set or clear RX flow filter
506 * @cmd: Command number - %ETHTOOL_SRXNTUPLE
507 * @fs: Flow filter specification
508 */
422struct ethtool_rx_ntuple { 509struct ethtool_rx_ntuple {
423 __u32 cmd; 510 __u32 cmd;
424 struct ethtool_rx_ntuple_flow_spec fs; 511 struct ethtool_rx_ntuple_flow_spec fs;
@@ -759,22 +846,23 @@ struct ethtool_ops {
759#define WAKE_MAGIC (1 << 5) 846#define WAKE_MAGIC (1 << 5)
760#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ 847#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
761 848
762/* L3-L4 network traffic flow types */ 849/* L2-L4 network traffic flow types */
763#define TCP_V4_FLOW 0x01 850#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
764#define UDP_V4_FLOW 0x02 851#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
765#define SCTP_V4_FLOW 0x03 852#define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
766#define AH_ESP_V4_FLOW 0x04 853#define AH_ESP_V4_FLOW 0x04 /* hash only */
767#define TCP_V6_FLOW 0x05 854#define TCP_V6_FLOW 0x05 /* hash only */
768#define UDP_V6_FLOW 0x06 855#define UDP_V6_FLOW 0x06 /* hash only */
769#define SCTP_V6_FLOW 0x07 856#define SCTP_V6_FLOW 0x07 /* hash only */
770#define AH_ESP_V6_FLOW 0x08 857#define AH_ESP_V6_FLOW 0x08 /* hash only */
771#define AH_V4_FLOW 0x09 858#define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
772#define ESP_V4_FLOW 0x0a 859#define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
773#define AH_V6_FLOW 0x0b 860#define AH_V6_FLOW 0x0b /* hash only */
774#define ESP_V6_FLOW 0x0c 861#define ESP_V6_FLOW 0x0c /* hash only */
775#define IP_USER_FLOW 0x0d 862#define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
776#define IPV4_FLOW 0x10 863#define IPV4_FLOW 0x10 /* hash only */
777#define IPV6_FLOW 0x11 864#define IPV6_FLOW 0x11 /* hash only */
865#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
778 866
779/* L3-L4 network traffic flow hash options */ 867/* L3-L4 network traffic flow hash options */
780#define RXH_L2DA (1 << 1) 868#define RXH_L2DA (1 << 1)
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index a9cd507f8cd..28028988c86 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -67,6 +67,19 @@ enum fid_type {
67 * 32 bit parent block number, 32 bit parent generation number 67 * 32 bit parent block number, 32 bit parent generation number
68 */ 68 */
69 FILEID_UDF_WITH_PARENT = 0x52, 69 FILEID_UDF_WITH_PARENT = 0x52,
70
71 /*
72 * 64 bit checkpoint number, 64 bit inode number,
73 * 32 bit generation number.
74 */
75 FILEID_NILFS_WITHOUT_PARENT = 0x61,
76
77 /*
78 * 64 bit checkpoint number, 64 bit inode number,
79 * 32 bit generation number, 32 bit parent generation.
80 * 64 bit parent inode number.
81 */
82 FILEID_NILFS_WITH_PARENT = 0x62,
70}; 83};
71 84
72struct fid { 85struct fid {
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index 63531a6b4d2..0f0121467fc 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -6,18 +6,19 @@
6/* the following events that user-space can register for */ 6/* the following events that user-space can register for */
7#define FAN_ACCESS 0x00000001 /* File was accessed */ 7#define FAN_ACCESS 0x00000001 /* File was accessed */
8#define FAN_MODIFY 0x00000002 /* File was modified */ 8#define FAN_MODIFY 0x00000002 /* File was modified */
9#define FAN_CLOSE_WRITE 0x00000008 /* Unwrittable file closed */ 9#define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */
10#define FAN_CLOSE_NOWRITE 0x00000010 /* Writtable file closed */ 10#define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
11#define FAN_OPEN 0x00000020 /* File was opened */ 11#define FAN_OPEN 0x00000020 /* File was opened */
12 12
13#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
14
15/* FIXME currently Q's have no limit.... */
16#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ 13#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
17 14
18#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ 15#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
19#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ 16#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
20 17
18#define FAN_ONDIR 0x40000000 /* event occurred against dir */
19
20#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
21
21/* helper events */ 22/* helper events */
22#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ 23#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
23 24
@@ -25,7 +26,19 @@
25#define FAN_CLOEXEC 0x00000001 26#define FAN_CLOEXEC 0x00000001
26#define FAN_NONBLOCK 0x00000002 27#define FAN_NONBLOCK 0x00000002
27 28
28#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK) 29/* These are NOT bitwise flags. Both bits are used togther. */
30#define FAN_CLASS_NOTIF 0x00000000
31#define FAN_CLASS_CONTENT 0x00000004
32#define FAN_CLASS_PRE_CONTENT 0x00000008
33#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \
34 FAN_CLASS_PRE_CONTENT)
35
36#define FAN_UNLIMITED_QUEUE 0x00000010
37#define FAN_UNLIMITED_MARKS 0x00000020
38
39#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
40 FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\
41 FAN_UNLIMITED_MARKS)
29 42
30/* flags used for fanotify_modify_mark() */ 43/* flags used for fanotify_modify_mark() */
31#define FAN_MARK_ADD 0x00000001 44#define FAN_MARK_ADD 0x00000001
@@ -36,6 +49,10 @@
36#define FAN_MARK_IGNORED_MASK 0x00000020 49#define FAN_MARK_IGNORED_MASK 0x00000020
37#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 50#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
38#define FAN_MARK_FLUSH 0x00000080 51#define FAN_MARK_FLUSH 0x00000080
52#ifdef __KERNEL__
53/* not valid from userspace, only kernel internal */
54#define FAN_MARK_ONDIR 0x00000100
55#endif
39 56
40#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ 57#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
41 FAN_MARK_REMOVE |\ 58 FAN_MARK_REMOVE |\
@@ -43,7 +60,8 @@
43 FAN_MARK_ONLYDIR |\ 60 FAN_MARK_ONLYDIR |\
44 FAN_MARK_MOUNT |\ 61 FAN_MARK_MOUNT |\
45 FAN_MARK_IGNORED_MASK |\ 62 FAN_MARK_IGNORED_MASK |\
46 FAN_MARK_IGNORED_SURV_MODIFY) 63 FAN_MARK_IGNORED_SURV_MODIFY |\
64 FAN_MARK_FLUSH)
47 65
48/* 66/*
49 * All of the events - we build the list by hand so that we can add flags in 67 * All of the events - we build the list by hand so that we can add flags in
@@ -70,10 +88,10 @@
70struct fanotify_event_metadata { 88struct fanotify_event_metadata {
71 __u32 event_len; 89 __u32 event_len;
72 __u32 vers; 90 __u32 vers;
73 __u64 mask; 91 __aligned_u64 mask;
74 __s32 fd; 92 __s32 fd;
75 __s32 pid; 93 __s32 pid;
76} __attribute__ ((packed)); 94};
77 95
78struct fanotify_response { 96struct fanotify_response {
79 __s32 fd; 97 __s32 fd;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index f0268deca65..7fca3dc4e47 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -931,6 +931,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
931#define fb_writel sbus_writel 931#define fb_writel sbus_writel
932#define fb_writeq sbus_writeq 932#define fb_writeq sbus_writeq
933#define fb_memset sbus_memset_io 933#define fb_memset sbus_memset_io
934#define fb_memcpy_fromfb sbus_memcpy_fromio
935#define fb_memcpy_tofb sbus_memcpy_toio
934 936
935#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__) 937#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__)
936 938
@@ -943,6 +945,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
943#define fb_writel __raw_writel 945#define fb_writel __raw_writel
944#define fb_writeq __raw_writeq 946#define fb_writeq __raw_writeq
945#define fb_memset memset_io 947#define fb_memset memset_io
948#define fb_memcpy_fromfb memcpy_fromio
949#define fb_memcpy_tofb memcpy_toio
946 950
947#else 951#else
948 952
@@ -955,6 +959,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
955#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b)) 959#define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b))
956#define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b)) 960#define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b))
957#define fb_memset memset 961#define fb_memset memset
962#define fb_memcpy_fromfb memcpy
963#define fb_memcpy_tofb memcpy
958 964
959#endif 965#endif
960 966
diff --git a/include/linux/fdreg.h b/include/linux/fdreg.h
index c2eeb63b72d..61ce6416900 100644
--- a/include/linux/fdreg.h
+++ b/include/linux/fdreg.h
@@ -89,7 +89,7 @@
89/* the following commands are new in the 82078. They are not used in the 89/* the following commands are new in the 82078. They are not used in the
90 * floppy driver, except the first three. These commands may be useful for apps 90 * floppy driver, except the first three. These commands may be useful for apps
91 * which use the FDRAWCMD interface. For doc, get the 82078 spec sheets at 91 * which use the FDRAWCMD interface. For doc, get the 82078 spec sheets at
92 * http://www-techdoc.intel.com/docs/periph/fd_contr/datasheets/ */ 92 * http://www.intel.com/design/archives/periphrl/docs/29046803.htm */
93 93
94#define FD_PARTID 0x18 /* part id ("extended" version cmd) */ 94#define FD_PARTID 0x18 /* part id ("extended" version cmd) */
95#define FD_SAVE 0x2e /* save fdc regs for later restore */ 95#define FD_SAVE 0x2e /* save fdc regs for later restore */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4f34ff6e555..334d68a1710 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,6 +9,7 @@
9#include <linux/limits.h> 9#include <linux/limits.h>
10#include <linux/ioctl.h> 10#include <linux/ioctl.h>
11#include <linux/blk_types.h> 11#include <linux/blk_types.h>
12#include <linux/types.h>
12 13
13/* 14/*
14 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change 15 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -32,11 +33,17 @@
32#define SEEK_END 2 /* seek relative to end of file */ 33#define SEEK_END 2 /* seek relative to end of file */
33#define SEEK_MAX SEEK_END 34#define SEEK_MAX SEEK_END
34 35
36struct fstrim_range {
37 uint64_t start;
38 uint64_t len;
39 uint64_t minlen;
40};
41
35/* And dynamically-tunable limits and defaults: */ 42/* And dynamically-tunable limits and defaults: */
36struct files_stat_struct { 43struct files_stat_struct {
37 int nr_files; /* read only */ 44 unsigned long nr_files; /* read only */
38 int nr_free_files; /* read only */ 45 unsigned long nr_free_files; /* read only */
39 int max_files; /* tunable */ 46 unsigned long max_files; /* tunable */
40}; 47};
41 48
42struct inodes_stat_t { 49struct inodes_stat_t {
@@ -92,6 +99,9 @@ struct inodes_stat_t {
92/* Expect random access pattern */ 99/* Expect random access pattern */
93#define FMODE_RANDOM ((__force fmode_t)0x1000) 100#define FMODE_RANDOM ((__force fmode_t)0x1000)
94 101
102/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
103#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
104
95/* File was opened by fanotify and shouldn't generate fanotify events */ 105/* File was opened by fanotify and shouldn't generate fanotify events */
96#define FMODE_NONOTIFY ((__force fmode_t)0x1000000) 106#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
97 107
@@ -231,6 +241,7 @@ struct inodes_stat_t {
231#define S_NOCMTIME 128 /* Do not update file c/mtime */ 241#define S_NOCMTIME 128 /* Do not update file c/mtime */
232#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ 242#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */
233#define S_PRIVATE 512 /* Inode is fs-internal */ 243#define S_PRIVATE 512 /* Inode is fs-internal */
244#define S_IMA 1024 /* Inode has an associated IMA struct */
234 245
235/* 246/*
236 * Note that nosuid etc flags are inode-specific: setting some file-system 247 * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -265,6 +276,7 @@ struct inodes_stat_t {
265#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) 276#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
266#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) 277#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
267#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) 278#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
279#define IS_IMA(inode) ((inode)->i_flags & S_IMA)
268 280
269/* the read-only stuff doesn't really belong here, but any other place is 281/* the read-only stuff doesn't really belong here, but any other place is
270 probably as bad and I don't want to create yet another include file. */ 282 probably as bad and I don't want to create yet another include file. */
@@ -312,6 +324,7 @@ struct inodes_stat_t {
312#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ 324#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
313#define FIFREEZE _IOWR('X', 119, int) /* Freeze */ 325#define FIFREEZE _IOWR('X', 119, int) /* Freeze */
314#define FITHAW _IOWR('X', 120, int) /* Thaw */ 326#define FITHAW _IOWR('X', 120, int) /* Thaw */
327#define FITRIM _IOWR('X', 121, struct fstrim_range) /* Trim */
315 328
316#define FS_IOC_GETFLAGS _IOR('f', 1, long) 329#define FS_IOC_GETFLAGS _IOR('f', 1, long)
317#define FS_IOC_SETFLAGS _IOW('f', 2, long) 330#define FS_IOC_SETFLAGS _IOW('f', 2, long)
@@ -400,7 +413,7 @@ extern void __init inode_init_early(void);
400extern void __init files_init(unsigned long); 413extern void __init files_init(unsigned long);
401 414
402extern struct files_stat_struct files_stat; 415extern struct files_stat_struct files_stat;
403extern int get_max_files(void); 416extern unsigned long get_max_files(void);
404extern int sysctl_nr_open; 417extern int sysctl_nr_open;
405extern struct inodes_stat_t inodes_stat; 418extern struct inodes_stat_t inodes_stat;
406extern int leases_enable, lease_break_time; 419extern int leases_enable, lease_break_time;
@@ -720,7 +733,8 @@ struct posix_acl;
720 733
721struct inode { 734struct inode {
722 struct hlist_node i_hash; 735 struct hlist_node i_hash;
723 struct list_head i_list; /* backing dev IO list */ 736 struct list_head i_wb_list; /* backing dev IO list */
737 struct list_head i_lru; /* inode LRU list */
724 struct list_head i_sb_list; 738 struct list_head i_sb_list;
725 struct list_head i_dentry; 739 struct list_head i_dentry;
726 unsigned long i_ino; 740 unsigned long i_ino;
@@ -772,6 +786,10 @@ struct inode {
772 786
773 unsigned int i_flags; 787 unsigned int i_flags;
774 788
789#ifdef CONFIG_IMA
790 /* protected by i_lock */
791 unsigned int i_readcount; /* struct files open RO */
792#endif
775 atomic_t i_writecount; 793 atomic_t i_writecount;
776#ifdef CONFIG_SECURITY 794#ifdef CONFIG_SECURITY
777 void *i_security; 795 void *i_security;
@@ -783,6 +801,11 @@ struct inode {
783 void *i_private; /* fs or device private pointer */ 801 void *i_private; /* fs or device private pointer */
784}; 802};
785 803
804static inline int inode_unhashed(struct inode *inode)
805{
806 return hlist_unhashed(&inode->i_hash);
807}
808
786/* 809/*
787 * inode->i_mutex nesting subclasses for the lock validator: 810 * inode->i_mutex nesting subclasses for the lock validator:
788 * 811 *
@@ -1033,7 +1056,6 @@ struct lock_manager_operations {
1033 int (*fl_compare_owner)(struct file_lock *, struct file_lock *); 1056 int (*fl_compare_owner)(struct file_lock *, struct file_lock *);
1034 void (*fl_notify)(struct file_lock *); /* unblock callback */ 1057 void (*fl_notify)(struct file_lock *); /* unblock callback */
1035 int (*fl_grant)(struct file_lock *, struct file_lock *, int); 1058 int (*fl_grant)(struct file_lock *, struct file_lock *, int);
1036 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
1037 void (*fl_release_private)(struct file_lock *); 1059 void (*fl_release_private)(struct file_lock *);
1038 void (*fl_break)(struct file_lock *); 1060 void (*fl_break)(struct file_lock *);
1039 int (*fl_mylease)(struct file_lock *, struct file_lock *); 1061 int (*fl_mylease)(struct file_lock *, struct file_lock *);
@@ -1106,7 +1128,9 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
1106extern int fcntl_getlease(struct file *filp); 1128extern int fcntl_getlease(struct file *filp);
1107 1129
1108/* fs/locks.c */ 1130/* fs/locks.c */
1131void locks_free_lock(struct file_lock *fl);
1109extern void locks_init_lock(struct file_lock *); 1132extern void locks_init_lock(struct file_lock *);
1133extern struct file_lock * locks_alloc_lock(void);
1110extern void locks_copy_lock(struct file_lock *, struct file_lock *); 1134extern void locks_copy_lock(struct file_lock *, struct file_lock *);
1111extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); 1135extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
1112extern void locks_remove_posix(struct file *, fl_owner_t); 1136extern void locks_remove_posix(struct file *, fl_owner_t);
@@ -1295,6 +1319,11 @@ struct fasync_struct {
1295 1319
1296/* SMP safe fasync helpers: */ 1320/* SMP safe fasync helpers: */
1297extern int fasync_helper(int, struct file *, int, struct fasync_struct **); 1321extern int fasync_helper(int, struct file *, int, struct fasync_struct **);
1322extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);
1323extern int fasync_remove_entry(struct file *, struct fasync_struct **);
1324extern struct fasync_struct *fasync_alloc(void);
1325extern void fasync_free(struct fasync_struct *);
1326
1298/* can be called from interrupts */ 1327/* can be called from interrupts */
1299extern void kill_fasync(struct fasync_struct **, int, int); 1328extern void kill_fasync(struct fasync_struct **, int, int);
1300 1329
@@ -1583,6 +1612,7 @@ struct super_operations {
1583 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1612 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
1584#endif 1613#endif
1585 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); 1614 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
1615 int (*trim_fs) (struct super_block *, struct fstrim_range *);
1586}; 1616};
1587 1617
1588/* 1618/*
@@ -1633,16 +1663,17 @@ struct super_operations {
1633 * 1663 *
1634 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1664 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1635 */ 1665 */
1636#define I_DIRTY_SYNC 1 1666#define I_DIRTY_SYNC (1 << 0)
1637#define I_DIRTY_DATASYNC 2 1667#define I_DIRTY_DATASYNC (1 << 1)
1638#define I_DIRTY_PAGES 4 1668#define I_DIRTY_PAGES (1 << 2)
1639#define __I_NEW 3 1669#define __I_NEW 3
1640#define I_NEW (1 << __I_NEW) 1670#define I_NEW (1 << __I_NEW)
1641#define I_WILL_FREE 16 1671#define I_WILL_FREE (1 << 4)
1642#define I_FREEING 32 1672#define I_FREEING (1 << 5)
1643#define I_CLEAR 64 1673#define I_CLEAR (1 << 6)
1644#define __I_SYNC 7 1674#define __I_SYNC 7
1645#define I_SYNC (1 << __I_SYNC) 1675#define I_SYNC (1 << __I_SYNC)
1676#define I_REFERENCED (1 << 8)
1646 1677
1647#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1678#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1648 1679
@@ -1734,12 +1765,15 @@ static inline void file_accessed(struct file *file)
1734} 1765}
1735 1766
1736int sync_inode(struct inode *inode, struct writeback_control *wbc); 1767int sync_inode(struct inode *inode, struct writeback_control *wbc);
1768int sync_inode_metadata(struct inode *inode, int wait);
1737 1769
1738struct file_system_type { 1770struct file_system_type {
1739 const char *name; 1771 const char *name;
1740 int fs_flags; 1772 int fs_flags;
1741 int (*get_sb) (struct file_system_type *, int, 1773 int (*get_sb) (struct file_system_type *, int,
1742 const char *, void *, struct vfsmount *); 1774 const char *, void *, struct vfsmount *);
1775 struct dentry *(*mount) (struct file_system_type *, int,
1776 const char *, void *);
1743 void (*kill_sb) (struct super_block *); 1777 void (*kill_sb) (struct super_block *);
1744 struct module *owner; 1778 struct module *owner;
1745 struct file_system_type * next; 1779 struct file_system_type * next;
@@ -1755,17 +1789,25 @@ struct file_system_type {
1755 struct lock_class_key i_alloc_sem_key; 1789 struct lock_class_key i_alloc_sem_key;
1756}; 1790};
1757 1791
1758extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data, 1792extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
1759 int (*fill_super)(struct super_block *, void *, int), 1793 void *data, int (*fill_super)(struct super_block *, void *, int));
1760 struct vfsmount *mnt); 1794extern struct dentry *mount_bdev(struct file_system_type *fs_type,
1795 int flags, const char *dev_name, void *data,
1796 int (*fill_super)(struct super_block *, void *, int));
1761extern int get_sb_bdev(struct file_system_type *fs_type, 1797extern int get_sb_bdev(struct file_system_type *fs_type,
1762 int flags, const char *dev_name, void *data, 1798 int flags, const char *dev_name, void *data,
1763 int (*fill_super)(struct super_block *, void *, int), 1799 int (*fill_super)(struct super_block *, void *, int),
1764 struct vfsmount *mnt); 1800 struct vfsmount *mnt);
1801extern struct dentry *mount_single(struct file_system_type *fs_type,
1802 int flags, void *data,
1803 int (*fill_super)(struct super_block *, void *, int));
1765extern int get_sb_single(struct file_system_type *fs_type, 1804extern int get_sb_single(struct file_system_type *fs_type,
1766 int flags, void *data, 1805 int flags, void *data,
1767 int (*fill_super)(struct super_block *, void *, int), 1806 int (*fill_super)(struct super_block *, void *, int),
1768 struct vfsmount *mnt); 1807 struct vfsmount *mnt);
1808extern struct dentry *mount_nodev(struct file_system_type *fs_type,
1809 int flags, void *data,
1810 int (*fill_super)(struct super_block *, void *, int));
1769extern int get_sb_nodev(struct file_system_type *fs_type, 1811extern int get_sb_nodev(struct file_system_type *fs_type,
1770 int flags, void *data, 1812 int flags, void *data,
1771 int (*fill_super)(struct super_block *, void *, int), 1813 int (*fill_super)(struct super_block *, void *, int),
@@ -1781,9 +1823,8 @@ struct super_block *sget(struct file_system_type *type,
1781 int (*test)(struct super_block *,void *), 1823 int (*test)(struct super_block *,void *),
1782 int (*set)(struct super_block *,void *), 1824 int (*set)(struct super_block *,void *),
1783 void *data); 1825 void *data);
1784extern int get_sb_pseudo(struct file_system_type *, char *, 1826extern struct dentry *mount_pseudo(struct file_system_type *, char *,
1785 const struct super_operations *ops, unsigned long, 1827 const struct super_operations *ops, unsigned long);
1786 struct vfsmount *mnt);
1787extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); 1828extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1788 1829
1789static inline void sb_mark_dirty(struct super_block *sb) 1830static inline void sb_mark_dirty(struct super_block *sb)
@@ -1826,6 +1867,7 @@ extern int current_umask(void);
1826/* /sys/fs */ 1867/* /sys/fs */
1827extern struct kobject *fs_kobj; 1868extern struct kobject *fs_kobj;
1828 1869
1870#define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK)
1829extern int rw_verify_area(int, struct file *, loff_t *, size_t); 1871extern int rw_verify_area(int, struct file *, loff_t *, size_t);
1830 1872
1831#define FLOCK_VERIFY_READ 1 1873#define FLOCK_VERIFY_READ 1
@@ -2078,7 +2120,6 @@ extern int check_disk_change(struct block_device *);
2078extern int __invalidate_device(struct block_device *); 2120extern int __invalidate_device(struct block_device *);
2079extern int invalidate_partition(struct gendisk *, int); 2121extern int invalidate_partition(struct gendisk *, int);
2080#endif 2122#endif
2081extern int invalidate_inodes(struct super_block *);
2082unsigned long invalidate_mapping_pages(struct address_space *mapping, 2123unsigned long invalidate_mapping_pages(struct address_space *mapping,
2083 pgoff_t start, pgoff_t end); 2124 pgoff_t start, pgoff_t end);
2084 2125
@@ -2162,7 +2203,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
2162 2203
2163extern int inode_init_always(struct super_block *, struct inode *); 2204extern int inode_init_always(struct super_block *, struct inode *);
2164extern void inode_init_once(struct inode *); 2205extern void inode_init_once(struct inode *);
2165extern void inode_add_to_lists(struct super_block *, struct inode *); 2206extern void ihold(struct inode * inode);
2166extern void iput(struct inode *); 2207extern void iput(struct inode *);
2167extern struct inode * igrab(struct inode *); 2208extern struct inode * igrab(struct inode *);
2168extern ino_t iunique(struct super_block *, ino_t); 2209extern ino_t iunique(struct super_block *, ino_t);
@@ -2182,11 +2223,11 @@ extern struct inode * iget_locked(struct super_block *, unsigned long);
2182extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); 2223extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
2183extern int insert_inode_locked(struct inode *); 2224extern int insert_inode_locked(struct inode *);
2184extern void unlock_new_inode(struct inode *); 2225extern void unlock_new_inode(struct inode *);
2226extern unsigned int get_next_ino(void);
2185 2227
2186extern void __iget(struct inode * inode); 2228extern void __iget(struct inode * inode);
2187extern void iget_failed(struct inode *); 2229extern void iget_failed(struct inode *);
2188extern void end_writeback(struct inode *); 2230extern void end_writeback(struct inode *);
2189extern void destroy_inode(struct inode *);
2190extern void __destroy_inode(struct inode *); 2231extern void __destroy_inode(struct inode *);
2191extern struct inode *new_inode(struct super_block *); 2232extern struct inode *new_inode(struct super_block *);
2192extern int should_remove_suid(struct dentry *); 2233extern int should_remove_suid(struct dentry *);
@@ -2194,9 +2235,11 @@ extern int file_remove_suid(struct file *);
2194 2235
2195extern void __insert_inode_hash(struct inode *, unsigned long hashval); 2236extern void __insert_inode_hash(struct inode *, unsigned long hashval);
2196extern void remove_inode_hash(struct inode *); 2237extern void remove_inode_hash(struct inode *);
2197static inline void insert_inode_hash(struct inode *inode) { 2238static inline void insert_inode_hash(struct inode *inode)
2239{
2198 __insert_inode_hash(inode, inode->i_ino); 2240 __insert_inode_hash(inode, inode->i_ino);
2199} 2241}
2242extern void inode_sb_list_add(struct inode *inode);
2200 2243
2201#ifdef CONFIG_BLOCK 2244#ifdef CONFIG_BLOCK
2202extern void submit_bio(int, struct bio *); 2245extern void submit_bio(int, struct bio *);
@@ -2479,7 +2522,10 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
2479struct ctl_table; 2522struct ctl_table;
2480int proc_nr_files(struct ctl_table *table, int write, 2523int proc_nr_files(struct ctl_table *table, int write,
2481 void __user *buffer, size_t *lenp, loff_t *ppos); 2524 void __user *buffer, size_t *lenp, loff_t *ppos);
2482 2525int proc_nr_dentry(struct ctl_table *table, int write,
2526 void __user *buffer, size_t *lenp, loff_t *ppos);
2527int proc_nr_inodes(struct ctl_table *table, int write,
2528 void __user *buffer, size_t *lenp, loff_t *ppos);
2483int __init get_filesystem_list(char *buf); 2529int __init get_filesystem_list(char *buf);
2484 2530
2485#define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) 2531#define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE])
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 59d0df43ff9..5c185fa2708 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -26,12 +26,12 @@ static inline void fsnotify_d_instantiate(struct dentry *dentry,
26} 26}
27 27
28/* Notify this dentry's parent about a child's events. */ 28/* Notify this dentry's parent about a child's events. */
29static inline void fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) 29static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask)
30{ 30{
31 if (!dentry) 31 if (!dentry)
32 dentry = path->dentry; 32 dentry = path->dentry;
33 33
34 __fsnotify_parent(path, dentry, mask); 34 return __fsnotify_parent(path, dentry, mask);
35} 35}
36 36
37/* simple call site for access decisions */ 37/* simple call site for access decisions */
@@ -40,6 +40,7 @@ static inline int fsnotify_perm(struct file *file, int mask)
40 struct path *path = &file->f_path; 40 struct path *path = &file->f_path;
41 struct inode *inode = path->dentry->d_inode; 41 struct inode *inode = path->dentry->d_inode;
42 __u32 fsnotify_mask = 0; 42 __u32 fsnotify_mask = 0;
43 int ret;
43 44
44 if (file->f_mode & FMODE_NONOTIFY) 45 if (file->f_mode & FMODE_NONOTIFY)
45 return 0; 46 return 0;
@@ -52,6 +53,10 @@ static inline int fsnotify_perm(struct file *file, int mask)
52 else 53 else
53 BUG(); 54 BUG();
54 55
56 ret = fsnotify_parent(path, NULL, fsnotify_mask);
57 if (ret)
58 return ret;
59
55 return fsnotify(inode, fsnotify_mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); 60 return fsnotify(inode, fsnotify_mask, path, FSNOTIFY_EVENT_PATH, NULL, 0);
56} 61}
57 62
@@ -93,8 +98,8 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
93 old_dir_mask |= FS_DN_RENAME; 98 old_dir_mask |= FS_DN_RENAME;
94 99
95 if (isdir) { 100 if (isdir) {
96 old_dir_mask |= FS_IN_ISDIR; 101 old_dir_mask |= FS_ISDIR;
97 new_dir_mask |= FS_IN_ISDIR; 102 new_dir_mask |= FS_ISDIR;
98 } 103 }
99 104
100 fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie); 105 fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie);
@@ -132,7 +137,7 @@ static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
132 __u32 mask = FS_DELETE; 137 __u32 mask = FS_DELETE;
133 138
134 if (isdir) 139 if (isdir)
135 mask |= FS_IN_ISDIR; 140 mask |= FS_ISDIR;
136 141
137 fsnotify_parent(NULL, dentry, mask); 142 fsnotify_parent(NULL, dentry, mask);
138} 143}
@@ -174,7 +179,7 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct
174 */ 179 */
175static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) 180static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
176{ 181{
177 __u32 mask = (FS_CREATE | FS_IN_ISDIR); 182 __u32 mask = (FS_CREATE | FS_ISDIR);
178 struct inode *d_inode = dentry->d_inode; 183 struct inode *d_inode = dentry->d_inode;
179 184
180 audit_inode_child(dentry, inode); 185 audit_inode_child(dentry, inode);
@@ -192,7 +197,7 @@ static inline void fsnotify_access(struct file *file)
192 __u32 mask = FS_ACCESS; 197 __u32 mask = FS_ACCESS;
193 198
194 if (S_ISDIR(inode->i_mode)) 199 if (S_ISDIR(inode->i_mode))
195 mask |= FS_IN_ISDIR; 200 mask |= FS_ISDIR;
196 201
197 if (!(file->f_mode & FMODE_NONOTIFY)) { 202 if (!(file->f_mode & FMODE_NONOTIFY)) {
198 fsnotify_parent(path, NULL, mask); 203 fsnotify_parent(path, NULL, mask);
@@ -210,7 +215,7 @@ static inline void fsnotify_modify(struct file *file)
210 __u32 mask = FS_MODIFY; 215 __u32 mask = FS_MODIFY;
211 216
212 if (S_ISDIR(inode->i_mode)) 217 if (S_ISDIR(inode->i_mode))
213 mask |= FS_IN_ISDIR; 218 mask |= FS_ISDIR;
214 219
215 if (!(file->f_mode & FMODE_NONOTIFY)) { 220 if (!(file->f_mode & FMODE_NONOTIFY)) {
216 fsnotify_parent(path, NULL, mask); 221 fsnotify_parent(path, NULL, mask);
@@ -228,12 +233,13 @@ static inline void fsnotify_open(struct file *file)
228 __u32 mask = FS_OPEN; 233 __u32 mask = FS_OPEN;
229 234
230 if (S_ISDIR(inode->i_mode)) 235 if (S_ISDIR(inode->i_mode))
231 mask |= FS_IN_ISDIR; 236 mask |= FS_ISDIR;
232 237
233 if (!(file->f_mode & FMODE_NONOTIFY)) { 238 /* FMODE_NONOTIFY must never be set from user */
234 fsnotify_parent(path, NULL, mask); 239 file->f_mode &= ~FMODE_NONOTIFY;
235 fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); 240
236 } 241 fsnotify_parent(path, NULL, mask);
242 fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0);
237} 243}
238 244
239/* 245/*
@@ -247,7 +253,7 @@ static inline void fsnotify_close(struct file *file)
247 __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; 253 __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE;
248 254
249 if (S_ISDIR(inode->i_mode)) 255 if (S_ISDIR(inode->i_mode))
250 mask |= FS_IN_ISDIR; 256 mask |= FS_ISDIR;
251 257
252 if (!(file->f_mode & FMODE_NONOTIFY)) { 258 if (!(file->f_mode & FMODE_NONOTIFY)) {
253 fsnotify_parent(path, NULL, mask); 259 fsnotify_parent(path, NULL, mask);
@@ -264,7 +270,7 @@ static inline void fsnotify_xattr(struct dentry *dentry)
264 __u32 mask = FS_ATTRIB; 270 __u32 mask = FS_ATTRIB;
265 271
266 if (S_ISDIR(inode->i_mode)) 272 if (S_ISDIR(inode->i_mode))
267 mask |= FS_IN_ISDIR; 273 mask |= FS_ISDIR;
268 274
269 fsnotify_parent(NULL, dentry, mask); 275 fsnotify_parent(NULL, dentry, mask);
270 fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); 276 fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0);
@@ -299,7 +305,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
299 305
300 if (mask) { 306 if (mask) {
301 if (S_ISDIR(inode->i_mode)) 307 if (S_ISDIR(inode->i_mode))
302 mask |= FS_IN_ISDIR; 308 mask |= FS_ISDIR;
303 309
304 fsnotify_parent(NULL, dentry, mask); 310 fsnotify_parent(NULL, dentry, mask);
305 fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); 311 fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0);
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index e40190d1687..0a68f924f06 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -45,7 +45,7 @@
45#define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */ 45#define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */
46 46
47#define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */ 47#define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */
48#define FS_IN_ISDIR 0x40000000 /* event occurred against dir */ 48#define FS_ISDIR 0x40000000 /* event occurred against dir */
49#define FS_IN_ONESHOT 0x80000000 /* only send event once */ 49#define FS_IN_ONESHOT 0x80000000 /* only send event once */
50 50
51#define FS_DN_RENAME 0x10000000 /* file renamed */ 51#define FS_DN_RENAME 0x10000000 /* file renamed */
@@ -64,13 +64,15 @@
64 64
65#define FS_MOVE (FS_MOVED_FROM | FS_MOVED_TO) 65#define FS_MOVE (FS_MOVED_FROM | FS_MOVED_TO)
66 66
67#define ALL_FSNOTIFY_PERM_EVENTS (FS_OPEN_PERM | FS_ACCESS_PERM)
68
67#define ALL_FSNOTIFY_EVENTS (FS_ACCESS | FS_MODIFY | FS_ATTRIB | \ 69#define ALL_FSNOTIFY_EVENTS (FS_ACCESS | FS_MODIFY | FS_ATTRIB | \
68 FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN | \ 70 FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN | \
69 FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE | \ 71 FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE | \
70 FS_DELETE | FS_DELETE_SELF | FS_MOVE_SELF | \ 72 FS_DELETE | FS_DELETE_SELF | FS_MOVE_SELF | \
71 FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \ 73 FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \
72 FS_OPEN_PERM | FS_ACCESS_PERM | FS_EXCL_UNLINK | \ 74 FS_OPEN_PERM | FS_ACCESS_PERM | FS_EXCL_UNLINK | \
73 FS_IN_ISDIR | FS_IN_ONESHOT | FS_DN_RENAME | \ 75 FS_ISDIR | FS_IN_ONESHOT | FS_DN_RENAME | \
74 FS_DN_MULTISHOT | FS_EVENT_ON_CHILD) 76 FS_DN_MULTISHOT | FS_EVENT_ON_CHILD)
75 77
76struct fsnotify_group; 78struct fsnotify_group;
@@ -129,6 +131,14 @@ struct fsnotify_group {
129 wait_queue_head_t notification_waitq; /* read() on the notification file blocks on this waitq */ 131 wait_queue_head_t notification_waitq; /* read() on the notification file blocks on this waitq */
130 unsigned int q_len; /* events on the queue */ 132 unsigned int q_len; /* events on the queue */
131 unsigned int max_events; /* maximum events allowed on the list */ 133 unsigned int max_events; /* maximum events allowed on the list */
134 /*
135 * Valid fsnotify group priorities. Events are send in order from highest
136 * priority to lowest priority. We default to the lowest priority.
137 */
138 #define FS_PRIO_0 0 /* normal notifiers, no permissions */
139 #define FS_PRIO_1 1 /* fanotify content based access control */
140 #define FS_PRIO_2 2 /* fanotify pre-content access */
141 unsigned int priority;
132 142
133 /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ 143 /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */
134 spinlock_t mark_lock; /* protect marks_list */ 144 spinlock_t mark_lock; /* protect marks_list */
@@ -159,6 +169,8 @@ struct fsnotify_group {
159 bool bypass_perm; /* protected by access_mutex */ 169 bool bypass_perm; /* protected by access_mutex */
160#endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ 170#endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */
161 int f_flags; 171 int f_flags;
172 unsigned int max_marks;
173 struct user_struct *user;
162 } fanotify_data; 174 } fanotify_data;
163#endif /* CONFIG_FANOTIFY */ 175#endif /* CONFIG_FANOTIFY */
164 }; 176 };
@@ -275,8 +287,8 @@ struct fsnotify_mark {
275 struct fsnotify_inode_mark i; 287 struct fsnotify_inode_mark i;
276 struct fsnotify_vfsmount_mark m; 288 struct fsnotify_vfsmount_mark m;
277 }; 289 };
278 __u32 ignored_mask; /* events types to ignore */
279 struct list_head free_g_list; /* tmp list used when freeing this mark */ 290 struct list_head free_g_list; /* tmp list used when freeing this mark */
291 __u32 ignored_mask; /* events types to ignore */
280#define FSNOTIFY_MARK_FLAG_INODE 0x01 292#define FSNOTIFY_MARK_FLAG_INODE 0x01
281#define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 293#define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02
282#define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04 294#define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04
@@ -294,7 +306,7 @@ struct fsnotify_mark {
294/* main fsnotify call to send events */ 306/* main fsnotify call to send events */
295extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, 307extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
296 const unsigned char *name, u32 cookie); 308 const unsigned char *name, u32 cookie);
297extern void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); 309extern int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask);
298extern void __fsnotify_inode_delete(struct inode *inode); 310extern void __fsnotify_inode_delete(struct inode *inode);
299extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); 311extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt);
300extern u32 fsnotify_get_cookie(void); 312extern u32 fsnotify_get_cookie(void);
@@ -423,8 +435,10 @@ static inline int fsnotify(struct inode *to_tell, __u32 mask, void *data, int da
423 return 0; 435 return 0;
424} 436}
425 437
426static inline void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) 438static inline int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask)
427{} 439{
440 return 0;
441}
428 442
429static inline void __fsnotify_inode_delete(struct inode *inode) 443static inline void __fsnotify_inode_delete(struct inode *inode)
430{} 444{}
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 361d1cc288d..b65a6f47277 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -53,9 +53,7 @@ struct gameport {
53#define to_gameport_port(d) container_of(d, struct gameport, dev) 53#define to_gameport_port(d) container_of(d, struct gameport, dev)
54 54
55struct gameport_driver { 55struct gameport_driver {
56 56 const char *description;
57 void *private;
58 char *description;
59 57
60 int (*connect)(struct gameport *, struct gameport_driver *drv); 58 int (*connect)(struct gameport *, struct gameport_driver *drv);
61 int (*reconnect)(struct gameport *); 59 int (*reconnect)(struct gameport *);
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 557c3927e70..7a7b9c1644e 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -140,7 +140,6 @@ struct disk_part_tbl {
140 struct rcu_head rcu_head; 140 struct rcu_head rcu_head;
141 int len; 141 int len;
142 struct hd_struct __rcu *last_lookup; 142 struct hd_struct __rcu *last_lookup;
143 struct gendisk *disk;
144 struct hd_struct __rcu *part[]; 143 struct hd_struct __rcu *part[];
145}; 144};
146 145
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 975609cb854..e8713d55360 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -9,6 +9,32 @@
9 9
10struct vm_area_struct; 10struct vm_area_struct;
11 11
12/* Plain integer GFP bitmasks. Do not use this directly. */
13#define ___GFP_DMA 0x01u
14#define ___GFP_HIGHMEM 0x02u
15#define ___GFP_DMA32 0x04u
16#define ___GFP_MOVABLE 0x08u
17#define ___GFP_WAIT 0x10u
18#define ___GFP_HIGH 0x20u
19#define ___GFP_IO 0x40u
20#define ___GFP_FS 0x80u
21#define ___GFP_COLD 0x100u
22#define ___GFP_NOWARN 0x200u
23#define ___GFP_REPEAT 0x400u
24#define ___GFP_NOFAIL 0x800u
25#define ___GFP_NORETRY 0x1000u
26#define ___GFP_COMP 0x4000u
27#define ___GFP_ZERO 0x8000u
28#define ___GFP_NOMEMALLOC 0x10000u
29#define ___GFP_HARDWALL 0x20000u
30#define ___GFP_THISNODE 0x40000u
31#define ___GFP_RECLAIMABLE 0x80000u
32#ifdef CONFIG_KMEMCHECK
33#define ___GFP_NOTRACK 0x200000u
34#else
35#define ___GFP_NOTRACK 0
36#endif
37
12/* 38/*
13 * GFP bitmasks.. 39 * GFP bitmasks..
14 * 40 *
@@ -18,10 +44,10 @@ struct vm_area_struct;
18 * without the underscores and use them consistently. The definitions here may 44 * without the underscores and use them consistently. The definitions here may
19 * be used in bit comparisons. 45 * be used in bit comparisons.
20 */ 46 */
21#define __GFP_DMA ((__force gfp_t)0x01u) 47#define __GFP_DMA ((__force gfp_t)___GFP_DMA)
22#define __GFP_HIGHMEM ((__force gfp_t)0x02u) 48#define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM)
23#define __GFP_DMA32 ((__force gfp_t)0x04u) 49#define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32)
24#define __GFP_MOVABLE ((__force gfp_t)0x08u) /* Page is movable */ 50#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* Page is movable */
25#define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) 51#define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE)
26/* 52/*
27 * Action modifiers - doesn't change the zoning 53 * Action modifiers - doesn't change the zoning
@@ -38,27 +64,22 @@ struct vm_area_struct;
38 * __GFP_MOVABLE: Flag that this page will be movable by the page migration 64 * __GFP_MOVABLE: Flag that this page will be movable by the page migration
39 * mechanism or reclaimed 65 * mechanism or reclaimed
40 */ 66 */
41#define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ 67#define __GFP_WAIT ((__force gfp_t)___GFP_WAIT) /* Can wait and reschedule? */
42#define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ 68#define __GFP_HIGH ((__force gfp_t)___GFP_HIGH) /* Should access emergency pools? */
43#define __GFP_IO ((__force gfp_t)0x40u) /* Can start physical IO? */ 69#define __GFP_IO ((__force gfp_t)___GFP_IO) /* Can start physical IO? */
44#define __GFP_FS ((__force gfp_t)0x80u) /* Can call down to low-level FS? */ 70#define __GFP_FS ((__force gfp_t)___GFP_FS) /* Can call down to low-level FS? */
45#define __GFP_COLD ((__force gfp_t)0x100u) /* Cache-cold page required */ 71#define __GFP_COLD ((__force gfp_t)___GFP_COLD) /* Cache-cold page required */
46#define __GFP_NOWARN ((__force gfp_t)0x200u) /* Suppress page allocation failure warning */ 72#define __GFP_NOWARN ((__force gfp_t)___GFP_NOWARN) /* Suppress page allocation failure warning */
47#define __GFP_REPEAT ((__force gfp_t)0x400u) /* See above */ 73#define __GFP_REPEAT ((__force gfp_t)___GFP_REPEAT) /* See above */
48#define __GFP_NOFAIL ((__force gfp_t)0x800u) /* See above */ 74#define __GFP_NOFAIL ((__force gfp_t)___GFP_NOFAIL) /* See above */
49#define __GFP_NORETRY ((__force gfp_t)0x1000u)/* See above */ 75#define __GFP_NORETRY ((__force gfp_t)___GFP_NORETRY) /* See above */
50#define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ 76#define __GFP_COMP ((__force gfp_t)___GFP_COMP) /* Add compound page metadata */
51#define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ 77#define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) /* Return zeroed page on success */
52#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ 78#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves */
53#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ 79#define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */
54#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ 80#define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */
55#define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ 81#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
56 82#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
57#ifdef CONFIG_KMEMCHECK
58#define __GFP_NOTRACK ((__force gfp_t)0x200000u) /* Don't track with kmemcheck */
59#else
60#define __GFP_NOTRACK ((__force gfp_t)0)
61#endif
62 83
63/* 84/*
64 * This may seem redundant, but it's a way of annotating false positives vs. 85 * This may seem redundant, but it's a way of annotating false positives vs.
@@ -186,14 +207,14 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
186#endif 207#endif
187 208
188#define GFP_ZONE_TABLE ( \ 209#define GFP_ZONE_TABLE ( \
189 (ZONE_NORMAL << 0 * ZONES_SHIFT) \ 210 (ZONE_NORMAL << 0 * ZONES_SHIFT) \
190 | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \ 211 | (OPT_ZONE_DMA << ___GFP_DMA * ZONES_SHIFT) \
191 | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \ 212 | (OPT_ZONE_HIGHMEM << ___GFP_HIGHMEM * ZONES_SHIFT) \
192 | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \ 213 | (OPT_ZONE_DMA32 << ___GFP_DMA32 * ZONES_SHIFT) \
193 | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \ 214 | (ZONE_NORMAL << ___GFP_MOVABLE * ZONES_SHIFT) \
194 | (OPT_ZONE_DMA << (__GFP_MOVABLE | __GFP_DMA) * ZONES_SHIFT) \ 215 | (OPT_ZONE_DMA << (___GFP_MOVABLE | ___GFP_DMA) * ZONES_SHIFT) \
195 | (ZONE_MOVABLE << (__GFP_MOVABLE | __GFP_HIGHMEM) * ZONES_SHIFT)\ 216 | (ZONE_MOVABLE << (___GFP_MOVABLE | ___GFP_HIGHMEM) * ZONES_SHIFT) \
196 | (OPT_ZONE_DMA32 << (__GFP_MOVABLE | __GFP_DMA32) * ZONES_SHIFT)\ 217 | (OPT_ZONE_DMA32 << (___GFP_MOVABLE | ___GFP_DMA32) * ZONES_SHIFT) \
197) 218)
198 219
199/* 220/*
@@ -203,20 +224,20 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
203 * allowed. 224 * allowed.
204 */ 225 */
205#define GFP_ZONE_BAD ( \ 226#define GFP_ZONE_BAD ( \
206 1 << (__GFP_DMA | __GFP_HIGHMEM) \ 227 1 << (___GFP_DMA | ___GFP_HIGHMEM) \
207 | 1 << (__GFP_DMA | __GFP_DMA32) \ 228 | 1 << (___GFP_DMA | ___GFP_DMA32) \
208 | 1 << (__GFP_DMA32 | __GFP_HIGHMEM) \ 229 | 1 << (___GFP_DMA32 | ___GFP_HIGHMEM) \
209 | 1 << (__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM) \ 230 | 1 << (___GFP_DMA | ___GFP_DMA32 | ___GFP_HIGHMEM) \
210 | 1 << (__GFP_MOVABLE | __GFP_HIGHMEM | __GFP_DMA) \ 231 | 1 << (___GFP_MOVABLE | ___GFP_HIGHMEM | ___GFP_DMA) \
211 | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA) \ 232 | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_DMA) \
212 | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_HIGHMEM) \ 233 | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_HIGHMEM) \
213 | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA | __GFP_HIGHMEM)\ 234 | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_DMA | ___GFP_HIGHMEM) \
214) 235)
215 236
216static inline enum zone_type gfp_zone(gfp_t flags) 237static inline enum zone_type gfp_zone(gfp_t flags)
217{ 238{
218 enum zone_type z; 239 enum zone_type z;
219 int bit = flags & GFP_ZONEMASK; 240 int bit = (__force int) (flags & GFP_ZONEMASK);
220 241
221 z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & 242 z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) &
222 ((1 << ZONES_SHIFT) - 1); 243 ((1 << ZONES_SHIFT) - 1);
diff --git a/include/linux/gpio-fan.h b/include/linux/gpio-fan.h
new file mode 100644
index 00000000000..09665916921
--- /dev/null
+++ b/include/linux/gpio-fan.h
@@ -0,0 +1,36 @@
1/*
2 * include/linux/gpio-fan.h
3 *
4 * Platform data structure for GPIO fan driver
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __LINUX_GPIO_FAN_H
12#define __LINUX_GPIO_FAN_H
13
14struct gpio_fan_alarm {
15 unsigned gpio;
16 unsigned active_low;
17};
18
19struct gpio_fan_speed {
20 int rpm;
21 int ctrl_val;
22};
23
24struct gpio_fan_platform_data {
25 int num_ctrl;
26 unsigned *ctrl; /* fan control GPIOs. */
27 struct gpio_fan_alarm *alarm; /* fan alarm GPIO. */
28 /*
29 * Speed conversion array: rpm from/to GPIO bit field.
30 * This array _must_ be sorted in ascending rpm order.
31 */
32 int num_speed;
33 struct gpio_fan_speed *speed;
34};
35
36#endif /* __LINUX_GPIO_FAN_H */
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 8a389b608ce..41cb31f14ee 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -96,11 +96,15 @@
96 */ 96 */
97#define in_nmi() (preempt_count() & NMI_MASK) 97#define in_nmi() (preempt_count() & NMI_MASK)
98 98
99#if defined(CONFIG_PREEMPT) 99#if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL)
100# define PREEMPT_INATOMIC_BASE kernel_locked() 100# define PREEMPT_INATOMIC_BASE kernel_locked()
101# define PREEMPT_CHECK_OFFSET 1
102#else 101#else
103# define PREEMPT_INATOMIC_BASE 0 102# define PREEMPT_INATOMIC_BASE 0
103#endif
104
105#if defined(CONFIG_PREEMPT)
106# define PREEMPT_CHECK_OFFSET 1
107#else
104# define PREEMPT_CHECK_OFFSET 0 108# define PREEMPT_CHECK_OFFSET 0
105#endif 109#endif
106 110
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 42a0f1d1136..bb0f56f5c01 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -316,6 +316,7 @@ struct hid_item {
316#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 316#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
317#define HID_QUIRK_NO_INIT_REPORTS 0x20000000 317#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
318#define HID_QUIRK_NO_IGNORE 0x40000000 318#define HID_QUIRK_NO_IGNORE 0x40000000
319#define HID_QUIRK_NO_INPUT_SYNC 0x80000000
319 320
320/* 321/*
321 * This is the global environment of the parser. This information is 322 * This is the global environment of the parser. This information is
@@ -626,8 +627,8 @@ struct hid_driver {
626 int (*event)(struct hid_device *hdev, struct hid_field *field, 627 int (*event)(struct hid_device *hdev, struct hid_field *field,
627 struct hid_usage *usage, __s32 value); 628 struct hid_usage *usage, __s32 value);
628 629
629 void (*report_fixup)(struct hid_device *hdev, __u8 *buf, 630 __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf,
630 unsigned int size); 631 unsigned int *size);
631 632
632 int (*input_mapping)(struct hid_device *hdev, 633 int (*input_mapping)(struct hid_device *hdev,
633 struct hid_input *hidinput, struct hid_field *field, 634 struct hid_input *hidinput, struct hid_field *field,
diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
index bb6f58baf31..a3f481a3063 100644
--- a/include/linux/hiddev.h
+++ b/include/linux/hiddev.h
@@ -226,8 +226,6 @@ void hiddev_disconnect(struct hid_device *);
226void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, 226void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
227 struct hid_usage *usage, __s32 value); 227 struct hid_usage *usage, __s32 value);
228void hiddev_report_event(struct hid_device *hid, struct hid_report *report); 228void hiddev_report_event(struct hid_device *hid, struct hid_report *report);
229int __init hiddev_init(void);
230void hiddev_exit(void);
231#else 229#else
232static inline int hiddev_connect(struct hid_device *hid, 230static inline int hiddev_connect(struct hid_device *hid,
233 unsigned int force) 231 unsigned int force)
@@ -236,8 +234,6 @@ static inline void hiddev_disconnect(struct hid_device *hid) { }
236static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, 234static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
237 struct hid_usage *usage, __s32 value) { } 235 struct hid_usage *usage, __s32 value) { }
238static inline void hiddev_report_event(struct hid_device *hid, struct hid_report *report) { } 236static inline void hiddev_report_event(struct hid_device *hid, struct hid_report *report) { }
239static inline int hiddev_init(void) { return 0; }
240static inline void hiddev_exit(void) { }
241#endif 237#endif
242 238
243#endif 239#endif
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index e3060ef85b6..e9138198e82 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -28,18 +28,6 @@ static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
28 28
29#include <asm/kmap_types.h> 29#include <asm/kmap_types.h>
30 30
31#ifdef CONFIG_DEBUG_HIGHMEM
32
33void debug_kmap_atomic(enum km_type type);
34
35#else
36
37static inline void debug_kmap_atomic(enum km_type type)
38{
39}
40
41#endif
42
43#ifdef CONFIG_HIGHMEM 31#ifdef CONFIG_HIGHMEM
44#include <asm/highmem.h> 32#include <asm/highmem.h>
45 33
@@ -66,19 +54,19 @@ static inline void kunmap(struct page *page)
66{ 54{
67} 55}
68 56
69static inline void *kmap_atomic(struct page *page, enum km_type idx) 57static inline void *__kmap_atomic(struct page *page)
70{ 58{
71 pagefault_disable(); 59 pagefault_disable();
72 return page_address(page); 60 return page_address(page);
73} 61}
74#define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) 62#define kmap_atomic_prot(page, prot) __kmap_atomic(page)
75 63
76static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx) 64static inline void __kunmap_atomic(void *addr)
77{ 65{
78 pagefault_enable(); 66 pagefault_enable();
79} 67}
80 68
81#define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) 69#define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn))
82#define kmap_atomic_to_page(ptr) virt_to_page(ptr) 70#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
83 71
84#define kmap_flush_unused() do {} while(0) 72#define kmap_flush_unused() do {} while(0)
@@ -86,12 +74,50 @@ static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx)
86 74
87#endif /* CONFIG_HIGHMEM */ 75#endif /* CONFIG_HIGHMEM */
88 76
89/* Prevent people trying to call kunmap_atomic() as if it were kunmap() */ 77#if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32)
90/* kunmap_atomic() should get the return value of kmap_atomic, not the page. */ 78
91#define kunmap_atomic(addr, idx) do { \ 79DECLARE_PER_CPU(int, __kmap_atomic_idx);
92 BUILD_BUG_ON(__same_type((addr), struct page *)); \ 80
93 kunmap_atomic_notypecheck((addr), (idx)); \ 81static inline int kmap_atomic_idx_push(void)
94 } while (0) 82{
83 int idx = __get_cpu_var(__kmap_atomic_idx)++;
84#ifdef CONFIG_DEBUG_HIGHMEM
85 WARN_ON_ONCE(in_irq() && !irqs_disabled());
86 BUG_ON(idx > KM_TYPE_NR);
87#endif
88 return idx;
89}
90
91static inline int kmap_atomic_idx(void)
92{
93 return __get_cpu_var(__kmap_atomic_idx) - 1;
94}
95
96static inline int kmap_atomic_idx_pop(void)
97{
98 int idx = --__get_cpu_var(__kmap_atomic_idx);
99#ifdef CONFIG_DEBUG_HIGHMEM
100 BUG_ON(idx < 0);
101#endif
102 return idx;
103}
104
105#endif
106
107/*
108 * Make both: kmap_atomic(page, idx) and kmap_atomic(page) work.
109 */
110#define kmap_atomic(page, args...) __kmap_atomic(page)
111
112/*
113 * Prevent people trying to call kunmap_atomic() as if it were kunmap()
114 * kunmap_atomic() should get the return value of kmap_atomic, not the page.
115 */
116#define kunmap_atomic(addr, args...) \
117do { \
118 BUILD_BUG_ON(__same_type((addr), struct page *)); \
119 __kunmap_atomic(addr); \
120} while (0)
95 121
96/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ 122/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */
97#ifndef clear_user_highpage 123#ifndef clear_user_highpage
@@ -201,8 +227,8 @@ static inline void copy_user_highpage(struct page *to, struct page *from,
201 vfrom = kmap_atomic(from, KM_USER0); 227 vfrom = kmap_atomic(from, KM_USER0);
202 vto = kmap_atomic(to, KM_USER1); 228 vto = kmap_atomic(to, KM_USER1);
203 copy_user_page(vto, vfrom, vaddr, to); 229 copy_user_page(vto, vfrom, vaddr, to);
204 kunmap_atomic(vfrom, KM_USER0);
205 kunmap_atomic(vto, KM_USER1); 230 kunmap_atomic(vto, KM_USER1);
231 kunmap_atomic(vfrom, KM_USER0);
206} 232}
207 233
208#endif 234#endif
@@ -214,8 +240,8 @@ static inline void copy_highpage(struct page *to, struct page *from)
214 vfrom = kmap_atomic(from, KM_USER0); 240 vfrom = kmap_atomic(from, KM_USER0);
215 vto = kmap_atomic(to, KM_USER1); 241 vto = kmap_atomic(to, KM_USER1);
216 copy_page(vto, vfrom); 242 copy_page(vto, vfrom);
217 kunmap_atomic(vfrom, KM_USER0);
218 kunmap_atomic(vto, KM_USER1); 243 kunmap_atomic(vto, KM_USER1);
244 kunmap_atomic(vfrom, KM_USER0);
219} 245}
220 246
221#endif /* _LINUX_HIGHMEM_H */ 247#endif /* _LINUX_HIGHMEM_H */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index f479700df61..943c76b3d4b 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -43,7 +43,8 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to,
43 struct vm_area_struct *vma, 43 struct vm_area_struct *vma,
44 int acctflags); 44 int acctflags);
45void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); 45void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
46void __isolate_hwpoisoned_huge_page(struct page *page); 46int dequeue_hwpoisoned_huge_page(struct page *page);
47void copy_huge_page(struct page *dst, struct page *src);
47 48
48extern unsigned long hugepages_treat_as_movable; 49extern unsigned long hugepages_treat_as_movable;
49extern const unsigned long hugetlb_zero, hugetlb_infinity; 50extern const unsigned long hugetlb_zero, hugetlb_infinity;
@@ -101,7 +102,10 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
101#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 102#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
102#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) 103#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; })
103#define huge_pte_offset(mm, address) 0 104#define huge_pte_offset(mm, address) 0
104#define __isolate_hwpoisoned_huge_page(page) 0 105#define dequeue_hwpoisoned_huge_page(page) 0
106static inline void copy_huge_page(struct page *dst, struct page *src)
107{
108}
105 109
106#define hugetlb_change_protection(vma, address, end, newprot) 110#define hugetlb_change_protection(vma, address, end, newprot)
107 111
@@ -228,6 +232,8 @@ struct huge_bootmem_page {
228 struct hstate *hstate; 232 struct hstate *hstate;
229}; 233};
230 234
235struct page *alloc_huge_page_node(struct hstate *h, int nid);
236
231/* arch callback */ 237/* arch callback */
232int __init alloc_bootmem_huge_page(struct hstate *h); 238int __init alloc_bootmem_huge_page(struct hstate *h);
233 239
@@ -301,8 +307,14 @@ static inline struct hstate *page_hstate(struct page *page)
301 return size_to_hstate(PAGE_SIZE << compound_order(page)); 307 return size_to_hstate(PAGE_SIZE << compound_order(page));
302} 308}
303 309
310static inline unsigned hstate_index_to_shift(unsigned index)
311{
312 return hstates[index].order + PAGE_SHIFT;
313}
314
304#else 315#else
305struct hstate {}; 316struct hstate {};
317#define alloc_huge_page_node(h, nid) NULL
306#define alloc_bootmem_huge_page(h) NULL 318#define alloc_bootmem_huge_page(h) NULL
307#define hstate_file(f) NULL 319#define hstate_file(f) NULL
308#define hstate_vma(v) NULL 320#define hstate_vma(v) NULL
@@ -317,6 +329,7 @@ static inline unsigned int pages_per_huge_page(struct hstate *h)
317{ 329{
318 return 1; 330 return 1;
319} 331}
332#define hstate_index_to_shift(index) 0
320#endif 333#endif
321 334
322#endif /* _LINUX_HUGETLB_H */ 335#endif /* _LINUX_HUGETLB_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 4bae0b72ed3..889b35abaed 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -384,11 +384,15 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
384 dev_set_drvdata(&dev->dev, data); 384 dev_set_drvdata(&dev->dev, data);
385} 385}
386 386
387static inline int i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) 387static inline struct i2c_adapter *
388i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
388{ 389{
389 return adapter->dev.parent != NULL 390 struct device *parent = adapter->dev.parent;
390 && adapter->dev.parent->bus == &i2c_bus_type 391
391 && adapter->dev.parent->type == &i2c_adapter_type; 392 if (parent != NULL && parent->type == &i2c_adapter_type)
393 return to_i2c_adapter(parent);
394 else
395 return NULL;
392} 396}
393 397
394/* Adapter locking functions, exported for shared pin cases */ 398/* Adapter locking functions, exported for shared pin cases */
@@ -403,8 +407,6 @@ void i2c_unlock_adapter(struct i2c_adapter *);
403 407
404/* i2c adapter classes (bitmask) */ 408/* i2c adapter classes (bitmask) */
405#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ 409#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */
406#define I2C_CLASS_TV_ANALOG (1<<1) /* bttv + friends */
407#define I2C_CLASS_TV_DIGITAL (1<<2) /* dvb cards */
408#define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ 410#define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */
409#define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ 411#define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */
410 412
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h
index 269181b8f62..3c5d6b6e765 100644
--- a/include/linux/i2c/adp5588.h
+++ b/include/linux/i2c/adp5588.h
@@ -74,6 +74,20 @@
74 74
75#define ADP5588_DEVICE_ID_MASK 0xF 75#define ADP5588_DEVICE_ID_MASK 0xF
76 76
77 /* Configuration Register1 */
78#define ADP5588_AUTO_INC (1 << 7)
79#define ADP5588_GPIEM_CFG (1 << 6)
80#define ADP5588_INT_CFG (1 << 4)
81#define ADP5588_GPI_IEN (1 << 1)
82
83/* Interrupt Status Register */
84#define ADP5588_GPI_INT (1 << 1)
85#define ADP5588_KE_INT (1 << 0)
86
87#define ADP5588_MAXGPIO 18
88#define ADP5588_BANK(offs) ((offs) >> 3)
89#define ADP5588_BIT(offs) (1u << ((offs) & 0x7))
90
77/* Put one of these structures in i2c_board_info platform_data */ 91/* Put one of these structures in i2c_board_info platform_data */
78 92
79#define ADP5588_KEYMAPSIZE 80 93#define ADP5588_KEYMAPSIZE 80
@@ -126,9 +140,12 @@ struct adp5588_kpad_platform_data {
126 const struct adp5588_gpio_platform_data *gpio_data; 140 const struct adp5588_gpio_platform_data *gpio_data;
127}; 141};
128 142
143struct i2c_client; /* forward declaration */
144
129struct adp5588_gpio_platform_data { 145struct adp5588_gpio_platform_data {
130 unsigned gpio_start; /* GPIO Chip base # */ 146 int gpio_start; /* GPIO Chip base # */
131 unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ 147 unsigned irq_base; /* interrupt base # */
148 unsigned pullup_dis_mask; /* Pull-Up Disable Mask */
132 int (*setup)(struct i2c_client *client, 149 int (*setup)(struct i2c_client *client,
133 int gpio, unsigned ngpio, 150 int gpio, unsigned ngpio,
134 void *context); 151 void *context);
diff --git a/include/linux/i2c/apds990x.h b/include/linux/i2c/apds990x.h
new file mode 100644
index 00000000000..d186fcc5d25
--- /dev/null
+++ b/include/linux/i2c/apds990x.h
@@ -0,0 +1,79 @@
1/*
2 * This file is part of the APDS990x sensor driver.
3 * Chip is combined proximity and ambient light sensor.
4 *
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 *
7 * Contact: Samu Onkalo <samu.p.onkalo@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef __APDS990X_H__
26#define __APDS990X_H__
27
28
29#define APDS_IRLED_CURR_12mA 0x3
30#define APDS_IRLED_CURR_25mA 0x2
31#define APDS_IRLED_CURR_50mA 0x1
32#define APDS_IRLED_CURR_100mA 0x0
33
34/**
35 * struct apds990x_chip_factors - defines effect of the cover window
36 * @ga: Total glass attenuation
37 * @cf1: clear channel factor 1 for raw to lux conversion
38 * @irf1: IR channel factor 1 for raw to lux conversion
39 * @cf2: clear channel factor 2 for raw to lux conversion
40 * @irf2: IR channel factor 2 for raw to lux conversion
41 * @df: device factor for conversion formulas
42 *
43 * Structure for tuning ALS calculation to match with environment.
44 * Values depend on the material above the sensor and the sensor
45 * itself. If the GA is zero, driver will use uncovered sensor default values
46 * format: decimal value * APDS_PARAM_SCALE except df which is plain integer.
47 */
48#define APDS_PARAM_SCALE 4096
49struct apds990x_chip_factors {
50 int ga;
51 int cf1;
52 int irf1;
53 int cf2;
54 int irf2;
55 int df;
56};
57
58/**
59 * struct apds990x_platform_data - platform data for apsd990x.c driver
60 * @cf: chip factor data
61 * @pddrive: IR-led driving current
62 * @ppcount: number of IR pulses used for proximity estimation
63 * @setup_resources: interrupt line setup call back function
64 * @release_resources: interrupt line release call back function
65 *
66 * Proximity detection result depends heavily on correct ppcount, pdrive
67 * and cover window.
68 *
69 */
70
71struct apds990x_platform_data {
72 struct apds990x_chip_factors cf;
73 u8 pdrive;
74 u8 ppcount;
75 int (*setup_resources)(void);
76 int (*release_resources)(void);
77};
78
79#endif
diff --git a/include/linux/i2c/bh1770glc.h b/include/linux/i2c/bh1770glc.h
new file mode 100644
index 00000000000..8b5e2df36c7
--- /dev/null
+++ b/include/linux/i2c/bh1770glc.h
@@ -0,0 +1,53 @@
1/*
2 * This file is part of the ROHM BH1770GLC / OSRAM SFH7770 sensor driver.
3 * Chip is combined proximity and ambient light sensor.
4 *
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 *
7 * Contact: Samu Onkalo <samu.p.onkalo@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef __BH1770_H__
26#define __BH1770_H__
27
28/**
29 * struct bh1770_platform_data - platform data for bh1770glc driver
30 * @led_def_curr: IR led driving current.
31 * @glass_attenuation: Attenuation factor for covering window.
32 * @setup_resources: Call back for interrupt line setup function
33 * @release_resources: Call back for interrupte line release function
34 *
35 * Example of glass attenuation: 16384 * 385 / 100 means attenuation factor
36 * of 3.85. i.e. light_above_sensor = light_above_cover_window / 3.85
37 */
38
39struct bh1770_platform_data {
40#define BH1770_LED_5mA 0
41#define BH1770_LED_10mA 1
42#define BH1770_LED_20mA 2
43#define BH1770_LED_50mA 3
44#define BH1770_LED_100mA 4
45#define BH1770_LED_150mA 5
46#define BH1770_LED_200mA 6
47 __u8 led_def_curr;
48#define BH1770_NEUTRAL_GA 16384 /* 16384 / 16384 = 1 */
49 __u32 glass_attenuation;
50 int (*setup_resources)(void);
51 int (*release_resources)(void);
52};
53#endif
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 6de90bfc6ac..c760991b354 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -141,6 +141,16 @@
141#define TWL6030_CHARGER_CTRL_INT_MASK 0x10 141#define TWL6030_CHARGER_CTRL_INT_MASK 0x10
142#define TWL6030_CHARGER_FAULT_INT_MASK 0x60 142#define TWL6030_CHARGER_FAULT_INT_MASK 0x60
143 143
144#define TWL6030_MMCCTRL 0xEE
145#define VMMC_AUTO_OFF (0x1 << 3)
146#define SW_FC (0x1 << 2)
147#define STS_MMC 0x1
148
149#define TWL6030_CFG_INPUT_PUPD3 0xF2
150#define MMC_PU (0x1 << 3)
151#define MMC_PD (0x1 << 2)
152
153
144 154
145#define TWL4030_CLASS_ID 0x4030 155#define TWL4030_CLASS_ID 0x4030
146#define TWL6030_CLASS_ID 0x6030 156#define TWL6030_CLASS_ID 0x6030
@@ -173,6 +183,27 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
173int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); 183int twl6030_interrupt_unmask(u8 bit_mask, u8 offset);
174int twl6030_interrupt_mask(u8 bit_mask, u8 offset); 184int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
175 185
186/* Card detect Configuration for MMC1 Controller on OMAP4 */
187#ifdef CONFIG_TWL4030_CORE
188int twl6030_mmc_card_detect_config(void);
189#else
190static inline int twl6030_mmc_card_detect_config(void)
191{
192 pr_debug("twl6030_mmc_card_detect_config not supported\n");
193 return 0;
194}
195#endif
196
197/* MMC1 Controller on OMAP4 uses Phoenix irq for Card detect */
198#ifdef CONFIG_TWL4030_CORE
199int twl6030_mmc_card_detect(struct device *dev, int slot);
200#else
201static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
202{
203 pr_debug("Call back twl6030_mmc_card_detect not supported\n");
204 return -EIO;
205}
206#endif
176/*----------------------------------------------------------------------*/ 207/*----------------------------------------------------------------------*/
177 208
178/* 209/*
@@ -357,6 +388,52 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
357 388
358/*----------------------------------------------------------------------*/ 389/*----------------------------------------------------------------------*/
359 390
391/*
392 * PM Master module register offsets (use TWL4030_MODULE_PM_MASTER)
393 */
394
395#define TWL4030_PM_MASTER_CFG_P1_TRANSITION 0x00
396#define TWL4030_PM_MASTER_CFG_P2_TRANSITION 0x01
397#define TWL4030_PM_MASTER_CFG_P3_TRANSITION 0x02
398#define TWL4030_PM_MASTER_CFG_P123_TRANSITION 0x03
399#define TWL4030_PM_MASTER_STS_BOOT 0x04
400#define TWL4030_PM_MASTER_CFG_BOOT 0x05
401#define TWL4030_PM_MASTER_SHUNDAN 0x06
402#define TWL4030_PM_MASTER_BOOT_BCI 0x07
403#define TWL4030_PM_MASTER_CFG_PWRANA1 0x08
404#define TWL4030_PM_MASTER_CFG_PWRANA2 0x09
405#define TWL4030_PM_MASTER_BACKUP_MISC_STS 0x0b
406#define TWL4030_PM_MASTER_BACKUP_MISC_CFG 0x0c
407#define TWL4030_PM_MASTER_BACKUP_MISC_TST 0x0d
408#define TWL4030_PM_MASTER_PROTECT_KEY 0x0e
409#define TWL4030_PM_MASTER_STS_HW_CONDITIONS 0x0f
410#define TWL4030_PM_MASTER_P1_SW_EVENTS 0x10
411#define TWL4030_PM_MASTER_P2_SW_EVENTS 0x11
412#define TWL4030_PM_MASTER_P3_SW_EVENTS 0x12
413#define TWL4030_PM_MASTER_STS_P123_STATE 0x13
414#define TWL4030_PM_MASTER_PB_CFG 0x14
415#define TWL4030_PM_MASTER_PB_WORD_MSB 0x15
416#define TWL4030_PM_MASTER_PB_WORD_LSB 0x16
417#define TWL4030_PM_MASTER_SEQ_ADD_W2P 0x1c
418#define TWL4030_PM_MASTER_SEQ_ADD_P2A 0x1d
419#define TWL4030_PM_MASTER_SEQ_ADD_A2W 0x1e
420#define TWL4030_PM_MASTER_SEQ_ADD_A2S 0x1f
421#define TWL4030_PM_MASTER_SEQ_ADD_S2A12 0x20
422#define TWL4030_PM_MASTER_SEQ_ADD_S2A3 0x21
423#define TWL4030_PM_MASTER_SEQ_ADD_WARM 0x22
424#define TWL4030_PM_MASTER_MEMORY_ADDRESS 0x23
425#define TWL4030_PM_MASTER_MEMORY_DATA 0x24
426
427#define TWL4030_PM_MASTER_KEY_CFG1 0xc0
428#define TWL4030_PM_MASTER_KEY_CFG2 0x0c
429
430#define TWL4030_PM_MASTER_KEY_TST1 0xe0
431#define TWL4030_PM_MASTER_KEY_TST2 0x0e
432
433#define TWL4030_PM_MASTER_GLOBAL_TST 0xb6
434
435/*----------------------------------------------------------------------*/
436
360/* Power bus message definitions */ 437/* Power bus message definitions */
361 438
362/* The TWL4030/5030 splits its power-management resources (the various 439/* The TWL4030/5030 splits its power-management resources (the various
@@ -553,8 +630,12 @@ extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
553extern int twl4030_remove_script(u8 flags); 630extern int twl4030_remove_script(u8 flags);
554 631
555struct twl4030_codec_audio_data { 632struct twl4030_codec_audio_data {
556 unsigned int audio_mclk; 633 unsigned int audio_mclk; /* not used, will be removed */
634 unsigned int digimic_delay; /* in ms */
557 unsigned int ramp_delay_value; 635 unsigned int ramp_delay_value;
636 unsigned int offset_cncl_path;
637 unsigned int check_defaults:1;
638 unsigned int reset_registers:1;
558 unsigned int hs_extmute:1; 639 unsigned int hs_extmute:1;
559 void (*set_hs_extmute)(int mute); 640 void (*set_hs_extmute)(int mute);
560}; 641};
diff --git a/include/linux/idr.h b/include/linux/idr.h
index cdb715e58e3..13a801f3d02 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -81,6 +81,7 @@ struct idr {
81#define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC) 81#define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC)
82 82
83/** 83/**
84 * DOC: idr sync
84 * idr synchronization (stolen from radix-tree.h) 85 * idr synchronization (stolen from radix-tree.h)
85 * 86 *
86 * idr_find() is able to be called locklessly, using RCU. The caller must 87 * idr_find() is able to be called locklessly, using RCU. The caller must
@@ -117,10 +118,13 @@ void idr_init(struct idr *idp);
117/* 118/*
118 * IDA - IDR based id allocator, use when translation from id to 119 * IDA - IDR based id allocator, use when translation from id to
119 * pointer isn't necessary. 120 * pointer isn't necessary.
121 *
122 * IDA_BITMAP_LONGS is calculated to be one less to accommodate
123 * ida_bitmap->nr_busy so that the whole struct fits in 128 bytes.
120 */ 124 */
121#define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */ 125#define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */
122#define IDA_BITMAP_LONGS (128 / sizeof(long) - 1) 126#define IDA_BITMAP_LONGS (IDA_CHUNK_SIZE / sizeof(long) - 1)
123#define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8) 127#define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8)
124 128
125struct ida_bitmap { 129struct ida_bitmap {
126 long nr_busy; 130 long nr_busy;
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 97b2eae6a22..ed5a03cbe18 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -986,6 +986,7 @@ struct ieee80211_ht_info {
986#define WLAN_AUTH_OPEN 0 986#define WLAN_AUTH_OPEN 0
987#define WLAN_AUTH_SHARED_KEY 1 987#define WLAN_AUTH_SHARED_KEY 1
988#define WLAN_AUTH_FT 2 988#define WLAN_AUTH_FT 2
989#define WLAN_AUTH_SAE 3
989#define WLAN_AUTH_LEAP 128 990#define WLAN_AUTH_LEAP 128
990 991
991#define WLAN_AUTH_CHALLENGE_LEN 128 992#define WLAN_AUTH_CHALLENGE_LEN 128
@@ -1072,6 +1073,10 @@ enum ieee80211_statuscode {
1072 WLAN_STATUS_NO_DIRECT_LINK = 48, 1073 WLAN_STATUS_NO_DIRECT_LINK = 48,
1073 WLAN_STATUS_STA_NOT_PRESENT = 49, 1074 WLAN_STATUS_STA_NOT_PRESENT = 49,
1074 WLAN_STATUS_STA_NOT_QSTA = 50, 1075 WLAN_STATUS_STA_NOT_QSTA = 50,
1076 /* 802.11s */
1077 WLAN_STATUS_ANTI_CLOG_REQUIRED = 76,
1078 WLAN_STATUS_FCG_NOT_SUPP = 78,
1079 WLAN_STATUS_STA_NO_TBTT = 78,
1075}; 1080};
1076 1081
1077 1082
@@ -1112,6 +1117,22 @@ enum ieee80211_reasoncode {
1112 WLAN_REASON_QSTA_REQUIRE_SETUP = 38, 1117 WLAN_REASON_QSTA_REQUIRE_SETUP = 38,
1113 WLAN_REASON_QSTA_TIMEOUT = 39, 1118 WLAN_REASON_QSTA_TIMEOUT = 39,
1114 WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45, 1119 WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45,
1120 /* 802.11s */
1121 WLAN_REASON_MESH_PEER_CANCELED = 52,
1122 WLAN_REASON_MESH_MAX_PEERS = 53,
1123 WLAN_REASON_MESH_CONFIG = 54,
1124 WLAN_REASON_MESH_CLOSE = 55,
1125 WLAN_REASON_MESH_MAX_RETRIES = 56,
1126 WLAN_REASON_MESH_CONFIRM_TIMEOUT = 57,
1127 WLAN_REASON_MESH_INVALID_GTK = 58,
1128 WLAN_REASON_MESH_INCONSISTENT_PARAM = 59,
1129 WLAN_REASON_MESH_INVALID_SECURITY = 60,
1130 WLAN_REASON_MESH_PATH_ERROR = 61,
1131 WLAN_REASON_MESH_PATH_NOFORWARD = 62,
1132 WLAN_REASON_MESH_PATH_DEST_UNREACHABLE = 63,
1133 WLAN_REASON_MAC_EXISTS_IN_MBSS = 64,
1134 WLAN_REASON_MESH_CHAN_REGULATORY = 65,
1135 WLAN_REASON_MESH_CHAN = 66,
1115}; 1136};
1116 1137
1117 1138
@@ -1139,20 +1160,33 @@ enum ieee80211_eid {
1139 WLAN_EID_TS_DELAY = 43, 1160 WLAN_EID_TS_DELAY = 43,
1140 WLAN_EID_TCLAS_PROCESSING = 44, 1161 WLAN_EID_TCLAS_PROCESSING = 44,
1141 WLAN_EID_QOS_CAPA = 46, 1162 WLAN_EID_QOS_CAPA = 46,
1142 /* 802.11s 1163 /* 802.11s */
1143 * 1164 WLAN_EID_MESH_CONFIG = 113,
1144 * All mesh EID numbers are pending IEEE 802.11 ANA approval. 1165 WLAN_EID_MESH_ID = 114,
1145 * The numbers have been incremented from those suggested in 1166 WLAN_EID_LINK_METRIC_REPORT = 115,
1146 * 802.11s/D2.0 so that MESH_CONFIG does not conflict with 1167 WLAN_EID_CONGESTION_NOTIFICATION = 116,
1147 * EXT_SUPP_RATES. 1168 /* Note that the Peer Link IE has been replaced with the similar
1169 * Peer Management IE. We will keep the former definition until mesh
1170 * code is changed to comply with latest 802.11s drafts.
1148 */ 1171 */
1149 WLAN_EID_MESH_CONFIG = 51, 1172 WLAN_EID_PEER_LINK = 55, /* no longer in 802.11s drafts */
1150 WLAN_EID_MESH_ID = 52, 1173 WLAN_EID_PEER_MGMT = 117,
1151 WLAN_EID_PEER_LINK = 55, 1174 WLAN_EID_CHAN_SWITCH_PARAM = 118,
1152 WLAN_EID_PREQ = 68, 1175 WLAN_EID_MESH_AWAKE_WINDOW = 119,
1153 WLAN_EID_PREP = 69, 1176 WLAN_EID_BEACON_TIMING = 120,
1154 WLAN_EID_PERR = 70, 1177 WLAN_EID_MCCAOP_SETUP_REQ = 121,
1155 WLAN_EID_RANN = 49, /* compatible with FreeBSD */ 1178 WLAN_EID_MCCAOP_SETUP_RESP = 122,
1179 WLAN_EID_MCCAOP_ADVERT = 123,
1180 WLAN_EID_MCCAOP_TEARDOWN = 124,
1181 WLAN_EID_GANN = 125,
1182 WLAN_EID_RANN = 126,
1183 WLAN_EID_PREQ = 130,
1184 WLAN_EID_PREP = 131,
1185 WLAN_EID_PERR = 132,
1186 WLAN_EID_PXU = 137,
1187 WLAN_EID_PXUC = 138,
1188 WLAN_EID_AUTH_MESH_PEER_EXCH = 139,
1189 WLAN_EID_MIC = 140,
1156 1190
1157 WLAN_EID_PWR_CONSTRAINT = 32, 1191 WLAN_EID_PWR_CONSTRAINT = 32,
1158 WLAN_EID_PWR_CAPABILITY = 33, 1192 WLAN_EID_PWR_CAPABILITY = 33,
@@ -1211,9 +1245,14 @@ enum ieee80211_category {
1211 WLAN_CATEGORY_HT = 7, 1245 WLAN_CATEGORY_HT = 7,
1212 WLAN_CATEGORY_SA_QUERY = 8, 1246 WLAN_CATEGORY_SA_QUERY = 8,
1213 WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, 1247 WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
1248 WLAN_CATEGORY_MESH_ACTION = 13,
1249 WLAN_CATEGORY_MULTIHOP_ACTION = 14,
1250 WLAN_CATEGORY_SELF_PROTECTED = 15,
1214 WLAN_CATEGORY_WMM = 17, 1251 WLAN_CATEGORY_WMM = 17,
1215 WLAN_CATEGORY_MESH_PLINK = 30, /* Pending ANA approval */ 1252 /* TODO: remove MESH_PLINK and MESH_PATH_SEL after */
1216 WLAN_CATEGORY_MESH_PATH_SEL = 32, /* Pending ANA approval */ 1253 /* mesh is updated to current 802.11s draft */
1254 WLAN_CATEGORY_MESH_PLINK = 30,
1255 WLAN_CATEGORY_MESH_PATH_SEL = 32,
1217 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, 1256 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
1218 WLAN_CATEGORY_VENDOR_SPECIFIC = 127, 1257 WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
1219}; 1258};
@@ -1351,6 +1390,8 @@ enum ieee80211_sa_query_action {
1351/* AKM suite selectors */ 1390/* AKM suite selectors */
1352#define WLAN_AKM_SUITE_8021X 0x000FAC01 1391#define WLAN_AKM_SUITE_8021X 0x000FAC01
1353#define WLAN_AKM_SUITE_PSK 0x000FAC02 1392#define WLAN_AKM_SUITE_PSK 0x000FAC02
1393#define WLAN_AKM_SUITE_SAE 0x000FAC08
1394#define WLAN_AKM_SUITE_FT_OVER_SAE 0x000FAC09
1354 1395
1355#define WLAN_MAX_KEY_LEN 32 1396#define WLAN_MAX_KEY_LEN 32
1356 1397
diff --git a/include/linux/if.h b/include/linux/if.h
index 53558ec59e1..12395992774 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -75,6 +75,8 @@
75#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */ 75#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */
76#define IFF_MACVLAN_PORT 0x4000 /* device used as macvlan port */ 76#define IFF_MACVLAN_PORT 0x4000 /* device used as macvlan port */
77#define IFF_BRIDGE_PORT 0x8000 /* device used as bridge port */ 77#define IFF_BRIDGE_PORT 0x8000 /* device used as bridge port */
78#define IFF_OVS_DATAPATH 0x10000 /* device used as Open vSwitch
79 * datapath port */
78 80
79#define IF_GET_IFACE 0x0001 /* for querying only */ 81#define IF_GET_IFACE 0x0001 /* for querying only */
80#define IF_GET_PROTO 0x0002 82#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h
index 2c7994372bd..a17edda8a78 100644
--- a/include/linux/if_bonding.h
+++ b/include/linux/if_bonding.h
@@ -84,6 +84,9 @@
84#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ 84#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */
85 85
86#define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */ 86#define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */
87
88#define BOND_DEFAULT_RESEND_IGMP 1 /* Default number of IGMP membership reports */
89
87/* hashing types */ 90/* hashing types */
88#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */ 91#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */
89#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */ 92#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index bed7a4682b9..f9c3df03db0 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -137,8 +137,6 @@ extern struct ctl_table ether_table[];
137 137
138extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); 138extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
139 139
140#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
141
142#endif 140#endif
143 141
144#endif /* _LINUX_IF_ETHER_H */ 142#endif /* _LINUX_IF_ETHER_H */
diff --git a/include/linux/if_infiniband.h b/include/linux/if_infiniband.h
index 3e659ec7dfd..7d958475d4a 100644
--- a/include/linux/if_infiniband.h
+++ b/include/linux/if_infiniband.h
@@ -5,7 +5,7 @@
5 * <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD 5 * <http://www.fsf.org/copyleft/gpl.html>, or the OpenIB.org BSD
6 * license, available in the LICENSE.TXT file accompanying this 6 * license, available in the LICENSE.TXT file accompanying this
7 * software. These details are also available at 7 * software. These details are also available at
8 * <http://openib.org/license.html>. 8 * <http://www.openfabrics.org/software_license.htm>.
9 * 9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 35280b30229..8a2fd66a8b5 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -40,6 +40,12 @@ struct macvlan_rx_stats {
40 unsigned long rx_errors; 40 unsigned long rx_errors;
41}; 41};
42 42
43/*
44 * Maximum times a macvtap device can be opened. This can be used to
45 * configure the number of receive queue, e.g. for multiqueue virtio.
46 */
47#define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16)
48
43struct macvlan_dev { 49struct macvlan_dev {
44 struct net_device *dev; 50 struct net_device *dev;
45 struct list_head list; 51 struct list_head list;
@@ -50,7 +56,8 @@ struct macvlan_dev {
50 enum macvlan_mode mode; 56 enum macvlan_mode mode;
51 int (*receive)(struct sk_buff *skb); 57 int (*receive)(struct sk_buff *skb);
52 int (*forward)(struct net_device *dev, struct sk_buff *skb); 58 int (*forward)(struct net_device *dev, struct sk_buff *skb);
53 struct macvtap_queue *tap; 59 struct macvtap_queue *taps[MAX_MACVTAP_QUEUES];
60 int numvtaps;
54}; 61};
55 62
56static inline void macvlan_count_rx(const struct macvlan_dev *vlan, 63static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 27741e05446..397921b09ef 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -40,25 +40,35 @@
40 * PPPoE addressing definition 40 * PPPoE addressing definition
41 */ 41 */
42typedef __be16 sid_t; 42typedef __be16 sid_t;
43struct pppoe_addr{ 43struct pppoe_addr {
44 sid_t sid; /* Session identifier */ 44 sid_t sid; /* Session identifier */
45 unsigned char remote[ETH_ALEN]; /* Remote address */ 45 unsigned char remote[ETH_ALEN]; /* Remote address */
46 char dev[IFNAMSIZ]; /* Local device to use */ 46 char dev[IFNAMSIZ]; /* Local device to use */
47}; 47};
48 48
49/************************************************************************ 49/************************************************************************
50 * Protocols supported by AF_PPPOX 50 * PPTP addressing definition
51 */ 51 */
52struct pptp_addr {
53 __be16 call_id;
54 struct in_addr sin_addr;
55};
56
57/************************************************************************
58 * Protocols supported by AF_PPPOX
59 */
52#define PX_PROTO_OE 0 /* Currently just PPPoE */ 60#define PX_PROTO_OE 0 /* Currently just PPPoE */
53#define PX_PROTO_OL2TP 1 /* Now L2TP also */ 61#define PX_PROTO_OL2TP 1 /* Now L2TP also */
54#define PX_MAX_PROTO 2 62#define PX_PROTO_PPTP 2
55 63#define PX_MAX_PROTO 3
56struct sockaddr_pppox { 64
57 sa_family_t sa_family; /* address family, AF_PPPOX */ 65struct sockaddr_pppox {
58 unsigned int sa_protocol; /* protocol identifier */ 66 sa_family_t sa_family; /* address family, AF_PPPOX */
59 union{ 67 unsigned int sa_protocol; /* protocol identifier */
60 struct pppoe_addr pppoe; 68 union {
61 }sa_addr; 69 struct pppoe_addr pppoe;
70 struct pptp_addr pptp;
71 } sa_addr;
62} __attribute__((packed)); 72} __attribute__((packed));
63 73
64/* The use of the above union isn't viable because the size of this 74/* The use of the above union isn't viable because the size of this
@@ -150,15 +160,23 @@ struct pppoe_opt {
150 relayed to (PPPoE relaying) */ 160 relayed to (PPPoE relaying) */
151}; 161};
152 162
163struct pptp_opt {
164 struct pptp_addr src_addr;
165 struct pptp_addr dst_addr;
166 u32 ack_sent, ack_recv;
167 u32 seq_sent, seq_recv;
168 int ppp_flags;
169};
153#include <net/sock.h> 170#include <net/sock.h>
154 171
155struct pppox_sock { 172struct pppox_sock {
156 /* struct sock must be the first member of pppox_sock */ 173 /* struct sock must be the first member of pppox_sock */
157 struct sock sk; 174 struct sock sk;
158 struct ppp_channel chan; 175 struct ppp_channel chan;
159 struct pppox_sock *next; /* for hash table */ 176 struct pppox_sock *next; /* for hash table */
160 union { 177 union {
161 struct pppoe_opt pppoe; 178 struct pppoe_opt pppoe;
179 struct pptp_opt pptp;
162 } proto; 180 } proto;
163 __be16 num; 181 __be16 num;
164}; 182};
@@ -186,7 +204,7 @@ struct pppox_proto {
186 struct module *owner; 204 struct module *owner;
187}; 205};
188 206
189extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); 207extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp);
190extern void unregister_pppox_proto(int proto_num); 208extern void unregister_pppox_proto(int proto_num);
191extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ 209extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
192extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 210extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 3d870fda8c4..c2f3a72712c 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -16,6 +16,7 @@
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17#include <linux/netdevice.h> 17#include <linux/netdevice.h>
18#include <linux/etherdevice.h> 18#include <linux/etherdevice.h>
19#include <linux/rtnetlink.h>
19 20
20#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) 21#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header)
21 * that VLAN requires. 22 * that VLAN requires.
@@ -68,6 +69,7 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
68#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */ 69#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */
69#define VLAN_TAG_PRESENT VLAN_CFI_MASK 70#define VLAN_TAG_PRESENT VLAN_CFI_MASK
70#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */ 71#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */
72#define VLAN_N_VID 4096
71 73
72/* found in socket.c */ 74/* found in socket.c */
73extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); 75extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
@@ -76,9 +78,8 @@ extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
76 * depends on completely exhausting the VLAN identifier space. Thus 78 * depends on completely exhausting the VLAN identifier space. Thus
77 * it gives constant time look-up, but in many cases it wastes memory. 79 * it gives constant time look-up, but in many cases it wastes memory.
78 */ 80 */
79#define VLAN_GROUP_ARRAY_LEN 4096
80#define VLAN_GROUP_ARRAY_SPLIT_PARTS 8 81#define VLAN_GROUP_ARRAY_SPLIT_PARTS 8
81#define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS) 82#define VLAN_GROUP_ARRAY_PART_LEN (VLAN_N_VID/VLAN_GROUP_ARRAY_SPLIT_PARTS)
82 83
83struct vlan_group { 84struct vlan_group {
84 struct net_device *real_dev; /* The ethernet(like) device 85 struct net_device *real_dev; /* The ethernet(like) device
@@ -114,12 +115,24 @@ static inline void vlan_group_set_device(struct vlan_group *vg,
114#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 115#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
115 116
116#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 117#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
118/* Must be invoked with rcu_read_lock or with RTNL. */
119static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
120 u16 vlan_id)
121{
122 struct vlan_group *grp = rcu_dereference_rtnl(real_dev->vlgrp);
123
124 if (grp)
125 return vlan_group_get_device(grp, vlan_id);
126
127 return NULL;
128}
129
117extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 130extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
118extern u16 vlan_dev_vlan_id(const struct net_device *dev); 131extern u16 vlan_dev_vlan_id(const struct net_device *dev);
119 132
120extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, 133extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
121 u16 vlan_tci, int polling); 134 u16 vlan_tci, int polling);
122extern int vlan_hwaccel_do_receive(struct sk_buff *skb); 135extern bool vlan_hwaccel_do_receive(struct sk_buff **skb);
123extern gro_result_t 136extern gro_result_t
124vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 137vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
125 unsigned int vlan_tci, struct sk_buff *skb); 138 unsigned int vlan_tci, struct sk_buff *skb);
@@ -128,6 +141,12 @@ vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
128 unsigned int vlan_tci); 141 unsigned int vlan_tci);
129 142
130#else 143#else
144static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
145 u16 vlan_id)
146{
147 return NULL;
148}
149
131static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) 150static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
132{ 151{
133 BUG(); 152 BUG();
@@ -147,9 +166,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
147 return NET_XMIT_SUCCESS; 166 return NET_XMIT_SUCCESS;
148} 167}
149 168
150static inline int vlan_hwaccel_do_receive(struct sk_buff *skb) 169static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb)
151{ 170{
152 return 0; 171 if ((*skb)->vlan_tci & VLAN_VID_MASK)
172 (*skb)->pkt_type = PACKET_OTHERHOST;
173 return false;
153} 174}
154 175
155static inline gro_result_t 176static inline gro_result_t
diff --git a/include/linux/in.h b/include/linux/in.h
index 41d88a4689a..beeb6dee2b4 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -250,6 +250,25 @@ struct sockaddr_in {
250 250
251#ifdef __KERNEL__ 251#ifdef __KERNEL__
252 252
253#include <linux/errno.h>
254
255static inline int proto_ports_offset(int proto)
256{
257 switch (proto) {
258 case IPPROTO_TCP:
259 case IPPROTO_UDP:
260 case IPPROTO_DCCP:
261 case IPPROTO_ESP: /* SPI */
262 case IPPROTO_SCTP:
263 case IPPROTO_UDPLITE:
264 return 0;
265 case IPPROTO_AH: /* SPI */
266 return 4;
267 default:
268 return -EINVAL;
269 }
270}
271
253static inline bool ipv4_is_loopback(__be32 addr) 272static inline bool ipv4_is_loopback(__be32 addr)
254{ 273{
255 return (addr & htonl(0xff000000)) == htonl(0x7f000000); 274 return (addr & htonl(0xff000000)) == htonl(0x7f000000);
diff --git a/include/linux/in6.h b/include/linux/in6.h
index c4bf46f764b..097a34b5556 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -268,6 +268,10 @@ struct in6_flowlabel_req {
268/* RFC5082: Generalized Ttl Security Mechanism */ 268/* RFC5082: Generalized Ttl Security Mechanism */
269#define IPV6_MINHOPCOUNT 73 269#define IPV6_MINHOPCOUNT 73
270 270
271#define IPV6_ORIGDSTADDR 74
272#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
273#define IPV6_TRANSPARENT 75
274
271/* 275/*
272 * Multicast Routing: 276 * Multicast Routing:
273 * see include/linux/mroute6.h. 277 * see include/linux/mroute6.h.
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 2be1a1a2beb..ccd5b07d678 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -9,6 +9,7 @@
9#include <linux/rcupdate.h> 9#include <linux/rcupdate.h>
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h> 11#include <linux/sysctl.h>
12#include <linux/rtnetlink.h>
12 13
13enum 14enum
14{ 15{
@@ -158,7 +159,12 @@ struct in_ifaddr {
158extern int register_inetaddr_notifier(struct notifier_block *nb); 159extern int register_inetaddr_notifier(struct notifier_block *nb);
159extern int unregister_inetaddr_notifier(struct notifier_block *nb); 160extern int unregister_inetaddr_notifier(struct notifier_block *nb);
160 161
161extern struct net_device *ip_dev_find(struct net *net, __be32 addr); 162extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref);
163static inline struct net_device *ip_dev_find(struct net *net, __be32 addr)
164{
165 return __ip_dev_find(net, addr, true);
166}
167
162extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); 168extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
163extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); 169extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
164extern void devinet_init(void); 170extern void devinet_init(void);
@@ -198,14 +204,10 @@ static __inline__ int bad_mask(__be32 mask, __be32 addr)
198 204
199static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) 205static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev)
200{ 206{
201 struct in_device *in_dev = dev->ip_ptr; 207 return rcu_dereference(dev->ip_ptr);
202 if (in_dev)
203 in_dev = rcu_dereference(in_dev);
204 return in_dev;
205} 208}
206 209
207static __inline__ struct in_device * 210static inline struct in_device *in_dev_get(const struct net_device *dev)
208in_dev_get(const struct net_device *dev)
209{ 211{
210 struct in_device *in_dev; 212 struct in_device *in_dev;
211 213
@@ -217,10 +219,9 @@ in_dev_get(const struct net_device *dev)
217 return in_dev; 219 return in_dev;
218} 220}
219 221
220static __inline__ struct in_device * 222static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev)
221__in_dev_get_rtnl(const struct net_device *dev)
222{ 223{
223 return (struct in_device*)dev->ip_ptr; 224 return rcu_dereference_check(dev->ip_ptr, lockdep_rtnl_is_held());
224} 225}
225 226
226extern void in_dev_finish_destroy(struct in_device *idev); 227extern void in_dev_finish_destroy(struct in_device *idev);
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 2fea6c8ef6b..1f8c06ce0fa 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -29,6 +29,8 @@ extern struct fs_struct init_fs;
29 .running = 0, \ 29 .running = 0, \
30 .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ 30 .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \
31 }, \ 31 }, \
32 .cred_guard_mutex = \
33 __MUTEX_INITIALIZER(sig.cred_guard_mutex), \
32} 34}
33 35
34extern struct nsproxy init_nsproxy; 36extern struct nsproxy init_nsproxy;
@@ -145,8 +147,6 @@ extern struct cred init_cred;
145 .group_leader = &tsk, \ 147 .group_leader = &tsk, \
146 RCU_INIT_POINTER(.real_cred, &init_cred), \ 148 RCU_INIT_POINTER(.real_cred, &init_cred), \
147 RCU_INIT_POINTER(.cred, &init_cred), \ 149 RCU_INIT_POINTER(.cred, &init_cred), \
148 .cred_guard_mutex = \
149 __MUTEX_INITIALIZER(tsk.cred_guard_mutex), \
150 .comm = "swapper", \ 150 .comm = "swapper", \
151 .thread = INIT_THREAD, \ 151 .thread = INIT_THREAD, \
152 .fs = &init_fs, \ 152 .fs = &init_fs, \
diff --git a/include/linux/input.h b/include/linux/input.h
index d6ae1761be9..51af441f3a2 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -34,7 +34,7 @@ struct input_event {
34 * Protocol version. 34 * Protocol version.
35 */ 35 */
36 36
37#define EV_VERSION 0x010000 37#define EV_VERSION 0x010001
38 38
39/* 39/*
40 * IOCTLs (0x00 - 0x7f) 40 * IOCTLs (0x00 - 0x7f)
@@ -56,25 +56,50 @@ struct input_absinfo {
56 __s32 resolution; 56 __s32 resolution;
57}; 57};
58 58
59/**
60 * struct input_keymap_entry - used by EVIOCGKEYCODE/EVIOCSKEYCODE ioctls
61 * @scancode: scancode represented in machine-endian form.
62 * @len: length of the scancode that resides in @scancode buffer.
63 * @index: index in the keymap, may be used instead of scancode
64 * @flags: allows to specify how kernel should handle the request. For
65 * example, setting INPUT_KEYMAP_BY_INDEX flag indicates that kernel
66 * should perform lookup in keymap by @index instead of @scancode
67 * @keycode: key code assigned to this scancode
68 *
69 * The structure is used to retrieve and modify keymap data. Users have
70 * option of performing lookup either by @scancode itself or by @index
71 * in keymap entry. EVIOCGKEYCODE will also return scancode or index
72 * (depending on which element was used to perform lookup).
73 */
74struct input_keymap_entry {
75#define INPUT_KEYMAP_BY_INDEX (1 << 0)
76 __u8 flags;
77 __u8 len;
78 __u16 index;
79 __u32 keycode;
80 __u8 scancode[32];
81};
82
59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ 83#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ 84#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
61#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ 85#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */
62#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ 86#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */
63#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */ 87
64#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */ 88#define EVIOCGKEYCODE _IOR('E', 0x04, struct input_keymap_entry) /* get keycode */
89#define EVIOCSKEYCODE _IOW('E', 0x04, struct input_keymap_entry) /* set keycode */
65 90
66#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ 91#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
67#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ 92#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
68#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ 93#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */
69 94
70#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ 95#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */
71#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ 96#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
72#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ 97#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
73#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ 98#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
74 99
75#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ 100#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
76#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ 101#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */
77#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ 102#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */
78 103
79#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ 104#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
80#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ 105#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
@@ -1088,13 +1113,13 @@ struct input_mt_slot {
1088 * @keycodemax: size of keycode table 1113 * @keycodemax: size of keycode table
1089 * @keycodesize: size of elements in keycode table 1114 * @keycodesize: size of elements in keycode table
1090 * @keycode: map of scancodes to keycodes for this device 1115 * @keycode: map of scancodes to keycodes for this device
1116 * @getkeycode: optional legacy method to retrieve current keymap.
1091 * @setkeycode: optional method to alter current keymap, used to implement 1117 * @setkeycode: optional method to alter current keymap, used to implement
1092 * sparse keymaps. If not supplied default mechanism will be used. 1118 * sparse keymaps. If not supplied default mechanism will be used.
1093 * The method is being called while holding event_lock and thus must 1119 * The method is being called while holding event_lock and thus must
1094 * not sleep 1120 * not sleep
1095 * @getkeycode: optional method to retrieve current keymap. If not supplied 1121 * @getkeycode_new: transition method
1096 * default mechanism will be used. The method is being called while 1122 * @setkeycode_new: transition method
1097 * holding event_lock and thus must not sleep
1098 * @ff: force feedback structure associated with the device if device 1123 * @ff: force feedback structure associated with the device if device
1099 * supports force feedback effects 1124 * supports force feedback effects
1100 * @repeat_key: stores key code of the last key pressed; used to implement 1125 * @repeat_key: stores key code of the last key pressed; used to implement
@@ -1168,10 +1193,16 @@ struct input_dev {
1168 unsigned int keycodemax; 1193 unsigned int keycodemax;
1169 unsigned int keycodesize; 1194 unsigned int keycodesize;
1170 void *keycode; 1195 void *keycode;
1196
1171 int (*setkeycode)(struct input_dev *dev, 1197 int (*setkeycode)(struct input_dev *dev,
1172 unsigned int scancode, unsigned int keycode); 1198 unsigned int scancode, unsigned int keycode);
1173 int (*getkeycode)(struct input_dev *dev, 1199 int (*getkeycode)(struct input_dev *dev,
1174 unsigned int scancode, unsigned int *keycode); 1200 unsigned int scancode, unsigned int *keycode);
1201 int (*setkeycode_new)(struct input_dev *dev,
1202 const struct input_keymap_entry *ke,
1203 unsigned int *old_keycode);
1204 int (*getkeycode_new)(struct input_dev *dev,
1205 struct input_keymap_entry *ke);
1175 1206
1176 struct ff_device *ff; 1207 struct ff_device *ff;
1177 1208
@@ -1478,10 +1509,12 @@ INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz)
1478INPUT_GENERATE_ABS_ACCESSORS(flat, flat) 1509INPUT_GENERATE_ABS_ACCESSORS(flat, flat)
1479INPUT_GENERATE_ABS_ACCESSORS(res, resolution) 1510INPUT_GENERATE_ABS_ACCESSORS(res, resolution)
1480 1511
1481int input_get_keycode(struct input_dev *dev, 1512int input_scancode_to_scalar(const struct input_keymap_entry *ke,
1482 unsigned int scancode, unsigned int *keycode); 1513 unsigned int *scancode);
1514
1515int input_get_keycode(struct input_dev *dev, struct input_keymap_entry *ke);
1483int input_set_keycode(struct input_dev *dev, 1516int input_set_keycode(struct input_dev *dev,
1484 unsigned int scancode, unsigned int keycode); 1517 const struct input_keymap_entry *ke);
1485 1518
1486extern struct class input_class; 1519extern struct class input_class;
1487 1520
diff --git a/include/linux/input/bu21013.h b/include/linux/input/bu21013.h
new file mode 100644
index 00000000000..e470d387dd4
--- /dev/null
+++ b/include/linux/input/bu21013.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 * Author: Naveen Kumar G <naveen.gaddipati@stericsson.com> for ST-Ericsson
4 * License terms:GNU General Public License (GPL) version 2
5 */
6
7#ifndef _BU21013_H
8#define _BU21013_H
9
10/**
11 * struct bu21013_platform_device - Handle the platform data
12 * @cs_en: pointer to the cs enable function
13 * @cs_dis: pointer to the cs disable function
14 * @irq_read_val: pointer to read the pen irq value function
15 * @x_max_res: xmax resolution
16 * @y_max_res: ymax resolution
17 * @touch_x_max: touch x max
18 * @touch_y_max: touch y max
19 * @cs_pin: chip select pin
20 * @irq: irq pin
21 * @ext_clk: external clock flag
22 * @x_flip: x flip flag
23 * @y_flip: y flip flag
24 * @wakeup: wakeup flag
25 *
26 * This is used to handle the platform data
27 */
28struct bu21013_platform_device {
29 int (*cs_en)(int reset_pin);
30 int (*cs_dis)(int reset_pin);
31 int (*irq_read_val)(void);
32 int x_max_res;
33 int y_max_res;
34 int touch_x_max;
35 int touch_y_max;
36 unsigned int cs_pin;
37 unsigned int irq;
38 bool ext_clk;
39 bool x_flip;
40 bool y_flip;
41 bool wakeup;
42};
43
44#endif
diff --git a/include/linux/intel_mid_dma.h b/include/linux/intel_mid_dma.h
index d9d08b6269b..10496bd24c5 100644
--- a/include/linux/intel_mid_dma.h
+++ b/include/linux/intel_mid_dma.h
@@ -27,14 +27,7 @@
27 27
28#include <linux/dmaengine.h> 28#include <linux/dmaengine.h>
29 29
30/*DMA transaction width, src and dstn width would be same 30#define DMA_PREP_CIRCULAR_LIST (1 << 10)
31The DMA length must be width aligned,
32for 32 bit width the length must be 32 bit (4bytes) aligned only*/
33enum intel_mid_dma_width {
34 LNW_DMA_WIDTH_8BIT = 0x0,
35 LNW_DMA_WIDTH_16BIT = 0x1,
36 LNW_DMA_WIDTH_32BIT = 0x2,
37};
38 31
39/*DMA mode configurations*/ 32/*DMA mode configurations*/
40enum intel_mid_dma_mode { 33enum intel_mid_dma_mode {
@@ -69,18 +62,15 @@ enum intel_mid_dma_msize {
69 * @cfg_mode: DMA data transfer mode (per-per/mem-per/mem-mem) 62 * @cfg_mode: DMA data transfer mode (per-per/mem-per/mem-mem)
70 * @src_msize: Source DMA burst size 63 * @src_msize: Source DMA burst size
71 * @dst_msize: Dst DMA burst size 64 * @dst_msize: Dst DMA burst size
65 * @per_addr: Periphral address
72 * @device_instance: DMA peripheral device instance, we can have multiple 66 * @device_instance: DMA peripheral device instance, we can have multiple
73 * peripheral device connected to single DMAC 67 * peripheral device connected to single DMAC
74 */ 68 */
75struct intel_mid_dma_slave { 69struct intel_mid_dma_slave {
76 enum dma_data_direction dirn;
77 enum intel_mid_dma_width src_width; /*width of DMA src txn*/
78 enum intel_mid_dma_width dst_width; /*width of DMA dst txn*/
79 enum intel_mid_dma_hs_mode hs_mode; /*handshaking*/ 70 enum intel_mid_dma_hs_mode hs_mode; /*handshaking*/
80 enum intel_mid_dma_mode cfg_mode; /*mode configuration*/ 71 enum intel_mid_dma_mode cfg_mode; /*mode configuration*/
81 enum intel_mid_dma_msize src_msize; /*size if src burst*/
82 enum intel_mid_dma_msize dst_msize; /*size of dst burst*/
83 unsigned int device_instance; /*0, 1 for periphral instance*/ 72 unsigned int device_instance; /*0, 1 for periphral instance*/
73 struct dma_slave_config dma_slave;
84}; 74};
85 75
86#endif /*__INTEL_MID_DMA_H__*/ 76#endif /*__INTEL_MID_DMA_H__*/
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 414328577ce..79d0c4f6d07 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -410,13 +410,12 @@ extern void open_softirq(int nr, void (*action)(struct softirq_action *));
410extern void softirq_init(void); 410extern void softirq_init(void);
411static inline void __raise_softirq_irqoff(unsigned int nr) 411static inline void __raise_softirq_irqoff(unsigned int nr)
412{ 412{
413 trace_softirq_raise((struct softirq_action *)(unsigned long)nr, NULL); 413 trace_softirq_raise(nr);
414 or_softirq_pending(1UL << nr); 414 or_softirq_pending(1UL << nr);
415} 415}
416 416
417extern void raise_softirq_irqoff(unsigned int nr); 417extern void raise_softirq_irqoff(unsigned int nr);
418extern void raise_softirq(unsigned int nr); 418extern void raise_softirq(unsigned int nr);
419extern void wakeup_softirqd(void);
420 419
421/* This is the worklist that queues up per-cpu softirq work. 420/* This is the worklist that queues up per-cpu softirq work.
422 * 421 *
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index 7fb59279373..8cdcc2a199a 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -81,8 +81,7 @@ io_mapping_free(struct io_mapping *mapping)
81/* Atomic map/unmap */ 81/* Atomic map/unmap */
82static inline void __iomem * 82static inline void __iomem *
83io_mapping_map_atomic_wc(struct io_mapping *mapping, 83io_mapping_map_atomic_wc(struct io_mapping *mapping,
84 unsigned long offset, 84 unsigned long offset)
85 int slot)
86{ 85{
87 resource_size_t phys_addr; 86 resource_size_t phys_addr;
88 unsigned long pfn; 87 unsigned long pfn;
@@ -90,13 +89,13 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping,
90 BUG_ON(offset >= mapping->size); 89 BUG_ON(offset >= mapping->size);
91 phys_addr = mapping->base + offset; 90 phys_addr = mapping->base + offset;
92 pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); 91 pfn = (unsigned long) (phys_addr >> PAGE_SHIFT);
93 return iomap_atomic_prot_pfn(pfn, slot, mapping->prot); 92 return iomap_atomic_prot_pfn(pfn, mapping->prot);
94} 93}
95 94
96static inline void 95static inline void
97io_mapping_unmap_atomic(void __iomem *vaddr, int slot) 96io_mapping_unmap_atomic(void __iomem *vaddr)
98{ 97{
99 iounmap_atomic(vaddr, slot); 98 iounmap_atomic(vaddr);
100} 99}
101 100
102static inline void __iomem * 101static inline void __iomem *
@@ -137,14 +136,13 @@ io_mapping_free(struct io_mapping *mapping)
137/* Atomic map/unmap */ 136/* Atomic map/unmap */
138static inline void __iomem * 137static inline void __iomem *
139io_mapping_map_atomic_wc(struct io_mapping *mapping, 138io_mapping_map_atomic_wc(struct io_mapping *mapping,
140 unsigned long offset, 139 unsigned long offset)
141 int slot)
142{ 140{
143 return ((char __force __iomem *) mapping) + offset; 141 return ((char __force __iomem *) mapping) + offset;
144} 142}
145 143
146static inline void 144static inline void
147io_mapping_unmap_atomic(void __iomem *vaddr, int slot) 145io_mapping_unmap_atomic(void __iomem *vaddr)
148{ 146{
149} 147}
150 148
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index b22790268b6..d377ea815d4 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -112,6 +112,7 @@ struct resource_list {
112/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ 112/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
113extern struct resource ioport_resource; 113extern struct resource ioport_resource;
114extern struct resource iomem_resource; 114extern struct resource iomem_resource;
115extern int resource_alloc_from_bottom;
115 116
116extern struct resource *request_resource_conflict(struct resource *root, struct resource *new); 117extern struct resource *request_resource_conflict(struct resource *root, struct resource *new);
117extern int request_resource(struct resource *root, struct resource *new); 118extern int request_resource(struct resource *root, struct resource *new);
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h
index 9708de265bb..5f43a3b2e3a 100644
--- a/include/linux/ip_vs.h
+++ b/include/linux/ip_vs.h
@@ -70,6 +70,7 @@
70 70
71/* 71/*
72 * IPVS Connection Flags 72 * IPVS Connection Flags
73 * Only flags 0..15 are sent to backup server
73 */ 74 */
74#define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */ 75#define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */
75#define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */ 76#define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */
@@ -88,9 +89,20 @@
88#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ 89#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */
89#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */ 90#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */
90 91
92/* Flags that are not sent to backup server start from bit 16 */
93#define IP_VS_CONN_F_NFCT (1 << 16) /* use netfilter conntrack */
94
95/* Connection flags from destination that can be changed by user space */
96#define IP_VS_CONN_F_DEST_MASK (IP_VS_CONN_F_FWD_MASK | \
97 IP_VS_CONN_F_ONE_PACKET | \
98 IP_VS_CONN_F_NFCT | \
99 0)
100
91#define IP_VS_SCHEDNAME_MAXLEN 16 101#define IP_VS_SCHEDNAME_MAXLEN 16
102#define IP_VS_PENAME_MAXLEN 16
92#define IP_VS_IFNAME_MAXLEN 16 103#define IP_VS_IFNAME_MAXLEN 16
93 104
105#define IP_VS_PEDATA_MAXLEN 255
94 106
95/* 107/*
96 * The struct ip_vs_service_user and struct ip_vs_dest_user are 108 * The struct ip_vs_service_user and struct ip_vs_dest_user are
@@ -324,6 +336,9 @@ enum {
324 IPVS_SVC_ATTR_NETMASK, /* persistent netmask */ 336 IPVS_SVC_ATTR_NETMASK, /* persistent netmask */
325 337
326 IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */ 338 IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */
339
340 IPVS_SVC_ATTR_PE_NAME, /* name of ct retriever */
341
327 __IPVS_SVC_ATTR_MAX, 342 __IPVS_SVC_ATTR_MAX,
328}; 343};
329 344
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index e62683ba88e..8e429d0e040 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -341,7 +341,9 @@ struct ipv6_pinfo {
341 odstopts:1, 341 odstopts:1,
342 rxflow:1, 342 rxflow:1,
343 rxtclass:1, 343 rxtclass:1,
344 rxpmtu:1; 344 rxpmtu:1,
345 rxorigdstaddr:1;
346 /* 2 bits hole */
345 } bits; 347 } bits;
346 __u16 all; 348 __u16 all;
347 } rxopt; 349 } rxopt;
diff --git a/include/linux/irq.h b/include/linux/irq.h
index e9639115dff..abde2527c69 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -412,6 +412,11 @@ static inline void irq_free_desc(unsigned int irq)
412 irq_free_descs(irq, 1); 412 irq_free_descs(irq, 1);
413} 413}
414 414
415static inline int irq_reserve_irq(unsigned int irq)
416{
417 return irq_reserve_irqs(irq, 1);
418}
419
415#endif /* CONFIG_GENERIC_HARDIRQS */ 420#endif /* CONFIG_GENERIC_HARDIRQS */
416 421
417#endif /* !CONFIG_S390 */ 422#endif /* !CONFIG_S390 */
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 05aa8c23483..3bc4dcab6e8 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -43,7 +43,7 @@ unsigned int irq_get_next_irq(unsigned int offset);
43 else 43 else
44 44
45#ifdef CONFIG_SMP 45#ifdef CONFIG_SMP
46#define irq_node(irq) (irq_to_desc(irq)->node) 46#define irq_node(irq) (irq_get_irq_data(irq)->node)
47#else 47#else
48#define irq_node(irq) 0 48#define irq_node(irq) 0
49#endif 49#endif
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 0b52924a0cb..2ae86aa21fc 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -395,7 +395,7 @@ struct jbd2_inode {
395 struct inode *i_vfs_inode; 395 struct inode *i_vfs_inode;
396 396
397 /* Flags of inode [j_list_lock] */ 397 /* Flags of inode [j_list_lock] */
398 unsigned int i_flags; 398 unsigned long i_flags;
399}; 399};
400 400
401struct jbd2_revoke_table_s; 401struct jbd2_revoke_table_s;
diff --git a/include/linux/jhash.h b/include/linux/jhash.h
index 2a2f99fbcb1..ced1159fa4f 100644
--- a/include/linux/jhash.h
+++ b/include/linux/jhash.h
@@ -116,7 +116,7 @@ static inline u32 jhash2(const u32 *k, u32 length, u32 initval)
116/* A special ultra-optimized versions that knows they are hashing exactly 116/* A special ultra-optimized versions that knows they are hashing exactly
117 * 3, 2 or 1 word(s). 117 * 3, 2 or 1 word(s).
118 * 118 *
119 * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally 119 * NOTE: In particular the "c += length; __jhash_mix(a,b,c);" normally
120 * done at the end is not done here. 120 * done at the end is not done here.
121 */ 121 */
122static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval) 122static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index b67cb180e6e..7880f18e4b8 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -1,7 +1,7 @@
1#ifndef _LINUX_JUMP_LABEL_H 1#ifndef _LINUX_JUMP_LABEL_H
2#define _LINUX_JUMP_LABEL_H 2#define _LINUX_JUMP_LABEL_H
3 3
4#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_HAVE_ARCH_JUMP_LABEL) 4#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
5# include <asm/jump_label.h> 5# include <asm/jump_label.h>
6# define HAVE_JUMP_LABEL 6# define HAVE_JUMP_LABEL
7#endif 7#endif
@@ -18,6 +18,8 @@ struct module;
18extern struct jump_entry __start___jump_table[]; 18extern struct jump_entry __start___jump_table[];
19extern struct jump_entry __stop___jump_table[]; 19extern struct jump_entry __stop___jump_table[];
20 20
21extern void jump_label_lock(void);
22extern void jump_label_unlock(void);
21extern void arch_jump_label_transform(struct jump_entry *entry, 23extern void arch_jump_label_transform(struct jump_entry *entry,
22 enum jump_label_type type); 24 enum jump_label_type type);
23extern void arch_jump_label_text_poke_early(jump_label_t addr); 25extern void arch_jump_label_text_poke_early(jump_label_t addr);
@@ -59,6 +61,9 @@ static inline int jump_label_text_reserved(void *start, void *end)
59 return 0; 61 return 0;
60} 62}
61 63
64static inline void jump_label_lock(void) {}
65static inline void jump_label_unlock(void) {}
66
62#endif 67#endif
63 68
64#define COND_STMT(key, stmt) \ 69#define COND_STMT(key, stmt) \
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index edef168a040..450092c1e35 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -173,6 +173,11 @@ extern int _cond_resched(void);
173 (__x < 0) ? -__x : __x; \ 173 (__x < 0) ? -__x : __x; \
174 }) 174 })
175 175
176#define abs64(x) ({ \
177 s64 __x = (x); \
178 (__x < 0) ? -__x : __x; \
179 })
180
176#ifdef CONFIG_PROVE_LOCKING 181#ifdef CONFIG_PROVE_LOCKING
177void might_fault(void); 182void might_fault(void);
178#else 183#else
@@ -203,10 +208,10 @@ extern unsigned long simple_strtoul(const char *,char **,unsigned int);
203extern long simple_strtol(const char *,char **,unsigned int); 208extern long simple_strtol(const char *,char **,unsigned int);
204extern unsigned long long simple_strtoull(const char *,char **,unsigned int); 209extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
205extern long long simple_strtoll(const char *,char **,unsigned int); 210extern long long simple_strtoll(const char *,char **,unsigned int);
206extern int strict_strtoul(const char *, unsigned int, unsigned long *); 211extern int __must_check strict_strtoul(const char *, unsigned int, unsigned long *);
207extern int strict_strtol(const char *, unsigned int, long *); 212extern int __must_check strict_strtol(const char *, unsigned int, long *);
208extern int strict_strtoull(const char *, unsigned int, unsigned long long *); 213extern int __must_check strict_strtoull(const char *, unsigned int, unsigned long long *);
209extern int strict_strtoll(const char *, unsigned int, long long *); 214extern int __must_check strict_strtoll(const char *, unsigned int, long long *);
210extern int sprintf(char * buf, const char * fmt, ...) 215extern int sprintf(char * buf, const char * fmt, ...)
211 __attribute__ ((format (printf, 2, 3))); 216 __attribute__ ((format (printf, 2, 3)));
212extern int vsprintf(char *buf, const char *, va_list) 217extern int vsprintf(char *buf, const char *, va_list)
@@ -277,6 +282,11 @@ asmlinkage int vprintk(const char *fmt, va_list args)
277asmlinkage int printk(const char * fmt, ...) 282asmlinkage int printk(const char * fmt, ...)
278 __attribute__ ((format (printf, 1, 2))) __cold; 283 __attribute__ ((format (printf, 1, 2))) __cold;
279 284
285/*
286 * Please don't use printk_ratelimit(), because it shares ratelimiting state
287 * with all other unrelated printk_ratelimit() callsites. Instead use
288 * printk_ratelimited() or plain old __ratelimit().
289 */
280extern int __printk_ratelimit(const char *func); 290extern int __printk_ratelimit(const char *func);
281#define printk_ratelimit() __printk_ratelimit(__func__) 291#define printk_ratelimit() __printk_ratelimit(__func__)
282extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, 292extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
@@ -651,6 +661,24 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
651 (void) (&_max1 == &_max2); \ 661 (void) (&_max1 == &_max2); \
652 _max1 > _max2 ? _max1 : _max2; }) 662 _max1 > _max2 ? _max1 : _max2; })
653 663
664#define min3(x, y, z) ({ \
665 typeof(x) _min1 = (x); \
666 typeof(y) _min2 = (y); \
667 typeof(z) _min3 = (z); \
668 (void) (&_min1 == &_min2); \
669 (void) (&_min1 == &_min3); \
670 _min1 < _min2 ? (_min1 < _min3 ? _min1 : _min3) : \
671 (_min2 < _min3 ? _min2 : _min3); })
672
673#define max3(x, y, z) ({ \
674 typeof(x) _max1 = (x); \
675 typeof(y) _max2 = (y); \
676 typeof(z) _max3 = (z); \
677 (void) (&_max1 == &_max2); \
678 (void) (&_max1 == &_max3); \
679 _max1 > _max2 ? (_max1 > _max3 ? _max1 : _max3) : \
680 (_max2 > _max3 ? _max2 : _max3); })
681
654/** 682/**
655 * min_not_zero - return the minimum that is _not_ zero, unless both are zero 683 * min_not_zero - return the minimum that is _not_ zero, unless both are zero
656 * @x: value1 684 * @x: value1
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index c059044bc6d..ad54c846911 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -33,6 +33,7 @@ struct kernel_stat {
33#ifndef CONFIG_GENERIC_HARDIRQS 33#ifndef CONFIG_GENERIC_HARDIRQS
34 unsigned int irqs[NR_IRQS]; 34 unsigned int irqs[NR_IRQS];
35#endif 35#endif
36 unsigned long irqs_sum;
36 unsigned int softirqs[NR_SOFTIRQS]; 37 unsigned int softirqs[NR_SOFTIRQS];
37}; 38};
38 39
@@ -54,6 +55,7 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
54 struct irq_desc *desc) 55 struct irq_desc *desc)
55{ 56{
56 kstat_this_cpu.irqs[irq]++; 57 kstat_this_cpu.irqs[irq]++;
58 kstat_this_cpu.irqs_sum++;
57} 59}
58 60
59static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) 61static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
@@ -65,8 +67,9 @@ static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
65extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); 67extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
66#define kstat_irqs_this_cpu(DESC) \ 68#define kstat_irqs_this_cpu(DESC) \
67 ((DESC)->kstat_irqs[smp_processor_id()]) 69 ((DESC)->kstat_irqs[smp_processor_id()])
68#define kstat_incr_irqs_this_cpu(irqno, DESC) \ 70#define kstat_incr_irqs_this_cpu(irqno, DESC) do {\
69 ((DESC)->kstat_irqs[smp_processor_id()]++) 71 ((DESC)->kstat_irqs[smp_processor_id()]++);\
72 kstat_this_cpu.irqs_sum++; } while (0)
70 73
71#endif 74#endif
72 75
@@ -83,6 +86,7 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu)
83/* 86/*
84 * Number of interrupts per specific IRQ source, since bootup 87 * Number of interrupts per specific IRQ source, since bootup
85 */ 88 */
89#ifndef CONFIG_GENERIC_HARDIRQS
86static inline unsigned int kstat_irqs(unsigned int irq) 90static inline unsigned int kstat_irqs(unsigned int irq)
87{ 91{
88 unsigned int sum = 0; 92 unsigned int sum = 0;
@@ -93,7 +97,17 @@ static inline unsigned int kstat_irqs(unsigned int irq)
93 97
94 return sum; 98 return sum;
95} 99}
100#else
101extern unsigned int kstat_irqs(unsigned int irq);
102#endif
96 103
104/*
105 * Number of interrupts per cpu, since bootup
106 */
107static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu)
108{
109 return kstat_cpu(cpu).irqs_sum;
110}
97 111
98/* 112/*
99 * Lock/unlock the current runqueue - to extract task statistics: 113 * Lock/unlock the current runqueue - to extract task statistics:
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 62dbee554f6..10308c6a3d1 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -172,7 +172,13 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PTR(unsigned char, 2, void);
172 172
173 173
174static inline unsigned int __must_check 174static inline unsigned int __must_check
175__kfifo_must_check_helper(unsigned int val) 175__kfifo_uint_must_check_helper(unsigned int val)
176{
177 return val;
178}
179
180static inline int __must_check
181__kfifo_int_must_check_helper(int val)
176{ 182{
177 return val; 183 return val;
178} 184}
@@ -267,7 +273,7 @@ __kfifo_must_check_helper(unsigned int val)
267 * @fifo: address of the fifo to be used 273 * @fifo: address of the fifo to be used
268 */ 274 */
269#define kfifo_avail(fifo) \ 275#define kfifo_avail(fifo) \
270__kfifo_must_check_helper( \ 276__kfifo_uint_must_check_helper( \
271({ \ 277({ \
272 typeof((fifo) + 1) __tmpq = (fifo); \ 278 typeof((fifo) + 1) __tmpq = (fifo); \
273 const size_t __recsize = sizeof(*__tmpq->rectype); \ 279 const size_t __recsize = sizeof(*__tmpq->rectype); \
@@ -300,7 +306,7 @@ __kfifo_must_check_helper( \
300 * This function returns the size of the next fifo record in number of bytes. 306 * This function returns the size of the next fifo record in number of bytes.
301 */ 307 */
302#define kfifo_peek_len(fifo) \ 308#define kfifo_peek_len(fifo) \
303__kfifo_must_check_helper( \ 309__kfifo_uint_must_check_helper( \
304({ \ 310({ \
305 typeof((fifo) + 1) __tmp = (fifo); \ 311 typeof((fifo) + 1) __tmp = (fifo); \
306 const size_t __recsize = sizeof(*__tmp->rectype); \ 312 const size_t __recsize = sizeof(*__tmp->rectype); \
@@ -323,7 +329,7 @@ __kfifo_must_check_helper( \
323 * Return 0 if no error, otherwise an error code. 329 * Return 0 if no error, otherwise an error code.
324 */ 330 */
325#define kfifo_alloc(fifo, size, gfp_mask) \ 331#define kfifo_alloc(fifo, size, gfp_mask) \
326__kfifo_must_check_helper( \ 332__kfifo_int_must_check_helper( \
327({ \ 333({ \
328 typeof((fifo) + 1) __tmp = (fifo); \ 334 typeof((fifo) + 1) __tmp = (fifo); \
329 struct __kfifo *__kfifo = &__tmp->kfifo; \ 335 struct __kfifo *__kfifo = &__tmp->kfifo; \
@@ -419,7 +425,7 @@ __kfifo_must_check_helper( \
419 * writer, you don't need extra locking to use these macro. 425 * writer, you don't need extra locking to use these macro.
420 */ 426 */
421#define kfifo_get(fifo, val) \ 427#define kfifo_get(fifo, val) \
422__kfifo_must_check_helper( \ 428__kfifo_uint_must_check_helper( \
423({ \ 429({ \
424 typeof((fifo) + 1) __tmp = (fifo); \ 430 typeof((fifo) + 1) __tmp = (fifo); \
425 typeof((val) + 1) __val = (val); \ 431 typeof((val) + 1) __val = (val); \
@@ -460,7 +466,7 @@ __kfifo_must_check_helper( \
460 * writer, you don't need extra locking to use these macro. 466 * writer, you don't need extra locking to use these macro.
461 */ 467 */
462#define kfifo_peek(fifo, val) \ 468#define kfifo_peek(fifo, val) \
463__kfifo_must_check_helper( \ 469__kfifo_uint_must_check_helper( \
464({ \ 470({ \
465 typeof((fifo) + 1) __tmp = (fifo); \ 471 typeof((fifo) + 1) __tmp = (fifo); \
466 typeof((val) + 1) __val = (val); \ 472 typeof((val) + 1) __val = (val); \
@@ -552,7 +558,7 @@ __kfifo_must_check_helper( \
552 * writer, you don't need extra locking to use these macro. 558 * writer, you don't need extra locking to use these macro.
553 */ 559 */
554#define kfifo_out(fifo, buf, n) \ 560#define kfifo_out(fifo, buf, n) \
555__kfifo_must_check_helper( \ 561__kfifo_uint_must_check_helper( \
556({ \ 562({ \
557 typeof((fifo) + 1) __tmp = (fifo); \ 563 typeof((fifo) + 1) __tmp = (fifo); \
558 typeof((buf) + 1) __buf = (buf); \ 564 typeof((buf) + 1) __buf = (buf); \
@@ -580,7 +586,7 @@ __kfifo_must_check_helper( \
580 * copied. 586 * copied.
581 */ 587 */
582#define kfifo_out_spinlocked(fifo, buf, n, lock) \ 588#define kfifo_out_spinlocked(fifo, buf, n, lock) \
583__kfifo_must_check_helper( \ 589__kfifo_uint_must_check_helper( \
584({ \ 590({ \
585 unsigned long __flags; \ 591 unsigned long __flags; \
586 unsigned int __ret; \ 592 unsigned int __ret; \
@@ -609,7 +615,7 @@ __kfifo_must_check_helper( \
609 * writer, you don't need extra locking to use these macro. 615 * writer, you don't need extra locking to use these macro.
610 */ 616 */
611#define kfifo_from_user(fifo, from, len, copied) \ 617#define kfifo_from_user(fifo, from, len, copied) \
612__kfifo_must_check_helper( \ 618__kfifo_uint_must_check_helper( \
613({ \ 619({ \
614 typeof((fifo) + 1) __tmp = (fifo); \ 620 typeof((fifo) + 1) __tmp = (fifo); \
615 const void __user *__from = (from); \ 621 const void __user *__from = (from); \
@@ -637,7 +643,7 @@ __kfifo_must_check_helper( \
637 * writer, you don't need extra locking to use these macro. 643 * writer, you don't need extra locking to use these macro.
638 */ 644 */
639#define kfifo_to_user(fifo, to, len, copied) \ 645#define kfifo_to_user(fifo, to, len, copied) \
640__kfifo_must_check_helper( \ 646__kfifo_uint_must_check_helper( \
641({ \ 647({ \
642 typeof((fifo) + 1) __tmp = (fifo); \ 648 typeof((fifo) + 1) __tmp = (fifo); \
643 void __user *__to = (to); \ 649 void __user *__to = (to); \
@@ -764,7 +770,7 @@ __kfifo_must_check_helper( \
764 * writer, you don't need extra locking to use these macro. 770 * writer, you don't need extra locking to use these macro.
765 */ 771 */
766#define kfifo_out_peek(fifo, buf, n) \ 772#define kfifo_out_peek(fifo, buf, n) \
767__kfifo_must_check_helper( \ 773__kfifo_uint_must_check_helper( \
768({ \ 774({ \
769 typeof((fifo) + 1) __tmp = (fifo); \ 775 typeof((fifo) + 1) __tmp = (fifo); \
770 typeof((buf) + 1) __buf = (buf); \ 776 typeof((buf) + 1) __buf = (buf); \
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index cc96f0f23e0..092e4250a45 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -35,16 +35,6 @@ struct pt_regs;
35 */ 35 */
36extern int kgdb_skipexception(int exception, struct pt_regs *regs); 36extern int kgdb_skipexception(int exception, struct pt_regs *regs);
37 37
38/**
39 * kgdb_disable_hw_debug - (optional) Disable hardware debugging hook
40 * @regs: Current &struct pt_regs.
41 *
42 * This function will be called if the particular architecture must
43 * disable hardware debugging while it is processing gdb packets or
44 * handling exception.
45 */
46extern void kgdb_disable_hw_debug(struct pt_regs *regs);
47
48struct tasklet_struct; 38struct tasklet_struct;
49struct task_struct; 39struct task_struct;
50struct uart_port; 40struct uart_port;
@@ -243,6 +233,8 @@ extern void kgdb_arch_late(void);
243 * breakpoint. 233 * breakpoint.
244 * @remove_hw_breakpoint: Allow an architecture to specify how to remove a 234 * @remove_hw_breakpoint: Allow an architecture to specify how to remove a
245 * hardware breakpoint. 235 * hardware breakpoint.
236 * @disable_hw_break: Allow an architecture to specify how to disable
237 * hardware breakpoints for a single cpu.
246 * @remove_all_hw_break: Allow an architecture to specify how to remove all 238 * @remove_all_hw_break: Allow an architecture to specify how to remove all
247 * hardware breakpoints. 239 * hardware breakpoints.
248 * @correct_hw_break: Allow an architecture to specify how to correct the 240 * @correct_hw_break: Allow an architecture to specify how to correct the
@@ -256,6 +248,7 @@ struct kgdb_arch {
256 int (*remove_breakpoint)(unsigned long, char *); 248 int (*remove_breakpoint)(unsigned long, char *);
257 int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); 249 int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype);
258 int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); 250 int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype);
251 void (*disable_hw_break)(struct pt_regs *regs);
259 void (*remove_all_hw_break)(void); 252 void (*remove_all_hw_break)(void);
260 void (*correct_hw_break)(void); 253 void (*correct_hw_break)(void);
261}; 254};
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 636fc381c89..919ae53adc5 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -414,6 +414,14 @@ struct kvm_enable_cap {
414 __u8 pad[64]; 414 __u8 pad[64];
415}; 415};
416 416
417/* for KVM_PPC_GET_PVINFO */
418struct kvm_ppc_pvinfo {
419 /* out */
420 __u32 flags;
421 __u32 hcall[4];
422 __u8 pad[108];
423};
424
417#define KVMIO 0xAE 425#define KVMIO 0xAE
418 426
419/* 427/*
@@ -530,6 +538,8 @@ struct kvm_enable_cap {
530#ifdef __KVM_HAVE_XCRS 538#ifdef __KVM_HAVE_XCRS
531#define KVM_CAP_XCRS 56 539#define KVM_CAP_XCRS 56
532#endif 540#endif
541#define KVM_CAP_PPC_GET_PVINFO 57
542#define KVM_CAP_PPC_IRQ_LEVEL 58
533 543
534#ifdef KVM_CAP_IRQ_ROUTING 544#ifdef KVM_CAP_IRQ_ROUTING
535 545
@@ -664,6 +674,8 @@ struct kvm_clock_data {
664/* Available with KVM_CAP_PIT_STATE2 */ 674/* Available with KVM_CAP_PIT_STATE2 */
665#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2) 675#define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2)
666#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) 676#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
677/* Available with KVM_CAP_PPC_GET_PVINFO */
678#define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo)
667 679
668/* 680/*
669 * ioctls for vcpu fds 681 * ioctls for vcpu fds
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ac740b26eb1..a0557422715 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -36,9 +36,10 @@
36#define KVM_REQ_PENDING_TIMER 5 36#define KVM_REQ_PENDING_TIMER 5
37#define KVM_REQ_UNHALT 6 37#define KVM_REQ_UNHALT 6
38#define KVM_REQ_MMU_SYNC 7 38#define KVM_REQ_MMU_SYNC 7
39#define KVM_REQ_KVMCLOCK_UPDATE 8 39#define KVM_REQ_CLOCK_UPDATE 8
40#define KVM_REQ_KICK 9 40#define KVM_REQ_KICK 9
41#define KVM_REQ_DEACTIVATE_FPU 10 41#define KVM_REQ_DEACTIVATE_FPU 10
42#define KVM_REQ_EVENT 11
42 43
43#define KVM_USERSPACE_IRQ_SOURCE_ID 0 44#define KVM_USERSPACE_IRQ_SOURCE_ID 0
44 45
@@ -289,6 +290,9 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
289void kvm_disable_largepages(void); 290void kvm_disable_largepages(void);
290void kvm_arch_flush_shadow(struct kvm *kvm); 291void kvm_arch_flush_shadow(struct kvm *kvm);
291 292
293int gfn_to_page_many_atomic(struct kvm *kvm, gfn_t gfn, struct page **pages,
294 int nr_pages);
295
292struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); 296struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
293unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); 297unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
294void kvm_release_page_clean(struct page *page); 298void kvm_release_page_clean(struct page *page);
@@ -296,6 +300,8 @@ void kvm_release_page_dirty(struct page *page);
296void kvm_set_page_dirty(struct page *page); 300void kvm_set_page_dirty(struct page *page);
297void kvm_set_page_accessed(struct page *page); 301void kvm_set_page_accessed(struct page *page);
298 302
303pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr);
304pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn);
299pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); 305pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn);
300pfn_t gfn_to_pfn_memslot(struct kvm *kvm, 306pfn_t gfn_to_pfn_memslot(struct kvm *kvm,
301 struct kvm_memory_slot *slot, gfn_t gfn); 307 struct kvm_memory_slot *slot, gfn_t gfn);
@@ -477,8 +483,7 @@ int kvm_deassign_device(struct kvm *kvm,
477 struct kvm_assigned_dev_kernel *assigned_dev); 483 struct kvm_assigned_dev_kernel *assigned_dev);
478#else /* CONFIG_IOMMU_API */ 484#else /* CONFIG_IOMMU_API */
479static inline int kvm_iommu_map_pages(struct kvm *kvm, 485static inline int kvm_iommu_map_pages(struct kvm *kvm,
480 gfn_t base_gfn, 486 struct kvm_memory_slot *slot)
481 unsigned long npages)
482{ 487{
483 return 0; 488 return 0;
484} 489}
@@ -518,11 +523,22 @@ static inline void kvm_guest_exit(void)
518 current->flags &= ~PF_VCPU; 523 current->flags &= ~PF_VCPU;
519} 524}
520 525
526static inline unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot,
527 gfn_t gfn)
528{
529 return slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE;
530}
531
521static inline gpa_t gfn_to_gpa(gfn_t gfn) 532static inline gpa_t gfn_to_gpa(gfn_t gfn)
522{ 533{
523 return (gpa_t)gfn << PAGE_SHIFT; 534 return (gpa_t)gfn << PAGE_SHIFT;
524} 535}
525 536
537static inline gfn_t gpa_to_gfn(gpa_t gpa)
538{
539 return (gfn_t)(gpa >> PAGE_SHIFT);
540}
541
526static inline hpa_t pfn_to_hpa(pfn_t pfn) 542static inline hpa_t pfn_to_hpa(pfn_t pfn)
527{ 543{
528 return (hpa_t)pfn << PAGE_SHIFT; 544 return (hpa_t)pfn << PAGE_SHIFT;
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h
index d73109243fd..47a070b0520 100644
--- a/include/linux/kvm_para.h
+++ b/include/linux/kvm_para.h
@@ -17,6 +17,8 @@
17 17
18#define KVM_HC_VAPIC_POLL_IRQ 1 18#define KVM_HC_VAPIC_POLL_IRQ 1
19#define KVM_HC_MMU_OP 2 19#define KVM_HC_MMU_OP 2
20#define KVM_HC_FEATURES 3
21#define KVM_HC_PPC_MAP_MAGIC_PAGE 4
20 22
21/* 23/*
22 * hypercalls use architecture specific 24 * hypercalls use architecture specific
@@ -24,11 +26,6 @@
24#include <asm/kvm_para.h> 26#include <asm/kvm_para.h>
25 27
26#ifdef __KERNEL__ 28#ifdef __KERNEL__
27#ifdef CONFIG_KVM_GUEST
28void __init kvm_guest_init(void);
29#else
30#define kvm_guest_init() do { } while (0)
31#endif
32 29
33static inline int kvm_para_has_feature(unsigned int feature) 30static inline int kvm_para_has_feature(unsigned int feature)
34{ 31{
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h
index 0e8a346424b..d4292c8431e 100644
--- a/include/linux/lis3lv02d.h
+++ b/include/linux/lis3lv02d.h
@@ -1,6 +1,52 @@
1#ifndef __LIS3LV02D_H_ 1#ifndef __LIS3LV02D_H_
2#define __LIS3LV02D_H_ 2#define __LIS3LV02D_H_
3 3
4/**
5 * struct lis3lv02d_platform_data - lis3 chip family platform data
6 * @click_flags: Click detection unit configuration
7 * @click_thresh_x: Click detection unit x axis threshold
8 * @click_thresh_y: Click detection unit y axis threshold
9 * @click_thresh_z: Click detection unit z axis threshold
10 * @click_time_limit: Click detection unit time parameter
11 * @click_latency: Click detection unit latency parameter
12 * @click_window: Click detection unit window parameter
13 * @irq_cfg: On chip irq source and type configuration (click /
14 * data available / wake up, open drain, polarity)
15 * @irq_flags1: Additional irq triggering flags for irq channel 0
16 * @irq_flags2: Additional irq triggering flags for irq channel 1
17 * @duration1: Wake up unit 1 duration parameter
18 * @duration2: Wake up unit 2 duration parameter
19 * @wakeup_flags: Wake up unit 1 flags
20 * @wakeup_thresh: Wake up unit 1 threshold value
21 * @wakeup_flags2: Wake up unit 2 flags
22 * @wakeup_thresh2: Wake up unit 2 threshold value
23 * @hipass_ctrl: High pass filter control (enable / disable, cut off
24 * frequency)
25 * @axis_x: Sensor orientation remapping for x-axis
26 * @axis_y: Sensor orientation remapping for y-axis
27 * @axis_z: Sensor orientation remapping for z-axis
28 * @driver_features: Enable bits for different features. Disabled by default
29 * @default_rate: Default sampling rate. 0 means reset default
30 * @setup_resources: Interrupt line setup call back function
31 * @release_resources: Interrupt line release call back function
32 * @st_min_limits[3]: Selftest acceptance minimum values
33 * @st_max_limits[3]: Selftest acceptance maximum values
34 * @irq2: Irq line 2 number
35 *
36 * Platform data is used to setup the sensor chip. Meaning of the different
37 * chip features can be found from the data sheet. It is publicly available
38 * at www.st.com web pages. Currently the platform data is used
39 * only for the 8 bit device. The 8 bit device has two wake up / free fall
40 * detection units and click detection unit. There are plenty of ways to
41 * configure the chip which makes is quite hard to explain deeper meaning of
42 * the fields here. Behaviour of the detection blocks varies heavily depending
43 * on the configuration. For example, interrupt detection block can use high
44 * pass filtered data which makes it react to the changes in the acceleration.
45 * Irq_flags can be used to enable interrupt detection on the both edges.
46 * With proper chip configuration this produces interrupt when some trigger
47 * starts and when it goes away.
48 */
49
4struct lis3lv02d_platform_data { 50struct lis3lv02d_platform_data {
5 /* please note: the 'click' feature is only supported for 51 /* please note: the 'click' feature is only supported for
6 * LIS[32]02DL variants of the chip and will be ignored for 52 * LIS[32]02DL variants of the chip and will be ignored for
@@ -36,7 +82,10 @@ struct lis3lv02d_platform_data {
36#define LIS3_IRQ_OPEN_DRAIN (1 << 6) 82#define LIS3_IRQ_OPEN_DRAIN (1 << 6)
37#define LIS3_IRQ_ACTIVE_LOW (1 << 7) 83#define LIS3_IRQ_ACTIVE_LOW (1 << 7)
38 unsigned char irq_cfg; 84 unsigned char irq_cfg;
39 85 unsigned char irq_flags1; /* Additional irq edge / level flags */
86 unsigned char irq_flags2; /* Additional irq edge / level flags */
87 unsigned char duration1;
88 unsigned char duration2;
40#define LIS3_WAKEUP_X_LO (1 << 0) 89#define LIS3_WAKEUP_X_LO (1 << 0)
41#define LIS3_WAKEUP_X_HI (1 << 1) 90#define LIS3_WAKEUP_X_HI (1 << 1)
42#define LIS3_WAKEUP_Y_LO (1 << 2) 91#define LIS3_WAKEUP_Y_LO (1 << 2)
@@ -64,6 +113,10 @@ struct lis3lv02d_platform_data {
64 s8 axis_x; 113 s8 axis_x;
65 s8 axis_y; 114 s8 axis_y;
66 s8 axis_z; 115 s8 axis_z;
116#define LIS3_USE_REGULATOR_CTRL 0x01
117#define LIS3_USE_BLOCK_READ 0x02
118 u16 driver_features;
119 int default_rate;
67 int (*setup_resources)(void); 120 int (*setup_resources)(void);
68 int (*release_resources)(void); 121 int (*release_resources)(void);
69 /* Limits for selftest are specified in chip data sheet */ 122 /* Limits for selftest are specified in chip data sheet */
diff --git a/include/linux/list.h b/include/linux/list.h
index 88a000617d7..9a5f8a71810 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -636,6 +636,12 @@ static inline void hlist_add_after(struct hlist_node *n,
636 next->next->pprev = &next->next; 636 next->next->pprev = &next->next;
637} 637}
638 638
639/* after that we'll appear to be on some hlist and hlist_del will work */
640static inline void hlist_add_fake(struct hlist_node *n)
641{
642 n->pprev = &n->next;
643}
644
639/* 645/*
640 * Move a list from one list head to another. Fixup the pprev 646 * Move a list from one list head to another. Fixup the pprev
641 * reference of the first entry if it exists. 647 * reference of the first entry if it exists.
diff --git a/include/linux/magic.h b/include/linux/magic.h
index eb9800f0578..ff690d05f12 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -57,5 +57,6 @@
57 57
58#define DEVPTS_SUPER_MAGIC 0x1cd1 58#define DEVPTS_SUPER_MAGIC 0x1cd1
59#define SOCKFS_MAGIC 0x534F434B 59#define SOCKFS_MAGIC 0x534F434B
60#define V9FS_MAGIC 0x01021997
60 61
61#endif /* __LINUX_MAGIC_H__ */ 62#endif /* __LINUX_MAGIC_H__ */
diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h
index d0f08018335..1ff81b51b65 100644
--- a/include/linux/marvell_phy.h
+++ b/include/linux/marvell_phy.h
@@ -12,7 +12,7 @@
12#define MARVELL_PHY_ID_88E1121R 0x01410cb0 12#define MARVELL_PHY_ID_88E1121R 0x01410cb0
13#define MARVELL_PHY_ID_88E1145 0x01410cd0 13#define MARVELL_PHY_ID_88E1145 0x01410cd0
14#define MARVELL_PHY_ID_88E1240 0x01410e30 14#define MARVELL_PHY_ID_88E1240 0x01410e30
15#define MARVELL_PHY_ID_88EC048 0x01410e90 15#define MARVELL_PHY_ID_88E1318S 0x01410e90
16 16
17/* struct phy_device dev_flags definitions */ 17/* struct phy_device dev_flags definitions */
18#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 18#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001
diff --git a/include/linux/math64.h b/include/linux/math64.h
index c87f1528703..23fcdfcba81 100644
--- a/include/linux/math64.h
+++ b/include/linux/math64.h
@@ -35,6 +35,14 @@ static inline u64 div64_u64(u64 dividend, u64 divisor)
35 return dividend / divisor; 35 return dividend / divisor;
36} 36}
37 37
38/**
39 * div64_s64 - signed 64bit divide with 64bit divisor
40 */
41static inline s64 div64_s64(s64 dividend, s64 divisor)
42{
43 return dividend / divisor;
44}
45
38#elif BITS_PER_LONG == 32 46#elif BITS_PER_LONG == 32
39 47
40#ifndef div_u64_rem 48#ifndef div_u64_rem
@@ -53,6 +61,10 @@ extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder);
53extern u64 div64_u64(u64 dividend, u64 divisor); 61extern u64 div64_u64(u64 dividend, u64 divisor);
54#endif 62#endif
55 63
64#ifndef div64_s64
65extern s64 div64_s64(s64 dividend, s64 divisor);
66#endif
67
56#endif /* BITS_PER_LONG */ 68#endif /* BITS_PER_LONG */
57 69
58/** 70/**
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 864035fb8f8..4307231bd22 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -70,6 +70,10 @@ extern void online_page(struct page *page);
70extern int online_pages(unsigned long, unsigned long); 70extern int online_pages(unsigned long, unsigned long);
71extern void __offline_isolated_pages(unsigned long, unsigned long); 71extern void __offline_isolated_pages(unsigned long, unsigned long);
72 72
73#ifdef CONFIG_MEMORY_HOTREMOVE
74extern bool is_pageblock_removable_nolock(struct page *page);
75#endif /* CONFIG_MEMORY_HOTREMOVE */
76
73/* reasonably generic interface to expand the physical pages in a zone */ 77/* reasonably generic interface to expand the physical pages in a zone */
74extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, 78extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn,
75 unsigned long nr_pages); 79 unsigned long nr_pages);
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index bfd23bef736..4db1fbd8969 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -138,7 +138,7 @@ enum {
138 PM8607_ID_RG_MAX, 138 PM8607_ID_RG_MAX,
139}; 139};
140 140
141#define PM8607_VERSION (0x40) /* 8607 chip ID */ 141/* 8607 chip ID is 0x40 or 0x50 */
142#define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */ 142#define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */
143 143
144/* Interrupt Registers */ 144/* Interrupt Registers */
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
index f5cec4500f3..d63b6050b18 100644
--- a/include/linux/mfd/ab8500.h
+++ b/include/linux/mfd/ab8500.h
@@ -10,6 +10,29 @@
10#include <linux/device.h> 10#include <linux/device.h>
11 11
12/* 12/*
13 * AB8500 bank addresses
14 */
15#define AB8500_SYS_CTRL1_BLOCK 0x1
16#define AB8500_SYS_CTRL2_BLOCK 0x2
17#define AB8500_REGU_CTRL1 0x3
18#define AB8500_REGU_CTRL2 0x4
19#define AB8500_USB 0x5
20#define AB8500_TVOUT 0x6
21#define AB8500_DBI 0x7
22#define AB8500_ECI_AV_ACC 0x8
23#define AB8500_RESERVED 0x9
24#define AB8500_GPADC 0xA
25#define AB8500_CHARGER 0xB
26#define AB8500_GAS_GAUGE 0xC
27#define AB8500_AUDIO 0xD
28#define AB8500_INTERRUPT 0xE
29#define AB8500_RTC 0xF
30#define AB8500_MISC 0x10
31#define AB8500_DEBUG 0x12
32#define AB8500_PROD_TEST 0x13
33#define AB8500_OTP_EMUL 0x15
34
35/*
13 * Interrupts 36 * Interrupts
14 */ 37 */
15 38
@@ -99,6 +122,7 @@ struct ab8500 {
99 int revision; 122 int revision;
100 int irq_base; 123 int irq_base;
101 int irq; 124 int irq;
125 u8 chip_id;
102 126
103 int (*write) (struct ab8500 *a8500, u16 addr, u8 data); 127 int (*write) (struct ab8500 *a8500, u16 addr, u8 data);
104 int (*read) (struct ab8500 *a8500, u16 addr); 128 int (*read) (struct ab8500 *a8500, u16 addr);
@@ -124,10 +148,6 @@ struct ab8500_platform_data {
124 struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; 148 struct regulator_init_data *regulator[AB8500_NUM_REGULATORS];
125}; 149};
126 150
127extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data);
128extern int ab8500_read(struct ab8500 *a8500, u16 addr);
129extern int ab8500_set_bits(struct ab8500 *a8500, u16 addr, u8 mask, u8 data);
130
131extern int __devinit ab8500_init(struct ab8500 *ab8500); 151extern int __devinit ab8500_init(struct ab8500 *ab8500);
132extern int __devexit ab8500_exit(struct ab8500 *ab8500); 152extern int __devexit ab8500_exit(struct ab8500 *ab8500);
133 153
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 390726fcbcb..67bd6f7ecf3 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -6,8 +6,7 @@
6 * 6 *
7 * ABX500 core access functions. 7 * ABX500 core access functions.
8 * The abx500 interface is used for the Analog Baseband chip 8 * The abx500 interface is used for the Analog Baseband chip
9 * ab3100, ab3550, ab5500 and possibly comming. It is not used for 9 * ab3100, ab3550, ab5500, and ab8500.
10 * ab4500 and ab8500 since they are another family of chip.
11 * 10 *
12 * Author: Mattias Wallin <mattias.wallin@stericsson.com> 11 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
13 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> 12 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
@@ -230,4 +229,5 @@ struct abx500_ops {
230}; 229};
231 230
232int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); 231int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
232void abx500_remove_ops(struct device *dev);
233#endif 233#endif
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 11d740b8831..cb93d80aa64 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -44,6 +44,9 @@ struct mfd_cell {
44 */ 44 */
45 int num_resources; 45 int num_resources;
46 const struct resource *resources; 46 const struct resource *resources;
47
48 /* don't check for resource conflicts */
49 bool ignore_resource_conflicts;
47}; 50};
48 51
49extern int mfd_add_devices(struct device *parent, int id, 52extern int mfd_add_devices(struct device *parent, int id,
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h
index 6dc75b3e2d3..7363dea6bbc 100644
--- a/include/linux/mfd/max8998-private.h
+++ b/include/linux/mfd/max8998-private.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8698.h - Voltage regulator driver for the Maxim 8998 2 * max8998.h - Voltage regulator driver for the Maxim 8998
3 * 3 *
4 * Copyright (C) 2009-2010 Samsung Electrnoics 4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
@@ -23,6 +23,8 @@
23#ifndef __LINUX_MFD_MAX8998_PRIV_H 23#ifndef __LINUX_MFD_MAX8998_PRIV_H
24#define __LINUX_MFD_MAX8998_PRIV_H 24#define __LINUX_MFD_MAX8998_PRIV_H
25 25
26#define MAX8998_NUM_IRQ_REGS 4
27
26/* MAX 8998 registers */ 28/* MAX 8998 registers */
27enum { 29enum {
28 MAX8998_REG_IRQ1, 30 MAX8998_REG_IRQ1,
@@ -46,12 +48,12 @@ enum {
46 MAX8998_REG_ONOFF2, 48 MAX8998_REG_ONOFF2,
47 MAX8998_REG_ONOFF3, 49 MAX8998_REG_ONOFF3,
48 MAX8998_REG_ONOFF4, 50 MAX8998_REG_ONOFF4,
49 MAX8998_REG_BUCK1_DVSARM1, 51 MAX8998_REG_BUCK1_VOLTAGE1,
50 MAX8998_REG_BUCK1_DVSARM2, 52 MAX8998_REG_BUCK1_VOLTAGE2,
51 MAX8998_REG_BUCK1_DVSARM3, 53 MAX8998_REG_BUCK1_VOLTAGE3,
52 MAX8998_REG_BUCK1_DVSARM4, 54 MAX8998_REG_BUCK1_VOLTAGE4,
53 MAX8998_REG_BUCK2_DVSINT1, 55 MAX8998_REG_BUCK2_VOLTAGE1,
54 MAX8998_REG_BUCK2_DVSINT2, 56 MAX8998_REG_BUCK2_VOLTAGE2,
55 MAX8998_REG_BUCK3, 57 MAX8998_REG_BUCK3,
56 MAX8998_REG_BUCK4, 58 MAX8998_REG_BUCK4,
57 MAX8998_REG_LDO2_LDO3, 59 MAX8998_REG_LDO2_LDO3,
@@ -72,41 +74,102 @@ enum {
72 MAX8998_REG_LBCNFG2, 74 MAX8998_REG_LBCNFG2,
73}; 75};
74 76
77/* IRQ definitions */
78enum {
79 MAX8998_IRQ_DCINF,
80 MAX8998_IRQ_DCINR,
81 MAX8998_IRQ_JIGF,
82 MAX8998_IRQ_JIGR,
83 MAX8998_IRQ_PWRONF,
84 MAX8998_IRQ_PWRONR,
85
86 MAX8998_IRQ_WTSREVNT,
87 MAX8998_IRQ_SMPLEVNT,
88 MAX8998_IRQ_ALARM1,
89 MAX8998_IRQ_ALARM0,
90
91 MAX8998_IRQ_ONKEY1S,
92 MAX8998_IRQ_TOPOFFR,
93 MAX8998_IRQ_DCINOVPR,
94 MAX8998_IRQ_CHGRSTF,
95 MAX8998_IRQ_DONER,
96 MAX8998_IRQ_CHGFAULT,
97
98 MAX8998_IRQ_LOBAT1,
99 MAX8998_IRQ_LOBAT2,
100
101 MAX8998_IRQ_NR,
102};
103
104/* MAX8998 various variants */
105enum {
106 TYPE_MAX8998 = 0, /* Default */
107 TYPE_LP3974, /* National version of MAX8998 */
108 TYPE_LP3979, /* Added AVS */
109};
110
111#define MAX8998_IRQ_DCINF_MASK (1 << 2)
112#define MAX8998_IRQ_DCINR_MASK (1 << 3)
113#define MAX8998_IRQ_JIGF_MASK (1 << 4)
114#define MAX8998_IRQ_JIGR_MASK (1 << 5)
115#define MAX8998_IRQ_PWRONF_MASK (1 << 6)
116#define MAX8998_IRQ_PWRONR_MASK (1 << 7)
117
118#define MAX8998_IRQ_WTSREVNT_MASK (1 << 0)
119#define MAX8998_IRQ_SMPLEVNT_MASK (1 << 1)
120#define MAX8998_IRQ_ALARM1_MASK (1 << 2)
121#define MAX8998_IRQ_ALARM0_MASK (1 << 3)
122
123#define MAX8998_IRQ_ONKEY1S_MASK (1 << 0)
124#define MAX8998_IRQ_TOPOFFR_MASK (1 << 2)
125#define MAX8998_IRQ_DCINOVPR_MASK (1 << 3)
126#define MAX8998_IRQ_CHGRSTF_MASK (1 << 4)
127#define MAX8998_IRQ_DONER_MASK (1 << 5)
128#define MAX8998_IRQ_CHGFAULT_MASK (1 << 7)
129
130#define MAX8998_IRQ_LOBAT1_MASK (1 << 0)
131#define MAX8998_IRQ_LOBAT2_MASK (1 << 1)
132
133#define MAX8998_ENRAMP (1 << 4)
134
75/** 135/**
76 * struct max8998_dev - max8998 master device for sub-drivers 136 * struct max8998_dev - max8998 master device for sub-drivers
77 * @dev: master device of the chip (can be used to access platform data) 137 * @dev: master device of the chip (can be used to access platform data)
78 * @i2c_client: i2c client private data 138 * @i2c: i2c client private data for regulator
79 * @dev_read(): chip register read function 139 * @rtc: i2c client private data for rtc
80 * @dev_write(): chip register write function
81 * @dev_update(): chip register update function
82 * @iolock: mutex for serializing io access 140 * @iolock: mutex for serializing io access
141 * @irqlock: mutex for buslock
142 * @irq_base: base IRQ number for max8998, required for IRQs
143 * @irq: generic IRQ number for max8998
144 * @ono: power onoff IRQ number for max8998
145 * @irq_masks_cur: currently active value
146 * @irq_masks_cache: cached hardware value
147 * @type: indicate which max8998 "variant" is used
83 */ 148 */
84
85struct max8998_dev { 149struct max8998_dev {
86 struct device *dev; 150 struct device *dev;
87 struct i2c_client *i2c_client; 151 struct i2c_client *i2c;
88 int (*dev_read)(struct max8998_dev *max8998, u8 reg, u8 *dest); 152 struct i2c_client *rtc;
89 int (*dev_write)(struct max8998_dev *max8998, u8 reg, u8 val);
90 int (*dev_update)(struct max8998_dev *max8998, u8 reg, u8 val, u8 mask);
91 struct mutex iolock; 153 struct mutex iolock;
154 struct mutex irqlock;
155
156 int irq_base;
157 int irq;
158 int ono;
159 u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS];
160 u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS];
161 int type;
92}; 162};
93 163
94static inline int max8998_read_reg(struct max8998_dev *max8998, u8 reg, 164int max8998_irq_init(struct max8998_dev *max8998);
95 u8 *value) 165void max8998_irq_exit(struct max8998_dev *max8998);
96{ 166
97 return max8998->dev_read(max8998, reg, value); 167extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
98} 168extern int max8998_bulk_read(struct i2c_client *i2c, u8 reg, int count,
99 169 u8 *buf);
100static inline int max8998_write_reg(struct max8998_dev *max8998, u8 reg, 170extern int max8998_write_reg(struct i2c_client *i2c, u8 reg, u8 value);
101 u8 value) 171extern int max8998_bulk_write(struct i2c_client *i2c, u8 reg, int count,
102{ 172 u8 *buf);
103 return max8998->dev_write(max8998, reg, value); 173extern int max8998_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);
104}
105
106static inline int max8998_update_reg(struct max8998_dev *max8998, u8 reg,
107 u8 value, u8 mask)
108{
109 return max8998->dev_update(max8998, reg, value, mask);
110}
111 174
112#endif /* __LINUX_MFD_MAX8998_PRIV_H */ 175#endif /* __LINUX_MFD_MAX8998_PRIV_H */
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h
index 1d3601a2d85..f8c9f884aff 100644
--- a/include/linux/mfd/max8998.h
+++ b/include/linux/mfd/max8998.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8698.h - Voltage regulator driver for the Maxim 8998 2 * max8998.h - Voltage regulator driver for the Maxim 8998
3 * 3 *
4 * Copyright (C) 2009-2010 Samsung Electrnoics 4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
@@ -66,13 +66,28 @@ struct max8998_regulator_data {
66 66
67/** 67/**
68 * struct max8998_board - packages regulator init data 68 * struct max8998_board - packages regulator init data
69 * @num_regulators: number of regultors used
70 * @regulators: array of defined regulators 69 * @regulators: array of defined regulators
70 * @num_regulators: number of regultors used
71 * @irq_base: base IRQ number for max8998, required for IRQs
72 * @ono: power onoff IRQ number for max8998
73 * @buck1_max_voltage1: BUCK1 maximum alowed voltage register 1
74 * @buck1_max_voltage2: BUCK1 maximum alowed voltage register 2
75 * @buck2_max_voltage: BUCK2 maximum alowed voltage
76 * @buck1_set1: BUCK1 gpio pin 1 to set output voltage
77 * @buck1_set2: BUCK1 gpio pin 2 to set output voltage
78 * @buck2_set3: BUCK2 gpio pin to set output voltage
71 */ 79 */
72
73struct max8998_platform_data { 80struct max8998_platform_data {
74 int num_regulators;
75 struct max8998_regulator_data *regulators; 81 struct max8998_regulator_data *regulators;
82 int num_regulators;
83 int irq_base;
84 int ono;
85 int buck1_max_voltage1;
86 int buck1_max_voltage2;
87 int buck2_max_voltage;
88 int buck1_set1;
89 int buck1_set2;
90 int buck2_set3;
76}; 91};
77 92
78#endif /* __LINUX_MFD_MAX8998_H */ 93#endif /* __LINUX_MFD_MAX8998_H */
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 0fa44fb8dd2..b4c741e352c 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2009 Pengutronix 2 * Copyright 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> 3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it under 5 * This program is free software; you can redistribute it and/or modify it under
@@ -9,48 +9,83 @@
9#ifndef __LINUX_MFD_MC13783_H 9#ifndef __LINUX_MFD_MC13783_H
10#define __LINUX_MFD_MC13783_H 10#define __LINUX_MFD_MC13783_H
11 11
12#include <linux/interrupt.h> 12#include <linux/mfd/mc13xxx.h>
13 13
14struct mc13783; 14struct mc13783;
15 15
16void mc13783_lock(struct mc13783 *mc13783); 16struct mc13xxx *mc13783_to_mc13xxx(struct mc13783 *mc13783);
17void mc13783_unlock(struct mc13783 *mc13783);
18 17
19int mc13783_reg_read(struct mc13783 *mc13783, unsigned int offset, u32 *val); 18static inline void mc13783_lock(struct mc13783 *mc13783)
20int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val); 19{
21int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset, 20 mc13xxx_lock(mc13783_to_mc13xxx(mc13783));
22 u32 mask, u32 val); 21}
22
23static inline void mc13783_unlock(struct mc13783 *mc13783)
24{
25 mc13xxx_unlock(mc13783_to_mc13xxx(mc13783));
26}
27
28static inline int mc13783_reg_read(struct mc13783 *mc13783,
29 unsigned int offset, u32 *val)
30{
31 return mc13xxx_reg_read(mc13783_to_mc13xxx(mc13783), offset, val);
32}
33
34static inline int mc13783_reg_write(struct mc13783 *mc13783,
35 unsigned int offset, u32 val)
36{
37 return mc13xxx_reg_write(mc13783_to_mc13xxx(mc13783), offset, val);
38}
39
40static inline int mc13783_reg_rmw(struct mc13783 *mc13783,
41 unsigned int offset, u32 mask, u32 val)
42{
43 return mc13xxx_reg_rmw(mc13783_to_mc13xxx(mc13783), offset, mask, val);
44}
23 45
24int mc13783_get_flags(struct mc13783 *mc13783); 46static inline int mc13783_get_flags(struct mc13783 *mc13783)
47{
48 return mc13xxx_get_flags(mc13783_to_mc13xxx(mc13783));
49}
25 50
26int mc13783_irq_request(struct mc13783 *mc13783, int irq, 51static inline int mc13783_irq_request(struct mc13783 *mc13783, int irq,
27 irq_handler_t handler, const char *name, void *dev); 52 irq_handler_t handler, const char *name, void *dev)
28int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, 53{
29 irq_handler_t handler, const char *name, void *dev); 54 return mc13xxx_irq_request(mc13783_to_mc13xxx(mc13783), irq,
30int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev); 55 handler, name, dev);
56}
31 57
32int mc13783_irq_mask(struct mc13783 *mc13783, int irq); 58static inline int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
33int mc13783_irq_unmask(struct mc13783 *mc13783, int irq); 59 irq_handler_t handler, const char *name, void *dev)
34int mc13783_irq_status(struct mc13783 *mc13783, int irq, 60{
35 int *enabled, int *pending); 61 return mc13xxx_irq_request_nounmask(mc13783_to_mc13xxx(mc13783), irq,
36int mc13783_irq_ack(struct mc13783 *mc13783, int irq); 62 handler, name, dev);
63}
37 64
38static inline int mc13783_mask(struct mc13783 *mc13783, int irq) __deprecated; 65static inline int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev)
39static inline int mc13783_mask(struct mc13783 *mc13783, int irq)
40{ 66{
41 return mc13783_irq_mask(mc13783, irq); 67 return mc13xxx_irq_free(mc13783_to_mc13xxx(mc13783), irq, dev);
42} 68}
43 69
44static inline int mc13783_unmask(struct mc13783 *mc13783, int irq) __deprecated; 70static inline int mc13783_irq_mask(struct mc13783 *mc13783, int irq)
45static inline int mc13783_unmask(struct mc13783 *mc13783, int irq)
46{ 71{
47 return mc13783_irq_unmask(mc13783, irq); 72 return mc13xxx_irq_mask(mc13783_to_mc13xxx(mc13783), irq);
48} 73}
49 74
50static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) __deprecated; 75static inline int mc13783_irq_unmask(struct mc13783 *mc13783, int irq)
51static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
52{ 76{
53 return mc13783_irq_ack(mc13783, irq); 77 return mc13xxx_irq_unmask(mc13783_to_mc13xxx(mc13783), irq);
78}
79static inline int mc13783_irq_status(struct mc13783 *mc13783, int irq,
80 int *enabled, int *pending)
81{
82 return mc13xxx_irq_status(mc13783_to_mc13xxx(mc13783),
83 irq, enabled, pending);
84}
85
86static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
87{
88 return mc13xxx_irq_ack(mc13783_to_mc13xxx(mc13783), irq);
54} 89}
55 90
56#define MC13783_ADC0 43 91#define MC13783_ADC0 43
@@ -66,96 +101,18 @@ static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
66 MC13783_ADC0_TSMOD1 | \ 101 MC13783_ADC0_TSMOD1 | \
67 MC13783_ADC0_TSMOD2) 102 MC13783_ADC0_TSMOD2)
68 103
69struct mc13783_led_platform_data { 104#define mc13783_regulator_init_data mc13xxx_regulator_init_data
70#define MC13783_LED_MD 0 105#define mc13783_regulator_platform_data mc13xxx_regulator_platform_data
71#define MC13783_LED_AD 1 106#define mc13783_led_platform_data mc13xxx_led_platform_data
72#define MC13783_LED_KP 2 107#define mc13783_leds_platform_data mc13xxx_leds_platform_data
73#define MC13783_LED_R1 3 108
74#define MC13783_LED_G1 4 109#define mc13783_platform_data mc13xxx_platform_data
75#define MC13783_LED_B1 5 110#define MC13783_USE_TOUCHSCREEN MC13XXX_USE_TOUCHSCREEN
76#define MC13783_LED_R2 6 111#define MC13783_USE_CODEC MC13XXX_USE_CODEC
77#define MC13783_LED_G2 7 112#define MC13783_USE_ADC MC13XXX_USE_ADC
78#define MC13783_LED_B2 8 113#define MC13783_USE_RTC MC13XXX_USE_RTC
79#define MC13783_LED_R3 9 114#define MC13783_USE_REGULATOR MC13XXX_USE_REGULATOR
80#define MC13783_LED_G3 10 115#define MC13783_USE_LED MC13XXX_USE_LED
81#define MC13783_LED_B3 11
82#define MC13783_LED_MAX MC13783_LED_B3
83 int id;
84 const char *name;
85 const char *default_trigger;
86
87/* Three or two bits current selection depending on the led */
88 char max_current;
89};
90
91struct mc13783_leds_platform_data {
92 int num_leds;
93 struct mc13783_led_platform_data *led;
94
95#define MC13783_LED_TRIODE_MD (1 << 0)
96#define MC13783_LED_TRIODE_AD (1 << 1)
97#define MC13783_LED_TRIODE_KP (1 << 2)
98#define MC13783_LED_BOOST_EN (1 << 3)
99#define MC13783_LED_TC1HALF (1 << 4)
100#define MC13783_LED_SLEWLIMTC (1 << 5)
101#define MC13783_LED_SLEWLIMBL (1 << 6)
102#define MC13783_LED_TRIODE_TC1 (1 << 7)
103#define MC13783_LED_TRIODE_TC2 (1 << 8)
104#define MC13783_LED_TRIODE_TC3 (1 << 9)
105 int flags;
106
107#define MC13783_LED_AB_DISABLED 0
108#define MC13783_LED_AB_MD1 1
109#define MC13783_LED_AB_MD12 2
110#define MC13783_LED_AB_MD123 3
111#define MC13783_LED_AB_MD1234 4
112#define MC13783_LED_AB_MD1234_AD1 5
113#define MC13783_LED_AB_MD1234_AD12 6
114#define MC13783_LED_AB_MD1_AD 7
115 char abmode;
116
117#define MC13783_LED_ABREF_200MV 0
118#define MC13783_LED_ABREF_400MV 1
119#define MC13783_LED_ABREF_600MV 2
120#define MC13783_LED_ABREF_800MV 3
121 char abref;
122
123#define MC13783_LED_PERIOD_10MS 0
124#define MC13783_LED_PERIOD_100MS 1
125#define MC13783_LED_PERIOD_500MS 2
126#define MC13783_LED_PERIOD_2S 3
127 char bl_period;
128 char tc1_period;
129 char tc2_period;
130 char tc3_period;
131};
132
133/* to be cleaned up */
134struct regulator_init_data;
135
136struct mc13783_regulator_init_data {
137 int id;
138 struct regulator_init_data *init_data;
139};
140
141struct mc13783_regulator_platform_data {
142 int num_regulators;
143 struct mc13783_regulator_init_data *regulators;
144};
145
146struct mc13783_platform_data {
147 int num_regulators;
148 struct mc13783_regulator_init_data *regulators;
149 struct mc13783_leds_platform_data *leds;
150
151#define MC13783_USE_TOUCHSCREEN (1 << 0)
152#define MC13783_USE_CODEC (1 << 1)
153#define MC13783_USE_ADC (1 << 2)
154#define MC13783_USE_RTC (1 << 3)
155#define MC13783_USE_REGULATOR (1 << 4)
156#define MC13783_USE_LED (1 << 5)
157 unsigned int flags;
158};
159 116
160#define MC13783_ADC_MODE_TS 1 117#define MC13783_ADC_MODE_TS 1
161#define MC13783_ADC_MODE_SINGLE_CHAN 2 118#define MC13783_ADC_MODE_SINGLE_CHAN 2
@@ -199,46 +156,46 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
199#define MC13783_REGU_PWGT1SPI 31 156#define MC13783_REGU_PWGT1SPI 31
200#define MC13783_REGU_PWGT2SPI 32 157#define MC13783_REGU_PWGT2SPI 32
201 158
202#define MC13783_IRQ_ADCDONE 0 159#define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE
203#define MC13783_IRQ_ADCBISDONE 1 160#define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE
204#define MC13783_IRQ_TS 2 161#define MC13783_IRQ_TS MC13XXX_IRQ_TS
205#define MC13783_IRQ_WHIGH 3 162#define MC13783_IRQ_WHIGH 3
206#define MC13783_IRQ_WLOW 4 163#define MC13783_IRQ_WLOW 4
207#define MC13783_IRQ_CHGDET 6 164#define MC13783_IRQ_CHGDET MC13XXX_IRQ_CHGDET
208#define MC13783_IRQ_CHGOV 7 165#define MC13783_IRQ_CHGOV 7
209#define MC13783_IRQ_CHGREV 8 166#define MC13783_IRQ_CHGREV MC13XXX_IRQ_CHGREV
210#define MC13783_IRQ_CHGSHORT 9 167#define MC13783_IRQ_CHGSHORT MC13XXX_IRQ_CHGSHORT
211#define MC13783_IRQ_CCCV 10 168#define MC13783_IRQ_CCCV MC13XXX_IRQ_CCCV
212#define MC13783_IRQ_CHGCURR 11 169#define MC13783_IRQ_CHGCURR MC13XXX_IRQ_CHGCURR
213#define MC13783_IRQ_BPON 12 170#define MC13783_IRQ_BPON MC13XXX_IRQ_BPON
214#define MC13783_IRQ_LOBATL 13 171#define MC13783_IRQ_LOBATL MC13XXX_IRQ_LOBATL
215#define MC13783_IRQ_LOBATH 14 172#define MC13783_IRQ_LOBATH MC13XXX_IRQ_LOBATH
216#define MC13783_IRQ_UDP 15 173#define MC13783_IRQ_UDP 15
217#define MC13783_IRQ_USB 16 174#define MC13783_IRQ_USB 16
218#define MC13783_IRQ_ID 19 175#define MC13783_IRQ_ID 19
219#define MC13783_IRQ_SE1 21 176#define MC13783_IRQ_SE1 21
220#define MC13783_IRQ_CKDET 22 177#define MC13783_IRQ_CKDET 22
221#define MC13783_IRQ_UDM 23 178#define MC13783_IRQ_UDM 23
222#define MC13783_IRQ_1HZ 24 179#define MC13783_IRQ_1HZ MC13XXX_IRQ_1HZ
223#define MC13783_IRQ_TODA 25 180#define MC13783_IRQ_TODA MC13XXX_IRQ_TODA
224#define MC13783_IRQ_ONOFD1 27 181#define MC13783_IRQ_ONOFD1 27
225#define MC13783_IRQ_ONOFD2 28 182#define MC13783_IRQ_ONOFD2 28
226#define MC13783_IRQ_ONOFD3 29 183#define MC13783_IRQ_ONOFD3 29
227#define MC13783_IRQ_SYSRST 30 184#define MC13783_IRQ_SYSRST MC13XXX_IRQ_SYSRST
228#define MC13783_IRQ_RTCRST 31 185#define MC13783_IRQ_RTCRST MC13XXX_IRQ_RTCRST
229#define MC13783_IRQ_PC 32 186#define MC13783_IRQ_PC MC13XXX_IRQ_PC
230#define MC13783_IRQ_WARM 33 187#define MC13783_IRQ_WARM MC13XXX_IRQ_WARM
231#define MC13783_IRQ_MEMHLD 34 188#define MC13783_IRQ_MEMHLD MC13XXX_IRQ_MEMHLD
232#define MC13783_IRQ_PWRRDY 35 189#define MC13783_IRQ_PWRRDY 35
233#define MC13783_IRQ_THWARNL 36 190#define MC13783_IRQ_THWARNL MC13XXX_IRQ_THWARNL
234#define MC13783_IRQ_THWARNH 37 191#define MC13783_IRQ_THWARNH MC13XXX_IRQ_THWARNH
235#define MC13783_IRQ_CLK 38 192#define MC13783_IRQ_CLK MC13XXX_IRQ_CLK
236#define MC13783_IRQ_SEMAF 39 193#define MC13783_IRQ_SEMAF 39
237#define MC13783_IRQ_MC2B 41 194#define MC13783_IRQ_MC2B 41
238#define MC13783_IRQ_HSDET 42 195#define MC13783_IRQ_HSDET 42
239#define MC13783_IRQ_HSL 43 196#define MC13783_IRQ_HSL 43
240#define MC13783_IRQ_ALSPTH 44 197#define MC13783_IRQ_ALSPTH 44
241#define MC13783_IRQ_AHSSHORT 45 198#define MC13783_IRQ_AHSSHORT 45
242#define MC13783_NUM_IRQ 46 199#define MC13783_NUM_IRQ MC13XXX_NUM_IRQ
243 200
244#endif /* __LINUX_MFD_MC13783_H */ 201#endif /* ifndef __LINUX_MFD_MC13783_H */
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
new file mode 100644
index 00000000000..a1d391b40e6
--- /dev/null
+++ b/include/linux/mfd/mc13xxx.h
@@ -0,0 +1,154 @@
1/*
2 * Copyright 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#ifndef __LINUX_MFD_MC13XXX_H
10#define __LINUX_MFD_MC13XXX_H
11
12#include <linux/interrupt.h>
13
14struct mc13xxx;
15
16void mc13xxx_lock(struct mc13xxx *mc13xxx);
17void mc13xxx_unlock(struct mc13xxx *mc13xxx);
18
19int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val);
20int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val);
21int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset,
22 u32 mask, u32 val);
23
24int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
25
26int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq,
27 irq_handler_t handler, const char *name, void *dev);
28int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq,
29 irq_handler_t handler, const char *name, void *dev);
30int mc13xxx_irq_free(struct mc13xxx *mc13xxx, int irq, void *dev);
31
32int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq);
33int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq);
34int mc13xxx_irq_status(struct mc13xxx *mc13xxx, int irq,
35 int *enabled, int *pending);
36int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq);
37
38int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
39
40#define MC13XXX_IRQ_ADCDONE 0
41#define MC13XXX_IRQ_ADCBISDONE 1
42#define MC13XXX_IRQ_TS 2
43#define MC13XXX_IRQ_CHGDET 6
44#define MC13XXX_IRQ_CHGREV 8
45#define MC13XXX_IRQ_CHGSHORT 9
46#define MC13XXX_IRQ_CCCV 10
47#define MC13XXX_IRQ_CHGCURR 11
48#define MC13XXX_IRQ_BPON 12
49#define MC13XXX_IRQ_LOBATL 13
50#define MC13XXX_IRQ_LOBATH 14
51#define MC13XXX_IRQ_1HZ 24
52#define MC13XXX_IRQ_TODA 25
53#define MC13XXX_IRQ_SYSRST 30
54#define MC13XXX_IRQ_RTCRST 31
55#define MC13XXX_IRQ_PC 32
56#define MC13XXX_IRQ_WARM 33
57#define MC13XXX_IRQ_MEMHLD 34
58#define MC13XXX_IRQ_THWARNL 36
59#define MC13XXX_IRQ_THWARNH 37
60#define MC13XXX_IRQ_CLK 38
61
62#define MC13XXX_NUM_IRQ 46
63
64struct regulator_init_data;
65
66struct mc13xxx_regulator_init_data {
67 int id;
68 struct regulator_init_data *init_data;
69};
70
71struct mc13xxx_regulator_platform_data {
72 int num_regulators;
73 struct mc13xxx_regulator_init_data *regulators;
74};
75
76struct mc13xxx_led_platform_data {
77#define MC13783_LED_MD 0
78#define MC13783_LED_AD 1
79#define MC13783_LED_KP 2
80#define MC13783_LED_R1 3
81#define MC13783_LED_G1 4
82#define MC13783_LED_B1 5
83#define MC13783_LED_R2 6
84#define MC13783_LED_G2 7
85#define MC13783_LED_B2 8
86#define MC13783_LED_R3 9
87#define MC13783_LED_G3 10
88#define MC13783_LED_B3 11
89#define MC13783_LED_MAX MC13783_LED_B3
90 int id;
91 const char *name;
92 const char *default_trigger;
93
94/* Three or two bits current selection depending on the led */
95 char max_current;
96};
97
98struct mc13xxx_leds_platform_data {
99 int num_leds;
100 struct mc13xxx_led_platform_data *led;
101
102#define MC13783_LED_TRIODE_MD (1 << 0)
103#define MC13783_LED_TRIODE_AD (1 << 1)
104#define MC13783_LED_TRIODE_KP (1 << 2)
105#define MC13783_LED_BOOST_EN (1 << 3)
106#define MC13783_LED_TC1HALF (1 << 4)
107#define MC13783_LED_SLEWLIMTC (1 << 5)
108#define MC13783_LED_SLEWLIMBL (1 << 6)
109#define MC13783_LED_TRIODE_TC1 (1 << 7)
110#define MC13783_LED_TRIODE_TC2 (1 << 8)
111#define MC13783_LED_TRIODE_TC3 (1 << 9)
112 int flags;
113
114#define MC13783_LED_AB_DISABLED 0
115#define MC13783_LED_AB_MD1 1
116#define MC13783_LED_AB_MD12 2
117#define MC13783_LED_AB_MD123 3
118#define MC13783_LED_AB_MD1234 4
119#define MC13783_LED_AB_MD1234_AD1 5
120#define MC13783_LED_AB_MD1234_AD12 6
121#define MC13783_LED_AB_MD1_AD 7
122 char abmode;
123
124#define MC13783_LED_ABREF_200MV 0
125#define MC13783_LED_ABREF_400MV 1
126#define MC13783_LED_ABREF_600MV 2
127#define MC13783_LED_ABREF_800MV 3
128 char abref;
129
130#define MC13783_LED_PERIOD_10MS 0
131#define MC13783_LED_PERIOD_100MS 1
132#define MC13783_LED_PERIOD_500MS 2
133#define MC13783_LED_PERIOD_2S 3
134 char bl_period;
135 char tc1_period;
136 char tc2_period;
137 char tc3_period;
138};
139
140struct mc13xxx_platform_data {
141#define MC13XXX_USE_TOUCHSCREEN (1 << 0)
142#define MC13XXX_USE_CODEC (1 << 1)
143#define MC13XXX_USE_ADC (1 << 2)
144#define MC13XXX_USE_RTC (1 << 3)
145#define MC13XXX_USE_REGULATOR (1 << 4)
146#define MC13XXX_USE_LED (1 << 5)
147 unsigned int flags;
148
149 int num_regulators;
150 struct mc13xxx_regulator_init_data *regulators;
151 struct mc13xxx_leds_platform_data *leds;
152};
153
154#endif /* ifndef __LINUX_MFD_MC13XXX_H */
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index ad411a78870..50d4a047118 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -227,4 +227,11 @@ static inline struct pcf50633 *dev_to_pcf50633(struct device *dev)
227 return dev_get_drvdata(dev); 227 return dev_get_drvdata(dev);
228} 228}
229 229
230int pcf50633_irq_init(struct pcf50633 *pcf, int irq);
231void pcf50633_irq_free(struct pcf50633 *pcf);
232#ifdef CONFIG_PM
233int pcf50633_irq_suspend(struct pcf50633 *pcf);
234int pcf50633_irq_resume(struct pcf50633 *pcf);
235#endif
236
230#endif 237#endif
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
index 49067802a6d..c981b959760 100644
--- a/include/linux/mfd/sh_mobile_sdhi.h
+++ b/include/linux/mfd/sh_mobile_sdhi.h
@@ -7,8 +7,10 @@ struct sh_mobile_sdhi_info {
7 int dma_slave_tx; 7 int dma_slave_tx;
8 int dma_slave_rx; 8 int dma_slave_rx;
9 unsigned long tmio_flags; 9 unsigned long tmio_flags;
10 unsigned long tmio_caps;
10 u32 tmio_ocr_mask; /* available MMC voltages */ 11 u32 tmio_ocr_mask; /* available MMC voltages */
11 void (*set_pwr)(struct platform_device *pdev, int state); 12 void (*set_pwr)(struct platform_device *pdev, int state);
13 int (*get_cd)(struct platform_device *pdev);
12}; 14};
13 15
14#endif /* __SH_MOBILE_SDHI_H__ */ 16#endif /* __SH_MOBILE_SDHI_H__ */
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
index 39ca7588659..e762c270d8d 100644
--- a/include/linux/mfd/stmpe.h
+++ b/include/linux/mfd/stmpe.h
@@ -112,13 +112,19 @@ struct stmpe_keypad_platform_data {
112 bool no_autorepeat; 112 bool no_autorepeat;
113}; 113};
114 114
115#define STMPE_GPIO_NOREQ_811_TOUCH (0xf0)
116
115/** 117/**
116 * struct stmpe_gpio_platform_data - STMPE GPIO platform data 118 * struct stmpe_gpio_platform_data - STMPE GPIO platform data
117 * @gpio_base: first gpio number assigned. A maximum of 119 * @gpio_base: first gpio number assigned. A maximum of
118 * %STMPE_NR_GPIOS GPIOs will be allocated. 120 * %STMPE_NR_GPIOS GPIOs will be allocated.
121 * @norequest_mask: bitmask specifying which GPIOs should _not_ be
122 * requestable due to different usage (e.g. touch, keypad)
123 * STMPE_GPIO_NOREQ_* macros can be used here.
119 */ 124 */
120struct stmpe_gpio_platform_data { 125struct stmpe_gpio_platform_data {
121 int gpio_base; 126 int gpio_base;
127 unsigned norequest_mask;
122 void (*setup)(struct stmpe *stmpe, unsigned gpio_base); 128 void (*setup)(struct stmpe *stmpe, unsigned gpio_base);
123 void (*remove)(struct stmpe *stmpe, unsigned gpio_base); 129 void (*remove)(struct stmpe *stmpe, unsigned gpio_base);
124}; 130};
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index f07425bc3dc..085f041197d 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -52,6 +52,11 @@
52 52
53/* tmio MMC platform flags */ 53/* tmio MMC platform flags */
54#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0) 54#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0)
55/*
56 * Some controllers can support a 2-byte block size when the bus width
57 * is configured in 4-bit mode.
58 */
59#define TMIO_MMC_BLKSZ_2BYTES (1 << 1)
55 60
56int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 61int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
57int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 62int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
@@ -74,6 +79,7 @@ struct tmio_mmc_data {
74 struct tmio_mmc_dma *dma; 79 struct tmio_mmc_dma *dma;
75 void (*set_pwr)(struct platform_device *host, int state); 80 void (*set_pwr)(struct platform_device *host, int state);
76 void (*set_clk_div)(struct platform_device *host, int state); 81 void (*set_clk_div)(struct platform_device *host, int state);
82 int (*get_cd)(struct platform_device *host);
77}; 83};
78 84
79/* 85/*
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index 772b3ae640a..b6bab1b04e2 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -18,6 +18,36 @@ enum {
18 TPS6586X_ID_LDO_RTC, 18 TPS6586X_ID_LDO_RTC,
19}; 19};
20 20
21enum {
22 TPS6586X_INT_PLDO_0,
23 TPS6586X_INT_PLDO_1,
24 TPS6586X_INT_PLDO_2,
25 TPS6586X_INT_PLDO_3,
26 TPS6586X_INT_PLDO_4,
27 TPS6586X_INT_PLDO_5,
28 TPS6586X_INT_PLDO_6,
29 TPS6586X_INT_PLDO_7,
30 TPS6586X_INT_COMP_DET,
31 TPS6586X_INT_ADC,
32 TPS6586X_INT_PLDO_8,
33 TPS6586X_INT_PLDO_9,
34 TPS6586X_INT_PSM_0,
35 TPS6586X_INT_PSM_1,
36 TPS6586X_INT_PSM_2,
37 TPS6586X_INT_PSM_3,
38 TPS6586X_INT_RTC_ALM1,
39 TPS6586X_INT_ACUSB_OVP,
40 TPS6586X_INT_USB_DET,
41 TPS6586X_INT_AC_DET,
42 TPS6586X_INT_BAT_DET,
43 TPS6586X_INT_CHG_STAT,
44 TPS6586X_INT_CHG_TEMP,
45 TPS6586X_INT_PP,
46 TPS6586X_INT_RESUME,
47 TPS6586X_INT_LOW_SYS,
48 TPS6586X_INT_RTC_ALM2,
49};
50
21struct tps6586x_subdev_info { 51struct tps6586x_subdev_info {
22 int id; 52 int id;
23 const char *name; 53 const char *name;
@@ -29,6 +59,7 @@ struct tps6586x_platform_data {
29 struct tps6586x_subdev_info *subdevs; 59 struct tps6586x_subdev_info *subdevs;
30 60
31 int gpio_base; 61 int gpio_base;
62 int irq_base;
32}; 63};
33 64
34/* 65/*
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index eb5bd4e0e03..a1239c48b41 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -238,6 +238,15 @@ struct regulator_dev;
238 238
239#define WM831X_NUM_IRQ_REGS 5 239#define WM831X_NUM_IRQ_REGS 5
240 240
241enum wm831x_parent {
242 WM8310 = 0x8310,
243 WM8311 = 0x8311,
244 WM8312 = 0x8312,
245 WM8320 = 0x8320,
246 WM8321 = 0x8321,
247 WM8325 = 0x8325,
248};
249
241struct wm831x { 250struct wm831x {
242 struct mutex io_lock; 251 struct mutex io_lock;
243 252
@@ -285,6 +294,9 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
285int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, 294int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
286 int count, u16 *buf); 295 int count, u16 *buf);
287 296
297int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq);
298void wm831x_device_exit(struct wm831x *wm831x);
299int wm831x_device_suspend(struct wm831x *wm831x);
288int wm831x_irq_init(struct wm831x *wm831x, int irq); 300int wm831x_irq_init(struct wm831x *wm831x, int irq);
289void wm831x_irq_exit(struct wm831x *wm831x); 301void wm831x_irq_exit(struct wm831x *wm831x);
290 302
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 7238231b8dd..085527fb826 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -14,6 +14,8 @@ extern int migrate_page(struct address_space *,
14 struct page *, struct page *); 14 struct page *, struct page *);
15extern int migrate_pages(struct list_head *l, new_page_t x, 15extern int migrate_pages(struct list_head *l, new_page_t x,
16 unsigned long private, int offlining); 16 unsigned long private, int offlining);
17extern int migrate_huge_pages(struct list_head *l, new_page_t x,
18 unsigned long private, int offlining);
17 19
18extern int fail_migrate_page(struct address_space *, 20extern int fail_migrate_page(struct address_space *,
19 struct page *, struct page *); 21 struct page *, struct page *);
@@ -23,12 +25,17 @@ extern int migrate_prep_local(void);
23extern int migrate_vmas(struct mm_struct *mm, 25extern int migrate_vmas(struct mm_struct *mm,
24 const nodemask_t *from, const nodemask_t *to, 26 const nodemask_t *from, const nodemask_t *to,
25 unsigned long flags); 27 unsigned long flags);
28extern void migrate_page_copy(struct page *newpage, struct page *page);
29extern int migrate_huge_page_move_mapping(struct address_space *mapping,
30 struct page *newpage, struct page *page);
26#else 31#else
27#define PAGE_MIGRATION 0 32#define PAGE_MIGRATION 0
28 33
29static inline void putback_lru_pages(struct list_head *l) {} 34static inline void putback_lru_pages(struct list_head *l) {}
30static inline int migrate_pages(struct list_head *l, new_page_t x, 35static inline int migrate_pages(struct list_head *l, new_page_t x,
31 unsigned long private, int offlining) { return -ENOSYS; } 36 unsigned long private, int offlining) { return -ENOSYS; }
37static inline int migrate_huge_pages(struct list_head *l, new_page_t x,
38 unsigned long private, int offlining) { return -ENOSYS; }
32 39
33static inline int migrate_prep(void) { return -ENOSYS; } 40static inline int migrate_prep(void) { return -ENOSYS; }
34static inline int migrate_prep_local(void) { return -ENOSYS; } 41static inline int migrate_prep_local(void) { return -ENOSYS; }
@@ -40,6 +47,15 @@ static inline int migrate_vmas(struct mm_struct *mm,
40 return -ENOSYS; 47 return -ENOSYS;
41} 48}
42 49
50static inline void migrate_page_copy(struct page *newpage,
51 struct page *page) {}
52
53static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
54 struct page *newpage, struct page *page)
55{
56 return -ENOSYS;
57}
58
43/* Possible settings for the migrate_page() method in address_operations */ 59/* Possible settings for the migrate_page() method in address_operations */
44#define migrate_page NULL 60#define migrate_page NULL
45#define fail_migrate_page NULL 61#define fail_migrate_page NULL
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 0f82293a82e..9a18667c13c 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -56,7 +56,9 @@ enum {
56 MLX4_CMD_QUERY_HCA = 0xb, 56 MLX4_CMD_QUERY_HCA = 0xb,
57 MLX4_CMD_QUERY_PORT = 0x43, 57 MLX4_CMD_QUERY_PORT = 0x43,
58 MLX4_CMD_SENSE_PORT = 0x4d, 58 MLX4_CMD_SENSE_PORT = 0x4d,
59 MLX4_CMD_HW_HEALTH_CHECK = 0x50,
59 MLX4_CMD_SET_PORT = 0xc, 60 MLX4_CMD_SET_PORT = 0xc,
61 MLX4_CMD_SET_NODE = 0x5a,
60 MLX4_CMD_ACCESS_DDR = 0x2e, 62 MLX4_CMD_ACCESS_DDR = 0x2e,
61 MLX4_CMD_MAP_ICM = 0xffa, 63 MLX4_CMD_MAP_ICM = 0xffa,
62 MLX4_CMD_UNMAP_ICM = 0xff9, 64 MLX4_CMD_UNMAP_ICM = 0xff9,
@@ -140,6 +142,7 @@ enum {
140 MLX4_SET_PORT_MAC_TABLE = 0x2, 142 MLX4_SET_PORT_MAC_TABLE = 0x2,
141 MLX4_SET_PORT_VLAN_TABLE = 0x3, 143 MLX4_SET_PORT_VLAN_TABLE = 0x3,
142 MLX4_SET_PORT_PRIO_MAP = 0x4, 144 MLX4_SET_PORT_PRIO_MAP = 0x4,
145 MLX4_SET_PORT_GID_TABLE = 0x5,
143}; 146};
144 147
145struct mlx4_dev; 148struct mlx4_dev;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 7a7f9c1e679..a7b15bc7648 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -67,7 +67,8 @@ enum {
67 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, 67 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18,
68 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, 68 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19,
69 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, 69 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20,
70 MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21 70 MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21,
71 MLX4_DEV_CAP_FLAG_IBOE = 1 << 30
71}; 72};
72 73
73enum { 74enum {
@@ -171,6 +172,10 @@ enum {
171 MLX4_NUM_FEXCH = 64 * 1024, 172 MLX4_NUM_FEXCH = 64 * 1024,
172}; 173};
173 174
175enum {
176 MLX4_MAX_FAST_REG_PAGES = 511,
177};
178
174static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 179static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
175{ 180{
176 return (major << 32) | (minor << 16) | subminor; 181 return (major << 32) | (minor << 16) | subminor;
@@ -186,6 +191,10 @@ struct mlx4_caps {
186 int eth_mtu_cap[MLX4_MAX_PORTS + 1]; 191 int eth_mtu_cap[MLX4_MAX_PORTS + 1];
187 int gid_table_len[MLX4_MAX_PORTS + 1]; 192 int gid_table_len[MLX4_MAX_PORTS + 1];
188 int pkey_table_len[MLX4_MAX_PORTS + 1]; 193 int pkey_table_len[MLX4_MAX_PORTS + 1];
194 int trans_type[MLX4_MAX_PORTS + 1];
195 int vendor_oui[MLX4_MAX_PORTS + 1];
196 int wavelength[MLX4_MAX_PORTS + 1];
197 u64 trans_code[MLX4_MAX_PORTS + 1];
189 int local_ca_ack_delay; 198 int local_ca_ack_delay;
190 int num_uars; 199 int num_uars;
191 int bf_reg_size; 200 int bf_reg_size;
@@ -229,6 +238,8 @@ struct mlx4_caps {
229 u32 bmme_flags; 238 u32 bmme_flags;
230 u32 reserved_lkey; 239 u32 reserved_lkey;
231 u16 stat_rate_support; 240 u16 stat_rate_support;
241 int udp_rss;
242 int loopback_support;
232 u8 port_width_cap[MLX4_MAX_PORTS + 1]; 243 u8 port_width_cap[MLX4_MAX_PORTS + 1];
233 int max_gso_sz; 244 int max_gso_sz;
234 int reserved_qps_cnt[MLX4_NUM_QP_REGION]; 245 int reserved_qps_cnt[MLX4_NUM_QP_REGION];
@@ -373,6 +384,27 @@ struct mlx4_av {
373 u8 dgid[16]; 384 u8 dgid[16];
374}; 385};
375 386
387struct mlx4_eth_av {
388 __be32 port_pd;
389 u8 reserved1;
390 u8 smac_idx;
391 u16 reserved2;
392 u8 reserved3;
393 u8 gid_index;
394 u8 stat_rate;
395 u8 hop_limit;
396 __be32 sl_tclass_flowlabel;
397 u8 dgid[16];
398 u32 reserved4[2];
399 __be16 vlan;
400 u8 mac[6];
401};
402
403union mlx4_ext_av {
404 struct mlx4_av ib;
405 struct mlx4_eth_av eth;
406};
407
376struct mlx4_dev { 408struct mlx4_dev {
377 struct pci_dev *pdev; 409 struct pci_dev *pdev;
378 unsigned long flags; 410 unsigned long flags;
@@ -401,6 +433,12 @@ struct mlx4_init_port_param {
401 if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ 433 if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \
402 ~(dev)->caps.port_mask) & 1 << ((port) - 1)) 434 ~(dev)->caps.port_mask) & 1 << ((port) - 1))
403 435
436#define mlx4_foreach_ib_transport_port(port, dev) \
437 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
438 if (((dev)->caps.port_mask & 1 << ((port) - 1)) || \
439 ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE))
440
441
404int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, 442int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
405 struct mlx4_buf *buf); 443 struct mlx4_buf *buf);
406void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); 444void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf);
@@ -468,6 +506,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]);
468int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); 506int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index);
469void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); 507void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index);
470 508
509int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
471int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 510int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
472void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); 511void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index);
473 512
@@ -480,5 +519,6 @@ void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr,
480 u32 *lkey, u32 *rkey); 519 u32 *lkey, u32 *rkey);
481int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); 520int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr);
482int mlx4_SYNC_TPT(struct mlx4_dev *dev); 521int mlx4_SYNC_TPT(struct mlx4_dev *dev);
522int mlx4_test_interrupts(struct mlx4_dev *dev);
483 523
484#endif /* MLX4_DEVICE_H */ 524#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index 53c5fdb6eac..f407cd4bfb3 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -44,15 +44,24 @@ enum mlx4_dev_event {
44 MLX4_DEV_EVENT_PORT_REINIT, 44 MLX4_DEV_EVENT_PORT_REINIT,
45}; 45};
46 46
47enum mlx4_protocol {
48 MLX4_PROTOCOL_IB,
49 MLX4_PROTOCOL_EN,
50};
51
47struct mlx4_interface { 52struct mlx4_interface {
48 void * (*add) (struct mlx4_dev *dev); 53 void * (*add) (struct mlx4_dev *dev);
49 void (*remove)(struct mlx4_dev *dev, void *context); 54 void (*remove)(struct mlx4_dev *dev, void *context);
50 void (*event) (struct mlx4_dev *dev, void *context, 55 void (*event) (struct mlx4_dev *dev, void *context,
51 enum mlx4_dev_event event, int port); 56 enum mlx4_dev_event event, int port);
57 void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port);
52 struct list_head list; 58 struct list_head list;
59 enum mlx4_protocol protocol;
53}; 60};
54 61
55int mlx4_register_interface(struct mlx4_interface *intf); 62int mlx4_register_interface(struct mlx4_interface *intf);
56void mlx4_unregister_interface(struct mlx4_interface *intf); 63void mlx4_unregister_interface(struct mlx4_interface *intf);
57 64
65void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port);
66
58#endif /* MLX4_DRIVER_H */ 67#endif /* MLX4_DRIVER_H */
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 7abe64326f7..0eeb2a1a867 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -109,10 +109,11 @@ struct mlx4_qp_path {
109 __be32 tclass_flowlabel; 109 __be32 tclass_flowlabel;
110 u8 rgid[16]; 110 u8 rgid[16];
111 u8 sched_queue; 111 u8 sched_queue;
112 u8 snooper_flags; 112 u8 vlan_index;
113 u8 reserved3[2]; 113 u8 reserved3[2];
114 u8 counter_index; 114 u8 counter_index;
115 u8 reserved4[7]; 115 u8 reserved4;
116 u8 dmac[6];
116}; 117};
117 118
118struct mlx4_qp_context { 119struct mlx4_qp_context {
@@ -166,6 +167,7 @@ enum {
166 MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, 167 MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5,
167 MLX4_WQE_CTRL_INS_VLAN = 1 << 6, 168 MLX4_WQE_CTRL_INS_VLAN = 1 << 6,
168 MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, 169 MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7,
170 MLX4_WQE_CTRL_FORCE_LOOPBACK = 1 << 0,
169}; 171};
170 172
171struct mlx4_wqe_ctrl_seg { 173struct mlx4_wqe_ctrl_seg {
@@ -219,7 +221,8 @@ struct mlx4_wqe_datagram_seg {
219 __be32 av[8]; 221 __be32 av[8];
220 __be32 dqpn; 222 __be32 dqpn;
221 __be32 qkey; 223 __be32 qkey;
222 __be32 reservd[2]; 224 __be16 vlan;
225 u8 mac[6];
223}; 226};
224 227
225struct mlx4_wqe_lso_seg { 228struct mlx4_wqe_lso_seg {
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7687228dd3b..721f451c302 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -144,6 +144,7 @@ extern pgprot_t protection_map[16];
144#define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ 144#define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */
145#define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ 145#define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */
146#define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ 146#define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */
147#define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */
147 148
148/* 149/*
149 * This interface is used by x86 PAT code to identify a pfn mapping that is 150 * This interface is used by x86 PAT code to identify a pfn mapping that is
@@ -497,8 +498,8 @@ static inline void set_compound_order(struct page *page, unsigned long order)
497#define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) 498#define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0))
498#define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) 499#define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0))
499 500
500/* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allcator */ 501/* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */
501#ifdef NODE_NOT_IN_PAGEFLAGS 502#ifdef NODE_NOT_IN_PAGE_FLAGS
502#define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) 503#define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT)
503#define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \ 504#define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \
504 SECTIONS_PGOFF : ZONES_PGOFF) 505 SECTIONS_PGOFF : ZONES_PGOFF)
@@ -718,12 +719,21 @@ static inline int page_mapped(struct page *page)
718#define VM_FAULT_SIGBUS 0x0002 719#define VM_FAULT_SIGBUS 0x0002
719#define VM_FAULT_MAJOR 0x0004 720#define VM_FAULT_MAJOR 0x0004
720#define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ 721#define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */
721#define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned page */ 722#define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned small page */
723#define VM_FAULT_HWPOISON_LARGE 0x0020 /* Hit poisoned large page. Index encoded in upper bits */
722 724
723#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ 725#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */
724#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ 726#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */
727#define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */
728
729#define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */
730
731#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | \
732 VM_FAULT_HWPOISON_LARGE)
725 733
726#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON) 734/* Encode hstate index for a hwpoisoned large page */
735#define VM_FAULT_SET_HINDEX(x) ((x) << 12)
736#define VM_FAULT_GET_HINDEX(x) (((x) >> 12) & 0xf)
727 737
728/* 738/*
729 * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. 739 * Can be called by the pagefault handler when it gets a VM_FAULT_OOM.
@@ -860,6 +870,7 @@ int __set_page_dirty_no_writeback(struct page *page);
860int redirty_page_for_writepage(struct writeback_control *wbc, 870int redirty_page_for_writepage(struct writeback_control *wbc,
861 struct page *page); 871 struct page *page);
862void account_page_dirtied(struct page *page, struct address_space *mapping); 872void account_page_dirtied(struct page *page, struct address_space *mapping);
873void account_page_writeback(struct page *page);
863int set_page_dirty(struct page *page); 874int set_page_dirty(struct page *page);
864int set_page_dirty_lock(struct page *page); 875int set_page_dirty_lock(struct page *page);
865int clear_page_dirty_for_io(struct page *page); 876int clear_page_dirty_for_io(struct page *page);
@@ -1023,7 +1034,15 @@ extern void unregister_shrinker(struct shrinker *);
1023 1034
1024int vma_wants_writenotify(struct vm_area_struct *vma); 1035int vma_wants_writenotify(struct vm_area_struct *vma);
1025 1036
1026extern pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl); 1037extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
1038 spinlock_t **ptl);
1039static inline pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
1040 spinlock_t **ptl)
1041{
1042 pte_t *ptep;
1043 __cond_lock(*ptl, ptep = __get_locked_pte(mm, addr, ptl));
1044 return ptep;
1045}
1027 1046
1028#ifdef __PAGETABLE_PUD_FOLDED 1047#ifdef __PAGETABLE_PUD_FOLDED
1029static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, 1048static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index cb57d657ce4..bb7288a782f 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -310,6 +310,8 @@ struct mm_struct {
310#ifdef CONFIG_MMU_NOTIFIER 310#ifdef CONFIG_MMU_NOTIFIER
311 struct mmu_notifier_mm *mmu_notifier_mm; 311 struct mmu_notifier_mm *mmu_notifier_mm;
312#endif 312#endif
313 /* How many tasks sharing this mm are OOM_DISABLE */
314 atomic_t oom_disable_count;
313}; 315};
314 316
315/* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ 317/* Future-safe accessor for struct mm_struct's cpu_vm_mask. */
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 6b7525099e5..8ce082781cc 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -48,6 +48,7 @@ struct mmc_ext_csd {
48 unsigned int sa_timeout; /* Units: 100ns */ 48 unsigned int sa_timeout; /* Units: 100ns */
49 unsigned int hs_max_dtr; 49 unsigned int hs_max_dtr;
50 unsigned int sectors; 50 unsigned int sectors;
51 unsigned int card_type;
51 unsigned int hc_erase_size; /* In sectors */ 52 unsigned int hc_erase_size; /* In sectors */
52 unsigned int hc_erase_timeout; /* In milliseconds */ 53 unsigned int hc_erase_timeout; /* In milliseconds */
53 unsigned int sec_trim_mult; /* Secure trim multiplier */ 54 unsigned int sec_trim_mult; /* Secure trim multiplier */
@@ -113,6 +114,7 @@ struct mmc_card {
113#define MMC_STATE_READONLY (1<<1) /* card is read-only */ 114#define MMC_STATE_READONLY (1<<1) /* card is read-only */
114#define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ 115#define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */
115#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ 116#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */
117#define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */
116 unsigned int quirks; /* card quirks */ 118 unsigned int quirks; /* card quirks */
117#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ 119#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */
118#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ 120#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */
@@ -154,11 +156,13 @@ struct mmc_card {
154#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) 156#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
155#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) 157#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED)
156#define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) 158#define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR)
159#define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR)
157 160
158#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) 161#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
159#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) 162#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
160#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) 163#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
161#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) 164#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
165#define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR)
162 166
163static inline int mmc_card_lenient_fn0(const struct mmc_card *c) 167static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
164{ 168{
@@ -173,6 +177,8 @@ static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
173#define mmc_card_name(c) ((c)->cid.prod_name) 177#define mmc_card_name(c) ((c)->cid.prod_name)
174#define mmc_card_id(c) (dev_name(&(c)->dev)) 178#define mmc_card_id(c) (dev_name(&(c)->dev))
175 179
180#define mmc_dev_to_card(d) container_of(d, struct mmc_card, dev)
181
176#define mmc_list_to_card(l) container_of(l, struct mmc_card, node) 182#define mmc_list_to_card(l) container_of(l, struct mmc_card, node)
177#define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev) 183#define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev)
178#define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d) 184#define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d)
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 7429033acb6..64e013f1cfb 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -153,6 +153,8 @@ extern int mmc_can_secure_erase_trim(struct mmc_card *card);
153extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, 153extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
154 unsigned int nr); 154 unsigned int nr);
155 155
156extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
157
156extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); 158extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
157extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); 159extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
158 160
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 1575b52c3bf..6d87f68ce4b 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -50,6 +50,12 @@ struct mmc_ios {
50#define MMC_TIMING_LEGACY 0 50#define MMC_TIMING_LEGACY 0
51#define MMC_TIMING_MMC_HS 1 51#define MMC_TIMING_MMC_HS 1
52#define MMC_TIMING_SD_HS 2 52#define MMC_TIMING_SD_HS 2
53
54 unsigned char ddr; /* dual data rate used */
55
56#define MMC_SDR_MODE 0
57#define MMC_1_2V_DDR_MODE 1
58#define MMC_1_8V_DDR_MODE 2
53}; 59};
54 60
55struct mmc_host_ops { 61struct mmc_host_ops {
@@ -123,6 +129,7 @@ struct mmc_host {
123 const struct mmc_host_ops *ops; 129 const struct mmc_host_ops *ops;
124 unsigned int f_min; 130 unsigned int f_min;
125 unsigned int f_max; 131 unsigned int f_max;
132 unsigned int f_init;
126 u32 ocr_avail; 133 u32 ocr_avail;
127 struct notifier_block pm_notify; 134 struct notifier_block pm_notify;
128 135
@@ -157,13 +164,16 @@ struct mmc_host {
157#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ 164#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */
158#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ 165#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */
159#define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ 166#define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */
167#define MMC_CAP_1_8V_DDR (1 << 11) /* can support */
168 /* DDR mode at 1.8V */
169#define MMC_CAP_1_2V_DDR (1 << 12) /* can support */
170 /* DDR mode at 1.2V */
160 171
161 mmc_pm_flag_t pm_caps; /* supported pm features */ 172 mmc_pm_flag_t pm_caps; /* supported pm features */
162 173
163 /* host specific block data */ 174 /* host specific block data */
164 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 175 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
165 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ 176 unsigned short max_segs; /* see blk_queue_max_segments */
166 unsigned short max_phys_segs; /* see blk_queue_max_phys_segments */
167 unsigned short unused; 177 unsigned short unused;
168 unsigned int max_req_size; /* maximum number of bytes in one req */ 178 unsigned int max_req_size; /* maximum number of bytes in one req */
169 unsigned int max_blk_size; /* maximum size of one mmc block */ 179 unsigned int max_blk_size; /* maximum size of one mmc block */
@@ -212,6 +222,10 @@ struct mmc_host {
212 struct led_trigger *led; /* activity led */ 222 struct led_trigger *led; /* activity led */
213#endif 223#endif
214 224
225#ifdef CONFIG_REGULATOR
226 bool regulator_enabled; /* regulator state */
227#endif
228
215 struct dentry *debugfs_root; 229 struct dentry *debugfs_root;
216 230
217 unsigned long private[0] ____cacheline_aligned; 231 unsigned long private[0] ____cacheline_aligned;
@@ -236,8 +250,8 @@ static inline void *mmc_priv(struct mmc_host *host)
236extern int mmc_suspend_host(struct mmc_host *); 250extern int mmc_suspend_host(struct mmc_host *);
237extern int mmc_resume_host(struct mmc_host *); 251extern int mmc_resume_host(struct mmc_host *);
238 252
239extern void mmc_power_save_host(struct mmc_host *host); 253extern int mmc_power_save_host(struct mmc_host *host);
240extern void mmc_power_restore_host(struct mmc_host *host); 254extern int mmc_power_restore_host(struct mmc_host *host);
241 255
242extern void mmc_detect_change(struct mmc_host *, unsigned long delay); 256extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
243extern void mmc_request_done(struct mmc_host *, struct mmc_request *); 257extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
@@ -250,8 +264,24 @@ static inline void mmc_signal_sdio_irq(struct mmc_host *host)
250 264
251struct regulator; 265struct regulator;
252 266
267#ifdef CONFIG_REGULATOR
253int mmc_regulator_get_ocrmask(struct regulator *supply); 268int mmc_regulator_get_ocrmask(struct regulator *supply);
254int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); 269int mmc_regulator_set_ocr(struct mmc_host *mmc,
270 struct regulator *supply,
271 unsigned short vdd_bit);
272#else
273static inline int mmc_regulator_get_ocrmask(struct regulator *supply)
274{
275 return 0;
276}
277
278static inline int mmc_regulator_set_ocr(struct mmc_host *mmc,
279 struct regulator *supply,
280 unsigned short vdd_bit)
281{
282 return 0;
283}
284#endif
255 285
256int mmc_card_awake(struct mmc_host *host); 286int mmc_card_awake(struct mmc_host *host);
257int mmc_card_sleep(struct mmc_host *host); 287int mmc_card_sleep(struct mmc_host *host);
@@ -268,5 +298,13 @@ static inline void mmc_set_disable_delay(struct mmc_host *host,
268 host->disable_delay = disable_delay; 298 host->disable_delay = disable_delay;
269} 299}
270 300
301/* Module parameter */
302extern int mmc_assume_removable;
303
304static inline int mmc_card_is_removable(struct mmc_host *host)
305{
306 return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable;
307}
308
271#endif 309#endif
272 310
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index dd11ae51fb6..956fbd87769 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -277,11 +277,19 @@ struct _mmc_csd {
277 277
278#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ 278#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */
279#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ 279#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */
280#define EXT_CSD_CARD_TYPE_MASK 0x3 /* Mask out reserved and DDR bits */ 280#define EXT_CSD_CARD_TYPE_MASK 0xF /* Mask out reserved bits */
281#define EXT_CSD_CARD_TYPE_DDR_1_8V (1<<2) /* Card can run at 52MHz */
282 /* DDR mode @1.8V or 3V I/O */
283#define EXT_CSD_CARD_TYPE_DDR_1_2V (1<<3) /* Card can run at 52MHz */
284 /* DDR mode @1.2V I/O */
285#define EXT_CSD_CARD_TYPE_DDR_52 (EXT_CSD_CARD_TYPE_DDR_1_8V \
286 | EXT_CSD_CARD_TYPE_DDR_1_2V)
281 287
282#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ 288#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */
283#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ 289#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
284#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ 290#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */
291#define EXT_CSD_DDR_BUS_WIDTH_4 5 /* Card is in 4 bit DDR mode */
292#define EXT_CSD_DDR_BUS_WIDTH_8 6 /* Card is in 8 bit DDR mode */
285 293
286#define EXT_CSD_SEC_ER_EN BIT(0) 294#define EXT_CSD_SEC_ER_EN BIT(0)
287#define EXT_CSD_SEC_BD_BLK_EN BIT(2) 295#define EXT_CSD_SEC_BD_BLK_EN BIT(2)
diff --git a/include/linux/sdhci-pltfm.h b/include/linux/mmc/sdhci-pltfm.h
index 0239bd70241..548d59d404c 100644
--- a/include/linux/sdhci-pltfm.h
+++ b/include/linux/mmc/sdhci-pltfm.h
@@ -28,7 +28,7 @@ struct sdhci_host;
28struct sdhci_pltfm_data { 28struct sdhci_pltfm_data {
29 struct sdhci_ops *ops; 29 struct sdhci_ops *ops;
30 unsigned int quirks; 30 unsigned int quirks;
31 int (*init)(struct sdhci_host *host); 31 int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata);
32 void (*exit)(struct sdhci_host *host); 32 void (*exit)(struct sdhci_host *host);
33}; 33};
34 34
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
new file mode 100644
index 00000000000..1fdc673f239
--- /dev/null
+++ b/include/linux/mmc/sdhci.h
@@ -0,0 +1,144 @@
1/*
2 * linux/include/linux/mmc/sdhci.h - Secure Digital Host Controller Interface
3 *
4 * Copyright (C) 2005-2008 Pierre Ossman, 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, or (at
9 * your option) any later version.
10 */
11#ifndef __SDHCI_H
12#define __SDHCI_H
13
14#include <linux/scatterlist.h>
15#include <linux/compiler.h>
16#include <linux/types.h>
17#include <linux/io.h>
18#include <linux/mmc/host.h>
19
20struct sdhci_host {
21 /* Data set by hardware interface driver */
22 const char *hw_name; /* Hardware bus name */
23
24 unsigned int quirks; /* Deviations from spec. */
25
26/* Controller doesn't honor resets unless we touch the clock register */
27#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0)
28/* Controller has bad caps bits, but really supports DMA */
29#define SDHCI_QUIRK_FORCE_DMA (1<<1)
30/* Controller doesn't like to be reset when there is no card inserted. */
31#define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<2)
32/* Controller doesn't like clearing the power reg before a change */
33#define SDHCI_QUIRK_SINGLE_POWER_WRITE (1<<3)
34/* Controller has flaky internal state so reset it on each ios change */
35#define SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS (1<<4)
36/* Controller has an unusable DMA engine */
37#define SDHCI_QUIRK_BROKEN_DMA (1<<5)
38/* Controller has an unusable ADMA engine */
39#define SDHCI_QUIRK_BROKEN_ADMA (1<<6)
40/* Controller can only DMA from 32-bit aligned addresses */
41#define SDHCI_QUIRK_32BIT_DMA_ADDR (1<<7)
42/* Controller can only DMA chunk sizes that are a multiple of 32 bits */
43#define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<8)
44/* Controller can only ADMA chunks that are a multiple of 32 bits */
45#define SDHCI_QUIRK_32BIT_ADMA_SIZE (1<<9)
46/* Controller needs to be reset after each request to stay stable */
47#define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<10)
48/* Controller needs voltage and power writes to happen separately */
49#define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<11)
50/* Controller provides an incorrect timeout value for transfers */
51#define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<12)
52/* Controller has an issue with buffer bits for small transfers */
53#define SDHCI_QUIRK_BROKEN_SMALL_PIO (1<<13)
54/* Controller does not provide transfer-complete interrupt when not busy */
55#define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14)
56/* Controller has unreliable card detection */
57#define SDHCI_QUIRK_BROKEN_CARD_DETECTION (1<<15)
58/* Controller reports inverted write-protect state */
59#define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16)
60/* Controller has nonstandard clock management */
61#define SDHCI_QUIRK_NONSTANDARD_CLOCK (1<<17)
62/* Controller does not like fast PIO transfers */
63#define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18)
64/* Controller losing signal/interrupt enable states after reset */
65#define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET (1<<19)
66/* Controller has to be forced to use block size of 2048 bytes */
67#define SDHCI_QUIRK_FORCE_BLK_SZ_2048 (1<<20)
68/* Controller cannot do multi-block transfers */
69#define SDHCI_QUIRK_NO_MULTIBLOCK (1<<21)
70/* Controller can only handle 1-bit data transfers */
71#define SDHCI_QUIRK_FORCE_1_BIT_DATA (1<<22)
72/* Controller needs 10ms delay between applying power and clock */
73#define SDHCI_QUIRK_DELAY_AFTER_POWER (1<<23)
74/* Controller uses SDCLK instead of TMCLK for data timeouts */
75#define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK (1<<24)
76/* Controller reports wrong base clock capability */
77#define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25)
78/* Controller cannot support End Attribute in NOP ADMA descriptor */
79#define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26)
80/* Controller is missing device caps. Use caps provided by host */
81#define SDHCI_QUIRK_MISSING_CAPS (1<<27)
82/* Controller uses Auto CMD12 command to stop the transfer */
83#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28)
84/* Controller doesn't have HISPD bit field in HI-SPEED SD card */
85#define SDHCI_QUIRK_NO_HISPD_BIT (1<<29)
86
87 int irq; /* Device IRQ */
88 void __iomem *ioaddr; /* Mapped address */
89
90 const struct sdhci_ops *ops; /* Low level hw interface */
91
92 struct regulator *vmmc; /* Power regulator */
93
94 /* Internal data */
95 struct mmc_host *mmc; /* MMC structure */
96 u64 dma_mask; /* custom DMA mask */
97
98#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
99 struct led_classdev led; /* LED control */
100 char led_name[32];
101#endif
102
103 spinlock_t lock; /* Mutex */
104
105 int flags; /* Host attributes */
106#define SDHCI_USE_SDMA (1<<0) /* Host is SDMA capable */
107#define SDHCI_USE_ADMA (1<<1) /* Host is ADMA capable */
108#define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */
109#define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */
110
111 unsigned int version; /* SDHCI spec. version */
112
113 unsigned int max_clk; /* Max possible freq (MHz) */
114 unsigned int timeout_clk; /* Timeout freq (KHz) */
115
116 unsigned int clock; /* Current clock (MHz) */
117 u8 pwr; /* Current voltage */
118
119 struct mmc_request *mrq; /* Current request */
120 struct mmc_command *cmd; /* Current command */
121 struct mmc_data *data; /* Current data request */
122 unsigned int data_early:1; /* Data finished before cmd */
123
124 struct sg_mapping_iter sg_miter; /* SG state for PIO */
125 unsigned int blocks; /* remaining PIO blocks */
126
127 int sg_count; /* Mapped sg entries */
128
129 u8 *adma_desc; /* ADMA descriptor table */
130 u8 *align_buffer; /* Bounce buffer */
131
132 dma_addr_t adma_addr; /* Mapped ADMA descr. table */
133 dma_addr_t align_addr; /* Mapped bounce buffer */
134
135 struct tasklet_struct card_tasklet; /* Tasklet structures */
136 struct tasklet_struct finish_tasklet;
137
138 struct timer_list timer; /* Timer for timeouts */
139
140 unsigned int caps; /* Alternative capabilities */
141
142 unsigned long private[0] ____cacheline_aligned;
143};
144#endif /* __SDHCI_H */
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 33b2ea09a4a..a36ab3bc7b0 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -18,6 +18,7 @@
18#define SDIO_CLASS_PHS 0x06 /* PHS standard interface */ 18#define SDIO_CLASS_PHS 0x06 /* PHS standard interface */
19#define SDIO_CLASS_WLAN 0x07 /* WLAN interface */ 19#define SDIO_CLASS_WLAN 0x07 /* WLAN interface */
20#define SDIO_CLASS_ATA 0x08 /* Embedded SDIO-ATA std interface */ 20#define SDIO_CLASS_ATA 0x08 /* Embedded SDIO-ATA std interface */
21#define SDIO_CLASS_BT_AMP 0x09 /* Type-A Bluetooth AMP interface */
21 22
22/* 23/*
23 * Vendors and devices. Sort key: vendor first, device next. 24 * Vendors and devices. Sort key: vendor first, device next.
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index d4a2ebbdab4..d19e2114fd8 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -34,6 +34,7 @@
34struct sh_mmcif_plat_data { 34struct sh_mmcif_plat_data {
35 void (*set_pwr)(struct platform_device *pdev, int state); 35 void (*set_pwr)(struct platform_device *pdev, int state);
36 void (*down_pwr)(struct platform_device *pdev); 36 void (*down_pwr)(struct platform_device *pdev);
37 int (*get_cd)(struct platform_device *pdef);
37 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ 38 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
38 unsigned long caps; 39 unsigned long caps;
39 u32 ocr; 40 u32 ocr;
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index 4e02ee2b071..43dcfbdc39d 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -227,7 +227,7 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
227 227
228/* 228/*
229 * These two macros will sometime replace ptep_clear_flush. 229 * These two macros will sometime replace ptep_clear_flush.
230 * ptep_clear_flush is impleemnted as macro itself, so this also is 230 * ptep_clear_flush is implemented as macro itself, so this also is
231 * implemented as a macro until ptep_clear_flush will converted to an 231 * implemented as a macro until ptep_clear_flush will converted to an
232 * inline function, to diminish the risk of compilation failure. The 232 * inline function, to diminish the risk of compilation failure. The
233 * invalidate_page method over time can be moved outside the PT lock 233 * invalidate_page method over time can be moved outside the PT lock
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 3984c4eb41f..39c24ebe9cf 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -104,6 +104,8 @@ enum zone_stat_item {
104 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ 104 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
105 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ 105 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
106 NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */ 106 NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */
107 NR_DIRTIED, /* page dirtyings since bootup */
108 NR_WRITTEN, /* page writings since bootup */
107#ifdef CONFIG_NUMA 109#ifdef CONFIG_NUMA
108 NUMA_HIT, /* allocated in intended node */ 110 NUMA_HIT, /* allocated in intended node */
109 NUMA_MISS, /* allocated in non intended node */ 111 NUMA_MISS, /* allocated in non intended node */
@@ -421,6 +423,9 @@ struct zone {
421typedef enum { 423typedef enum {
422 ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ 424 ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */
423 ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ 425 ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */
426 ZONE_CONGESTED, /* zone has many dirty pages backed by
427 * a congested BDI
428 */
424} zone_flags_t; 429} zone_flags_t;
425 430
426static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) 431static inline void zone_set_flag(struct zone *zone, zone_flags_t flag)
@@ -438,6 +443,11 @@ static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag)
438 clear_bit(flag, &zone->flags); 443 clear_bit(flag, &zone->flags);
439} 444}
440 445
446static inline int zone_is_reclaim_congested(const struct zone *zone)
447{
448 return test_bit(ZONE_CONGESTED, &zone->flags);
449}
450
441static inline int zone_is_reclaim_locked(const struct zone *zone) 451static inline int zone_is_reclaim_locked(const struct zone *zone)
442{ 452{
443 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); 453 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags);
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 9d2f1837b3d..112adf8bd47 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -21,8 +21,8 @@
21#define __module_cat(a,b) ___module_cat(a,b) 21#define __module_cat(a,b) ___module_cat(a,b)
22#define __MODULE_INFO(tag, name, info) \ 22#define __MODULE_INFO(tag, name, info) \
23static const char __module_cat(name,__LINE__)[] \ 23static const char __module_cat(name,__LINE__)[] \
24 __used \ 24 __used __attribute__((section(".modinfo"), unused, aligned(1))) \
25 __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info 25 = __stringify(tag) "=" info
26#else /* !MODULE */ 26#else /* !MODULE */
27#define __MODULE_INFO(tag, name, info) 27#define __MODULE_INFO(tag, name, info)
28#endif 28#endif
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index fa04b246c9a..0fa7a3a874c 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -213,6 +213,7 @@ struct mfc_cache {
213 unsigned char ttls[MAXVIFS]; /* TTL thresholds */ 213 unsigned char ttls[MAXVIFS]; /* TTL thresholds */
214 } res; 214 } res;
215 } mfc_un; 215 } mfc_un;
216 struct rcu_head rcu;
216}; 217};
217 218
218#define MFC_STATIC 1 219#define MFC_STATIC 1
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 7fa20beb2ab..57cc0e63714 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -84,7 +84,7 @@ struct nand_bbt_descr {
84#define NAND_BBT_PERCHIP 0x00000080 84#define NAND_BBT_PERCHIP 0x00000080
85/* bbt has a version counter at offset veroffs */ 85/* bbt has a version counter at offset veroffs */
86#define NAND_BBT_VERSION 0x00000100 86#define NAND_BBT_VERSION 0x00000100
87/* Create a bbt if none axists */ 87/* Create a bbt if none exists */
88#define NAND_BBT_CREATE 0x00000200 88#define NAND_BBT_CREATE 0x00000200
89/* Search good / bad pattern through all pages of a block */ 89/* Search good / bad pattern through all pages of a block */
90#define NAND_BBT_SCANALLPAGES 0x00000400 90#define NAND_BBT_SCANALLPAGES 0x00000400
@@ -102,6 +102,8 @@ struct nand_bbt_descr {
102#define NAND_BBT_SCANBYTE1AND6 0x00100000 102#define NAND_BBT_SCANBYTE1AND6 0x00100000
103/* The nand_bbt_descr was created dynamicaly and must be freed */ 103/* The nand_bbt_descr was created dynamicaly and must be freed */
104#define NAND_BBT_DYNAMICSTRUCT 0x00200000 104#define NAND_BBT_DYNAMICSTRUCT 0x00200000
105/* The bad block table does not OOB for marker */
106#define NAND_BBT_NO_OOB 0x00400000
105 107
106/* The maximum number of blocks to scan for a bbt */ 108/* The maximum number of blocks to scan for a bbt */
107#define NAND_BBT_SCAN_MAXBLOCKS 4 109#define NAND_BBT_SCAN_MAXBLOCKS 4
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index d2118b0eac9..4dd0c2cd765 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -289,6 +289,7 @@ struct cfi_private {
289 must be of the same type. */ 289 must be of the same type. */
290 int mfr, id; 290 int mfr, id;
291 int numchips; 291 int numchips;
292 map_word sector_erase_cmd;
292 unsigned long chipshift; /* Because they're of the same type */ 293 unsigned long chipshift; /* Because they're of the same type */
293 const char *im_name; /* inter_module name for cmdset_setup */ 294 const char *im_name; /* inter_module name for cmdset_setup */
294 struct flchip chips[0]; /* per-chip data structure for each chip */ 295 struct flchip chips[0]; /* per-chip data structure for each chip */
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h
new file mode 100644
index 00000000000..5d2556700ec
--- /dev/null
+++ b/include/linux/mtd/fsmc.h
@@ -0,0 +1,181 @@
1/*
2 * incude/mtd/fsmc.h
3 *
4 * ST Microelectronics
5 * Flexible Static Memory Controller (FSMC)
6 * platform data interface and header file
7 *
8 * Copyright © 2010 ST Microelectronics
9 * Vipin Kumar <vipin.kumar@st.com>
10 *
11 * This file is licensed under the terms of the GNU General Public
12 * License version 2. This program is licensed "as is" without any
13 * warranty of any kind, whether express or implied.
14 */
15
16#ifndef __MTD_FSMC_H
17#define __MTD_FSMC_H
18
19#include <linux/platform_device.h>
20#include <linux/mtd/physmap.h>
21#include <linux/types.h>
22#include <linux/mtd/partitions.h>
23#include <asm/param.h>
24
25#define FSMC_NAND_BW8 1
26#define FSMC_NAND_BW16 2
27
28/*
29 * The placement of the Command Latch Enable (CLE) and
30 * Address Latch Enable (ALE) is twised around in the
31 * SPEAR310 implementation.
32 */
33#if defined(CONFIG_MACH_SPEAR310)
34#define PLAT_NAND_CLE (1 << 17)
35#define PLAT_NAND_ALE (1 << 16)
36#else
37#define PLAT_NAND_CLE (1 << 16)
38#define PLAT_NAND_ALE (1 << 17)
39#endif
40
41#define FSMC_MAX_NOR_BANKS 4
42#define FSMC_MAX_NAND_BANKS 4
43
44#define FSMC_FLASH_WIDTH8 1
45#define FSMC_FLASH_WIDTH16 2
46
47struct fsmc_nor_bank_regs {
48 uint32_t ctrl;
49 uint32_t ctrl_tim;
50};
51
52/* ctrl register definitions */
53#define BANK_ENABLE (1 << 0)
54#define MUXED (1 << 1)
55#define NOR_DEV (2 << 2)
56#define WIDTH_8 (0 << 4)
57#define WIDTH_16 (1 << 4)
58#define RSTPWRDWN (1 << 6)
59#define WPROT (1 << 7)
60#define WRT_ENABLE (1 << 12)
61#define WAIT_ENB (1 << 13)
62
63/* ctrl_tim register definitions */
64
65struct fsms_nand_bank_regs {
66 uint32_t pc;
67 uint32_t sts;
68 uint32_t comm;
69 uint32_t attrib;
70 uint32_t ioata;
71 uint32_t ecc1;
72 uint32_t ecc2;
73 uint32_t ecc3;
74};
75
76#define FSMC_NOR_REG_SIZE 0x40
77
78struct fsmc_regs {
79 struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS];
80 uint8_t reserved_1[0x40 - 0x20];
81 struct fsms_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS];
82 uint8_t reserved_2[0xfe0 - 0xc0];
83 uint32_t peripid0; /* 0xfe0 */
84 uint32_t peripid1; /* 0xfe4 */
85 uint32_t peripid2; /* 0xfe8 */
86 uint32_t peripid3; /* 0xfec */
87 uint32_t pcellid0; /* 0xff0 */
88 uint32_t pcellid1; /* 0xff4 */
89 uint32_t pcellid2; /* 0xff8 */
90 uint32_t pcellid3; /* 0xffc */
91};
92
93#define FSMC_BUSY_WAIT_TIMEOUT (1 * HZ)
94
95/* pc register definitions */
96#define FSMC_RESET (1 << 0)
97#define FSMC_WAITON (1 << 1)
98#define FSMC_ENABLE (1 << 2)
99#define FSMC_DEVTYPE_NAND (1 << 3)
100#define FSMC_DEVWID_8 (0 << 4)
101#define FSMC_DEVWID_16 (1 << 4)
102#define FSMC_ECCEN (1 << 6)
103#define FSMC_ECCPLEN_512 (0 << 7)
104#define FSMC_ECCPLEN_256 (1 << 7)
105#define FSMC_TCLR_1 (1 << 9)
106#define FSMC_TAR_1 (1 << 13)
107
108/* sts register definitions */
109#define FSMC_CODE_RDY (1 << 15)
110
111/* comm register definitions */
112#define FSMC_TSET_0 (0 << 0)
113#define FSMC_TWAIT_6 (6 << 8)
114#define FSMC_THOLD_4 (4 << 16)
115#define FSMC_THIZ_1 (1 << 24)
116
117/* peripid2 register definitions */
118#define FSMC_REVISION_MSK (0xf)
119#define FSMC_REVISION_SHFT (0x4)
120
121#define FSMC_VER1 1
122#define FSMC_VER2 2
123#define FSMC_VER3 3
124#define FSMC_VER4 4
125#define FSMC_VER5 5
126#define FSMC_VER6 6
127#define FSMC_VER7 7
128#define FSMC_VER8 8
129
130static inline uint32_t get_fsmc_version(struct fsmc_regs *regs)
131{
132 return (readl(&regs->peripid2) >> FSMC_REVISION_SHFT) &
133 FSMC_REVISION_MSK;
134}
135
136/*
137 * There are 13 bytes of ecc for every 512 byte block in FSMC version 8
138 * and it has to be read consecutively and immediately after the 512
139 * byte data block for hardware to generate the error bit offsets
140 * Managing the ecc bytes in the following way is easier. This way is
141 * similar to oobfree structure maintained already in u-boot nand driver
142 */
143#define MAX_ECCPLACE_ENTRIES 32
144
145struct fsmc_nand_eccplace {
146 uint8_t offset;
147 uint8_t length;
148};
149
150struct fsmc_eccplace {
151 struct fsmc_nand_eccplace eccplace[MAX_ECCPLACE_ENTRIES];
152};
153
154/**
155 * fsmc_nand_platform_data - platform specific NAND controller config
156 * @partitions: partition table for the platform, use a default fallback
157 * if this is NULL
158 * @nr_partitions: the number of partitions in the previous entry
159 * @options: different options for the driver
160 * @width: bus width
161 * @bank: default bank
162 * @select_bank: callback to select a certain bank, this is
163 * platform-specific. If the controller only supports one bank
164 * this may be set to NULL
165 */
166struct fsmc_nand_platform_data {
167 struct mtd_partition *partitions;
168 unsigned int nr_partitions;
169 unsigned int options;
170 unsigned int width;
171 unsigned int bank;
172 void (*select_bank)(uint32_t bank, uint32_t busw);
173};
174
175extern int __init fsmc_nor_init(struct platform_device *pdev,
176 unsigned long base, uint32_t bank, uint32_t width);
177extern void __init fsmc_init_board_info(struct platform_device *pdev,
178 struct mtd_partition *partitions, unsigned int nr_partitions,
179 unsigned int width);
180
181#endif /* __MTD_FSMC_H */
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h
index 64ee53ce95a..02cd5f9b79b 100644
--- a/include/linux/mtd/inftl.h
+++ b/include/linux/mtd/inftl.h
@@ -37,14 +37,14 @@ struct INFTLrecord {
37 __u16 firstEUN; 37 __u16 firstEUN;
38 __u16 lastEUN; 38 __u16 lastEUN;
39 __u16 numfreeEUNs; 39 __u16 numfreeEUNs;
40 __u16 LastFreeEUN; /* To speed up finding a free EUN */ 40 __u16 LastFreeEUN; /* To speed up finding a free EUN */
41 int head,sect,cyl; 41 int head,sect,cyl;
42 __u16 *PUtable; /* Physical Unit Table */ 42 __u16 *PUtable; /* Physical Unit Table */
43 __u16 *VUtable; /* Virtual Unit Table */ 43 __u16 *VUtable; /* Virtual Unit Table */
44 unsigned int nb_blocks; /* number of physical blocks */ 44 unsigned int nb_blocks; /* number of physical blocks */
45 unsigned int nb_boot_blocks; /* number of blocks used by the bios */ 45 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
46 struct erase_info instr; 46 struct erase_info instr;
47 struct nand_ecclayout oobinfo; 47 struct nand_ecclayout oobinfo;
48}; 48};
49 49
50int INFTL_mount(struct INFTLrecord *s); 50int INFTL_mount(struct INFTLrecord *s);
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 8485e42a9b0..fe8d77ebec1 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -110,6 +110,21 @@ struct mtd_oob_ops {
110 uint8_t *oobbuf; 110 uint8_t *oobbuf;
111}; 111};
112 112
113#define MTD_MAX_OOBFREE_ENTRIES_LARGE 32
114#define MTD_MAX_ECCPOS_ENTRIES_LARGE 448
115/*
116 * Internal ECC layout control structure. For historical reasons, there is a
117 * similar, smaller struct nand_ecclayout_user (in mtd-abi.h) that is retained
118 * for export to user-space via the ECCGETLAYOUT ioctl.
119 * nand_ecclayout should be expandable in the future simply by the above macros.
120 */
121struct nand_ecclayout {
122 __u32 eccbytes;
123 __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES_LARGE];
124 __u32 oobavail;
125 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE];
126};
127
113struct mtd_info { 128struct mtd_info {
114 u_char type; 129 u_char type;
115 uint32_t flags; 130 uint32_t flags;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 102e12c58cb..63e17d01fde 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -27,15 +27,17 @@
27struct mtd_info; 27struct mtd_info;
28struct nand_flash_dev; 28struct nand_flash_dev;
29/* Scan and identify a NAND device */ 29/* Scan and identify a NAND device */
30extern int nand_scan (struct mtd_info *mtd, int max_chips); 30extern int nand_scan(struct mtd_info *mtd, int max_chips);
31/* Separate phases of nand_scan(), allowing board driver to intervene 31/*
32 * and override command or ECC setup according to flash type */ 32 * Separate phases of nand_scan(), allowing board driver to intervene
33 * and override command or ECC setup according to flash type.
34 */
33extern int nand_scan_ident(struct mtd_info *mtd, int max_chips, 35extern int nand_scan_ident(struct mtd_info *mtd, int max_chips,
34 struct nand_flash_dev *table); 36 struct nand_flash_dev *table);
35extern int nand_scan_tail(struct mtd_info *mtd); 37extern int nand_scan_tail(struct mtd_info *mtd);
36 38
37/* Free resources held by the NAND device */ 39/* Free resources held by the NAND device */
38extern void nand_release (struct mtd_info *mtd); 40extern void nand_release(struct mtd_info *mtd);
39 41
40/* Internal helper for board drivers which need to override command function */ 42/* Internal helper for board drivers which need to override command function */
41extern void nand_wait_ready(struct mtd_info *mtd); 43extern void nand_wait_ready(struct mtd_info *mtd);
@@ -49,12 +51,13 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
49/* The maximum number of NAND chips in an array */ 51/* The maximum number of NAND chips in an array */
50#define NAND_MAX_CHIPS 8 52#define NAND_MAX_CHIPS 8
51 53
52/* This constant declares the max. oobsize / page, which 54/*
55 * This constant declares the max. oobsize / page, which
53 * is supported now. If you add a chip with bigger oobsize/page 56 * is supported now. If you add a chip with bigger oobsize/page
54 * adjust this accordingly. 57 * adjust this accordingly.
55 */ 58 */
56#define NAND_MAX_OOBSIZE 256 59#define NAND_MAX_OOBSIZE 576
57#define NAND_MAX_PAGESIZE 4096 60#define NAND_MAX_PAGESIZE 8192
58 61
59/* 62/*
60 * Constants for hardware specific CLE/ALE/NCE function 63 * Constants for hardware specific CLE/ALE/NCE function
@@ -88,6 +91,7 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
88#define NAND_CMD_RNDIN 0x85 91#define NAND_CMD_RNDIN 0x85
89#define NAND_CMD_READID 0x90 92#define NAND_CMD_READID 0x90
90#define NAND_CMD_ERASE2 0xd0 93#define NAND_CMD_ERASE2 0xd0
94#define NAND_CMD_PARAM 0xec
91#define NAND_CMD_RESET 0xff 95#define NAND_CMD_RESET 0xff
92 96
93#define NAND_CMD_LOCK 0x2a 97#define NAND_CMD_LOCK 0x2a
@@ -152,9 +156,10 @@ typedef enum {
152#define NAND_GET_DEVICE 0x80 156#define NAND_GET_DEVICE 0x80
153 157
154 158
155/* Option constants for bizarre disfunctionality and real 159/*
156* features 160 * Option constants for bizarre disfunctionality and real
157*/ 161 * features.
162 */
158/* Chip can not auto increment pages */ 163/* Chip can not auto increment pages */
159#define NAND_NO_AUTOINCR 0x00000001 164#define NAND_NO_AUTOINCR 0x00000001
160/* Buswitdh is 16 bit */ 165/* Buswitdh is 16 bit */
@@ -165,19 +170,27 @@ typedef enum {
165#define NAND_CACHEPRG 0x00000008 170#define NAND_CACHEPRG 0x00000008
166/* Chip has copy back function */ 171/* Chip has copy back function */
167#define NAND_COPYBACK 0x00000010 172#define NAND_COPYBACK 0x00000010
168/* AND Chip which has 4 banks and a confusing page / block 173/*
169 * assignment. See Renesas datasheet for further information */ 174 * AND Chip which has 4 banks and a confusing page / block
175 * assignment. See Renesas datasheet for further information.
176 */
170#define NAND_IS_AND 0x00000020 177#define NAND_IS_AND 0x00000020
171/* Chip has a array of 4 pages which can be read without 178/*
172 * additional ready /busy waits */ 179 * Chip has a array of 4 pages which can be read without
180 * additional ready /busy waits.
181 */
173#define NAND_4PAGE_ARRAY 0x00000040 182#define NAND_4PAGE_ARRAY 0x00000040
174/* Chip requires that BBT is periodically rewritten to prevent 183/*
184 * Chip requires that BBT is periodically rewritten to prevent
175 * bits from adjacent blocks from 'leaking' in altering data. 185 * bits from adjacent blocks from 'leaking' in altering data.
176 * This happens with the Renesas AG-AND chips, possibly others. */ 186 * This happens with the Renesas AG-AND chips, possibly others.
187 */
177#define BBT_AUTO_REFRESH 0x00000080 188#define BBT_AUTO_REFRESH 0x00000080
178/* Chip does not require ready check on read. True 189/*
190 * Chip does not require ready check on read. True
179 * for all large page devices, as they do not support 191 * for all large page devices, as they do not support
180 * autoincrement.*/ 192 * autoincrement.
193 */
181#define NAND_NO_READRDY 0x00000100 194#define NAND_NO_READRDY 0x00000100
182/* Chip does not allow subpage writes */ 195/* Chip does not allow subpage writes */
183#define NAND_NO_SUBPAGE_WRITE 0x00000200 196#define NAND_NO_SUBPAGE_WRITE 0x00000200
@@ -205,16 +218,27 @@ typedef enum {
205#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) 218#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR)
206 219
207/* Non chip related options */ 220/* Non chip related options */
208/* Use a flash based bad block table. This option is passed to the 221/*
209 * default bad block table function. */ 222 * Use a flash based bad block table. OOB identifier is saved in OOB area.
223 * This option is passed to the default bad block table function.
224 */
210#define NAND_USE_FLASH_BBT 0x00010000 225#define NAND_USE_FLASH_BBT 0x00010000
211/* This option skips the bbt scan during initialization. */ 226/* This option skips the bbt scan during initialization. */
212#define NAND_SKIP_BBTSCAN 0x00020000 227#define NAND_SKIP_BBTSCAN 0x00020000
213/* This option is defined if the board driver allocates its own buffers 228/*
214 (e.g. because it needs them DMA-coherent */ 229 * This option is defined if the board driver allocates its own buffers
230 * (e.g. because it needs them DMA-coherent).
231 */
215#define NAND_OWN_BUFFERS 0x00040000 232#define NAND_OWN_BUFFERS 0x00040000
216/* Chip may not exist, so silence any errors in scan */ 233/* Chip may not exist, so silence any errors in scan */
217#define NAND_SCAN_SILENT_NODEV 0x00080000 234#define NAND_SCAN_SILENT_NODEV 0x00080000
235/*
236 * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch
237 * the OOB area.
238 */
239#define NAND_USE_FLASH_BBT_NO_OOB 0x00100000
240/* Create an empty BBT with no vendor information if the BBT is available */
241#define NAND_CREATE_EMPTY_BBT 0x00200000
218 242
219/* Options set by nand scan */ 243/* Options set by nand scan */
220/* Nand scan has allocated controller struct */ 244/* Nand scan has allocated controller struct */
@@ -227,15 +251,80 @@ typedef enum {
227/* Keep gcc happy */ 251/* Keep gcc happy */
228struct nand_chip; 252struct nand_chip;
229 253
254struct nand_onfi_params {
255 /* rev info and features block */
256 /* 'O' 'N' 'F' 'I' */
257 u8 sig[4];
258 __le16 revision;
259 __le16 features;
260 __le16 opt_cmd;
261 u8 reserved[22];
262
263 /* manufacturer information block */
264 char manufacturer[12];
265 char model[20];
266 u8 jedec_id;
267 __le16 date_code;
268 u8 reserved2[13];
269
270 /* memory organization block */
271 __le32 byte_per_page;
272 __le16 spare_bytes_per_page;
273 __le32 data_bytes_per_ppage;
274 __le16 spare_bytes_per_ppage;
275 __le32 pages_per_block;
276 __le32 blocks_per_lun;
277 u8 lun_count;
278 u8 addr_cycles;
279 u8 bits_per_cell;
280 __le16 bb_per_lun;
281 __le16 block_endurance;
282 u8 guaranteed_good_blocks;
283 __le16 guaranteed_block_endurance;
284 u8 programs_per_page;
285 u8 ppage_attr;
286 u8 ecc_bits;
287 u8 interleaved_bits;
288 u8 interleaved_ops;
289 u8 reserved3[13];
290
291 /* electrical parameter block */
292 u8 io_pin_capacitance_max;
293 __le16 async_timing_mode;
294 __le16 program_cache_timing_mode;
295 __le16 t_prog;
296 __le16 t_bers;
297 __le16 t_r;
298 __le16 t_ccs;
299 __le16 src_sync_timing_mode;
300 __le16 src_ssync_features;
301 __le16 clk_pin_capacitance_typ;
302 __le16 io_pin_capacitance_typ;
303 __le16 input_pin_capacitance_typ;
304 u8 input_pin_capacitance_max;
305 u8 driver_strenght_support;
306 __le16 t_int_r;
307 __le16 t_ald;
308 u8 reserved4[7];
309
310 /* vendor */
311 u8 reserved5[90];
312
313 __le16 crc;
314} __attribute__((packed));
315
316#define ONFI_CRC_BASE 0x4F4E
317
230/** 318/**
231 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices 319 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices
232 * @lock: protection lock 320 * @lock: protection lock
233 * @active: the mtd device which holds the controller currently 321 * @active: the mtd device which holds the controller currently
234 * @wq: wait queue to sleep on if a NAND operation is in progress 322 * @wq: wait queue to sleep on if a NAND operation is in
235 * used instead of the per chip wait queue when a hw controller is available 323 * progress used instead of the per chip wait queue
324 * when a hw controller is available.
236 */ 325 */
237struct nand_hw_control { 326struct nand_hw_control {
238 spinlock_t lock; 327 spinlock_t lock;
239 struct nand_chip *active; 328 struct nand_chip *active;
240 wait_queue_head_t wq; 329 wait_queue_head_t wq;
241}; 330};
@@ -256,51 +345,42 @@ struct nand_hw_control {
256 * @correct: function for ecc correction, matching to ecc generator (sw/hw) 345 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
257 * @read_page_raw: function to read a raw page without ECC 346 * @read_page_raw: function to read a raw page without ECC
258 * @write_page_raw: function to write a raw page without ECC 347 * @write_page_raw: function to write a raw page without ECC
259 * @read_page: function to read a page according to the ecc generator requirements 348 * @read_page: function to read a page according to the ecc generator
349 * requirements.
260 * @read_subpage: function to read parts of the page covered by ECC. 350 * @read_subpage: function to read parts of the page covered by ECC.
261 * @write_page: function to write a page according to the ecc generator requirements 351 * @write_page: function to write a page according to the ecc generator
352 * requirements.
262 * @read_oob: function to read chip OOB data 353 * @read_oob: function to read chip OOB data
263 * @write_oob: function to write chip OOB data 354 * @write_oob: function to write chip OOB data
264 */ 355 */
265struct nand_ecc_ctrl { 356struct nand_ecc_ctrl {
266 nand_ecc_modes_t mode; 357 nand_ecc_modes_t mode;
267 int steps; 358 int steps;
268 int size; 359 int size;
269 int bytes; 360 int bytes;
270 int total; 361 int total;
271 int prepad; 362 int prepad;
272 int postpad; 363 int postpad;
273 struct nand_ecclayout *layout; 364 struct nand_ecclayout *layout;
274 void (*hwctl)(struct mtd_info *mtd, int mode); 365 void (*hwctl)(struct mtd_info *mtd, int mode);
275 int (*calculate)(struct mtd_info *mtd, 366 int (*calculate)(struct mtd_info *mtd, const uint8_t *dat,
276 const uint8_t *dat, 367 uint8_t *ecc_code);
277 uint8_t *ecc_code); 368 int (*correct)(struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc,
278 int (*correct)(struct mtd_info *mtd, uint8_t *dat, 369 uint8_t *calc_ecc);
279 uint8_t *read_ecc, 370 int (*read_page_raw)(struct mtd_info *mtd, struct nand_chip *chip,
280 uint8_t *calc_ecc); 371 uint8_t *buf, int page);
281 int (*read_page_raw)(struct mtd_info *mtd, 372 void (*write_page_raw)(struct mtd_info *mtd, struct nand_chip *chip,
282 struct nand_chip *chip, 373 const uint8_t *buf);
283 uint8_t *buf, int page); 374 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip,
284 void (*write_page_raw)(struct mtd_info *mtd, 375 uint8_t *buf, int page);
285 struct nand_chip *chip, 376 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
286 const uint8_t *buf); 377 uint32_t offs, uint32_t len, uint8_t *buf);
287 int (*read_page)(struct mtd_info *mtd, 378 void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
288 struct nand_chip *chip, 379 const uint8_t *buf);
289 uint8_t *buf, int page); 380 int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page,
290 int (*read_subpage)(struct mtd_info *mtd, 381 int sndcmd);
291 struct nand_chip *chip, 382 int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip,
292 uint32_t offs, uint32_t len, 383 int page);
293 uint8_t *buf);
294 void (*write_page)(struct mtd_info *mtd,
295 struct nand_chip *chip,
296 const uint8_t *buf);
297 int (*read_oob)(struct mtd_info *mtd,
298 struct nand_chip *chip,
299 int page,
300 int sndcmd);
301 int (*write_oob)(struct mtd_info *mtd,
302 struct nand_chip *chip,
303 int page);
304}; 384};
305 385
306/** 386/**
@@ -320,102 +400,132 @@ struct nand_buffers {
320 400
321/** 401/**
322 * struct nand_chip - NAND Private Flash Chip Data 402 * struct nand_chip - NAND Private Flash Chip Data
323 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device 403 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the
324 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device 404 * flash device
405 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the
406 * flash device.
325 * @read_byte: [REPLACEABLE] read one byte from the chip 407 * @read_byte: [REPLACEABLE] read one byte from the chip
326 * @read_word: [REPLACEABLE] read one word from the chip 408 * @read_word: [REPLACEABLE] read one word from the chip
327 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 409 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
328 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 410 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
329 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data 411 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip
412 * data.
330 * @select_chip: [REPLACEABLE] select chip nr 413 * @select_chip: [REPLACEABLE] select chip nr
331 * @block_bad: [REPLACEABLE] check, if the block is bad 414 * @block_bad: [REPLACEABLE] check, if the block is bad
332 * @block_markbad: [REPLACEABLE] mark the block bad 415 * @block_markbad: [REPLACEABLE] mark the block bad
333 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling 416 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling
334 * ALE/CLE/nCE. Also used to write command and address 417 * ALE/CLE/nCE. Also used to write command and address
335 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line 418 * @init_size: [BOARDSPECIFIC] hardwarespecific funtion for setting
336 * If set to NULL no access to ready/busy is available and the ready/busy information 419 * mtd->oobsize, mtd->writesize and so on.
337 * is read from the chip status register 420 * @id_data contains the 8 bytes values of NAND_CMD_READID.
338 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip 421 * Return with the bus width.
339 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready 422 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing
423 * device ready/busy line. If set to NULL no access to
424 * ready/busy is available and the ready/busy information
425 * is read from the chip status register.
426 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing
427 * commands to the chip.
428 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on
429 * ready.
340 * @ecc: [BOARDSPECIFIC] ecc control ctructure 430 * @ecc: [BOARDSPECIFIC] ecc control ctructure
341 * @buffers: buffer structure for read/write 431 * @buffers: buffer structure for read/write
342 * @hwcontrol: platform-specific hardware control structure 432 * @hwcontrol: platform-specific hardware control structure
343 * @ops: oob operation operands 433 * @ops: oob operation operands
344 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support 434 * @erase_cmd: [INTERN] erase command write function, selectable due
435 * to AND support.
345 * @scan_bbt: [REPLACEABLE] function to scan bad block table 436 * @scan_bbt: [REPLACEABLE] function to scan bad block table
346 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) 437 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering
438 * data from array to read regs (tR).
347 * @state: [INTERN] the current state of the NAND device 439 * @state: [INTERN] the current state of the NAND device
348 * @oob_poi: poison value buffer 440 * @oob_poi: poison value buffer
349 * @page_shift: [INTERN] number of address bits in a page (column address bits) 441 * @page_shift: [INTERN] number of address bits in a page (column
442 * address bits).
350 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 443 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
351 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry 444 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
352 * @chip_shift: [INTERN] number of address bits in one chip 445 * @chip_shift: [INTERN] number of address bits in one chip
353 * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about 446 * @options: [BOARDSPECIFIC] various chip options. They can partly
354 * special functionality. See the defines for further explanation 447 * be set to inform nand_scan about special functionality.
355 * @badblockpos: [INTERN] position of the bad block marker in the oob area 448 * See the defines for further explanation.
449 * @badblockpos: [INTERN] position of the bad block marker in the oob
450 * area.
356 * @cellinfo: [INTERN] MLC/multichip data from chip ident 451 * @cellinfo: [INTERN] MLC/multichip data from chip ident
357 * @numchips: [INTERN] number of physical chips 452 * @numchips: [INTERN] number of physical chips
358 * @chipsize: [INTERN] the size of one chip for multichip arrays 453 * @chipsize: [INTERN] the size of one chip for multichip arrays
359 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 454 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
360 * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf 455 * @pagebuf: [INTERN] holds the pagenumber which is currently in
456 * data_buf.
361 * @subpagesize: [INTERN] holds the subpagesize 457 * @subpagesize: [INTERN] holds the subpagesize
458 * @onfi_version: [INTERN] holds the chip ONFI version (BCD encoded),
459 * non 0 if ONFI supported.
460 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is
461 * supported, 0 otherwise.
362 * @ecclayout: [REPLACEABLE] the default ecc placement scheme 462 * @ecclayout: [REPLACEABLE] the default ecc placement scheme
363 * @bbt: [INTERN] bad block table pointer 463 * @bbt: [INTERN] bad block table pointer
364 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup 464 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash
465 * lookup.
365 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor 466 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor
366 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan 467 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial
367 * @controller: [REPLACEABLE] a pointer to a hardware controller structure 468 * bad block scan.
368 * which is shared among multiple independend devices 469 * @controller: [REPLACEABLE] a pointer to a hardware controller
470 * structure which is shared among multiple independend
471 * devices.
369 * @priv: [OPTIONAL] pointer to private chip date 472 * @priv: [OPTIONAL] pointer to private chip date
370 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 473 * @errstat: [OPTIONAL] hardware specific function to perform
371 * (determine if errors are correctable) 474 * additional error status checks (determine if errors are
475 * correctable).
372 * @write_page: [REPLACEABLE] High-level page write function 476 * @write_page: [REPLACEABLE] High-level page write function
373 */ 477 */
374 478
375struct nand_chip { 479struct nand_chip {
376 void __iomem *IO_ADDR_R; 480 void __iomem *IO_ADDR_R;
377 void __iomem *IO_ADDR_W; 481 void __iomem *IO_ADDR_W;
378 482
379 uint8_t (*read_byte)(struct mtd_info *mtd); 483 uint8_t (*read_byte)(struct mtd_info *mtd);
380 u16 (*read_word)(struct mtd_info *mtd); 484 u16 (*read_word)(struct mtd_info *mtd);
381 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); 485 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
382 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); 486 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
383 int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); 487 int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
384 void (*select_chip)(struct mtd_info *mtd, int chip); 488 void (*select_chip)(struct mtd_info *mtd, int chip);
385 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); 489 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
386 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); 490 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
387 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, 491 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl);
388 unsigned int ctrl); 492 int (*init_size)(struct mtd_info *mtd, struct nand_chip *this,
389 int (*dev_ready)(struct mtd_info *mtd); 493 u8 *id_data);
390 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); 494 int (*dev_ready)(struct mtd_info *mtd);
391 int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); 495 void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column,
392 void (*erase_cmd)(struct mtd_info *mtd, int page); 496 int page_addr);
393 int (*scan_bbt)(struct mtd_info *mtd); 497 int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
394 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); 498 void (*erase_cmd)(struct mtd_info *mtd, int page);
395 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, 499 int (*scan_bbt)(struct mtd_info *mtd);
396 const uint8_t *buf, int page, int cached, int raw); 500 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state,
397 501 int status, int page);
398 int chip_delay; 502 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
399 unsigned int options; 503 const uint8_t *buf, int page, int cached, int raw);
400 504
401 int page_shift; 505 int chip_delay;
402 int phys_erase_shift; 506 unsigned int options;
403 int bbt_erase_shift; 507
404 int chip_shift; 508 int page_shift;
405 int numchips; 509 int phys_erase_shift;
406 uint64_t chipsize; 510 int bbt_erase_shift;
407 int pagemask; 511 int chip_shift;
408 int pagebuf; 512 int numchips;
409 int subpagesize; 513 uint64_t chipsize;
410 uint8_t cellinfo; 514 int pagemask;
411 int badblockpos; 515 int pagebuf;
412 int badblockbits; 516 int subpagesize;
413 517 uint8_t cellinfo;
414 flstate_t state; 518 int badblockpos;
415 519 int badblockbits;
416 uint8_t *oob_poi; 520
417 struct nand_hw_control *controller; 521 int onfi_version;
418 struct nand_ecclayout *ecclayout; 522 struct nand_onfi_params onfi_params;
523
524 flstate_t state;
525
526 uint8_t *oob_poi;
527 struct nand_hw_control *controller;
528 struct nand_ecclayout *ecclayout;
419 529
420 struct nand_ecc_ctrl ecc; 530 struct nand_ecc_ctrl ecc;
421 struct nand_buffers *buffers; 531 struct nand_buffers *buffers;
@@ -423,13 +533,13 @@ struct nand_chip {
423 533
424 struct mtd_oob_ops ops; 534 struct mtd_oob_ops ops;
425 535
426 uint8_t *bbt; 536 uint8_t *bbt;
427 struct nand_bbt_descr *bbt_td; 537 struct nand_bbt_descr *bbt_td;
428 struct nand_bbt_descr *bbt_md; 538 struct nand_bbt_descr *bbt_md;
429 539
430 struct nand_bbt_descr *badblock_pattern; 540 struct nand_bbt_descr *badblock_pattern;
431 541
432 void *priv; 542 void *priv;
433}; 543};
434 544
435/* 545/*
@@ -473,7 +583,7 @@ struct nand_flash_dev {
473*/ 583*/
474struct nand_manufacturers { 584struct nand_manufacturers {
475 int id; 585 int id;
476 char * name; 586 char *name;
477}; 587};
478 588
479extern struct nand_flash_dev nand_flash_ids[]; 589extern struct nand_flash_dev nand_flash_ids[];
@@ -486,7 +596,7 @@ extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt);
486extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, 596extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
487 int allowbbt); 597 int allowbbt);
488extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, 598extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
489 size_t * retlen, uint8_t * buf); 599 size_t *retlen, uint8_t *buf);
490 600
491/** 601/**
492 * struct platform_nand_chip - chip level device structure 602 * struct platform_nand_chip - chip level device structure
@@ -502,17 +612,16 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
502 * @priv: hardware controller specific settings 612 * @priv: hardware controller specific settings
503 */ 613 */
504struct platform_nand_chip { 614struct platform_nand_chip {
505 int nr_chips; 615 int nr_chips;
506 int chip_offset; 616 int chip_offset;
507 int nr_partitions; 617 int nr_partitions;
508 struct mtd_partition *partitions; 618 struct mtd_partition *partitions;
509 struct nand_ecclayout *ecclayout; 619 struct nand_ecclayout *ecclayout;
510 int chip_delay; 620 int chip_delay;
511 unsigned int options; 621 unsigned int options;
512 const char **part_probe_types; 622 const char **part_probe_types;
513 void (*set_parts)(uint64_t size, 623 void (*set_parts)(uint64_t size, struct platform_nand_chip *chip);
514 struct platform_nand_chip *chip); 624 void *priv;
515 void *priv;
516}; 625};
517 626
518/* Keep gcc happy */ 627/* Keep gcc happy */
@@ -534,18 +643,15 @@ struct platform_device;
534 * All fields are optional and depend on the hardware driver requirements 643 * All fields are optional and depend on the hardware driver requirements
535 */ 644 */
536struct platform_nand_ctrl { 645struct platform_nand_ctrl {
537 int (*probe)(struct platform_device *pdev); 646 int (*probe)(struct platform_device *pdev);
538 void (*remove)(struct platform_device *pdev); 647 void (*remove)(struct platform_device *pdev);
539 void (*hwcontrol)(struct mtd_info *mtd, int cmd); 648 void (*hwcontrol)(struct mtd_info *mtd, int cmd);
540 int (*dev_ready)(struct mtd_info *mtd); 649 int (*dev_ready)(struct mtd_info *mtd);
541 void (*select_chip)(struct mtd_info *mtd, int chip); 650 void (*select_chip)(struct mtd_info *mtd, int chip);
542 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, 651 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl);
543 unsigned int ctrl); 652 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
544 void (*write_buf)(struct mtd_info *mtd, 653 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
545 const uint8_t *buf, int len); 654 void *priv;
546 void (*read_buf)(struct mtd_info *mtd,
547 uint8_t *buf, int len);
548 void *priv;
549}; 655};
550 656
551/** 657/**
@@ -554,8 +660,8 @@ struct platform_nand_ctrl {
554 * @ctrl: controller level device structure 660 * @ctrl: controller level device structure
555 */ 661 */
556struct platform_nand_data { 662struct platform_nand_data {
557 struct platform_nand_chip chip; 663 struct platform_nand_chip chip;
558 struct platform_nand_ctrl ctrl; 664 struct platform_nand_ctrl ctrl;
559}; 665};
560 666
561/* Some helpers to access the data structures */ 667/* Some helpers to access the data structures */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 274b6196091..2b54316591d 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -39,7 +39,7 @@ struct mtd_partition {
39 uint64_t size; /* partition size */ 39 uint64_t size; /* partition size */
40 uint64_t offset; /* offset within the master MTD space */ 40 uint64_t offset; /* offset within the master MTD space */
41 uint32_t mask_flags; /* master MTD flags to mask out for this partition */ 41 uint32_t mask_flags; /* master MTD flags to mask out for this partition */
42 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ 42 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */
43}; 43};
44 44
45#define MTDPART_OFS_NXTBLK (-2) 45#define MTDPART_OFS_NXTBLK (-2)
@@ -89,4 +89,9 @@ static inline int mtd_has_cmdlinepart(void) { return 1; }
89static inline int mtd_has_cmdlinepart(void) { return 0; } 89static inline int mtd_has_cmdlinepart(void) { return 0; }
90#endif 90#endif
91 91
92int mtd_is_master(struct mtd_info *mtd);
93int mtd_add_partition(struct mtd_info *master, char *name,
94 long long offset, long long length);
95int mtd_del_partition(struct mtd_info *master, int partno);
96
92#endif 97#endif
diff --git a/include/linux/mtd/super.h b/include/linux/mtd/super.h
index 4016dd6fe33..f456230f933 100644
--- a/include/linux/mtd/super.h
+++ b/include/linux/mtd/super.h
@@ -18,10 +18,9 @@
18#include <linux/fs.h> 18#include <linux/fs.h>
19#include <linux/mount.h> 19#include <linux/mount.h>
20 20
21extern int get_sb_mtd(struct file_system_type *fs_type, int flags, 21extern struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
22 const char *dev_name, void *data, 22 const char *dev_name, void *data,
23 int (*fill_super)(struct super_block *, void *, int), 23 int (*fill_super)(struct super_block *, void *, int));
24 struct vfsmount *mnt);
25extern void kill_mtd_super(struct super_block *sb); 24extern void kill_mtd_super(struct super_block *sb);
26 25
27 26
diff --git a/include/linux/n_r3964.h b/include/linux/n_r3964.h
index de24af79ebd..54b8e0d8d91 100644
--- a/include/linux/n_r3964.h
+++ b/include/linux/n_r3964.h
@@ -4,7 +4,6 @@
4 * Copyright by 4 * Copyright by
5 * Philips Automation Projects 5 * Philips Automation Projects
6 * Kassel (Germany) 6 * Kassel (Germany)
7 * http://www.pap-philips.de
8 * ----------------------------------------------------------- 7 * -----------------------------------------------------------
9 * This software may be used and distributed according to the terms of 8 * This software may be used and distributed according to the terms of
10 * the GNU General Public License, incorporated herein by reference. 9 * the GNU General Public License, incorporated herein by reference.
diff --git a/include/linux/net.h b/include/linux/net.h
index dee0b11a875..16faa130088 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -229,6 +229,8 @@ enum {
229extern int sock_wake_async(struct socket *sk, int how, int band); 229extern int sock_wake_async(struct socket *sk, int how, int band);
230extern int sock_register(const struct net_proto_family *fam); 230extern int sock_register(const struct net_proto_family *fam);
231extern void sock_unregister(int family); 231extern void sock_unregister(int family);
232extern int __sock_create(struct net *net, int family, int type, int proto,
233 struct socket **res, int kern);
232extern int sock_create(int family, int type, int proto, 234extern int sock_create(int family, int type, int proto,
233 struct socket **res); 235 struct socket **res);
234extern int sock_create_kern(int family, int type, int proto, 236extern int sock_create_kern(int family, int type, int proto,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 46c36ffe20e..072652d94d9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -228,9 +228,9 @@ struct netdev_hw_addr {
228#define NETDEV_HW_ADDR_T_SLAVE 3 228#define NETDEV_HW_ADDR_T_SLAVE 3
229#define NETDEV_HW_ADDR_T_UNICAST 4 229#define NETDEV_HW_ADDR_T_UNICAST 4
230#define NETDEV_HW_ADDR_T_MULTICAST 5 230#define NETDEV_HW_ADDR_T_MULTICAST 5
231 int refcount;
232 bool synced; 231 bool synced;
233 bool global_use; 232 bool global_use;
233 int refcount;
234 struct rcu_head rcu_head; 234 struct rcu_head rcu_head;
235}; 235};
236 236
@@ -281,6 +281,12 @@ struct hh_cache {
281 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; 281 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
282}; 282};
283 283
284static inline void hh_cache_put(struct hh_cache *hh)
285{
286 if (atomic_dec_and_test(&hh->hh_refcnt))
287 kfree(hh);
288}
289
284/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. 290/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much.
285 * Alternative is: 291 * Alternative is:
286 * dev->hard_header_len ? (dev->hard_header_len + 292 * dev->hard_header_len ? (dev->hard_header_len +
@@ -579,15 +585,15 @@ static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table,
579 table->ents[hash & table->mask] = RPS_NO_CPU; 585 table->ents[hash & table->mask] = RPS_NO_CPU;
580} 586}
581 587
582extern struct rps_sock_flow_table *rps_sock_flow_table; 588extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
583 589
584/* This structure contains an instance of an RX queue. */ 590/* This structure contains an instance of an RX queue. */
585struct netdev_rx_queue { 591struct netdev_rx_queue {
586 struct rps_map *rps_map; 592 struct rps_map __rcu *rps_map;
587 struct rps_dev_flow_table *rps_flow_table; 593 struct rps_dev_flow_table __rcu *rps_flow_table;
588 struct kobject kobj; 594 struct kobject kobj;
589 struct netdev_rx_queue *first; 595 struct netdev_rx_queue *first;
590 atomic_t count; 596 atomic_t count;
591} ____cacheline_aligned_in_smp; 597} ____cacheline_aligned_in_smp;
592#endif /* CONFIG_RPS */ 598#endif /* CONFIG_RPS */
593 599
@@ -884,6 +890,9 @@ struct net_device {
884 int iflink; 890 int iflink;
885 891
886 struct net_device_stats stats; 892 struct net_device_stats stats;
893 atomic_long_t rx_dropped; /* dropped packets by core network
894 * Do not use this in drivers.
895 */
887 896
888#ifdef CONFIG_WIRELESS_EXT 897#ifdef CONFIG_WIRELESS_EXT
889 /* List of functions to handle Wireless Extensions (instead of ioctl). 898 /* List of functions to handle Wireless Extensions (instead of ioctl).
@@ -901,7 +910,7 @@ struct net_device {
901 910
902 unsigned int flags; /* interface flags (a la BSD) */ 911 unsigned int flags; /* interface flags (a la BSD) */
903 unsigned short gflags; 912 unsigned short gflags;
904 unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ 913 unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */
905 unsigned short padded; /* How much padding added by alloc_netdev() */ 914 unsigned short padded; /* How much padding added by alloc_netdev() */
906 915
907 unsigned char operstate; /* RFC2863 operstate */ 916 unsigned char operstate; /* RFC2863 operstate */
@@ -918,10 +927,6 @@ struct net_device {
918 unsigned short needed_headroom; 927 unsigned short needed_headroom;
919 unsigned short needed_tailroom; 928 unsigned short needed_tailroom;
920 929
921 struct net_device *master; /* Pointer to master device of a group,
922 * which this device is member of.
923 */
924
925 /* Interface address info. */ 930 /* Interface address info. */
926 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ 931 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */
927 unsigned char addr_assign_type; /* hw address assignment type */ 932 unsigned char addr_assign_type; /* hw address assignment type */
@@ -937,23 +942,37 @@ struct net_device {
937 942
938 943
939 /* Protocol specific pointers */ 944 /* Protocol specific pointers */
940 945
946#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
947 struct vlan_group __rcu *vlgrp; /* VLAN group */
948#endif
941#ifdef CONFIG_NET_DSA 949#ifdef CONFIG_NET_DSA
942 void *dsa_ptr; /* dsa specific data */ 950 void *dsa_ptr; /* dsa specific data */
943#endif 951#endif
944 void *atalk_ptr; /* AppleTalk link */ 952 void *atalk_ptr; /* AppleTalk link */
945 void *ip_ptr; /* IPv4 specific data */ 953 struct in_device __rcu *ip_ptr; /* IPv4 specific data */
946 void *dn_ptr; /* DECnet specific data */ 954 void *dn_ptr; /* DECnet specific data */
947 void *ip6_ptr; /* IPv6 specific data */ 955 struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */
948 void *ec_ptr; /* Econet specific data */ 956 void *ec_ptr; /* Econet specific data */
949 void *ax25_ptr; /* AX.25 specific data */ 957 void *ax25_ptr; /* AX.25 specific data */
950 struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data, 958 struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data,
951 assign before registering */ 959 assign before registering */
952 960
953/* 961/*
954 * Cache line mostly used on receive path (including eth_type_trans()) 962 * Cache lines mostly used on receive path (including eth_type_trans())
955 */ 963 */
956 unsigned long last_rx; /* Time of last Rx */ 964 unsigned long last_rx; /* Time of last Rx
965 * This should not be set in
966 * drivers, unless really needed,
967 * because network stack (bonding)
968 * use it if/when necessary, to
969 * avoid dirtying this cache line.
970 */
971
972 struct net_device *master; /* Pointer to master device of a group,
973 * which this device is member of.
974 */
975
957 /* Interface address info used in eth_type_trans() */ 976 /* Interface address info used in eth_type_trans() */
958 unsigned char *dev_addr; /* hw address, (before bcast 977 unsigned char *dev_addr; /* hw address, (before bcast
959 because most packets are 978 because most packets are
@@ -969,14 +988,21 @@ struct net_device {
969 988
970 struct netdev_rx_queue *_rx; 989 struct netdev_rx_queue *_rx;
971 990
972 /* Number of RX queues allocated at alloc_netdev_mq() time */ 991 /* Number of RX queues allocated at register_netdev() time */
973 unsigned int num_rx_queues; 992 unsigned int num_rx_queues;
993
994 /* Number of RX queues currently active in device */
995 unsigned int real_num_rx_queues;
974#endif 996#endif
975 997
976 struct netdev_queue rx_queue;
977 rx_handler_func_t *rx_handler; 998 rx_handler_func_t *rx_handler;
978 void *rx_handler_data; 999 void *rx_handler_data;
979 1000
1001 struct netdev_queue __rcu *ingress_queue;
1002
1003/*
1004 * Cache lines mostly used on transmit path
1005 */
980 struct netdev_queue *_tx ____cacheline_aligned_in_smp; 1006 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
981 1007
982 /* Number of TX queues allocated at alloc_netdev_mq() time */ 1008 /* Number of TX queues allocated at alloc_netdev_mq() time */
@@ -990,9 +1016,7 @@ struct net_device {
990 1016
991 unsigned long tx_queue_len; /* Max frames per queue allowed */ 1017 unsigned long tx_queue_len; /* Max frames per queue allowed */
992 spinlock_t tx_global_lock; 1018 spinlock_t tx_global_lock;
993/* 1019
994 * One part is mostly used on xmit path (device)
995 */
996 /* These may be needed for future network-power-down code. */ 1020 /* These may be needed for future network-power-down code. */
997 1021
998 /* 1022 /*
@@ -1005,7 +1029,7 @@ struct net_device {
1005 struct timer_list watchdog_timer; 1029 struct timer_list watchdog_timer;
1006 1030
1007 /* Number of references to this device */ 1031 /* Number of references to this device */
1008 atomic_t refcnt ____cacheline_aligned_in_smp; 1032 int __percpu *pcpu_refcnt;
1009 1033
1010 /* delayed register/unregister */ 1034 /* delayed register/unregister */
1011 struct list_head todo_list; 1035 struct list_head todo_list;
@@ -1041,10 +1065,14 @@ struct net_device {
1041#endif 1065#endif
1042 1066
1043 /* mid-layer private */ 1067 /* mid-layer private */
1044 void *ml_priv; 1068 union {
1045 1069 void *ml_priv;
1070 struct pcpu_lstats __percpu *lstats; /* loopback stats */
1071 struct pcpu_tstats __percpu *tstats; /* tunnel stats */
1072 struct pcpu_dstats __percpu *dstats; /* dummy stats */
1073 };
1046 /* GARP */ 1074 /* GARP */
1047 struct garp_port *garp_port; 1075 struct garp_port __rcu *garp_port;
1048 1076
1049 /* class/net/name entry */ 1077 /* class/net/name entry */
1050 struct device dev; 1078 struct device dev;
@@ -1305,6 +1333,7 @@ static inline void unregister_netdevice(struct net_device *dev)
1305 unregister_netdevice_queue(dev, NULL); 1333 unregister_netdevice_queue(dev, NULL);
1306} 1334}
1307 1335
1336extern int netdev_refcnt_read(const struct net_device *dev);
1308extern void free_netdev(struct net_device *dev); 1337extern void free_netdev(struct net_device *dev);
1309extern void synchronize_net(void); 1338extern void synchronize_net(void);
1310extern int register_netdevice_notifier(struct notifier_block *nb); 1339extern int register_netdevice_notifier(struct notifier_block *nb);
@@ -1667,11 +1696,34 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
1667 */ 1696 */
1668static inline int netif_is_multiqueue(const struct net_device *dev) 1697static inline int netif_is_multiqueue(const struct net_device *dev)
1669{ 1698{
1670 return (dev->num_tx_queues > 1); 1699 return dev->num_tx_queues > 1;
1671} 1700}
1672 1701
1673extern void netif_set_real_num_tx_queues(struct net_device *dev, 1702extern int netif_set_real_num_tx_queues(struct net_device *dev,
1674 unsigned int txq); 1703 unsigned int txq);
1704
1705#ifdef CONFIG_RPS
1706extern int netif_set_real_num_rx_queues(struct net_device *dev,
1707 unsigned int rxq);
1708#else
1709static inline int netif_set_real_num_rx_queues(struct net_device *dev,
1710 unsigned int rxq)
1711{
1712 return 0;
1713}
1714#endif
1715
1716static inline int netif_copy_real_num_queues(struct net_device *to_dev,
1717 const struct net_device *from_dev)
1718{
1719 netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues);
1720#ifdef CONFIG_RPS
1721 return netif_set_real_num_rx_queues(to_dev,
1722 from_dev->real_num_rx_queues);
1723#else
1724 return 0;
1725#endif
1726}
1675 1727
1676/* Use this variant when it is known for sure that it 1728/* Use this variant when it is known for sure that it
1677 * is executing from hardware interrupt context or with hardware interrupts 1729 * is executing from hardware interrupt context or with hardware interrupts
@@ -1695,8 +1747,7 @@ extern gro_result_t dev_gro_receive(struct napi_struct *napi,
1695extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); 1747extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
1696extern gro_result_t napi_gro_receive(struct napi_struct *napi, 1748extern gro_result_t napi_gro_receive(struct napi_struct *napi,
1697 struct sk_buff *skb); 1749 struct sk_buff *skb);
1698extern void napi_reuse_skb(struct napi_struct *napi, 1750extern void napi_gro_flush(struct napi_struct *napi);
1699 struct sk_buff *skb);
1700extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 1751extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
1701extern gro_result_t napi_frags_finish(struct napi_struct *napi, 1752extern gro_result_t napi_frags_finish(struct napi_struct *napi,
1702 struct sk_buff *skb, 1753 struct sk_buff *skb,
@@ -1715,7 +1766,6 @@ extern int netdev_rx_handler_register(struct net_device *dev,
1715 void *rx_handler_data); 1766 void *rx_handler_data);
1716extern void netdev_rx_handler_unregister(struct net_device *dev); 1767extern void netdev_rx_handler_unregister(struct net_device *dev);
1717 1768
1718extern void netif_nit_deliver(struct sk_buff *skb);
1719extern int dev_valid_name(const char *name); 1769extern int dev_valid_name(const char *name);
1720extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 1770extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
1721extern int dev_ethtool(struct net *net, struct ifreq *); 1771extern int dev_ethtool(struct net *net, struct ifreq *);
@@ -1749,7 +1799,7 @@ extern void netdev_run_todo(void);
1749 */ 1799 */
1750static inline void dev_put(struct net_device *dev) 1800static inline void dev_put(struct net_device *dev)
1751{ 1801{
1752 atomic_dec(&dev->refcnt); 1802 irqsafe_cpu_dec(*dev->pcpu_refcnt);
1753} 1803}
1754 1804
1755/** 1805/**
@@ -1760,7 +1810,7 @@ static inline void dev_put(struct net_device *dev)
1760 */ 1810 */
1761static inline void dev_hold(struct net_device *dev) 1811static inline void dev_hold(struct net_device *dev)
1762{ 1812{
1763 atomic_inc(&dev->refcnt); 1813 irqsafe_cpu_inc(*dev->pcpu_refcnt);
1764} 1814}
1765 1815
1766/* Carrier loss detection, dial on demand. The functions netif_carrier_on 1816/* Carrier loss detection, dial on demand. The functions netif_carrier_on
@@ -2171,6 +2221,8 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
2171extern int netdev_class_create_file(struct class_attribute *class_attr); 2221extern int netdev_class_create_file(struct class_attribute *class_attr);
2172extern void netdev_class_remove_file(struct class_attribute *class_attr); 2222extern void netdev_class_remove_file(struct class_attribute *class_attr);
2173 2223
2224extern struct kobj_ns_type_operations net_ns_type_operations;
2225
2174extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); 2226extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len);
2175 2227
2176extern void linkwatch_run_queue(void); 2228extern void linkwatch_run_queue(void);
@@ -2191,14 +2243,22 @@ static inline int net_gso_ok(int features, int gso_type)
2191static inline int skb_gso_ok(struct sk_buff *skb, int features) 2243static inline int skb_gso_ok(struct sk_buff *skb, int features)
2192{ 2244{
2193 return net_gso_ok(features, skb_shinfo(skb)->gso_type) && 2245 return net_gso_ok(features, skb_shinfo(skb)->gso_type) &&
2194 (!skb_has_frags(skb) || (features & NETIF_F_FRAGLIST)); 2246 (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST));
2195} 2247}
2196 2248
2197static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) 2249static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
2198{ 2250{
2199 return skb_is_gso(skb) && 2251 if (skb_is_gso(skb)) {
2200 (!skb_gso_ok(skb, dev->features) || 2252 int features = dev->features;
2201 unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); 2253
2254 if (skb->protocol == htons(ETH_P_8021Q) || skb->vlan_tci)
2255 features &= dev->vlan_features;
2256
2257 return (!skb_gso_ok(skb, features) ||
2258 unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
2259 }
2260
2261 return 0;
2202} 2262}
2203 2263
2204static inline void netif_set_gso_max_size(struct net_device *dev, 2264static inline void netif_set_gso_max_size(struct net_device *dev,
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 1afd18c855e..50cdc2559a5 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -98,8 +98,14 @@ enum ip_conntrack_events {
98 98
99enum ip_conntrack_expect_events { 99enum ip_conntrack_expect_events {
100 IPEXP_NEW, /* new expectation */ 100 IPEXP_NEW, /* new expectation */
101 IPEXP_DESTROY, /* destroyed expectation */
101}; 102};
102 103
104/* expectation flags */
105#define NF_CT_EXPECT_PERMANENT 0x1
106#define NF_CT_EXPECT_INACTIVE 0x2
107#define NF_CT_EXPECT_USERSPACE 0x4
108
103#ifdef __KERNEL__ 109#ifdef __KERNEL__
104struct ip_conntrack_stat { 110struct ip_conntrack_stat {
105 unsigned int searched; 111 unsigned int searched;
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index ff8cfbcf3b8..0ce91d56a5f 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -89,6 +89,7 @@ enum sip_header_types {
89 SIP_HDR_VIA_TCP, 89 SIP_HDR_VIA_TCP,
90 SIP_HDR_EXPIRES, 90 SIP_HDR_EXPIRES,
91 SIP_HDR_CONTENT_LENGTH, 91 SIP_HDR_CONTENT_LENGTH,
92 SIP_HDR_CALL_ID,
92}; 93};
93 94
94enum sdp_header_types { 95enum sdp_header_types {
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index 70cd0603911..19711e3ffd4 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -162,6 +162,7 @@ enum ctattr_expect {
162 CTA_EXPECT_ID, 162 CTA_EXPECT_ID,
163 CTA_EXPECT_HELP_NAME, 163 CTA_EXPECT_HELP_NAME,
164 CTA_EXPECT_ZONE, 164 CTA_EXPECT_ZONE,
165 CTA_EXPECT_FLAGS,
165 __CTA_EXPECT_MAX 166 __CTA_EXPECT_MAX
166}; 167};
167#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) 168#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1)
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 24e5d01d27d..742bec05144 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -66,6 +66,11 @@ struct xt_standard_target {
66 int verdict; 66 int verdict;
67}; 67};
68 68
69struct xt_error_target {
70 struct xt_entry_target target;
71 char errorname[XT_FUNCTION_MAXNAMELEN];
72};
73
69/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision 74/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
70 * kernel supports, if >= revision. */ 75 * kernel supports, if >= revision. */
71struct xt_get_revision { 76struct xt_get_revision {
diff --git a/include/linux/netfilter/xt_TPROXY.h b/include/linux/netfilter/xt_TPROXY.h
index 152e8f97132..3f3d6936128 100644
--- a/include/linux/netfilter/xt_TPROXY.h
+++ b/include/linux/netfilter/xt_TPROXY.h
@@ -1,5 +1,5 @@
1#ifndef _XT_TPROXY_H_target 1#ifndef _XT_TPROXY_H
2#define _XT_TPROXY_H_target 2#define _XT_TPROXY_H
3 3
4/* TPROXY target is capable of marking the packet to perform 4/* TPROXY target is capable of marking the packet to perform
5 * redirection. We can get rid of that whenever we get support for 5 * redirection. We can get rid of that whenever we get support for
@@ -11,4 +11,11 @@ struct xt_tproxy_target_info {
11 __be16 lport; 11 __be16 lport;
12}; 12};
13 13
14#endif /* _XT_TPROXY_H_target */ 14struct xt_tproxy_target_info_v1 {
15 u_int32_t mark_mask;
16 u_int32_t mark_value;
17 union nf_inet_addr laddr;
18 __be16 lport;
19};
20
21#endif /* _XT_TPROXY_H */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index e9948c0560f..adbf4bff87e 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -21,8 +21,21 @@
21 21
22#include <linux/netfilter/x_tables.h> 22#include <linux/netfilter/x_tables.h>
23 23
24#ifndef __KERNEL__
24#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 25#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
25#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 26#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
27#define arpt_entry_target xt_entry_target
28#define arpt_standard_target xt_standard_target
29#define arpt_error_target xt_error_target
30#define ARPT_CONTINUE XT_CONTINUE
31#define ARPT_RETURN XT_RETURN
32#define arpt_counters_info xt_counters_info
33#define arpt_counters xt_counters
34#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
35#define ARPT_ERROR_TARGET XT_ERROR_TARGET
36#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
37 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
38#endif
26 39
27#define ARPT_DEV_ADDR_LEN_MAX 16 40#define ARPT_DEV_ADDR_LEN_MAX 16
28 41
@@ -63,9 +76,6 @@ struct arpt_arp {
63 u_int16_t invflags; 76 u_int16_t invflags;
64}; 77};
65 78
66#define arpt_entry_target xt_entry_target
67#define arpt_standard_target xt_standard_target
68
69/* Values for "flag" field in struct arpt_ip (general arp structure). 79/* Values for "flag" field in struct arpt_ip (general arp structure).
70 * No flags defined yet. 80 * No flags defined yet.
71 */ 81 */
@@ -125,16 +135,10 @@ struct arpt_entry
125#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3) 135#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
126#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET) 136#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
127 137
128/* CONTINUE verdict for targets */
129#define ARPT_CONTINUE XT_CONTINUE
130
131/* For standard target */
132#define ARPT_RETURN XT_RETURN
133
134/* The argument to ARPT_SO_GET_INFO */ 138/* The argument to ARPT_SO_GET_INFO */
135struct arpt_getinfo { 139struct arpt_getinfo {
136 /* Which table: caller fills this in. */ 140 /* Which table: caller fills this in. */
137 char name[ARPT_TABLE_MAXNAMELEN]; 141 char name[XT_TABLE_MAXNAMELEN];
138 142
139 /* Kernel fills these in. */ 143 /* Kernel fills these in. */
140 /* Which hook entry points are valid: bitmask */ 144 /* Which hook entry points are valid: bitmask */
@@ -156,7 +160,7 @@ struct arpt_getinfo {
156/* The argument to ARPT_SO_SET_REPLACE. */ 160/* The argument to ARPT_SO_SET_REPLACE. */
157struct arpt_replace { 161struct arpt_replace {
158 /* Which table. */ 162 /* Which table. */
159 char name[ARPT_TABLE_MAXNAMELEN]; 163 char name[XT_TABLE_MAXNAMELEN];
160 164
161 /* Which hook entry points are valid: bitmask. You can't 165 /* Which hook entry points are valid: bitmask. You can't
162 change this. */ 166 change this. */
@@ -184,14 +188,10 @@ struct arpt_replace {
184 struct arpt_entry entries[0]; 188 struct arpt_entry entries[0];
185}; 189};
186 190
187/* The argument to ARPT_SO_ADD_COUNTERS. */
188#define arpt_counters_info xt_counters_info
189#define arpt_counters xt_counters
190
191/* The argument to ARPT_SO_GET_ENTRIES. */ 191/* The argument to ARPT_SO_GET_ENTRIES. */
192struct arpt_get_entries { 192struct arpt_get_entries {
193 /* Which table: user fills this in. */ 193 /* Which table: user fills this in. */
194 char name[ARPT_TABLE_MAXNAMELEN]; 194 char name[XT_TABLE_MAXNAMELEN];
195 195
196 /* User fills this in: total entry size. */ 196 /* User fills this in: total entry size. */
197 unsigned int size; 197 unsigned int size;
@@ -200,23 +200,12 @@ struct arpt_get_entries {
200 struct arpt_entry entrytable[0]; 200 struct arpt_entry entrytable[0];
201}; 201};
202 202
203/* Standard return verdict, or do jump. */
204#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
205/* Error verdict. */
206#define ARPT_ERROR_TARGET XT_ERROR_TARGET
207
208/* Helper functions */ 203/* Helper functions */
209static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e) 204static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)
210{ 205{
211 return (void *)e + e->target_offset; 206 return (void *)e + e->target_offset;
212} 207}
213 208
214#ifndef __KERNEL__
215/* fn returns 0 to continue iteration */
216#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
217 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
218#endif
219
220/* 209/*
221 * Main firewall chains definitions and global var's definitions. 210 * Main firewall chains definitions and global var's definitions.
222 */ 211 */
@@ -225,17 +214,12 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e
225/* Standard entry. */ 214/* Standard entry. */
226struct arpt_standard { 215struct arpt_standard {
227 struct arpt_entry entry; 216 struct arpt_entry entry;
228 struct arpt_standard_target target; 217 struct xt_standard_target target;
229};
230
231struct arpt_error_target {
232 struct arpt_entry_target target;
233 char errorname[ARPT_FUNCTION_MAXNAMELEN];
234}; 218};
235 219
236struct arpt_error { 220struct arpt_error {
237 struct arpt_entry entry; 221 struct arpt_entry entry;
238 struct arpt_error_target target; 222 struct xt_error_target target;
239}; 223};
240 224
241#define ARPT_ENTRY_INIT(__size) \ 225#define ARPT_ENTRY_INIT(__size) \
@@ -247,16 +231,16 @@ struct arpt_error {
247#define ARPT_STANDARD_INIT(__verdict) \ 231#define ARPT_STANDARD_INIT(__verdict) \
248{ \ 232{ \
249 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \ 233 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \
250 .target = XT_TARGET_INIT(ARPT_STANDARD_TARGET, \ 234 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
251 sizeof(struct arpt_standard_target)), \ 235 sizeof(struct xt_standard_target)), \
252 .target.verdict = -(__verdict) - 1, \ 236 .target.verdict = -(__verdict) - 1, \
253} 237}
254 238
255#define ARPT_ERROR_INIT \ 239#define ARPT_ERROR_INIT \
256{ \ 240{ \
257 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_error)), \ 241 .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_error)), \
258 .target = XT_TARGET_INIT(ARPT_ERROR_TARGET, \ 242 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
259 sizeof(struct arpt_error_target)), \ 243 sizeof(struct xt_error_target)), \
260 .target.errorname = "ERROR", \ 244 .target.errorname = "ERROR", \
261} 245}
262 246
@@ -271,8 +255,6 @@ extern unsigned int arpt_do_table(struct sk_buff *skb,
271 const struct net_device *out, 255 const struct net_device *out,
272 struct xt_table *table); 256 struct xt_table *table);
273 257
274#define ARPT_ALIGN(s) XT_ALIGN(s)
275
276#ifdef CONFIG_COMPAT 258#ifdef CONFIG_COMPAT
277#include <net/compat.h> 259#include <net/compat.h>
278 260
@@ -285,14 +267,12 @@ struct compat_arpt_entry {
285 unsigned char elems[0]; 267 unsigned char elems[0];
286}; 268};
287 269
288static inline struct arpt_entry_target * 270static inline struct xt_entry_target *
289compat_arpt_get_target(struct compat_arpt_entry *e) 271compat_arpt_get_target(struct compat_arpt_entry *e)
290{ 272{
291 return (void *)e + e->target_offset; 273 return (void *)e + e->target_offset;
292} 274}
293 275
294#define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s)
295
296#endif /* CONFIG_COMPAT */ 276#endif /* CONFIG_COMPAT */
297#endif /*__KERNEL__*/ 277#endif /*__KERNEL__*/
298#endif /* _ARPTABLES_H */ 278#endif /* _ARPTABLES_H */
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild
index d4d78672873..e48f1a3f5a4 100644
--- a/include/linux/netfilter_bridge/Kbuild
+++ b/include/linux/netfilter_bridge/Kbuild
@@ -3,11 +3,13 @@ header-y += ebt_among.h
3header-y += ebt_arp.h 3header-y += ebt_arp.h
4header-y += ebt_arpreply.h 4header-y += ebt_arpreply.h
5header-y += ebt_ip.h 5header-y += ebt_ip.h
6header-y += ebt_ip6.h
6header-y += ebt_limit.h 7header-y += ebt_limit.h
7header-y += ebt_log.h 8header-y += ebt_log.h
8header-y += ebt_mark_m.h 9header-y += ebt_mark_m.h
9header-y += ebt_mark_t.h 10header-y += ebt_mark_t.h
10header-y += ebt_nat.h 11header-y += ebt_nat.h
12header-y += ebt_nflog.h
11header-y += ebt_pkttype.h 13header-y += ebt_pkttype.h
12header-y += ebt_redirect.h 14header-y += ebt_redirect.h
13header-y += ebt_stp.h 15header-y += ebt_stp.h
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 704a7b6e816..64a5d95c58e 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -27,12 +27,49 @@
27 27
28#include <linux/netfilter/x_tables.h> 28#include <linux/netfilter/x_tables.h>
29 29
30#ifndef __KERNEL__
30#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 31#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
31#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 32#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
32#define ipt_match xt_match 33#define ipt_match xt_match
33#define ipt_target xt_target 34#define ipt_target xt_target
34#define ipt_table xt_table 35#define ipt_table xt_table
35#define ipt_get_revision xt_get_revision 36#define ipt_get_revision xt_get_revision
37#define ipt_entry_match xt_entry_match
38#define ipt_entry_target xt_entry_target
39#define ipt_standard_target xt_standard_target
40#define ipt_error_target xt_error_target
41#define ipt_counters xt_counters
42#define IPT_CONTINUE XT_CONTINUE
43#define IPT_RETURN XT_RETURN
44
45/* This group is older than old (iptables < v1.4.0-rc1~89) */
46#include <linux/netfilter/xt_tcpudp.h>
47#define ipt_udp xt_udp
48#define ipt_tcp xt_tcp
49#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
50#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
51#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
52#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
53#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
54#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
55#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
56#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
57
58/* The argument to IPT_SO_ADD_COUNTERS. */
59#define ipt_counters_info xt_counters_info
60/* Standard return verdict, or do jump. */
61#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
62/* Error verdict. */
63#define IPT_ERROR_TARGET XT_ERROR_TARGET
64
65/* fn returns 0 to continue iteration */
66#define IPT_MATCH_ITERATE(e, fn, args...) \
67 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
68
69/* fn returns 0 to continue iteration */
70#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
71 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
72#endif
36 73
37/* Yes, Virginia, you have to zero the padding. */ 74/* Yes, Virginia, you have to zero the padding. */
38struct ipt_ip { 75struct ipt_ip {
@@ -52,12 +89,6 @@ struct ipt_ip {
52 u_int8_t invflags; 89 u_int8_t invflags;
53}; 90};
54 91
55#define ipt_entry_match xt_entry_match
56#define ipt_entry_target xt_entry_target
57#define ipt_standard_target xt_standard_target
58
59#define ipt_counters xt_counters
60
61/* Values for "flag" field in struct ipt_ip (general ip structure). */ 92/* Values for "flag" field in struct ipt_ip (general ip structure). */
62#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ 93#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */
63#define IPT_F_GOTO 0x02 /* Set if jump is a goto */ 94#define IPT_F_GOTO 0x02 /* Set if jump is a goto */
@@ -116,23 +147,6 @@ struct ipt_entry {
116#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3) 147#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
117#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET 148#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
118 149
119#define IPT_CONTINUE XT_CONTINUE
120#define IPT_RETURN XT_RETURN
121
122#include <linux/netfilter/xt_tcpudp.h>
123#define ipt_udp xt_udp
124#define ipt_tcp xt_tcp
125
126#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
127#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
128#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
129#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
130#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
131
132#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
133#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
134#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
135
136/* ICMP matching stuff */ 150/* ICMP matching stuff */
137struct ipt_icmp { 151struct ipt_icmp {
138 u_int8_t type; /* type to match */ 152 u_int8_t type; /* type to match */
@@ -146,7 +160,7 @@ struct ipt_icmp {
146/* The argument to IPT_SO_GET_INFO */ 160/* The argument to IPT_SO_GET_INFO */
147struct ipt_getinfo { 161struct ipt_getinfo {
148 /* Which table: caller fills this in. */ 162 /* Which table: caller fills this in. */
149 char name[IPT_TABLE_MAXNAMELEN]; 163 char name[XT_TABLE_MAXNAMELEN];
150 164
151 /* Kernel fills these in. */ 165 /* Kernel fills these in. */
152 /* Which hook entry points are valid: bitmask */ 166 /* Which hook entry points are valid: bitmask */
@@ -168,7 +182,7 @@ struct ipt_getinfo {
168/* The argument to IPT_SO_SET_REPLACE. */ 182/* The argument to IPT_SO_SET_REPLACE. */
169struct ipt_replace { 183struct ipt_replace {
170 /* Which table. */ 184 /* Which table. */
171 char name[IPT_TABLE_MAXNAMELEN]; 185 char name[XT_TABLE_MAXNAMELEN];
172 186
173 /* Which hook entry points are valid: bitmask. You can't 187 /* Which hook entry points are valid: bitmask. You can't
174 change this. */ 188 change this. */
@@ -196,13 +210,10 @@ struct ipt_replace {
196 struct ipt_entry entries[0]; 210 struct ipt_entry entries[0];
197}; 211};
198 212
199/* The argument to IPT_SO_ADD_COUNTERS. */
200#define ipt_counters_info xt_counters_info
201
202/* The argument to IPT_SO_GET_ENTRIES. */ 213/* The argument to IPT_SO_GET_ENTRIES. */
203struct ipt_get_entries { 214struct ipt_get_entries {
204 /* Which table: user fills this in. */ 215 /* Which table: user fills this in. */
205 char name[IPT_TABLE_MAXNAMELEN]; 216 char name[XT_TABLE_MAXNAMELEN];
206 217
207 /* User fills this in: total entry size. */ 218 /* User fills this in: total entry size. */
208 unsigned int size; 219 unsigned int size;
@@ -211,28 +222,13 @@ struct ipt_get_entries {
211 struct ipt_entry entrytable[0]; 222 struct ipt_entry entrytable[0];
212}; 223};
213 224
214/* Standard return verdict, or do jump. */
215#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
216/* Error verdict. */
217#define IPT_ERROR_TARGET XT_ERROR_TARGET
218
219/* Helper functions */ 225/* Helper functions */
220static __inline__ struct ipt_entry_target * 226static __inline__ struct xt_entry_target *
221ipt_get_target(struct ipt_entry *e) 227ipt_get_target(struct ipt_entry *e)
222{ 228{
223 return (void *)e + e->target_offset; 229 return (void *)e + e->target_offset;
224} 230}
225 231
226#ifndef __KERNEL__
227/* fn returns 0 to continue iteration */
228#define IPT_MATCH_ITERATE(e, fn, args...) \
229 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
230
231/* fn returns 0 to continue iteration */
232#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
233 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
234#endif
235
236/* 232/*
237 * Main firewall chains definitions and global var's definitions. 233 * Main firewall chains definitions and global var's definitions.
238 */ 234 */
@@ -249,17 +245,12 @@ extern void ipt_unregister_table(struct net *net, struct xt_table *table);
249/* Standard entry. */ 245/* Standard entry. */
250struct ipt_standard { 246struct ipt_standard {
251 struct ipt_entry entry; 247 struct ipt_entry entry;
252 struct ipt_standard_target target; 248 struct xt_standard_target target;
253};
254
255struct ipt_error_target {
256 struct ipt_entry_target target;
257 char errorname[IPT_FUNCTION_MAXNAMELEN];
258}; 249};
259 250
260struct ipt_error { 251struct ipt_error {
261 struct ipt_entry entry; 252 struct ipt_entry entry;
262 struct ipt_error_target target; 253 struct xt_error_target target;
263}; 254};
264 255
265#define IPT_ENTRY_INIT(__size) \ 256#define IPT_ENTRY_INIT(__size) \
@@ -271,7 +262,7 @@ struct ipt_error {
271#define IPT_STANDARD_INIT(__verdict) \ 262#define IPT_STANDARD_INIT(__verdict) \
272{ \ 263{ \
273 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \ 264 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \
274 .target = XT_TARGET_INIT(IPT_STANDARD_TARGET, \ 265 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
275 sizeof(struct xt_standard_target)), \ 266 sizeof(struct xt_standard_target)), \
276 .target.verdict = -(__verdict) - 1, \ 267 .target.verdict = -(__verdict) - 1, \
277} 268}
@@ -279,8 +270,8 @@ struct ipt_error {
279#define IPT_ERROR_INIT \ 270#define IPT_ERROR_INIT \
280{ \ 271{ \
281 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \ 272 .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \
282 .target = XT_TARGET_INIT(IPT_ERROR_TARGET, \ 273 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
283 sizeof(struct ipt_error_target)), \ 274 sizeof(struct xt_error_target)), \
284 .target.errorname = "ERROR", \ 275 .target.errorname = "ERROR", \
285} 276}
286 277
@@ -291,8 +282,6 @@ extern unsigned int ipt_do_table(struct sk_buff *skb,
291 const struct net_device *out, 282 const struct net_device *out,
292 struct xt_table *table); 283 struct xt_table *table);
293 284
294#define IPT_ALIGN(s) XT_ALIGN(s)
295
296#ifdef CONFIG_COMPAT 285#ifdef CONFIG_COMPAT
297#include <net/compat.h> 286#include <net/compat.h>
298 287
@@ -307,14 +296,12 @@ struct compat_ipt_entry {
307}; 296};
308 297
309/* Helper functions */ 298/* Helper functions */
310static inline struct ipt_entry_target * 299static inline struct xt_entry_target *
311compat_ipt_get_target(struct compat_ipt_entry *e) 300compat_ipt_get_target(struct compat_ipt_entry *e)
312{ 301{
313 return (void *)e + e->target_offset; 302 return (void *)e + e->target_offset;
314} 303}
315 304
316#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s)
317
318#endif /* CONFIG_COMPAT */ 305#endif /* CONFIG_COMPAT */
319#endif /*__KERNEL__*/ 306#endif /*__KERNEL__*/
320#endif /* _IPTABLES_H */ 307#endif /* _IPTABLES_H */
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 18442ff19c0..c9784f7a9c1 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -27,13 +27,42 @@
27 27
28#include <linux/netfilter/x_tables.h> 28#include <linux/netfilter/x_tables.h>
29 29
30#ifndef __KERNEL__
30#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN 31#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
31#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN 32#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
32
33#define ip6t_match xt_match 33#define ip6t_match xt_match
34#define ip6t_target xt_target 34#define ip6t_target xt_target
35#define ip6t_table xt_table 35#define ip6t_table xt_table
36#define ip6t_get_revision xt_get_revision 36#define ip6t_get_revision xt_get_revision
37#define ip6t_entry_match xt_entry_match
38#define ip6t_entry_target xt_entry_target
39#define ip6t_standard_target xt_standard_target
40#define ip6t_error_target xt_error_target
41#define ip6t_counters xt_counters
42#define IP6T_CONTINUE XT_CONTINUE
43#define IP6T_RETURN XT_RETURN
44
45/* Pre-iptables-1.4.0 */
46#include <linux/netfilter/xt_tcpudp.h>
47#define ip6t_tcp xt_tcp
48#define ip6t_udp xt_udp
49#define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
50#define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
51#define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
52#define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
53#define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
54#define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
55#define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
56#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
57
58#define ip6t_counters_info xt_counters_info
59#define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
60#define IP6T_ERROR_TARGET XT_ERROR_TARGET
61#define IP6T_MATCH_ITERATE(e, fn, args...) \
62 XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args)
63#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
64 XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args)
65#endif
37 66
38/* Yes, Virginia, you have to zero the padding. */ 67/* Yes, Virginia, you have to zero the padding. */
39struct ip6t_ip6 { 68struct ip6t_ip6 {
@@ -62,12 +91,6 @@ struct ip6t_ip6 {
62 u_int8_t invflags; 91 u_int8_t invflags;
63}; 92};
64 93
65#define ip6t_entry_match xt_entry_match
66#define ip6t_entry_target xt_entry_target
67#define ip6t_standard_target xt_standard_target
68
69#define ip6t_counters xt_counters
70
71/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ 94/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
72#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper 95#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper
73 protocols */ 96 protocols */
@@ -112,17 +135,12 @@ struct ip6t_entry {
112/* Standard entry */ 135/* Standard entry */
113struct ip6t_standard { 136struct ip6t_standard {
114 struct ip6t_entry entry; 137 struct ip6t_entry entry;
115 struct ip6t_standard_target target; 138 struct xt_standard_target target;
116};
117
118struct ip6t_error_target {
119 struct ip6t_entry_target target;
120 char errorname[IP6T_FUNCTION_MAXNAMELEN];
121}; 139};
122 140
123struct ip6t_error { 141struct ip6t_error {
124 struct ip6t_entry entry; 142 struct ip6t_entry entry;
125 struct ip6t_error_target target; 143 struct xt_error_target target;
126}; 144};
127 145
128#define IP6T_ENTRY_INIT(__size) \ 146#define IP6T_ENTRY_INIT(__size) \
@@ -134,16 +152,16 @@ struct ip6t_error {
134#define IP6T_STANDARD_INIT(__verdict) \ 152#define IP6T_STANDARD_INIT(__verdict) \
135{ \ 153{ \
136 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \ 154 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \
137 .target = XT_TARGET_INIT(IP6T_STANDARD_TARGET, \ 155 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
138 sizeof(struct ip6t_standard_target)), \ 156 sizeof(struct xt_standard_target)), \
139 .target.verdict = -(__verdict) - 1, \ 157 .target.verdict = -(__verdict) - 1, \
140} 158}
141 159
142#define IP6T_ERROR_INIT \ 160#define IP6T_ERROR_INIT \
143{ \ 161{ \
144 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \ 162 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \
145 .target = XT_TARGET_INIT(IP6T_ERROR_TARGET, \ 163 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
146 sizeof(struct ip6t_error_target)), \ 164 sizeof(struct xt_error_target)), \
147 .target.errorname = "ERROR", \ 165 .target.errorname = "ERROR", \
148} 166}
149 167
@@ -166,30 +184,6 @@ struct ip6t_error {
166#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) 184#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
167#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET 185#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
168 186
169/* CONTINUE verdict for targets */
170#define IP6T_CONTINUE XT_CONTINUE
171
172/* For standard target */
173#define IP6T_RETURN XT_RETURN
174
175/* TCP/UDP matching stuff */
176#include <linux/netfilter/xt_tcpudp.h>
177
178#define ip6t_tcp xt_tcp
179#define ip6t_udp xt_udp
180
181/* Values for "inv" field in struct ipt_tcp. */
182#define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
183#define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
184#define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
185#define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
186#define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
187
188/* Values for "invflags" field in struct ipt_udp. */
189#define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
190#define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
191#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
192
193/* ICMP matching stuff */ 187/* ICMP matching stuff */
194struct ip6t_icmp { 188struct ip6t_icmp {
195 u_int8_t type; /* type to match */ 189 u_int8_t type; /* type to match */
@@ -203,7 +197,7 @@ struct ip6t_icmp {
203/* The argument to IP6T_SO_GET_INFO */ 197/* The argument to IP6T_SO_GET_INFO */
204struct ip6t_getinfo { 198struct ip6t_getinfo {
205 /* Which table: caller fills this in. */ 199 /* Which table: caller fills this in. */
206 char name[IP6T_TABLE_MAXNAMELEN]; 200 char name[XT_TABLE_MAXNAMELEN];
207 201
208 /* Kernel fills these in. */ 202 /* Kernel fills these in. */
209 /* Which hook entry points are valid: bitmask */ 203 /* Which hook entry points are valid: bitmask */
@@ -225,7 +219,7 @@ struct ip6t_getinfo {
225/* The argument to IP6T_SO_SET_REPLACE. */ 219/* The argument to IP6T_SO_SET_REPLACE. */
226struct ip6t_replace { 220struct ip6t_replace {
227 /* Which table. */ 221 /* Which table. */
228 char name[IP6T_TABLE_MAXNAMELEN]; 222 char name[XT_TABLE_MAXNAMELEN];
229 223
230 /* Which hook entry points are valid: bitmask. You can't 224 /* Which hook entry points are valid: bitmask. You can't
231 change this. */ 225 change this. */
@@ -253,13 +247,10 @@ struct ip6t_replace {
253 struct ip6t_entry entries[0]; 247 struct ip6t_entry entries[0];
254}; 248};
255 249
256/* The argument to IP6T_SO_ADD_COUNTERS. */
257#define ip6t_counters_info xt_counters_info
258
259/* The argument to IP6T_SO_GET_ENTRIES. */ 250/* The argument to IP6T_SO_GET_ENTRIES. */
260struct ip6t_get_entries { 251struct ip6t_get_entries {
261 /* Which table: user fills this in. */ 252 /* Which table: user fills this in. */
262 char name[IP6T_TABLE_MAXNAMELEN]; 253 char name[XT_TABLE_MAXNAMELEN];
263 254
264 /* User fills this in: total entry size. */ 255 /* User fills this in: total entry size. */
265 unsigned int size; 256 unsigned int size;
@@ -268,28 +259,13 @@ struct ip6t_get_entries {
268 struct ip6t_entry entrytable[0]; 259 struct ip6t_entry entrytable[0];
269}; 260};
270 261
271/* Standard return verdict, or do jump. */
272#define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
273/* Error verdict. */
274#define IP6T_ERROR_TARGET XT_ERROR_TARGET
275
276/* Helper functions */ 262/* Helper functions */
277static __inline__ struct ip6t_entry_target * 263static __inline__ struct xt_entry_target *
278ip6t_get_target(struct ip6t_entry *e) 264ip6t_get_target(struct ip6t_entry *e)
279{ 265{
280 return (void *)e + e->target_offset; 266 return (void *)e + e->target_offset;
281} 267}
282 268
283#ifndef __KERNEL__
284/* fn returns 0 to continue iteration */
285#define IP6T_MATCH_ITERATE(e, fn, args...) \
286 XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args)
287
288/* fn returns 0 to continue iteration */
289#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
290 XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args)
291#endif
292
293/* 269/*
294 * Main firewall chains definitions and global var's definitions. 270 * Main firewall chains definitions and global var's definitions.
295 */ 271 */
@@ -316,8 +292,6 @@ extern int ip6t_ext_hdr(u8 nexthdr);
316extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, 292extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
317 int target, unsigned short *fragoff); 293 int target, unsigned short *fragoff);
318 294
319#define IP6T_ALIGN(s) XT_ALIGN(s)
320
321#ifdef CONFIG_COMPAT 295#ifdef CONFIG_COMPAT
322#include <net/compat.h> 296#include <net/compat.h>
323 297
@@ -331,14 +305,12 @@ struct compat_ip6t_entry {
331 unsigned char elems[0]; 305 unsigned char elems[0];
332}; 306};
333 307
334static inline struct ip6t_entry_target * 308static inline struct xt_entry_target *
335compat_ip6t_get_target(struct compat_ip6t_entry *e) 309compat_ip6t_get_target(struct compat_ip6t_entry *e)
336{ 310{
337 return (void *)e + e->target_offset; 311 return (void *)e + e->target_offset;
338} 312}
339 313
340#define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s)
341
342#endif /* CONFIG_COMPAT */ 314#endif /* CONFIG_COMPAT */
343#endif /*__KERNEL__*/ 315#endif /*__KERNEL__*/
344#endif /* _IP6_TABLES_H */ 316#endif /* _IP6_TABLES_H */
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 50d8009be86..79358bb712c 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -14,7 +14,6 @@
14 14
15struct netpoll { 15struct netpoll {
16 struct net_device *dev; 16 struct net_device *dev;
17 struct net_device *real_dev;
18 char dev_name[IFNAMSIZ]; 17 char dev_name[IFNAMSIZ];
19 const char *name; 18 const char *name;
20 void (*rx_hook)(struct netpoll *, int, char *, int); 19 void (*rx_hook)(struct netpoll *, int, char *, int);
@@ -53,7 +52,13 @@ void netpoll_set_trap(int trap);
53void __netpoll_cleanup(struct netpoll *np); 52void __netpoll_cleanup(struct netpoll *np);
54void netpoll_cleanup(struct netpoll *np); 53void netpoll_cleanup(struct netpoll *np);
55int __netpoll_rx(struct sk_buff *skb); 54int __netpoll_rx(struct sk_buff *skb);
56void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); 55void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
56 struct net_device *dev);
57static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
58{
59 netpoll_send_skb_on_dev(np, skb, np->dev);
60}
61
57 62
58 63
59#ifdef CONFIG_NETPOLL 64#ifdef CONFIG_NETPOLL
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 07e40c62597..4925b22219d 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -17,7 +17,9 @@
17 17
18#define NFS4_BITMAP_SIZE 2 18#define NFS4_BITMAP_SIZE 2
19#define NFS4_VERIFIER_SIZE 8 19#define NFS4_VERIFIER_SIZE 8
20#define NFS4_STATEID_SIZE 16 20#define NFS4_STATEID_SEQID_SIZE 4
21#define NFS4_STATEID_OTHER_SIZE 12
22#define NFS4_STATEID_SIZE (NFS4_STATEID_SEQID_SIZE + NFS4_STATEID_OTHER_SIZE)
21#define NFS4_FHSIZE 128 23#define NFS4_FHSIZE 128
22#define NFS4_MAXPATHLEN PATH_MAX 24#define NFS4_MAXPATHLEN PATH_MAX
23#define NFS4_MAXNAMLEN NAME_MAX 25#define NFS4_MAXNAMLEN NAME_MAX
@@ -61,6 +63,9 @@
61#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000 63#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000
62#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000 64#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000
63 65
66#define NFS4_CDFC4_FORE 0x1
67#define NFS4_CDFC4_BACK 0x2
68
64#define NFS4_SET_TO_SERVER_TIME 0 69#define NFS4_SET_TO_SERVER_TIME 0
65#define NFS4_SET_TO_CLIENT_TIME 1 70#define NFS4_SET_TO_CLIENT_TIME 1
66 71
@@ -167,7 +172,16 @@ struct nfs4_acl {
167}; 172};
168 173
169typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; 174typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
170typedef struct { char data[NFS4_STATEID_SIZE]; } nfs4_stateid; 175
176struct nfs41_stateid {
177 __be32 seqid;
178 char other[NFS4_STATEID_OTHER_SIZE];
179} __attribute__ ((packed));
180
181typedef union {
182 char data[NFS4_STATEID_SIZE];
183 struct nfs41_stateid stateid;
184} nfs4_stateid;
171 185
172enum nfs_opnum4 { 186enum nfs_opnum4 {
173 OP_ACCESS = 3, 187 OP_ACCESS = 3,
@@ -471,6 +485,8 @@ enum lock_type4 {
471#define FATTR4_WORD1_TIME_MODIFY (1UL << 21) 485#define FATTR4_WORD1_TIME_MODIFY (1UL << 21)
472#define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22) 486#define FATTR4_WORD1_TIME_MODIFY_SET (1UL << 22)
473#define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23) 487#define FATTR4_WORD1_MOUNTED_ON_FILEID (1UL << 23)
488#define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30)
489#define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1)
474 490
475#define NFSPROC4_NULL 0 491#define NFSPROC4_NULL 0
476#define NFSPROC4_COMPOUND 1 492#define NFSPROC4_COMPOUND 1
@@ -532,6 +548,8 @@ enum {
532 NFSPROC4_CLNT_SEQUENCE, 548 NFSPROC4_CLNT_SEQUENCE,
533 NFSPROC4_CLNT_GET_LEASE_TIME, 549 NFSPROC4_CLNT_GET_LEASE_TIME,
534 NFSPROC4_CLNT_RECLAIM_COMPLETE, 550 NFSPROC4_CLNT_RECLAIM_COMPLETE,
551 NFSPROC4_CLNT_LAYOUTGET,
552 NFSPROC4_CLNT_GETDEVICEINFO,
535}; 553};
536 554
537/* nfs41 types */ 555/* nfs41 types */
@@ -550,6 +568,49 @@ enum state_protect_how4 {
550 SP4_SSV = 2 568 SP4_SSV = 2
551}; 569};
552 570
571enum pnfs_layouttype {
572 LAYOUT_NFSV4_1_FILES = 1,
573 LAYOUT_OSD2_OBJECTS = 2,
574 LAYOUT_BLOCK_VOLUME = 3,
575};
576
577/* used for both layout return and recall */
578enum pnfs_layoutreturn_type {
579 RETURN_FILE = 1,
580 RETURN_FSID = 2,
581 RETURN_ALL = 3
582};
583
584enum pnfs_iomode {
585 IOMODE_READ = 1,
586 IOMODE_RW = 2,
587 IOMODE_ANY = 3,
588};
589
590enum pnfs_notify_deviceid_type4 {
591 NOTIFY_DEVICEID4_CHANGE = 1 << 1,
592 NOTIFY_DEVICEID4_DELETE = 1 << 2,
593};
594
595#define NFL4_UFLG_MASK 0x0000003F
596#define NFL4_UFLG_DENSE 0x00000001
597#define NFL4_UFLG_COMMIT_THRU_MDS 0x00000002
598#define NFL4_UFLG_STRIPE_UNIT_SIZE_MASK 0xFFFFFFC0
599
600/* Encoded in the loh_body field of type layouthint4 */
601enum filelayout_hint_care4 {
602 NFLH4_CARE_DENSE = NFL4_UFLG_DENSE,
603 NFLH4_CARE_COMMIT_THRU_MDS = NFL4_UFLG_COMMIT_THRU_MDS,
604 NFLH4_CARE_STRIPE_UNIT_SIZE = 0x00000040,
605 NFLH4_CARE_STRIPE_COUNT = 0x00000080
606};
607
608#define NFS4_DEVICEID4_SIZE 16
609
610struct nfs4_deviceid {
611 char data[NFS4_DEVICEID4_SIZE];
612};
613
553#endif 614#endif
554#endif 615#endif
555 616
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index d0edf7d823a..bba26684acd 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -188,6 +188,9 @@ struct nfs_inode {
188 struct nfs_delegation __rcu *delegation; 188 struct nfs_delegation __rcu *delegation;
189 fmode_t delegation_state; 189 fmode_t delegation_state;
190 struct rw_semaphore rwsem; 190 struct rw_semaphore rwsem;
191
192 /* pNFS layout information */
193 struct pnfs_layout_hdr *layout;
191#endif /* CONFIG_NFS_V4*/ 194#endif /* CONFIG_NFS_V4*/
192#ifdef CONFIG_NFS_FSCACHE 195#ifdef CONFIG_NFS_FSCACHE
193 struct fscache_cookie *fscache; 196 struct fscache_cookie *fscache;
@@ -360,10 +363,13 @@ extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
360extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 363extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
361extern void put_nfs_open_context(struct nfs_open_context *ctx); 364extern void put_nfs_open_context(struct nfs_open_context *ctx);
362extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); 365extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode);
366extern struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred, fmode_t f_mode);
367extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
363extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); 368extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx);
364extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); 369extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
365extern u64 nfs_compat_user_ino64(u64 fileid); 370extern u64 nfs_compat_user_ino64(u64 fileid);
366extern void nfs_fattr_init(struct nfs_fattr *fattr); 371extern void nfs_fattr_init(struct nfs_fattr *fattr);
372extern unsigned long nfs_inc_attr_generation_counter(void);
367 373
368extern struct nfs_fattr *nfs_alloc_fattr(void); 374extern struct nfs_fattr *nfs_alloc_fattr(void);
369 375
@@ -379,9 +385,12 @@ static inline void nfs_free_fhandle(const struct nfs_fh *fh)
379 kfree(fh); 385 kfree(fh);
380} 386}
381 387
388/*
389 * linux/fs/nfs/nfsroot.c
390 */
391extern int nfs_root_data(char **root_device, char **root_data); /*__init*/
382/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 392/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
383extern __be32 root_nfs_parse_addr(char *name); /*__init*/ 393extern __be32 root_nfs_parse_addr(char *name); /*__init*/
384extern unsigned long nfs_inc_attr_generation_counter(void);
385 394
386/* 395/*
387 * linux/fs/nfs/file.c 396 * linux/fs/nfs/file.c
@@ -479,10 +488,10 @@ extern void nfs_release_automount_timer(void);
479/* 488/*
480 * linux/fs/nfs/unlink.c 489 * linux/fs/nfs/unlink.c
481 */ 490 */
482extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry);
483extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); 491extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
484extern void nfs_block_sillyrename(struct dentry *dentry); 492extern void nfs_block_sillyrename(struct dentry *dentry);
485extern void nfs_unblock_sillyrename(struct dentry *dentry); 493extern void nfs_unblock_sillyrename(struct dentry *dentry);
494extern int nfs_sillyrename(struct inode *dir, struct dentry *dentry);
486 495
487/* 496/*
488 * linux/fs/nfs/write.c 497 * linux/fs/nfs/write.c
@@ -584,10 +593,6 @@ nfs_fileid_to_ino_t(u64 fileid)
584 return ino; 593 return ino;
585} 594}
586 595
587/* NFS root */
588
589extern void * nfs_root_data(void);
590
591#define nfs_wait_event(clnt, wq, condition) \ 596#define nfs_wait_event(clnt, wq, condition) \
592({ \ 597({ \
593 int __retval = wait_event_killable(wq, condition); \ 598 int __retval = wait_event_killable(wq, condition); \
@@ -613,6 +618,8 @@ extern void * nfs_root_data(void);
613#define NFSDBG_CLIENT 0x0200 618#define NFSDBG_CLIENT 0x0200
614#define NFSDBG_MOUNT 0x0400 619#define NFSDBG_MOUNT 0x0400
615#define NFSDBG_FSCACHE 0x0800 620#define NFSDBG_FSCACHE 0x0800
621#define NFSDBG_PNFS 0x1000
622#define NFSDBG_PNFS_LD 0x2000
616#define NFSDBG_ALL 0xFFFF 623#define NFSDBG_ALL 0xFFFF
617 624
618#ifdef __KERNEL__ 625#ifdef __KERNEL__
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index c82ee7cd628..452d96436d2 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -82,6 +82,8 @@ struct nfs_client {
82 /* The flags used for obtaining the clientid during EXCHANGE_ID */ 82 /* The flags used for obtaining the clientid during EXCHANGE_ID */
83 u32 cl_exchange_flags; 83 u32 cl_exchange_flags;
84 struct nfs4_session *cl_session; /* sharred session */ 84 struct nfs4_session *cl_session; /* sharred session */
85 struct list_head cl_layouts;
86 struct pnfs_deviceid_cache *cl_devid_cache; /* pNFS deviceid cache */
85#endif /* CONFIG_NFS_V4_1 */ 87#endif /* CONFIG_NFS_V4_1 */
86 88
87#ifdef CONFIG_NFS_FSCACHE 89#ifdef CONFIG_NFS_FSCACHE
@@ -124,6 +126,7 @@ struct nfs_server {
124 126
125 struct nfs_fsid fsid; 127 struct nfs_fsid fsid;
126 __u64 maxfilesize; /* maximum file size */ 128 __u64 maxfilesize; /* maximum file size */
129 struct timespec time_delta; /* smallest time granularity */
127 unsigned long mount_time; /* when this fs was mounted */ 130 unsigned long mount_time; /* when this fs was mounted */
128 dev_t s_dev; /* superblock dev numbers */ 131 dev_t s_dev; /* superblock dev numbers */
129 132
@@ -144,6 +147,7 @@ struct nfs_server {
144 u32 acl_bitmask; /* V4 bitmask representing the ACEs 147 u32 acl_bitmask; /* V4 bitmask representing the ACEs
145 that are supported on this 148 that are supported on this
146 filesystem */ 149 filesystem */
150 struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */
147#endif 151#endif
148 void (*destroy)(struct nfs_server *); 152 void (*destroy)(struct nfs_server *);
149 153
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
index 91a1c24e0cb..e8352dc5afb 100644
--- a/include/linux/nfs_idmap.h
+++ b/include/linux/nfs_idmap.h
@@ -66,13 +66,40 @@ struct idmap_msg {
66/* Forward declaration to make this header independent of others */ 66/* Forward declaration to make this header independent of others */
67struct nfs_client; 67struct nfs_client;
68 68
69#ifdef CONFIG_NFS_USE_NEW_IDMAPPER
70
71int nfs_idmap_init(void);
72void nfs_idmap_quit(void);
73
74static inline int nfs_idmap_new(struct nfs_client *clp)
75{
76 return 0;
77}
78
79static inline void nfs_idmap_delete(struct nfs_client *clp)
80{
81}
82
83#else /* CONFIG_NFS_USE_NEW_IDMAPPER not set */
84
85static inline int nfs_idmap_init(void)
86{
87 return 0;
88}
89
90static inline void nfs_idmap_quit(void)
91{
92}
93
69int nfs_idmap_new(struct nfs_client *); 94int nfs_idmap_new(struct nfs_client *);
70void nfs_idmap_delete(struct nfs_client *); 95void nfs_idmap_delete(struct nfs_client *);
71 96
97#endif /* CONFIG_NFS_USE_NEW_IDMAPPER */
98
72int nfs_map_name_to_uid(struct nfs_client *, const char *, size_t, __u32 *); 99int nfs_map_name_to_uid(struct nfs_client *, const char *, size_t, __u32 *);
73int nfs_map_group_to_gid(struct nfs_client *, const char *, size_t, __u32 *); 100int nfs_map_group_to_gid(struct nfs_client *, const char *, size_t, __u32 *);
74int nfs_map_uid_to_name(struct nfs_client *, __u32, char *); 101int nfs_map_uid_to_name(struct nfs_client *, __u32, char *, size_t);
75int nfs_map_gid_to_group(struct nfs_client *, __u32, char *); 102int nfs_map_gid_to_group(struct nfs_client *, __u32, char *, size_t);
76 103
77extern unsigned int nfs_idmap_cache_timeout; 104extern unsigned int nfs_idmap_cache_timeout;
78#endif /* __KERNEL__ */ 105#endif /* __KERNEL__ */
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index 5d59ae861aa..576bddd72e0 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -71,4 +71,7 @@ struct nfs_mount_data {
71#define NFS_MOUNT_NORESVPORT 0x40000 71#define NFS_MOUNT_NORESVPORT 0x40000
72#define NFS_MOUNT_LEGACY_INTERFACE 0x80000 72#define NFS_MOUNT_LEGACY_INTERFACE 0x80000
73 73
74#define NFS_MOUNT_LOCAL_FLOCK 0x100000
75#define NFS_MOUNT_LOCAL_FCNTL 0x200000
76
74#endif 77#endif
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index fc461926c41..ba6cc8f223c 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -112,7 +112,9 @@ struct nfs_fsinfo {
112 __u32 wtmult; /* writes should be multiple of this */ 112 __u32 wtmult; /* writes should be multiple of this */
113 __u32 dtpref; /* pref. readdir transfer size */ 113 __u32 dtpref; /* pref. readdir transfer size */
114 __u64 maxfilesize; 114 __u64 maxfilesize;
115 struct timespec time_delta; /* server time granularity */
115 __u32 lease_time; /* in seconds */ 116 __u32 lease_time; /* in seconds */
117 __u32 layouttype; /* supported pnfs layout driver */
116}; 118};
117 119
118struct nfs_fsstat { 120struct nfs_fsstat {
@@ -170,7 +172,7 @@ struct nfs4_sequence_args {
170 172
171struct nfs4_sequence_res { 173struct nfs4_sequence_res {
172 struct nfs4_session *sr_session; 174 struct nfs4_session *sr_session;
173 u8 sr_slotid; /* slot used to send request */ 175 struct nfs4_slot *sr_slot; /* slot used to send request */
174 int sr_status; /* sequence operation status */ 176 int sr_status; /* sequence operation status */
175 unsigned long sr_renewal_time; 177 unsigned long sr_renewal_time;
176 u32 sr_status_flags; 178 u32 sr_status_flags;
@@ -185,6 +187,55 @@ struct nfs4_get_lease_time_res {
185 struct nfs4_sequence_res lr_seq_res; 187 struct nfs4_sequence_res lr_seq_res;
186}; 188};
187 189
190#define PNFS_LAYOUT_MAXSIZE 4096
191
192struct nfs4_layoutdriver_data {
193 __u32 len;
194 void *buf;
195};
196
197struct pnfs_layout_range {
198 u32 iomode;
199 u64 offset;
200 u64 length;
201};
202
203struct nfs4_layoutget_args {
204 __u32 type;
205 struct pnfs_layout_range range;
206 __u64 minlength;
207 __u32 maxcount;
208 struct inode *inode;
209 struct nfs_open_context *ctx;
210 struct nfs4_sequence_args seq_args;
211};
212
213struct nfs4_layoutget_res {
214 __u32 return_on_close;
215 struct pnfs_layout_range range;
216 __u32 type;
217 nfs4_stateid stateid;
218 struct nfs4_layoutdriver_data layout;
219 struct nfs4_sequence_res seq_res;
220};
221
222struct nfs4_layoutget {
223 struct nfs4_layoutget_args args;
224 struct nfs4_layoutget_res res;
225 struct pnfs_layout_segment **lsegpp;
226 int status;
227};
228
229struct nfs4_getdeviceinfo_args {
230 struct pnfs_device *pdev;
231 struct nfs4_sequence_args seq_args;
232};
233
234struct nfs4_getdeviceinfo_res {
235 struct pnfs_device *pdev;
236 struct nfs4_sequence_res seq_res;
237};
238
188/* 239/*
189 * Arguments to the open call. 240 * Arguments to the open call.
190 */ 241 */
@@ -400,6 +451,27 @@ struct nfs_removeres {
400}; 451};
401 452
402/* 453/*
454 * Common arguments to the rename call
455 */
456struct nfs_renameargs {
457 const struct nfs_fh *old_dir;
458 const struct nfs_fh *new_dir;
459 const struct qstr *old_name;
460 const struct qstr *new_name;
461 const u32 *bitmask;
462 struct nfs4_sequence_args seq_args;
463};
464
465struct nfs_renameres {
466 const struct nfs_server *server;
467 struct nfs4_change_info old_cinfo;
468 struct nfs_fattr *old_fattr;
469 struct nfs4_change_info new_cinfo;
470 struct nfs_fattr *new_fattr;
471 struct nfs4_sequence_res seq_res;
472};
473
474/*
403 * Argument struct for decode_entry function 475 * Argument struct for decode_entry function
404 */ 476 */
405struct nfs_entry { 477struct nfs_entry {
@@ -434,15 +506,6 @@ struct nfs_createargs {
434 struct iattr * sattr; 506 struct iattr * sattr;
435}; 507};
436 508
437struct nfs_renameargs {
438 struct nfs_fh * fromfh;
439 const char * fromname;
440 unsigned int fromlen;
441 struct nfs_fh * tofh;
442 const char * toname;
443 unsigned int tolen;
444};
445
446struct nfs_setattrargs { 509struct nfs_setattrargs {
447 struct nfs_fh * fh; 510 struct nfs_fh * fh;
448 nfs4_stateid stateid; 511 nfs4_stateid stateid;
@@ -586,15 +649,6 @@ struct nfs3_mknodargs {
586 dev_t rdev; 649 dev_t rdev;
587}; 650};
588 651
589struct nfs3_renameargs {
590 struct nfs_fh * fromfh;
591 const char * fromname;
592 unsigned int fromlen;
593 struct nfs_fh * tofh;
594 const char * toname;
595 unsigned int tolen;
596};
597
598struct nfs3_linkargs { 652struct nfs3_linkargs {
599 struct nfs_fh * fromfh; 653 struct nfs_fh * fromfh;
600 struct nfs_fh * tofh; 654 struct nfs_fh * tofh;
@@ -629,11 +683,6 @@ struct nfs3_readlinkargs {
629 struct page ** pages; 683 struct page ** pages;
630}; 684};
631 685
632struct nfs3_renameres {
633 struct nfs_fattr * fromattr;
634 struct nfs_fattr * toattr;
635};
636
637struct nfs3_linkres { 686struct nfs3_linkres {
638 struct nfs_fattr * dir_attr; 687 struct nfs_fattr * dir_attr;
639 struct nfs_fattr * fattr; 688 struct nfs_fattr * fattr;
@@ -780,6 +829,7 @@ struct nfs4_readdir_arg {
780 struct page ** pages; /* zero-copy data */ 829 struct page ** pages; /* zero-copy data */
781 unsigned int pgbase; /* zero-copy data */ 830 unsigned int pgbase; /* zero-copy data */
782 const u32 * bitmask; 831 const u32 * bitmask;
832 int plus;
783 struct nfs4_sequence_args seq_args; 833 struct nfs4_sequence_args seq_args;
784}; 834};
785 835
@@ -801,24 +851,6 @@ struct nfs4_readlink_res {
801 struct nfs4_sequence_res seq_res; 851 struct nfs4_sequence_res seq_res;
802}; 852};
803 853
804struct nfs4_rename_arg {
805 const struct nfs_fh * old_dir;
806 const struct nfs_fh * new_dir;
807 const struct qstr * old_name;
808 const struct qstr * new_name;
809 const u32 * bitmask;
810 struct nfs4_sequence_args seq_args;
811};
812
813struct nfs4_rename_res {
814 const struct nfs_server * server;
815 struct nfs4_change_info old_cinfo;
816 struct nfs_fattr * old_fattr;
817 struct nfs4_change_info new_cinfo;
818 struct nfs_fattr * new_fattr;
819 struct nfs4_sequence_res seq_res;
820};
821
822#define NFS4_SETCLIENTID_NAMELEN (127) 854#define NFS4_SETCLIENTID_NAMELEN (127)
823struct nfs4_setclientid { 855struct nfs4_setclientid {
824 const nfs4_verifier * sc_verifier; 856 const nfs4_verifier * sc_verifier;
@@ -1032,19 +1064,21 @@ struct nfs_rpc_ops {
1032 int (*readlink)(struct inode *, struct page *, unsigned int, 1064 int (*readlink)(struct inode *, struct page *, unsigned int,
1033 unsigned int); 1065 unsigned int);
1034 int (*create) (struct inode *, struct dentry *, 1066 int (*create) (struct inode *, struct dentry *,
1035 struct iattr *, int, struct nameidata *); 1067 struct iattr *, int, struct nfs_open_context *);
1036 int (*remove) (struct inode *, struct qstr *); 1068 int (*remove) (struct inode *, struct qstr *);
1037 void (*unlink_setup) (struct rpc_message *, struct inode *dir); 1069 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1038 int (*unlink_done) (struct rpc_task *, struct inode *); 1070 int (*unlink_done) (struct rpc_task *, struct inode *);
1039 int (*rename) (struct inode *, struct qstr *, 1071 int (*rename) (struct inode *, struct qstr *,
1040 struct inode *, struct qstr *); 1072 struct inode *, struct qstr *);
1073 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1074 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1041 int (*link) (struct inode *, struct inode *, struct qstr *); 1075 int (*link) (struct inode *, struct inode *, struct qstr *);
1042 int (*symlink) (struct inode *, struct dentry *, struct page *, 1076 int (*symlink) (struct inode *, struct dentry *, struct page *,
1043 unsigned int, struct iattr *); 1077 unsigned int, struct iattr *);
1044 int (*mkdir) (struct inode *, struct dentry *, struct iattr *); 1078 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1045 int (*rmdir) (struct inode *, struct qstr *); 1079 int (*rmdir) (struct inode *, struct qstr *);
1046 int (*readdir) (struct dentry *, struct rpc_cred *, 1080 int (*readdir) (struct dentry *, struct rpc_cred *,
1047 u64, struct page *, unsigned int, int); 1081 u64, struct page **, unsigned int, int);
1048 int (*mknod) (struct inode *, struct dentry *, struct iattr *, 1082 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
1049 dev_t); 1083 dev_t);
1050 int (*statfs) (struct nfs_server *, struct nfs_fh *, 1084 int (*statfs) (struct nfs_server *, struct nfs_fh *,
@@ -1054,7 +1088,7 @@ struct nfs_rpc_ops {
1054 int (*pathconf) (struct nfs_server *, struct nfs_fh *, 1088 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
1055 struct nfs_pathconf *); 1089 struct nfs_pathconf *);
1056 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); 1090 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1057 __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus); 1091 __be32 *(*decode_dirent)(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int plus);
1058 void (*read_setup) (struct nfs_read_data *, struct rpc_message *); 1092 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
1059 int (*read_done) (struct rpc_task *, struct nfs_read_data *); 1093 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1060 void (*write_setup) (struct nfs_write_data *, struct rpc_message *); 1094 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
@@ -1065,6 +1099,10 @@ struct nfs_rpc_ops {
1065 int (*lock_check_bounds)(const struct file_lock *); 1099 int (*lock_check_bounds)(const struct file_lock *);
1066 void (*clear_acl_cache)(struct inode *); 1100 void (*clear_acl_cache)(struct inode *);
1067 void (*close_context)(struct nfs_open_context *ctx, int); 1101 void (*close_context)(struct nfs_open_context *ctx, int);
1102 struct inode * (*open_context) (struct inode *dir,
1103 struct nfs_open_context *ctx,
1104 int open_flags,
1105 struct iattr *iattr);
1068}; 1106};
1069 1107
1070/* 1108/*
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h
index f5487b6f91e..227e49dd572 100644
--- a/include/linux/nilfs2_fs.h
+++ b/include/linux/nilfs2_fs.h
@@ -4,16 +4,16 @@
4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation. 4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU Lesser General Public License as published
8 * the Free Software Foundation; either version 2 of the License, or 8 * by the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version. 9 * (at your option) any later version.
10 * 10 *
11 * This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 * 19 *
@@ -147,7 +147,6 @@ struct nilfs_super_root {
147#define NILFS_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */ 147#define NILFS_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */
148#define NILFS_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */ 148#define NILFS_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */
149#define NILFS_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */ 149#define NILFS_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */
150#define NILFS_MOUNT_SNAPSHOT 0x0080 /* Snapshot flag */
151#define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ 150#define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */
152#define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order 151#define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order
153 semantics also for data */ 152 semantics also for data */
@@ -229,6 +228,7 @@ struct nilfs_super_block {
229 */ 228 */
230#define NILFS_CURRENT_REV 2 /* current major revision */ 229#define NILFS_CURRENT_REV 2 /* current major revision */
231#define NILFS_MINOR_REV 0 /* minor revision */ 230#define NILFS_MINOR_REV 0 /* minor revision */
231#define NILFS_MIN_SUPP_REV 2 /* minimum supported revision */
232 232
233/* 233/*
234 * Feature set definitions 234 * Feature set definitions
@@ -270,6 +270,14 @@ struct nilfs_super_block {
270 segments */ 270 segments */
271 271
272/* 272/*
273 * We call DAT, cpfile, and sufile root metadata files. Inodes of
274 * these files are written in super root block instead of ifile, and
275 * garbage collector doesn't keep any past versions of these files.
276 */
277#define NILFS_ROOT_METADATA_FILE(ino) \
278 ((ino) >= NILFS_DAT_INO && (ino) <= NILFS_SUFILE_INO)
279
280/*
273 * bytes offset of secondary super block 281 * bytes offset of secondary super block
274 */ 282 */
275#define NILFS_SB2_OFFSET_BYTES(devsize) ((((devsize) >> 12) - 1) << 12) 283#define NILFS_SB2_OFFSET_BYTES(devsize) ((((devsize) >> 12) - 1) << 12)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 2c870168733..0edb2566c14 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -40,6 +40,43 @@
40 */ 40 */
41 41
42/** 42/**
43 * DOC: Frame transmission/registration support
44 *
45 * Frame transmission and registration support exists to allow userspace
46 * management entities such as wpa_supplicant react to management frames
47 * that are not being handled by the kernel. This includes, for example,
48 * certain classes of action frames that cannot be handled in the kernel
49 * for various reasons.
50 *
51 * Frame registration is done on a per-interface basis and registrations
52 * cannot be removed other than by closing the socket. It is possible to
53 * specify a registration filter to register, for example, only for a
54 * certain type of action frame. In particular with action frames, those
55 * that userspace registers for will not be returned as unhandled by the
56 * driver, so that the registered application has to take responsibility
57 * for doing that.
58 *
59 * The type of frame that can be registered for is also dependent on the
60 * driver and interface type. The frame types are advertised in wiphy
61 * attributes so applications know what to expect.
62 *
63 * NOTE: When an interface changes type while registrations are active,
64 * these registrations are ignored until the interface type is
65 * changed again. This means that changing the interface type can
66 * lead to a situation that couldn't otherwise be produced, but
67 * any such registrations will be dormant in the sense that they
68 * will not be serviced, i.e. they will not receive any frames.
69 *
70 * Frame transmission allows userspace to send for example the required
71 * responses to action frames. It is subject to some sanity checking,
72 * but many frames can be transmitted. When a frame was transmitted, its
73 * status is indicated to the sending socket.
74 *
75 * For more technical details, see the corresponding command descriptions
76 * below.
77 */
78
79/**
43 * enum nl80211_commands - supported nl80211 commands 80 * enum nl80211_commands - supported nl80211 commands
44 * 81 *
45 * @NL80211_CMD_UNSPEC: unspecified command to catch errors 82 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -258,7 +295,9 @@
258 * auth and assoc steps. For this, you need to specify the SSID in a 295 * auth and assoc steps. For this, you need to specify the SSID in a
259 * %NL80211_ATTR_SSID attribute, and can optionally specify the association 296 * %NL80211_ATTR_SSID attribute, and can optionally specify the association
260 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC, 297 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,
261 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT. 298 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
299 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
300 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
262 * It is also sent as an event, with the BSSID and response IEs when the 301 * It is also sent as an event, with the BSSID and response IEs when the
263 * connection is established or failed to be established. This can be 302 * connection is established or failed to be established. This can be
264 * determined by the STATUS_CODE attribute. 303 * determined by the STATUS_CODE attribute.
@@ -276,8 +315,8 @@
276 * channel for the specified amount of time. This can be used to do 315 * channel for the specified amount of time. This can be used to do
277 * off-channel operations like transmit a Public Action frame and wait for 316 * off-channel operations like transmit a Public Action frame and wait for
278 * a response while being associated to an AP on another channel. 317 * a response while being associated to an AP on another channel.
279 * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which 318 * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
280 * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the 319 * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
281 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be 320 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
282 * optionally used to specify additional channel parameters. 321 * optionally used to specify additional channel parameters.
283 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds 322 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
@@ -301,16 +340,20 @@
301 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface 340 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
302 * and @NL80211_ATTR_TX_RATES the set of allowed rates. 341 * and @NL80211_ATTR_TX_RATES the set of allowed rates.
303 * 342 *
304 * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames 343 * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
305 * (via @NL80211_CMD_ACTION) for processing in userspace. This command 344 * (via @NL80211_CMD_FRAME) for processing in userspace. This command
306 * requires an interface index and a match attribute containing the first 345 * requires an interface index, a frame type attribute (optional for
307 * few bytes of the frame that should match, e.g. a single byte for only 346 * backward compatibility reasons, if not given assumes action frames)
308 * a category match or four bytes for vendor frames including the OUI. 347 * and a match attribute containing the first few bytes of the frame
309 * The registration cannot be dropped, but is removed automatically 348 * that should match, e.g. a single byte for only a category match or
310 * when the netlink socket is closed. Multiple registrations can be made. 349 * four bytes for vendor frames including the OUI. The registration
311 * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This 350 * cannot be dropped, but is removed automatically when the netlink
312 * command is used both as a request to transmit an Action frame and as an 351 * socket is closed. Multiple registrations can be made.
313 * event indicating reception of an Action frame that was not processed in 352 * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
353 * backward compatibility
354 * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
355 * command is used both as a request to transmit a management frame and
356 * as an event indicating reception of a frame that was not processed in
314 * kernel code, but is for us (i.e., which may need to be processed in a 357 * kernel code, but is for us (i.e., which may need to be processed in a
315 * user space application). %NL80211_ATTR_FRAME is used to specify the 358 * user space application). %NL80211_ATTR_FRAME is used to specify the
316 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and 359 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
@@ -320,11 +363,14 @@
320 * operational channel). When called, this operation returns a cookie 363 * operational channel). When called, this operation returns a cookie
321 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event 364 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event
322 * pertaining to the TX request. 365 * pertaining to the TX request.
323 * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame 366 * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
324 * transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies 367 * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
368 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
325 * the TX command and %NL80211_ATTR_FRAME includes the contents of the 369 * the TX command and %NL80211_ATTR_FRAME includes the contents of the
326 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged 370 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
327 * the frame. 371 * the frame.
372 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
373 * backward compatibility.
328 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command 374 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
329 * is used to configure connection quality monitoring notification trigger 375 * is used to configure connection quality monitoring notification trigger
330 * levels. 376 * levels.
@@ -341,6 +387,8 @@
341 * of any other interfaces, and other interfaces will again take 387 * of any other interfaces, and other interfaces will again take
342 * precedence when they are used. 388 * precedence when they are used.
343 * 389 *
390 * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
391 *
344 * @NL80211_CMD_MAX: highest used command number 392 * @NL80211_CMD_MAX: highest used command number
345 * @__NL80211_CMD_AFTER_LAST: internal use 393 * @__NL80211_CMD_AFTER_LAST: internal use
346 */ 394 */
@@ -429,9 +477,12 @@ enum nl80211_commands {
429 477
430 NL80211_CMD_SET_TX_BITRATE_MASK, 478 NL80211_CMD_SET_TX_BITRATE_MASK,
431 479
432 NL80211_CMD_REGISTER_ACTION, 480 NL80211_CMD_REGISTER_FRAME,
433 NL80211_CMD_ACTION, 481 NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
434 NL80211_CMD_ACTION_TX_STATUS, 482 NL80211_CMD_FRAME,
483 NL80211_CMD_ACTION = NL80211_CMD_FRAME,
484 NL80211_CMD_FRAME_TX_STATUS,
485 NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
435 486
436 NL80211_CMD_SET_POWER_SAVE, 487 NL80211_CMD_SET_POWER_SAVE,
437 NL80211_CMD_GET_POWER_SAVE, 488 NL80211_CMD_GET_POWER_SAVE,
@@ -440,6 +491,7 @@ enum nl80211_commands {
440 NL80211_CMD_NOTIFY_CQM, 491 NL80211_CMD_NOTIFY_CQM,
441 492
442 NL80211_CMD_SET_CHANNEL, 493 NL80211_CMD_SET_CHANNEL,
494 NL80211_CMD_SET_WDS_PEER,
443 495
444 /* add new commands above here */ 496 /* add new commands above here */
445 497
@@ -639,6 +691,15 @@ enum nl80211_commands {
639 * request, the driver will assume that the port is unauthorized until 691 * request, the driver will assume that the port is unauthorized until
640 * authorized by user space. Otherwise, port is marked authorized by 692 * authorized by user space. Otherwise, port is marked authorized by
641 * default in station mode. 693 * default in station mode.
694 * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
695 * ethertype that will be used for key negotiation. It can be
696 * specified with the associate and connect commands. If it is not
697 * specified, the value defaults to 0x888E (PAE, 802.1X). This
698 * attribute is also used as a flag in the wiphy information to
699 * indicate that protocols other than PAE are supported.
700 * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
701 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
702 * ethertype frames used for key negotiation must not be encrypted.
642 * 703 *
643 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. 704 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
644 * We recommend using nested, driver-specific attributes within this. 705 * We recommend using nested, driver-specific attributes within this.
@@ -708,7 +769,16 @@ enum nl80211_commands {
708 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK. 769 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
709 * 770 *
710 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain 771 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
711 * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION. 772 * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
773 * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
774 * @NL80211_CMD_REGISTER_FRAME command.
775 * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
776 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
777 * information about which frame types can be transmitted with
778 * %NL80211_CMD_FRAME.
779 * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
780 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
781 * information about which frame types can be registered for RX.
712 * 782 *
713 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was 783 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
714 * acknowledged by the recipient. 784 * acknowledged by the recipient.
@@ -731,6 +801,9 @@ enum nl80211_commands {
731 * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING 801 * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
732 * for non-automatic settings. 802 * for non-automatic settings.
733 * 803 *
804 * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly
805 * means support for per-station GTKs.
806 *
734 * @NL80211_ATTR_MAX: highest attribute number currently defined 807 * @NL80211_ATTR_MAX: highest attribute number currently defined
735 * @__NL80211_ATTR_AFTER_LAST: internal use 808 * @__NL80211_ATTR_AFTER_LAST: internal use
736 */ 809 */
@@ -891,6 +964,15 @@ enum nl80211_attrs {
891 NL80211_ATTR_WIPHY_TX_POWER_SETTING, 964 NL80211_ATTR_WIPHY_TX_POWER_SETTING,
892 NL80211_ATTR_WIPHY_TX_POWER_LEVEL, 965 NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
893 966
967 NL80211_ATTR_TX_FRAME_TYPES,
968 NL80211_ATTR_RX_FRAME_TYPES,
969 NL80211_ATTR_FRAME_TYPE,
970
971 NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
972 NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
973
974 NL80211_ATTR_SUPPORT_IBSS_RSN,
975
894 /* add attributes here, update the policy in nl80211.c */ 976 /* add attributes here, update the policy in nl80211.c */
895 977
896 __NL80211_ATTR_AFTER_LAST, 978 __NL80211_ATTR_AFTER_LAST,
@@ -946,8 +1028,10 @@ enum nl80211_attrs {
946 * @NL80211_IFTYPE_WDS: wireless distribution interface 1028 * @NL80211_IFTYPE_WDS: wireless distribution interface
947 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames 1029 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
948 * @NL80211_IFTYPE_MESH_POINT: mesh point 1030 * @NL80211_IFTYPE_MESH_POINT: mesh point
1031 * @NL80211_IFTYPE_P2P_CLIENT: P2P client
1032 * @NL80211_IFTYPE_P2P_GO: P2P group owner
949 * @NL80211_IFTYPE_MAX: highest interface type number currently defined 1033 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
950 * @__NL80211_IFTYPE_AFTER_LAST: internal use 1034 * @NUM_NL80211_IFTYPES: number of defined interface types
951 * 1035 *
952 * These values are used with the %NL80211_ATTR_IFTYPE 1036 * These values are used with the %NL80211_ATTR_IFTYPE
953 * to set the type of an interface. 1037 * to set the type of an interface.
@@ -962,10 +1046,12 @@ enum nl80211_iftype {
962 NL80211_IFTYPE_WDS, 1046 NL80211_IFTYPE_WDS,
963 NL80211_IFTYPE_MONITOR, 1047 NL80211_IFTYPE_MONITOR,
964 NL80211_IFTYPE_MESH_POINT, 1048 NL80211_IFTYPE_MESH_POINT,
1049 NL80211_IFTYPE_P2P_CLIENT,
1050 NL80211_IFTYPE_P2P_GO,
965 1051
966 /* keep last */ 1052 /* keep last */
967 __NL80211_IFTYPE_AFTER_LAST, 1053 NUM_NL80211_IFTYPES,
968 NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1 1054 NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
969}; 1055};
970 1056
971/** 1057/**
@@ -974,11 +1060,14 @@ enum nl80211_iftype {
974 * Station flags. When a station is added to an AP interface, it is 1060 * Station flags. When a station is added to an AP interface, it is
975 * assumed to be already associated (and hence authenticated.) 1061 * assumed to be already associated (and hence authenticated.)
976 * 1062 *
1063 * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved
977 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X) 1064 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
978 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames 1065 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
979 * with short barker preamble 1066 * with short barker preamble
980 * @NL80211_STA_FLAG_WME: station is WME/QoS capable 1067 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
981 * @NL80211_STA_FLAG_MFP: station uses management frame protection 1068 * @NL80211_STA_FLAG_MFP: station uses management frame protection
1069 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
1070 * @__NL80211_STA_FLAG_AFTER_LAST: internal use
982 */ 1071 */
983enum nl80211_sta_flags { 1072enum nl80211_sta_flags {
984 __NL80211_STA_FLAG_INVALID, 1073 __NL80211_STA_FLAG_INVALID,
@@ -1048,6 +1137,8 @@ enum nl80211_rate_info {
1048 * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) 1137 * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station)
1049 * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this 1138 * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this
1050 * station) 1139 * station)
1140 * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
1141 * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
1051 */ 1142 */
1052enum nl80211_sta_info { 1143enum nl80211_sta_info {
1053 __NL80211_STA_INFO_INVALID, 1144 __NL80211_STA_INFO_INVALID,
@@ -1061,6 +1152,8 @@ enum nl80211_sta_info {
1061 NL80211_STA_INFO_TX_BITRATE, 1152 NL80211_STA_INFO_TX_BITRATE,
1062 NL80211_STA_INFO_RX_PACKETS, 1153 NL80211_STA_INFO_RX_PACKETS,
1063 NL80211_STA_INFO_TX_PACKETS, 1154 NL80211_STA_INFO_TX_PACKETS,
1155 NL80211_STA_INFO_TX_RETRIES,
1156 NL80211_STA_INFO_TX_FAILED,
1064 1157
1065 /* keep last */ 1158 /* keep last */
1066 __NL80211_STA_INFO_AFTER_LAST, 1159 __NL80211_STA_INFO_AFTER_LAST,
@@ -1091,14 +1184,17 @@ enum nl80211_mpath_flags {
1091 * information about a mesh path. 1184 * information about a mesh path.
1092 * 1185 *
1093 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved 1186 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
1094 * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination 1187 * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination
1095 * @NL80211_ATTR_MPATH_SN: destination sequence number 1188 * @NL80211_MPATH_INFO_SN: destination sequence number
1096 * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path 1189 * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
1097 * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now 1190 * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
1098 * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in 1191 * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
1099 * &enum nl80211_mpath_flags; 1192 * &enum nl80211_mpath_flags;
1100 * @NL80211_ATTR_MPATH_DISCOVERY_TIMEOUT: total path discovery timeout, in msec 1193 * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
1101 * @NL80211_ATTR_MPATH_DISCOVERY_RETRIES: mesh path discovery retries 1194 * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
1195 * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
1196 * currently defind
1197 * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
1102 */ 1198 */
1103enum nl80211_mpath_info { 1199enum nl80211_mpath_info {
1104 __NL80211_MPATH_INFO_INVALID, 1200 __NL80211_MPATH_INFO_INVALID,
@@ -1127,6 +1223,8 @@ enum nl80211_mpath_info {
1127 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE 1223 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
1128 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n 1224 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
1129 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n 1225 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
1226 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
1227 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
1130 */ 1228 */
1131enum nl80211_band_attr { 1229enum nl80211_band_attr {
1132 __NL80211_BAND_ATTR_INVALID, 1230 __NL80211_BAND_ATTR_INVALID,
@@ -1147,6 +1245,7 @@ enum nl80211_band_attr {
1147 1245
1148/** 1246/**
1149 * enum nl80211_frequency_attr - frequency attributes 1247 * enum nl80211_frequency_attr - frequency attributes
1248 * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
1150 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz 1249 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
1151 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current 1250 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
1152 * regulatory domain. 1251 * regulatory domain.
@@ -1158,6 +1257,9 @@ enum nl80211_band_attr {
1158 * on this channel in current regulatory domain. 1257 * on this channel in current regulatory domain.
1159 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm 1258 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
1160 * (100 * dBm). 1259 * (100 * dBm).
1260 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
1261 * currently defined
1262 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
1161 */ 1263 */
1162enum nl80211_frequency_attr { 1264enum nl80211_frequency_attr {
1163 __NL80211_FREQUENCY_ATTR_INVALID, 1265 __NL80211_FREQUENCY_ATTR_INVALID,
@@ -1177,9 +1279,13 @@ enum nl80211_frequency_attr {
1177 1279
1178/** 1280/**
1179 * enum nl80211_bitrate_attr - bitrate attributes 1281 * enum nl80211_bitrate_attr - bitrate attributes
1282 * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
1180 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps 1283 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
1181 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported 1284 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
1182 * in 2.4 GHz band. 1285 * in 2.4 GHz band.
1286 * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number
1287 * currently defined
1288 * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use
1183 */ 1289 */
1184enum nl80211_bitrate_attr { 1290enum nl80211_bitrate_attr {
1185 __NL80211_BITRATE_ATTR_INVALID, 1291 __NL80211_BITRATE_ATTR_INVALID,
@@ -1235,6 +1341,7 @@ enum nl80211_reg_type {
1235 1341
1236/** 1342/**
1237 * enum nl80211_reg_rule_attr - regulatory rule attributes 1343 * enum nl80211_reg_rule_attr - regulatory rule attributes
1344 * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
1238 * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional 1345 * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
1239 * considerations for a given frequency range. These are the 1346 * considerations for a given frequency range. These are the
1240 * &enum nl80211_reg_rule_flags. 1347 * &enum nl80211_reg_rule_flags.
@@ -1251,6 +1358,9 @@ enum nl80211_reg_type {
1251 * If you don't have one then don't send this. 1358 * If you don't have one then don't send this.
1252 * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for 1359 * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
1253 * a given frequency range. The value is in mBm (100 * dBm). 1360 * a given frequency range. The value is in mBm (100 * dBm).
1361 * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
1362 * currently defined
1363 * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
1254 */ 1364 */
1255enum nl80211_reg_rule_attr { 1365enum nl80211_reg_rule_attr {
1256 __NL80211_REG_RULE_ATTR_INVALID, 1366 __NL80211_REG_RULE_ATTR_INVALID,
@@ -1302,11 +1412,31 @@ enum nl80211_reg_rule_flags {
1302 * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved 1412 * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
1303 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel 1413 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
1304 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) 1414 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
1415 * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
1416 * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio
1417 * spent on this channel
1418 * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary
1419 * channel was sensed busy (either due to activity or energy detect)
1420 * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension
1421 * channel was sensed busy
1422 * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent
1423 * receiving data
1424 * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent
1425 * transmitting data
1426 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
1427 * currently defined
1428 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
1305 */ 1429 */
1306enum nl80211_survey_info { 1430enum nl80211_survey_info {
1307 __NL80211_SURVEY_INFO_INVALID, 1431 __NL80211_SURVEY_INFO_INVALID,
1308 NL80211_SURVEY_INFO_FREQUENCY, 1432 NL80211_SURVEY_INFO_FREQUENCY,
1309 NL80211_SURVEY_INFO_NOISE, 1433 NL80211_SURVEY_INFO_NOISE,
1434 NL80211_SURVEY_INFO_IN_USE,
1435 NL80211_SURVEY_INFO_CHANNEL_TIME,
1436 NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY,
1437 NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY,
1438 NL80211_SURVEY_INFO_CHANNEL_TIME_RX,
1439 NL80211_SURVEY_INFO_CHANNEL_TIME_TX,
1310 1440
1311 /* keep last */ 1441 /* keep last */
1312 __NL80211_SURVEY_INFO_AFTER_LAST, 1442 __NL80211_SURVEY_INFO_AFTER_LAST,
@@ -1466,6 +1596,7 @@ enum nl80211_channel_type {
1466 * enum nl80211_bss - netlink attributes for a BSS 1596 * enum nl80211_bss - netlink attributes for a BSS
1467 * 1597 *
1468 * @__NL80211_BSS_INVALID: invalid 1598 * @__NL80211_BSS_INVALID: invalid
1599 * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
1469 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32) 1600 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
1470 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64) 1601 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
1471 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) 1602 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
@@ -1509,6 +1640,12 @@ enum nl80211_bss {
1509 1640
1510/** 1641/**
1511 * enum nl80211_bss_status - BSS "status" 1642 * enum nl80211_bss_status - BSS "status"
1643 * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
1644 * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
1645 * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
1646 *
1647 * The BSS status is a BSS attribute in scan dumps, which
1648 * indicates the status the interface has wrt. this BSS.
1512 */ 1649 */
1513enum nl80211_bss_status { 1650enum nl80211_bss_status {
1514 NL80211_BSS_STATUS_AUTHENTICATED, 1651 NL80211_BSS_STATUS_AUTHENTICATED,
@@ -1546,11 +1683,14 @@ enum nl80211_auth_type {
1546 * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key 1683 * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
1547 * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key 1684 * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
1548 * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS) 1685 * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
1686 * @NUM_NL80211_KEYTYPES: number of defined key types
1549 */ 1687 */
1550enum nl80211_key_type { 1688enum nl80211_key_type {
1551 NL80211_KEYTYPE_GROUP, 1689 NL80211_KEYTYPE_GROUP,
1552 NL80211_KEYTYPE_PAIRWISE, 1690 NL80211_KEYTYPE_PAIRWISE,
1553 NL80211_KEYTYPE_PEERKEY, 1691 NL80211_KEYTYPE_PEERKEY,
1692
1693 NUM_NL80211_KEYTYPES
1554}; 1694};
1555 1695
1556/** 1696/**
@@ -1581,6 +1721,9 @@ enum nl80211_wpa_versions {
1581 * CCMP keys, each six bytes in little endian 1721 * CCMP keys, each six bytes in little endian
1582 * @NL80211_KEY_DEFAULT: flag indicating default key 1722 * @NL80211_KEY_DEFAULT: flag indicating default key
1583 * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key 1723 * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
1724 * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
1725 * specified the default depends on whether a MAC address was
1726 * given with the command using the key or not (u32)
1584 * @__NL80211_KEY_AFTER_LAST: internal 1727 * @__NL80211_KEY_AFTER_LAST: internal
1585 * @NL80211_KEY_MAX: highest key attribute 1728 * @NL80211_KEY_MAX: highest key attribute
1586 */ 1729 */
@@ -1592,6 +1735,7 @@ enum nl80211_key_attributes {
1592 NL80211_KEY_SEQ, 1735 NL80211_KEY_SEQ,
1593 NL80211_KEY_DEFAULT, 1736 NL80211_KEY_DEFAULT,
1594 NL80211_KEY_DEFAULT_MGMT, 1737 NL80211_KEY_DEFAULT_MGMT,
1738 NL80211_KEY_TYPE,
1595 1739
1596 /* keep last */ 1740 /* keep last */
1597 __NL80211_KEY_AFTER_LAST, 1741 __NL80211_KEY_AFTER_LAST,
@@ -1619,8 +1763,8 @@ enum nl80211_tx_rate_attributes {
1619 1763
1620/** 1764/**
1621 * enum nl80211_band - Frequency band 1765 * enum nl80211_band - Frequency band
1622 * @NL80211_BAND_2GHZ - 2.4 GHz ISM band 1766 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
1623 * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz) 1767 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
1624 */ 1768 */
1625enum nl80211_band { 1769enum nl80211_band {
1626 NL80211_BAND_2GHZ, 1770 NL80211_BAND_2GHZ,
@@ -1658,9 +1802,9 @@ enum nl80211_attr_cqm {
1658 1802
1659/** 1803/**
1660 * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event 1804 * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event
1661 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW - The RSSI level is lower than the 1805 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the
1662 * configured threshold 1806 * configured threshold
1663 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH - The RSSI is higher than the 1807 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
1664 * configured threshold 1808 * configured threshold
1665 */ 1809 */
1666enum nl80211_cqm_rssi_threshold_event { 1810enum nl80211_cqm_rssi_threshold_event {
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 835f85ecd2d..975d347079d 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -27,20 +27,19 @@ static inline int of_driver_match_device(const struct device *dev,
27extern struct platform_device *of_dev_get(struct platform_device *dev); 27extern struct platform_device *of_dev_get(struct platform_device *dev);
28extern void of_dev_put(struct platform_device *dev); 28extern void of_dev_put(struct platform_device *dev);
29 29
30extern int of_device_add(struct platform_device *pdev);
30extern int of_device_register(struct platform_device *ofdev); 31extern int of_device_register(struct platform_device *ofdev);
31extern void of_device_unregister(struct platform_device *ofdev); 32extern void of_device_unregister(struct platform_device *ofdev);
32extern void of_release_dev(struct device *dev);
33
34static inline void of_device_free(struct platform_device *dev)
35{
36 of_release_dev(&dev->dev);
37}
38 33
39extern ssize_t of_device_get_modalias(struct device *dev, 34extern ssize_t of_device_get_modalias(struct device *dev,
40 char *str, ssize_t len); 35 char *str, ssize_t len);
41 36
42extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env); 37extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
43 38
39static inline void of_device_node_put(struct device *dev)
40{
41 of_node_put(dev->of_node);
42}
44 43
45#else /* CONFIG_OF_DEVICE */ 44#else /* CONFIG_OF_DEVICE */
46 45
@@ -56,6 +55,8 @@ static inline int of_device_uevent(struct device *dev,
56 return -ENODEV; 55 return -ENODEV;
57} 56}
58 57
58static inline void of_device_node_put(struct device *dev) { }
59
59#endif /* CONFIG_OF_DEVICE */ 60#endif /* CONFIG_OF_DEVICE */
60 61
61#endif /* _LINUX_OF_DEVICE_H */ 62#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 71e1a916d3f..7bbf5b32843 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -72,7 +72,7 @@ extern void *of_get_flat_dt_prop(unsigned long node, const char *name,
72 unsigned long *size); 72 unsigned long *size);
73extern int of_flat_dt_is_compatible(unsigned long node, const char *name); 73extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
74extern unsigned long of_get_flat_dt_root(void); 74extern unsigned long of_get_flat_dt_root(void);
75extern void early_init_dt_scan_chosen_arch(unsigned long node); 75
76extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, 76extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
77 int depth, void *data); 77 int depth, void *data);
78extern void early_init_dt_check_for_initrd(unsigned long node); 78extern void early_init_dt_check_for_initrd(unsigned long node);
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index 5929781c104..109e013b177 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -5,6 +5,7 @@
5struct of_irq; 5struct of_irq;
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/errno.h> 7#include <linux/errno.h>
8#include <linux/irq.h>
8#include <linux/ioport.h> 9#include <linux/ioport.h>
9#include <linux/of.h> 10#include <linux/of.h>
10 11
@@ -64,6 +65,9 @@ extern unsigned int irq_create_of_mapping(struct device_node *controller,
64 unsigned int intsize); 65 unsigned int intsize);
65extern int of_irq_to_resource(struct device_node *dev, int index, 66extern int of_irq_to_resource(struct device_node *dev, int index,
66 struct resource *r); 67 struct resource *r);
68extern int of_irq_count(struct device_node *dev);
69extern int of_irq_to_resource_table(struct device_node *dev,
70 struct resource *res, int nr_irqs);
67 71
68#endif /* CONFIG_OF_IRQ */ 72#endif /* CONFIG_OF_IRQ */
69#endif /* CONFIG_OF */ 73#endif /* CONFIG_OF */
diff --git a/include/linux/of_pdt.h b/include/linux/of_pdt.h
new file mode 100644
index 00000000000..c65a18a0cfd
--- /dev/null
+++ b/include/linux/of_pdt.h
@@ -0,0 +1,45 @@
1/*
2 * Definitions for building a device tree by calling into the
3 * Open Firmware PROM.
4 *
5 * Copyright (C) 2010 Andres Salomon <dilinger@queued.net>
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 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifndef _LINUX_OF_PDT_H
14#define _LINUX_OF_PDT_H
15
16/* overridable operations for calling into the PROM */
17struct of_pdt_ops {
18 /*
19 * buf should be 32 bytes; return 0 on success.
20 * If prev is NULL, the first property will be returned.
21 */
22 int (*nextprop)(phandle node, char *prev, char *buf);
23
24 /* for both functions, return proplen on success; -1 on error */
25 int (*getproplen)(phandle node, const char *prop);
26 int (*getproperty)(phandle node, const char *prop, char *buf,
27 int bufsize);
28
29 /* phandles are 0 if no child or sibling exists */
30 phandle (*getchild)(phandle parent);
31 phandle (*getsibling)(phandle node);
32
33 /* return 0 on success; fill in 'len' with number of bytes in path */
34 int (*pkg2path)(phandle node, char *buf, const int buflen, int *len);
35};
36
37extern void *prom_early_alloc(unsigned long size);
38
39/* for building the device tree */
40extern void of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops);
41
42extern void (*of_pdt_build_more)(struct device_node *dp,
43 struct device_node ***nextp);
44
45#endif /* _LINUX_OF_PDT_H */
diff --git a/include/linux/padata.h b/include/linux/padata.h
index bdcd1e9eace..4633b2f726b 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -127,8 +127,8 @@ struct padata_cpumask {
127 */ 127 */
128struct parallel_data { 128struct parallel_data {
129 struct padata_instance *pinst; 129 struct padata_instance *pinst;
130 struct padata_parallel_queue *pqueue; 130 struct padata_parallel_queue __percpu *pqueue;
131 struct padata_serial_queue *squeue; 131 struct padata_serial_queue __percpu *squeue;
132 atomic_t seq_nr; 132 atomic_t seq_nr;
133 atomic_t reorder_objects; 133 atomic_t reorder_objects;
134 atomic_t refcnt; 134 atomic_t refcnt;
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 6fa317801e1..5f38c460367 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -310,7 +310,7 @@ static inline void SetPageUptodate(struct page *page)
310{ 310{
311#ifdef CONFIG_S390 311#ifdef CONFIG_S390
312 if (!test_and_set_bit(PG_uptodate, &page->flags)) 312 if (!test_and_set_bit(PG_uptodate, &page->flags))
313 page_clear_dirty(page); 313 page_clear_dirty(page, 0);
314#else 314#else
315 /* 315 /*
316 * Memory barrier must be issued before setting the PG_uptodate bit, 316 * Memory barrier must be issued before setting the PG_uptodate bit,
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index e8c06122be3..19ef95d293a 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -67,7 +67,8 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
67 67
68#define get_pageblock_flags(page) \ 68#define get_pageblock_flags(page) \
69 get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) 69 get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1)
70#define set_pageblock_flags(page) \ 70#define set_pageblock_flags(page, flags) \
71 set_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) 71 set_pageblock_flags_group(page, flags, \
72 0, NR_PAGEBLOCK_BITS-1)
72 73
73#endif /* PAGEBLOCK_FLAGS_H */ 74#endif /* PAGEBLOCK_FLAGS_H */
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index e12cdc6d79e..2d1ffe3cf1e 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -299,6 +299,8 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma,
299extern void __lock_page(struct page *page); 299extern void __lock_page(struct page *page);
300extern int __lock_page_killable(struct page *page); 300extern int __lock_page_killable(struct page *page);
301extern void __lock_page_nosync(struct page *page); 301extern void __lock_page_nosync(struct page *page);
302extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm,
303 unsigned int flags);
302extern void unlock_page(struct page *page); 304extern void unlock_page(struct page *page);
303 305
304static inline void __set_page_locked(struct page *page) 306static inline void __set_page_locked(struct page *page)
@@ -351,6 +353,17 @@ static inline void lock_page_nosync(struct page *page)
351} 353}
352 354
353/* 355/*
356 * lock_page_or_retry - Lock the page, unless this would block and the
357 * caller indicated that it can handle a retry.
358 */
359static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm,
360 unsigned int flags)
361{
362 might_sleep();
363 return trylock_page(page) || __lock_page_or_retry(page, mm, flags);
364}
365
366/*
354 * This is exported only for wait_on_page_locked/wait_on_page_writeback. 367 * This is exported only for wait_on_page_locked/wait_on_page_writeback.
355 * Never use this directly! 368 * Never use this directly!
356 */ 369 */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c8d95e369ff..7454408c41b 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -541,7 +541,7 @@ struct pci_error_handlers {
541struct module; 541struct module;
542struct pci_driver { 542struct pci_driver {
543 struct list_head node; 543 struct list_head node;
544 char *name; 544 const char *name;
545 const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ 545 const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
546 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ 546 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
547 void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ 547 void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
@@ -819,6 +819,9 @@ pci_power_t pci_target_state(struct pci_dev *dev);
819int pci_prepare_to_sleep(struct pci_dev *dev); 819int pci_prepare_to_sleep(struct pci_dev *dev);
820int pci_back_from_sleep(struct pci_dev *dev); 820int pci_back_from_sleep(struct pci_dev *dev);
821bool pci_dev_run_wake(struct pci_dev *dev); 821bool pci_dev_run_wake(struct pci_dev *dev);
822bool pci_check_pme_status(struct pci_dev *dev);
823void pci_wakeup_event(struct pci_dev *dev);
824void pci_pme_wakeup_bus(struct pci_bus *bus);
822 825
823static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, 826static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
824 bool enable) 827 bool enable)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index e4471b27c39..c6bcfe93b9c 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -767,6 +767,8 @@
767#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 767#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
768#define PCI_DEVICE_ID_ELSA_QS3000 0x3000 768#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
769 769
770#define PCI_VENDOR_ID_STMICRO 0x104A
771
770#define PCI_VENDOR_ID_BUSLOGIC 0x104B 772#define PCI_VENDOR_ID_BUSLOGIC 0x104B
771#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 773#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140
772#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 774#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040
@@ -820,7 +822,7 @@
820 822
821#define PCI_VENDOR_ID_ANIGMA 0x1051 823#define PCI_VENDOR_ID_ANIGMA 0x1051
822#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100 824#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100
823 825
824#define PCI_VENDOR_ID_EFAR 0x1055 826#define PCI_VENDOR_ID_EFAR 0x1055
825#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130 827#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130
826#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463 828#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463
@@ -1251,6 +1253,8 @@
1251#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348 1253#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348
1252#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C 1254#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C
1253#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E 1255#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
1256#define PCI_DEVICE_ID_NVIDIA_MCP55_BRIDGE_V0 0x0360
1257#define PCI_DEVICE_ID_NVIDIA_MCP55_BRIDGE_V4 0x0364
1254#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1258#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1255#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7 1259#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7
1256#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SMBUS 0x03EB 1260#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SMBUS 0x03EB
@@ -1451,7 +1455,7 @@
1451 1455
1452#define PCI_VENDOR_ID_ZIATECH 0x1138 1456#define PCI_VENDOR_ID_ZIATECH 0x1138
1453#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 1457#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550
1454 1458
1455 1459
1456#define PCI_VENDOR_ID_SYSKONNECT 0x1148 1460#define PCI_VENDOR_ID_SYSKONNECT 0x1148
1457#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 1461#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200
@@ -1605,8 +1609,8 @@
1605#define PCI_DEVICE_ID_RP8OCTA 0x0005 1609#define PCI_DEVICE_ID_RP8OCTA 0x0005
1606#define PCI_DEVICE_ID_RP8J 0x0006 1610#define PCI_DEVICE_ID_RP8J 0x0006
1607#define PCI_DEVICE_ID_RP4J 0x0007 1611#define PCI_DEVICE_ID_RP4J 0x0007
1608#define PCI_DEVICE_ID_RP8SNI 0x0008 1612#define PCI_DEVICE_ID_RP8SNI 0x0008
1609#define PCI_DEVICE_ID_RP16SNI 0x0009 1613#define PCI_DEVICE_ID_RP16SNI 0x0009
1610#define PCI_DEVICE_ID_RPP4 0x000A 1614#define PCI_DEVICE_ID_RPP4 0x000A
1611#define PCI_DEVICE_ID_RPP8 0x000B 1615#define PCI_DEVICE_ID_RPP8 0x000B
1612#define PCI_DEVICE_ID_RP4M 0x000D 1616#define PCI_DEVICE_ID_RP4M 0x000D
@@ -1616,9 +1620,9 @@
1616#define PCI_DEVICE_ID_URP8INTF 0x0802 1620#define PCI_DEVICE_ID_URP8INTF 0x0802
1617#define PCI_DEVICE_ID_URP16INTF 0x0803 1621#define PCI_DEVICE_ID_URP16INTF 0x0803
1618#define PCI_DEVICE_ID_URP8OCTA 0x0805 1622#define PCI_DEVICE_ID_URP8OCTA 0x0805
1619#define PCI_DEVICE_ID_UPCI_RM3_8PORT 0x080C 1623#define PCI_DEVICE_ID_UPCI_RM3_8PORT 0x080C
1620#define PCI_DEVICE_ID_UPCI_RM3_4PORT 0x080D 1624#define PCI_DEVICE_ID_UPCI_RM3_4PORT 0x080D
1621#define PCI_DEVICE_ID_CRP16INTF 0x0903 1625#define PCI_DEVICE_ID_CRP16INTF 0x0903
1622 1626
1623#define PCI_VENDOR_ID_CYCLADES 0x120e 1627#define PCI_VENDOR_ID_CYCLADES 0x120e
1624#define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100 1628#define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100
@@ -2144,7 +2148,7 @@
2144#define PCI_DEVICE_ID_RASTEL_2PORT 0x2000 2148#define PCI_DEVICE_ID_RASTEL_2PORT 0x2000
2145 2149
2146#define PCI_VENDOR_ID_ZOLTRIX 0x15b0 2150#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
2147#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0 2151#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0
2148 2152
2149#define PCI_VENDOR_ID_MELLANOX 0x15b3 2153#define PCI_VENDOR_ID_MELLANOX 0x15b3
2150#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 2154#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44
@@ -2194,6 +2198,9 @@
2194#define PCI_VENDOR_ID_ARIMA 0x161f 2198#define PCI_VENDOR_ID_ARIMA 0x161f
2195 2199
2196#define PCI_VENDOR_ID_BROCADE 0x1657 2200#define PCI_VENDOR_ID_BROCADE 0x1657
2201#define PCI_DEVICE_ID_BROCADE_CT 0x0014
2202#define PCI_DEVICE_ID_BROCADE_FC_8G1P 0x0017
2203#define PCI_DEVICE_ID_BROCADE_CT_FC 0x0021
2197 2204
2198#define PCI_VENDOR_ID_SIBYTE 0x166d 2205#define PCI_VENDOR_ID_SIBYTE 0x166d
2199#define PCI_DEVICE_ID_BCM1250_PCI 0x0001 2206#define PCI_DEVICE_ID_BCM1250_PCI 0x0001
@@ -2265,6 +2272,13 @@
2265 2272
2266#define PCI_VENDOR_ID_SILAN 0x1904 2273#define PCI_VENDOR_ID_SILAN 0x1904
2267 2274
2275#define PCI_VENDOR_ID_RENESAS 0x1912
2276#define PCI_DEVICE_ID_RENESAS_SH7781 0x0001
2277#define PCI_DEVICE_ID_RENESAS_SH7780 0x0002
2278#define PCI_DEVICE_ID_RENESAS_SH7763 0x0004
2279#define PCI_DEVICE_ID_RENESAS_SH7785 0x0007
2280#define PCI_DEVICE_ID_RENESAS_SH7786 0x0010
2281
2268#define PCI_VENDOR_ID_TDI 0x192E 2282#define PCI_VENDOR_ID_TDI 0x192E
2269#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2283#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2270 2284
@@ -2420,6 +2434,13 @@
2420#define PCI_DEVICE_ID_INTEL_82375 0x0482 2434#define PCI_DEVICE_ID_INTEL_82375 0x0482
2421#define PCI_DEVICE_ID_INTEL_82424 0x0483 2435#define PCI_DEVICE_ID_INTEL_82424 0x0483
2422#define PCI_DEVICE_ID_INTEL_82378 0x0484 2436#define PCI_DEVICE_ID_INTEL_82378 0x0484
2437#define PCI_DEVICE_ID_INTEL_MRST_SD0 0x0807
2438#define PCI_DEVICE_ID_INTEL_MRST_SD1 0x0808
2439#define PCI_DEVICE_ID_INTEL_MFD_SD 0x0820
2440#define PCI_DEVICE_ID_INTEL_MFD_SDIO1 0x0821
2441#define PCI_DEVICE_ID_INTEL_MFD_SDIO2 0x0822
2442#define PCI_DEVICE_ID_INTEL_MFD_EMMC0 0x0823
2443#define PCI_DEVICE_ID_INTEL_MFD_EMMC1 0x0824
2423#define PCI_DEVICE_ID_INTEL_I960 0x0960 2444#define PCI_DEVICE_ID_INTEL_I960 0x0960
2424#define PCI_DEVICE_ID_INTEL_I960RM 0x0962 2445#define PCI_DEVICE_ID_INTEL_I960RM 0x0962
2425#define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062 2446#define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062
@@ -2428,7 +2449,7 @@
2428#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130 2449#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130
2429#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132 2450#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132
2430#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221 2451#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
2431#define PCI_DEVICE_ID_INTEL_7505_0 0x2550 2452#define PCI_DEVICE_ID_INTEL_7505_0 0x2550
2432#define PCI_DEVICE_ID_INTEL_7205_0 0x255d 2453#define PCI_DEVICE_ID_INTEL_7205_0 0x255d
2433#define PCI_DEVICE_ID_INTEL_82437 0x122d 2454#define PCI_DEVICE_ID_INTEL_82437 0x122d
2434#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e 2455#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e
@@ -2441,9 +2462,11 @@
2441#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 2462#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21
2442#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 2463#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2443#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 2464#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
2444#define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22 2465#define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22
2445#define PCI_DEVICE_ID_INTEL_CPT_LPC_MIN 0x1c41 2466#define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41
2446#define PCI_DEVICE_ID_INTEL_CPT_LPC_MAX 0x1c5f 2467#define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f
2468#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22
2469#define PCI_DEVICE_ID_INTEL_PATSBURG_LPC 0x1d40
2447#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 2470#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2448#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 2471#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2449#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 2472#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
@@ -2631,6 +2654,9 @@
2631#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 2654#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
2632#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a 2655#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
2633#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e 2656#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
2657#define PCI_DEVICE_ID_INTEL_I7300_MCH_ERR 0x360c
2658#define PCI_DEVICE_ID_INTEL_I7300_MCH_FB0 0x360f
2659#define PCI_DEVICE_ID_INTEL_I7300_MCH_FB1 0x3610
2634#define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b 2660#define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b
2635#define PCI_DEVICE_ID_INTEL_FBD_CNB 0x360c 2661#define PCI_DEVICE_ID_INTEL_FBD_CNB 0x360c
2636#define PCI_DEVICE_ID_INTEL_IOAT_JSF0 0x3710 2662#define PCI_DEVICE_ID_INTEL_IOAT_JSF0 0x3710
@@ -2649,9 +2675,9 @@
2649#define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a 2675#define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a
2650#define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 2676#define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30
2651#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 2677#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60
2652#define PCI_DEVICE_ID_INTEL_PCH_LPC_MIN 0x3b00 2678#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00
2653#define PCI_DEVICE_ID_INTEL_PCH_LPC_MAX 0x3b1f 2679#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f
2654#define PCI_DEVICE_ID_INTEL_PCH_SMBUS 0x3b30 2680#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30
2655#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f 2681#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
2656#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 2682#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0
2657#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 2683#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5
@@ -2660,8 +2686,8 @@
2660#define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035 2686#define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035
2661#define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036 2687#define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036
2662#define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff 2688#define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff
2663#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031 2689#define PCI_DEVICE_ID_INTEL_EP80579_0 0x5031
2664#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032 2690#define PCI_DEVICE_ID_INTEL_EP80579_1 0x5032
2665#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 2691#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
2666#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 2692#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
2667#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 2693#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 455b9ccdfca..af83076c31a 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -300,12 +300,14 @@
300#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 300#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
301#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ 301#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
302 302
303/* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */ 303/* MSI-X registers */
304#define PCI_MSIX_FLAGS 2 304#define PCI_MSIX_FLAGS 2
305#define PCI_MSIX_FLAGS_QSIZE 0x7FF 305#define PCI_MSIX_FLAGS_QSIZE 0x7FF
306#define PCI_MSIX_FLAGS_ENABLE (1 << 15) 306#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
307#define PCI_MSIX_FLAGS_MASKALL (1 << 14) 307#define PCI_MSIX_FLAGS_MASKALL (1 << 14)
308#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) 308#define PCI_MSIX_TABLE 4
309#define PCI_MSIX_PBA 8
310#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
309 311
310/* CompactPCI Hotswap Register */ 312/* CompactPCI Hotswap Register */
311 313
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 018db9a62ff..27ef6b190ea 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -148,18 +148,6 @@
148 DEFINE_PER_CPU_SECTION(type, name, "..readmostly") 148 DEFINE_PER_CPU_SECTION(type, name, "..readmostly")
149 149
150/* 150/*
151 * Declaration/definition used for large per-CPU variables that must be
152 * aligned to something larger than the pagesize.
153 */
154#define DECLARE_PER_CPU_MULTIPAGE_ALIGNED(type, name, size) \
155 DECLARE_PER_CPU_SECTION(type, name, "..page_aligned") \
156 __aligned(size)
157
158#define DEFINE_PER_CPU_MULTIPAGE_ALIGNED(type, name, size) \
159 DEFINE_PER_CPU_SECTION(type, name, "..page_aligned") \
160 __aligned(size)
161
162/*
163 * Intermodule exports for per-CPU variables. sparse forgets about 151 * Intermodule exports for per-CPU variables. sparse forgets about
164 * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to 152 * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to
165 * noop if __CHECKER__. 153 * noop if __CHECKER__.
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 8a7d510ffa9..46f6ba56fa9 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -78,6 +78,11 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
78 return 1; 78 return 1;
79} 79}
80 80
81static inline int percpu_counter_initialized(struct percpu_counter *fbc)
82{
83 return (fbc->counters != NULL);
84}
85
81#else 86#else
82 87
83struct percpu_counter { 88struct percpu_counter {
@@ -143,6 +148,11 @@ static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
143 return percpu_counter_read(fbc); 148 return percpu_counter_read(fbc);
144} 149}
145 150
151static inline int percpu_counter_initialized(struct percpu_counter *fbc)
152{
153 return 1;
154}
155
146#endif /* CONFIG_SMP */ 156#endif /* CONFIG_SMP */
147 157
148static inline void percpu_counter_inc(struct percpu_counter *fbc) 158static inline void percpu_counter_inc(struct percpu_counter *fbc)
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index 76edadf046d..26c8df78691 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -36,6 +36,9 @@
36/* Socket options for SOL_PNPIPE level */ 36/* Socket options for SOL_PNPIPE level */
37#define PNPIPE_ENCAP 1 37#define PNPIPE_ENCAP 1
38#define PNPIPE_IFINDEX 2 38#define PNPIPE_IFINDEX 2
39#define PNPIPE_PIPE_HANDLE 3
40#define PNPIPE_ENABLE 4
41/* unused slot */
39 42
40#define PNADDR_ANY 0 43#define PNADDR_ANY 0
41#define PNADDR_BROADCAST 0xFC 44#define PNADDR_BROADCAST 0xFC
@@ -47,6 +50,8 @@
47 50
48/* ioctls */ 51/* ioctls */
49#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0) 52#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
53#define SIOCPNADDRESOURCE (SIOCPROTOPRIVATE + 14)
54#define SIOCPNDELRESOURCE (SIOCPROTOPRIVATE + 15)
50 55
51/* Phonet protocol header */ 56/* Phonet protocol header */
52struct phonethdr { 57struct phonethdr {
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 6b0a782c622..7da5fa84595 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -116,7 +116,7 @@ struct mii_bus {
116 /* list of all PHYs on bus */ 116 /* list of all PHYs on bus */
117 struct phy_device *phy_map[PHY_MAX_ADDR]; 117 struct phy_device *phy_map[PHY_MAX_ADDR];
118 118
119 /* Phy addresses to be ignored when probing */ 119 /* PHY addresses to be ignored when probing */
120 u32 phy_mask; 120 u32 phy_mask;
121 121
122 /* 122 /*
@@ -283,7 +283,7 @@ struct phy_device {
283 283
284 phy_interface_t interface; 284 phy_interface_t interface;
285 285
286 /* Bus address of the PHY (0-32) */ 286 /* Bus address of the PHY (0-31) */
287 int addr; 287 int addr;
288 288
289 /* 289 /*
@@ -472,11 +472,7 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
472int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); 472int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
473struct phy_device* get_phy_device(struct mii_bus *bus, int addr); 473struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
474int phy_device_register(struct phy_device *phy); 474int phy_device_register(struct phy_device *phy);
475int phy_clear_interrupt(struct phy_device *phydev);
476int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
477int phy_init_hw(struct phy_device *phydev); 475int phy_init_hw(struct phy_device *phydev);
478int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
479 u32 flags, phy_interface_t interface);
480struct phy_device * phy_attach(struct net_device *dev, 476struct phy_device * phy_attach(struct net_device *dev,
481 const char *bus_id, u32 flags, phy_interface_t interface); 477 const char *bus_id, u32 flags, phy_interface_t interface);
482struct phy_device *phy_find_first(struct mii_bus *bus); 478struct phy_device *phy_find_first(struct mii_bus *bus);
@@ -492,17 +488,12 @@ void phy_start(struct phy_device *phydev);
492void phy_stop(struct phy_device *phydev); 488void phy_stop(struct phy_device *phydev);
493int phy_start_aneg(struct phy_device *phydev); 489int phy_start_aneg(struct phy_device *phydev);
494 490
495void phy_sanitize_settings(struct phy_device *phydev);
496int phy_stop_interrupts(struct phy_device *phydev); 491int phy_stop_interrupts(struct phy_device *phydev);
497int phy_enable_interrupts(struct phy_device *phydev);
498int phy_disable_interrupts(struct phy_device *phydev);
499 492
500static inline int phy_read_status(struct phy_device *phydev) { 493static inline int phy_read_status(struct phy_device *phydev) {
501 return phydev->drv->read_status(phydev); 494 return phydev->drv->read_status(phydev);
502} 495}
503 496
504int genphy_config_advert(struct phy_device *phydev);
505int genphy_setup_forced(struct phy_device *phydev);
506int genphy_restart_aneg(struct phy_device *phydev); 497int genphy_restart_aneg(struct phy_device *phydev);
507int genphy_config_aneg(struct phy_device *phydev); 498int genphy_config_aneg(struct phy_device *phydev);
508int genphy_update_link(struct phy_device *phydev); 499int genphy_update_link(struct phy_device *phydev);
@@ -511,8 +502,6 @@ int genphy_suspend(struct phy_device *phydev);
511int genphy_resume(struct phy_device *phydev); 502int genphy_resume(struct phy_device *phydev);
512void phy_driver_unregister(struct phy_driver *drv); 503void phy_driver_unregister(struct phy_driver *drv);
513int phy_driver_register(struct phy_driver *new_driver); 504int phy_driver_register(struct phy_driver *new_driver);
514void phy_prepare_link(struct phy_device *phydev,
515 void (*adjust_link)(struct net_device *));
516void phy_state_machine(struct work_struct *work); 505void phy_state_machine(struct work_struct *work);
517void phy_start_machine(struct phy_device *phydev, 506void phy_start_machine(struct phy_device *phydev,
518 void (*handler)(struct net_device *)); 507 void (*handler)(struct net_device *));
@@ -523,7 +512,6 @@ int phy_mii_ioctl(struct phy_device *phydev,
523 struct ifreq *ifr, int cmd); 512 struct ifreq *ifr, int cmd);
524int phy_start_interrupts(struct phy_device *phydev); 513int phy_start_interrupts(struct phy_device *phydev);
525void phy_print_status(struct phy_device *phydev); 514void phy_print_status(struct phy_device *phydev);
526struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id);
527void phy_device_free(struct phy_device *phydev); 515void phy_device_free(struct phy_device *phydev);
528 516
529int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, 517int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 7f6ba8658ab..defbde203d0 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -332,6 +332,7 @@ enum {
332 FLOW_KEY_SKUID, 332 FLOW_KEY_SKUID,
333 FLOW_KEY_SKGID, 333 FLOW_KEY_SKGID,
334 FLOW_KEY_VLAN_TAG, 334 FLOW_KEY_VLAN_TAG,
335 FLOW_KEY_RXHASH,
335 __FLOW_KEY_MAX, 336 __FLOW_KEY_MAX,
336}; 337};
337 338
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 600cc1fde64..56e76af7810 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -73,6 +73,8 @@ extern void poll_initwait(struct poll_wqueues *pwq);
73extern void poll_freewait(struct poll_wqueues *pwq); 73extern void poll_freewait(struct poll_wqueues *pwq);
74extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state, 74extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
75 ktime_t *expires, unsigned long slack); 75 ktime_t *expires, unsigned long slack);
76extern long select_estimate_accuracy(struct timespec *tv);
77
76 78
77static inline int poll_schedule(struct poll_wqueues *pwq, int state) 79static inline int poll_schedule(struct poll_wqueues *pwq, int state)
78{ 80{
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 30083a896f3..7d7325685c4 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -89,6 +89,7 @@ enum power_supply_property {
89 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, 89 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
90 POWER_SUPPLY_PROP_VOLTAGE_NOW, 90 POWER_SUPPLY_PROP_VOLTAGE_NOW,
91 POWER_SUPPLY_PROP_VOLTAGE_AVG, 91 POWER_SUPPLY_PROP_VOLTAGE_AVG,
92 POWER_SUPPLY_PROP_CURRENT_MAX,
92 POWER_SUPPLY_PROP_CURRENT_NOW, 93 POWER_SUPPLY_PROP_CURRENT_NOW,
93 POWER_SUPPLY_PROP_CURRENT_AVG, 94 POWER_SUPPLY_PROP_CURRENT_AVG,
94 POWER_SUPPLY_PROP_POWER_NOW, 95 POWER_SUPPLY_PROP_POWER_NOW,
@@ -125,7 +126,10 @@ enum power_supply_type {
125 POWER_SUPPLY_TYPE_BATTERY = 0, 126 POWER_SUPPLY_TYPE_BATTERY = 0,
126 POWER_SUPPLY_TYPE_UPS, 127 POWER_SUPPLY_TYPE_UPS,
127 POWER_SUPPLY_TYPE_MAINS, 128 POWER_SUPPLY_TYPE_MAINS,
128 POWER_SUPPLY_TYPE_USB, 129 POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */
130 POWER_SUPPLY_TYPE_USB_DCP, /* Dedicated Charging Port */
131 POWER_SUPPLY_TYPE_USB_CDP, /* Charging Downstream Port */
132 POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */
129}; 133};
130 134
131union power_supply_propval { 135union power_supply_propval {
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 4272521e29e..092a04f874a 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -100,7 +100,8 @@
100#include <linux/sched.h> /* For struct task_struct. */ 100#include <linux/sched.h> /* For struct task_struct. */
101 101
102 102
103extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); 103extern long arch_ptrace(struct task_struct *child, long request,
104 unsigned long addr, unsigned long data);
104extern int ptrace_traceme(void); 105extern int ptrace_traceme(void);
105extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 106extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
106extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); 107extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
@@ -108,7 +109,8 @@ extern int ptrace_attach(struct task_struct *tsk);
108extern int ptrace_detach(struct task_struct *, unsigned int); 109extern int ptrace_detach(struct task_struct *, unsigned int);
109extern void ptrace_disable(struct task_struct *); 110extern void ptrace_disable(struct task_struct *);
110extern int ptrace_check_attach(struct task_struct *task, int kill); 111extern int ptrace_check_attach(struct task_struct *task, int kill);
111extern int ptrace_request(struct task_struct *child, long request, long addr, long data); 112extern int ptrace_request(struct task_struct *child, long request,
113 unsigned long addr, unsigned long data);
112extern void ptrace_notify(int exit_code); 114extern void ptrace_notify(int exit_code);
113extern void __ptrace_link(struct task_struct *child, 115extern void __ptrace_link(struct task_struct *child,
114 struct task_struct *new_parent); 116 struct task_struct *new_parent);
@@ -132,8 +134,10 @@ static inline void ptrace_unlink(struct task_struct *child)
132 __ptrace_unlink(child); 134 __ptrace_unlink(child);
133} 135}
134 136
135int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data); 137int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr,
136int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data); 138 unsigned long data);
139int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
140 unsigned long data);
137 141
138/** 142/**
139 * task_ptrace - return %PT_* flags that apply to a task 143 * task_ptrace - return %PT_* flags that apply to a task
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index e7320b5e82f..3a8f0c9b293 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -3,8 +3,8 @@
3 3
4struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir, 4struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
5 int mode, dev_t dev); 5 int mode, dev_t dev);
6extern int ramfs_get_sb(struct file_system_type *fs_type, 6extern struct dentry *ramfs_mount(struct file_system_type *fs_type,
7 int flags, const char *dev_name, void *data, struct vfsmount *mnt); 7 int flags, const char *dev_name, void *data);
8 8
9#ifndef CONFIG_MMU 9#ifndef CONFIG_MMU
10extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); 10extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);
diff --git a/include/linux/ramoops.h b/include/linux/ramoops.h
new file mode 100644
index 00000000000..0ae68a2c121
--- /dev/null
+++ b/include/linux/ramoops.h
@@ -0,0 +1,15 @@
1#ifndef __RAMOOPS_H
2#define __RAMOOPS_H
3
4/*
5 * Ramoops platform data
6 * @mem_size memory size for ramoops
7 * @mem_address physical memory address to contain ramoops
8 */
9
10struct ramoops_platform_data {
11 unsigned long mem_size;
12 unsigned long mem_address;
13};
14
15#endif
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 8f69d09a41a..03ff67b0cdf 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -36,6 +36,8 @@ static inline void ratelimit_state_init(struct ratelimit_state *rs,
36 rs->begin = 0; 36 rs->begin = 0;
37} 37}
38 38
39extern struct ratelimit_state printk_ratelimit_state;
40
39extern int ___ratelimit(struct ratelimit_state *rs, const char *func); 41extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
40#define __ratelimit(state) ___ratelimit(state, __func__) 42#define __ratelimit(state) ___ratelimit(state, __func__)
41 43
diff --git a/include/linux/rds.h b/include/linux/rds.h
index 24bce3ded9e..91950950aa5 100644
--- a/include/linux/rds.h
+++ b/include/linux/rds.h
@@ -36,15 +36,6 @@
36 36
37#include <linux/types.h> 37#include <linux/types.h>
38 38
39/* These sparse annotated types shouldn't be in any user
40 * visible header file. We should clean this up rather
41 * than kludging around them. */
42#ifndef __KERNEL__
43#define __be16 u_int16_t
44#define __be32 u_int32_t
45#define __be64 u_int64_t
46#endif
47
48#define RDS_IB_ABI_VERSION 0x301 39#define RDS_IB_ABI_VERSION 0x301
49 40
50/* 41/*
@@ -82,6 +73,10 @@
82#define RDS_CMSG_RDMA_MAP 3 73#define RDS_CMSG_RDMA_MAP 3
83#define RDS_CMSG_RDMA_STATUS 4 74#define RDS_CMSG_RDMA_STATUS 4
84#define RDS_CMSG_CONG_UPDATE 5 75#define RDS_CMSG_CONG_UPDATE 5
76#define RDS_CMSG_ATOMIC_FADD 6
77#define RDS_CMSG_ATOMIC_CSWP 7
78#define RDS_CMSG_MASKED_ATOMIC_FADD 8
79#define RDS_CMSG_MASKED_ATOMIC_CSWP 9
85 80
86#define RDS_INFO_FIRST 10000 81#define RDS_INFO_FIRST 10000
87#define RDS_INFO_COUNTERS 10000 82#define RDS_INFO_COUNTERS 10000
@@ -98,9 +93,9 @@
98#define RDS_INFO_LAST 10010 93#define RDS_INFO_LAST 10010
99 94
100struct rds_info_counter { 95struct rds_info_counter {
101 u_int8_t name[32]; 96 uint8_t name[32];
102 u_int64_t value; 97 uint64_t value;
103} __packed; 98} __attribute__((packed));
104 99
105#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 100#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
106#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02 101#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02
@@ -109,56 +104,48 @@ struct rds_info_counter {
109#define TRANSNAMSIZ 16 104#define TRANSNAMSIZ 16
110 105
111struct rds_info_connection { 106struct rds_info_connection {
112 u_int64_t next_tx_seq; 107 uint64_t next_tx_seq;
113 u_int64_t next_rx_seq; 108 uint64_t next_rx_seq;
114 __be32 laddr;
115 __be32 faddr;
116 u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */
117 u_int8_t flags;
118} __packed;
119
120struct rds_info_flow {
121 __be32 laddr; 109 __be32 laddr;
122 __be32 faddr; 110 __be32 faddr;
123 u_int32_t bytes; 111 uint8_t transport[TRANSNAMSIZ]; /* null term ascii */
124 __be16 lport; 112 uint8_t flags;
125 __be16 fport; 113} __attribute__((packed));
126} __packed;
127 114
128#define RDS_INFO_MESSAGE_FLAG_ACK 0x01 115#define RDS_INFO_MESSAGE_FLAG_ACK 0x01
129#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 116#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
130 117
131struct rds_info_message { 118struct rds_info_message {
132 u_int64_t seq; 119 uint64_t seq;
133 u_int32_t len; 120 uint32_t len;
134 __be32 laddr; 121 __be32 laddr;
135 __be32 faddr; 122 __be32 faddr;
136 __be16 lport; 123 __be16 lport;
137 __be16 fport; 124 __be16 fport;
138 u_int8_t flags; 125 uint8_t flags;
139} __packed; 126} __attribute__((packed));
140 127
141struct rds_info_socket { 128struct rds_info_socket {
142 u_int32_t sndbuf; 129 uint32_t sndbuf;
143 __be32 bound_addr; 130 __be32 bound_addr;
144 __be32 connected_addr; 131 __be32 connected_addr;
145 __be16 bound_port; 132 __be16 bound_port;
146 __be16 connected_port; 133 __be16 connected_port;
147 u_int32_t rcvbuf; 134 uint32_t rcvbuf;
148 u_int64_t inum; 135 uint64_t inum;
149} __packed; 136} __attribute__((packed));
150 137
151struct rds_info_tcp_socket { 138struct rds_info_tcp_socket {
152 __be32 local_addr; 139 __be32 local_addr;
153 __be16 local_port; 140 __be16 local_port;
154 __be32 peer_addr; 141 __be32 peer_addr;
155 __be16 peer_port; 142 __be16 peer_port;
156 u_int64_t hdr_rem; 143 uint64_t hdr_rem;
157 u_int64_t data_rem; 144 uint64_t data_rem;
158 u_int32_t last_sent_nxt; 145 uint32_t last_sent_nxt;
159 u_int32_t last_expected_una; 146 uint32_t last_expected_una;
160 u_int32_t last_seen_una; 147 uint32_t last_seen_una;
161} __packed; 148} __attribute__((packed));
162 149
163#define RDS_IB_GID_LEN 16 150#define RDS_IB_GID_LEN 16
164struct rds_info_rdma_connection { 151struct rds_info_rdma_connection {
@@ -212,42 +199,69 @@ struct rds_info_rdma_connection {
212 * (so that the application does not have to worry about 199 * (so that the application does not have to worry about
213 * alignment). 200 * alignment).
214 */ 201 */
215typedef u_int64_t rds_rdma_cookie_t; 202typedef uint64_t rds_rdma_cookie_t;
216 203
217struct rds_iovec { 204struct rds_iovec {
218 u_int64_t addr; 205 uint64_t addr;
219 u_int64_t bytes; 206 uint64_t bytes;
220}; 207};
221 208
222struct rds_get_mr_args { 209struct rds_get_mr_args {
223 struct rds_iovec vec; 210 struct rds_iovec vec;
224 u_int64_t cookie_addr; 211 uint64_t cookie_addr;
225 uint64_t flags; 212 uint64_t flags;
226}; 213};
227 214
228struct rds_get_mr_for_dest_args { 215struct rds_get_mr_for_dest_args {
229 struct sockaddr_storage dest_addr; 216 struct sockaddr_storage dest_addr;
230 struct rds_iovec vec; 217 struct rds_iovec vec;
231 u_int64_t cookie_addr; 218 uint64_t cookie_addr;
232 uint64_t flags; 219 uint64_t flags;
233}; 220};
234 221
235struct rds_free_mr_args { 222struct rds_free_mr_args {
236 rds_rdma_cookie_t cookie; 223 rds_rdma_cookie_t cookie;
237 u_int64_t flags; 224 uint64_t flags;
238}; 225};
239 226
240struct rds_rdma_args { 227struct rds_rdma_args {
241 rds_rdma_cookie_t cookie; 228 rds_rdma_cookie_t cookie;
242 struct rds_iovec remote_vec; 229 struct rds_iovec remote_vec;
243 u_int64_t local_vec_addr; 230 uint64_t local_vec_addr;
244 u_int64_t nr_local; 231 uint64_t nr_local;
245 u_int64_t flags; 232 uint64_t flags;
246 u_int64_t user_token; 233 uint64_t user_token;
234};
235
236struct rds_atomic_args {
237 rds_rdma_cookie_t cookie;
238 uint64_t local_addr;
239 uint64_t remote_addr;
240 union {
241 struct {
242 uint64_t compare;
243 uint64_t swap;
244 } cswp;
245 struct {
246 uint64_t add;
247 } fadd;
248 struct {
249 uint64_t compare;
250 uint64_t swap;
251 uint64_t compare_mask;
252 uint64_t swap_mask;
253 } m_cswp;
254 struct {
255 uint64_t add;
256 uint64_t nocarry_mask;
257 } m_fadd;
258 };
259 uint64_t flags;
260 uint64_t user_token;
247}; 261};
248 262
249struct rds_rdma_notify { 263struct rds_rdma_notify {
250 u_int64_t user_token; 264 uint64_t user_token;
251 int32_t status; 265 int32_t status;
252}; 266};
253 267
@@ -266,5 +280,6 @@ struct rds_rdma_notify {
266#define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */ 280#define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */
267#define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */ 281#define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */
268#define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */ 282#define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */
283#define RDS_RDMA_SILENT 0x0040 /* Do not interrupt remote */
269 284
270#endif /* IB_RDS_H */ 285#endif /* IB_RDS_H */
diff --git a/include/linux/regulator/lp3972.h b/include/linux/regulator/lp3972.h
new file mode 100644
index 00000000000..9bb7389b7a1
--- /dev/null
+++ b/include/linux/regulator/lp3972.h
@@ -0,0 +1,48 @@
1/*
2 * National Semiconductors LP3972 PMIC chip client interface
3 *
4 * Based on lp3971.h
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef __LINUX_REGULATOR_LP3972_H
22#define __LINUX_REGULATOR_LP3972_H
23
24#include <linux/regulator/machine.h>
25
26#define LP3972_LDO1 0
27#define LP3972_LDO2 1
28#define LP3972_LDO3 2
29#define LP3972_LDO4 3
30#define LP3972_LDO5 4
31
32#define LP3972_DCDC1 5
33#define LP3972_DCDC2 6
34#define LP3972_DCDC3 7
35
36#define LP3972_NUM_REGULATORS 8
37
38struct lp3972_regulator_subdev {
39 int id;
40 struct regulator_init_data *initdata;
41};
42
43struct lp3972_platform_data {
44 int num_regulators;
45 struct lp3972_regulator_subdev *regulators;
46};
47
48#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index e2980287245..761c745b9c2 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -189,10 +189,15 @@ int regulator_suspend_prepare(suspend_state_t state);
189 189
190#ifdef CONFIG_REGULATOR 190#ifdef CONFIG_REGULATOR
191void regulator_has_full_constraints(void); 191void regulator_has_full_constraints(void);
192void regulator_use_dummy_regulator(void);
192#else 193#else
193static inline void regulator_has_full_constraints(void) 194static inline void regulator_has_full_constraints(void)
194{ 195{
195} 196}
197
198static inline void regulator_use_dummy_regulator(void)
199{
200}
196#endif 201#endif
197 202
198#endif 203#endif
diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h
new file mode 100644
index 00000000000..45e42855ad0
--- /dev/null
+++ b/include/linux/regulator/max8952.h
@@ -0,0 +1,135 @@
1/*
2 * max8952.h - Voltage regulation for the Maxim 8952
3 *
4 * Copyright (C) 2010 Samsung Electrnoics
5 * MyungJoo Ham <myungjoo.ham@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#ifndef REGULATOR_MAX8952
23#define REGULATOR_MAX8952
24
25#include <linux/regulator/machine.h>
26
27enum {
28 MAX8952_DVS_MODE0,
29 MAX8952_DVS_MODE1,
30 MAX8952_DVS_MODE2,
31 MAX8952_DVS_MODE3,
32};
33
34enum {
35 MAX8952_DVS_770mV = 0,
36 MAX8952_DVS_780mV,
37 MAX8952_DVS_790mV,
38 MAX8952_DVS_800mV,
39 MAX8952_DVS_810mV,
40 MAX8952_DVS_820mV,
41 MAX8952_DVS_830mV,
42 MAX8952_DVS_840mV,
43 MAX8952_DVS_850mV,
44 MAX8952_DVS_860mV,
45 MAX8952_DVS_870mV,
46 MAX8952_DVS_880mV,
47 MAX8952_DVS_890mV,
48 MAX8952_DVS_900mV,
49 MAX8952_DVS_910mV,
50 MAX8952_DVS_920mV,
51 MAX8952_DVS_930mV,
52 MAX8952_DVS_940mV,
53 MAX8952_DVS_950mV,
54 MAX8952_DVS_960mV,
55 MAX8952_DVS_970mV,
56 MAX8952_DVS_980mV,
57 MAX8952_DVS_990mV,
58 MAX8952_DVS_1000mV,
59 MAX8952_DVS_1010mV,
60 MAX8952_DVS_1020mV,
61 MAX8952_DVS_1030mV,
62 MAX8952_DVS_1040mV,
63 MAX8952_DVS_1050mV,
64 MAX8952_DVS_1060mV,
65 MAX8952_DVS_1070mV,
66 MAX8952_DVS_1080mV,
67 MAX8952_DVS_1090mV,
68 MAX8952_DVS_1100mV,
69 MAX8952_DVS_1110mV,
70 MAX8952_DVS_1120mV,
71 MAX8952_DVS_1130mV,
72 MAX8952_DVS_1140mV,
73 MAX8952_DVS_1150mV,
74 MAX8952_DVS_1160mV,
75 MAX8952_DVS_1170mV,
76 MAX8952_DVS_1180mV,
77 MAX8952_DVS_1190mV,
78 MAX8952_DVS_1200mV,
79 MAX8952_DVS_1210mV,
80 MAX8952_DVS_1220mV,
81 MAX8952_DVS_1230mV,
82 MAX8952_DVS_1240mV,
83 MAX8952_DVS_1250mV,
84 MAX8952_DVS_1260mV,
85 MAX8952_DVS_1270mV,
86 MAX8952_DVS_1280mV,
87 MAX8952_DVS_1290mV,
88 MAX8952_DVS_1300mV,
89 MAX8952_DVS_1310mV,
90 MAX8952_DVS_1320mV,
91 MAX8952_DVS_1330mV,
92 MAX8952_DVS_1340mV,
93 MAX8952_DVS_1350mV,
94 MAX8952_DVS_1360mV,
95 MAX8952_DVS_1370mV,
96 MAX8952_DVS_1380mV,
97 MAX8952_DVS_1390mV,
98 MAX8952_DVS_1400mV,
99};
100
101enum {
102 MAX8952_SYNC_FREQ_26MHZ, /* Default */
103 MAX8952_SYNC_FREQ_13MHZ,
104 MAX8952_SYNC_FREQ_19_2MHZ,
105};
106
107enum {
108 MAX8952_RAMP_32mV_us = 0, /* Default */
109 MAX8952_RAMP_16mV_us,
110 MAX8952_RAMP_8mV_us,
111 MAX8952_RAMP_4mV_us,
112 MAX8952_RAMP_2mV_us,
113 MAX8952_RAMP_1mV_us,
114 MAX8952_RAMP_0_5mV_us,
115 MAX8952_RAMP_0_25mV_us,
116};
117
118#define MAX8952_NUM_DVS_MODE 4
119
120struct max8952_platform_data {
121 int gpio_vid0;
122 int gpio_vid1;
123 int gpio_en;
124
125 u8 default_mode;
126 u8 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */
127
128 u8 sync_freq;
129 u8 ramp_speed;
130
131 struct regulator_init_data reg_data;
132};
133
134
135#endif /* REGULATOR_MAX8952 */
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 91a4177e60c..5ca47e59b72 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -2072,6 +2072,8 @@ void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode);
2072void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs); 2072void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs);
2073int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); 2073int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
2074 2074
2075int __reiserfs_write_begin(struct page *page, unsigned from, unsigned len);
2076
2075/* namei.c */ 2077/* namei.c */
2076void set_de_name_and_namelen(struct reiserfs_dir_entry *de); 2078void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
2077int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, 2079int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 25b4f686d91..8d3a2486544 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -62,18 +62,6 @@ enum ring_buffer_type {
62unsigned ring_buffer_event_length(struct ring_buffer_event *event); 62unsigned ring_buffer_event_length(struct ring_buffer_event *event);
63void *ring_buffer_event_data(struct ring_buffer_event *event); 63void *ring_buffer_event_data(struct ring_buffer_event *event);
64 64
65/**
66 * ring_buffer_event_time_delta - return the delta timestamp of the event
67 * @event: the event to get the delta timestamp of
68 *
69 * The delta timestamp is the 27 bit timestamp since the last event.
70 */
71static inline unsigned
72ring_buffer_event_time_delta(struct ring_buffer_event *event)
73{
74 return event->time_delta;
75}
76
77/* 65/*
78 * ring_buffer_discard_commit will remove an event that has not 66 * ring_buffer_discard_commit will remove an event that has not
79 * ben committed yet. If this is used, then ring_buffer_unlock_commit 67 * ben committed yet. If this is used, then ring_buffer_unlock_commit
diff --git a/include/linux/rio.h b/include/linux/rio.h
index bd6eb0ed34a..0bed941f9b1 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -67,6 +67,7 @@
67#define RIO_PW_MSG_SIZE 64 67#define RIO_PW_MSG_SIZE 64
68 68
69extern struct bus_type rio_bus_type; 69extern struct bus_type rio_bus_type;
70extern struct device rio_bus;
70extern struct list_head rio_devices; /* list of all devices */ 71extern struct list_head rio_devices; /* list of all devices */
71 72
72struct rio_mport; 73struct rio_mport;
@@ -98,6 +99,7 @@ union rio_pw_msg;
98 * @riores: RIO resources this device owns 99 * @riores: RIO resources this device owns
99 * @pwcback: port-write callback function for this device 100 * @pwcback: port-write callback function for this device
100 * @destid: Network destination ID 101 * @destid: Network destination ID
102 * @prev: Previous RIO device connected to the current one
101 */ 103 */
102struct rio_dev { 104struct rio_dev {
103 struct list_head global_list; /* node in list of all RIO devices */ 105 struct list_head global_list; /* node in list of all RIO devices */
@@ -111,7 +113,7 @@ struct rio_dev {
111 u16 asm_rev; 113 u16 asm_rev;
112 u16 efptr; 114 u16 efptr;
113 u32 pef; 115 u32 pef;
114 u32 swpinfo; /* Only used for switches */ 116 u32 swpinfo;
115 u32 src_ops; 117 u32 src_ops;
116 u32 dst_ops; 118 u32 dst_ops;
117 u32 comp_tag; 119 u32 comp_tag;
@@ -124,6 +126,7 @@ struct rio_dev {
124 struct resource riores[RIO_MAX_DEV_RESOURCES]; 126 struct resource riores[RIO_MAX_DEV_RESOURCES];
125 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); 127 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
126 u16 destid; 128 u16 destid;
129 struct rio_dev *prev;
127}; 130};
128 131
129#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) 132#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
@@ -174,6 +177,7 @@ enum rio_phy_type {
174 * @index: Port index, unique among all port interfaces of the same type 177 * @index: Port index, unique among all port interfaces of the same type
175 * @sys_size: RapidIO common transport system size 178 * @sys_size: RapidIO common transport system size
176 * @phy_type: RapidIO phy type 179 * @phy_type: RapidIO phy type
180 * @phys_efptr: RIO port extended features pointer
177 * @name: Port name string 181 * @name: Port name string
178 * @priv: Master port private data 182 * @priv: Master port private data
179 */ 183 */
@@ -195,6 +199,7 @@ struct rio_mport {
195 * 1 - Large size, 65536 devices. 199 * 1 - Large size, 65536 devices.
196 */ 200 */
197 enum rio_phy_type phy_type; /* RapidIO phy type */ 201 enum rio_phy_type phy_type; /* RapidIO phy type */
202 u32 phys_efptr;
198 unsigned char name[40]; 203 unsigned char name[40];
199 void *priv; /* Master port private data */ 204 void *priv; /* Master port private data */
200}; 205};
@@ -215,9 +220,14 @@ struct rio_net {
215 unsigned char id; /* RIO network ID */ 220 unsigned char id; /* RIO network ID */
216}; 221};
217 222
223/* Definitions used by switch sysfs initialization callback */
224#define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */
225#define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */
226
218/** 227/**
219 * struct rio_switch - RIO switch info 228 * struct rio_switch - RIO switch info
220 * @node: Node in global list of switches 229 * @node: Node in global list of switches
230 * @rdev: Associated RIO device structure
221 * @switchid: Switch ID that is unique across a network 231 * @switchid: Switch ID that is unique across a network
222 * @hopcount: Hopcount to this switch 232 * @hopcount: Hopcount to this switch
223 * @destid: Associated destid in the path 233 * @destid: Associated destid in the path
@@ -230,9 +240,12 @@ struct rio_net {
230 * @get_domain: Callback for switch-specific domain get function 240 * @get_domain: Callback for switch-specific domain get function
231 * @em_init: Callback for switch-specific error management initialization function 241 * @em_init: Callback for switch-specific error management initialization function
232 * @em_handle: Callback for switch-specific error management handler function 242 * @em_handle: Callback for switch-specific error management handler function
243 * @sw_sysfs: Callback that initializes switch-specific sysfs attributes
244 * @nextdev: Array of per-port pointers to the next attached device
233 */ 245 */
234struct rio_switch { 246struct rio_switch {
235 struct list_head node; 247 struct list_head node;
248 struct rio_dev *rdev;
236 u16 switchid; 249 u16 switchid;
237 u16 hopcount; 250 u16 hopcount;
238 u16 destid; 251 u16 destid;
@@ -250,6 +263,8 @@ struct rio_switch {
250 u8 *sw_domain); 263 u8 *sw_domain);
251 int (*em_init) (struct rio_dev *dev); 264 int (*em_init) (struct rio_dev *dev);
252 int (*em_handle) (struct rio_dev *dev, u8 swport); 265 int (*em_handle) (struct rio_dev *dev, u8 swport);
266 int (*sw_sysfs) (struct rio_dev *dev, int create);
267 struct rio_dev *nextdev[0];
253}; 268};
254 269
255/* Low-level architecture-dependent routines */ 270/* Low-level architecture-dependent routines */
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
index db50e1c288b..ee7b6ada188 100644
--- a/include/linux/rio_ids.h
+++ b/include/linux/rio_ids.h
@@ -34,5 +34,7 @@
34#define RIO_DID_IDTCPS16 0x035b 34#define RIO_DID_IDTCPS16 0x035b
35#define RIO_DID_IDTCPS6Q 0x035f 35#define RIO_DID_IDTCPS6Q 0x035f
36#define RIO_DID_IDTCPS10Q 0x035e 36#define RIO_DID_IDTCPS10Q 0x035e
37#define RIO_DID_IDTCPS1848 0x0374
38#define RIO_DID_IDTCPS1616 0x0379
37 39
38#endif /* LINUX_RIO_IDS_H */ 40#endif /* LINUX_RIO_IDS_H */
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
index aedee0489fb..d63dcbaea16 100644
--- a/include/linux/rio_regs.h
+++ b/include/linux/rio_regs.h
@@ -33,6 +33,7 @@
33#define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */ 33#define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */
34#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */ 34#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */
35#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */ 35#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */
36#define RIO_PEF_MULTIPORT 0x08000000 /* [VI, 2.1] Multiport */
36#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */ 37#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */
37#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */ 38#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */
38#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */ 39#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */
@@ -51,6 +52,7 @@
51#define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */ 52#define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */
52#define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */ 53#define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */
53#define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8) 54#define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8)
55#define RIO_GET_PORT_NUM(x) (x & RIO_SWP_INFO_PORT_NUM_MASK)
54 56
55#define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */ 57#define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */
56#define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */ 58#define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */
@@ -159,6 +161,7 @@
159#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */ 161#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */
160 162
161#define RIO_STD_RTE_CONF_DESTID_SEL_CSR 0x70 163#define RIO_STD_RTE_CONF_DESTID_SEL_CSR 0x70
164#define RIO_STD_RTE_CONF_EXTCFGEN 0x80000000
162#define RIO_STD_RTE_CONF_PORT_SEL_CSR 0x74 165#define RIO_STD_RTE_CONF_PORT_SEL_CSR 0x74
163#define RIO_STD_RTE_DEFAULT_PORT 0x78 166#define RIO_STD_RTE_DEFAULT_PORT 0x78
164 167
@@ -222,15 +225,17 @@
222#define RIO_PORT_GEN_MASTER 0x40000000 225#define RIO_PORT_GEN_MASTER 0x40000000
223#define RIO_PORT_GEN_DISCOVERED 0x20000000 226#define RIO_PORT_GEN_DISCOVERED 0x20000000
224#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */ 227#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */
228#define RIO_MNT_REQ_CMD_RD 0x03 /* Reset-device command */
229#define RIO_MNT_REQ_CMD_IS 0x04 /* Input-status command */
225#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */ 230#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */
226#define RIO_PORT_N_MNT_RSP_RVAL 0x80000000 /* Response Valid */ 231#define RIO_PORT_N_MNT_RSP_RVAL 0x80000000 /* Response Valid */
227#define RIO_PORT_N_MNT_RSP_ASTAT 0x000003e0 /* ackID Status */ 232#define RIO_PORT_N_MNT_RSP_ASTAT 0x000007e0 /* ackID Status */
228#define RIO_PORT_N_MNT_RSP_LSTAT 0x0000001f /* Link Status */ 233#define RIO_PORT_N_MNT_RSP_LSTAT 0x0000001f /* Link Status */
229#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */ 234#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */
230#define RIO_PORT_N_ACK_CLEAR 0x80000000 235#define RIO_PORT_N_ACK_CLEAR 0x80000000
231#define RIO_PORT_N_ACK_INBOUND 0x1f000000 236#define RIO_PORT_N_ACK_INBOUND 0x3f000000
232#define RIO_PORT_N_ACK_OUTSTAND 0x00001f00 237#define RIO_PORT_N_ACK_OUTSTAND 0x00003f00
233#define RIO_PORT_N_ACK_OUTBOUND 0x0000001f 238#define RIO_PORT_N_ACK_OUTBOUND 0x0000003f
234#define RIO_PORT_N_ERR_STS_CSR(x) (0x0058 + x*0x20) 239#define RIO_PORT_N_ERR_STS_CSR(x) (0x0058 + x*0x20)
235#define RIO_PORT_N_ERR_STS_PW_OUT_ES 0x00010000 /* Output Error-stopped */ 240#define RIO_PORT_N_ERR_STS_PW_OUT_ES 0x00010000 /* Output Error-stopped */
236#define RIO_PORT_N_ERR_STS_PW_INP_ES 0x00000100 /* Input Error-stopped */ 241#define RIO_PORT_N_ERR_STS_PW_INP_ES 0x00000100 /* Input Error-stopped */
@@ -238,7 +243,6 @@
238#define RIO_PORT_N_ERR_STS_PORT_ERR 0x00000004 243#define RIO_PORT_N_ERR_STS_PORT_ERR 0x00000004
239#define RIO_PORT_N_ERR_STS_PORT_OK 0x00000002 244#define RIO_PORT_N_ERR_STS_PORT_OK 0x00000002
240#define RIO_PORT_N_ERR_STS_PORT_UNINIT 0x00000001 245#define RIO_PORT_N_ERR_STS_PORT_UNINIT 0x00000001
241#define RIO_PORT_N_ERR_STS_CLR_MASK 0x07120204
242#define RIO_PORT_N_CTL_CSR(x) (0x005c + x*0x20) 246#define RIO_PORT_N_CTL_CSR(x) (0x005c + x*0x20)
243#define RIO_PORT_N_CTL_PWIDTH 0xc0000000 247#define RIO_PORT_N_CTL_PWIDTH 0xc0000000
244#define RIO_PORT_N_CTL_PWIDTH_1 0x00000000 248#define RIO_PORT_N_CTL_PWIDTH_1 0x00000000
@@ -261,6 +265,10 @@
261#define RIO_EM_EFB_HEADER 0x000 /* Error Management Extensions Block Header */ 265#define RIO_EM_EFB_HEADER 0x000 /* Error Management Extensions Block Header */
262#define RIO_EM_LTL_ERR_DETECT 0x008 /* Logical/Transport Layer Error Detect CSR */ 266#define RIO_EM_LTL_ERR_DETECT 0x008 /* Logical/Transport Layer Error Detect CSR */
263#define RIO_EM_LTL_ERR_EN 0x00c /* Logical/Transport Layer Error Enable CSR */ 267#define RIO_EM_LTL_ERR_EN 0x00c /* Logical/Transport Layer Error Enable CSR */
268#define REM_LTL_ERR_ILLTRAN 0x08000000 /* Illegal Transaction decode */
269#define REM_LTL_ERR_UNSOLR 0x00800000 /* Unsolicited Response */
270#define REM_LTL_ERR_UNSUPTR 0x00400000 /* Unsupported Transaction */
271#define REM_LTL_ERR_IMPSPEC 0x000000ff /* Implementation Specific */
264#define RIO_EM_LTL_HIADDR_CAP 0x010 /* Logical/Transport Layer High Address Capture CSR */ 272#define RIO_EM_LTL_HIADDR_CAP 0x010 /* Logical/Transport Layer High Address Capture CSR */
265#define RIO_EM_LTL_ADDR_CAP 0x014 /* Logical/Transport Layer Address Capture CSR */ 273#define RIO_EM_LTL_ADDR_CAP 0x014 /* Logical/Transport Layer Address Capture CSR */
266#define RIO_EM_LTL_DEVID_CAP 0x018 /* Logical/Transport Layer Device ID Capture CSR */ 274#define RIO_EM_LTL_DEVID_CAP 0x018 /* Logical/Transport Layer Device ID Capture CSR */
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 31b2fd75dcb..bb83c0da207 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -25,8 +25,8 @@
25 * pointing to this anon_vma once its vma list is empty. 25 * pointing to this anon_vma once its vma list is empty.
26 */ 26 */
27struct anon_vma { 27struct anon_vma {
28 spinlock_t lock; /* Serialize access to vma list */
29 struct anon_vma *root; /* Root of this anon_vma tree */ 28 struct anon_vma *root; /* Root of this anon_vma tree */
29 spinlock_t lock; /* Serialize access to vma list */
30#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) 30#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION)
31 31
32 /* 32 /*
@@ -205,9 +205,20 @@ int try_to_unmap_one(struct page *, struct vm_area_struct *,
205/* 205/*
206 * Called from mm/filemap_xip.c to unmap empty zero page 206 * Called from mm/filemap_xip.c to unmap empty zero page
207 */ 207 */
208pte_t *page_check_address(struct page *, struct mm_struct *, 208pte_t *__page_check_address(struct page *, struct mm_struct *,
209 unsigned long, spinlock_t **, int); 209 unsigned long, spinlock_t **, int);
210 210
211static inline pte_t *page_check_address(struct page *page, struct mm_struct *mm,
212 unsigned long address,
213 spinlock_t **ptlp, int sync)
214{
215 pte_t *ptep;
216
217 __cond_lock(*ptlp, ptep = __page_check_address(page, mm, address,
218 ptlp, sync));
219 return ptep;
220}
221
211/* 222/*
212 * Used by swapoff to help locate where page is expected in vma. 223 * Used by swapoff to help locate where page is expected in vma.
213 */ 224 */
@@ -230,7 +241,20 @@ int try_to_munlock(struct page *);
230/* 241/*
231 * Called by memory-failure.c to kill processes. 242 * Called by memory-failure.c to kill processes.
232 */ 243 */
233struct anon_vma *page_lock_anon_vma(struct page *page); 244struct anon_vma *__page_lock_anon_vma(struct page *page);
245
246static inline struct anon_vma *page_lock_anon_vma(struct page *page)
247{
248 struct anon_vma *anon_vma;
249
250 __cond_lock(RCU, anon_vma = __page_lock_anon_vma(page));
251
252 /* (void) is needed to make gcc happy */
253 (void) __cond_lock(&anon_vma->root->lock, anon_vma);
254
255 return anon_vma;
256}
257
234void page_unlock_anon_vma(struct anon_vma *anon_vma); 258void page_unlock_anon_vma(struct anon_vma *anon_vma);
235int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); 259int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
236 260
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 58d44491880..d42f274418b 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -6,6 +6,7 @@
6#include <linux/if_link.h> 6#include <linux/if_link.h>
7#include <linux/if_addr.h> 7#include <linux/if_addr.h>
8#include <linux/neighbour.h> 8#include <linux/neighbour.h>
9#include <linux/netdevice.h>
9 10
10/* rtnetlink families. Values up to 127 are reserved for real address 11/* rtnetlink families. Values up to 127 are reserved for real address
11 * families, values above 128 may be used arbitrarily. 12 * families, values above 128 may be used arbitrarily.
@@ -749,6 +750,35 @@ extern int rtnl_is_locked(void);
749extern int lockdep_rtnl_is_held(void); 750extern int lockdep_rtnl_is_held(void);
750#endif /* #ifdef CONFIG_PROVE_LOCKING */ 751#endif /* #ifdef CONFIG_PROVE_LOCKING */
751 752
753/**
754 * rcu_dereference_rtnl - rcu_dereference with debug checking
755 * @p: The pointer to read, prior to dereferencing
756 *
757 * Do an rcu_dereference(p), but check caller either holds rcu_read_lock()
758 * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference()
759 */
760#define rcu_dereference_rtnl(p) \
761 rcu_dereference_check(p, rcu_read_lock_held() || \
762 lockdep_rtnl_is_held())
763
764/**
765 * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL
766 * @p: The pointer to read, prior to dereferencing
767 *
768 * Return the value of the specified RCU-protected pointer, but omit
769 * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because
770 * caller holds RTNL.
771 */
772#define rtnl_dereference(p) \
773 rcu_dereference_protected(p, lockdep_rtnl_is_held())
774
775static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev)
776{
777 return rtnl_dereference(dev->ingress_queue);
778}
779
780extern struct netdev_queue *dev_ingress_queue_create(struct net_device *dev);
781
752extern void rtnetlink_init(void); 782extern void rtnetlink_init(void);
753extern void __rtnl_unlock(void); 783extern void __rtnl_unlock(void);
754 784
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 56154bbb8da..d0036e52a24 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -626,6 +626,10 @@ struct signal_struct {
626 626
627 int oom_adj; /* OOM kill score adjustment (bit shift) */ 627 int oom_adj; /* OOM kill score adjustment (bit shift) */
628 int oom_score_adj; /* OOM kill score adjustment */ 628 int oom_score_adj; /* OOM kill score adjustment */
629
630 struct mutex cred_guard_mutex; /* guard against foreign influences on
631 * credential calculations
632 * (notably. ptrace) */
629}; 633};
630 634
631/* Context switch must be unlocked if interrupts are to be enabled */ 635/* Context switch must be unlocked if interrupts are to be enabled */
@@ -668,6 +672,9 @@ struct user_struct {
668 atomic_t inotify_watches; /* How many inotify watches does this user have? */ 672 atomic_t inotify_watches; /* How many inotify watches does this user have? */
669 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ 673 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */
670#endif 674#endif
675#ifdef CONFIG_FANOTIFY
676 atomic_t fanotify_listeners;
677#endif
671#ifdef CONFIG_EPOLL 678#ifdef CONFIG_EPOLL
672 atomic_t epoll_watches; /* The number of file descriptors currently watched */ 679 atomic_t epoll_watches; /* The number of file descriptors currently watched */
673#endif 680#endif
@@ -1076,7 +1083,7 @@ struct sched_class {
1076 struct task_struct *task); 1083 struct task_struct *task);
1077 1084
1078#ifdef CONFIG_FAIR_GROUP_SCHED 1085#ifdef CONFIG_FAIR_GROUP_SCHED
1079 void (*moved_group) (struct task_struct *p, int on_rq); 1086 void (*task_move_group) (struct task_struct *p, int on_rq);
1080#endif 1087#endif
1081}; 1088};
1082 1089
@@ -1305,9 +1312,6 @@ struct task_struct {
1305 * credentials (COW) */ 1312 * credentials (COW) */
1306 const struct cred __rcu *cred; /* effective (overridable) subjective task 1313 const struct cred __rcu *cred; /* effective (overridable) subjective task
1307 * credentials (COW) */ 1314 * credentials (COW) */
1308 struct mutex cred_guard_mutex; /* guard against foreign influences on
1309 * credential calculations
1310 * (notably. ptrace) */
1311 struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */ 1315 struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */
1312 1316
1313 char comm[TASK_COMM_LEN]; /* executable name excluding path 1317 char comm[TASK_COMM_LEN]; /* executable name excluding path
@@ -1706,7 +1710,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1706#define PF_DUMPCORE 0x00000200 /* dumped core */ 1710#define PF_DUMPCORE 0x00000200 /* dumped core */
1707#define PF_SIGNALED 0x00000400 /* killed by a signal */ 1711#define PF_SIGNALED 0x00000400 /* killed by a signal */
1708#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1712#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1709#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */
1710#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1713#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1711#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ 1714#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
1712#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1715#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
@@ -2237,9 +2240,16 @@ static inline void task_unlock(struct task_struct *p)
2237 spin_unlock(&p->alloc_lock); 2240 spin_unlock(&p->alloc_lock);
2238} 2241}
2239 2242
2240extern struct sighand_struct *lock_task_sighand(struct task_struct *tsk, 2243extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
2241 unsigned long *flags); 2244 unsigned long *flags);
2242 2245
2246#define lock_task_sighand(tsk, flags) \
2247({ struct sighand_struct *__ss; \
2248 __cond_lock(&(tsk)->sighand->siglock, \
2249 (__ss = __lock_task_sighand(tsk, flags))); \
2250 __ss; \
2251}) \
2252
2243static inline void unlock_task_sighand(struct task_struct *tsk, 2253static inline void unlock_task_sighand(struct task_struct *tsk,
2244 unsigned long *flags) 2254 unsigned long *flags)
2245{ 2255{
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h
index 5310d27abd2..39fa04966aa 100644
--- a/include/linux/semaphore.h
+++ b/include/linux/semaphore.h
@@ -29,9 +29,6 @@ struct semaphore {
29#define DEFINE_SEMAPHORE(name) \ 29#define DEFINE_SEMAPHORE(name) \
30 struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) 30 struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
31 31
32#define DECLARE_MUTEX(name) \
33 struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
34
35static inline void sema_init(struct semaphore *sem, int val) 32static inline void sema_init(struct semaphore *sem, int val)
36{ 33{
37 static struct lock_class_key __key; 34 static struct lock_class_key __key;
@@ -39,9 +36,6 @@ static inline void sema_init(struct semaphore *sem, int val)
39 lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); 36 lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0);
40} 37}
41 38
42#define init_MUTEX(sem) sema_init(sem, 1)
43#define init_MUTEX_LOCKED(sem) sema_init(sem, 0)
44
45extern void down(struct semaphore *sem); 39extern void down(struct semaphore *sem);
46extern int __must_check down_interruptible(struct semaphore *sem); 40extern int __must_check down_interruptible(struct semaphore *sem);
47extern int __must_check down_killable(struct semaphore *sem); 41extern int __must_check down_killable(struct semaphore *sem);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 99e5994e6f8..212eb4c6779 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -196,6 +196,9 @@
196/* High Speed UART for Medfield */ 196/* High Speed UART for Medfield */
197#define PORT_MFD 95 197#define PORT_MFD 95
198 198
199/* TI OMAP-UART */
200#define PORT_OMAP 96
201
199#ifdef __KERNEL__ 202#ifdef __KERNEL__
200 203
201#include <linux/compiler.h> 204#include <linux/compiler.h>
diff --git a/include/linux/serio.h b/include/linux/serio.h
index b5552568178..e26f4788845 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -41,7 +41,9 @@ struct serio {
41 int (*start)(struct serio *); 41 int (*start)(struct serio *);
42 void (*stop)(struct serio *); 42 void (*stop)(struct serio *);
43 43
44 struct serio *parent, *child; 44 struct serio *parent;
45 struct list_head child_node; /* Entry in parent->children list */
46 struct list_head children;
45 unsigned int depth; /* level of nesting in serio hierarchy */ 47 unsigned int depth; /* level of nesting in serio hierarchy */
46 48
47 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ 49 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
@@ -54,10 +56,9 @@ struct serio {
54#define to_serio_port(d) container_of(d, struct serio, dev) 56#define to_serio_port(d) container_of(d, struct serio, dev)
55 57
56struct serio_driver { 58struct serio_driver {
57 void *private; 59 const char *description;
58 char *description;
59 60
60 struct serio_device_id *id_table; 61 const struct serio_device_id *id_table;
61 bool manual_bind; 62 bool manual_bind;
62 63
63 void (*write_wakeup)(struct serio *); 64 void (*write_wakeup)(struct serio *);
@@ -197,5 +198,6 @@ static inline void serio_continue_rx(struct serio *serio)
197#define SERIO_W8001 0x39 198#define SERIO_W8001 0x39
198#define SERIO_DYNAPRO 0x3a 199#define SERIO_DYNAPRO 0x3a
199#define SERIO_HAMPSHIRE 0x3b 200#define SERIO_HAMPSHIRE 0x3b
201#define SERIO_PS2MULT 0x3c
200 202
201#endif 203#endif
diff --git a/include/linux/sfi.h b/include/linux/sfi.h
index 0299b4ce63d..7f770c638e9 100644
--- a/include/linux/sfi.h
+++ b/include/linux/sfi.h
@@ -70,9 +70,6 @@
70#define SFI_SIG_APIC "APIC" 70#define SFI_SIG_APIC "APIC"
71#define SFI_SIG_XSDT "XSDT" 71#define SFI_SIG_XSDT "XSDT"
72#define SFI_SIG_WAKE "WAKE" 72#define SFI_SIG_WAKE "WAKE"
73#define SFI_SIG_SPIB "SPIB"
74#define SFI_SIG_I2CB "I2CB"
75#define SFI_SIG_GPEM "GPEM"
76#define SFI_SIG_DEVS "DEVS" 73#define SFI_SIG_DEVS "DEVS"
77#define SFI_SIG_GPIO "GPIO" 74#define SFI_SIG_GPIO "GPIO"
78 75
@@ -168,27 +165,6 @@ struct sfi_gpio_table_entry {
168 char pin_name[16]; 165 char pin_name[16];
169} __packed; 166} __packed;
170 167
171struct sfi_spi_table_entry {
172 u16 host_num; /* attached to host 0, 1...*/
173 u16 cs; /* chip select */
174 u16 irq_info;
175 char name[16];
176 u8 dev_info[10];
177} __packed;
178
179struct sfi_i2c_table_entry {
180 u16 host_num;
181 u16 addr; /* slave addr */
182 u16 irq_info;
183 char name[16];
184 u8 dev_info[10];
185} __packed;
186
187struct sfi_gpe_table_entry {
188 u16 logical_id; /* logical id */
189 u16 phys_id; /* physical GPE id */
190} __packed;
191
192typedef int (*sfi_table_handler) (struct sfi_table_header *table); 168typedef int (*sfi_table_handler) (struct sfi_table_header *table);
193 169
194#ifdef CONFIG_SFI 170#ifdef CONFIG_SFI
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index 875ce50719a..4dca992f309 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -4,11 +4,20 @@
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/seq_file.h> 5#include <linux/seq_file.h>
6#include <linux/cpufreq.h> 6#include <linux/cpufreq.h>
7#include <linux/types.h>
8#include <linux/kref.h>
7#include <linux/clk.h> 9#include <linux/clk.h>
8#include <linux/err.h> 10#include <linux/err.h>
9 11
10struct clk; 12struct clk;
11 13
14struct clk_mapping {
15 phys_addr_t phys;
16 void __iomem *base;
17 unsigned long len;
18 struct kref ref;
19};
20
12struct clk_ops { 21struct clk_ops {
13 void (*init)(struct clk *clk); 22 void (*init)(struct clk *clk);
14 int (*enable)(struct clk *clk); 23 int (*enable)(struct clk *clk);
@@ -21,9 +30,6 @@ struct clk_ops {
21 30
22struct clk { 31struct clk {
23 struct list_head node; 32 struct list_head node;
24 const char *name;
25 int id;
26
27 struct clk *parent; 33 struct clk *parent;
28 struct clk **parent_table; /* list of parents to */ 34 struct clk **parent_table; /* list of parents to */
29 unsigned short parent_num; /* choose between */ 35 unsigned short parent_num; /* choose between */
@@ -45,7 +51,9 @@ struct clk {
45 unsigned long arch_flags; 51 unsigned long arch_flags;
46 void *priv; 52 void *priv;
47 struct dentry *dentry; 53 struct dentry *dentry;
54 struct clk_mapping *mapping;
48 struct cpufreq_frequency_table *freq_table; 55 struct cpufreq_frequency_table *freq_table;
56 unsigned int nr_freqs;
49}; 57};
50 58
51#define CLK_ENABLE_ON_INIT (1 << 0) 59#define CLK_ENABLE_ON_INIT (1 << 0)
@@ -111,6 +119,9 @@ int clk_rate_table_find(struct clk *clk,
111 struct cpufreq_frequency_table *freq_table, 119 struct cpufreq_frequency_table *freq_table,
112 unsigned long rate); 120 unsigned long rate);
113 121
122long clk_rate_div_range_round(struct clk *clk, unsigned int div_min,
123 unsigned int div_max, unsigned long rate);
124
114#define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ 125#define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \
115{ \ 126{ \
116 .parent = _parent, \ 127 .parent = _parent, \
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
index 0d6cd38e673..f656d1a43dc 100644
--- a/include/linux/sh_intc.h
+++ b/include/linux/sh_intc.h
@@ -20,6 +20,12 @@ struct intc_group {
20 20
21#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } } 21#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } }
22 22
23struct intc_subgroup {
24 unsigned long reg, reg_width;
25 intc_enum parent_id;
26 intc_enum enum_ids[32];
27};
28
23struct intc_mask_reg { 29struct intc_mask_reg {
24 unsigned long set_reg, clr_reg, reg_width; 30 unsigned long set_reg, clr_reg, reg_width;
25 intc_enum enum_ids[32]; 31 intc_enum enum_ids[32];
@@ -69,9 +75,12 @@ struct intc_hw_desc {
69 unsigned int nr_sense_regs; 75 unsigned int nr_sense_regs;
70 struct intc_mask_reg *ack_regs; 76 struct intc_mask_reg *ack_regs;
71 unsigned int nr_ack_regs; 77 unsigned int nr_ack_regs;
78 struct intc_subgroup *subgroups;
79 unsigned int nr_subgroups;
72}; 80};
73 81
74#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) 82#define _INTC_ARRAY(a) a, a == NULL ? 0 : sizeof(a)/sizeof(*a)
83
75#define INTC_HW_DESC(vectors, groups, mask_regs, \ 84#define INTC_HW_DESC(vectors, groups, mask_regs, \
76 prio_regs, sense_regs, ack_regs) \ 85 prio_regs, sense_regs, ack_regs) \
77{ \ 86{ \
@@ -105,8 +114,11 @@ struct intc_desc symbol __initdata = { \
105 prio_regs, sense_regs, ack_regs), \ 114 prio_regs, sense_regs, ack_regs), \
106} 115}
107 116
108int __init register_intc_controller(struct intc_desc *desc); 117int register_intc_controller(struct intc_desc *desc);
118void reserve_intc_vectors(struct intc_vect *vectors, unsigned int nr_vecs);
109int intc_set_priority(unsigned int irq, unsigned int prio); 119int intc_set_priority(unsigned int irq, unsigned int prio);
120int intc_irq_lookup(const char *chipname, intc_enum enum_id);
121void intc_finalize(void);
110 122
111#ifdef CONFIG_INTC_USERIMASK 123#ifdef CONFIG_INTC_USERIMASK
112int register_intc_userimask(unsigned long addr); 124int register_intc_userimask(unsigned long addr);
@@ -117,7 +129,4 @@ static inline int register_intc_userimask(unsigned long addr)
117} 129}
118#endif 130#endif
119 131
120int reserve_irq_vector(unsigned int irq);
121void reserve_irq_legacy(void);
122
123#endif /* __SH_INTC_H */ 132#endif /* __SH_INTC_H */
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
index 07c08af9f8f..30cae70874f 100644
--- a/include/linux/sh_pfc.h
+++ b/include/linux/sh_pfc.h
@@ -92,5 +92,6 @@ struct pinmux_info {
92}; 92};
93 93
94int register_pinmux(struct pinmux_info *pip); 94int register_pinmux(struct pinmux_info *pip);
95int unregister_pinmux(struct pinmux_info *pip);
95 96
96#endif /* __SH_PFC_H */ 97#endif /* __SH_PFC_H */
diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h
index b363b916c90..3ff4961da9b 100644
--- a/include/linux/signalfd.h
+++ b/include/linux/signalfd.h
@@ -33,6 +33,7 @@ struct signalfd_siginfo {
33 __u64 ssi_utime; 33 __u64 ssi_utime;
34 __u64 ssi_stime; 34 __u64 ssi_stime;
35 __u64 ssi_addr; 35 __u64 ssi_addr;
36 __u16 ssi_addr_lsb;
36 37
37 /* 38 /*
38 * Pad strcture to 128 bytes. Remember to update the 39 * Pad strcture to 128 bytes. Remember to update the
@@ -43,7 +44,7 @@ struct signalfd_siginfo {
43 * comes out of a read(2) and we really don't want to have 44 * comes out of a read(2) and we really don't want to have
44 * a compat on read(2). 45 * a compat on read(2).
45 */ 46 */
46 __u8 __pad[48]; 47 __u8 __pad[46];
47}; 48};
48 49
49 50
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 77eb60d2b49..e6ba898de61 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -129,8 +129,13 @@ typedef struct skb_frag_struct skb_frag_t;
129 129
130struct skb_frag_struct { 130struct skb_frag_struct {
131 struct page *page; 131 struct page *page;
132#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
132 __u32 page_offset; 133 __u32 page_offset;
133 __u32 size; 134 __u32 size;
135#else
136 __u16 page_offset;
137 __u16 size;
138#endif
134}; 139};
135 140
136#define HAVE_HW_TIME_STAMP 141#define HAVE_HW_TIME_STAMP
@@ -163,26 +168,19 @@ struct skb_shared_hwtstamps {
163 ktime_t syststamp; 168 ktime_t syststamp;
164}; 169};
165 170
166/** 171/* Definitions for tx_flags in struct skb_shared_info */
167 * struct skb_shared_tx - instructions for time stamping of outgoing packets 172enum {
168 * @hardware: generate hardware time stamp 173 /* generate hardware time stamp */
169 * @software: generate software time stamp 174 SKBTX_HW_TSTAMP = 1 << 0,
170 * @in_progress: device driver is going to provide 175
171 * hardware time stamp 176 /* generate software time stamp */
172 * @prevent_sk_orphan: make sk reference available on driver level 177 SKBTX_SW_TSTAMP = 1 << 1,
173 * @flags: all shared_tx flags 178
174 * 179 /* device driver is going to provide hardware time stamp */
175 * These flags are attached to packets as part of the 180 SKBTX_IN_PROGRESS = 1 << 2,
176 * &skb_shared_info. Use skb_tx() to get a pointer. 181
177 */ 182 /* ensure the originating sk reference is available on driver level */
178union skb_shared_tx { 183 SKBTX_DRV_NEEDS_SK_REF = 1 << 3,
179 struct {
180 __u8 hardware:1,
181 software:1,
182 in_progress:1,
183 prevent_sk_orphan:1;
184 };
185 __u8 flags;
186}; 184};
187 185
188/* This data is invariant across clones and lives at 186/* This data is invariant across clones and lives at
@@ -195,7 +193,7 @@ struct skb_shared_info {
195 unsigned short gso_segs; 193 unsigned short gso_segs;
196 unsigned short gso_type; 194 unsigned short gso_type;
197 __be32 ip6_frag_id; 195 __be32 ip6_frag_id;
198 union skb_shared_tx tx_flags; 196 __u8 tx_flags;
199 struct sk_buff *frag_list; 197 struct sk_buff *frag_list;
200 struct skb_shared_hwtstamps hwtstamps; 198 struct skb_shared_hwtstamps hwtstamps;
201 199
@@ -462,19 +460,7 @@ static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
462 skb->_skb_refdst = (unsigned long)dst; 460 skb->_skb_refdst = (unsigned long)dst;
463} 461}
464 462
465/** 463extern void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst);
466 * skb_dst_set_noref - sets skb dst, without a reference
467 * @skb: buffer
468 * @dst: dst entry
469 *
470 * Sets skb dst, assuming a reference was not taken on dst
471 * skb_dst_drop() should not dst_release() this dst
472 */
473static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst)
474{
475 WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
476 skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF;
477}
478 464
479/** 465/**
480 * skb_dst_is_noref - Test if skb dst isnt refcounted 466 * skb_dst_is_noref - Test if skb dst isnt refcounted
@@ -498,13 +484,13 @@ extern struct sk_buff *__alloc_skb(unsigned int size,
498static inline struct sk_buff *alloc_skb(unsigned int size, 484static inline struct sk_buff *alloc_skb(unsigned int size,
499 gfp_t priority) 485 gfp_t priority)
500{ 486{
501 return __alloc_skb(size, priority, 0, -1); 487 return __alloc_skb(size, priority, 0, NUMA_NO_NODE);
502} 488}
503 489
504static inline struct sk_buff *alloc_skb_fclone(unsigned int size, 490static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
505 gfp_t priority) 491 gfp_t priority)
506{ 492{
507 return __alloc_skb(size, priority, 1, -1); 493 return __alloc_skb(size, priority, 1, NUMA_NO_NODE);
508} 494}
509 495
510extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); 496extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);
@@ -558,6 +544,15 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
558 unsigned int to, struct ts_config *config, 544 unsigned int to, struct ts_config *config,
559 struct ts_state *state); 545 struct ts_state *state);
560 546
547extern __u32 __skb_get_rxhash(struct sk_buff *skb);
548static inline __u32 skb_get_rxhash(struct sk_buff *skb)
549{
550 if (!skb->rxhash)
551 skb->rxhash = __skb_get_rxhash(skb);
552
553 return skb->rxhash;
554}
555
561#ifdef NET_SKBUFF_DATA_USES_OFFSET 556#ifdef NET_SKBUFF_DATA_USES_OFFSET
562static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 557static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
563{ 558{
@@ -578,11 +573,6 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
578 return &skb_shinfo(skb)->hwtstamps; 573 return &skb_shinfo(skb)->hwtstamps;
579} 574}
580 575
581static inline union skb_shared_tx *skb_tx(struct sk_buff *skb)
582{
583 return &skb_shinfo(skb)->tx_flags;
584}
585
586/** 576/**
587 * skb_queue_empty - check if a queue is empty 577 * skb_queue_empty - check if a queue is empty
588 * @list: queue head 578 * @list: queue head
@@ -604,7 +594,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
604static inline bool skb_queue_is_last(const struct sk_buff_head *list, 594static inline bool skb_queue_is_last(const struct sk_buff_head *list,
605 const struct sk_buff *skb) 595 const struct sk_buff *skb)
606{ 596{
607 return (skb->next == (struct sk_buff *) list); 597 return skb->next == (struct sk_buff *)list;
608} 598}
609 599
610/** 600/**
@@ -617,7 +607,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
617static inline bool skb_queue_is_first(const struct sk_buff_head *list, 607static inline bool skb_queue_is_first(const struct sk_buff_head *list,
618 const struct sk_buff *skb) 608 const struct sk_buff *skb)
619{ 609{
620 return (skb->prev == (struct sk_buff *) list); 610 return skb->prev == (struct sk_buff *)list;
621} 611}
622 612
623/** 613/**
@@ -1123,7 +1113,7 @@ extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
1123 int off, int size); 1113 int off, int size);
1124 1114
1125#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) 1115#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
1126#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frags(skb)) 1116#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb))
1127#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) 1117#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb))
1128 1118
1129#ifdef NET_SKBUFF_DATA_USES_OFFSET 1119#ifdef NET_SKBUFF_DATA_USES_OFFSET
@@ -1561,13 +1551,25 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1561 return skb; 1551 return skb;
1562} 1552}
1563 1553
1564extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); 1554/**
1555 * __netdev_alloc_page - allocate a page for ps-rx on a specific device
1556 * @dev: network device to receive on
1557 * @gfp_mask: alloc_pages_node mask
1558 *
1559 * Allocate a new page. dev currently unused.
1560 *
1561 * %NULL is returned if there is no free memory.
1562 */
1563static inline struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask)
1564{
1565 return alloc_pages_node(NUMA_NO_NODE, gfp_mask, 0);
1566}
1565 1567
1566/** 1568/**
1567 * netdev_alloc_page - allocate a page for ps-rx on a specific device 1569 * netdev_alloc_page - allocate a page for ps-rx on a specific device
1568 * @dev: network device to receive on 1570 * @dev: network device to receive on
1569 * 1571 *
1570 * Allocate a new page node local to the specified device. 1572 * Allocate a new page. dev currently unused.
1571 * 1573 *
1572 * %NULL is returned if there is no free memory. 1574 * %NULL is returned if there is no free memory.
1573 */ 1575 */
@@ -1787,7 +1789,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
1787 skb = skb->prev) 1789 skb = skb->prev)
1788 1790
1789 1791
1790static inline bool skb_has_frags(const struct sk_buff *skb) 1792static inline bool skb_has_frag_list(const struct sk_buff *skb)
1791{ 1793{
1792 return skb_shinfo(skb)->frag_list != NULL; 1794 return skb_shinfo(skb)->frag_list != NULL;
1793} 1795}
@@ -1987,8 +1989,8 @@ extern void skb_tstamp_tx(struct sk_buff *orig_skb,
1987 1989
1988static inline void sw_tx_timestamp(struct sk_buff *skb) 1990static inline void sw_tx_timestamp(struct sk_buff *skb)
1989{ 1991{
1990 union skb_shared_tx *shtx = skb_tx(skb); 1992 if (skb_shinfo(skb)->tx_flags & SKBTX_SW_TSTAMP &&
1991 if (shtx->software && !shtx->in_progress) 1993 !(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS))
1992 skb_tstamp_tx(skb, NULL); 1994 skb_tstamp_tx(skb, NULL);
1993} 1995}
1994 1996
@@ -2159,7 +2161,7 @@ static inline u16 skb_get_rx_queue(const struct sk_buff *skb)
2159 2161
2160static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) 2162static inline bool skb_rx_queue_recorded(const struct sk_buff *skb)
2161{ 2163{
2162 return (skb->queue_mapping != 0); 2164 return skb->queue_mapping != 0;
2163} 2165}
2164 2166
2165extern u16 skb_tx_hash(const struct net_device *dev, 2167extern u16 skb_tx_hash(const struct net_device *dev,
@@ -2209,6 +2211,21 @@ static inline void skb_forward_csum(struct sk_buff *skb)
2209 skb->ip_summed = CHECKSUM_NONE; 2211 skb->ip_summed = CHECKSUM_NONE;
2210} 2212}
2211 2213
2214/**
2215 * skb_checksum_none_assert - make sure skb ip_summed is CHECKSUM_NONE
2216 * @skb: skb to check
2217 *
2218 * fresh skbs have their ip_summed set to CHECKSUM_NONE.
2219 * Instead of forcing ip_summed to CHECKSUM_NONE, we can
2220 * use this helper, to document places where we make this assertion.
2221 */
2222static inline void skb_checksum_none_assert(struct sk_buff *skb)
2223{
2224#ifdef DEBUG
2225 BUG_ON(skb->ip_summed != CHECKSUM_NONE);
2226#endif
2227}
2228
2212bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2229bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2213#endif /* __KERNEL__ */ 2230#endif /* __KERNEL__ */
2214#endif /* _LINUX_SKBUFF_H */ 2231#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 9f63538928c..e4f5ed180b9 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -87,7 +87,7 @@ struct kmem_cache {
87 unsigned long min_partial; 87 unsigned long min_partial;
88 const char *name; /* Name (only for display!) */ 88 const char *name; /* Name (only for display!) */
89 struct list_head list; /* List of slab caches */ 89 struct list_head list; /* List of slab caches */
90#ifdef CONFIG_SLUB_DEBUG 90#ifdef CONFIG_SYSFS
91 struct kobject kobj; /* For sysfs */ 91 struct kobject kobj; /* For sysfs */
92#endif 92#endif
93 93
@@ -96,11 +96,8 @@ struct kmem_cache {
96 * Defragmentation by allocating from a remote node. 96 * Defragmentation by allocating from a remote node.
97 */ 97 */
98 int remote_node_defrag_ratio; 98 int remote_node_defrag_ratio;
99 struct kmem_cache_node *node[MAX_NUMNODES];
100#else
101 /* Avoid an extra cache line for UP */
102 struct kmem_cache_node local_node;
103#endif 99#endif
100 struct kmem_cache_node *node[MAX_NUMNODES];
104}; 101};
105 102
106/* 103/*
@@ -139,19 +136,16 @@ struct kmem_cache {
139 136
140#ifdef CONFIG_ZONE_DMA 137#ifdef CONFIG_ZONE_DMA
141#define SLUB_DMA __GFP_DMA 138#define SLUB_DMA __GFP_DMA
142/* Reserve extra caches for potential DMA use */
143#define KMALLOC_CACHES (2 * SLUB_PAGE_SHIFT)
144#else 139#else
145/* Disable DMA functionality */ 140/* Disable DMA functionality */
146#define SLUB_DMA (__force gfp_t)0 141#define SLUB_DMA (__force gfp_t)0
147#define KMALLOC_CACHES SLUB_PAGE_SHIFT
148#endif 142#endif
149 143
150/* 144/*
151 * We keep the general caches in an array of slab caches that are used for 145 * We keep the general caches in an array of slab caches that are used for
152 * 2^x bytes of allocations. 146 * 2^x bytes of allocations.
153 */ 147 */
154extern struct kmem_cache kmalloc_caches[KMALLOC_CACHES]; 148extern struct kmem_cache *kmalloc_caches[SLUB_PAGE_SHIFT];
155 149
156/* 150/*
157 * Sorry that the following has to be that ugly but some versions of GCC 151 * Sorry that the following has to be that ugly but some versions of GCC
@@ -216,7 +210,7 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
216 if (index == 0) 210 if (index == 0)
217 return NULL; 211 return NULL;
218 212
219 return &kmalloc_caches[index]; 213 return kmalloc_caches[index];
220} 214}
221 215
222void *kmem_cache_alloc(struct kmem_cache *, gfp_t); 216void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
diff --git a/include/linux/smb.h b/include/linux/smb.h
deleted file mode 100644
index 82fefddc598..00000000000
--- a/include/linux/smb.h
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * smb.h
3 *
4 * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_H
10#define _LINUX_SMB_H
11
12#include <linux/types.h>
13#include <linux/magic.h>
14#ifdef __KERNEL__
15#include <linux/time.h>
16#endif
17
18enum smb_protocol {
19 SMB_PROTOCOL_NONE,
20 SMB_PROTOCOL_CORE,
21 SMB_PROTOCOL_COREPLUS,
22 SMB_PROTOCOL_LANMAN1,
23 SMB_PROTOCOL_LANMAN2,
24 SMB_PROTOCOL_NT1
25};
26
27enum smb_case_hndl {
28 SMB_CASE_DEFAULT,
29 SMB_CASE_LOWER,
30 SMB_CASE_UPPER
31};
32
33struct smb_dskattr {
34 __u16 total;
35 __u16 allocblocks;
36 __u16 blocksize;
37 __u16 free;
38};
39
40struct smb_conn_opt {
41
42 /* The socket */
43 unsigned int fd;
44
45 enum smb_protocol protocol;
46 enum smb_case_hndl case_handling;
47
48 /* Connection-Options */
49
50 __u32 max_xmit;
51 __u16 server_uid;
52 __u16 tid;
53
54 /* The following are LANMAN 1.0 options */
55 __u16 secmode;
56 __u16 maxmux;
57 __u16 maxvcs;
58 __u16 rawmode;
59 __u32 sesskey;
60
61 /* The following are NT LM 0.12 options */
62 __u32 maxraw;
63 __u32 capabilities;
64 __s16 serverzone;
65};
66
67#ifdef __KERNEL__
68
69#define SMB_NLS_MAXNAMELEN 20
70struct smb_nls_codepage {
71 char local_name[SMB_NLS_MAXNAMELEN];
72 char remote_name[SMB_NLS_MAXNAMELEN];
73};
74
75
76#define SMB_MAXNAMELEN 255
77#define SMB_MAXPATHLEN 1024
78
79/*
80 * Contains all relevant data on a SMB networked file.
81 */
82struct smb_fattr {
83 __u16 attr;
84
85 unsigned long f_ino;
86 umode_t f_mode;
87 nlink_t f_nlink;
88 uid_t f_uid;
89 gid_t f_gid;
90 dev_t f_rdev;
91 loff_t f_size;
92 struct timespec f_atime;
93 struct timespec f_mtime;
94 struct timespec f_ctime;
95 unsigned long f_blocks;
96 int f_unix;
97};
98
99enum smb_conn_state {
100 CONN_VALID, /* everything's fine */
101 CONN_INVALID, /* Something went wrong, but did not
102 try to reconnect yet. */
103 CONN_RETRIED, /* Tried a reconnection, but was refused */
104 CONN_RETRYING /* Currently trying to reconnect */
105};
106
107#define SMB_HEADER_LEN 37 /* includes everything up to, but not
108 * including smb_bcc */
109
110#define SMB_INITIAL_PACKET_SIZE 4000
111#define SMB_MAX_PACKET_SIZE 32768
112
113/* reserve this much space for trans2 parameters. Shouldn't have to be more
114 than 10 or so, but OS/2 seems happier like this. */
115#define SMB_TRANS2_MAX_PARAM 64
116
117#endif
118#endif
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
deleted file mode 100644
index 923cd8a247b..00000000000
--- a/include/linux/smb_fs.h
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * smb_fs.h
3 *
4 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_FS_H
10#define _LINUX_SMB_FS_H
11
12#include <linux/smb.h>
13
14/*
15 * ioctl commands
16 */
17#define SMB_IOC_GETMOUNTUID _IOR('u', 1, __kernel_old_uid_t)
18#define SMB_IOC_NEWCONN _IOW('u', 2, struct smb_conn_opt)
19
20/* __kernel_uid_t can never change, so we have to use __kernel_uid32_t */
21#define SMB_IOC_GETMOUNTUID32 _IOR('u', 3, __kernel_uid32_t)
22
23
24#ifdef __KERNEL__
25#include <linux/smb_fs_i.h>
26#include <linux/smb_fs_sb.h>
27
28#include <linux/fs.h>
29#include <linux/pagemap.h>
30#include <linux/vmalloc.h>
31#include <linux/smb_mount.h>
32#include <linux/jiffies.h>
33#include <asm/unaligned.h>
34
35static inline struct smb_sb_info *SMB_SB(struct super_block *sb)
36{
37 return sb->s_fs_info;
38}
39
40static inline struct smb_inode_info *SMB_I(struct inode *inode)
41{
42 return container_of(inode, struct smb_inode_info, vfs_inode);
43}
44
45/* macro names are short for word, double-word, long value (?) */
46#define WVAL(buf, pos) (get_unaligned_le16((u8 *)(buf) + (pos)))
47#define DVAL(buf, pos) (get_unaligned_le32((u8 *)(buf) + (pos)))
48#define LVAL(buf, pos) (get_unaligned_le64((u8 *)(buf) + (pos)))
49
50#define WSET(buf, pos, val) put_unaligned_le16((val), (u8 *)(buf) + (pos))
51#define DSET(buf, pos, val) put_unaligned_le32((val), (u8 *)(buf) + (pos))
52#define LSET(buf, pos, val) put_unaligned_le64((val), (u8 *)(buf) + (pos))
53
54/* where to find the base of the SMB packet proper */
55#define smb_base(buf) ((u8 *)(((u8 *)(buf))+4))
56
57/*
58 * Flags for the in-memory inode
59 */
60#define SMB_F_LOCALWRITE 0x02 /* file modified locally */
61
62
63/* NT1 protocol capability bits */
64#define SMB_CAP_RAW_MODE 0x00000001
65#define SMB_CAP_MPX_MODE 0x00000002
66#define SMB_CAP_UNICODE 0x00000004
67#define SMB_CAP_LARGE_FILES 0x00000008
68#define SMB_CAP_NT_SMBS 0x00000010
69#define SMB_CAP_RPC_REMOTE_APIS 0x00000020
70#define SMB_CAP_STATUS32 0x00000040
71#define SMB_CAP_LEVEL_II_OPLOCKS 0x00000080
72#define SMB_CAP_LOCK_AND_READ 0x00000100
73#define SMB_CAP_NT_FIND 0x00000200
74#define SMB_CAP_DFS 0x00001000
75#define SMB_CAP_LARGE_READX 0x00004000
76#define SMB_CAP_LARGE_WRITEX 0x00008000
77#define SMB_CAP_UNIX 0x00800000 /* unofficial ... */
78
79
80/*
81 * This is the time we allow an inode, dentry or dir cache to live. It is bad
82 * for performance to have shorter ttl on an inode than on the cache. It can
83 * cause refresh on each inode for a dir listing ... one-by-one
84 */
85#define SMB_MAX_AGE(server) (((server)->mnt->ttl * HZ) / 1000)
86
87static inline void
88smb_age_dentry(struct smb_sb_info *server, struct dentry *dentry)
89{
90 dentry->d_time = jiffies - SMB_MAX_AGE(server);
91}
92
93struct smb_cache_head {
94 time_t mtime; /* unused */
95 unsigned long time; /* cache age */
96 unsigned long end; /* last valid fpos in cache */
97 int eof;
98};
99
100#define SMB_DIRCACHE_SIZE ((int)(PAGE_CACHE_SIZE/sizeof(struct dentry *)))
101union smb_dir_cache {
102 struct smb_cache_head head;
103 struct dentry *dentry[SMB_DIRCACHE_SIZE];
104};
105
106#define SMB_FIRSTCACHE_SIZE ((int)((SMB_DIRCACHE_SIZE * \
107 sizeof(struct dentry *) - sizeof(struct smb_cache_head)) / \
108 sizeof(struct dentry *)))
109
110#define SMB_DIRCACHE_START (SMB_DIRCACHE_SIZE - SMB_FIRSTCACHE_SIZE)
111
112struct smb_cache_control {
113 struct smb_cache_head head;
114 struct page *page;
115 union smb_dir_cache *cache;
116 unsigned long fpos, ofs;
117 int filled, valid, idx;
118};
119
120#define SMB_OPS_NUM_STATIC 5
121struct smb_ops {
122 int (*read)(struct inode *inode, loff_t offset, int count,
123 char *data);
124 int (*write)(struct inode *inode, loff_t offset, int count, const
125 char *data);
126 int (*readdir)(struct file *filp, void *dirent, filldir_t filldir,
127 struct smb_cache_control *ctl);
128
129 int (*getattr)(struct smb_sb_info *server, struct dentry *dir,
130 struct smb_fattr *fattr);
131 /* int (*setattr)(...); */ /* setattr is really icky! */
132
133 int (*truncate)(struct inode *inode, loff_t length);
134
135
136 /* --- --- --- end of "static" entries --- --- --- */
137
138 int (*convert)(unsigned char *output, int olen,
139 const unsigned char *input, int ilen,
140 struct nls_table *nls_from,
141 struct nls_table *nls_to);
142};
143
144static inline int
145smb_is_open(struct inode *i)
146{
147 return (SMB_I(i)->open == server_from_inode(i)->generation);
148}
149
150extern void smb_install_null_ops(struct smb_ops *);
151#endif /* __KERNEL__ */
152
153#endif /* _LINUX_SMB_FS_H */
diff --git a/include/linux/smb_fs_i.h b/include/linux/smb_fs_i.h
deleted file mode 100644
index 8ccf4eca2c3..00000000000
--- a/include/linux/smb_fs_i.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * smb_fs_i.h
3 *
4 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_FS_I
10#define _LINUX_SMB_FS_I
11
12#include <linux/types.h>
13#include <linux/fs.h>
14
15/*
16 * smb fs inode data (in memory only)
17 */
18struct smb_inode_info {
19
20 /*
21 * file handles are local to a connection. A file is open if
22 * (open == generation).
23 */
24 unsigned int open; /* open generation */
25 __u16 fileid; /* What id to handle a file with? */
26 __u16 attr; /* Attribute fields, DOS value */
27
28 __u16 access; /* Access mode */
29 __u16 flags;
30 unsigned long oldmtime; /* last time refreshed */
31 unsigned long closed; /* timestamp when closed */
32 unsigned openers; /* number of fileid users */
33
34 struct inode vfs_inode; /* must be at the end */
35};
36
37#endif
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
deleted file mode 100644
index bb947dd1fba..00000000000
--- a/include/linux/smb_fs_sb.h
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 * smb_fs_sb.h
3 *
4 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _SMB_FS_SB
10#define _SMB_FS_SB
11
12#include <linux/types.h>
13#include <linux/backing-dev.h>
14#include <linux/smb.h>
15
16/*
17 * Upper limit on the total number of active smb_request structs.
18 */
19#define MAX_REQUEST_HARD 256
20
21enum smb_receive_state {
22 SMB_RECV_START, /* No data read, looking for length + sig */
23 SMB_RECV_HEADER, /* Reading the header data */
24 SMB_RECV_HCOMPLETE, /* Done with the header */
25 SMB_RECV_PARAM, /* Reading parameter words */
26 SMB_RECV_DATA, /* Reading data bytes */
27 SMB_RECV_END, /* End of request */
28 SMB_RECV_DROP, /* Dropping this SMB */
29 SMB_RECV_REQUEST, /* Received a request and not a reply */
30};
31
32/* structure access macros */
33#define server_from_inode(inode) SMB_SB((inode)->i_sb)
34#define server_from_dentry(dentry) SMB_SB((dentry)->d_sb)
35#define SB_of(server) ((server)->super_block)
36
37struct smb_sb_info {
38 /* List of all smbfs superblocks */
39 struct list_head entry;
40
41 enum smb_conn_state state;
42 struct file * sock_file;
43 int conn_error;
44 enum smb_receive_state rstate;
45
46 atomic_t nr_requests;
47 struct list_head xmitq;
48 struct list_head recvq;
49 u16 mid;
50
51 struct smb_mount_data_kernel *mnt;
52
53 /* Connections are counted. Each time a new socket arrives,
54 * generation is incremented.
55 */
56 unsigned int generation;
57 struct pid *conn_pid;
58 struct smb_conn_opt opt;
59 wait_queue_head_t conn_wq;
60 int conn_complete;
61 struct semaphore sem;
62
63 unsigned char header[SMB_HEADER_LEN + 20*2 + 2];
64 u32 header_len;
65 u32 smb_len;
66 u32 smb_read;
67
68 /* We use our own data_ready callback, but need the original one */
69 void *data_ready;
70
71 /* nls pointers for codepage conversions */
72 struct nls_table *remote_nls;
73 struct nls_table *local_nls;
74
75 struct smb_ops *ops;
76
77 struct super_block *super_block;
78
79 struct backing_dev_info bdi;
80};
81
82static inline int
83smb_lock_server_interruptible(struct smb_sb_info *server)
84{
85 return down_interruptible(&(server->sem));
86}
87
88static inline void
89smb_lock_server(struct smb_sb_info *server)
90{
91 down(&(server->sem));
92}
93
94static inline void
95smb_unlock_server(struct smb_sb_info *server)
96{
97 up(&(server->sem));
98}
99
100#endif
diff --git a/include/linux/smb_mount.h b/include/linux/smb_mount.h
deleted file mode 100644
index d10f00cb570..00000000000
--- a/include/linux/smb_mount.h
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * smb_mount.h
3 *
4 * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 */
8
9#ifndef _LINUX_SMB_MOUNT_H
10#define _LINUX_SMB_MOUNT_H
11
12#include <linux/types.h>
13
14#define SMB_MOUNT_VERSION 6
15
16struct smb_mount_data {
17 int version;
18 __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */
19 __kernel_uid_t uid;
20 __kernel_gid_t gid;
21 __kernel_mode_t file_mode;
22 __kernel_mode_t dir_mode;
23};
24
25
26#ifdef __KERNEL__
27
28/* "vers" in big-endian */
29#define SMB_MOUNT_ASCII 0x76657273
30
31#define SMB_MOUNT_OLDVERSION 6
32#undef SMB_MOUNT_VERSION
33#define SMB_MOUNT_VERSION 7
34
35/* flags */
36#define SMB_MOUNT_WIN95 0x0001 /* Win 95 server */
37#define SMB_MOUNT_OLDATTR 0x0002 /* Use core getattr (Win 95 speedup) */
38#define SMB_MOUNT_DIRATTR 0x0004 /* Use find_first for getattr */
39#define SMB_MOUNT_CASE 0x0008 /* Be case sensitive */
40#define SMB_MOUNT_UNICODE 0x0010 /* Server talks unicode */
41#define SMB_MOUNT_UID 0x0020 /* Use user specified uid */
42#define SMB_MOUNT_GID 0x0040 /* Use user specified gid */
43#define SMB_MOUNT_FMODE 0x0080 /* Use user specified file mode */
44#define SMB_MOUNT_DMODE 0x0100 /* Use user specified dir mode */
45
46struct smb_mount_data_kernel {
47 int version;
48
49 uid_t mounted_uid; /* Who may umount() this filesystem? */
50 uid_t uid;
51 gid_t gid;
52 mode_t file_mode;
53 mode_t dir_mode;
54
55 u32 flags;
56
57 /* maximum age in jiffies (inode, dentry and dircache) */
58 int ttl;
59
60 struct smb_nls_codepage codepage;
61};
62
63#endif
64
65#endif
diff --git a/include/linux/smbno.h b/include/linux/smbno.h
deleted file mode 100644
index f99e02d9ffe..00000000000
--- a/include/linux/smbno.h
+++ /dev/null
@@ -1,363 +0,0 @@
1#ifndef _SMBNO_H_
2#define _SMBNO_H_
3
4/* these define the attribute byte as seen by DOS */
5#define aRONLY (1L<<0)
6#define aHIDDEN (1L<<1)
7#define aSYSTEM (1L<<2)
8#define aVOLID (1L<<3)
9#define aDIR (1L<<4)
10#define aARCH (1L<<5)
11
12/* error classes */
13#define SUCCESS 0 /* The request was successful. */
14#define ERRDOS 0x01 /* Error is from the core DOS operating system set. */
15#define ERRSRV 0x02 /* Error is generated by the server network file manager.*/
16#define ERRHRD 0x03 /* Error is an hardware error. */
17#define ERRCMD 0xFF /* Command was not in the "SMB" format. */
18
19/* SMB X/Open error codes for the ERRdos error class */
20
21#define ERRbadfunc 1 /* Invalid function (or system call) */
22#define ERRbadfile 2 /* File not found (pathname error) */
23#define ERRbadpath 3 /* Directory not found */
24#define ERRnofids 4 /* Too many open files */
25#define ERRnoaccess 5 /* Access denied */
26#define ERRbadfid 6 /* Invalid fid */
27#define ERRbadmcb 7 /* Memory control blocks destroyed */
28#define ERRnomem 8 /* Out of memory */
29#define ERRbadmem 9 /* Invalid memory block address */
30#define ERRbadenv 10 /* Invalid environment */
31#define ERRbadformat 11 /* Invalid format */
32#define ERRbadaccess 12 /* Invalid open mode */
33#define ERRbaddata 13 /* Invalid data (only from ioctl call) */
34#define ERRres 14 /* reserved */
35#define ERRbaddrive 15 /* Invalid drive */
36#define ERRremcd 16 /* Attempt to delete current directory */
37#define ERRdiffdevice 17 /* rename/move across different filesystems */
38#define ERRnofiles 18 /* no more files found in file search */
39#define ERRbadshare 32 /* Share mode on file conflict with open mode */
40#define ERRlock 33 /* Lock request conflicts with existing lock */
41#define ERRfilexists 80 /* File in operation already exists */
42#define ERRbadpipe 230 /* Named pipe invalid */
43#define ERRpipebusy 231 /* All instances of pipe are busy */
44#define ERRpipeclosing 232 /* named pipe close in progress */
45#define ERRnotconnected 233 /* No process on other end of named pipe */
46#define ERRmoredata 234 /* More data to be returned */
47
48#define ERROR_INVALID_PARAMETER 87
49#define ERROR_DISK_FULL 112
50#define ERROR_INVALID_NAME 123
51#define ERROR_DIR_NOT_EMPTY 145
52#define ERROR_NOT_LOCKED 158
53#define ERROR_ALREADY_EXISTS 183 /* see also 80 ? */
54#define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */
55#define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not supported */
56
57/* Error codes for the ERRSRV class */
58
59#define ERRerror 1 /* Non specific error code */
60#define ERRbadpw 2 /* Bad password */
61#define ERRbadtype 3 /* reserved */
62#define ERRaccess 4 /* No permissions to do the requested operation */
63#define ERRinvnid 5 /* tid invalid */
64#define ERRinvnetname 6 /* Invalid servername */
65#define ERRinvdevice 7 /* Invalid device */
66#define ERRqfull 49 /* Print queue full */
67#define ERRqtoobig 50 /* Queued item too big */
68#define ERRinvpfid 52 /* Invalid print file in smb_fid */
69#define ERRsmbcmd 64 /* Unrecognised command */
70#define ERRsrverror 65 /* smb server internal error */
71#define ERRfilespecs 67 /* fid and pathname invalid combination */
72#define ERRbadlink 68 /* reserved */
73#define ERRbadpermits 69 /* Access specified for a file is not valid */
74#define ERRbadpid 70 /* reserved */
75#define ERRsetattrmode 71 /* attribute mode invalid */
76#define ERRpaused 81 /* Message server paused */
77#define ERRmsgoff 82 /* Not receiving messages */
78#define ERRnoroom 83 /* No room for message */
79#define ERRrmuns 87 /* too many remote usernames */
80#define ERRtimeout 88 /* operation timed out */
81#define ERRnoresource 89 /* No resources currently available for request. */
82#define ERRtoomanyuids 90 /* too many userids */
83#define ERRbaduid 91 /* bad userid */
84#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
85#define ERRuseSTD 251 /* temporarily unable to use raw mode, use std.mode */
86#define ERRcontMPX 252 /* resume MPX mode */
87#define ERRbadPW /* reserved */
88#define ERRnosupport 0xFFFF
89
90/* Error codes for the ERRHRD class */
91
92#define ERRnowrite 19 /* read only media */
93#define ERRbadunit 20 /* Unknown device */
94#define ERRnotready 21 /* Drive not ready */
95#define ERRbadcmd 22 /* Unknown command */
96#define ERRdata 23 /* Data (CRC) error */
97#define ERRbadreq 24 /* Bad request structure length */
98#define ERRseek 25
99#define ERRbadmedia 26
100#define ERRbadsector 27
101#define ERRnopaper 28
102#define ERRwrite 29 /* write fault */
103#define ERRread 30 /* read fault */
104#define ERRgeneral 31 /* General hardware failure */
105#define ERRwrongdisk 34
106#define ERRFCBunavail 35
107#define ERRsharebufexc 36 /* share buffer exceeded */
108#define ERRdiskfull 39
109
110/*
111 * Access modes when opening a file
112 */
113#define SMB_ACCMASK 0x0003
114#define SMB_O_RDONLY 0x0000
115#define SMB_O_WRONLY 0x0001
116#define SMB_O_RDWR 0x0002
117
118/* offsets into message for common items */
119#define smb_com 8
120#define smb_rcls 9
121#define smb_reh 10
122#define smb_err 11
123#define smb_flg 13
124#define smb_flg2 14
125#define smb_reb 13
126#define smb_tid 28
127#define smb_pid 30
128#define smb_uid 32
129#define smb_mid 34
130#define smb_wct 36
131#define smb_vwv 37
132#define smb_vwv0 37
133#define smb_vwv1 39
134#define smb_vwv2 41
135#define smb_vwv3 43
136#define smb_vwv4 45
137#define smb_vwv5 47
138#define smb_vwv6 49
139#define smb_vwv7 51
140#define smb_vwv8 53
141#define smb_vwv9 55
142#define smb_vwv10 57
143#define smb_vwv11 59
144#define smb_vwv12 61
145#define smb_vwv13 63
146#define smb_vwv14 65
147
148/* these are the trans2 sub fields for primary requests */
149#define smb_tpscnt smb_vwv0
150#define smb_tdscnt smb_vwv1
151#define smb_mprcnt smb_vwv2
152#define smb_mdrcnt smb_vwv3
153#define smb_msrcnt smb_vwv4
154#define smb_flags smb_vwv5
155#define smb_timeout smb_vwv6
156#define smb_pscnt smb_vwv9
157#define smb_psoff smb_vwv10
158#define smb_dscnt smb_vwv11
159#define smb_dsoff smb_vwv12
160#define smb_suwcnt smb_vwv13
161#define smb_setup smb_vwv14
162#define smb_setup0 smb_setup
163#define smb_setup1 (smb_setup+2)
164#define smb_setup2 (smb_setup+4)
165
166/* these are for the secondary requests */
167#define smb_spscnt smb_vwv2
168#define smb_spsoff smb_vwv3
169#define smb_spsdisp smb_vwv4
170#define smb_sdscnt smb_vwv5
171#define smb_sdsoff smb_vwv6
172#define smb_sdsdisp smb_vwv7
173#define smb_sfid smb_vwv8
174
175/* and these for responses */
176#define smb_tprcnt smb_vwv0
177#define smb_tdrcnt smb_vwv1
178#define smb_prcnt smb_vwv3
179#define smb_proff smb_vwv4
180#define smb_prdisp smb_vwv5
181#define smb_drcnt smb_vwv6
182#define smb_droff smb_vwv7
183#define smb_drdisp smb_vwv8
184
185/* the complete */
186#define SMBmkdir 0x00 /* create directory */
187#define SMBrmdir 0x01 /* delete directory */
188#define SMBopen 0x02 /* open file */
189#define SMBcreate 0x03 /* create file */
190#define SMBclose 0x04 /* close file */
191#define SMBflush 0x05 /* flush file */
192#define SMBunlink 0x06 /* delete file */
193#define SMBmv 0x07 /* rename file */
194#define SMBgetatr 0x08 /* get file attributes */
195#define SMBsetatr 0x09 /* set file attributes */
196#define SMBread 0x0A /* read from file */
197#define SMBwrite 0x0B /* write to file */
198#define SMBlock 0x0C /* lock byte range */
199#define SMBunlock 0x0D /* unlock byte range */
200#define SMBctemp 0x0E /* create temporary file */
201#define SMBmknew 0x0F /* make new file */
202#define SMBchkpth 0x10 /* check directory path */
203#define SMBexit 0x11 /* process exit */
204#define SMBlseek 0x12 /* seek */
205#define SMBtcon 0x70 /* tree connect */
206#define SMBtconX 0x75 /* tree connect and X*/
207#define SMBtdis 0x71 /* tree disconnect */
208#define SMBnegprot 0x72 /* negotiate protocol */
209#define SMBdskattr 0x80 /* get disk attributes */
210#define SMBsearch 0x81 /* search directory */
211#define SMBsplopen 0xC0 /* open print spool file */
212#define SMBsplwr 0xC1 /* write to print spool file */
213#define SMBsplclose 0xC2 /* close print spool file */
214#define SMBsplretq 0xC3 /* return print queue */
215#define SMBsends 0xD0 /* send single block message */
216#define SMBsendb 0xD1 /* send broadcast message */
217#define SMBfwdname 0xD2 /* forward user name */
218#define SMBcancelf 0xD3 /* cancel forward */
219#define SMBgetmac 0xD4 /* get machine name */
220#define SMBsendstrt 0xD5 /* send start of multi-block message */
221#define SMBsendend 0xD6 /* send end of multi-block message */
222#define SMBsendtxt 0xD7 /* send text of multi-block message */
223
224/* Core+ protocol */
225#define SMBlockread 0x13 /* Lock a range and read */
226#define SMBwriteunlock 0x14 /* Unlock a range then write */
227#define SMBreadbraw 0x1a /* read a block of data with no smb header */
228#define SMBwritebraw 0x1d /* write a block of data with no smb header */
229#define SMBwritec 0x20 /* secondary write request */
230#define SMBwriteclose 0x2c /* write a file then close it */
231
232/* dos extended protocol */
233#define SMBreadBraw 0x1A /* read block raw */
234#define SMBreadBmpx 0x1B /* read block multiplexed */
235#define SMBreadBs 0x1C /* read block (secondary response) */
236#define SMBwriteBraw 0x1D /* write block raw */
237#define SMBwriteBmpx 0x1E /* write block multiplexed */
238#define SMBwriteBs 0x1F /* write block (secondary request) */
239#define SMBwriteC 0x20 /* write complete response */
240#define SMBsetattrE 0x22 /* set file attributes expanded */
241#define SMBgetattrE 0x23 /* get file attributes expanded */
242#define SMBlockingX 0x24 /* lock/unlock byte ranges and X */
243#define SMBtrans 0x25 /* transaction - name, bytes in/out */
244#define SMBtranss 0x26 /* transaction (secondary request/response) */
245#define SMBioctl 0x27 /* IOCTL */
246#define SMBioctls 0x28 /* IOCTL (secondary request/response) */
247#define SMBcopy 0x29 /* copy */
248#define SMBmove 0x2A /* move */
249#define SMBecho 0x2B /* echo */
250#define SMBopenX 0x2D /* open and X */
251#define SMBreadX 0x2E /* read and X */
252#define SMBwriteX 0x2F /* write and X */
253#define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */
254#define SMBtconX 0x75 /* tree connect and X */
255#define SMBffirst 0x82 /* find first */
256#define SMBfunique 0x83 /* find unique */
257#define SMBfclose 0x84 /* find close */
258#define SMBinvalid 0xFE /* invalid command */
259
260
261/* Extended 2.0 protocol */
262#define SMBtrans2 0x32 /* TRANS2 protocol set */
263#define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */
264#define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */
265#define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */
266#define SMBulogoffX 0x74 /* user logoff */
267
268/* these are the TRANS2 sub commands */
269#define TRANSACT2_OPEN 0
270#define TRANSACT2_FINDFIRST 1
271#define TRANSACT2_FINDNEXT 2
272#define TRANSACT2_QFSINFO 3
273#define TRANSACT2_SETFSINFO 4
274#define TRANSACT2_QPATHINFO 5
275#define TRANSACT2_SETPATHINFO 6
276#define TRANSACT2_QFILEINFO 7
277#define TRANSACT2_SETFILEINFO 8
278#define TRANSACT2_FSCTL 9
279#define TRANSACT2_IOCTL 10
280#define TRANSACT2_FINDNOTIFYFIRST 11
281#define TRANSACT2_FINDNOTIFYNEXT 12
282#define TRANSACT2_MKDIR 13
283
284/* Information Levels - Shared? */
285#define SMB_INFO_STANDARD 1
286#define SMB_INFO_QUERY_EA_SIZE 2
287#define SMB_INFO_QUERY_EAS_FROM_LIST 3
288#define SMB_INFO_QUERY_ALL_EAS 4
289#define SMB_INFO_IS_NAME_VALID 6
290
291/* Information Levels - TRANSACT2_FINDFIRST */
292#define SMB_FIND_FILE_DIRECTORY_INFO 0x101
293#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
294#define SMB_FIND_FILE_NAMES_INFO 0x103
295#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
296
297/* Information Levels - TRANSACT2_QPATHINFO */
298#define SMB_QUERY_FILE_BASIC_INFO 0x101
299#define SMB_QUERY_FILE_STANDARD_INFO 0x102
300#define SMB_QUERY_FILE_EA_INFO 0x103
301#define SMB_QUERY_FILE_NAME_INFO 0x104
302#define SMB_QUERY_FILE_ALL_INFO 0x107
303#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
304#define SMB_QUERY_FILE_STREAM_INFO 0x109
305#define SMB_QUERY_FILE_COMPRESSION_INFO 0x10b
306
307/* Information Levels - TRANSACT2_SETFILEINFO */
308#define SMB_SET_FILE_BASIC_INFO 0x101
309#define SMB_SET_FILE_DISPOSITION_INFO 0x102
310#define SMB_SET_FILE_ALLOCATION_INFO 0x103
311#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
312
313/* smb_flg field flags */
314#define SMB_FLAGS_SUPPORT_LOCKREAD 0x01
315#define SMB_FLAGS_CLIENT_BUF_AVAIL 0x02
316#define SMB_FLAGS_RESERVED 0x04
317#define SMB_FLAGS_CASELESS_PATHNAMES 0x08
318#define SMB_FLAGS_CANONICAL_PATHNAMES 0x10
319#define SMB_FLAGS_REQUEST_OPLOCK 0x20
320#define SMB_FLAGS_REQUEST_BATCH_OPLOCK 0x40
321#define SMB_FLAGS_REPLY 0x80
322
323/* smb_flg2 field flags (samba-2.2.0/source/include/smb.h) */
324#define SMB_FLAGS2_LONG_PATH_COMPONENTS 0x0001
325#define SMB_FLAGS2_EXTENDED_ATTRIBUTES 0x0002
326#define SMB_FLAGS2_DFS_PATHNAMES 0x1000
327#define SMB_FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000
328#define SMB_FLAGS2_32_BIT_ERROR_CODES 0x4000
329#define SMB_FLAGS2_UNICODE_STRINGS 0x8000
330
331
332/*
333 * UNIX stuff (from samba trans2.h)
334 */
335#define MIN_UNIX_INFO_LEVEL 0x200
336#define MAX_UNIX_INFO_LEVEL 0x2FF
337#define SMB_FIND_FILE_UNIX 0x202
338#define SMB_QUERY_FILE_UNIX_BASIC 0x200
339#define SMB_QUERY_FILE_UNIX_LINK 0x201
340#define SMB_QUERY_FILE_UNIX_HLINK 0x202
341#define SMB_SET_FILE_UNIX_BASIC 0x200
342#define SMB_SET_FILE_UNIX_LINK 0x201
343#define SMB_SET_FILE_UNIX_HLINK 0x203
344#define SMB_QUERY_CIFS_UNIX_INFO 0x200
345
346/* values which means "don't change it" */
347#define SMB_MODE_NO_CHANGE 0xFFFFFFFF
348#define SMB_UID_NO_CHANGE 0xFFFFFFFF
349#define SMB_GID_NO_CHANGE 0xFFFFFFFF
350#define SMB_TIME_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
351#define SMB_SIZE_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL
352
353/* UNIX filetype mappings. */
354#define UNIX_TYPE_FILE 0
355#define UNIX_TYPE_DIR 1
356#define UNIX_TYPE_SYMLINK 2
357#define UNIX_TYPE_CHARDEV 3
358#define UNIX_TYPE_BLKDEV 4
359#define UNIX_TYPE_FIFO 5
360#define UNIX_TYPE_SOCKET 6
361#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF
362
363#endif /* _SMBNO_H_ */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index cfa2d20e35f..6dc95cac6b3 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -13,9 +13,10 @@
13 13
14extern void cpu_idle(void); 14extern void cpu_idle(void);
15 15
16typedef void (*smp_call_func_t)(void *info);
16struct call_single_data { 17struct call_single_data {
17 struct list_head list; 18 struct list_head list;
18 void (*func) (void *info); 19 smp_call_func_t func;
19 void *info; 20 void *info;
20 u16 flags; 21 u16 flags;
21 u16 priv; 22 u16 priv;
@@ -24,8 +25,8 @@ struct call_single_data {
24/* total number of cpus in this system (may exceed NR_CPUS) */ 25/* total number of cpus in this system (may exceed NR_CPUS) */
25extern unsigned int total_cpus; 26extern unsigned int total_cpus;
26 27
27int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, 28int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
28 int wait); 29 int wait);
29 30
30#ifdef CONFIG_SMP 31#ifdef CONFIG_SMP
31 32
@@ -69,15 +70,15 @@ extern void smp_cpus_done(unsigned int max_cpus);
69/* 70/*
70 * Call a function on all other processors 71 * Call a function on all other processors
71 */ 72 */
72int smp_call_function(void(*func)(void *info), void *info, int wait); 73int smp_call_function(smp_call_func_t func, void *info, int wait);
73void smp_call_function_many(const struct cpumask *mask, 74void smp_call_function_many(const struct cpumask *mask,
74 void (*func)(void *info), void *info, bool wait); 75 smp_call_func_t func, void *info, bool wait);
75 76
76void __smp_call_function_single(int cpuid, struct call_single_data *data, 77void __smp_call_function_single(int cpuid, struct call_single_data *data,
77 int wait); 78 int wait);
78 79
79int smp_call_function_any(const struct cpumask *mask, 80int smp_call_function_any(const struct cpumask *mask,
80 void (*func)(void *info), void *info, int wait); 81 smp_call_func_t func, void *info, int wait);
81 82
82/* 83/*
83 * Generic and arch helpers 84 * Generic and arch helpers
@@ -94,7 +95,7 @@ void ipi_call_unlock_irq(void);
94/* 95/*
95 * Call a function on all processors 96 * Call a function on all processors
96 */ 97 */
97int on_each_cpu(void (*func) (void *info), void *info, int wait); 98int on_each_cpu(smp_call_func_t func, void *info, int wait);
98 99
99#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ 100#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */
100#define MSG_ALL 0x8001 101#define MSG_ALL 0x8001
@@ -122,7 +123,7 @@ static inline void smp_send_stop(void) { }
122 * These macros fold the SMP functionality into a single CPU system 123 * These macros fold the SMP functionality into a single CPU system
123 */ 124 */
124#define raw_smp_processor_id() 0 125#define raw_smp_processor_id() 0
125static inline int up_smp_call_function(void (*func)(void *), void *info) 126static inline int up_smp_call_function(smp_call_func_t func, void *info)
126{ 127{
127 return 0; 128 return 0;
128} 129}
@@ -143,7 +144,7 @@ static inline void smp_send_reschedule(int cpu) { }
143static inline void init_call_single_data(void) { } 144static inline void init_call_single_data(void) { }
144 145
145static inline int 146static inline int
146smp_call_function_any(const struct cpumask *mask, void (*func)(void *info), 147smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
147 void *info, int wait) 148 void *info, int wait)
148{ 149{
149 return smp_call_function_single(0, func, info, wait); 150 return smp_call_function_single(0, func, info, wait);
diff --git a/include/linux/socket.h b/include/linux/socket.h
index a8f56e1ec76..86b652fabf6 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -322,11 +322,10 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
322 int offset, 322 int offset,
323 unsigned int len, __wsum *csump); 323 unsigned int len, __wsum *csump);
324 324
325extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); 325extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);
326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 326extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, 327extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
328 int offset, int len); 328 int offset, int len);
329extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, int __user *ulen);
330extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); 329extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr);
331extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); 330extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
332 331
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h
new file mode 100644
index 00000000000..d85c52f294a
--- /dev/null
+++ b/include/linux/spi/74x164.h
@@ -0,0 +1,11 @@
1#ifndef LINUX_SPI_74X164_H
2#define LINUX_SPI_74X164_H
3
4#define GEN_74X164_DRIVER_NAME "74x164"
5
6struct gen_74x164_chip_platform_data {
7 /* number assigned to the first GPIO */
8 unsigned base;
9};
10
11#endif
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 92e52a1e6af..b4d7710bc38 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -204,6 +204,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
204/** 204/**
205 * struct spi_master - interface to SPI master controller 205 * struct spi_master - interface to SPI master controller
206 * @dev: device interface to this driver 206 * @dev: device interface to this driver
207 * @list: link with the global spi_master list
207 * @bus_num: board-specific (and often SOC-specific) identifier for a 208 * @bus_num: board-specific (and often SOC-specific) identifier for a
208 * given SPI controller. 209 * given SPI controller.
209 * @num_chipselect: chipselects are used to distinguish individual 210 * @num_chipselect: chipselects are used to distinguish individual
@@ -238,6 +239,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
238struct spi_master { 239struct spi_master {
239 struct device dev; 240 struct device dev;
240 241
242 struct list_head list;
243
241 /* other than negative (== assign one dynamically), bus_num is fully 244 /* other than negative (== assign one dynamically), bus_num is fully
242 * board-specific. usually that simplifies to being SOC-specific. 245 * board-specific. usually that simplifies to being SOC-specific.
243 * example: one SOC has three SPI controllers, numbered 0..2, 246 * example: one SOC has three SPI controllers, numbered 0..2,
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index a6d5225b927..11daf9c140e 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -97,6 +97,7 @@
97#define SSB_TMSLOW_RESET 0x00000001 /* Reset */ 97#define SSB_TMSLOW_RESET 0x00000001 /* Reset */
98#define SSB_TMSLOW_REJECT_22 0x00000002 /* Reject (Backplane rev 2.2) */ 98#define SSB_TMSLOW_REJECT_22 0x00000002 /* Reject (Backplane rev 2.2) */
99#define SSB_TMSLOW_REJECT_23 0x00000004 /* Reject (Backplane rev 2.3) */ 99#define SSB_TMSLOW_REJECT_23 0x00000004 /* Reject (Backplane rev 2.3) */
100#define SSB_TMSLOW_PHYCLK 0x00000010 /* MAC PHY Clock Control Enable */
100#define SSB_TMSLOW_CLOCK 0x00010000 /* Clock Enable */ 101#define SSB_TMSLOW_CLOCK 0x00010000 /* Clock Enable */
101#define SSB_TMSLOW_FGC 0x00020000 /* Force Gated Clocks On */ 102#define SSB_TMSLOW_FGC 0x00020000 /* Force Gated Clocks On */
102#define SSB_TMSLOW_PE 0x40000000 /* Power Management Enable */ 103#define SSB_TMSLOW_PE 0x40000000 /* Power Management Enable */
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 632ff7c0328..d66c61774d9 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -32,10 +32,14 @@
32struct plat_stmmacenet_data { 32struct plat_stmmacenet_data {
33 int bus_id; 33 int bus_id;
34 int pbl; 34 int pbl;
35 int clk_csr;
35 int has_gmac; 36 int has_gmac;
36 int enh_desc; 37 int enh_desc;
38 int tx_coe;
39 int bugged_jumbo;
40 int pmt;
37 void (*fix_mac_speed)(void *priv, unsigned int speed); 41 void (*fix_mac_speed)(void *priv, unsigned int speed);
38 void (*bus_setup)(unsigned long ioaddr); 42 void (*bus_setup)(void __iomem *ioaddr);
39#ifdef CONFIG_STM_DRIVERS 43#ifdef CONFIG_STM_DRIVERS
40 struct stm_pad_config *pad_config; 44 struct stm_pad_config *pad_config;
41#endif 45#endif
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 5bbc447175d..b2024757edd 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -122,8 +122,8 @@ extern const struct rpc_authops authnull_ops;
122int __init rpc_init_authunix(void); 122int __init rpc_init_authunix(void);
123int __init rpc_init_generic_auth(void); 123int __init rpc_init_generic_auth(void);
124int __init rpcauth_init_module(void); 124int __init rpcauth_init_module(void);
125void __exit rpcauth_remove_module(void); 125void rpcauth_remove_module(void);
126void __exit rpc_destroy_generic_auth(void); 126void rpc_destroy_generic_auth(void);
127void rpc_destroy_authunix(void); 127void rpc_destroy_authunix(void);
128 128
129struct rpc_cred * rpc_lookup_cred(void); 129struct rpc_cred * rpc_lookup_cred(void);
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 7bf3e84b92f..6950c981882 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -125,12 +125,15 @@ struct cache_detail {
125 */ 125 */
126struct cache_req { 126struct cache_req {
127 struct cache_deferred_req *(*defer)(struct cache_req *req); 127 struct cache_deferred_req *(*defer)(struct cache_req *req);
128 int thread_wait; /* How long (jiffies) we can block the
129 * current thread to wait for updates.
130 */
128}; 131};
129/* this must be embedded in a deferred_request that is being 132/* this must be embedded in a deferred_request that is being
130 * delayed awaiting cache-fill 133 * delayed awaiting cache-fill
131 */ 134 */
132struct cache_deferred_req { 135struct cache_deferred_req {
133 struct list_head hash; /* on hash chain */ 136 struct hlist_node hash; /* on hash chain */
134 struct list_head recent; /* on fifo */ 137 struct list_head recent; /* on fifo */
135 struct cache_head *item; /* cache item we wait on */ 138 struct cache_head *item; /* cache item we wait on */
136 void *owner; /* we might need to discard all defered requests 139 void *owner; /* we might need to discard all defered requests
@@ -194,7 +197,9 @@ extern void cache_purge(struct cache_detail *detail);
194#define NEVER (0x7FFFFFFF) 197#define NEVER (0x7FFFFFFF)
195extern void __init cache_initialize(void); 198extern void __init cache_initialize(void);
196extern int cache_register(struct cache_detail *cd); 199extern int cache_register(struct cache_detail *cd);
200extern int cache_register_net(struct cache_detail *cd, struct net *net);
197extern void cache_unregister(struct cache_detail *cd); 201extern void cache_unregister(struct cache_detail *cd);
202extern void cache_unregister_net(struct cache_detail *cd, struct net *net);
198 203
199extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, 204extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *,
200 mode_t, struct cache_detail *); 205 mode_t, struct cache_detail *);
@@ -218,14 +223,42 @@ static inline int get_int(char **bpp, int *anint)
218 return 0; 223 return 0;
219} 224}
220 225
226/*
227 * timestamps kept in the cache are expressed in seconds
228 * since boot. This is the best for measuring differences in
229 * real time.
230 */
231static inline time_t seconds_since_boot(void)
232{
233 struct timespec boot;
234 getboottime(&boot);
235 return get_seconds() - boot.tv_sec;
236}
237
238static inline time_t convert_to_wallclock(time_t sinceboot)
239{
240 struct timespec boot;
241 getboottime(&boot);
242 return boot.tv_sec + sinceboot;
243}
244
221static inline time_t get_expiry(char **bpp) 245static inline time_t get_expiry(char **bpp)
222{ 246{
223 int rv; 247 int rv;
248 struct timespec boot;
249
224 if (get_int(bpp, &rv)) 250 if (get_int(bpp, &rv))
225 return 0; 251 return 0;
226 if (rv < 0) 252 if (rv < 0)
227 return 0; 253 return 0;
228 return rv; 254 getboottime(&boot);
255 return rv - boot.tv_sec;
229} 256}
230 257
258static inline void sunrpc_invalidate(struct cache_head *h,
259 struct cache_detail *detail)
260{
261 h->expiry_time = seconds_since_boot() - 1;
262 detail->nextcheck = seconds_since_boot();
263}
231#endif /* _LINUX_SUNRPC_CACHE_H_ */ 264#endif /* _LINUX_SUNRPC_CACHE_H_ */
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 85f38a63f09..a5a55f284b7 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -102,6 +102,7 @@ struct rpc_procinfo {
102#ifdef __KERNEL__ 102#ifdef __KERNEL__
103 103
104struct rpc_create_args { 104struct rpc_create_args {
105 struct net *net;
105 int protocol; 106 int protocol;
106 struct sockaddr *address; 107 struct sockaddr *address;
107 size_t addrsize; 108 size_t addrsize;
@@ -137,7 +138,6 @@ int rpcb_register(u32, u32, int, unsigned short);
137int rpcb_v4_register(const u32 program, const u32 version, 138int rpcb_v4_register(const u32 program, const u32 version,
138 const struct sockaddr *address, 139 const struct sockaddr *address,
139 const char *netid); 140 const char *netid);
140int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int);
141void rpcb_getport_async(struct rpc_task *); 141void rpcb_getport_async(struct rpc_task *);
142 142
143void rpc_call_start(struct rpc_task *); 143void rpc_call_start(struct rpc_task *);
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h
deleted file mode 100644
index e3e6a3437f8..00000000000
--- a/include/linux/sunrpc/gss_spkm3.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * linux/include/linux/sunrpc/gss_spkm3.h
3 *
4 * Copyright (c) 2000 The Regents of the University of Michigan.
5 * All rights reserved.
6 *
7 * Andy Adamson <andros@umich.edu>
8 */
9
10#include <linux/sunrpc/auth_gss.h>
11#include <linux/sunrpc/gss_err.h>
12#include <linux/sunrpc/gss_asn1.h>
13
14struct spkm3_ctx {
15 struct xdr_netobj ctx_id; /* per message context id */
16 int endtime; /* endtime of the context */
17 struct xdr_netobj mech_used;
18 unsigned int ret_flags ;
19 struct xdr_netobj conf_alg;
20 struct xdr_netobj derived_conf_key;
21 struct xdr_netobj intg_alg;
22 struct xdr_netobj derived_integ_key;
23};
24
25/* OIDs declarations for K-ALG, I-ALG, C-ALG, and OWF-ALG */
26extern const struct xdr_netobj hmac_md5_oid;
27extern const struct xdr_netobj cast5_cbc_oid;
28
29/* SPKM InnerContext Token types */
30
31#define SPKM_ERROR_TOK 3
32#define SPKM_MIC_TOK 4
33#define SPKM_WRAP_TOK 5
34#define SPKM_DEL_TOK 6
35
36u32 spkm3_make_token(struct spkm3_ctx *ctx, struct xdr_buf * text, struct xdr_netobj * token, int toktype);
37
38u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int toktype);
39
40#define CKSUMTYPE_RSA_MD5 0x0007
41#define CKSUMTYPE_HMAC_MD5 0x0008
42
43s32 make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header,
44 unsigned int hdrlen, struct xdr_buf *body,
45 unsigned int body_offset, struct xdr_netobj *cksum);
46void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits);
47int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen,
48 int explen);
49void spkm3_mic_header(unsigned char **hdrbuf, unsigned int *hdrlen,
50 unsigned char *ctxhdr, int elen, int zbit);
51void spkm3_make_mic_token(unsigned char **tokp, int toklen,
52 struct xdr_netobj *mic_hdr,
53 struct xdr_netobj *md5cksum, int md5elen, int md5zbit);
54u32 spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen,
55 unsigned char **cksum);
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h
index 5fa0f208430..680471d1f28 100644
--- a/include/linux/sunrpc/stats.h
+++ b/include/linux/sunrpc/stats.h
@@ -38,8 +38,21 @@ struct svc_stat {
38 rpcbadclnt; 38 rpcbadclnt;
39}; 39};
40 40
41void rpc_proc_init(void); 41struct net;
42void rpc_proc_exit(void); 42#ifdef CONFIG_PROC_FS
43int rpc_proc_init(struct net *);
44void rpc_proc_exit(struct net *);
45#else
46static inline int rpc_proc_init(struct net *net)
47{
48 return 0;
49}
50
51static inline void rpc_proc_exit(struct net *net)
52{
53}
54#endif
55
43#ifdef MODULE 56#ifdef MODULE
44void rpc_modcount(struct inode *, int); 57void rpc_modcount(struct inode *, int);
45#endif 58#endif
@@ -54,9 +67,6 @@ void svc_proc_unregister(const char *);
54 67
55void svc_seq_show(struct seq_file *, 68void svc_seq_show(struct seq_file *,
56 const struct svc_stat *); 69 const struct svc_stat *);
57
58extern struct proc_dir_entry *proc_net_rpc;
59
60#else 70#else
61 71
62static inline struct proc_dir_entry *rpc_proc_register(struct rpc_stat *s) { return NULL; } 72static inline struct proc_dir_entry *rpc_proc_register(struct rpc_stat *s) { return NULL; }
@@ -69,9 +79,6 @@ static inline void svc_proc_unregister(const char *p) {}
69 79
70static inline void svc_seq_show(struct seq_file *seq, 80static inline void svc_seq_show(struct seq_file *seq,
71 const struct svc_stat *st) {} 81 const struct svc_stat *st) {}
72
73#define proc_net_rpc NULL
74
75#endif 82#endif
76 83
77#endif /* _LINUX_SUNRPC_STATS_H */ 84#endif /* _LINUX_SUNRPC_STATS_H */
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 5f4e18b3ce7..bbdb680ffbe 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -12,6 +12,7 @@
12 12
13struct svc_xprt_ops { 13struct svc_xprt_ops {
14 struct svc_xprt *(*xpo_create)(struct svc_serv *, 14 struct svc_xprt *(*xpo_create)(struct svc_serv *,
15 struct net *net,
15 struct sockaddr *, int, 16 struct sockaddr *, int,
16 int); 17 int);
17 struct svc_xprt *(*xpo_accept)(struct svc_xprt *); 18 struct svc_xprt *(*xpo_accept)(struct svc_xprt *);
@@ -32,6 +33,16 @@ struct svc_xprt_class {
32 u32 xcl_max_payload; 33 u32 xcl_max_payload;
33}; 34};
34 35
36/*
37 * This is embedded in an object that wants a callback before deleting
38 * an xprt; intended for use by NFSv4.1, which needs to know when a
39 * client's tcp connection (and hence possibly a backchannel) goes away.
40 */
41struct svc_xpt_user {
42 struct list_head list;
43 void (*callback)(struct svc_xpt_user *);
44};
45
35struct svc_xprt { 46struct svc_xprt {
36 struct svc_xprt_class *xpt_class; 47 struct svc_xprt_class *xpt_class;
37 struct svc_xprt_ops *xpt_ops; 48 struct svc_xprt_ops *xpt_ops;
@@ -66,14 +77,31 @@ struct svc_xprt {
66 struct sockaddr_storage xpt_remote; /* remote peer's address */ 77 struct sockaddr_storage xpt_remote; /* remote peer's address */
67 size_t xpt_remotelen; /* length of address */ 78 size_t xpt_remotelen; /* length of address */
68 struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */ 79 struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */
80 struct list_head xpt_users; /* callbacks on free */
81
82 struct net *xpt_net;
69}; 83};
70 84
85static inline void register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
86{
87 spin_lock(&xpt->xpt_lock);
88 list_add(&u->list, &xpt->xpt_users);
89 spin_unlock(&xpt->xpt_lock);
90}
91
92static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
93{
94 spin_lock(&xpt->xpt_lock);
95 list_del_init(&u->list);
96 spin_unlock(&xpt->xpt_lock);
97}
98
71int svc_reg_xprt_class(struct svc_xprt_class *); 99int svc_reg_xprt_class(struct svc_xprt_class *);
72void svc_unreg_xprt_class(struct svc_xprt_class *); 100void svc_unreg_xprt_class(struct svc_xprt_class *);
73void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *, 101void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *,
74 struct svc_serv *); 102 struct svc_serv *);
75int svc_create_xprt(struct svc_serv *, const char *, const int, 103int svc_create_xprt(struct svc_serv *, const char *, struct net *,
76 const unsigned short, int); 104 const int, const unsigned short, int);
77void svc_xprt_enqueue(struct svc_xprt *xprt); 105void svc_xprt_enqueue(struct svc_xprt *xprt);
78void svc_xprt_received(struct svc_xprt *); 106void svc_xprt_received(struct svc_xprt *);
79void svc_xprt_put(struct svc_xprt *xprt); 107void svc_xprt_put(struct svc_xprt *xprt);
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index d39dbdc7b10..25d333c1b57 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -108,10 +108,15 @@ struct auth_ops {
108#define SVC_NEGATIVE 4 108#define SVC_NEGATIVE 4
109#define SVC_OK 5 109#define SVC_OK 5
110#define SVC_DROP 6 110#define SVC_DROP 6
111#define SVC_DENIED 7 111#define SVC_CLOSE 7 /* Like SVC_DROP, but request is definitely
112#define SVC_PENDING 8 112 * lost so if there is a tcp connection, it
113#define SVC_COMPLETE 9 113 * should be closed
114 */
115#define SVC_DENIED 8
116#define SVC_PENDING 9
117#define SVC_COMPLETE 10
114 118
119struct svc_xprt;
115 120
116extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp); 121extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp);
117extern int svc_authorise(struct svc_rqst *rqstp); 122extern int svc_authorise(struct svc_rqst *rqstp);
@@ -121,13 +126,13 @@ extern void svc_auth_unregister(rpc_authflavor_t flavor);
121 126
122extern struct auth_domain *unix_domain_find(char *name); 127extern struct auth_domain *unix_domain_find(char *name);
123extern void auth_domain_put(struct auth_domain *item); 128extern void auth_domain_put(struct auth_domain *item);
124extern int auth_unix_add_addr(struct in6_addr *addr, struct auth_domain *dom); 129extern int auth_unix_add_addr(struct net *net, struct in6_addr *addr, struct auth_domain *dom);
125extern struct auth_domain *auth_domain_lookup(char *name, struct auth_domain *new); 130extern struct auth_domain *auth_domain_lookup(char *name, struct auth_domain *new);
126extern struct auth_domain *auth_domain_find(char *name); 131extern struct auth_domain *auth_domain_find(char *name);
127extern struct auth_domain *auth_unix_lookup(struct in6_addr *addr); 132extern struct auth_domain *auth_unix_lookup(struct net *net, struct in6_addr *addr);
128extern int auth_unix_forget_old(struct auth_domain *dom); 133extern int auth_unix_forget_old(struct auth_domain *dom);
129extern void svcauth_unix_purge(void); 134extern void svcauth_unix_purge(void);
130extern void svcauth_unix_info_release(void *); 135extern void svcauth_unix_info_release(struct svc_xprt *xpt);
131extern int svcauth_unix_set_client(struct svc_rqst *rqstp); 136extern int svcauth_unix_set_client(struct svc_rqst *rqstp);
132 137
133static inline unsigned long hash_str(char *name, int bits) 138static inline unsigned long hash_str(char *name, int bits)
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 35cf2e8cd7c..498ab93a81e 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -108,6 +108,7 @@ void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int,
108 unsigned int); 108 unsigned int);
109void xdr_inline_pages(struct xdr_buf *, unsigned int, 109void xdr_inline_pages(struct xdr_buf *, unsigned int,
110 struct page **, unsigned int, unsigned int); 110 struct page **, unsigned int, unsigned int);
111void xdr_terminate_string(struct xdr_buf *, const u32);
111 112
112static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len) 113static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len)
113{ 114{
@@ -131,6 +132,13 @@ xdr_decode_hyper(__be32 *p, __u64 *valp)
131 return p + 2; 132 return p + 2;
132} 133}
133 134
135static inline __be32 *
136xdr_decode_opaque_fixed(__be32 *p, void *ptr, unsigned int len)
137{
138 memcpy(ptr, p, len);
139 return p + XDR_QUADLEN(len);
140}
141
134/* 142/*
135 * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) 143 * Adjust kvec to reflect end of xdr'ed data (RPC client XDR)
136 */ 144 */
@@ -200,6 +208,7 @@ extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes);
200extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, 208extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages,
201 unsigned int base, unsigned int len); 209 unsigned int base, unsigned int len);
202extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); 210extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
211extern __be32 *xdr_inline_peek(struct xdr_stream *xdr, size_t nbytes);
203extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); 212extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
204extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); 213extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
205extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); 214extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index ff5a77b28c5..89d10d279a2 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -224,6 +224,7 @@ struct rpc_xprt {
224 bklog_u; /* backlog queue utilization */ 224 bklog_u; /* backlog queue utilization */
225 } stat; 225 } stat;
226 226
227 struct net *xprt_net;
227 const char *address_strings[RPC_DISPLAY_MAX]; 228 const char *address_strings[RPC_DISPLAY_MAX];
228}; 229};
229 230
@@ -249,6 +250,7 @@ static inline int bc_prealloc(struct rpc_rqst *req)
249 250
250struct xprt_create { 251struct xprt_create {
251 int ident; /* XPRT_TRANSPORT identifier */ 252 int ident; /* XPRT_TRANSPORT identifier */
253 struct net * net;
252 struct sockaddr * srcaddr; /* optional local address */ 254 struct sockaddr * srcaddr; /* optional local address */
253 struct sockaddr * dstaddr; /* remote peer address */ 255 struct sockaddr * dstaddr; /* remote peer address */
254 size_t addrlen; 256 size_t addrlen;
@@ -280,6 +282,8 @@ void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
280void xprt_release(struct rpc_task *task); 282void xprt_release(struct rpc_task *task);
281struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); 283struct rpc_xprt * xprt_get(struct rpc_xprt *xprt);
282void xprt_put(struct rpc_xprt *xprt); 284void xprt_put(struct rpc_xprt *xprt);
285struct rpc_xprt * xprt_alloc(struct net *net, int size, int max_req);
286void xprt_free(struct rpc_xprt *);
283 287
284static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) 288static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p)
285{ 289{
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 7cdd63366f8..eba53e71d2c 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -271,8 +271,18 @@ extern void scan_mapping_unevictable_pages(struct address_space *);
271extern unsigned long scan_unevictable_pages; 271extern unsigned long scan_unevictable_pages;
272extern int scan_unevictable_handler(struct ctl_table *, int, 272extern int scan_unevictable_handler(struct ctl_table *, int,
273 void __user *, size_t *, loff_t *); 273 void __user *, size_t *, loff_t *);
274#ifdef CONFIG_NUMA
274extern int scan_unevictable_register_node(struct node *node); 275extern int scan_unevictable_register_node(struct node *node);
275extern void scan_unevictable_unregister_node(struct node *node); 276extern void scan_unevictable_unregister_node(struct node *node);
277#else
278static inline int scan_unevictable_register_node(struct node *node)
279{
280 return 0;
281}
282static inline void scan_unevictable_unregister_node(struct node *node)
283{
284}
285#endif
276 286
277extern int kswapd_run(int nid); 287extern int kswapd_run(int nid);
278extern void kswapd_stop(int nid); 288extern void kswapd_stop(int nid);
diff --git a/include/linux/synclink.h b/include/linux/synclink.h
index 0ff2779c44d..2e7d81c4e5a 100644
--- a/include/linux/synclink.h
+++ b/include/linux/synclink.h
@@ -126,6 +126,7 @@
126#define MGSL_MODE_BISYNC 4 126#define MGSL_MODE_BISYNC 4
127#define MGSL_MODE_RAW 6 127#define MGSL_MODE_RAW 6
128#define MGSL_MODE_BASE_CLOCK 7 128#define MGSL_MODE_BASE_CLOCK 7
129#define MGSL_MODE_XSYNC 8
129 130
130#define MGSL_BUS_TYPE_ISA 1 131#define MGSL_BUS_TYPE_ISA 1
131#define MGSL_BUS_TYPE_EISA 2 132#define MGSL_BUS_TYPE_EISA 2
@@ -290,6 +291,10 @@ struct gpio_desc {
290#define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc) 291#define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc)
291#define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc) 292#define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc)
292#define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc) 293#define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc)
294#define MGSL_IOCSXSYNC _IO(MGSL_MAGIC_IOC, 19)
295#define MGSL_IOCGXSYNC _IO(MGSL_MAGIC_IOC, 20)
296#define MGSL_IOCSXCTRL _IO(MGSL_MAGIC_IOC, 21)
297#define MGSL_IOCGXCTRL _IO(MGSL_MAGIC_IOC, 22)
293 298
294#ifdef __KERNEL__ 299#ifdef __KERNEL__
295/* provide 32 bit ioctl compatibility on 64 bit systems */ 300/* provide 32 bit ioctl compatibility on 64 bit systems */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index e6319d18a55..cacc27a0e28 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -701,7 +701,8 @@ asmlinkage long sys_nfsservctl(int cmd,
701asmlinkage long sys_syslog(int type, char __user *buf, int len); 701asmlinkage long sys_syslog(int type, char __user *buf, int len);
702asmlinkage long sys_uselib(const char __user *library); 702asmlinkage long sys_uselib(const char __user *library);
703asmlinkage long sys_ni_syscall(void); 703asmlinkage long sys_ni_syscall(void);
704asmlinkage long sys_ptrace(long request, long pid, long addr, long data); 704asmlinkage long sys_ptrace(long request, long pid, unsigned long addr,
705 unsigned long data);
705 706
706asmlinkage long sys_add_key(const char __user *_type, 707asmlinkage long sys_add_key(const char __user *_type,
707 const char __user *_description, 708 const char __user *_description,
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild
index 76990937f4c..67b501c302b 100644
--- a/include/linux/tc_act/Kbuild
+++ b/include/linux/tc_act/Kbuild
@@ -4,3 +4,4 @@ header-y += tc_mirred.h
4header-y += tc_pedit.h 4header-y += tc_pedit.h
5header-y += tc_nat.h 5header-y += tc_nat.h
6header-y += tc_skbedit.h 6header-y += tc_skbedit.h
7header-y += tc_csum.h
diff --git a/include/linux/tc_act/tc_csum.h b/include/linux/tc_act/tc_csum.h
new file mode 100644
index 00000000000..a047c49a315
--- /dev/null
+++ b/include/linux/tc_act/tc_csum.h
@@ -0,0 +1,32 @@
1#ifndef __LINUX_TC_CSUM_H
2#define __LINUX_TC_CSUM_H
3
4#include <linux/types.h>
5#include <linux/pkt_cls.h>
6
7#define TCA_ACT_CSUM 16
8
9enum {
10 TCA_CSUM_UNSPEC,
11 TCA_CSUM_PARMS,
12 TCA_CSUM_TM,
13 __TCA_CSUM_MAX
14};
15#define TCA_CSUM_MAX (__TCA_CSUM_MAX - 1)
16
17enum {
18 TCA_CSUM_UPDATE_FLAG_IPV4HDR = 1,
19 TCA_CSUM_UPDATE_FLAG_ICMP = 2,
20 TCA_CSUM_UPDATE_FLAG_IGMP = 4,
21 TCA_CSUM_UPDATE_FLAG_TCP = 8,
22 TCA_CSUM_UPDATE_FLAG_UDP = 16,
23 TCA_CSUM_UPDATE_FLAG_UDPLITE = 32
24};
25
26struct tc_csum {
27 tc_gen;
28
29 __u32 update_flags;
30};
31
32#endif /* __LINUX_TC_CSUM_H */
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index 0864206ec1a..7138962664f 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -79,6 +79,7 @@ enum {
79 TCF_META_ID_SK_SENDMSG_OFF, 79 TCF_META_ID_SK_SENDMSG_OFF,
80 TCF_META_ID_SK_WRITE_PENDING, 80 TCF_META_ID_SK_WRITE_PENDING,
81 TCF_META_ID_VLAN_TAG, 81 TCF_META_ID_VLAN_TAG,
82 TCF_META_ID_RXHASH,
82 __TCF_META_ID_MAX 83 __TCF_META_ID_MAX
83}; 84};
84#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) 85#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index a778ee02459..e64f4c67d0e 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -105,6 +105,7 @@ enum {
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ 105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ 106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ 107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
108#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
108 109
109/* for TCP_INFO socket option */ 110/* for TCP_INFO socket option */
110#define TCPI_OPT_TIMESTAMPS 1 111#define TCPI_OPT_TIMESTAMPS 1
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
new file mode 100644
index 00000000000..4c7be226301
--- /dev/null
+++ b/include/linux/ti_wilink_st.h
@@ -0,0 +1,400 @@
1/*
2 * Shared Transport Header file
3 * To be included by the protocol stack drivers for
4 * Texas Instruments BT,FM and GPS combo chip drivers
5 * and also serves the sub-modules of the shared transport driver.
6 *
7 * Copyright (C) 2009-2010 Texas Instruments
8 * Author: Pavan Savoy <pavan_savoy@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#ifndef TI_WILINK_ST_H
26#define TI_WILINK_ST_H
27
28/**
29 * enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW
30 * gpio states for their chip/core enable gpios
31 */
32enum kim_gpio_state {
33 KIM_GPIO_INACTIVE,
34 KIM_GPIO_ACTIVE,
35};
36
37/**
38 * enum proto-type - The protocol on WiLink chips which share a
39 * common physical interface like UART.
40 */
41enum proto_type {
42 ST_BT,
43 ST_FM,
44 ST_GPS,
45 ST_MAX,
46};
47
48/**
49 * struct st_proto_s - Per Protocol structure from BT/FM/GPS to ST
50 * @type: type of the protocol being registered among the
51 * available proto_type(BT, FM, GPS the protocol which share TTY).
52 * @recv: the receiver callback pointing to a function in the
53 * protocol drivers called by the ST driver upon receiving
54 * relevant data.
55 * @match_packet: reserved for future use, to make ST more generic
56 * @reg_complete_cb: callback handler pointing to a function in protocol
57 * handler called by ST when the pending registrations are complete.
58 * The registrations are marked pending, in situations when fw
59 * download is in progress.
60 * @write: pointer to function in ST provided to protocol drivers from ST,
61 * to be made use when protocol drivers have data to send to TTY.
62 * @priv_data: privdate data holder for the protocol drivers, sent
63 * from the protocol drivers during registration, and sent back on
64 * reg_complete_cb and recv.
65 */
66struct st_proto_s {
67 enum proto_type type;
68 long (*recv) (void *, struct sk_buff *);
69 unsigned char (*match_packet) (const unsigned char *data);
70 void (*reg_complete_cb) (void *, char data);
71 long (*write) (struct sk_buff *skb);
72 void *priv_data;
73};
74
75extern long st_register(struct st_proto_s *);
76extern long st_unregister(enum proto_type);
77
78
79/*
80 * header information used by st_core.c
81 */
82
83/* states of protocol list */
84#define ST_NOTEMPTY 1
85#define ST_EMPTY 0
86
87/*
88 * possible st_states
89 */
90#define ST_INITIALIZING 1
91#define ST_REG_IN_PROGRESS 2
92#define ST_REG_PENDING 3
93#define ST_WAITING_FOR_RESP 4
94
95/**
96 * struct st_data_s - ST core internal structure
97 * @st_state: different states of ST like initializing, registration
98 * in progress, this is mainly used to return relevant err codes
99 * when protocol drivers are registering. It is also used to track
100 * the recv function, as in during fw download only HCI events
101 * can occur , where as during other times other events CH8, CH9
102 * can occur.
103 * @tty: tty provided by the TTY core for line disciplines.
104 * @tx_skb: If for some reason the tty's write returns lesser bytes written
105 * then to maintain the rest of data to be written on next instance.
106 * This needs to be protected, hence the lock inside wakeup func.
107 * @tx_state: if the data is being written onto the TTY and protocol driver
108 * wants to send more, queue up data and mark that there is
109 * more data to send.
110 * @list: the list of protocols registered, only MAX can exist, one protocol
111 * can register only once.
112 * @rx_state: states to be maintained inside st's tty receive
113 * @rx_count: count to be maintained inside st's tty receieve
114 * @rx_skb: the skb where all data for a protocol gets accumulated,
115 * since tty might not call receive when a complete event packet
116 * is received, the states, count and the skb needs to be maintained.
117 * @txq: the list of skbs which needs to be sent onto the TTY.
118 * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued
119 * up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs
120 * from waitq can be moved onto the txq.
121 * Needs locking too.
122 * @lock: the lock to protect skbs, queues, and ST states.
123 * @protos_registered: count of the protocols registered, also when 0 the
124 * chip enable gpio can be toggled, and when it changes to 1 the fw
125 * needs to be downloaded to initialize chip side ST.
126 * @ll_state: the various PM states the chip can be, the states are notified
127 * to us, when the chip sends relevant PM packets(SLEEP_IND, WAKE_IND).
128 * @kim_data: reference to the parent encapsulating structure.
129 *
130 */
131struct st_data_s {
132 unsigned long st_state;
133 struct tty_struct *tty;
134 struct sk_buff *tx_skb;
135#define ST_TX_SENDING 1
136#define ST_TX_WAKEUP 2
137 unsigned long tx_state;
138 struct st_proto_s *list[ST_MAX];
139 unsigned long rx_state;
140 unsigned long rx_count;
141 struct sk_buff *rx_skb;
142 struct sk_buff_head txq, tx_waitq;
143 spinlock_t lock;
144 unsigned char protos_registered;
145 unsigned long ll_state;
146 void *kim_data;
147};
148
149/**
150 * st_int_write -
151 * point this to tty->driver->write or tty->ops->write
152 * depending upon the kernel version
153 */
154int st_int_write(struct st_data_s*, const unsigned char*, int);
155
156/**
157 * st_write -
158 * internal write function, passed onto protocol drivers
159 * via the write function ptr of protocol struct
160 */
161long st_write(struct sk_buff *);
162
163/* function to be called from ST-LL */
164void st_ll_send_frame(enum proto_type, struct sk_buff *);
165
166/* internal wake up function */
167void st_tx_wakeup(struct st_data_s *st_data);
168
169/* init, exit entry funcs called from KIM */
170int st_core_init(struct st_data_s **);
171void st_core_exit(struct st_data_s *);
172
173/* ask for reference from KIM */
174void st_kim_ref(struct st_data_s **, int);
175
176#define GPS_STUB_TEST
177#ifdef GPS_STUB_TEST
178int gps_chrdrv_stub_write(const unsigned char*, int);
179void gps_chrdrv_stub_init(void);
180#endif
181
182/*
183 * header information used by st_kim.c
184 */
185
186/* time in msec to wait for
187 * line discipline to be installed
188 */
189#define LDISC_TIME 500
190#define CMD_RESP_TIME 500
191#define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \
192 | ((unsigned short)((unsigned char)(b))) << 8))
193
194#define GPIO_HIGH 1
195#define GPIO_LOW 0
196
197/* the Power-On-Reset logic, requires to attempt
198 * to download firmware onto chip more than once
199 * since the self-test for chip takes a while
200 */
201#define POR_RETRY_COUNT 5
202
203/**
204 * struct chip_version - save the chip version
205 */
206struct chip_version {
207 unsigned short full;
208 unsigned short chip;
209 unsigned short min_ver;
210 unsigned short maj_ver;
211};
212
213/**
214 * struct kim_data_s - the KIM internal data, embedded as the
215 * platform's drv data. One for each ST device in the system.
216 * @uim_pid: KIM needs to communicate with UIM to request to install
217 * the ldisc by opening UART when protocol drivers register.
218 * @kim_pdev: the platform device added in one of the board-XX.c file
219 * in arch/XX/ directory, 1 for each ST device.
220 * @kim_rcvd: completion handler to notify when data was received,
221 * mainly used during fw download, which involves multiple send/wait
222 * for each of the HCI-VS commands.
223 * @ldisc_installed: completion handler to notify that the UIM accepted
224 * the request to install ldisc, notify from tty_open which suggests
225 * the ldisc was properly installed.
226 * @resp_buffer: data buffer for the .bts fw file name.
227 * @fw_entry: firmware class struct to request/release the fw.
228 * @gpios: the list of core/chip enable gpios for BT, FM and GPS cores.
229 * @rx_state: the rx state for kim's receive func during fw download.
230 * @rx_count: the rx count for the kim's receive func during fw download.
231 * @rx_skb: all of fw data might not come at once, and hence data storage for
232 * whole of the fw response, only HCI_EVENTs and hence diff from ST's
233 * response.
234 * @rfkill: rfkill data for each of the cores to be registered with rfkill.
235 * @rf_protos: proto types of the data registered with rfkill sub-system.
236 * @core_data: ST core's data, which mainly is the tty's disc_data
237 * @version: chip version available via a sysfs entry.
238 *
239 */
240struct kim_data_s {
241 long uim_pid;
242 struct platform_device *kim_pdev;
243 struct completion kim_rcvd, ldisc_installed;
244 char resp_buffer[30];
245 const struct firmware *fw_entry;
246 long gpios[ST_MAX];
247 unsigned long rx_state;
248 unsigned long rx_count;
249 struct sk_buff *rx_skb;
250 struct rfkill *rfkill[ST_MAX];
251 enum proto_type rf_protos[ST_MAX];
252 struct st_data_s *core_data;
253 struct chip_version version;
254};
255
256/**
257 * functions called when 1 of the protocol drivers gets
258 * registered, these need to communicate with UIM to request
259 * ldisc installed, read chip_version, download relevant fw
260 */
261long st_kim_start(void *);
262long st_kim_stop(void *);
263
264void st_kim_recv(void *, const unsigned char *, long count);
265void st_kim_chip_toggle(enum proto_type, enum kim_gpio_state);
266void st_kim_complete(void *);
267void kim_st_list_protocols(struct st_data_s *, void *);
268
269/*
270 * BTS headers
271 */
272#define ACTION_SEND_COMMAND 1
273#define ACTION_WAIT_EVENT 2
274#define ACTION_SERIAL 3
275#define ACTION_DELAY 4
276#define ACTION_RUN_SCRIPT 5
277#define ACTION_REMARKS 6
278
279/**
280 * struct bts_header - the fw file is NOT binary which can
281 * be sent onto TTY as is. The .bts is more a script
282 * file which has different types of actions.
283 * Each such action needs to be parsed by the KIM and
284 * relevant procedure to be called.
285 */
286struct bts_header {
287 u32 magic;
288 u32 version;
289 u8 future[24];
290 u8 actions[0];
291} __attribute__ ((packed));
292
293/**
294 * struct bts_action - Each .bts action has its own type of
295 * data.
296 */
297struct bts_action {
298 u16 type;
299 u16 size;
300 u8 data[0];
301} __attribute__ ((packed));
302
303struct bts_action_send {
304 u8 data[0];
305} __attribute__ ((packed));
306
307struct bts_action_wait {
308 u32 msec;
309 u32 size;
310 u8 data[0];
311} __attribute__ ((packed));
312
313struct bts_action_delay {
314 u32 msec;
315} __attribute__ ((packed));
316
317struct bts_action_serial {
318 u32 baud;
319 u32 flow_control;
320} __attribute__ ((packed));
321
322/**
323 * struct hci_command - the HCI-VS for intrepreting
324 * the change baud rate of host-side UART, which
325 * needs to be ignored, since UIM would do that
326 * when it receives request from KIM for ldisc installation.
327 */
328struct hci_command {
329 u8 prefix;
330 u16 opcode;
331 u8 plen;
332 u32 speed;
333} __attribute__ ((packed));
334
335/*
336 * header information used by st_ll.c
337 */
338
339/* ST LL receiver states */
340#define ST_W4_PACKET_TYPE 0
341#define ST_BT_W4_EVENT_HDR 1
342#define ST_BT_W4_ACL_HDR 2
343#define ST_BT_W4_SCO_HDR 3
344#define ST_BT_W4_DATA 4
345#define ST_FM_W4_EVENT_HDR 5
346#define ST_GPS_W4_EVENT_HDR 6
347
348/* ST LL state machines */
349#define ST_LL_ASLEEP 0
350#define ST_LL_ASLEEP_TO_AWAKE 1
351#define ST_LL_AWAKE 2
352#define ST_LL_AWAKE_TO_ASLEEP 3
353#define ST_LL_INVALID 4
354
355/* different PM notifications coming from chip */
356#define LL_SLEEP_IND 0x30
357#define LL_SLEEP_ACK 0x31
358#define LL_WAKE_UP_IND 0x32
359#define LL_WAKE_UP_ACK 0x33
360
361/* initialize and de-init ST LL */
362long st_ll_init(struct st_data_s *);
363long st_ll_deinit(struct st_data_s *);
364
365/**
366 * enable/disable ST LL along with KIM start/stop
367 * called by ST Core
368 */
369void st_ll_enable(struct st_data_s *);
370void st_ll_disable(struct st_data_s *);
371
372/**
373 * various funcs used by ST core to set/get the various PM states
374 * of the chip.
375 */
376unsigned long st_ll_getstate(struct st_data_s *);
377unsigned long st_ll_sleep_state(struct st_data_s *, unsigned char);
378void st_ll_wakeup(struct st_data_s *);
379
380/*
381 * header information used by st_core.c for FM and GPS
382 * packet parsing, the bluetooth headers are already available
383 * at net/bluetooth/
384 */
385
386struct fm_event_hdr {
387 u8 plen;
388} __attribute__ ((packed));
389
390#define FM_MAX_FRAME_SIZE 0xFF /* TODO: */
391#define FM_EVENT_HDR_SIZE 1 /* size of fm_event_hdr */
392#define ST_FM_CH8_PKT 0x8
393
394/* gps stuff */
395struct gps_event_hdr {
396 u8 opcode;
397 u16 plen;
398} __attribute__ ((packed));
399
400#endif /* TI_WILINK_ST_H */
diff --git a/include/linux/tipc.h b/include/linux/tipc.h
index 181c8d0e6f7..d10614b29d5 100644
--- a/include/linux/tipc.h
+++ b/include/linux/tipc.h
@@ -127,17 +127,23 @@ static inline unsigned int tipc_node(__u32 addr)
127 * TIPC topology subscription service definitions 127 * TIPC topology subscription service definitions
128 */ 128 */
129 129
130#define TIPC_SUB_SERVICE 0x00 /* Filter for service availability */ 130#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
131#define TIPC_SUB_PORTS 0x01 /* Filter for port availability */ 131#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
132#define TIPC_SUB_CANCEL 0x04 /* Cancel a subscription */ 132#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
133#if 0
134/* The following filter options are not currently implemented */
135#define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */
136#define TIPC_SUB_NO_UNBIND_EVTS 0x08 /* filter out "withdraw" events */
137#define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */
138#endif
133 139
134#define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */ 140#define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */
135 141
136struct tipc_subscr { 142struct tipc_subscr {
137 struct tipc_name_seq seq; /* NBO. Name sequence of interest */ 143 struct tipc_name_seq seq; /* name sequence of interest */
138 __u32 timeout; /* NBO. Subscription duration (in ms) */ 144 __u32 timeout; /* subscription duration (in ms) */
139 __u32 filter; /* NBO. Bitmask of filter options */ 145 __u32 filter; /* bitmask of filter options */
140 char usr_handle[8]; /* Opaque. Available for subscriber use */ 146 char usr_handle[8]; /* available for subscriber use */
141}; 147};
142 148
143#define TIPC_PUBLISHED 1 /* publication event */ 149#define TIPC_PUBLISHED 1 /* publication event */
@@ -145,11 +151,11 @@ struct tipc_subscr {
145#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */ 151#define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */
146 152
147struct tipc_event { 153struct tipc_event {
148 __u32 event; /* NBO. Event type, as defined above */ 154 __u32 event; /* event type */
149 __u32 found_lower; /* NBO. Matching name seq instances */ 155 __u32 found_lower; /* matching name seq instances */
150 __u32 found_upper; /* " " " " " */ 156 __u32 found_upper; /* " " " " */
151 struct tipc_portid port; /* NBO. Associated port */ 157 struct tipc_portid port; /* associated port */
152 struct tipc_subscr s; /* Original, associated subscription */ 158 struct tipc_subscr s; /* associated subscription */
153}; 159};
154 160
155/* 161/*
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 10db0102a89..3a2e66d88a3 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -150,7 +150,7 @@ static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
150 * 150 *
151 * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. 151 * Return %LSM_UNSAFE_* bits applied to an exec because of tracing.
152 * 152 *
153 * @task->cred_guard_mutex is held by the caller through the do_execve(). 153 * @task->signal->cred_guard_mutex is held by the caller through the do_execve().
154 */ 154 */
155static inline int tracehook_unsafe_exec(struct task_struct *task) 155static inline int tracehook_unsafe_exec(struct task_struct *task)
156{ 156{
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 86be0cdeb11..2a754748dd5 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -50,6 +50,7 @@
50#define N_V253 19 /* Codec control over voice modem */ 50#define N_V253 19 /* Codec control over voice modem */
51#define N_CAIF 20 /* CAIF protocol for talking to modems */ 51#define N_CAIF 20 /* CAIF protocol for talking to modems */
52#define N_GSM0710 21 /* GSM 0710 Mux */ 52#define N_GSM0710 21 /* GSM 0710 Mux */
53#define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */
53 54
54/* 55/*
55 * This character is the same as _POSIX_VDISABLE: it cannot be used as 56 * This character is the same as _POSIX_VDISABLE: it cannot be used as
@@ -540,8 +541,8 @@ extern void tty_audit_exit(void);
540extern void tty_audit_fork(struct signal_struct *sig); 541extern void tty_audit_fork(struct signal_struct *sig);
541extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); 542extern void tty_audit_tiocsti(struct tty_struct *tty, char ch);
542extern void tty_audit_push(struct tty_struct *tty); 543extern void tty_audit_push(struct tty_struct *tty);
543extern void tty_audit_push_task(struct task_struct *tsk, 544extern int tty_audit_push_task(struct task_struct *tsk,
544 uid_t loginuid, u32 sessionid); 545 uid_t loginuid, u32 sessionid);
545#else 546#else
546static inline void tty_audit_add_data(struct tty_struct *tty, 547static inline void tty_audit_add_data(struct tty_struct *tty,
547 unsigned char *data, size_t size) 548 unsigned char *data, size_t size)
@@ -559,9 +560,10 @@ static inline void tty_audit_fork(struct signal_struct *sig)
559static inline void tty_audit_push(struct tty_struct *tty) 560static inline void tty_audit_push(struct tty_struct *tty)
560{ 561{
561} 562}
562static inline void tty_audit_push_task(struct task_struct *tsk, 563static inline int tty_audit_push_task(struct task_struct *tsk,
563 uid_t loginuid, u32 sessionid) 564 uid_t loginuid, u32 sessionid)
564{ 565{
566 return 0;
565} 567}
566#endif 568#endif
567 569
diff --git a/include/linux/types.h b/include/linux/types.h
index 357dbc19606..c2a9eb44f2f 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -121,15 +121,7 @@ typedef __u64 u_int64_t;
121typedef __s64 int64_t; 121typedef __s64 int64_t;
122#endif 122#endif
123 123
124/* 124/* this is a special 64bit data type that is 8-byte aligned */
125 * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
126 * common 32/64-bit compat problems.
127 * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
128 * architectures) and to 8-byte boundaries on 64-bit architetures. The new
129 * aligned_64 type enforces 8-byte alignment so that structs containing
130 * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
131 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
132 */
133#define aligned_u64 __u64 __attribute__((aligned(8))) 125#define aligned_u64 __u64 __attribute__((aligned(8)))
134#define aligned_be64 __be64 __attribute__((aligned(8))) 126#define aligned_be64 __be64 __attribute__((aligned(8)))
135#define aligned_le64 __le64 __attribute__((aligned(8))) 127#define aligned_le64 __le64 __attribute__((aligned(8)))
@@ -186,7 +178,15 @@ typedef __u64 __bitwise __be64;
186typedef __u16 __bitwise __sum16; 178typedef __u16 __bitwise __sum16;
187typedef __u32 __bitwise __wsum; 179typedef __u32 __bitwise __wsum;
188 180
189/* this is a special 64bit data type that is 8-byte aligned */ 181/*
182 * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
183 * common 32/64-bit compat problems.
184 * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
185 * architectures) and to 8-byte boundaries on 64-bit architetures. The new
186 * aligned_64 type enforces 8-byte alignment so that structs containing
187 * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
188 * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
189 */
190#define __aligned_u64 __u64 __attribute__((aligned(8))) 190#define __aligned_u64 __u64 __attribute__((aligned(8)))
191#define __aligned_be64 __be64 __attribute__((aligned(8))) 191#define __aligned_be64 __be64 __attribute__((aligned(8)))
192#define __aligned_le64 __le64 __attribute__((aligned(8))) 192#define __aligned_le64 __le64 __attribute__((aligned(8)))
diff --git a/include/linux/via-core.h b/include/linux/via-core.h
index 7ffb521e1a7..38bffd8ccca 100644
--- a/include/linux/via-core.h
+++ b/include/linux/via-core.h
@@ -81,7 +81,7 @@ struct viafb_dev {
81 unsigned long fbmem_start; 81 unsigned long fbmem_start;
82 long fbmem_len; 82 long fbmem_len;
83 void __iomem *fbmem; 83 void __iomem *fbmem;
84#if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE) 84#if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE)
85 long camera_fbmem_offset; 85 long camera_fbmem_offset;
86 long camera_fbmem_size; 86 long camera_fbmem_size;
87#endif 87#endif
@@ -138,6 +138,7 @@ void viafb_irq_disable(u32 mask);
138#define VDE_I_LVDSSIEN 0x40000000 /* LVDS Sense enable */ 138#define VDE_I_LVDSSIEN 0x40000000 /* LVDS Sense enable */
139#define VDE_I_ENABLE 0x80000000 /* Global interrupt enable */ 139#define VDE_I_ENABLE 0x80000000 /* Global interrupt enable */
140 140
141#if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE)
141/* 142/*
142 * DMA management. 143 * DMA management.
143 */ 144 */
@@ -172,6 +173,7 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg);
172 */ 173 */
173#define VGA_WIDTH 640 174#define VGA_WIDTH 640
174#define VGA_HEIGHT 480 175#define VGA_HEIGHT 480
176#endif /* CONFIG_VIDEO_VIA_CAMERA */
175 177
176/* 178/*
177 * Indexed port operations. Note that these are all multi-op 179 * Indexed port operations. Note that these are all multi-op
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 61490c6dcdb..5f6f47044ab 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -363,6 +363,8 @@ struct v4l2_pix_format {
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#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
365#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ 365#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
366#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
367#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
366 368
367/* 369/*
368 * F O R M A T E N U M E R A T I O N 370 * F O R M A T E N U M E R A T I O N
@@ -1045,8 +1047,11 @@ enum v4l2_colorfx {
1045 1047
1046#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36) 1048#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
1047 1049
1050#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
1051#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
1052
1048/* last CID + 1 */ 1053/* last CID + 1 */
1049#define V4L2_CID_LASTP1 (V4L2_CID_BASE+37) 1054#define V4L2_CID_LASTP1 (V4L2_CID_BASE+39)
1050 1055
1051/* MPEG-class control IDs defined by V4L2 */ 1056/* MPEG-class control IDs defined by V4L2 */
1052#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1057#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1363,6 +1368,8 @@ struct v4l2_modulator {
1363#define V4L2_TUNER_CAP_SAP 0x0020 1368#define V4L2_TUNER_CAP_SAP 0x0020
1364#define V4L2_TUNER_CAP_LANG1 0x0040 1369#define V4L2_TUNER_CAP_LANG1 0x0040
1365#define V4L2_TUNER_CAP_RDS 0x0080 1370#define V4L2_TUNER_CAP_RDS 0x0080
1371#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
1372#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
1366 1373
1367/* Flags for the 'rxsubchans' field */ 1374/* Flags for the 'rxsubchans' field */
1368#define V4L2_TUNER_SUB_MONO 0x0001 1375#define V4L2_TUNER_SUB_MONO 0x0001
@@ -1392,7 +1399,8 @@ struct v4l2_hw_freq_seek {
1392 enum v4l2_tuner_type type; 1399 enum v4l2_tuner_type type;
1393 __u32 seek_upward; 1400 __u32 seek_upward;
1394 __u32 wrap_around; 1401 __u32 wrap_around;
1395 __u32 reserved[8]; 1402 __u32 spacing;
1403 __u32 reserved[7];
1396}; 1404};
1397 1405
1398/* 1406/*
diff --git a/include/linux/videotext.h b/include/linux/videotext.h
deleted file mode 100644
index 3e68c8d1c7f..00000000000
--- a/include/linux/videotext.h
+++ /dev/null
@@ -1,125 +0,0 @@
1#ifndef _VTX_H
2#define _VTX_H
3
4/*
5 * Teletext (=Videotext) hardware decoders using interface /dev/vtx
6 * Do not confuse with drivers using /dev/vbi which decode videotext by software
7 *
8 * Videotext IOCTLs changed in order to use _IO() macros defined in <linux/ioctl.h>,
9 * unused tuner IOCTLs cleaned up by
10 * Michael Geng <linux@MichaelGeng.de>
11 *
12 * Copyright (c) 1994-97 Martin Buck <martin-2.buck@student.uni-ulm.de>
13 * Read COPYING for more information
14 *
15 */
16
17
18/*
19 * Videotext ioctls
20 */
21#define VTXIOCGETINFO _IOR (0x81, 1, vtx_info_t)
22#define VTXIOCCLRPAGE _IOW (0x81, 2, vtx_pagereq_t)
23#define VTXIOCCLRFOUND _IOW (0x81, 3, vtx_pagereq_t)
24#define VTXIOCPAGEREQ _IOW (0x81, 4, vtx_pagereq_t)
25#define VTXIOCGETSTAT _IOW (0x81, 5, vtx_pagereq_t)
26#define VTXIOCGETPAGE _IOW (0x81, 6, vtx_pagereq_t)
27#define VTXIOCSTOPDAU _IOW (0x81, 7, vtx_pagereq_t)
28#define VTXIOCPUTPAGE _IO (0x81, 8)
29#define VTXIOCSETDISP _IO (0x81, 9)
30#define VTXIOCPUTSTAT _IO (0x81, 10)
31#define VTXIOCCLRCACHE _IO (0x81, 11)
32#define VTXIOCSETVIRT _IOW (0x81, 12, long)
33
34/* for compatibility, will go away some day */
35#define VTXIOCGETINFO_OLD 0x7101 /* get version of driver & capabilities of vtx-chipset */
36#define VTXIOCCLRPAGE_OLD 0x7102 /* clear page-buffer */
37#define VTXIOCCLRFOUND_OLD 0x7103 /* clear bits indicating that page was found */
38#define VTXIOCPAGEREQ_OLD 0x7104 /* search for page */
39#define VTXIOCGETSTAT_OLD 0x7105 /* get status of page-buffer */
40#define VTXIOCGETPAGE_OLD 0x7106 /* get contents of page-buffer */
41#define VTXIOCSTOPDAU_OLD 0x7107 /* stop data acquisition unit */
42#define VTXIOCPUTPAGE_OLD 0x7108 /* display page on TV-screen */
43#define VTXIOCSETDISP_OLD 0x7109 /* set TV-mode */
44#define VTXIOCPUTSTAT_OLD 0x710a /* set status of TV-output-buffer */
45#define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */
46#define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */
47
48/*
49 * Definitions for VTXIOCGETINFO
50 */
51
52#define SAA5243 0
53#define SAA5246 1
54#define SAA5249 2
55#define SAA5248 3
56#define XSTV5346 4
57
58typedef struct {
59 int version_major, version_minor; /* version of driver; if version_major changes, driver */
60 /* is not backward compatible!!! CHECK THIS!!! */
61 int numpages; /* number of page-buffers of vtx-chipset */
62 int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or
63 * SAA5249) */
64}
65vtx_info_t;
66
67
68/*
69 * Definitions for VTXIOC{CLRPAGE,CLRFOUND,PAGEREQ,GETSTAT,GETPAGE,STOPDAU,PUTPAGE,SETDISP}
70 */
71
72#define MIN_UNIT (1<<0)
73#define MIN_TEN (1<<1)
74#define HR_UNIT (1<<2)
75#define HR_TEN (1<<3)
76#define PG_UNIT (1<<4)
77#define PG_TEN (1<<5)
78#define PG_HUND (1<<6)
79#define PGMASK_MAX (1<<7)
80#define PGMASK_PAGE (PG_HUND | PG_TEN | PG_UNIT)
81#define PGMASK_HOUR (HR_TEN | HR_UNIT)
82#define PGMASK_MINUTE (MIN_TEN | MIN_UNIT)
83
84typedef struct
85{
86 int page; /* number of requested page (hexadecimal) */
87 int hour; /* requested hour (hexadecimal) */
88 int minute; /* requested minute (hexadecimal) */
89 int pagemask; /* mask defining which values of the above are set */
90 int pgbuf; /* buffer where page will be stored */
91 int start; /* start of requested part of page */
92 int end; /* end of requested part of page */
93 void __user *buffer; /* pointer to beginning of destination buffer */
94}
95vtx_pagereq_t;
96
97
98/*
99 * Definitions for VTXIOC{GETSTAT,PUTSTAT}
100 */
101
102#define VTX_PAGESIZE (40 * 24)
103#define VTX_VIRTUALSIZE (40 * 49)
104
105typedef struct
106{
107 int pagenum; /* number of page (hexadecimal) */
108 int hour; /* hour (hexadecimal) */
109 int minute; /* minute (hexadecimal) */
110 int charset; /* national charset */
111 unsigned delete : 1; /* delete page (C4) */
112 unsigned headline : 1; /* insert headline (C5) */
113 unsigned subtitle : 1; /* insert subtitle (C6) */
114 unsigned supp_header : 1; /* suppress header (C7) */
115 unsigned update : 1; /* update page (C8) */
116 unsigned inter_seq : 1; /* interrupted sequence (C9) */
117 unsigned dis_disp : 1; /* disable/suppress display (C10) */
118 unsigned serial : 1; /* serial mode (C11) */
119 unsigned notfound : 1; /* /FOUND */
120 unsigned pblf : 1; /* PBLF */
121 unsigned hamming : 1; /* hamming-error occurred */
122}
123vtx_pageinfo_t;
124
125#endif /* _VTX_H */
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h
index 1faa80d92f0..e68b439b286 100644
--- a/include/linux/virtio_9p.h
+++ b/include/linux/virtio_9p.h
@@ -5,7 +5,6 @@
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/virtio_ids.h> 6#include <linux/virtio_ids.h>
7#include <linux/virtio_config.h> 7#include <linux/virtio_config.h>
8#include <linux/types.h>
9 8
10/* The feature bitmap for virtio 9P */ 9/* The feature bitmap for virtio 9P */
11 10
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 63a4fe6d51b..a03dcf62ca9 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -53,8 +53,10 @@ static inline void vmalloc_init(void)
53#endif 53#endif
54 54
55extern void *vmalloc(unsigned long size); 55extern void *vmalloc(unsigned long size);
56extern void *vzalloc(unsigned long size);
56extern void *vmalloc_user(unsigned long size); 57extern void *vmalloc_user(unsigned long size);
57extern void *vmalloc_node(unsigned long size, int node); 58extern void *vmalloc_node(unsigned long size, int node);
59extern void *vzalloc_node(unsigned long size, int node);
58extern void *vmalloc_exec(unsigned long size); 60extern void *vmalloc_exec(unsigned long size);
59extern void *vmalloc_32(unsigned long size); 61extern void *vmalloc_32(unsigned long size);
60extern void *vmalloc_32_user(unsigned long size); 62extern void *vmalloc_32_user(unsigned long size);
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index e6827eedf18..4395b28bb86 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -1157,6 +1157,6 @@ struct __compat_iw_event {
1157#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) 1157#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param))
1158#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) 1158#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr))
1159#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) 1159#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality))
1160#define IW_EV_POINT_PK_LEN (IW_EV_LCP_LEN + 4) 1160#define IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4)
1161 1161
1162#endif /* _LINUX_WIRELESS_H */ 1162#endif /* _LINUX_WIRELESS_H */
diff --git a/include/linux/spi/wl12xx.h b/include/linux/wl12xx.h
index a223ecbc71e..4f902e1908a 100644
--- a/include/linux/spi/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2009 Nokia Corporation 4 * Copyright (C) 2009 Nokia Corporation
5 * 5 *
6 * Contact: Kalle Valo <kalle.valo@nokia.com> 6 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
@@ -21,14 +21,31 @@
21 * 21 *
22 */ 22 */
23 23
24#ifndef _LINUX_SPI_WL12XX_H 24#ifndef _LINUX_WL12XX_H
25#define _LINUX_SPI_WL12XX_H 25#define _LINUX_WL12XX_H
26 26
27struct wl12xx_platform_data { 27struct wl12xx_platform_data {
28 void (*set_power)(bool enable); 28 void (*set_power)(bool enable);
29 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ 29 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
30 int irq; 30 int irq;
31 bool use_eeprom; 31 bool use_eeprom;
32 int board_ref_clock;
32}; 33};
33 34
35#ifdef CONFIG_WL12XX_PLATFORM_DATA
36
37int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
38
39#else
40
41static inline
42int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
43{
44 return -ENOSYS;
45}
46
47#endif
48
49const struct wl12xx_platform_data *wl12xx_get_platform_data(void);
50
34#endif 51#endif
diff --git a/include/linux/wlp.h b/include/linux/wlp.h
deleted file mode 100644
index c76fe239250..00000000000
--- a/include/linux/wlp.h
+++ /dev/null
@@ -1,736 +0,0 @@
1/*
2 * WiMedia Logical Link Control Protocol (WLP)
3 *
4 * Copyright (C) 2005-2006 Intel Corporation
5 * Reinette Chatre <reinette.chatre@intel.com>
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 version
9 * 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301, USA.
20 *
21 *
22 * FIXME: docs
23 *
24 * - Does not (yet) include support for WLP control frames
25 * WLP Draft 0.99 [6.5].
26 *
27 * A visual representation of the data structures.
28 *
29 * wssidB wssidB
30 * ^ ^
31 * | |
32 * wssidA wssidA
33 * wlp interface { ^ ^
34 * ... | |
35 * ... ... wssid wssid ...
36 * wlp --- ... | |
37 * }; neighbors --> neighbA --> neighbB
38 * ...
39 * wss
40 * ...
41 * eda cache --> neighborA --> neighborB --> neighborC ...
42 */
43
44#ifndef __LINUX__WLP_H_
45#define __LINUX__WLP_H_
46
47#include <linux/netdevice.h>
48#include <linux/skbuff.h>
49#include <linux/list.h>
50#include <linux/uwb.h>
51
52/**
53 * WLP Protocol ID
54 * WLP Draft 0.99 [6.2]
55 *
56 * The MUX header for all WLP frames
57 */
58#define WLP_PROTOCOL_ID 0x0100
59
60/**
61 * WLP Version
62 * WLP version placed in the association frames (WLP 0.99 [6.6])
63 */
64#define WLP_VERSION 0x10
65
66/**
67 * Bytes needed to print UUID as string
68 */
69#define WLP_WSS_UUID_STRSIZE 48
70
71/**
72 * Bytes needed to print nonce as string
73 */
74#define WLP_WSS_NONCE_STRSIZE 48
75
76
77/**
78 * Size used for WLP name size
79 *
80 * The WSS name is set to 65 bytes, 1 byte larger than the maximum
81 * allowed by the WLP spec. This is to have a null terminated string
82 * for display to the user. A maximum of 64 bytes will still be used
83 * when placing the WSS name field in association frames.
84 */
85#define WLP_WSS_NAME_SIZE 65
86
87/**
88 * Number of bytes added by WLP to data frame
89 *
90 * A data frame transmitted from a host will be placed in a Standard or
91 * Abbreviated WLP frame. These have an extra 4 bytes of header (struct
92 * wlp_frame_std_abbrv_hdr).
93 * When the stack sends this data frame for transmission it needs to ensure
94 * there is enough headroom for this header.
95 */
96#define WLP_DATA_HLEN 4
97
98/**
99 * State of device regarding WLP Service Set
100 *
101 * WLP_WSS_STATE_NONE: the host does not participate in any WSS
102 * WLP_WSS_STATE_PART_ENROLLED: used as part of the enrollment sequence
103 * ("Partial Enroll"). This state is used to
104 * indicate the first part of enrollment that is
105 * unsecure. If the WSS is unsecure then the
106 * state will promptly go to WLP_WSS_STATE_ENROLLED,
107 * if the WSS is not secure then the enrollment
108 * procedure is a few more steps before we are
109 * enrolled.
110 * WLP_WSS_STATE_ENROLLED: the host is enrolled in a WSS
111 * WLP_WSS_STATE_ACTIVE: WSS is activated
112 * WLP_WSS_STATE_CONNECTED: host is connected to neighbor in WSS
113 *
114 */
115enum wlp_wss_state {
116 WLP_WSS_STATE_NONE = 0,
117 WLP_WSS_STATE_PART_ENROLLED,
118 WLP_WSS_STATE_ENROLLED,
119 WLP_WSS_STATE_ACTIVE,
120 WLP_WSS_STATE_CONNECTED,
121};
122
123/**
124 * WSS Secure status
125 * WLP 0.99 Table 6
126 *
127 * Set to one if the WSS is secure, zero if it is not secure
128 */
129enum wlp_wss_sec_status {
130 WLP_WSS_UNSECURE = 0,
131 WLP_WSS_SECURE,
132};
133
134/**
135 * WLP frame type
136 * WLP Draft 0.99 [6.2 Table 1]
137 */
138enum wlp_frame_type {
139 WLP_FRAME_STANDARD = 0,
140 WLP_FRAME_ABBREVIATED,
141 WLP_FRAME_CONTROL,
142 WLP_FRAME_ASSOCIATION,
143};
144
145/**
146 * WLP Association Message Type
147 * WLP Draft 0.99 [6.6.1.2 Table 8]
148 */
149enum wlp_assoc_type {
150 WLP_ASSOC_D1 = 2,
151 WLP_ASSOC_D2 = 3,
152 WLP_ASSOC_M1 = 4,
153 WLP_ASSOC_M2 = 5,
154 WLP_ASSOC_M3 = 7,
155 WLP_ASSOC_M4 = 8,
156 WLP_ASSOC_M5 = 9,
157 WLP_ASSOC_M6 = 10,
158 WLP_ASSOC_M7 = 11,
159 WLP_ASSOC_M8 = 12,
160 WLP_ASSOC_F0 = 14,
161 WLP_ASSOC_E1 = 32,
162 WLP_ASSOC_E2 = 33,
163 WLP_ASSOC_C1 = 34,
164 WLP_ASSOC_C2 = 35,
165 WLP_ASSOC_C3 = 36,
166 WLP_ASSOC_C4 = 37,
167};
168
169/**
170 * WLP Attribute Type
171 * WLP Draft 0.99 [6.6.1 Table 6]
172 */
173enum wlp_attr_type {
174 WLP_ATTR_AUTH = 0x1005, /* Authenticator */
175 WLP_ATTR_DEV_NAME = 0x1011, /* Device Name */
176 WLP_ATTR_DEV_PWD_ID = 0x1012, /* Device Password ID */
177 WLP_ATTR_E_HASH1 = 0x1014, /* E-Hash1 */
178 WLP_ATTR_E_HASH2 = 0x1015, /* E-Hash2 */
179 WLP_ATTR_E_SNONCE1 = 0x1016, /* E-SNonce1 */
180 WLP_ATTR_E_SNONCE2 = 0x1017, /* E-SNonce2 */
181 WLP_ATTR_ENCR_SET = 0x1018, /* Encrypted Settings */
182 WLP_ATTR_ENRL_NONCE = 0x101A, /* Enrollee Nonce */
183 WLP_ATTR_KEYWRAP_AUTH = 0x101E, /* Key Wrap Authenticator */
184 WLP_ATTR_MANUF = 0x1021, /* Manufacturer */
185 WLP_ATTR_MSG_TYPE = 0x1022, /* Message Type */
186 WLP_ATTR_MODEL_NAME = 0x1023, /* Model Name */
187 WLP_ATTR_MODEL_NR = 0x1024, /* Model Number */
188 WLP_ATTR_PUB_KEY = 0x1032, /* Public Key */
189 WLP_ATTR_REG_NONCE = 0x1039, /* Registrar Nonce */
190 WLP_ATTR_R_HASH1 = 0x103D, /* R-Hash1 */
191 WLP_ATTR_R_HASH2 = 0x103E, /* R-Hash2 */
192 WLP_ATTR_R_SNONCE1 = 0x103F, /* R-SNonce1 */
193 WLP_ATTR_R_SNONCE2 = 0x1040, /* R-SNonce2 */
194 WLP_ATTR_SERIAL = 0x1042, /* Serial number */
195 WLP_ATTR_UUID_E = 0x1047, /* UUID-E */
196 WLP_ATTR_UUID_R = 0x1048, /* UUID-R */
197 WLP_ATTR_PRI_DEV_TYPE = 0x1054, /* Primary Device Type */
198 WLP_ATTR_SEC_DEV_TYPE = 0x1055, /* Secondary Device Type */
199 WLP_ATTR_PORT_DEV = 0x1056, /* Portable Device */
200 WLP_ATTR_APP_EXT = 0x1058, /* Application Extension */
201 WLP_ATTR_WLP_VER = 0x2000, /* WLP Version */
202 WLP_ATTR_WSSID = 0x2001, /* WSSID */
203 WLP_ATTR_WSS_NAME = 0x2002, /* WSS Name */
204 WLP_ATTR_WSS_SEC_STAT = 0x2003, /* WSS Secure Status */
205 WLP_ATTR_WSS_BCAST = 0x2004, /* WSS Broadcast Address */
206 WLP_ATTR_WSS_M_KEY = 0x2005, /* WSS Master Key */
207 WLP_ATTR_ACC_ENRL = 0x2006, /* Accepting Enrollment */
208 WLP_ATTR_WSS_INFO = 0x2007, /* WSS Information */
209 WLP_ATTR_WSS_SEL_MTHD = 0x2008, /* WSS Selection Method */
210 WLP_ATTR_ASSC_MTHD_LIST = 0x2009, /* Association Methods List */
211 WLP_ATTR_SEL_ASSC_MTHD = 0x200A, /* Selected Association Method */
212 WLP_ATTR_ENRL_HASH_COMM = 0x200B, /* Enrollee Hash Commitment */
213 WLP_ATTR_WSS_TAG = 0x200C, /* WSS Tag */
214 WLP_ATTR_WSS_VIRT = 0x200D, /* WSS Virtual EUI-48 */
215 WLP_ATTR_WLP_ASSC_ERR = 0x200E, /* WLP Association Error */
216 WLP_ATTR_VNDR_EXT = 0x200F, /* Vendor Extension */
217};
218
219/**
220 * WLP Category ID of primary/secondary device
221 * WLP Draft 0.99 [6.6.1.8 Table 12]
222 */
223enum wlp_dev_category_id {
224 WLP_DEV_CAT_COMPUTER = 1,
225 WLP_DEV_CAT_INPUT,
226 WLP_DEV_CAT_PRINT_SCAN_FAX_COPIER,
227 WLP_DEV_CAT_CAMERA,
228 WLP_DEV_CAT_STORAGE,
229 WLP_DEV_CAT_INFRASTRUCTURE,
230 WLP_DEV_CAT_DISPLAY,
231 WLP_DEV_CAT_MULTIM,
232 WLP_DEV_CAT_GAMING,
233 WLP_DEV_CAT_TELEPHONE,
234 WLP_DEV_CAT_OTHER = 65535,
235};
236
237/**
238 * WLP WSS selection method
239 * WLP Draft 0.99 [6.6.1.6 Table 10]
240 */
241enum wlp_wss_sel_mthd {
242 WLP_WSS_ENRL_SELECT = 1, /* Enrollee selects */
243 WLP_WSS_REG_SELECT, /* Registrar selects */
244};
245
246/**
247 * WLP association error values
248 * WLP Draft 0.99 [6.6.1.5 Table 9]
249 */
250enum wlp_assc_error {
251 WLP_ASSOC_ERROR_NONE,
252 WLP_ASSOC_ERROR_AUTH, /* Authenticator Failure */
253 WLP_ASSOC_ERROR_ROGUE, /* Rogue activity suspected */
254 WLP_ASSOC_ERROR_BUSY, /* Device busy */
255 WLP_ASSOC_ERROR_LOCK, /* Setup Locked */
256 WLP_ASSOC_ERROR_NOT_READY, /* Registrar not ready */
257 WLP_ASSOC_ERROR_INV, /* Invalid WSS selection */
258 WLP_ASSOC_ERROR_MSG_TIME, /* Message timeout */
259 WLP_ASSOC_ERROR_ENR_TIME, /* Enrollment session timeout */
260 WLP_ASSOC_ERROR_PW, /* Device password invalid */
261 WLP_ASSOC_ERROR_VER, /* Unsupported version */
262 WLP_ASSOC_ERROR_INT, /* Internal error */
263 WLP_ASSOC_ERROR_UNDEF, /* Undefined error */
264 WLP_ASSOC_ERROR_NUM, /* Numeric comparison failure */
265 WLP_ASSOC_ERROR_WAIT, /* Waiting for user input */
266};
267
268/**
269 * WLP Parameters
270 * WLP 0.99 [7.7]
271 */
272enum wlp_parameters {
273 WLP_PER_MSG_TIMEOUT = 15, /* Seconds to wait for response to
274 association message. */
275};
276
277/**
278 * WLP IE
279 *
280 * The WLP IE should be included in beacons by all devices.
281 *
282 * The driver can set only a few of the fields in this information element,
283 * most fields are managed by the device self. When the driver needs to set
284 * a field it will only provide values for the fields of interest, the rest
285 * will be filled with zeroes. The fields of interest are:
286 *
287 * Element ID
288 * Length
289 * Capabilities (only to include WSSID Hash list length)
290 * WSSID Hash List fields
291 *
292 * WLP 0.99 [6.7]
293 *
294 * Only the fields that will be used are detailed in this structure, rest
295 * are not detailed or marked as "notused".
296 */
297struct wlp_ie {
298 struct uwb_ie_hdr hdr;
299 __le16 capabilities;
300 __le16 cycle_param;
301 __le16 acw_anchor_addr;
302 u8 wssid_hash_list[];
303} __packed;
304
305static inline int wlp_ie_hash_length(struct wlp_ie *ie)
306{
307 return (le16_to_cpu(ie->capabilities) >> 12) & 0xf;
308}
309
310static inline void wlp_ie_set_hash_length(struct wlp_ie *ie, int hash_length)
311{
312 u16 caps = le16_to_cpu(ie->capabilities);
313 caps = (caps & ~(0xf << 12)) | (hash_length << 12);
314 ie->capabilities = cpu_to_le16(caps);
315}
316
317/**
318 * WLP nonce
319 * WLP Draft 0.99 [6.6.1 Table 6]
320 *
321 * A 128-bit random number often used (E-SNonce1, E-SNonce2, Enrollee
322 * Nonce, Registrar Nonce, R-SNonce1, R-SNonce2). It is passed to HW so
323 * it is packed.
324 */
325struct wlp_nonce {
326 u8 data[16];
327} __packed;
328
329/**
330 * WLP UUID
331 * WLP Draft 0.99 [6.6.1 Table 6]
332 *
333 * Universally Unique Identifier (UUID) encoded as an octet string in the
334 * order the octets are shown in string representation in RFC4122. A UUID
335 * is often used (UUID-E, UUID-R, WSSID). It is passed to HW so it is packed.
336 */
337struct wlp_uuid {
338 u8 data[16];
339} __packed;
340
341
342/**
343 * Primary and secondary device type attributes
344 * WLP Draft 0.99 [6.6.1.8]
345 */
346struct wlp_dev_type {
347 enum wlp_dev_category_id category:16;
348 u8 OUI[3];
349 u8 OUIsubdiv;
350 __le16 subID;
351} __packed;
352
353/**
354 * WLP frame header
355 * WLP Draft 0.99 [6.2]
356 */
357struct wlp_frame_hdr {
358 __le16 mux_hdr; /* WLP_PROTOCOL_ID */
359 enum wlp_frame_type type:8;
360} __packed;
361
362/**
363 * WLP attribute field header
364 * WLP Draft 0.99 [6.6.1]
365 *
366 * Header of each attribute found in an association frame
367 */
368struct wlp_attr_hdr {
369 __le16 type;
370 __le16 length;
371} __packed;
372
373/**
374 * Device information commonly used together
375 *
376 * Each of these device information elements has a specified range in which it
377 * should fit (WLP 0.99 [Table 6]). This range provided in the spec does not
378 * include the termination null '\0' character (when used in the
379 * association protocol the attribute fields are accompanied
380 * with a "length" field so the full range from the spec can be used for
381 * the value). We thus allocate an extra byte to be able to store a string
382 * of max length with a terminating '\0'.
383 */
384struct wlp_device_info {
385 char name[33];
386 char model_name[33];
387 char manufacturer[65];
388 char model_nr[33];
389 char serial[33];
390 struct wlp_dev_type prim_dev_type;
391};
392
393/**
394 * Macros for the WLP attributes
395 *
396 * There are quite a few attributes (total is 43). The attribute layout can be
397 * in one of three categories: one value, an array, an enum forced to 8 bits.
398 * These macros help with their definitions.
399 */
400#define wlp_attr(type, name) \
401struct wlp_attr_##name { \
402 struct wlp_attr_hdr hdr; \
403 type name; \
404} __packed;
405
406#define wlp_attr_array(type, name) \
407struct wlp_attr_##name { \
408 struct wlp_attr_hdr hdr; \
409 type name[]; \
410} __packed;
411
412/**
413 * WLP association attribute fields
414 * WLP Draft 0.99 [6.6.1 Table 6]
415 *
416 * Attributes appear in same order as the Table in the spec
417 * FIXME Does not define all attributes yet
418 */
419
420/* Device name: Friendly name of sending device */
421wlp_attr_array(u8, dev_name)
422
423/* Enrollee Nonce: Random number generated by enrollee for an enrollment
424 * session */
425wlp_attr(struct wlp_nonce, enonce)
426
427/* Manufacturer name: Name of manufacturer of the sending device */
428wlp_attr_array(u8, manufacturer)
429
430/* WLP Message Type */
431wlp_attr(u8, msg_type)
432
433/* WLP Model name: Model name of sending device */
434wlp_attr_array(u8, model_name)
435
436/* WLP Model number: Model number of sending device */
437wlp_attr_array(u8, model_nr)
438
439/* Registrar Nonce: Random number generated by registrar for an enrollment
440 * session */
441wlp_attr(struct wlp_nonce, rnonce)
442
443/* Serial number of device */
444wlp_attr_array(u8, serial)
445
446/* UUID of enrollee */
447wlp_attr(struct wlp_uuid, uuid_e)
448
449/* UUID of registrar */
450wlp_attr(struct wlp_uuid, uuid_r)
451
452/* WLP Primary device type */
453wlp_attr(struct wlp_dev_type, prim_dev_type)
454
455/* WLP Secondary device type */
456wlp_attr(struct wlp_dev_type, sec_dev_type)
457
458/* WLP protocol version */
459wlp_attr(u8, version)
460
461/* WLP service set identifier */
462wlp_attr(struct wlp_uuid, wssid)
463
464/* WLP WSS name */
465wlp_attr_array(u8, wss_name)
466
467/* WLP WSS Secure Status */
468wlp_attr(u8, wss_sec_status)
469
470/* WSS Broadcast Address */
471wlp_attr(struct uwb_mac_addr, wss_bcast)
472
473/* WLP Accepting Enrollment */
474wlp_attr(u8, accept_enrl)
475
476/**
477 * WSS information attributes
478 * WLP Draft 0.99 [6.6.3 Table 15]
479 */
480struct wlp_wss_info {
481 struct wlp_attr_wssid wssid;
482 struct wlp_attr_wss_name name;
483 struct wlp_attr_accept_enrl accept;
484 struct wlp_attr_wss_sec_status sec_stat;
485 struct wlp_attr_wss_bcast bcast;
486} __packed;
487
488/* WLP WSS Information */
489wlp_attr_array(struct wlp_wss_info, wss_info)
490
491/* WLP WSS Selection method */
492wlp_attr(u8, wss_sel_mthd)
493
494/* WLP WSS tag */
495wlp_attr(u8, wss_tag)
496
497/* WSS Virtual Address */
498wlp_attr(struct uwb_mac_addr, wss_virt)
499
500/* WLP association error */
501wlp_attr(u8, wlp_assc_err)
502
503/**
504 * WLP standard and abbreviated frames
505 *
506 * WLP Draft 0.99 [6.3] and [6.4]
507 *
508 * The difference between the WLP standard frame and the WLP
509 * abbreviated frame is that the standard frame includes the src
510 * and dest addresses from the Ethernet header, the abbreviated frame does
511 * not.
512 * The src/dest (as well as the type/length and client data) are already
513 * defined as part of the Ethernet header, we do not do this here.
514 * From this perspective the standard and abbreviated frames appear the
515 * same - they will be treated differently though.
516 *
517 * The size of this header is also captured in WLP_DATA_HLEN to enable
518 * interfaces to prepare their headroom.
519 */
520struct wlp_frame_std_abbrv_hdr {
521 struct wlp_frame_hdr hdr;
522 u8 tag;
523} __packed;
524
525/**
526 * WLP association frames
527 *
528 * WLP Draft 0.99 [6.6]
529 */
530struct wlp_frame_assoc {
531 struct wlp_frame_hdr hdr;
532 enum wlp_assoc_type type:8;
533 struct wlp_attr_version version;
534 struct wlp_attr_msg_type msg_type;
535 u8 attr[];
536} __packed;
537
538/* Ethernet to dev address mapping */
539struct wlp_eda {
540 spinlock_t lock;
541 struct list_head cache; /* Eth<->Dev Addr cache */
542};
543
544/**
545 * WSS information temporary storage
546 *
547 * This information is only stored temporarily during discovery. It should
548 * not be stored unless the device is enrolled in the advertised WSS. This
549 * is done mainly because we follow the letter of the spec in this regard.
550 * See WLP 0.99 [7.2.3].
551 * When the device does become enrolled in a WSS the WSS information will
552 * be stored as part of the more comprehensive struct wlp_wss.
553 */
554struct wlp_wss_tmp_info {
555 char name[WLP_WSS_NAME_SIZE];
556 u8 accept_enroll;
557 u8 sec_status;
558 struct uwb_mac_addr bcast;
559};
560
561struct wlp_wssid_e {
562 struct list_head node;
563 struct wlp_uuid wssid;
564 struct wlp_wss_tmp_info *info;
565};
566
567/**
568 * A cache entry of WLP neighborhood
569 *
570 * @node: head of list is wlp->neighbors
571 * @wssid: list of wssids of this neighbor, element is wlp_wssid_e
572 * @info: temporary storage for information learned during discovery. This
573 * storage is used together with the wssid_e temporary storage
574 * during discovery.
575 */
576struct wlp_neighbor_e {
577 struct list_head node;
578 struct wlp_uuid uuid;
579 struct uwb_dev *uwb_dev;
580 struct list_head wssid; /* Elements are wlp_wssid_e */
581 struct wlp_device_info *info;
582};
583
584struct wlp;
585/**
586 * Information for an association session in progress.
587 *
588 * @exp_message: The type of the expected message. Both this message and a
589 * F0 message (which can be sent in response to any
590 * association frame) will be accepted as a valid message for
591 * this session.
592 * @cb: The function that will be called upon receipt of this
593 * message.
594 * @cb_priv: Private data of callback
595 * @data: Data used in association process (always a sk_buff?)
596 * @neighbor: Address of neighbor with which association session is in
597 * progress.
598 */
599struct wlp_session {
600 enum wlp_assoc_type exp_message;
601 void (*cb)(struct wlp *);
602 void *cb_priv;
603 void *data;
604 struct uwb_dev_addr neighbor_addr;
605};
606
607/**
608 * WLP Service Set
609 *
610 * @mutex: used to protect entire WSS structure.
611 *
612 * @name: The WSS name is set to 65 bytes, 1 byte larger than the maximum
613 * allowed by the WLP spec. This is to have a null terminated string
614 * for display to the user. A maximum of 64 bytes will still be used
615 * when placing the WSS name field in association frames.
616 *
617 * @accept_enroll: Accepting enrollment: Set to one if registrar is
618 * accepting enrollment in WSS, or zero otherwise.
619 *
620 * Global and local information for each WSS in which we are enrolled.
621 * WLP 0.99 Section 7.2.1 and Section 7.2.2
622 */
623struct wlp_wss {
624 struct mutex mutex;
625 struct kobject kobj;
626 /* Global properties. */
627 struct wlp_uuid wssid;
628 u8 hash;
629 char name[WLP_WSS_NAME_SIZE];
630 struct uwb_mac_addr bcast;
631 u8 secure_status:1;
632 u8 master_key[16];
633 /* Local properties. */
634 u8 tag;
635 struct uwb_mac_addr virtual_addr;
636 /* Extra */
637 u8 accept_enroll:1;
638 enum wlp_wss_state state;
639};
640
641/**
642 * WLP main structure
643 * @mutex: protect changes to WLP structure. We only allow changes to the
644 * uuid, so currently this mutex only protects this field.
645 */
646struct wlp {
647 struct mutex mutex;
648 struct uwb_rc *rc; /* UWB radio controller */
649 struct net_device *ndev;
650 struct uwb_pal pal;
651 struct wlp_eda eda;
652 struct wlp_uuid uuid;
653 struct wlp_session *session;
654 struct wlp_wss wss;
655 struct mutex nbmutex; /* Neighbor mutex protects neighbors list */
656 struct list_head neighbors; /* Elements are wlp_neighbor_e */
657 struct uwb_notifs_handler uwb_notifs_handler;
658 struct wlp_device_info *dev_info;
659 void (*fill_device_info)(struct wlp *wlp, struct wlp_device_info *info);
660 int (*xmit_frame)(struct wlp *, struct sk_buff *,
661 struct uwb_dev_addr *);
662 void (*stop_queue)(struct wlp *);
663 void (*start_queue)(struct wlp *);
664};
665
666/* sysfs */
667
668
669struct wlp_wss_attribute {
670 struct attribute attr;
671 ssize_t (*show)(struct wlp_wss *wss, char *buf);
672 ssize_t (*store)(struct wlp_wss *wss, const char *buf, size_t count);
673};
674
675#define WSS_ATTR(_name, _mode, _show, _store) \
676static struct wlp_wss_attribute wss_attr_##_name = __ATTR(_name, _mode, \
677 _show, _store)
678
679extern int wlp_setup(struct wlp *, struct uwb_rc *, struct net_device *ndev);
680extern void wlp_remove(struct wlp *);
681extern ssize_t wlp_neighborhood_show(struct wlp *, char *);
682extern int wlp_wss_setup(struct net_device *, struct wlp_wss *);
683extern void wlp_wss_remove(struct wlp_wss *);
684extern ssize_t wlp_wss_activate_show(struct wlp_wss *, char *);
685extern ssize_t wlp_wss_activate_store(struct wlp_wss *, const char *, size_t);
686extern ssize_t wlp_eda_show(struct wlp *, char *);
687extern ssize_t wlp_eda_store(struct wlp *, const char *, size_t);
688extern ssize_t wlp_uuid_show(struct wlp *, char *);
689extern ssize_t wlp_uuid_store(struct wlp *, const char *, size_t);
690extern ssize_t wlp_dev_name_show(struct wlp *, char *);
691extern ssize_t wlp_dev_name_store(struct wlp *, const char *, size_t);
692extern ssize_t wlp_dev_manufacturer_show(struct wlp *, char *);
693extern ssize_t wlp_dev_manufacturer_store(struct wlp *, const char *, size_t);
694extern ssize_t wlp_dev_model_name_show(struct wlp *, char *);
695extern ssize_t wlp_dev_model_name_store(struct wlp *, const char *, size_t);
696extern ssize_t wlp_dev_model_nr_show(struct wlp *, char *);
697extern ssize_t wlp_dev_model_nr_store(struct wlp *, const char *, size_t);
698extern ssize_t wlp_dev_serial_show(struct wlp *, char *);
699extern ssize_t wlp_dev_serial_store(struct wlp *, const char *, size_t);
700extern ssize_t wlp_dev_prim_category_show(struct wlp *, char *);
701extern ssize_t wlp_dev_prim_category_store(struct wlp *, const char *,
702 size_t);
703extern ssize_t wlp_dev_prim_OUI_show(struct wlp *, char *);
704extern ssize_t wlp_dev_prim_OUI_store(struct wlp *, const char *, size_t);
705extern ssize_t wlp_dev_prim_OUI_sub_show(struct wlp *, char *);
706extern ssize_t wlp_dev_prim_OUI_sub_store(struct wlp *, const char *,
707 size_t);
708extern ssize_t wlp_dev_prim_subcat_show(struct wlp *, char *);
709extern ssize_t wlp_dev_prim_subcat_store(struct wlp *, const char *,
710 size_t);
711extern int wlp_receive_frame(struct device *, struct wlp *, struct sk_buff *,
712 struct uwb_dev_addr *);
713extern int wlp_prepare_tx_frame(struct device *, struct wlp *,
714 struct sk_buff *, struct uwb_dev_addr *);
715void wlp_reset_all(struct wlp *wlp);
716
717/**
718 * Initialize WSS
719 */
720static inline
721void wlp_wss_init(struct wlp_wss *wss)
722{
723 mutex_init(&wss->mutex);
724}
725
726static inline
727void wlp_init(struct wlp *wlp)
728{
729 INIT_LIST_HEAD(&wlp->neighbors);
730 mutex_init(&wlp->mutex);
731 mutex_init(&wlp->nbmutex);
732 wlp_wss_init(&wlp->wss);
733}
734
735
736#endif /* #ifndef __LINUX__WLP_H_ */
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 070bb7a8893..0c0771f06bf 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -190,7 +190,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
190 __INIT_WORK((_work), (_func), 0); \ 190 __INIT_WORK((_work), (_func), 0); \
191 } while (0) 191 } while (0)
192 192
193#define INIT_WORK_ON_STACK(_work, _func) \ 193#define INIT_WORK_ONSTACK(_work, _func) \
194 do { \ 194 do { \
195 __INIT_WORK((_work), (_func), 1); \ 195 __INIT_WORK((_work), (_func), 1); \
196 } while (0) 196 } while (0)
@@ -201,9 +201,9 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
201 init_timer(&(_work)->timer); \ 201 init_timer(&(_work)->timer); \
202 } while (0) 202 } while (0)
203 203
204#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ 204#define INIT_DELAYED_WORK_ONSTACK(_work, _func) \
205 do { \ 205 do { \
206 INIT_WORK_ON_STACK(&(_work)->work, (_func)); \ 206 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
207 init_timer_on_stack(&(_work)->timer); \ 207 init_timer_on_stack(&(_work)->timer); \
208 } while (0) 208 } while (0)
209 209
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 72a5d647a5f..0ead399e08b 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -10,8 +10,6 @@
10struct backing_dev_info; 10struct backing_dev_info;
11 11
12extern spinlock_t inode_lock; 12extern spinlock_t inode_lock;
13extern struct list_head inode_in_use;
14extern struct list_head inode_unused;
15 13
16/* 14/*
17 * fs/fs-writeback.c 15 * fs/fs-writeback.c
@@ -60,7 +58,9 @@ struct writeback_control {
60struct bdi_writeback; 58struct bdi_writeback;
61int inode_wait(void *); 59int inode_wait(void *);
62void writeback_inodes_sb(struct super_block *); 60void writeback_inodes_sb(struct super_block *);
61void writeback_inodes_sb_nr(struct super_block *, unsigned long nr);
63int writeback_inodes_sb_if_idle(struct super_block *); 62int writeback_inodes_sb_if_idle(struct super_block *);
63int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr);
64void sync_inodes_sb(struct super_block *); 64void sync_inodes_sb(struct super_block *);
65void writeback_inodes_wb(struct bdi_writeback *wb, 65void writeback_inodes_wb(struct bdi_writeback *wb,
66 struct writeback_control *wbc); 66 struct writeback_control *wbc);
@@ -143,12 +143,16 @@ typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
143 143
144int generic_writepages(struct address_space *mapping, 144int generic_writepages(struct address_space *mapping,
145 struct writeback_control *wbc); 145 struct writeback_control *wbc);
146void tag_pages_for_writeback(struct address_space *mapping,
147 pgoff_t start, pgoff_t end);
146int write_cache_pages(struct address_space *mapping, 148int write_cache_pages(struct address_space *mapping,
147 struct writeback_control *wbc, writepage_t writepage, 149 struct writeback_control *wbc, writepage_t writepage,
148 void *data); 150 void *data);
149int do_writepages(struct address_space *mapping, struct writeback_control *wbc); 151int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
150void set_page_dirty_balance(struct page *page, int page_mkwrite); 152void set_page_dirty_balance(struct page *page, int page_mkwrite);
151void writeback_set_ratelimit(void); 153void writeback_set_ratelimit(void);
154void tag_pages_for_writeback(struct address_space *mapping,
155 pgoff_t start, pgoff_t end);
152 156
153/* pdflush.c */ 157/* pdflush.c */
154extern int nr_pdflush_threads; /* Global so it can be exported to sysctl 158extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
diff --git a/include/media/ir-core.h b/include/media/ir-core.h
index eb7fddf8f60..6dc37fae660 100644
--- a/include/media/ir-core.h
+++ b/include/media/ir-core.h
@@ -60,6 +60,7 @@ enum rc_driver_type {
60 * @s_idle: optional: enable/disable hardware idle mode, upon which, 60 * @s_idle: optional: enable/disable hardware idle mode, upon which,
61 device doesn't interrupt host until it sees IR pulses 61 device doesn't interrupt host until it sees IR pulses
62 * @s_learning_mode: enable wide band receiver used for learning 62 * @s_learning_mode: enable wide band receiver used for learning
63 * @s_carrier_report: enable carrier reports
63 */ 64 */
64struct ir_dev_props { 65struct ir_dev_props {
65 enum rc_driver_type driver_type; 66 enum rc_driver_type driver_type;
@@ -82,8 +83,9 @@ struct ir_dev_props {
82 int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle); 83 int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle);
83 int (*s_rx_carrier_range)(void *priv, u32 min, u32 max); 84 int (*s_rx_carrier_range)(void *priv, u32 min, u32 max);
84 int (*tx_ir)(void *priv, int *txbuf, u32 n); 85 int (*tx_ir)(void *priv, int *txbuf, u32 n);
85 void (*s_idle)(void *priv, int enable); 86 void (*s_idle)(void *priv, bool enable);
86 int (*s_learning_mode)(void *priv, int enable); 87 int (*s_learning_mode)(void *priv, int enable);
88 int (*s_carrier_report) (void *priv, int enable);
87}; 89};
88 90
89struct ir_input_dev { 91struct ir_input_dev {
@@ -157,27 +159,54 @@ void ir_input_unregister(struct input_dev *input_dev);
157 159
158void ir_repeat(struct input_dev *dev); 160void ir_repeat(struct input_dev *dev);
159void ir_keydown(struct input_dev *dev, int scancode, u8 toggle); 161void ir_keydown(struct input_dev *dev, int scancode, u8 toggle);
162void ir_keyup(struct ir_input_dev *ir);
160u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode); 163u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode);
161 164
162/* From ir-raw-event.c */ 165/* From ir-raw-event.c */
163 166
164struct ir_raw_event { 167struct ir_raw_event {
165 unsigned pulse:1; 168 union {
166 unsigned duration:31; 169 u32 duration;
170
171 struct {
172 u32 carrier;
173 u8 duty_cycle;
174 };
175 };
176
177 unsigned pulse:1;
178 unsigned reset:1;
179 unsigned timeout:1;
180 unsigned carrier_report:1;
167}; 181};
168 182
169#define IR_MAX_DURATION 0x7FFFFFFF /* a bit more than 2 seconds */ 183#define DEFINE_IR_RAW_EVENT(event) \
184 struct ir_raw_event event = { \
185 { .duration = 0 } , \
186 .pulse = 0, \
187 .reset = 0, \
188 .timeout = 0, \
189 .carrier_report = 0 }
190
191static inline void init_ir_raw_event(struct ir_raw_event *ev)
192{
193 memset(ev, 0, sizeof(*ev));
194}
195
196#define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */
170 197
171void ir_raw_event_handle(struct input_dev *input_dev); 198void ir_raw_event_handle(struct input_dev *input_dev);
172int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev); 199int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev);
173int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type); 200int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type);
174int ir_raw_event_store_with_filter(struct input_dev *input_dev, 201int ir_raw_event_store_with_filter(struct input_dev *input_dev,
175 struct ir_raw_event *ev); 202 struct ir_raw_event *ev);
176void ir_raw_event_set_idle(struct input_dev *input_dev, int idle); 203void ir_raw_event_set_idle(struct input_dev *input_dev, bool idle);
177 204
178static inline void ir_raw_event_reset(struct input_dev *input_dev) 205static inline void ir_raw_event_reset(struct input_dev *input_dev)
179{ 206{
180 struct ir_raw_event ev = { .pulse = false, .duration = 0 }; 207 DEFINE_IR_RAW_EVENT(ev);
208 ev.reset = true;
209
181 ir_raw_event_store(input_dev, &ev); 210 ir_raw_event_store(input_dev, &ev);
182 ir_raw_event_handle(input_dev); 211 ir_raw_event_handle(input_dev);
183} 212}
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index 5e96d7a430b..557c676ab7d 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -3,6 +3,8 @@
3 3
4#include <media/ir-common.h> 4#include <media/ir-common.h>
5 5
6#define DEFAULT_POLLING_INTERVAL 100 /* ms */
7
6struct IR_i2c; 8struct IR_i2c;
7 9
8struct IR_i2c { 10struct IR_i2c {
@@ -15,6 +17,8 @@ struct IR_i2c {
15 /* Used to avoid fast repeating */ 17 /* Used to avoid fast repeating */
16 unsigned char old; 18 unsigned char old;
17 19
20 u32 polling_interval; /* in ms */
21
18 struct delayed_work work; 22 struct delayed_work work;
19 char name[32]; 23 char name[32];
20 char phys[32]; 24 char phys[32];
@@ -24,7 +28,6 @@ struct IR_i2c {
24enum ir_kbd_get_key_fn { 28enum ir_kbd_get_key_fn {
25 IR_KBD_GET_KEY_CUSTOM = 0, 29 IR_KBD_GET_KEY_CUSTOM = 0,
26 IR_KBD_GET_KEY_PIXELVIEW, 30 IR_KBD_GET_KEY_PIXELVIEW,
27 IR_KBD_GET_KEY_PV951,
28 IR_KBD_GET_KEY_HAUP, 31 IR_KBD_GET_KEY_HAUP,
29 IR_KBD_GET_KEY_KNC1, 32 IR_KBD_GET_KEY_KNC1,
30 IR_KBD_GET_KEY_FUSIONHDTV, 33 IR_KBD_GET_KEY_FUSIONHDTV,
@@ -35,8 +38,9 @@ enum ir_kbd_get_key_fn {
35/* Can be passed when instantiating an ir_video i2c device */ 38/* Can be passed when instantiating an ir_video i2c device */
36struct IR_i2c_init_data { 39struct IR_i2c_init_data {
37 char *ir_codes; 40 char *ir_codes;
38 const char *name; 41 const char *name;
39 u64 type; /* IR_TYPE_RC5, etc */ 42 u64 type; /* IR_TYPE_RC5, etc */
43 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
40 /* 44 /*
41 * Specify either a function pointer or a value indicating one of 45 * Specify either a function pointer or a value indicating one of
42 * ir_kbd_i2c's internal get_key functions 46 * ir_kbd_i2c's internal get_key functions
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index b1f60663cb3..54780a560d0 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -125,10 +125,10 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf,
125struct lirc_driver { 125struct lirc_driver {
126 char name[40]; 126 char name[40];
127 int minor; 127 int minor;
128 unsigned long code_length; 128 __u32 code_length;
129 unsigned int buffer_size; /* in chunks holding one code each */ 129 unsigned int buffer_size; /* in chunks holding one code each */
130 int sample_rate; 130 int sample_rate;
131 unsigned long features; 131 __u32 features;
132 132
133 unsigned int chunk_size; 133 unsigned int chunk_size;
134 134
@@ -139,7 +139,7 @@ struct lirc_driver {
139 struct lirc_buffer *rbuf; 139 struct lirc_buffer *rbuf;
140 int (*set_use_inc) (void *data); 140 int (*set_use_inc) (void *data);
141 void (*set_use_dec) (void *data); 141 void (*set_use_dec) (void *data);
142 struct file_operations *fops; 142 const struct file_operations *fops;
143 struct device *dev; 143 struct device *dev;
144 struct module *owner; 144 struct module *owner;
145}; 145};
diff --git a/include/media/omap1_camera.h b/include/media/omap1_camera.h
new file mode 100644
index 00000000000..819767cf04d
--- /dev/null
+++ b/include/media/omap1_camera.h
@@ -0,0 +1,35 @@
1/*
2 * Header for V4L2 SoC Camera driver for OMAP1 Camera Interface
3 *
4 * Copyright (C) 2010, Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __MEDIA_OMAP1_CAMERA_H_
12#define __MEDIA_OMAP1_CAMERA_H_
13
14#include <linux/bitops.h>
15
16#define OMAP1_CAMERA_IOSIZE 0x1c
17
18enum omap1_cam_vb_mode {
19 OMAP1_CAM_DMA_CONTIG = 0,
20 OMAP1_CAM_DMA_SG,
21};
22
23#define OMAP1_CAMERA_MIN_BUF_COUNT(x) ((x) == OMAP1_CAM_DMA_CONTIG ? 3 : 2)
24
25struct omap1_cam_platform_data {
26 unsigned long camexclk_khz;
27 unsigned long lclk_khz_max;
28 unsigned long flags;
29};
30
31#define OMAP1_CAMERA_LCLK_RISING BIT(0)
32#define OMAP1_CAMERA_RST_LOW BIT(1)
33#define OMAP1_CAMERA_RST_HIGH BIT(2)
34
35#endif /* __MEDIA_OMAP1_CAMERA_H_ */
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index a9c041d4966..e0f17edf38e 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -17,12 +17,13 @@
17#define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ 17#define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */
18#define IR_TYPE_JVC (1 << 3) /* JVC protocol */ 18#define IR_TYPE_JVC (1 << 3) /* JVC protocol */
19#define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ 19#define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
20#define IR_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
20#define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ 21#define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
21#define IR_TYPE_OTHER (1u << 31) 22#define IR_TYPE_OTHER (1u << 31)
22 23
23#define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ 24#define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \
24 IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ 25 IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \
25 IR_TYPE_OTHER) 26 IR_TYPE_RC5_SZ | IR_TYPE_OTHER)
26 27
27struct ir_scancode { 28struct ir_scancode {
28 u32 scancode; 29 u32 scancode;
@@ -35,7 +36,7 @@ struct ir_scancode_table {
35 unsigned int len; /* Used number of entries */ 36 unsigned int len; /* Used number of entries */
36 unsigned int alloc; /* Size of *scan in bytes */ 37 unsigned int alloc; /* Size of *scan in bytes */
37 u64 ir_type; 38 u64 ir_type;
38 char *name; 39 const char *name;
39 spinlock_t lock; 40 spinlock_t lock;
40}; 41};
41 42
@@ -54,6 +55,8 @@ void rc_map_init(void);
54/* Names of the several keytables defined in-kernel */ 55/* Names of the several keytables defined in-kernel */
55 56
56#define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci" 57#define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci"
58#define RC_MAP_ALINK_DTU_M "rc-alink-dtu-m"
59#define RC_MAP_ANYSEE "rc-anysee"
57#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" 60#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp"
58#define RC_MAP_ASUS_PC39 "rc-asus-pc39" 61#define RC_MAP_ASUS_PC39 "rc-asus-pc39"
59#define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" 62#define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600"
@@ -62,8 +65,10 @@ void rc_map_init(void);
62#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" 65#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt"
63#define RC_MAP_AVERMEDIA_M135A "rc-avermedia-m135a" 66#define RC_MAP_AVERMEDIA_M135A "rc-avermedia-m135a"
64#define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6" 67#define RC_MAP_AVERMEDIA_M733A_RM_K6 "rc-avermedia-m733a-rm-k6"
68#define RC_MAP_AVERMEDIA_RM_KS "rc-avermedia-rm-ks"
65#define RC_MAP_AVERMEDIA "rc-avermedia" 69#define RC_MAP_AVERMEDIA "rc-avermedia"
66#define RC_MAP_AVERTV_303 "rc-avertv-303" 70#define RC_MAP_AVERTV_303 "rc-avertv-303"
71#define RC_MAP_AZUREWAVE_AD_TU700 "rc-azurewave-ad-tu700"
67#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus" 72#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus"
68#define RC_MAP_BEHOLD "rc-behold" 73#define RC_MAP_BEHOLD "rc-behold"
69#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" 74#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old"
@@ -71,6 +76,8 @@ void rc_map_init(void);
71#define RC_MAP_CINERGY "rc-cinergy" 76#define RC_MAP_CINERGY "rc-cinergy"
72#define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec" 77#define RC_MAP_DIB0700_NEC_TABLE "rc-dib0700-nec"
73#define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5" 78#define RC_MAP_DIB0700_RC5_TABLE "rc-dib0700-rc5"
79#define RC_MAP_DIGITALNOW_TINYTWIN "rc-digitalnow-tinytwin"
80#define RC_MAP_DIGITTRADE "rc-digittrade"
74#define RC_MAP_DM1105_NEC "rc-dm1105-nec" 81#define RC_MAP_DM1105_NEC "rc-dm1105-nec"
75#define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro" 82#define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro"
76#define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t" 83#define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t"
@@ -94,8 +101,12 @@ void rc_map_init(void);
94#define RC_MAP_KAIOMY "rc-kaiomy" 101#define RC_MAP_KAIOMY "rc-kaiomy"
95#define RC_MAP_KWORLD_315U "rc-kworld-315u" 102#define RC_MAP_KWORLD_315U "rc-kworld-315u"
96#define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" 103#define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog"
104#define RC_MAP_LEADTEK_Y04G0051 "rc-leadtek-y04g0051"
97#define RC_MAP_LIRC "rc-lirc" 105#define RC_MAP_LIRC "rc-lirc"
106#define RC_MAP_LME2510 "rc-lme2510"
98#define RC_MAP_MANLI "rc-manli" 107#define RC_MAP_MANLI "rc-manli"
108#define RC_MAP_MSI_DIGIVOX_II "rc-msi-digivox-ii"
109#define RC_MAP_MSI_DIGIVOX_III "rc-msi-digivox-iii"
99#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" 110#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus"
100#define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" 111#define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere"
101#define RC_MAP_NEBULA "rc-nebula" 112#define RC_MAP_NEBULA "rc-nebula"
@@ -114,14 +125,18 @@ void rc_map_init(void);
114#define RC_MAP_PURPLETV "rc-purpletv" 125#define RC_MAP_PURPLETV "rc-purpletv"
115#define RC_MAP_PV951 "rc-pv951" 126#define RC_MAP_PV951 "rc-pv951"
116#define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" 127#define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new"
117#define RC_MAP_RC5_STREAMZAP "rc-rc5-streamzap"
118#define RC_MAP_RC5_TV "rc-rc5-tv" 128#define RC_MAP_RC5_TV "rc-rc5-tv"
119#define RC_MAP_RC6_MCE "rc-rc6-mce" 129#define RC_MAP_RC6_MCE "rc-rc6-mce"
120#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" 130#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
131#define RC_MAP_STREAMZAP "rc-streamzap"
121#define RC_MAP_TBS_NEC "rc-tbs-nec" 132#define RC_MAP_TBS_NEC "rc-tbs-nec"
122#define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" 133#define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs"
134#define RC_MAP_TERRATEC_SLIM "rc-terratec-slim"
123#define RC_MAP_TEVII_NEC "rc-tevii-nec" 135#define RC_MAP_TEVII_NEC "rc-tevii-nec"
136#define RC_MAP_TOTAL_MEDIA_IN_HAND "rc-total-media-in-hand"
137#define RC_MAP_TREKSTOR "rc-trekstor"
124#define RC_MAP_TT_1500 "rc-tt-1500" 138#define RC_MAP_TT_1500 "rc-tt-1500"
139#define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027"
125#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" 140#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350"
126#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" 141#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr"
127#define RC_MAP_WINFAST "rc-winfast" 142#define RC_MAP_WINFAST "rc-winfast"
diff --git a/include/media/s3c_fimc.h b/include/media/s3c_fimc.h
new file mode 100644
index 00000000000..ca1b6738e4a
--- /dev/null
+++ b/include/media/s3c_fimc.h
@@ -0,0 +1,60 @@
1/*
2 * Samsung S5P SoC camera interface driver header
3 *
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd
5 * Author: Sylwester Nawrocki, <s.nawrocki@samsung.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 S3C_FIMC_H_
13#define S3C_FIMC_H_
14
15enum cam_bus_type {
16 FIMC_ITU_601 = 1,
17 FIMC_ITU_656,
18 FIMC_MIPI_CSI2,
19 FIMC_LCD_WB, /* FIFO link from LCD mixer */
20};
21
22#define FIMC_CLK_INV_PCLK (1 << 0)
23#define FIMC_CLK_INV_VSYNC (1 << 1)
24#define FIMC_CLK_INV_HREF (1 << 2)
25#define FIMC_CLK_INV_HSYNC (1 << 3)
26
27struct i2c_board_info;
28
29/**
30 * struct s3c_fimc_isp_info - image sensor information required for host
31 * interace configuration.
32 *
33 * @board_info: pointer to I2C subdevice's board info
34 * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc.
35 * @i2c_bus_num: i2c control bus id the sensor is attached to
36 * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
37 * @bus_width: camera data bus width in bits
38 * @flags: flags defining bus signals polarity inversion (High by default)
39 */
40struct s3c_fimc_isp_info {
41 struct i2c_board_info *board_info;
42 enum cam_bus_type bus_type;
43 u16 i2c_bus_num;
44 u16 mux_id;
45 u16 bus_width;
46 u16 flags;
47};
48
49
50#define FIMC_MAX_CAMIF_CLIENTS 2
51
52/**
53 * struct s3c_platform_fimc - camera host interface platform data
54 *
55 * @isp_info: properties of camera sensor required for host interface setup
56 */
57struct s3c_platform_fimc {
58 struct s3c_fimc_isp_info *isp_info[FIMC_MAX_CAMIF_CLIENTS];
59};
60#endif /* S3C_FIMC_H_ */
diff --git a/include/media/sh_vou.h b/include/media/sh_vou.h
index a3ef30242b0..ec3ba9a597a 100644
--- a/include/media/sh_vou.h
+++ b/include/media/sh_vou.h
@@ -28,7 +28,6 @@ struct sh_vou_pdata {
28 int i2c_adap; 28 int i2c_adap;
29 struct i2c_board_info *board_info; 29 struct i2c_board_info *board_info;
30 unsigned long flags; 30 unsigned long flags;
31 char *module_name;
32}; 31};
33 32
34#endif 33#endif
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 2ce957301f7..86e3631764e 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -21,6 +21,8 @@
21 21
22extern struct bus_type soc_camera_bus_type; 22extern struct bus_type soc_camera_bus_type;
23 23
24struct file;
25
24struct soc_camera_device { 26struct soc_camera_device {
25 struct list_head list; 27 struct list_head list;
26 struct device dev; 28 struct device dev;
@@ -41,10 +43,7 @@ struct soc_camera_device {
41 /* soc_camera.c private count. Only accessed with .video_lock held */ 43 /* soc_camera.c private count. Only accessed with .video_lock held */
42 int use_count; 44 int use_count;
43 struct mutex video_lock; /* Protects device data */ 45 struct mutex video_lock; /* Protects device data */
44}; 46 struct file *streamer; /* stream owner */
45
46struct soc_camera_file {
47 struct soc_camera_device *icd;
48 struct videobuf_queue vb_vidq; 47 struct videobuf_queue vb_vidq;
49}; 48};
50 49
@@ -79,7 +78,7 @@ struct soc_camera_host_ops {
79 int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *); 78 int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
80 void (*init_videobuf)(struct videobuf_queue *, 79 void (*init_videobuf)(struct videobuf_queue *,
81 struct soc_camera_device *); 80 struct soc_camera_device *);
82 int (*reqbufs)(struct soc_camera_file *, struct v4l2_requestbuffers *); 81 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *);
83 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); 82 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
84 int (*set_bus_param)(struct soc_camera_device *, __u32); 83 int (*set_bus_param)(struct soc_camera_device *, __u32);
85 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); 84 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *);
diff --git a/include/media/sr030pc30.h b/include/media/sr030pc30.h
new file mode 100644
index 00000000000..6f901a653ba
--- /dev/null
+++ b/include/media/sr030pc30.h
@@ -0,0 +1,21 @@
1/*
2 * Driver header for SR030PC30 camera sensor
3 *
4 * Copyright (c) 2010 Samsung Electronics, Co. Ltd
5 * Contact: Sylwester Nawrocki <s.nawrocki@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef SR030PC30_H
14#define SR030PC30_H
15
16struct sr030pc30_platform_data {
17 unsigned long clk_rate; /* master clock frequency in Hz */
18 int (*set_power)(struct device *dev, int on);
19};
20
21#endif /* SR030PC30_H */
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 21b4428c12a..51e89f2267b 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -38,6 +38,9 @@ enum {
38 /* module tvaudio: reserved range 50-99 */ 38 /* module tvaudio: reserved range 50-99 */
39 V4L2_IDENT_TVAUDIO = 50, /* A tvaudio chip, unknown which it is exactly */ 39 V4L2_IDENT_TVAUDIO = 50, /* A tvaudio chip, unknown which it is exactly */
40 40
41 /* Sony IMX074 */
42 V4L2_IDENT_IMX074 = 74,
43
41 /* module saa7110: just ident 100 */ 44 /* module saa7110: just ident 100 */
42 V4L2_IDENT_SAA7110 = 100, 45 V4L2_IDENT_SAA7110 = 100,
43 46
@@ -70,6 +73,7 @@ enum {
70 V4L2_IDENT_OV9655 = 255, 73 V4L2_IDENT_OV9655 = 255,
71 V4L2_IDENT_SOI968 = 256, 74 V4L2_IDENT_SOI968 = 256,
72 V4L2_IDENT_OV9640 = 257, 75 V4L2_IDENT_OV9640 = 257,
76 V4L2_IDENT_OV6650 = 258,
73 77
74 /* module saa7146: reserved range 300-309 */ 78 /* module saa7146: reserved range 300-309 */
75 V4L2_IDENT_SAA7146 = 300, 79 V4L2_IDENT_SAA7146 = 300,
@@ -111,6 +115,10 @@ enum {
111 V4L2_IDENT_VPX3216B = 3216, 115 V4L2_IDENT_VPX3216B = 3216,
112 V4L2_IDENT_VPX3220A = 3220, 116 V4L2_IDENT_VPX3220A = 3220,
113 117
118 /* VX855 just ident 3409 */
119 /* Other via devs could use 3314, 3324, 3327, 3336, 3364, 3353 */
120 V4L2_IDENT_VIA_VX855 = 3409,
121
114 /* module tvp5150 */ 122 /* module tvp5150 */
115 V4L2_IDENT_TVP5150 = 5150, 123 V4L2_IDENT_TVP5150 = 5150,
116 124
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 98b32645e5a..41dd480e45f 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -232,4 +232,14 @@ void v4l_bound_align_image(unsigned int *w, unsigned int wmin,
232 unsigned int hmax, unsigned int halign, 232 unsigned int hmax, unsigned int halign,
233 unsigned int salign); 233 unsigned int salign);
234int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info); 234int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info);
235
236struct v4l2_discrete_probe {
237 const struct v4l2_frmsize_discrete *sizes;
238 int num_sizes;
239};
240
241const struct v4l2_frmsize_discrete *v4l2_find_nearest_format(
242 const struct v4l2_discrete_probe *probe,
243 s32 width, s32 height);
244
235#endif /* V4L2_COMMON_H_ */ 245#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 1efcacbed01..15802a067a1 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -21,8 +21,7 @@
21#define VFL_TYPE_GRABBER 0 21#define VFL_TYPE_GRABBER 0
22#define VFL_TYPE_VBI 1 22#define VFL_TYPE_VBI 1
23#define VFL_TYPE_RADIO 2 23#define VFL_TYPE_RADIO 2
24#define VFL_TYPE_VTX 3 24#define VFL_TYPE_MAX 3
25#define VFL_TYPE_MAX 4
26 25
27struct v4l2_ioctl_callbacks; 26struct v4l2_ioctl_callbacks;
28struct video_device; 27struct video_device;
@@ -42,8 +41,6 @@ struct v4l2_file_operations {
42 unsigned int (*poll) (struct file *, struct poll_table_struct *); 41 unsigned int (*poll) (struct file *, struct poll_table_struct *);
43 long (*ioctl) (struct file *, unsigned int, unsigned long); 42 long (*ioctl) (struct file *, unsigned int, unsigned long);
44 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 43 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
45 unsigned long (*get_unmapped_area) (struct file *, unsigned long,
46 unsigned long, unsigned long, unsigned long);
47 int (*mmap) (struct file *, struct vm_area_struct *); 44 int (*mmap) (struct file *, struct vm_area_struct *);
48 int (*open) (struct file *); 45 int (*open) (struct file *);
49 int (*release) (struct file *); 46 int (*release) (struct file *);
@@ -97,6 +94,9 @@ struct video_device
97 94
98 /* ioctl callbacks */ 95 /* ioctl callbacks */
99 const struct v4l2_ioctl_ops *ioctl_ops; 96 const struct v4l2_ioctl_ops *ioctl_ops;
97
98 /* serialization lock */
99 struct mutex *lock;
100}; 100};
101 101
102/* dev to video-device */ 102/* dev to video-device */
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index 8bcbd7a0271..6648036b728 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -101,46 +101,67 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd);
101/* Call the specified callback for all subdevs matching the condition. 101/* Call the specified callback for all subdevs matching the condition.
102 Ignore any errors. Note that you cannot add or delete a subdev 102 Ignore any errors. Note that you cannot add or delete a subdev
103 while walking the subdevs list. */ 103 while walking the subdevs list. */
104#define __v4l2_device_call_subdevs(v4l2_dev, cond, o, f, args...) \ 104#define __v4l2_device_call_subdevs_p(v4l2_dev, sd, cond, o, f, args...) \
105 do { \ 105 do { \
106 struct v4l2_subdev *sd; \ 106 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
107 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
108 (sd)->ops->o->f((sd) , ##args); \
109 } while (0)
110
111#define __v4l2_device_call_subdevs(v4l2_dev, cond, o, f, args...) \
112 do { \
113 struct v4l2_subdev *__sd; \
107 \ 114 \
108 list_for_each_entry(sd, &(v4l2_dev)->subdevs, list) \ 115 __v4l2_device_call_subdevs_p(v4l2_dev, __sd, cond, o, \
109 if ((cond) && sd->ops->o && sd->ops->o->f) \ 116 f , ##args); \
110 sd->ops->o->f(sd , ##args); \
111 } while (0) 117 } while (0)
112 118
113/* Call the specified callback for all subdevs matching the condition. 119/* Call the specified callback for all subdevs matching the condition.
114 If the callback returns an error other than 0 or -ENOIOCTLCMD, then 120 If the callback returns an error other than 0 or -ENOIOCTLCMD, then
115 return with that error code. Note that you cannot add or delete a 121 return with that error code. Note that you cannot add or delete a
116 subdev while walking the subdevs list. */ 122 subdev while walking the subdevs list. */
117#define __v4l2_device_call_subdevs_until_err(v4l2_dev, cond, o, f, args...) \ 123#define __v4l2_device_call_subdevs_until_err_p(v4l2_dev, sd, cond, o, f, args...) \
118({ \ 124({ \
119 struct v4l2_subdev *sd; \ 125 long __err = 0; \
120 long err = 0; \
121 \ 126 \
122 list_for_each_entry(sd, &(v4l2_dev)->subdevs, list) { \ 127 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) { \
123 if ((cond) && sd->ops->o && sd->ops->o->f) \ 128 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
124 err = sd->ops->o->f(sd , ##args); \ 129 __err = (sd)->ops->o->f((sd) , ##args); \
125 if (err && err != -ENOIOCTLCMD) \ 130 if (__err && __err != -ENOIOCTLCMD) \
126 break; \ 131 break; \
127 } \ 132 } \
128 (err == -ENOIOCTLCMD) ? 0 : err; \ 133 (__err == -ENOIOCTLCMD) ? 0 : __err; \
134})
135
136#define __v4l2_device_call_subdevs_until_err(v4l2_dev, cond, o, f, args...) \
137({ \
138 struct v4l2_subdev *__sd; \
139 __v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, cond, o, \
140 f, args...); \
129}) 141})
130 142
131/* Call the specified callback for all subdevs matching grp_id (if 0, then 143/* Call the specified callback for all subdevs matching grp_id (if 0, then
132 match them all). Ignore any errors. Note that you cannot add or delete 144 match them all). Ignore any errors. Note that you cannot add or delete
133 a subdev while walking the subdevs list. */ 145 a subdev while walking the subdevs list. */
134#define v4l2_device_call_all(v4l2_dev, grpid, o, f, args...) \ 146#define v4l2_device_call_all(v4l2_dev, grpid, o, f, args...) \
135 __v4l2_device_call_subdevs(v4l2_dev, \ 147 do { \
136 !(grpid) || sd->grp_id == (grpid), o, f , ##args) 148 struct v4l2_subdev *__sd; \
149 \
150 __v4l2_device_call_subdevs_p(v4l2_dev, __sd, \
151 !(grpid) || __sd->grp_id == (grpid), o, f , \
152 ##args); \
153 } while (0)
137 154
138/* Call the specified callback for all subdevs matching grp_id (if 0, then 155/* Call the specified callback for all subdevs matching grp_id (if 0, then
139 match them all). If the callback returns an error other than 0 or 156 match them all). If the callback returns an error other than 0 or
140 -ENOIOCTLCMD, then return with that error code. Note that you cannot 157 -ENOIOCTLCMD, then return with that error code. Note that you cannot
141 add or delete a subdev while walking the subdevs list. */ 158 add or delete a subdev while walking the subdevs list. */
142#define v4l2_device_call_until_err(v4l2_dev, grpid, o, f, args...) \ 159#define v4l2_device_call_until_err(v4l2_dev, grpid, o, f, args...) \
143 __v4l2_device_call_subdevs_until_err(v4l2_dev, \ 160({ \
144 !(grpid) || sd->grp_id == (grpid), o, f , ##args) 161 struct v4l2_subdev *__sd; \
162 __v4l2_device_call_subdevs_until_err_p(v4l2_dev, __sd, \
163 !(grpid) || __sd->grp_id == (grpid), o, f , \
164 ##args); \
165})
145 166
146#endif 167#endif
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h
deleted file mode 100644
index 74bf741d1a9..00000000000
--- a/include/media/v4l2-i2c-drv.h
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * v4l2-i2c-drv.h - contains I2C handling code that's identical for
3 * all V4L2 I2C drivers. Use this header if the
4 * I2C driver is only used by drivers converted
5 * to the bus-based I2C API.
6 *
7 * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24/* NOTE: the full version of this header is in the v4l-dvb repository
25 * and allows v4l i2c drivers to be compiled on pre-2.6.26 kernels.
26 * The version of this header as it appears in the kernel is a stripped
27 * version (without all the backwards compatibility stuff) and so it
28 * looks a bit odd.
29 *
30 * If you look at the full version then you will understand the reason
31 * for introducing this header since you really don't want to have all
32 * the tricky backwards compatibility code in each and every i2c driver.
33 *
34 * If the i2c driver will never be compiled for pre-2.6.26 kernels, then
35 * DO NOT USE this header! Just write it as a regular i2c driver.
36 */
37
38#ifndef __V4L2_I2C_DRV_H__
39#define __V4L2_I2C_DRV_H__
40
41#include <media/v4l2-common.h>
42
43struct v4l2_i2c_driver_data {
44 const char * const name;
45 int (*command)(struct i2c_client *client, unsigned int cmd, void *arg);
46 int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);
47 int (*remove)(struct i2c_client *client);
48 int (*suspend)(struct i2c_client *client, pm_message_t state);
49 int (*resume)(struct i2c_client *client);
50 const struct i2c_device_id *id_table;
51};
52
53static struct v4l2_i2c_driver_data v4l2_i2c_data;
54static struct i2c_driver v4l2_i2c_driver;
55
56
57/* Bus-based I2C implementation for kernels >= 2.6.26 */
58
59static int __init v4l2_i2c_drv_init(void)
60{
61 v4l2_i2c_driver.driver.name = v4l2_i2c_data.name;
62 v4l2_i2c_driver.command = v4l2_i2c_data.command;
63 v4l2_i2c_driver.probe = v4l2_i2c_data.probe;
64 v4l2_i2c_driver.remove = v4l2_i2c_data.remove;
65 v4l2_i2c_driver.suspend = v4l2_i2c_data.suspend;
66 v4l2_i2c_driver.resume = v4l2_i2c_data.resume;
67 v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table;
68 return i2c_add_driver(&v4l2_i2c_driver);
69}
70
71
72static void __exit v4l2_i2c_drv_cleanup(void)
73{
74 i2c_del_driver(&v4l2_i2c_driver);
75}
76
77module_init(v4l2_i2c_drv_init);
78module_exit(v4l2_i2c_drv_cleanup);
79
80#endif /* __V4L2_I2C_DRV_H__ */
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index f0cf2e7def0..8e6559838ae 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -28,10 +28,18 @@ enum v4l2_mbus_pixelcode {
28 V4L2_MBUS_FMT_YVYU8_2X8, 28 V4L2_MBUS_FMT_YVYU8_2X8,
29 V4L2_MBUS_FMT_UYVY8_2X8, 29 V4L2_MBUS_FMT_UYVY8_2X8,
30 V4L2_MBUS_FMT_VYUY8_2X8, 30 V4L2_MBUS_FMT_VYUY8_2X8,
31 V4L2_MBUS_FMT_YVYU10_2X10,
32 V4L2_MBUS_FMT_YUYV10_2X10,
33 V4L2_MBUS_FMT_YVYU10_1X20,
34 V4L2_MBUS_FMT_YUYV10_1X20,
35 V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE,
36 V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE,
31 V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, 37 V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
32 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, 38 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
33 V4L2_MBUS_FMT_RGB565_2X8_LE, 39 V4L2_MBUS_FMT_RGB565_2X8_LE,
34 V4L2_MBUS_FMT_RGB565_2X8_BE, 40 V4L2_MBUS_FMT_RGB565_2X8_BE,
41 V4L2_MBUS_FMT_BGR565_2X8_LE,
42 V4L2_MBUS_FMT_BGR565_2X8_BE,
35 V4L2_MBUS_FMT_SBGGR8_1X8, 43 V4L2_MBUS_FMT_SBGGR8_1X8,
36 V4L2_MBUS_FMT_SBGGR10_1X10, 44 V4L2_MBUS_FMT_SBGGR10_1X10,
37 V4L2_MBUS_FMT_GREY8_1X8, 45 V4L2_MBUS_FMT_GREY8_1X8,
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 4a97d7341a9..b0316a7cf08 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -256,10 +256,6 @@ struct v4l2_subdev_video_ops {
256 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); 256 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std);
257 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); 257 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
258 int (*s_stream)(struct v4l2_subdev *sd, int enable); 258 int (*s_stream)(struct v4l2_subdev *sd, int enable);
259 int (*enum_fmt)(struct v4l2_subdev *sd, struct v4l2_fmtdesc *fmtdesc);
260 int (*g_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
261 int (*try_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
262 int (*s_fmt)(struct v4l2_subdev *sd, struct v4l2_format *fmt);
263 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); 259 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc);
264 int (*g_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop); 260 int (*g_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop);
265 int (*s_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop); 261 int (*s_crop)(struct v4l2_subdev *sd, struct v4l2_crop *crop);
@@ -442,17 +438,28 @@ struct v4l2_subdev {
442 /* can be used to group similar subdevs, value is driver-specific */ 438 /* can be used to group similar subdevs, value is driver-specific */
443 u32 grp_id; 439 u32 grp_id;
444 /* pointer to private data */ 440 /* pointer to private data */
445 void *priv; 441 void *dev_priv;
442 void *host_priv;
446}; 443};
447 444
448static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p) 445static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)
449{ 446{
450 sd->priv = p; 447 sd->dev_priv = p;
451} 448}
452 449
453static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd) 450static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd)
454{ 451{
455 return sd->priv; 452 return sd->dev_priv;
453}
454
455static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p)
456{
457 sd->host_priv = p;
458}
459
460static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd)
461{
462 return sd->host_priv;
456} 463}
457 464
458static inline void v4l2_subdev_init(struct v4l2_subdev *sd, 465static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
@@ -466,7 +473,8 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
466 sd->flags = 0; 473 sd->flags = 0;
467 sd->name[0] = '\0'; 474 sd->name[0] = '\0';
468 sd->grp_id = 0; 475 sd->grp_id = 0;
469 sd->priv = NULL; 476 sd->dev_priv = NULL;
477 sd->host_priv = NULL;
470} 478}
471 479
472/* Call an ops of a v4l2_subdev, doing the right checks against 480/* Call an ops of a v4l2_subdev, doing the right checks against
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index f2c41cebf45..1d3835fc26b 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -139,6 +139,7 @@ struct videobuf_qtype_ops {
139 139
140struct videobuf_queue { 140struct videobuf_queue {
141 struct mutex vb_lock; 141 struct mutex vb_lock;
142 struct mutex *ext_lock;
142 spinlock_t *irqlock; 143 spinlock_t *irqlock;
143 struct device *dev; 144 struct device *dev;
144 145
@@ -167,7 +168,20 @@ struct videobuf_queue {
167 void *priv_data; 168 void *priv_data;
168}; 169};
169 170
170int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); 171static inline void videobuf_queue_lock(struct videobuf_queue *q)
172{
173 if (!q->ext_lock)
174 mutex_lock(&q->vb_lock);
175}
176
177static inline void videobuf_queue_unlock(struct videobuf_queue *q)
178{
179 if (!q->ext_lock)
180 mutex_unlock(&q->vb_lock);
181}
182
183int videobuf_waiton(struct videobuf_queue *q, struct videobuf_buffer *vb,
184 int non_blocking, int intr);
171int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, 185int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
172 struct v4l2_framebuffer *fbuf); 186 struct v4l2_framebuffer *fbuf);
173 187
@@ -185,7 +199,8 @@ void videobuf_queue_core_init(struct videobuf_queue *q,
185 enum v4l2_field field, 199 enum v4l2_field field,
186 unsigned int msize, 200 unsigned int msize,
187 void *priv, 201 void *priv,
188 struct videobuf_qtype_ops *int_ops); 202 struct videobuf_qtype_ops *int_ops,
203 struct mutex *ext_lock);
189int videobuf_queue_is_busy(struct videobuf_queue *q); 204int videobuf_queue_is_busy(struct videobuf_queue *q);
190void videobuf_queue_cancel(struct videobuf_queue *q); 205void videobuf_queue_cancel(struct videobuf_queue *q);
191 206
diff --git a/include/media/videobuf-dma-contig.h b/include/media/videobuf-dma-contig.h
index ebaa9bc1ee8..f0ed82543d9 100644
--- a/include/media/videobuf-dma-contig.h
+++ b/include/media/videobuf-dma-contig.h
@@ -23,7 +23,8 @@ void videobuf_queue_dma_contig_init(struct videobuf_queue *q,
23 enum v4l2_buf_type type, 23 enum v4l2_buf_type type,
24 enum v4l2_field field, 24 enum v4l2_field field,
25 unsigned int msize, 25 unsigned int msize,
26 void *priv); 26 void *priv,
27 struct mutex *ext_lock);
27 28
28dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); 29dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf);
29void videobuf_dma_contig_free(struct videobuf_queue *q, 30void videobuf_dma_contig_free(struct videobuf_queue *q,
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index aa4ebb42a56..1c647e8148c 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -103,7 +103,8 @@ void videobuf_queue_sg_init(struct videobuf_queue *q,
103 enum v4l2_buf_type type, 103 enum v4l2_buf_type type,
104 enum v4l2_field field, 104 enum v4l2_field field,
105 unsigned int msize, 105 unsigned int msize,
106 void *priv); 106 void *priv,
107 struct mutex *ext_lock);
107 108
108#endif /* _VIDEOBUF_DMA_SG_H */ 109#endif /* _VIDEOBUF_DMA_SG_H */
109 110
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h
index e19403c18da..486a97efdb5 100644
--- a/include/media/videobuf-vmalloc.h
+++ b/include/media/videobuf-vmalloc.h
@@ -36,7 +36,8 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue *q,
36 enum v4l2_buf_type type, 36 enum v4l2_buf_type type,
37 enum v4l2_field field, 37 enum v4l2_field field,
38 unsigned int msize, 38 unsigned int msize,
39 void *priv); 39 void *priv,
40 struct mutex *ext_lock);
40 41
41void *videobuf_to_vmalloc(struct videobuf_buffer *buf); 42void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
42 43
diff --git a/include/media/wm8775.h b/include/media/wm8775.h
index 60739c5a23a..a1c4d417dfa 100644
--- a/include/media/wm8775.h
+++ b/include/media/wm8775.h
@@ -32,4 +32,7 @@
32#define WM8775_AIN3 4 32#define WM8775_AIN3 4
33#define WM8775_AIN4 8 33#define WM8775_AIN4 8
34 34
35/* subdev group ID */
36#define WM8775_GID (1 << 0)
37
35#endif 38#endif
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index 4debb451463..2f7d45bcbd2 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -52,6 +52,7 @@ struct mtd_oob_buf64 {
52#define MTD_NANDFLASH 4 52#define MTD_NANDFLASH 4
53#define MTD_DATAFLASH 6 53#define MTD_DATAFLASH 6
54#define MTD_UBIVOLUME 7 54#define MTD_UBIVOLUME 7
55#define MTD_MLCNANDFLASH 8
55 56
56#define MTD_WRITEABLE 0x400 /* Device is writeable */ 57#define MTD_WRITEABLE 0x400 /* Device is writeable */
57#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */ 58#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */
@@ -119,7 +120,7 @@ struct otp_info {
119#define OTPGETREGIONCOUNT _IOW('M', 14, int) 120#define OTPGETREGIONCOUNT _IOW('M', 14, int)
120#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) 121#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
121#define OTPLOCK _IOR('M', 16, struct otp_info) 122#define OTPLOCK _IOR('M', 16, struct otp_info)
122#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout) 123#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
123#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) 124#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
124#define MTDFILEMODE _IO('M', 19) 125#define MTDFILEMODE _IO('M', 19)
125#define MEMERASE64 _IOW('M', 20, struct erase_info_user64) 126#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
@@ -144,13 +145,18 @@ struct nand_oobfree {
144}; 145};
145 146
146#define MTD_MAX_OOBFREE_ENTRIES 8 147#define MTD_MAX_OOBFREE_ENTRIES 8
148#define MTD_MAX_ECCPOS_ENTRIES 64
147/* 149/*
148 * ECC layout control structure. Exported to userspace for 150 * OBSOLETE: ECC layout control structure. Exported to user-space via ioctl
149 * diagnosis and to allow creation of raw images 151 * ECCGETLAYOUT for backwards compatbility and should not be mistaken as a
152 * complete set of ECC information. The ioctl truncates the larger internal
153 * structure to retain binary compatibility with the static declaration of the
154 * ioctl. Note that the "MTD_MAX_..._ENTRIES" macros represent the max size of
155 * the user struct, not the MAX size of the internal struct nand_ecclayout.
150 */ 156 */
151struct nand_ecclayout { 157struct nand_ecclayout_user {
152 __u32 eccbytes; 158 __u32 eccbytes;
153 __u32 eccpos[64]; 159 __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES];
154 __u32 oobavail; 160 __u32 oobavail;
155 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; 161 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
156}; 162};
diff --git a/include/mtd/mtd-user.h b/include/mtd/mtd-user.h
index aa3c2f86a91..83327c808c8 100644
--- a/include/mtd/mtd-user.h
+++ b/include/mtd/mtd-user.h
@@ -29,6 +29,6 @@ typedef struct mtd_info_user mtd_info_t;
29typedef struct erase_info_user erase_info_t; 29typedef struct erase_info_user erase_info_t;
30typedef struct region_info_user region_info_t; 30typedef struct region_info_user region_info_t;
31typedef struct nand_oobinfo nand_oobinfo_t; 31typedef struct nand_oobinfo nand_oobinfo_t;
32typedef struct nand_ecclayout nand_ecclayout_t; 32typedef struct nand_ecclayout_user nand_ecclayout_t;
33 33
34#endif /* __MTD_USER_H__ */ 34#endif /* __MTD_USER_H__ */
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index a8de812ccbc..071fd7a8d78 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -86,6 +86,8 @@ do { \
86 86
87/** 87/**
88 * enum p9_msg_t - 9P message types 88 * enum p9_msg_t - 9P message types
89 * @P9_TLERROR: not used
90 * @P9_RLERROR: response for any failed request for 9P2000.L
89 * @P9_TSTATFS: file system status request 91 * @P9_TSTATFS: file system status request
90 * @P9_RSTATFS: file system status response 92 * @P9_RSTATFS: file system status response
91 * @P9_TSYMLINK: make symlink request 93 * @P9_TSYMLINK: make symlink request
@@ -137,6 +139,8 @@ do { \
137 */ 139 */
138 140
139enum p9_msg_t { 141enum p9_msg_t {
142 P9_TLERROR = 6,
143 P9_RLERROR,
140 P9_TSTATFS = 8, 144 P9_TSTATFS = 8,
141 P9_RSTATFS, 145 P9_RSTATFS,
142 P9_TLOPEN = 12, 146 P9_TLOPEN = 12,
@@ -149,6 +153,8 @@ enum p9_msg_t {
149 P9_RMKNOD, 153 P9_RMKNOD,
150 P9_TRENAME = 20, 154 P9_TRENAME = 20,
151 P9_RRENAME, 155 P9_RRENAME,
156 P9_TREADLINK = 22,
157 P9_RREADLINK,
152 P9_TGETATTR = 24, 158 P9_TGETATTR = 24,
153 P9_RGETATTR, 159 P9_RGETATTR,
154 P9_TSETATTR = 26, 160 P9_TSETATTR = 26,
@@ -159,6 +165,12 @@ enum p9_msg_t {
159 P9_RXATTRCREATE, 165 P9_RXATTRCREATE,
160 P9_TREADDIR = 40, 166 P9_TREADDIR = 40,
161 P9_RREADDIR, 167 P9_RREADDIR,
168 P9_TFSYNC = 50,
169 P9_RFSYNC,
170 P9_TLOCK = 52,
171 P9_RLOCK,
172 P9_TGETLOCK = 54,
173 P9_RGETLOCK,
162 P9_TLINK = 70, 174 P9_TLINK = 70,
163 P9_RLINK, 175 P9_RLINK,
164 P9_TMKDIR = 72, 176 P9_TMKDIR = 72,
@@ -458,6 +470,48 @@ struct p9_iattr_dotl {
458 u64 mtime_nsec; 470 u64 mtime_nsec;
459}; 471};
460 472
473#define P9_LOCK_SUCCESS 0
474#define P9_LOCK_BLOCKED 1
475#define P9_LOCK_ERROR 2
476#define P9_LOCK_GRACE 3
477
478#define P9_LOCK_FLAGS_BLOCK 1
479#define P9_LOCK_FLAGS_RECLAIM 2
480
481/* struct p9_flock: POSIX lock structure
482 * @type - type of lock
483 * @flags - lock flags
484 * @start - starting offset of the lock
485 * @length - number of bytes
486 * @proc_id - process id which wants to take lock
487 * @client_id - client id
488 */
489
490struct p9_flock {
491 u8 type;
492 u32 flags;
493 u64 start;
494 u64 length;
495 u32 proc_id;
496 char *client_id;
497};
498
499/* struct p9_getlock: getlock structure
500 * @type - type of lock
501 * @start - starting offset of the lock
502 * @length - number of bytes
503 * @proc_id - process id which wants to take lock
504 * @client_id - client id
505 */
506
507struct p9_getlock {
508 u8 type;
509 u64 start;
510 u64 length;
511 u32 proc_id;
512 char *client_id;
513};
514
461/* Structures for Protocol Operations */ 515/* Structures for Protocol Operations */
462struct p9_tstatfs { 516struct p9_tstatfs {
463 u32 fid; 517 u32 fid;
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index d1aa2cfb30f..83ba6a4d58a 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -212,15 +212,12 @@ struct p9_dirent {
212 212
213int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb); 213int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb);
214int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name); 214int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name);
215int p9_client_version(struct p9_client *);
216struct p9_client *p9_client_create(const char *dev_name, char *options); 215struct p9_client *p9_client_create(const char *dev_name, char *options);
217void p9_client_destroy(struct p9_client *clnt); 216void p9_client_destroy(struct p9_client *clnt);
218void p9_client_disconnect(struct p9_client *clnt); 217void p9_client_disconnect(struct p9_client *clnt);
219void p9_client_begin_disconnect(struct p9_client *clnt); 218void p9_client_begin_disconnect(struct p9_client *clnt);
220struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, 219struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
221 char *uname, u32 n_uname, char *aname); 220 char *uname, u32 n_uname, char *aname);
222struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname,
223 u32 n_uname, char *aname);
224struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames, 221struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames,
225 int clone); 222 int clone);
226int p9_client_open(struct p9_fid *fid, int mode); 223int p9_client_open(struct p9_fid *fid, int mode);
@@ -232,6 +229,7 @@ int p9_client_symlink(struct p9_fid *fid, char *name, char *symname, gid_t gid,
232int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, 229int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
233 gid_t gid, struct p9_qid *qid); 230 gid_t gid, struct p9_qid *qid);
234int p9_client_clunk(struct p9_fid *fid); 231int p9_client_clunk(struct p9_fid *fid);
232int p9_client_fsync(struct p9_fid *fid, int datasync);
235int p9_client_remove(struct p9_fid *fid); 233int p9_client_remove(struct p9_fid *fid);
236int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, 234int p9_client_read(struct p9_fid *fid, char *data, char __user *udata,
237 u64 offset, u32 count); 235 u64 offset, u32 count);
@@ -251,6 +249,8 @@ int p9_client_mknod_dotl(struct p9_fid *oldfid, char *name, int mode,
251 dev_t rdev, gid_t gid, struct p9_qid *); 249 dev_t rdev, gid_t gid, struct p9_qid *);
252int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, 250int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
253 gid_t gid, struct p9_qid *); 251 gid_t gid, struct p9_qid *);
252int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status);
253int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl);
254struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); 254struct p9_req_t *p9_tag_lookup(struct p9_client *, u16);
255void p9_client_cb(struct p9_client *c, struct p9_req_t *req); 255void p9_client_cb(struct p9_client *c, struct p9_req_t *req);
256 256
@@ -262,5 +262,6 @@ int p9_is_proto_dotu(struct p9_client *clnt);
262int p9_is_proto_dotl(struct p9_client *clnt); 262int p9_is_proto_dotl(struct p9_client *clnt);
263struct p9_fid *p9_client_xattrwalk(struct p9_fid *, const char *, u64 *); 263struct p9_fid *p9_client_xattrwalk(struct p9_fid *, const char *, u64 *);
264int p9_client_xattrcreate(struct p9_fid *, const char *, u64, int); 264int p9_client_xattrcreate(struct p9_fid *, const char *, u64, int);
265int p9_client_readlink(struct p9_fid *fid, char **target);
265 266
266#endif /* NET_9P_CLIENT_H */ 267#endif /* NET_9P_CLIENT_H */
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 4d40c4d0230..a9441249306 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -175,20 +175,32 @@ extern int ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
175extern int register_inet6addr_notifier(struct notifier_block *nb); 175extern int register_inet6addr_notifier(struct notifier_block *nb);
176extern int unregister_inet6addr_notifier(struct notifier_block *nb); 176extern int unregister_inet6addr_notifier(struct notifier_block *nb);
177 177
178static inline struct inet6_dev * 178/**
179__in6_dev_get(struct net_device *dev) 179 * __in6_dev_get - get inet6_dev pointer from netdevice
180 * @dev: network device
181 *
182 * Caller must hold rcu_read_lock or RTNL, because this function
183 * does not take a reference on the inet6_dev.
184 */
185static inline struct inet6_dev *__in6_dev_get(const struct net_device *dev)
180{ 186{
181 return rcu_dereference_check(dev->ip6_ptr, 187 return rcu_dereference_rtnl(dev->ip6_ptr);
182 rcu_read_lock_held() ||
183 lockdep_rtnl_is_held());
184} 188}
185 189
186static inline struct inet6_dev * 190/**
187in6_dev_get(struct net_device *dev) 191 * in6_dev_get - get inet6_dev pointer from netdevice
192 * @dev: network device
193 *
194 * This version can be used in any context, and takes a reference
195 * on the inet6_dev. Callers must use in6_dev_put() later to
196 * release this reference.
197 */
198static inline struct inet6_dev *in6_dev_get(const struct net_device *dev)
188{ 199{
189 struct inet6_dev *idev = NULL; 200 struct inet6_dev *idev;
201
190 rcu_read_lock(); 202 rcu_read_lock();
191 idev = __in6_dev_get(dev); 203 idev = rcu_dereference(dev->ip6_ptr);
192 if (idev) 204 if (idev)
193 atomic_inc(&idev->refcnt); 205 atomic_inc(&idev->refcnt);
194 rcu_read_unlock(); 206 rcu_read_unlock();
@@ -197,16 +209,21 @@ in6_dev_get(struct net_device *dev)
197 209
198extern void in6_dev_finish_destroy(struct inet6_dev *idev); 210extern void in6_dev_finish_destroy(struct inet6_dev *idev);
199 211
200static inline void 212static inline void in6_dev_put(struct inet6_dev *idev)
201in6_dev_put(struct inet6_dev *idev)
202{ 213{
203 if (atomic_dec_and_test(&idev->refcnt)) 214 if (atomic_dec_and_test(&idev->refcnt))
204 in6_dev_finish_destroy(idev); 215 in6_dev_finish_destroy(idev);
205} 216}
206 217
207#define __in6_dev_put(idev) atomic_dec(&(idev)->refcnt) 218static inline void __in6_dev_put(struct inet6_dev *idev)
208#define in6_dev_hold(idev) atomic_inc(&(idev)->refcnt) 219{
220 atomic_dec(&idev->refcnt);
221}
209 222
223static inline void in6_dev_hold(struct inet6_dev *idev)
224{
225 atomic_inc(&idev->refcnt);
226}
210 227
211extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); 228extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp);
212 229
@@ -216,9 +233,15 @@ static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
216 inet6_ifa_finish_destroy(ifp); 233 inet6_ifa_finish_destroy(ifp);
217} 234}
218 235
219#define __in6_ifa_put(ifp) atomic_dec(&(ifp)->refcnt) 236static inline void __in6_ifa_put(struct inet6_ifaddr *ifp)
220#define in6_ifa_hold(ifp) atomic_inc(&(ifp)->refcnt) 237{
238 atomic_dec(&ifp->refcnt);
239}
221 240
241static inline void in6_ifa_hold(struct inet6_ifaddr *ifp)
242{
243 atomic_inc(&ifp->refcnt);
244}
222 245
223 246
224/* 247/*
@@ -241,23 +264,21 @@ static inline int ipv6_addr_is_multicast(const struct in6_addr *addr)
241 264
242static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) 265static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr)
243{ 266{
244 return (((addr->s6_addr32[0] ^ htonl(0xff020000)) | 267 return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
245 addr->s6_addr32[1] | addr->s6_addr32[2] | 268 addr->s6_addr32[1] | addr->s6_addr32[2] |
246 (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0); 269 (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0;
247} 270}
248 271
249static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) 272static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr)
250{ 273{
251 return (((addr->s6_addr32[0] ^ htonl(0xff020000)) | 274 return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
252 addr->s6_addr32[1] | addr->s6_addr32[2] | 275 addr->s6_addr32[1] | addr->s6_addr32[2] |
253 (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0); 276 (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0;
254} 277}
255 278
256extern int __ipv6_isatap_ifid(u8 *eui, __be32 addr);
257
258static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) 279static inline int ipv6_addr_is_isatap(const struct in6_addr *addr)
259{ 280{
260 return ((addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE)); 281 return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE);
261} 282}
262 283
263#ifdef CONFIG_PROC_FS 284#ifdef CONFIG_PROC_FS
diff --git a/include/net/arp.h b/include/net/arp.h
index 716f43c5c98..f4cf6ce6658 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -26,6 +26,4 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
26 const unsigned char *target_hw); 26 const unsigned char *target_hw);
27extern void arp_xmit(struct sk_buff *skb); 27extern void arp_xmit(struct sk_buff *skb);
28 28
29extern const struct neigh_ops arp_broken_ops;
30
31#endif /* _ARP_H */ 29#endif /* _ARP_H */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 30fce0128dd..d81ea799770 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -126,6 +126,8 @@ int bt_sock_unregister(int proto);
126void bt_sock_link(struct bt_sock_list *l, struct sock *s); 126void bt_sock_link(struct bt_sock_list *l, struct sock *s);
127void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); 127void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
128int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); 128int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags);
129int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
130 struct msghdr *msg, size_t len, int flags);
129uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); 131uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait);
130int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 132int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
131int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); 133int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo);
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index bcbdd6d4e6d..e30e0083434 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -54,7 +54,7 @@
54 54
55/* HCI controller types */ 55/* HCI controller types */
56#define HCI_BREDR 0x00 56#define HCI_BREDR 0x00
57#define HCI_80211 0x01 57#define HCI_AMP 0x01
58 58
59/* HCI device quirks */ 59/* HCI device quirks */
60enum { 60enum {
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 4568b938ca3..ebec8c9a929 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -233,7 +233,7 @@ static inline void inquiry_cache_init(struct hci_dev *hdev)
233static inline int inquiry_cache_empty(struct hci_dev *hdev) 233static inline int inquiry_cache_empty(struct hci_dev *hdev)
234{ 234{
235 struct inquiry_cache *c = &hdev->inq_cache; 235 struct inquiry_cache *c = &hdev->inq_cache;
236 return (c->list == NULL); 236 return c->list == NULL;
237} 237}
238 238
239static inline long inquiry_cache_age(struct hci_dev *hdev) 239static inline long inquiry_cache_age(struct hci_dev *hdev)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 6c241444f90..c819c8bf9b6 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -414,7 +414,7 @@ static inline int l2cap_tx_window_full(struct sock *sk)
414 if (sub < 0) 414 if (sub < 0)
415 sub += 64; 415 sub += 64;
416 416
417 return (sub == pi->remote_tx_win); 417 return sub == pi->remote_tx_win;
418} 418}
419 419
420#define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1 420#define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index a140847d622..71047bc0af8 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -213,11 +213,6 @@ struct rfcomm_dlc {
213#define RFCOMM_DEFER_SETUP 8 213#define RFCOMM_DEFER_SETUP 8
214 214
215/* Scheduling flags and events */ 215/* Scheduling flags and events */
216#define RFCOMM_SCHED_STATE 0
217#define RFCOMM_SCHED_RX 1
218#define RFCOMM_SCHED_TX 2
219#define RFCOMM_SCHED_TIMEO 3
220#define RFCOMM_SCHED_AUTH 4
221#define RFCOMM_SCHED_WAKEUP 31 216#define RFCOMM_SCHED_WAKEUP 31
222 217
223/* MSC exchange flags */ 218/* MSC exchange flags */
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h
index 6da573c75d5..8eff83b9536 100644
--- a/include/net/caif/caif_dev.h
+++ b/include/net/caif/caif_dev.h
@@ -28,7 +28,7 @@ struct caif_param {
28 * @sockaddr: Socket address to connect. 28 * @sockaddr: Socket address to connect.
29 * @priority: Priority of the connection. 29 * @priority: Priority of the connection.
30 * @link_selector: Link selector (high bandwidth or low latency) 30 * @link_selector: Link selector (high bandwidth or low latency)
31 * @link_name: Name of the CAIF Link Layer to use. 31 * @ifindex: kernel index of the interface.
32 * @param: Connect Request parameters (CAIF_SO_REQ_PARAM). 32 * @param: Connect Request parameters (CAIF_SO_REQ_PARAM).
33 * 33 *
34 * This struct is used when connecting a CAIF channel. 34 * This struct is used when connecting a CAIF channel.
@@ -39,7 +39,7 @@ struct caif_connect_request {
39 struct sockaddr_caif sockaddr; 39 struct sockaddr_caif sockaddr;
40 enum caif_channel_priority priority; 40 enum caif_channel_priority priority;
41 enum caif_link_selector link_selector; 41 enum caif_link_selector link_selector;
42 char link_name[16]; 42 int ifindex;
43 struct caif_param param; 43 struct caif_param param;
44}; 44};
45 45
diff --git a/include/net/caif/caif_shm.h b/include/net/caif/caif_shm.h
new file mode 100644
index 00000000000..5bcce55438c
--- /dev/null
+++ b/include/net/caif/caif_shm.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright (C) ST-Ericsson AB 2010
3 * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
4 * Author: Amarnath Revanna / amarnath.bangalore.revanna@stericsson.com
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef CAIF_SHM_H_
9#define CAIF_SHM_H_
10
11struct shmdev_layer {
12 u32 shm_base_addr;
13 u32 shm_total_sz;
14 u32 shm_id;
15 u32 shm_loopback;
16 void *hmbx;
17 int (*pshmdev_mbxsend) (u32 shm_id, u32 mbx_msg);
18 int (*pshmdev_mbxsetup) (void *pshmdrv_cb,
19 struct shmdev_layer *pshm_dev, void *pshm_drv);
20 struct net_device *pshm_netdev;
21};
22
23extern int caif_shmcore_probe(struct shmdev_layer *pshm_dev);
24extern void caif_shmcore_remove(struct net_device *pshm_netdev);
25
26#endif
diff --git a/include/net/caif/caif_spi.h b/include/net/caif/caif_spi.h
index ce4570dff02..87c3d11b8e5 100644
--- a/include/net/caif/caif_spi.h
+++ b/include/net/caif/caif_spi.h
@@ -121,6 +121,8 @@ struct cfspi {
121 wait_queue_head_t wait; 121 wait_queue_head_t wait;
122 spinlock_t lock; 122 spinlock_t lock;
123 bool flow_stop; 123 bool flow_stop;
124 bool slave;
125 bool slave_talked;
124#ifdef CONFIG_DEBUG_FS 126#ifdef CONFIG_DEBUG_FS
125 enum cfspi_state dbg_state; 127 enum cfspi_state dbg_state;
126 u16 pcmd; 128 u16 pcmd;
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h
index bd646faffa4..f688478bfb8 100644
--- a/include/net/caif/cfcnfg.h
+++ b/include/net/caif/cfcnfg.h
@@ -139,10 +139,10 @@ struct dev_info *cfcnfg_get_phyid(struct cfcnfg *cnfg,
139 enum cfcnfg_phy_preference phy_pref); 139 enum cfcnfg_phy_preference phy_pref);
140 140
141/** 141/**
142 * cfcnfg_get_named() - Get the Physical Identifier of CAIF Link Layer 142 * cfcnfg_get_id_from_ifi() - Get the Physical Identifier of ifindex,
143 * it matches caif physical id with the kernel interface id.
143 * @cnfg: Configuration object 144 * @cnfg: Configuration object
144 * @name: Name of the Physical Layer (Caif Link Layer) 145 * @ifi: ifindex obtained from socket.c bindtodevice.
145 */ 146 */
146int cfcnfg_get_named(struct cfcnfg *cnfg, char *name); 147int cfcnfg_get_id_from_ifi(struct cfcnfg *cnfg, int ifi);
147
148#endif /* CFCNFG_H_ */ 148#endif /* CFCNFG_H_ */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 2fd06c60ffb..2a7936d7851 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -25,6 +25,43 @@
25#include <linux/wireless.h> 25#include <linux/wireless.h>
26 26
27 27
28/**
29 * DOC: Introduction
30 *
31 * cfg80211 is the configuration API for 802.11 devices in Linux. It bridges
32 * userspace and drivers, and offers some utility functionality associated
33 * with 802.11. cfg80211 must, directly or indirectly via mac80211, be used
34 * by all modern wireless drivers in Linux, so that they offer a consistent
35 * API through nl80211. For backward compatibility, cfg80211 also offers
36 * wireless extensions to userspace, but hides them from drivers completely.
37 *
38 * Additionally, cfg80211 contains code to help enforce regulatory spectrum
39 * use restrictions.
40 */
41
42
43/**
44 * DOC: Device registration
45 *
46 * In order for a driver to use cfg80211, it must register the hardware device
47 * with cfg80211. This happens through a number of hardware capability structs
48 * described below.
49 *
50 * The fundamental structure for each device is the 'wiphy', of which each
51 * instance describes a physical wireless device connected to the system. Each
52 * such wiphy can have zero, one, or many virtual interfaces associated with
53 * it, which need to be identified as such by pointing the network interface's
54 * @ieee80211_ptr pointer to a &struct wireless_dev which further describes
55 * the wireless part of the interface, normally this struct is embedded in the
56 * network interface's private data area. Drivers can optionally allow creating
57 * or destroying virtual interfaces on the fly, but without at least one or the
58 * ability to create some the wireless device isn't useful.
59 *
60 * Each wiphy structure contains device capability information, and also has
61 * a pointer to the various operations the driver offers. The definitions and
62 * structures here describe these capabilities in detail.
63 */
64
28/* 65/*
29 * wireless hardware capability structures 66 * wireless hardware capability structures
30 */ 67 */
@@ -205,6 +242,21 @@ struct ieee80211_supported_band {
205 */ 242 */
206 243
207/** 244/**
245 * DOC: Actions and configuration
246 *
247 * Each wireless device and each virtual interface offer a set of configuration
248 * operations and other actions that are invoked by userspace. Each of these
249 * actions is described in the operations structure, and the parameters these
250 * operations use are described separately.
251 *
252 * Additionally, some operations are asynchronous and expect to get status
253 * information via some functions that drivers need to call.
254 *
255 * Scanning and BSS list handling with its associated functionality is described
256 * in a separate chapter.
257 */
258
259/**
208 * struct vif_params - describes virtual interface parameters 260 * struct vif_params - describes virtual interface parameters
209 * @mesh_id: mesh ID to use 261 * @mesh_id: mesh ID to use
210 * @mesh_id_len: length of the mesh ID 262 * @mesh_id_len: length of the mesh ID
@@ -241,12 +293,24 @@ struct key_params {
241 * enum survey_info_flags - survey information flags 293 * enum survey_info_flags - survey information flags
242 * 294 *
243 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in 295 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
296 * @SURVEY_INFO_IN_USE: channel is currently being used
297 * @SURVEY_INFO_CHANNEL_TIME: channel active time (in ms) was filled in
298 * @SURVEY_INFO_CHANNEL_TIME_BUSY: channel busy time was filled in
299 * @SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: extension channel busy time was filled in
300 * @SURVEY_INFO_CHANNEL_TIME_RX: channel receive time was filled in
301 * @SURVEY_INFO_CHANNEL_TIME_TX: channel transmit time was filled in
244 * 302 *
245 * Used by the driver to indicate which info in &struct survey_info 303 * Used by the driver to indicate which info in &struct survey_info
246 * it has filled in during the get_survey(). 304 * it has filled in during the get_survey().
247 */ 305 */
248enum survey_info_flags { 306enum survey_info_flags {
249 SURVEY_INFO_NOISE_DBM = 1<<0, 307 SURVEY_INFO_NOISE_DBM = 1<<0,
308 SURVEY_INFO_IN_USE = 1<<1,
309 SURVEY_INFO_CHANNEL_TIME = 1<<2,
310 SURVEY_INFO_CHANNEL_TIME_BUSY = 1<<3,
311 SURVEY_INFO_CHANNEL_TIME_EXT_BUSY = 1<<4,
312 SURVEY_INFO_CHANNEL_TIME_RX = 1<<5,
313 SURVEY_INFO_CHANNEL_TIME_TX = 1<<6,
250}; 314};
251 315
252/** 316/**
@@ -256,6 +320,11 @@ enum survey_info_flags {
256 * @filled: bitflag of flags from &enum survey_info_flags 320 * @filled: bitflag of flags from &enum survey_info_flags
257 * @noise: channel noise in dBm. This and all following fields are 321 * @noise: channel noise in dBm. This and all following fields are
258 * optional 322 * optional
323 * @channel_time: amount of time in ms the radio spent on the channel
324 * @channel_time_busy: amount of time the primary channel was sensed busy
325 * @channel_time_ext_busy: amount of time the extension channel was sensed busy
326 * @channel_time_rx: amount of time the radio spent receiving data
327 * @channel_time_tx: amount of time the radio spent transmitting data
259 * 328 *
260 * Used by dump_survey() to report back per-channel survey information. 329 * Used by dump_survey() to report back per-channel survey information.
261 * 330 *
@@ -264,6 +333,11 @@ enum survey_info_flags {
264 */ 333 */
265struct survey_info { 334struct survey_info {
266 struct ieee80211_channel *channel; 335 struct ieee80211_channel *channel;
336 u64 channel_time;
337 u64 channel_time_busy;
338 u64 channel_time_ext_busy;
339 u64 channel_time_rx;
340 u64 channel_time_tx;
267 u32 filled; 341 u32 filled;
268 s8 noise; 342 s8 noise;
269}; 343};
@@ -347,6 +421,9 @@ struct station_parameters {
347 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) 421 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
348 * @STATION_INFO_RX_PACKETS: @rx_packets filled 422 * @STATION_INFO_RX_PACKETS: @rx_packets filled
349 * @STATION_INFO_TX_PACKETS: @tx_packets filled 423 * @STATION_INFO_TX_PACKETS: @tx_packets filled
424 * @STATION_INFO_TX_RETRIES: @tx_retries filled
425 * @STATION_INFO_TX_FAILED: @tx_failed filled
426 * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled
350 */ 427 */
351enum station_info_flags { 428enum station_info_flags {
352 STATION_INFO_INACTIVE_TIME = 1<<0, 429 STATION_INFO_INACTIVE_TIME = 1<<0,
@@ -359,6 +436,9 @@ enum station_info_flags {
359 STATION_INFO_TX_BITRATE = 1<<7, 436 STATION_INFO_TX_BITRATE = 1<<7,
360 STATION_INFO_RX_PACKETS = 1<<8, 437 STATION_INFO_RX_PACKETS = 1<<8,
361 STATION_INFO_TX_PACKETS = 1<<9, 438 STATION_INFO_TX_PACKETS = 1<<9,
439 STATION_INFO_TX_RETRIES = 1<<10,
440 STATION_INFO_TX_FAILED = 1<<11,
441 STATION_INFO_RX_DROP_MISC = 1<<12,
362}; 442};
363 443
364/** 444/**
@@ -408,6 +488,9 @@ struct rate_info {
408 * @txrate: current unicast bitrate to this station 488 * @txrate: current unicast bitrate to this station
409 * @rx_packets: packets received from this station 489 * @rx_packets: packets received from this station
410 * @tx_packets: packets transmitted to this station 490 * @tx_packets: packets transmitted to this station
491 * @tx_retries: cumulative retry counts
492 * @tx_failed: number of failed transmissions (retries exceeded, no ACK)
493 * @rx_dropped_misc: Dropped for un-specified reason.
411 * @generation: generation number for nl80211 dumps. 494 * @generation: generation number for nl80211 dumps.
412 * This number should increase every time the list of stations 495 * This number should increase every time the list of stations
413 * changes, i.e. when a station is added or removed, so that 496 * changes, i.e. when a station is added or removed, so that
@@ -425,6 +508,9 @@ struct station_info {
425 struct rate_info txrate; 508 struct rate_info txrate;
426 u32 rx_packets; 509 u32 rx_packets;
427 u32 tx_packets; 510 u32 tx_packets;
511 u32 tx_retries;
512 u32 tx_failed;
513 u32 rx_dropped_misc;
428 514
429 int generation; 515 int generation;
430}; 516};
@@ -570,8 +656,28 @@ struct ieee80211_txq_params {
570/* from net/wireless.h */ 656/* from net/wireless.h */
571struct wiphy; 657struct wiphy;
572 658
573/* from net/ieee80211.h */ 659/**
574struct ieee80211_channel; 660 * DOC: Scanning and BSS list handling
661 *
662 * The scanning process itself is fairly simple, but cfg80211 offers quite
663 * a bit of helper functionality. To start a scan, the scan operation will
664 * be invoked with a scan definition. This scan definition contains the
665 * channels to scan, and the SSIDs to send probe requests for (including the
666 * wildcard, if desired). A passive scan is indicated by having no SSIDs to
667 * probe. Additionally, a scan request may contain extra information elements
668 * that should be added to the probe request. The IEs are guaranteed to be
669 * well-formed, and will not exceed the maximum length the driver advertised
670 * in the wiphy structure.
671 *
672 * When scanning finds a BSS, cfg80211 needs to be notified of that, because
673 * it is responsible for maintaining the BSS list; the driver should not
674 * maintain a list itself. For this notification, various functions exist.
675 *
676 * Since drivers do not maintain a BSS list, there are also a number of
677 * functions to search for a BSS and obtain information about it from the
678 * BSS structure cfg80211 maintains. The BSS list is also made available
679 * to userspace.
680 */
575 681
576/** 682/**
577 * struct cfg80211_ssid - SSID description 683 * struct cfg80211_ssid - SSID description
@@ -691,6 +797,10 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
691 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is 797 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
692 * required to assume that the port is unauthorized until authorized by 798 * required to assume that the port is unauthorized until authorized by
693 * user space. Otherwise, port is marked authorized by default. 799 * user space. Otherwise, port is marked authorized by default.
800 * @control_port_ethertype: the control port protocol that should be
801 * allowed through even on unauthorized ports
802 * @control_port_no_encrypt: TRUE to prevent encryption of control port
803 * protocol frames.
694 */ 804 */
695struct cfg80211_crypto_settings { 805struct cfg80211_crypto_settings {
696 u32 wpa_versions; 806 u32 wpa_versions;
@@ -700,6 +810,8 @@ struct cfg80211_crypto_settings {
700 int n_akm_suites; 810 int n_akm_suites;
701 u32 akm_suites[NL80211_MAX_NR_AKM_SUITES]; 811 u32 akm_suites[NL80211_MAX_NR_AKM_SUITES];
702 bool control_port; 812 bool control_port;
813 __be16 control_port_ethertype;
814 bool control_port_no_encrypt;
703}; 815};
704 816
705/** 817/**
@@ -1020,7 +1132,7 @@ struct cfg80211_pmksa {
1020 * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. 1132 * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation.
1021 * This allows the operation to be terminated prior to timeout based on 1133 * This allows the operation to be terminated prior to timeout based on
1022 * the duration value. 1134 * the duration value.
1023 * @action: Transmit an action frame 1135 * @mgmt_tx: Transmit a management frame
1024 * 1136 *
1025 * @testmode_cmd: run a test mode command 1137 * @testmode_cmd: run a test mode command
1026 * 1138 *
@@ -1035,6 +1147,9 @@ struct cfg80211_pmksa {
1035 * allows the driver to adjust the dynamic ps timeout value. 1147 * allows the driver to adjust the dynamic ps timeout value.
1036 * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. 1148 * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold.
1037 * 1149 *
1150 * @mgmt_frame_register: Notify driver that a management frame type was
1151 * registered. Note that this callback may not sleep, and cannot run
1152 * concurrently with itself.
1038 */ 1153 */
1039struct cfg80211_ops { 1154struct cfg80211_ops {
1040 int (*suspend)(struct wiphy *wiphy); 1155 int (*suspend)(struct wiphy *wiphy);
@@ -1050,13 +1165,14 @@ struct cfg80211_ops {
1050 struct vif_params *params); 1165 struct vif_params *params);
1051 1166
1052 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, 1167 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev,
1053 u8 key_index, const u8 *mac_addr, 1168 u8 key_index, bool pairwise, const u8 *mac_addr,
1054 struct key_params *params); 1169 struct key_params *params);
1055 int (*get_key)(struct wiphy *wiphy, struct net_device *netdev, 1170 int (*get_key)(struct wiphy *wiphy, struct net_device *netdev,
1056 u8 key_index, const u8 *mac_addr, void *cookie, 1171 u8 key_index, bool pairwise, const u8 *mac_addr,
1172 void *cookie,
1057 void (*callback)(void *cookie, struct key_params*)); 1173 void (*callback)(void *cookie, struct key_params*));
1058 int (*del_key)(struct wiphy *wiphy, struct net_device *netdev, 1174 int (*del_key)(struct wiphy *wiphy, struct net_device *netdev,
1059 u8 key_index, const u8 *mac_addr); 1175 u8 key_index, bool pairwise, const u8 *mac_addr);
1060 int (*set_default_key)(struct wiphy *wiphy, 1176 int (*set_default_key)(struct wiphy *wiphy,
1061 struct net_device *netdev, 1177 struct net_device *netdev,
1062 u8 key_index); 1178 u8 key_index);
@@ -1140,7 +1256,7 @@ struct cfg80211_ops {
1140 int (*get_tx_power)(struct wiphy *wiphy, int *dbm); 1256 int (*get_tx_power)(struct wiphy *wiphy, int *dbm);
1141 1257
1142 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, 1258 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
1143 u8 *addr); 1259 const u8 *addr);
1144 1260
1145 void (*rfkill_poll)(struct wiphy *wiphy); 1261 void (*rfkill_poll)(struct wiphy *wiphy);
1146 1262
@@ -1172,7 +1288,7 @@ struct cfg80211_ops {
1172 struct net_device *dev, 1288 struct net_device *dev,
1173 u64 cookie); 1289 u64 cookie);
1174 1290
1175 int (*action)(struct wiphy *wiphy, struct net_device *dev, 1291 int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev,
1176 struct ieee80211_channel *chan, 1292 struct ieee80211_channel *chan,
1177 enum nl80211_channel_type channel_type, 1293 enum nl80211_channel_type channel_type,
1178 bool channel_type_valid, 1294 bool channel_type_valid,
@@ -1184,6 +1300,10 @@ struct cfg80211_ops {
1184 int (*set_cqm_rssi_config)(struct wiphy *wiphy, 1300 int (*set_cqm_rssi_config)(struct wiphy *wiphy,
1185 struct net_device *dev, 1301 struct net_device *dev,
1186 s32 rssi_thold, u32 rssi_hyst); 1302 s32 rssi_thold, u32 rssi_hyst);
1303
1304 void (*mgmt_frame_register)(struct wiphy *wiphy,
1305 struct net_device *dev,
1306 u16 frame_type, bool reg);
1187}; 1307};
1188 1308
1189/* 1309/*
@@ -1221,21 +1341,31 @@ struct cfg80211_ops {
1221 * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station 1341 * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station
1222 * on a VLAN interface) 1342 * on a VLAN interface)
1223 * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station 1343 * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station
1344 * @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the
1345 * control port protocol ethertype. The device also honours the
1346 * control_port_no_encrypt flag.
1347 * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN.
1224 */ 1348 */
1225enum wiphy_flags { 1349enum wiphy_flags {
1226 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 1350 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
1227 WIPHY_FLAG_STRICT_REGULATORY = BIT(1), 1351 WIPHY_FLAG_STRICT_REGULATORY = BIT(1),
1228 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), 1352 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2),
1229 WIPHY_FLAG_NETNS_OK = BIT(3), 1353 WIPHY_FLAG_NETNS_OK = BIT(3),
1230 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), 1354 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
1231 WIPHY_FLAG_4ADDR_AP = BIT(5), 1355 WIPHY_FLAG_4ADDR_AP = BIT(5),
1232 WIPHY_FLAG_4ADDR_STATION = BIT(6), 1356 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1357 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7),
1358 WIPHY_FLAG_IBSS_RSN = BIT(7),
1233}; 1359};
1234 1360
1235struct mac_address { 1361struct mac_address {
1236 u8 addr[ETH_ALEN]; 1362 u8 addr[ETH_ALEN];
1237}; 1363};
1238 1364
1365struct ieee80211_txrx_stypes {
1366 u16 tx, rx;
1367};
1368
1239/** 1369/**
1240 * struct wiphy - wireless hardware description 1370 * struct wiphy - wireless hardware description
1241 * @reg_notifier: the driver's regulatory notification callback 1371 * @reg_notifier: the driver's regulatory notification callback
@@ -1286,6 +1416,10 @@ struct mac_address {
1286 * @privid: a pointer that drivers can use to identify if an arbitrary 1416 * @privid: a pointer that drivers can use to identify if an arbitrary
1287 * wiphy is theirs, e.g. in global notifiers 1417 * wiphy is theirs, e.g. in global notifiers
1288 * @bands: information about bands/channels supported by this device 1418 * @bands: information about bands/channels supported by this device
1419 *
1420 * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or
1421 * transmitted through nl80211, points to an array indexed by interface
1422 * type
1289 */ 1423 */
1290struct wiphy { 1424struct wiphy {
1291 /* assign these fields before you register the wiphy */ 1425 /* assign these fields before you register the wiphy */
@@ -1294,9 +1428,12 @@ struct wiphy {
1294 u8 perm_addr[ETH_ALEN]; 1428 u8 perm_addr[ETH_ALEN];
1295 u8 addr_mask[ETH_ALEN]; 1429 u8 addr_mask[ETH_ALEN];
1296 1430
1297 u16 n_addresses;
1298 struct mac_address *addresses; 1431 struct mac_address *addresses;
1299 1432
1433 const struct ieee80211_txrx_stypes *mgmt_stypes;
1434
1435 u16 n_addresses;
1436
1300 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1437 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
1301 u16 interface_modes; 1438 u16 interface_modes;
1302 1439
@@ -1492,8 +1629,8 @@ struct cfg80211_cached_keys;
1492 * set by driver (if supported) on add_interface BEFORE registering the 1629 * set by driver (if supported) on add_interface BEFORE registering the
1493 * netdev and may otherwise be used by driver read-only, will be update 1630 * netdev and may otherwise be used by driver read-only, will be update
1494 * by cfg80211 on change_interface 1631 * by cfg80211 on change_interface
1495 * @action_registrations: list of registrations for action frames 1632 * @mgmt_registrations: list of registrations for management frames
1496 * @action_registrations_lock: lock for the list 1633 * @mgmt_registrations_lock: lock for the list
1497 * @mtx: mutex used to lock data in this struct 1634 * @mtx: mutex used to lock data in this struct
1498 * @cleanup_work: work struct used for cleanup that can't be done directly 1635 * @cleanup_work: work struct used for cleanup that can't be done directly
1499 */ 1636 */
@@ -1505,8 +1642,8 @@ struct wireless_dev {
1505 struct list_head list; 1642 struct list_head list;
1506 struct net_device *netdev; 1643 struct net_device *netdev;
1507 1644
1508 struct list_head action_registrations; 1645 struct list_head mgmt_registrations;
1509 spinlock_t action_registrations_lock; 1646 spinlock_t mgmt_registrations_lock;
1510 1647
1511 struct mutex mtx; 1648 struct mutex mtx;
1512 1649
@@ -1563,8 +1700,10 @@ static inline void *wdev_priv(struct wireless_dev *wdev)
1563 return wiphy_priv(wdev->wiphy); 1700 return wiphy_priv(wdev->wiphy);
1564} 1701}
1565 1702
1566/* 1703/**
1567 * Utility functions 1704 * DOC: Utility functions
1705 *
1706 * cfg80211 offers a number of utility functions that can be useful.
1568 */ 1707 */
1569 1708
1570/** 1709/**
@@ -1715,7 +1854,15 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1715 * ieee80211_hdrlen - get header length in bytes from frame control 1854 * ieee80211_hdrlen - get header length in bytes from frame control
1716 * @fc: frame control field in little-endian format 1855 * @fc: frame control field in little-endian format
1717 */ 1856 */
1718unsigned int ieee80211_hdrlen(__le16 fc); 1857unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc);
1858
1859/**
1860 * DOC: Data path helpers
1861 *
1862 * In addition to generic utilities, cfg80211 also offers
1863 * functions that help implement the data path for devices
1864 * that do not do the 802.11/802.3 conversion on the device.
1865 */
1719 1866
1720/** 1867/**
1721 * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 1868 * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3
@@ -1777,8 +1924,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb);
1777 */ 1924 */
1778const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); 1925const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len);
1779 1926
1780/* 1927/**
1781 * Regulatory helper functions for wiphys 1928 * DOC: Regulatory enforcement infrastructure
1929 *
1930 * TODO
1782 */ 1931 */
1783 1932
1784/** 1933/**
@@ -2181,6 +2330,20 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
2181void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); 2330void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp);
2182 2331
2183/** 2332/**
2333 * DOC: RFkill integration
2334 *
2335 * RFkill integration in cfg80211 is almost invisible to drivers,
2336 * as cfg80211 automatically registers an rfkill instance for each
2337 * wireless device it knows about. Soft kill is also translated
2338 * into disconnecting and turning all interfaces off, drivers are
2339 * expected to turn off the device when all interfaces are down.
2340 *
2341 * However, devices may have a hard RFkill line, in which case they
2342 * also need to interact with the rfkill subsystem, via cfg80211.
2343 * They can do this with a few helper functions documented here.
2344 */
2345
2346/**
2184 * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state 2347 * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state
2185 * @wiphy: the wiphy 2348 * @wiphy: the wiphy
2186 * @blocked: block status 2349 * @blocked: block status
@@ -2201,6 +2364,17 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
2201 2364
2202#ifdef CONFIG_NL80211_TESTMODE 2365#ifdef CONFIG_NL80211_TESTMODE
2203/** 2366/**
2367 * DOC: Test mode
2368 *
2369 * Test mode is a set of utility functions to allow drivers to
2370 * interact with driver-specific tools to aid, for instance,
2371 * factory programming.
2372 *
2373 * This chapter describes how drivers interact with it, for more
2374 * information see the nl80211 book's chapter on it.
2375 */
2376
2377/**
2204 * cfg80211_testmode_alloc_reply_skb - allocate testmode reply 2378 * cfg80211_testmode_alloc_reply_skb - allocate testmode reply
2205 * @wiphy: the wiphy 2379 * @wiphy: the wiphy
2206 * @approxlen: an upper bound of the length of the data that will 2380 * @approxlen: an upper bound of the length of the data that will
@@ -2373,38 +2547,39 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
2373 struct station_info *sinfo, gfp_t gfp); 2547 struct station_info *sinfo, gfp_t gfp);
2374 2548
2375/** 2549/**
2376 * cfg80211_rx_action - notification of received, unprocessed Action frame 2550 * cfg80211_rx_mgmt - notification of received, unprocessed management frame
2377 * @dev: network device 2551 * @dev: network device
2378 * @freq: Frequency on which the frame was received in MHz 2552 * @freq: Frequency on which the frame was received in MHz
2379 * @buf: Action frame (header + body) 2553 * @buf: Management frame (header + body)
2380 * @len: length of the frame data 2554 * @len: length of the frame data
2381 * @gfp: context flags 2555 * @gfp: context flags
2382 * Returns %true if a user space application is responsible for rejecting the 2556 *
2383 * unrecognized Action frame; %false if no such application is registered 2557 * Returns %true if a user space application has registered for this frame.
2384 * (i.e., the driver is responsible for rejecting the unrecognized Action 2558 * For action frames, that makes it responsible for rejecting unrecognized
2385 * frame) 2559 * action frames; %false otherwise, in which case for action frames the
2560 * driver is responsible for rejecting the frame.
2386 * 2561 *
2387 * This function is called whenever an Action frame is received for a station 2562 * This function is called whenever an Action frame is received for a station
2388 * mode interface, but is not processed in kernel. 2563 * mode interface, but is not processed in kernel.
2389 */ 2564 */
2390bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf, 2565bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf,
2391 size_t len, gfp_t gfp); 2566 size_t len, gfp_t gfp);
2392 2567
2393/** 2568/**
2394 * cfg80211_action_tx_status - notification of TX status for Action frame 2569 * cfg80211_mgmt_tx_status - notification of TX status for management frame
2395 * @dev: network device 2570 * @dev: network device
2396 * @cookie: Cookie returned by cfg80211_ops::action() 2571 * @cookie: Cookie returned by cfg80211_ops::mgmt_tx()
2397 * @buf: Action frame (header + body) 2572 * @buf: Management frame (header + body)
2398 * @len: length of the frame data 2573 * @len: length of the frame data
2399 * @ack: Whether frame was acknowledged 2574 * @ack: Whether frame was acknowledged
2400 * @gfp: context flags 2575 * @gfp: context flags
2401 * 2576 *
2402 * This function is called whenever an Action frame was requested to be 2577 * This function is called whenever a management frame was requested to be
2403 * transmitted with cfg80211_ops::action() to report the TX status of the 2578 * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the
2404 * transmission attempt. 2579 * transmission attempt.
2405 */ 2580 */
2406void cfg80211_action_tx_status(struct net_device *dev, u64 cookie, 2581void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie,
2407 const u8 *buf, size_t len, bool ack, gfp_t gfp); 2582 const u8 *buf, size_t len, bool ack, gfp_t gfp);
2408 2583
2409 2584
2410/** 2585/**
@@ -2420,56 +2595,41 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
2420 enum nl80211_cqm_rssi_threshold_event rssi_event, 2595 enum nl80211_cqm_rssi_threshold_event rssi_event,
2421 gfp_t gfp); 2596 gfp_t gfp);
2422 2597
2423#ifdef __KERNEL__
2424
2425/* Logging, debugging and troubleshooting/diagnostic helpers. */ 2598/* Logging, debugging and troubleshooting/diagnostic helpers. */
2426 2599
2427/* wiphy_printk helpers, similar to dev_printk */ 2600/* wiphy_printk helpers, similar to dev_printk */
2428 2601
2429#define wiphy_printk(level, wiphy, format, args...) \ 2602#define wiphy_printk(level, wiphy, format, args...) \
2430 printk(level "%s: " format, wiphy_name(wiphy), ##args) 2603 dev_printk(level, &(wiphy)->dev, format, ##args)
2431#define wiphy_emerg(wiphy, format, args...) \ 2604#define wiphy_emerg(wiphy, format, args...) \
2432 wiphy_printk(KERN_EMERG, wiphy, format, ##args) 2605 dev_emerg(&(wiphy)->dev, format, ##args)
2433#define wiphy_alert(wiphy, format, args...) \ 2606#define wiphy_alert(wiphy, format, args...) \
2434 wiphy_printk(KERN_ALERT, wiphy, format, ##args) 2607 dev_alert(&(wiphy)->dev, format, ##args)
2435#define wiphy_crit(wiphy, format, args...) \ 2608#define wiphy_crit(wiphy, format, args...) \
2436 wiphy_printk(KERN_CRIT, wiphy, format, ##args) 2609 dev_crit(&(wiphy)->dev, format, ##args)
2437#define wiphy_err(wiphy, format, args...) \ 2610#define wiphy_err(wiphy, format, args...) \
2438 wiphy_printk(KERN_ERR, wiphy, format, ##args) 2611 dev_err(&(wiphy)->dev, format, ##args)
2439#define wiphy_warn(wiphy, format, args...) \ 2612#define wiphy_warn(wiphy, format, args...) \
2440 wiphy_printk(KERN_WARNING, wiphy, format, ##args) 2613 dev_warn(&(wiphy)->dev, format, ##args)
2441#define wiphy_notice(wiphy, format, args...) \ 2614#define wiphy_notice(wiphy, format, args...) \
2442 wiphy_printk(KERN_NOTICE, wiphy, format, ##args) 2615 dev_notice(&(wiphy)->dev, format, ##args)
2443#define wiphy_info(wiphy, format, args...) \ 2616#define wiphy_info(wiphy, format, args...) \
2444 wiphy_printk(KERN_INFO, wiphy, format, ##args) 2617 dev_info(&(wiphy)->dev, format, ##args)
2445 2618
2446int wiphy_debug(const struct wiphy *wiphy, const char *format, ...) 2619#define wiphy_debug(wiphy, format, args...) \
2447 __attribute__ ((format (printf, 2, 3)));
2448
2449#if defined(DEBUG)
2450#define wiphy_dbg(wiphy, format, args...) \
2451 wiphy_printk(KERN_DEBUG, wiphy, format, ##args) 2620 wiphy_printk(KERN_DEBUG, wiphy, format, ##args)
2452#elif defined(CONFIG_DYNAMIC_DEBUG) 2621
2453#define wiphy_dbg(wiphy, format, args...) \ 2622#define wiphy_dbg(wiphy, format, args...) \
2454 dynamic_pr_debug("%s: " format, wiphy_name(wiphy), ##args) 2623 dev_dbg(&(wiphy)->dev, format, ##args)
2455#else
2456#define wiphy_dbg(wiphy, format, args...) \
2457({ \
2458 if (0) \
2459 wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \
2460 0; \
2461})
2462#endif
2463 2624
2464#if defined(VERBOSE_DEBUG) 2625#if defined(VERBOSE_DEBUG)
2465#define wiphy_vdbg wiphy_dbg 2626#define wiphy_vdbg wiphy_dbg
2466#else 2627#else
2467
2468#define wiphy_vdbg(wiphy, format, args...) \ 2628#define wiphy_vdbg(wiphy, format, args...) \
2469({ \ 2629({ \
2470 if (0) \ 2630 if (0) \
2471 wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ 2631 wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \
2472 0; \ 2632 0; \
2473}) 2633})
2474#endif 2634#endif
2475 2635
@@ -2481,6 +2641,4 @@ int wiphy_debug(const struct wiphy *wiphy, const char *format, ...)
2481#define wiphy_WARN(wiphy, format, args...) \ 2641#define wiphy_WARN(wiphy, format, args...) \
2482 WARN(1, "wiphy: %s\n" format, wiphy_name(wiphy), ##args); 2642 WARN(1, "wiphy: %s\n" format, wiphy_name(wiphy), ##args);
2483 2643
2484#endif
2485
2486#endif /* __NET_CFG80211_H */ 2644#endif /* __NET_CFG80211_H */
diff --git a/include/net/dst.h b/include/net/dst.h
index 02386505033..ffe9cb719c0 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -43,10 +43,11 @@ struct dst_entry {
43 short error; 43 short error;
44 short obsolete; 44 short obsolete;
45 int flags; 45 int flags;
46#define DST_HOST 1 46#define DST_HOST 0x0001
47#define DST_NOXFRM 2 47#define DST_NOXFRM 0x0002
48#define DST_NOPOLICY 4 48#define DST_NOPOLICY 0x0004
49#define DST_NOHASH 8 49#define DST_NOHASH 0x0008
50#define DST_NOCACHE 0x0010
50 unsigned long expires; 51 unsigned long expires;
51 52
52 unsigned short header_len; /* more space at head required */ 53 unsigned short header_len; /* more space at head required */
@@ -94,7 +95,7 @@ struct dst_entry {
94 unsigned long lastuse; 95 unsigned long lastuse;
95 union { 96 union {
96 struct dst_entry *next; 97 struct dst_entry *next;
97 struct rtable *rt_next; 98 struct rtable __rcu *rt_next;
98 struct rt6_info *rt6_next; 99 struct rt6_info *rt6_next;
99 struct dn_route *dn_next; 100 struct dn_route *dn_next;
100 }; 101 };
@@ -228,23 +229,37 @@ static inline void skb_dst_force(struct sk_buff *skb)
228 229
229 230
230/** 231/**
232 * __skb_tunnel_rx - prepare skb for rx reinsert
233 * @skb: buffer
234 * @dev: tunnel device
235 *
236 * After decapsulation, packet is going to re-enter (netif_rx()) our stack,
237 * so make some cleanups. (no accounting done)
238 */
239static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
240{
241 skb->dev = dev;
242 skb->rxhash = 0;
243 skb_set_queue_mapping(skb, 0);
244 skb_dst_drop(skb);
245 nf_reset(skb);
246}
247
248/**
231 * skb_tunnel_rx - prepare skb for rx reinsert 249 * skb_tunnel_rx - prepare skb for rx reinsert
232 * @skb: buffer 250 * @skb: buffer
233 * @dev: tunnel device 251 * @dev: tunnel device
234 * 252 *
235 * After decapsulation, packet is going to re-enter (netif_rx()) our stack, 253 * After decapsulation, packet is going to re-enter (netif_rx()) our stack,
236 * so make some cleanups, and perform accounting. 254 * so make some cleanups, and perform accounting.
255 * Note: this accounting is not SMP safe.
237 */ 256 */
238static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 257static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
239{ 258{
240 skb->dev = dev;
241 /* TODO : stats should be SMP safe */ 259 /* TODO : stats should be SMP safe */
242 dev->stats.rx_packets++; 260 dev->stats.rx_packets++;
243 dev->stats.rx_bytes += skb->len; 261 dev->stats.rx_bytes += skb->len;
244 skb->rxhash = 0; 262 __skb_tunnel_rx(skb, dev);
245 skb_set_queue_mapping(skb, 0);
246 skb_dst_drop(skb);
247 nf_reset(skb);
248} 263}
249 264
250/* Children define the path of the packet through the 265/* Children define the path of the packet through the
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h
index d1ff9b7e99b..1fa5306e3e2 100644
--- a/include/net/dst_ops.h
+++ b/include/net/dst_ops.h
@@ -1,6 +1,7 @@
1#ifndef _NET_DST_OPS_H 1#ifndef _NET_DST_OPS_H
2#define _NET_DST_OPS_H 2#define _NET_DST_OPS_H
3#include <linux/types.h> 3#include <linux/types.h>
4#include <linux/percpu_counter.h>
4 5
5struct dst_entry; 6struct dst_entry;
6struct kmem_cachep; 7struct kmem_cachep;
@@ -22,7 +23,41 @@ struct dst_ops {
22 void (*update_pmtu)(struct dst_entry *dst, u32 mtu); 23 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
23 int (*local_out)(struct sk_buff *skb); 24 int (*local_out)(struct sk_buff *skb);
24 25
25 atomic_t entries;
26 struct kmem_cache *kmem_cachep; 26 struct kmem_cache *kmem_cachep;
27
28 struct percpu_counter pcpuc_entries ____cacheline_aligned_in_smp;
27}; 29};
30
31static inline int dst_entries_get_fast(struct dst_ops *dst)
32{
33 return percpu_counter_read_positive(&dst->pcpuc_entries);
34}
35
36static inline int dst_entries_get_slow(struct dst_ops *dst)
37{
38 int res;
39
40 local_bh_disable();
41 res = percpu_counter_sum_positive(&dst->pcpuc_entries);
42 local_bh_enable();
43 return res;
44}
45
46static inline void dst_entries_add(struct dst_ops *dst, int val)
47{
48 local_bh_disable();
49 percpu_counter_add(&dst->pcpuc_entries, val);
50 local_bh_enable();
51}
52
53static inline int dst_entries_init(struct dst_ops *dst)
54{
55 return percpu_counter_init(&dst->pcpuc_entries, 0);
56}
57
58static inline void dst_entries_destroy(struct dst_ops *dst)
59{
60 percpu_counter_destroy(&dst->pcpuc_entries);
61}
62
28#endif 63#endif
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index e8923bc20f9..075f1e3a0fe 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -20,7 +20,7 @@ struct fib_rule {
20 u32 table; 20 u32 table;
21 u8 action; 21 u8 action;
22 u32 target; 22 u32 target;
23 struct fib_rule * ctarget; 23 struct fib_rule __rcu *ctarget;
24 char iifname[IFNAMSIZ]; 24 char iifname[IFNAMSIZ];
25 char oifname[IFNAMSIZ]; 25 char oifname[IFNAMSIZ];
26 struct rcu_head rcu; 26 struct rcu_head rcu;
@@ -31,6 +31,8 @@ struct fib_lookup_arg {
31 void *lookup_ptr; 31 void *lookup_ptr;
32 void *result; 32 void *result;
33 struct fib_rule *rule; 33 struct fib_rule *rule;
34 int flags;
35#define FIB_LOOKUP_NOREF 1
34}; 36};
35 37
36struct fib_rules_ops { 38struct fib_rules_ops {
@@ -106,7 +108,6 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
106 108
107extern struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, struct net *); 109extern struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, struct net *);
108extern void fib_rules_unregister(struct fib_rules_ops *); 110extern void fib_rules_unregister(struct fib_rules_ops *);
109extern void fib_rules_cleanup_ops(struct fib_rules_ops *);
110 111
111extern int fib_rules_lookup(struct fib_rules_ops *, 112extern int fib_rules_lookup(struct fib_rules_ops *,
112 struct flowi *, int flags, 113 struct flowi *, int flags,
diff --git a/include/net/flow.h b/include/net/flow.h
index bb08692a20b..0ac3fb5e097 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -49,6 +49,7 @@ struct flowi {
49 __u8 proto; 49 __u8 proto;
50 __u8 flags; 50 __u8 flags;
51#define FLOWI_FLAG_ANYSRC 0x01 51#define FLOWI_FLAG_ANYSRC 0x01
52#define FLOWI_FLAG_MATCH_ANY_IIF 0x02
52 union { 53 union {
53 struct { 54 struct {
54 __be16 sport; 55 __be16 sport;
diff --git a/include/net/garp.h b/include/net/garp.h
index 825f172caba..f4c295984c4 100644
--- a/include/net/garp.h
+++ b/include/net/garp.h
@@ -107,7 +107,7 @@ struct garp_applicant {
107}; 107};
108 108
109struct garp_port { 109struct garp_port {
110 struct garp_applicant *applicants[GARP_APPLICATION_MAX + 1]; 110 struct garp_applicant __rcu *applicants[GARP_APPLICATION_MAX + 1];
111}; 111};
112 112
113extern int garp_register_application(struct garp_application *app); 113extern int garp_register_application(struct garp_application *app);
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index f7dcd2c7041..8a64b811a39 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -20,6 +20,9 @@ struct genl_multicast_group {
20 u32 id; 20 u32 id;
21}; 21};
22 22
23struct genl_ops;
24struct genl_info;
25
23/** 26/**
24 * struct genl_family - generic netlink family 27 * struct genl_family - generic netlink family
25 * @id: protocol family idenfitier 28 * @id: protocol family idenfitier
@@ -29,6 +32,10 @@ struct genl_multicast_group {
29 * @maxattr: maximum number of attributes supported 32 * @maxattr: maximum number of attributes supported
30 * @netnsok: set to true if the family can handle network 33 * @netnsok: set to true if the family can handle network
31 * namespaces and should be presented in all of them 34 * namespaces and should be presented in all of them
35 * @pre_doit: called before an operation's doit callback, it may
36 * do additional, common, filtering and return an error
37 * @post_doit: called after an operation's doit callback, it may
38 * undo operations done by pre_doit, for example release locks
32 * @attrbuf: buffer to store parsed attributes 39 * @attrbuf: buffer to store parsed attributes
33 * @ops_list: list of all assigned operations 40 * @ops_list: list of all assigned operations
34 * @family_list: family list 41 * @family_list: family list
@@ -41,6 +48,12 @@ struct genl_family {
41 unsigned int version; 48 unsigned int version;
42 unsigned int maxattr; 49 unsigned int maxattr;
43 bool netnsok; 50 bool netnsok;
51 int (*pre_doit)(struct genl_ops *ops,
52 struct sk_buff *skb,
53 struct genl_info *info);
54 void (*post_doit)(struct genl_ops *ops,
55 struct sk_buff *skb,
56 struct genl_info *info);
44 struct nlattr ** attrbuf; /* private */ 57 struct nlattr ** attrbuf; /* private */
45 struct list_head ops_list; /* private */ 58 struct list_head ops_list; /* private */
46 struct list_head family_list; /* private */ 59 struct list_head family_list; /* private */
@@ -55,6 +68,8 @@ struct genl_family {
55 * @genlhdr: generic netlink message header 68 * @genlhdr: generic netlink message header
56 * @userhdr: user specific header 69 * @userhdr: user specific header
57 * @attrs: netlink attributes 70 * @attrs: netlink attributes
71 * @_net: network namespace
72 * @user_ptr: user pointers
58 */ 73 */
59struct genl_info { 74struct genl_info {
60 u32 snd_seq; 75 u32 snd_seq;
@@ -66,6 +81,7 @@ struct genl_info {
66#ifdef CONFIG_NET_NS 81#ifdef CONFIG_NET_NS
67 struct net * _net; 82 struct net * _net;
68#endif 83#endif
84 void * user_ptr[2];
69}; 85};
70 86
71static inline struct net *genl_info_net(struct genl_info *info) 87static inline struct net *genl_info_net(struct genl_info *info)
@@ -81,6 +97,7 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net)
81/** 97/**
82 * struct genl_ops - generic netlink operations 98 * struct genl_ops - generic netlink operations
83 * @cmd: command identifier 99 * @cmd: command identifier
100 * @internal_flags: flags used by the family
84 * @flags: flags 101 * @flags: flags
85 * @policy: attribute validation policy 102 * @policy: attribute validation policy
86 * @doit: standard command callback 103 * @doit: standard command callback
@@ -90,6 +107,7 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net)
90 */ 107 */
91struct genl_ops { 108struct genl_ops {
92 u8 cmd; 109 u8 cmd;
110 u8 internal_flags;
93 unsigned int flags; 111 unsigned int flags;
94 const struct nla_policy *policy; 112 const struct nla_policy *policy;
95 int (*doit)(struct sk_buff *skb, 113 int (*doit)(struct sk_buff *skb,
diff --git a/include/net/gre.h b/include/net/gre.h
new file mode 100644
index 00000000000..82665474bcb
--- /dev/null
+++ b/include/net/gre.h
@@ -0,0 +1,18 @@
1#ifndef __LINUX_GRE_H
2#define __LINUX_GRE_H
3
4#include <linux/skbuff.h>
5
6#define GREPROTO_CISCO 0
7#define GREPROTO_PPTP 1
8#define GREPROTO_MAX 2
9
10struct gre_protocol {
11 int (*handler)(struct sk_buff *skb);
12 void (*err_handler)(struct sk_buff *skb, u32 info);
13};
14
15int gre_add_protocol(const struct gre_protocol *proto, u8 version);
16int gre_del_protocol(const struct gre_protocol *proto, u8 version);
17
18#endif
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index b6d3b55da19..e4f494b42e0 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -125,6 +125,7 @@ struct inet_connection_sock {
125 int probe_size; 125 int probe_size;
126 } icsk_mtup; 126 } icsk_mtup;
127 u32 icsk_ca_priv[16]; 127 u32 icsk_ca_priv[16];
128 u32 icsk_user_timeout;
128#define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) 129#define ICSK_CA_PRIV_SIZE (16 * sizeof(u32))
129}; 130};
130 131
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 9b5d08f4f6e..88bdd010d65 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -27,7 +27,7 @@ static inline int INET_ECN_is_not_ect(__u8 dsfield)
27 27
28static inline int INET_ECN_is_capable(__u8 dsfield) 28static inline int INET_ECN_is_capable(__u8 dsfield)
29{ 29{
30 return (dsfield & INET_ECN_ECT_0); 30 return dsfield & INET_ECN_ECT_0;
31} 31}
32 32
33static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) 33static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 74358d1b3f4..e9c2ed8af86 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -245,7 +245,7 @@ static inline int inet_sk_listen_hashfn(const struct sock *sk)
245} 245}
246 246
247/* Caller must disable local BH processing. */ 247/* Caller must disable local BH processing. */
248extern void __inet_inherit_port(struct sock *sk, struct sock *child); 248extern int __inet_inherit_port(struct sock *sk, struct sock *child);
249 249
250extern void inet_put_port(struct sock *sk); 250extern void inet_put_port(struct sock *sk);
251 251
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 417d0c894f2..fe239bfe5f7 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -15,7 +15,7 @@
15 15
16struct inet_peer { 16struct inet_peer {
17 /* group together avl_left,avl_right,v4daddr to speedup lookups */ 17 /* group together avl_left,avl_right,v4daddr to speedup lookups */
18 struct inet_peer *avl_left, *avl_right; 18 struct inet_peer __rcu *avl_left, *avl_right;
19 __be32 v4daddr; /* peer's address */ 19 __be32 v4daddr; /* peer's address */
20 __u32 avl_height; 20 __u32 avl_height;
21 struct list_head unused; 21 struct list_head unused;
diff --git a/include/net/ip.h b/include/net/ip.h
index 890f9725d68..86e2b182a0c 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -53,13 +53,13 @@ struct ipcm_cookie {
53 __be32 addr; 53 __be32 addr;
54 int oif; 54 int oif;
55 struct ip_options *opt; 55 struct ip_options *opt;
56 union skb_shared_tx shtx; 56 __u8 tx_flags;
57}; 57};
58 58
59#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) 59#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb))
60 60
61struct ip_ra_chain { 61struct ip_ra_chain {
62 struct ip_ra_chain *next; 62 struct ip_ra_chain __rcu *next;
63 struct sock *sk; 63 struct sock *sk;
64 union { 64 union {
65 void (*destructor)(struct sock *); 65 void (*destructor)(struct sock *);
@@ -68,7 +68,7 @@ struct ip_ra_chain {
68 struct rcu_head rcu; 68 struct rcu_head rcu;
69}; 69};
70 70
71extern struct ip_ra_chain *ip_ra_chain; 71extern struct ip_ra_chain __rcu *ip_ra_chain;
72 72
73/* IP flags. */ 73/* IP flags. */
74#define IP_CE 0x8000 /* Flag: "Congestion" */ 74#define IP_CE 0x8000 /* Flag: "Congestion" */
@@ -238,9 +238,9 @@ int ip_decrease_ttl(struct iphdr *iph)
238static inline 238static inline
239int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) 239int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
240{ 240{
241 return (inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO || 241 return inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||
242 (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT && 242 (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
243 !(dst_metric_locked(dst, RTAX_MTU)))); 243 !(dst_metric_locked(dst, RTAX_MTU)));
244} 244}
245 245
246extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); 246extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index fc94ec568a5..fc73e667b50 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -13,7 +13,7 @@
13/* IPv6 tunnel */ 13/* IPv6 tunnel */
14 14
15struct ip6_tnl { 15struct ip6_tnl {
16 struct ip6_tnl *next; /* next tunnel in list */ 16 struct ip6_tnl __rcu *next; /* next tunnel in list */
17 struct net_device *dev; /* virtual device associated with tunnel */ 17 struct net_device *dev; /* virtual device associated with tunnel */
18 struct ip6_tnl_parm parms; /* tunnel configuration parameters */ 18 struct ip6_tnl_parm parms; /* tunnel configuration parameters */
19 struct flowi fl; /* flowi template for xmit */ 19 struct flowi fl; /* flowi template for xmit */
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index c93f94edc61..07bdb5e9e8a 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -86,6 +86,7 @@ struct fib_info {
86#ifdef CONFIG_IP_ROUTE_MULTIPATH 86#ifdef CONFIG_IP_ROUTE_MULTIPATH
87 int fib_power; 87 int fib_power;
88#endif 88#endif
89 struct rcu_head rcu;
89 struct fib_nh fib_nh[0]; 90 struct fib_nh fib_nh[0];
90#define fib_dev fib_nh[0].nh_dev 91#define fib_dev fib_nh[0].nh_dev
91}; 92};
@@ -148,7 +149,7 @@ struct fib_table {
148}; 149};
149 150
150extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp, 151extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp,
151 struct fib_result *res); 152 struct fib_result *res, int fib_flags);
152extern int fib_table_insert(struct fib_table *, struct fib_config *); 153extern int fib_table_insert(struct fib_table *, struct fib_config *);
153extern int fib_table_delete(struct fib_table *, struct fib_config *); 154extern int fib_table_delete(struct fib_table *, struct fib_config *);
154extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb, 155extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb,
@@ -157,6 +158,8 @@ extern int fib_table_flush(struct fib_table *table);
157extern void fib_table_select_default(struct fib_table *table, 158extern void fib_table_select_default(struct fib_table *table,
158 const struct flowi *flp, 159 const struct flowi *flp,
159 struct fib_result *res); 160 struct fib_result *res);
161extern void fib_free_table(struct fib_table *tb);
162
160 163
161 164
162#ifndef CONFIG_IP_MULTIPLE_TABLES 165#ifndef CONFIG_IP_MULTIPLE_TABLES
@@ -185,11 +188,11 @@ static inline int fib_lookup(struct net *net, const struct flowi *flp,
185 struct fib_table *table; 188 struct fib_table *table;
186 189
187 table = fib_get_table(net, RT_TABLE_LOCAL); 190 table = fib_get_table(net, RT_TABLE_LOCAL);
188 if (!fib_table_lookup(table, flp, res)) 191 if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF))
189 return 0; 192 return 0;
190 193
191 table = fib_get_table(net, RT_TABLE_MAIN); 194 table = fib_get_table(net, RT_TABLE_MAIN);
192 if (!fib_table_lookup(table, flp, res)) 195 if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF))
193 return 0; 196 return 0;
194 return -ENETUNREACH; 197 return -ENETUNREACH;
195} 198}
@@ -254,16 +257,6 @@ static inline void fib_info_put(struct fib_info *fi)
254 free_fib_info(fi); 257 free_fib_info(fi);
255} 258}
256 259
257static inline void fib_res_put(struct fib_result *res)
258{
259 if (res->fi)
260 fib_info_put(res->fi);
261#ifdef CONFIG_IP_MULTIPLE_TABLES
262 if (res->r)
263 fib_rule_put(res->r);
264#endif
265}
266
267#ifdef CONFIG_PROC_FS 260#ifdef CONFIG_PROC_FS
268extern int __net_init fib_proc_init(struct net *net); 261extern int __net_init fib_proc_init(struct net *net);
269extern void __net_exit fib_proc_exit(struct net *net); 262extern void __net_exit fib_proc_exit(struct net *net);
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index f976885f686..b7bbd6c28cf 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -25,7 +25,9 @@
25#include <linux/ip.h> 25#include <linux/ip.h>
26#include <linux/ipv6.h> /* for struct ipv6hdr */ 26#include <linux/ipv6.h> /* for struct ipv6hdr */
27#include <net/ipv6.h> /* for ipv6_addr_copy */ 27#include <net/ipv6.h> /* for ipv6_addr_copy */
28 28#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
29#include <net/netfilter/nf_conntrack.h>
30#endif
29 31
30/* Connections' size value needed by ip_vs_ctl.c */ 32/* Connections' size value needed by ip_vs_ctl.c */
31extern int ip_vs_conn_tab_size; 33extern int ip_vs_conn_tab_size;
@@ -134,24 +136,24 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
134 if (net_ratelimit()) \ 136 if (net_ratelimit()) \
135 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ 137 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
136 } while (0) 138 } while (0)
137#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ 139#define IP_VS_DBG_PKT(level, af, pp, skb, ofs, msg) \
138 do { \ 140 do { \
139 if (level <= ip_vs_get_debug_level()) \ 141 if (level <= ip_vs_get_debug_level()) \
140 pp->debug_packet(pp, skb, ofs, msg); \ 142 pp->debug_packet(af, pp, skb, ofs, msg); \
141 } while (0) 143 } while (0)
142#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ 144#define IP_VS_DBG_RL_PKT(level, af, pp, skb, ofs, msg) \
143 do { \ 145 do { \
144 if (level <= ip_vs_get_debug_level() && \ 146 if (level <= ip_vs_get_debug_level() && \
145 net_ratelimit()) \ 147 net_ratelimit()) \
146 pp->debug_packet(pp, skb, ofs, msg); \ 148 pp->debug_packet(af, pp, skb, ofs, msg); \
147 } while (0) 149 } while (0)
148#else /* NO DEBUGGING at ALL */ 150#else /* NO DEBUGGING at ALL */
149#define IP_VS_DBG_BUF(level, msg...) do {} while (0) 151#define IP_VS_DBG_BUF(level, msg...) do {} while (0)
150#define IP_VS_ERR_BUF(msg...) do {} while (0) 152#define IP_VS_ERR_BUF(msg...) do {} while (0)
151#define IP_VS_DBG(level, msg...) do {} while (0) 153#define IP_VS_DBG(level, msg...) do {} while (0)
152#define IP_VS_DBG_RL(msg...) do {} while (0) 154#define IP_VS_DBG_RL(msg...) do {} while (0)
153#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) do {} while (0) 155#define IP_VS_DBG_PKT(level, af, pp, skb, ofs, msg) do {} while (0)
154#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) do {} while (0) 156#define IP_VS_DBG_RL_PKT(level, af, pp, skb, ofs, msg) do {} while (0)
155#endif 157#endif
156 158
157#define IP_VS_BUG() BUG() 159#define IP_VS_BUG() BUG()
@@ -343,7 +345,7 @@ struct ip_vs_protocol {
343 345
344 int (*app_conn_bind)(struct ip_vs_conn *cp); 346 int (*app_conn_bind)(struct ip_vs_conn *cp);
345 347
346 void (*debug_packet)(struct ip_vs_protocol *pp, 348 void (*debug_packet)(int af, struct ip_vs_protocol *pp,
347 const struct sk_buff *skb, 349 const struct sk_buff *skb,
348 int offset, 350 int offset,
349 const char *msg); 351 const char *msg);
@@ -355,6 +357,19 @@ struct ip_vs_protocol {
355 357
356extern struct ip_vs_protocol * ip_vs_proto_get(unsigned short proto); 358extern struct ip_vs_protocol * ip_vs_proto_get(unsigned short proto);
357 359
360struct ip_vs_conn_param {
361 const union nf_inet_addr *caddr;
362 const union nf_inet_addr *vaddr;
363 __be16 cport;
364 __be16 vport;
365 __u16 protocol;
366 u16 af;
367
368 const struct ip_vs_pe *pe;
369 char *pe_data;
370 __u8 pe_data_len;
371};
372
358/* 373/*
359 * IP_VS structure allocated for each dynamically scheduled connection 374 * IP_VS structure allocated for each dynamically scheduled connection
360 */ 375 */
@@ -366,6 +381,7 @@ struct ip_vs_conn {
366 union nf_inet_addr caddr; /* client address */ 381 union nf_inet_addr caddr; /* client address */
367 union nf_inet_addr vaddr; /* virtual address */ 382 union nf_inet_addr vaddr; /* virtual address */
368 union nf_inet_addr daddr; /* destination address */ 383 union nf_inet_addr daddr; /* destination address */
384 volatile __u32 flags; /* status flags */
369 __be16 cport; 385 __be16 cport;
370 __be16 vport; 386 __be16 vport;
371 __be16 dport; 387 __be16 dport;
@@ -378,7 +394,6 @@ struct ip_vs_conn {
378 394
379 /* Flags and state transition */ 395 /* Flags and state transition */
380 spinlock_t lock; /* lock for state transition */ 396 spinlock_t lock; /* lock for state transition */
381 volatile __u16 flags; /* status flags */
382 volatile __u16 state; /* state info */ 397 volatile __u16 state; /* state info */
383 volatile __u16 old_state; /* old state, to be used for 398 volatile __u16 old_state; /* old state, to be used for
384 * state transition triggerd 399 * state transition triggerd
@@ -394,6 +409,7 @@ struct ip_vs_conn {
394 /* packet transmitter for different forwarding methods. If it 409 /* packet transmitter for different forwarding methods. If it
395 mangles the packet, it must return NF_DROP or better NF_STOLEN, 410 mangles the packet, it must return NF_DROP or better NF_STOLEN,
396 otherwise this must be changed to a sk_buff **. 411 otherwise this must be changed to a sk_buff **.
412 NF_ACCEPT can be returned when destination is local.
397 */ 413 */
398 int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, 414 int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp,
399 struct ip_vs_protocol *pp); 415 struct ip_vs_protocol *pp);
@@ -405,6 +421,9 @@ struct ip_vs_conn {
405 void *app_data; /* Application private data */ 421 void *app_data; /* Application private data */
406 struct ip_vs_seq in_seq; /* incoming seq. struct */ 422 struct ip_vs_seq in_seq; /* incoming seq. struct */
407 struct ip_vs_seq out_seq; /* outgoing seq. struct */ 423 struct ip_vs_seq out_seq; /* outgoing seq. struct */
424
425 char *pe_data;
426 __u8 pe_data_len;
408}; 427};
409 428
410 429
@@ -426,6 +445,7 @@ struct ip_vs_service_user_kern {
426 445
427 /* virtual service options */ 446 /* virtual service options */
428 char *sched_name; 447 char *sched_name;
448 char *pe_name;
429 unsigned flags; /* virtual service flags */ 449 unsigned flags; /* virtual service flags */
430 unsigned timeout; /* persistent timeout in sec */ 450 unsigned timeout; /* persistent timeout in sec */
431 u32 netmask; /* persistent netmask */ 451 u32 netmask; /* persistent netmask */
@@ -475,6 +495,9 @@ struct ip_vs_service {
475 struct ip_vs_scheduler *scheduler; /* bound scheduler object */ 495 struct ip_vs_scheduler *scheduler; /* bound scheduler object */
476 rwlock_t sched_lock; /* lock sched_data */ 496 rwlock_t sched_lock; /* lock sched_data */
477 void *sched_data; /* scheduler application data */ 497 void *sched_data; /* scheduler application data */
498
499 /* alternate persistence engine */
500 struct ip_vs_pe *pe;
478}; 501};
479 502
480 503
@@ -507,6 +530,10 @@ struct ip_vs_dest {
507 spinlock_t dst_lock; /* lock of dst_cache */ 530 spinlock_t dst_lock; /* lock of dst_cache */
508 struct dst_entry *dst_cache; /* destination cache entry */ 531 struct dst_entry *dst_cache; /* destination cache entry */
509 u32 dst_rtos; /* RT_TOS(tos) for dst */ 532 u32 dst_rtos; /* RT_TOS(tos) for dst */
533 u32 dst_cookie;
534#ifdef CONFIG_IP_VS_IPV6
535 struct in6_addr dst_saddr;
536#endif
510 537
511 /* for virtual service */ 538 /* for virtual service */
512 struct ip_vs_service *svc; /* service it belongs to */ 539 struct ip_vs_service *svc; /* service it belongs to */
@@ -538,6 +565,21 @@ struct ip_vs_scheduler {
538 const struct sk_buff *skb); 565 const struct sk_buff *skb);
539}; 566};
540 567
568/* The persistence engine object */
569struct ip_vs_pe {
570 struct list_head n_list; /* d-linked list head */
571 char *name; /* scheduler name */
572 atomic_t refcnt; /* reference counter */
573 struct module *module; /* THIS_MODULE/NULL */
574
575 /* get the connection template, if any */
576 int (*fill_param)(struct ip_vs_conn_param *p, struct sk_buff *skb);
577 bool (*ct_match)(const struct ip_vs_conn_param *p,
578 struct ip_vs_conn *ct);
579 u32 (*hashkey_raw)(const struct ip_vs_conn_param *p, u32 initval,
580 bool inverse);
581 int (*show_pe_data)(const struct ip_vs_conn *cp, char *buf);
582};
541 583
542/* 584/*
543 * The application module object (a.k.a. app incarnation) 585 * The application module object (a.k.a. app incarnation)
@@ -556,11 +598,19 @@ struct ip_vs_app {
556 __be16 port; /* port number in net order */ 598 __be16 port; /* port number in net order */
557 atomic_t usecnt; /* usage counter */ 599 atomic_t usecnt; /* usage counter */
558 600
559 /* output hook: return false if can't linearize. diff set for TCP. */ 601 /*
602 * output hook: Process packet in inout direction, diff set for TCP.
603 * Return: 0=Error, 1=Payload Not Mangled/Mangled but checksum is ok,
604 * 2=Mangled but checksum was not updated
605 */
560 int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *, 606 int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *,
561 struct sk_buff *, int *diff); 607 struct sk_buff *, int *diff);
562 608
563 /* input hook: return false if can't linearize. diff set for TCP. */ 609 /*
610 * input hook: Process packet in outin direction, diff set for TCP.
611 * Return: 0=Error, 1=Payload Not Mangled/Mangled but checksum is ok,
612 * 2=Mangled but checksum was not updated
613 */
564 int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *, 614 int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *,
565 struct sk_buff *, int *diff); 615 struct sk_buff *, int *diff);
566 616
@@ -624,13 +674,25 @@ enum {
624 IP_VS_DIR_LAST, 674 IP_VS_DIR_LAST,
625}; 675};
626 676
627extern struct ip_vs_conn *ip_vs_conn_in_get 677static inline void ip_vs_conn_fill_param(int af, int protocol,
628(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, 678 const union nf_inet_addr *caddr,
629 const union nf_inet_addr *d_addr, __be16 d_port); 679 __be16 cport,
680 const union nf_inet_addr *vaddr,
681 __be16 vport,
682 struct ip_vs_conn_param *p)
683{
684 p->af = af;
685 p->protocol = protocol;
686 p->caddr = caddr;
687 p->cport = cport;
688 p->vaddr = vaddr;
689 p->vport = vport;
690 p->pe = NULL;
691 p->pe_data = NULL;
692}
630 693
631extern struct ip_vs_conn *ip_vs_ct_in_get 694struct ip_vs_conn *ip_vs_conn_in_get(const struct ip_vs_conn_param *p);
632(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, 695struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p);
633 const union nf_inet_addr *d_addr, __be16 d_port);
634 696
635struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, 697struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
636 struct ip_vs_protocol *pp, 698 struct ip_vs_protocol *pp,
@@ -638,9 +700,7 @@ struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
638 unsigned int proto_off, 700 unsigned int proto_off,
639 int inverse); 701 int inverse);
640 702
641extern struct ip_vs_conn *ip_vs_conn_out_get 703struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p);
642(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
643 const union nf_inet_addr *d_addr, __be16 d_port);
644 704
645struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, 705struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb,
646 struct ip_vs_protocol *pp, 706 struct ip_vs_protocol *pp,
@@ -656,11 +716,10 @@ static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
656extern void ip_vs_conn_put(struct ip_vs_conn *cp); 716extern void ip_vs_conn_put(struct ip_vs_conn *cp);
657extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); 717extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport);
658 718
659extern struct ip_vs_conn * 719struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p,
660ip_vs_conn_new(int af, int proto, const union nf_inet_addr *caddr, __be16 cport, 720 const union nf_inet_addr *daddr,
661 const union nf_inet_addr *vaddr, __be16 vport, 721 __be16 dport, unsigned flags,
662 const union nf_inet_addr *daddr, __be16 dport, unsigned flags, 722 struct ip_vs_dest *dest);
663 struct ip_vs_dest *dest);
664extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); 723extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp);
665 724
666extern const char * ip_vs_state_name(__u16 proto, int state); 725extern const char * ip_vs_state_name(__u16 proto, int state);
@@ -751,6 +810,12 @@ extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
751extern int ip_vs_app_init(void); 810extern int ip_vs_app_init(void);
752extern void ip_vs_app_cleanup(void); 811extern void ip_vs_app_cleanup(void);
753 812
813void ip_vs_bind_pe(struct ip_vs_service *svc, struct ip_vs_pe *pe);
814void ip_vs_unbind_pe(struct ip_vs_service *svc);
815int register_ip_vs_pe(struct ip_vs_pe *pe);
816int unregister_ip_vs_pe(struct ip_vs_pe *pe);
817extern struct ip_vs_pe *ip_vs_pe_get(const char *name);
818extern void ip_vs_pe_put(struct ip_vs_pe *pe);
754 819
755/* 820/*
756 * IPVS protocol functions (from ip_vs_proto.c) 821 * IPVS protocol functions (from ip_vs_proto.c)
@@ -763,7 +828,8 @@ extern int
763ip_vs_set_state_timeout(int *table, int num, const char *const *names, 828ip_vs_set_state_timeout(int *table, int num, const char *const *names,
764 const char *name, int to); 829 const char *name, int to);
765extern void 830extern void
766ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, 831ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp,
832 const struct sk_buff *skb,
767 int offset, const char *msg); 833 int offset, const char *msg);
768 834
769extern struct ip_vs_protocol ip_vs_protocol_tcp; 835extern struct ip_vs_protocol ip_vs_protocol_tcp;
@@ -785,7 +851,8 @@ extern int ip_vs_unbind_scheduler(struct ip_vs_service *svc);
785extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); 851extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name);
786extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); 852extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler);
787extern struct ip_vs_conn * 853extern struct ip_vs_conn *
788ip_vs_schedule(struct ip_vs_service *svc, const struct sk_buff *skb); 854ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
855 struct ip_vs_protocol *pp, int *ignored);
789extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, 856extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
790 struct ip_vs_protocol *pp); 857 struct ip_vs_protocol *pp);
791 858
@@ -798,6 +865,8 @@ extern int sysctl_ip_vs_expire_nodest_conn;
798extern int sysctl_ip_vs_expire_quiescent_template; 865extern int sysctl_ip_vs_expire_quiescent_template;
799extern int sysctl_ip_vs_sync_threshold[2]; 866extern int sysctl_ip_vs_sync_threshold[2];
800extern int sysctl_ip_vs_nat_icmp_send; 867extern int sysctl_ip_vs_nat_icmp_send;
868extern int sysctl_ip_vs_conntrack;
869extern int sysctl_ip_vs_snat_reroute;
801extern struct ip_vs_stats ip_vs_stats; 870extern struct ip_vs_stats ip_vs_stats;
802extern const struct ctl_path net_vs_ctl_path[]; 871extern const struct ctl_path net_vs_ctl_path[];
803 872
@@ -955,8 +1024,65 @@ static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum)
955 return csum_partial(diff, sizeof(diff), oldsum); 1024 return csum_partial(diff, sizeof(diff), oldsum);
956} 1025}
957 1026
1027/*
1028 * Forget current conntrack (unconfirmed) and attach notrack entry
1029 */
1030static inline void ip_vs_notrack(struct sk_buff *skb)
1031{
1032#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
1033 enum ip_conntrack_info ctinfo;
1034 struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo);
1035
1036 if (!ct || !nf_ct_is_untracked(ct)) {
1037 nf_reset(skb);
1038 skb->nfct = &nf_ct_untracked_get()->ct_general;
1039 skb->nfctinfo = IP_CT_NEW;
1040 nf_conntrack_get(skb->nfct);
1041 }
1042#endif
1043}
1044
1045#ifdef CONFIG_IP_VS_NFCT
1046/*
1047 * Netfilter connection tracking
1048 * (from ip_vs_nfct.c)
1049 */
1050static inline int ip_vs_conntrack_enabled(void)
1051{
1052 return sysctl_ip_vs_conntrack;
1053}
1054
958extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, 1055extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp,
959 int outin); 1056 int outin);
1057extern int ip_vs_confirm_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp);
1058extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct,
1059 struct ip_vs_conn *cp, u_int8_t proto,
1060 const __be16 port, int from_rs);
1061extern void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp);
1062
1063#else
1064
1065static inline int ip_vs_conntrack_enabled(void)
1066{
1067 return 0;
1068}
1069
1070static inline void ip_vs_update_conntrack(struct sk_buff *skb,
1071 struct ip_vs_conn *cp, int outin)
1072{
1073}
1074
1075static inline int ip_vs_confirm_conntrack(struct sk_buff *skb,
1076 struct ip_vs_conn *cp)
1077{
1078 return NF_ACCEPT;
1079}
1080
1081static inline void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp)
1082{
1083}
1084/* CONFIG_IP_VS_NFCT */
1085#endif
960 1086
961#endif /* __KERNEL__ */ 1087#endif /* __KERNEL__ */
962 1088
diff --git a/include/net/ipip.h b/include/net/ipip.h
index 65caea8b414..a32654d5273 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -16,7 +16,7 @@ struct ip_tunnel_6rd_parm {
16}; 16};
17 17
18struct ip_tunnel { 18struct ip_tunnel {
19 struct ip_tunnel *next; 19 struct ip_tunnel __rcu *next;
20 struct net_device *dev; 20 struct net_device *dev;
21 21
22 int err_count; /* Number of arrived ICMP errors */ 22 int err_count; /* Number of arrived ICMP errors */
@@ -34,18 +34,18 @@ struct ip_tunnel {
34#ifdef CONFIG_IPV6_SIT_6RD 34#ifdef CONFIG_IPV6_SIT_6RD
35 struct ip_tunnel_6rd_parm ip6rd; 35 struct ip_tunnel_6rd_parm ip6rd;
36#endif 36#endif
37 struct ip_tunnel_prl_entry *prl; /* potential router list */ 37 struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */
38 unsigned int prl_count; /* # of entries in PRL */ 38 unsigned int prl_count; /* # of entries in PRL */
39}; 39};
40 40
41struct ip_tunnel_prl_entry { 41struct ip_tunnel_prl_entry {
42 struct ip_tunnel_prl_entry *next; 42 struct ip_tunnel_prl_entry __rcu *next;
43 __be32 addr; 43 __be32 addr;
44 u16 flags; 44 u16 flags;
45 struct rcu_head rcu_head; 45 struct rcu_head rcu_head;
46}; 46};
47 47
48#define IPTUNNEL_XMIT() do { \ 48#define __IPTUNNEL_XMIT(stats1, stats2) do { \
49 int err; \ 49 int err; \
50 int pkt_len = skb->len - skb_transport_offset(skb); \ 50 int pkt_len = skb->len - skb_transport_offset(skb); \
51 \ 51 \
@@ -54,12 +54,14 @@ struct ip_tunnel_prl_entry {
54 \ 54 \
55 err = ip_local_out(skb); \ 55 err = ip_local_out(skb); \
56 if (likely(net_xmit_eval(err) == 0)) { \ 56 if (likely(net_xmit_eval(err) == 0)) { \
57 txq->tx_bytes += pkt_len; \ 57 (stats1)->tx_bytes += pkt_len; \
58 txq->tx_packets++; \ 58 (stats1)->tx_packets++; \
59 } else { \ 59 } else { \
60 stats->tx_errors++; \ 60 (stats2)->tx_errors++; \
61 stats->tx_aborted_errors++; \ 61 (stats2)->tx_aborted_errors++; \
62 } \ 62 } \
63} while (0) 63} while (0)
64 64
65#define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats)
66
65#endif 67#endif
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 1f841241099..4a3cd2cd2f5 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -262,7 +262,7 @@ static inline int ipv6_addr_scope(const struct in6_addr *addr)
262 262
263static inline int __ipv6_addr_src_scope(int type) 263static inline int __ipv6_addr_src_scope(int type)
264{ 264{
265 return (type == IPV6_ADDR_ANY ? __IPV6_ADDR_SCOPE_INVALID : (type >> 16)); 265 return (type == IPV6_ADDR_ANY) ? __IPV6_ADDR_SCOPE_INVALID : (type >> 16);
266} 266}
267 267
268static inline int ipv6_addr_src_scope(const struct in6_addr *addr) 268static inline int ipv6_addr_src_scope(const struct in6_addr *addr)
@@ -279,10 +279,10 @@ static inline int
279ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, 279ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m,
280 const struct in6_addr *a2) 280 const struct in6_addr *a2)
281{ 281{
282 return (!!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) | 282 return !!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) |
283 ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) | 283 ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) |
284 ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) | 284 ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) |
285 ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3]))); 285 ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3]));
286} 286}
287 287
288static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) 288static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2)
@@ -317,10 +317,10 @@ static inline void ipv6_addr_set(struct in6_addr *addr,
317static inline int ipv6_addr_equal(const struct in6_addr *a1, 317static inline int ipv6_addr_equal(const struct in6_addr *a1,
318 const struct in6_addr *a2) 318 const struct in6_addr *a2)
319{ 319{
320 return (((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | 320 return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) |
321 (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | 321 (a1->s6_addr32[1] ^ a2->s6_addr32[1]) |
322 (a1->s6_addr32[2] ^ a2->s6_addr32[2]) | 322 (a1->s6_addr32[2] ^ a2->s6_addr32[2]) |
323 (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0); 323 (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0;
324} 324}
325 325
326static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, 326static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2,
@@ -373,20 +373,20 @@ int ip6_frag_match(struct inet_frag_queue *q, void *a);
373 373
374static inline int ipv6_addr_any(const struct in6_addr *a) 374static inline int ipv6_addr_any(const struct in6_addr *a)
375{ 375{
376 return ((a->s6_addr32[0] | a->s6_addr32[1] | 376 return (a->s6_addr32[0] | a->s6_addr32[1] |
377 a->s6_addr32[2] | a->s6_addr32[3] ) == 0); 377 a->s6_addr32[2] | a->s6_addr32[3]) == 0;
378} 378}
379 379
380static inline int ipv6_addr_loopback(const struct in6_addr *a) 380static inline int ipv6_addr_loopback(const struct in6_addr *a)
381{ 381{
382 return ((a->s6_addr32[0] | a->s6_addr32[1] | 382 return (a->s6_addr32[0] | a->s6_addr32[1] |
383 a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0); 383 a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0;
384} 384}
385 385
386static inline int ipv6_addr_v4mapped(const struct in6_addr *a) 386static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
387{ 387{
388 return ((a->s6_addr32[0] | a->s6_addr32[1] | 388 return (a->s6_addr32[0] | a->s6_addr32[1] |
389 (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0); 389 (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0;
390} 390}
391 391
392/* 392/*
@@ -395,8 +395,7 @@ static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
395 */ 395 */
396static inline int ipv6_addr_orchid(const struct in6_addr *a) 396static inline int ipv6_addr_orchid(const struct in6_addr *a)
397{ 397{
398 return ((a->s6_addr32[0] & htonl(0xfffffff0)) 398 return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010);
399 == htonl(0x20010010));
400} 399}
401 400
402static inline void ipv6_addr_set_v4mapped(const __be32 addr, 401static inline void ipv6_addr_set_v4mapped(const __be32 addr,
@@ -441,7 +440,7 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a
441 * if returned value is greater than prefix length. 440 * if returned value is greater than prefix length.
442 * --ANK (980803) 441 * --ANK (980803)
443 */ 442 */
444 return (addrlen << 5); 443 return addrlen << 5;
445} 444}
446 445
447static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2) 446static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2)
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 73cacb3ac16..0af8b8dfbc2 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -171,7 +171,6 @@ struct irlan_cb {
171 int magic; 171 int magic;
172 struct list_head dev_list; 172 struct list_head dev_list;
173 struct net_device *dev; /* Ethernet device structure*/ 173 struct net_device *dev; /* Ethernet device structure*/
174 struct net_device_stats stats;
175 174
176 __u32 saddr; /* Source device address */ 175 __u32 saddr; /* Source device address */
177 __u32 daddr; /* Destination device address */ 176 __u32 daddr; /* Destination device address */
diff --git a/include/net/irda/irlan_event.h b/include/net/irda/irlan_event.h
index 6d9539f0580..018b5a77e61 100644
--- a/include/net/irda/irlan_event.h
+++ b/include/net/irda/irlan_event.h
@@ -67,7 +67,7 @@ typedef enum {
67 IRLAN_WATCHDOG_TIMEOUT, 67 IRLAN_WATCHDOG_TIMEOUT,
68} IRLAN_EVENT; 68} IRLAN_EVENT;
69 69
70extern char *irlan_state[]; 70extern const char * const irlan_state[];
71 71
72void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event, 72void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event,
73 struct sk_buff *skb); 73 struct sk_buff *skb);
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h
index 9d0c78ea92f..17fcd964f9d 100644
--- a/include/net/irda/irlap.h
+++ b/include/net/irda/irlap.h
@@ -282,7 +282,7 @@ static inline int irlap_is_primary(struct irlap_cb *self)
282 default: 282 default:
283 ret = -1; 283 ret = -1;
284 } 284 }
285 return(ret); 285 return ret;
286} 286}
287 287
288/* Clear a pending IrLAP disconnect. - Jean II */ 288/* Clear a pending IrLAP disconnect. - Jean II */
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index 3ffc1d0f93d..fff11b7fe8a 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -274,7 +274,7 @@ static inline int irlmp_lap_tx_queue_full(struct lsap_cb *self)
274 if (self->lap->irlap == NULL) 274 if (self->lap->irlap == NULL)
275 return 0; 275 return 0;
276 276
277 return(IRLAP_GET_TX_QUEUE_LEN(self->lap->irlap) >= LAP_HIGH_THRESHOLD); 277 return IRLAP_GET_TX_QUEUE_LEN(self->lap->irlap) >= LAP_HIGH_THRESHOLD;
278} 278}
279 279
280/* After doing a irlmp_dup(), this get one of the two socket back into 280/* After doing a irlmp_dup(), this get one of the two socket back into
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h
index 11aee7a2972..af4b87721d1 100644
--- a/include/net/irda/irttp.h
+++ b/include/net/irda/irttp.h
@@ -204,7 +204,7 @@ static inline int irttp_is_primary(struct tsap_cb *self)
204 (self->lsap->lap == NULL) || 204 (self->lsap->lap == NULL) ||
205 (self->lsap->lap->irlap == NULL)) 205 (self->lsap->lap->irlap == NULL))
206 return -2; 206 return -2;
207 return(irlap_is_primary(self->lsap->lap->irlap)); 207 return irlap_is_primary(self->lsap->lap->irlap);
208} 208}
209 209
210#endif /* IRTTP_H */ 210#endif /* IRTTP_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index b0787a1dea9..9fdf982d128 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -149,6 +149,7 @@ struct ieee80211_low_level_stats {
149 * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. 149 * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed.
150 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note 150 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note
151 * that it is only ever disabled for station mode. 151 * that it is only ever disabled for station mode.
152 * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface.
152 */ 153 */
153enum ieee80211_bss_change { 154enum ieee80211_bss_change {
154 BSS_CHANGED_ASSOC = 1<<0, 155 BSS_CHANGED_ASSOC = 1<<0,
@@ -165,6 +166,7 @@ enum ieee80211_bss_change {
165 BSS_CHANGED_IBSS = 1<<11, 166 BSS_CHANGED_IBSS = 1<<11,
166 BSS_CHANGED_ARP_FILTER = 1<<12, 167 BSS_CHANGED_ARP_FILTER = 1<<12,
167 BSS_CHANGED_QOS = 1<<13, 168 BSS_CHANGED_QOS = 1<<13,
169 BSS_CHANGED_IDLE = 1<<14,
168 170
169 /* when adding here, make sure to change ieee80211_reconfig */ 171 /* when adding here, make sure to change ieee80211_reconfig */
170}; 172};
@@ -223,6 +225,9 @@ enum ieee80211_bss_change {
223 * hardware must not perform any ARP filtering. Note, that the filter will 225 * hardware must not perform any ARP filtering. Note, that the filter will
224 * be enabled also in promiscuous mode. 226 * be enabled also in promiscuous mode.
225 * @qos: This is a QoS-enabled BSS. 227 * @qos: This is a QoS-enabled BSS.
228 * @idle: This interface is idle. There's also a global idle flag in the
229 * hardware config which may be more appropriate depending on what
230 * your driver/device needs to do.
226 */ 231 */
227struct ieee80211_bss_conf { 232struct ieee80211_bss_conf {
228 const u8 *bssid; 233 const u8 *bssid;
@@ -247,6 +252,7 @@ struct ieee80211_bss_conf {
247 u8 arp_addr_cnt; 252 u8 arp_addr_cnt;
248 bool arp_filter_enabled; 253 bool arp_filter_enabled;
249 bool qos; 254 bool qos;
255 bool idle;
250}; 256};
251 257
252/** 258/**
@@ -315,6 +321,9 @@ struct ieee80211_bss_conf {
315 * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame 321 * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame
316 * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this 322 * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this
317 * frame and selects the maximum number of streams that it can use. 323 * frame and selects the maximum number of streams that it can use.
324 *
325 * Note: If you have to add new flags to the enumeration, then don't
326 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
318 */ 327 */
319enum mac80211_tx_control_flags { 328enum mac80211_tx_control_flags {
320 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 329 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
@@ -344,6 +353,19 @@ enum mac80211_tx_control_flags {
344 353
345#define IEEE80211_TX_CTL_STBC_SHIFT 23 354#define IEEE80211_TX_CTL_STBC_SHIFT 23
346 355
356/*
357 * This definition is used as a mask to clear all temporary flags, which are
358 * set by the tx handlers for each transmission attempt by the mac80211 stack.
359 */
360#define IEEE80211_TX_TEMPORARY_FLAGS (IEEE80211_TX_CTL_NO_ACK | \
361 IEEE80211_TX_CTL_CLEAR_PS_FILT | IEEE80211_TX_CTL_FIRST_FRAGMENT | \
362 IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \
363 IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \
364 IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \
365 IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_PSPOLL_RESPONSE | \
366 IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \
367 IEEE80211_TX_CTL_STBC)
368
347/** 369/**
348 * enum mac80211_rate_control_flags - per-rate flags set by the 370 * enum mac80211_rate_control_flags - per-rate flags set by the
349 * Rate Control algorithm. 371 * Rate Control algorithm.
@@ -559,9 +581,6 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
559 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index 581 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index
560 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used 582 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used
561 * @RX_FLAG_SHORT_GI: Short guard interval was used 583 * @RX_FLAG_SHORT_GI: Short guard interval was used
562 * @RX_FLAG_INTERNAL_CMTR: set internally after frame was reported
563 * on cooked monitor to avoid double-reporting it for multiple
564 * virtual interfaces
565 */ 584 */
566enum mac80211_rx_flags { 585enum mac80211_rx_flags {
567 RX_FLAG_MMIC_ERROR = 1<<0, 586 RX_FLAG_MMIC_ERROR = 1<<0,
@@ -575,7 +594,6 @@ enum mac80211_rx_flags {
575 RX_FLAG_HT = 1<<9, 594 RX_FLAG_HT = 1<<9,
576 RX_FLAG_40MHZ = 1<<10, 595 RX_FLAG_40MHZ = 1<<10,
577 RX_FLAG_SHORT_GI = 1<<11, 596 RX_FLAG_SHORT_GI = 1<<11,
578 RX_FLAG_INTERNAL_CMTR = 1<<12,
579}; 597};
580 598
581/** 599/**
@@ -596,6 +614,7 @@ enum mac80211_rx_flags {
596 * @rate_idx: index of data rate into band's supported rates or MCS index if 614 * @rate_idx: index of data rate into band's supported rates or MCS index if
597 * HT rates are use (RX_FLAG_HT) 615 * HT rates are use (RX_FLAG_HT)
598 * @flag: %RX_FLAG_* 616 * @flag: %RX_FLAG_*
617 * @rx_flags: internal RX flags for mac80211
599 */ 618 */
600struct ieee80211_rx_status { 619struct ieee80211_rx_status {
601 u64 mactime; 620 u64 mactime;
@@ -605,6 +624,7 @@ struct ieee80211_rx_status {
605 int antenna; 624 int antenna;
606 int rate_idx; 625 int rate_idx;
607 int flag; 626 int flag;
627 unsigned int rx_flags;
608}; 628};
609 629
610/** 630/**
@@ -763,6 +783,8 @@ struct ieee80211_channel_switch {
763 * @bss_conf: BSS configuration for this interface, either our own 783 * @bss_conf: BSS configuration for this interface, either our own
764 * or the BSS we're associated to 784 * or the BSS we're associated to
765 * @addr: address of this interface 785 * @addr: address of this interface
786 * @p2p: indicates whether this AP or STA interface is a p2p
787 * interface, i.e. a GO or p2p-sta respectively
766 * @drv_priv: data area for driver use, will always be aligned to 788 * @drv_priv: data area for driver use, will always be aligned to
767 * sizeof(void *). 789 * sizeof(void *).
768 */ 790 */
@@ -770,6 +792,7 @@ struct ieee80211_vif {
770 enum nl80211_iftype type; 792 enum nl80211_iftype type;
771 struct ieee80211_bss_conf bss_conf; 793 struct ieee80211_bss_conf bss_conf;
772 u8 addr[ETH_ALEN]; 794 u8 addr[ETH_ALEN];
795 bool p2p;
773 /* must be last */ 796 /* must be last */
774 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 797 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
775}; 798};
@@ -783,20 +806,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
783} 806}
784 807
785/** 808/**
786 * enum ieee80211_key_alg - key algorithm
787 * @ALG_WEP: WEP40 or WEP104
788 * @ALG_TKIP: TKIP
789 * @ALG_CCMP: CCMP (AES)
790 * @ALG_AES_CMAC: AES-128-CMAC
791 */
792enum ieee80211_key_alg {
793 ALG_WEP,
794 ALG_TKIP,
795 ALG_CCMP,
796 ALG_AES_CMAC,
797};
798
799/**
800 * enum ieee80211_key_flags - key flags 809 * enum ieee80211_key_flags - key flags
801 * 810 *
802 * These flags are used for communication about keys between the driver 811 * These flags are used for communication about keys between the driver
@@ -833,7 +842,7 @@ enum ieee80211_key_flags {
833 * @hw_key_idx: To be set by the driver, this is the key index the driver 842 * @hw_key_idx: To be set by the driver, this is the key index the driver
834 * wants to be given when a frame is transmitted and needs to be 843 * wants to be given when a frame is transmitted and needs to be
835 * encrypted in hardware. 844 * encrypted in hardware.
836 * @alg: The key algorithm. 845 * @cipher: The key's cipher suite selector.
837 * @flags: key flags, see &enum ieee80211_key_flags. 846 * @flags: key flags, see &enum ieee80211_key_flags.
838 * @keyidx: the key index (0-3) 847 * @keyidx: the key index (0-3)
839 * @keylen: key material length 848 * @keylen: key material length
@@ -846,7 +855,7 @@ enum ieee80211_key_flags {
846 * @iv_len: The IV length for this key type 855 * @iv_len: The IV length for this key type
847 */ 856 */
848struct ieee80211_key_conf { 857struct ieee80211_key_conf {
849 enum ieee80211_key_alg alg; 858 u32 cipher;
850 u8 icv_len; 859 u8 icv_len;
851 u8 iv_len; 860 u8 iv_len;
852 u8 hw_key_idx; 861 u8 hw_key_idx;
@@ -1032,6 +1041,13 @@ enum ieee80211_tkip_key_type {
1032 * @IEEE80211_HW_NEED_DTIM_PERIOD: 1041 * @IEEE80211_HW_NEED_DTIM_PERIOD:
1033 * This device needs to know the DTIM period for the BSS before 1042 * This device needs to know the DTIM period for the BSS before
1034 * associating. 1043 * associating.
1044 *
1045 * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports
1046 * per-station GTKs as used by IBSS RSN or during fast transition. If
1047 * the device doesn't support per-station GTKs, but can be asked not
1048 * to decrypt group addressed frames, then IBSS RSN support is still
1049 * possible but software crypto will be used. Advertise the wiphy flag
1050 * only in that case.
1035 */ 1051 */
1036enum ieee80211_hw_flags { 1052enum ieee80211_hw_flags {
1037 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1053 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1055,6 +1071,7 @@ enum ieee80211_hw_flags {
1055 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, 1071 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18,
1056 IEEE80211_HW_CONNECTION_MONITOR = 1<<19, 1072 IEEE80211_HW_CONNECTION_MONITOR = 1<<19,
1057 IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, 1073 IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20,
1074 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1058}; 1075};
1059 1076
1060/** 1077/**
@@ -1100,8 +1117,15 @@ enum ieee80211_hw_flags {
1100 * @sta_data_size: size (in bytes) of the drv_priv data area 1117 * @sta_data_size: size (in bytes) of the drv_priv data area
1101 * within &struct ieee80211_sta. 1118 * within &struct ieee80211_sta.
1102 * 1119 *
1103 * @max_rates: maximum number of alternate rate retry stages 1120 * @max_rates: maximum number of alternate rate retry stages the hw
1121 * can handle.
1122 * @max_report_rates: maximum number of alternate rate retry stages
1123 * the hw can report back.
1104 * @max_rate_tries: maximum number of tries for each stage 1124 * @max_rate_tries: maximum number of tries for each stage
1125 *
1126 * @napi_weight: weight used for NAPI polling. You must specify an
1127 * appropriate value here if a napi_poll operation is provided
1128 * by your driver.
1105 */ 1129 */
1106struct ieee80211_hw { 1130struct ieee80211_hw {
1107 struct ieee80211_conf conf; 1131 struct ieee80211_conf conf;
@@ -1113,10 +1137,12 @@ struct ieee80211_hw {
1113 int channel_change_time; 1137 int channel_change_time;
1114 int vif_data_size; 1138 int vif_data_size;
1115 int sta_data_size; 1139 int sta_data_size;
1140 int napi_weight;
1116 u16 queues; 1141 u16 queues;
1117 u16 max_listen_interval; 1142 u16 max_listen_interval;
1118 s8 max_signal; 1143 s8 max_signal;
1119 u8 max_rates; 1144 u8 max_rates;
1145 u8 max_report_rates;
1120 u8 max_rate_tries; 1146 u8 max_rate_tries;
1121}; 1147};
1122 1148
@@ -1245,8 +1271,8 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1245 * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in 1271 * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in
1246 * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused 1272 * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused
1247 * with hardware wakeup and sleep states. Driver is responsible for waking 1273 * with hardware wakeup and sleep states. Driver is responsible for waking
1248 * up the hardware before issueing commands to the hardware and putting it 1274 * up the hardware before issuing commands to the hardware and putting it
1249 * back to sleep at approriate times. 1275 * back to sleep at appropriate times.
1250 * 1276 *
1251 * When PS is enabled, hardware needs to wakeup for beacons and receive the 1277 * When PS is enabled, hardware needs to wakeup for beacons and receive the
1252 * buffered multicast/broadcast frames after the beacon. Also it must be 1278 * buffered multicast/broadcast frames after the beacon. Also it must be
@@ -1267,7 +1293,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1267 * there's data traffic and still saving significantly power in idle 1293 * there's data traffic and still saving significantly power in idle
1268 * periods. 1294 * periods.
1269 * 1295 *
1270 * Dynamic powersave is supported by simply mac80211 enabling and disabling 1296 * Dynamic powersave is simply supported by mac80211 enabling and disabling
1271 * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS 1297 * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS
1272 * flag and mac80211 will handle everything automatically. Additionally, 1298 * flag and mac80211 will handle everything automatically. Additionally,
1273 * hardware having support for the dynamic PS feature may set the 1299 * hardware having support for the dynamic PS feature may set the
@@ -1452,12 +1478,14 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1452 * honour this flag if possible. 1478 * honour this flag if possible.
1453 * 1479 *
1454 * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS 1480 * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS
1455 * is not set then only those addressed to this station. 1481 * is not set then only those addressed to this station.
1456 * 1482 *
1457 * @FIF_OTHER_BSS: pass frames destined to other BSSes 1483 * @FIF_OTHER_BSS: pass frames destined to other BSSes
1458 * 1484 *
1459 * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only 1485 * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only
1460 * those addressed to this station. 1486 * those addressed to this station.
1487 *
1488 * @FIF_PROBE_REQ: pass probe request frames
1461 */ 1489 */
1462enum ieee80211_filter_flags { 1490enum ieee80211_filter_flags {
1463 FIF_PROMISC_IN_BSS = 1<<0, 1491 FIF_PROMISC_IN_BSS = 1<<0,
@@ -1468,6 +1496,7 @@ enum ieee80211_filter_flags {
1468 FIF_CONTROL = 1<<5, 1496 FIF_CONTROL = 1<<5,
1469 FIF_OTHER_BSS = 1<<6, 1497 FIF_OTHER_BSS = 1<<6,
1470 FIF_PSPOLL = 1<<7, 1498 FIF_PSPOLL = 1<<7,
1499 FIF_PROBE_REQ = 1<<8,
1471}; 1500};
1472 1501
1473/** 1502/**
@@ -1540,6 +1569,12 @@ enum ieee80211_ampdu_mlme_action {
1540 * negative error code (which will be seen in userspace.) 1569 * negative error code (which will be seen in userspace.)
1541 * Must be implemented and can sleep. 1570 * Must be implemented and can sleep.
1542 * 1571 *
1572 * @change_interface: Called when a netdevice changes type. This callback
1573 * is optional, but only if it is supported can interface types be
1574 * switched while the interface is UP. The callback may sleep.
1575 * Note that while an interface is being switched, it will not be
1576 * found by the interface iteration callbacks.
1577 *
1543 * @remove_interface: Notifies a driver that an interface is going down. 1578 * @remove_interface: Notifies a driver that an interface is going down.
1544 * The @stop callback is called after this if it is the last interface 1579 * The @stop callback is called after this if it is the last interface
1545 * and no monitor interfaces are present. 1580 * and no monitor interfaces are present.
@@ -1687,6 +1722,8 @@ enum ieee80211_ampdu_mlme_action {
1687 * switch operation for CSAs received from the AP may implement this 1722 * switch operation for CSAs received from the AP may implement this
1688 * callback. They must then call ieee80211_chswitch_done() to indicate 1723 * callback. They must then call ieee80211_chswitch_done() to indicate
1689 * completion of the channel switch. 1724 * completion of the channel switch.
1725 *
1726 * @napi_poll: Poll Rx queue for incoming data frames.
1690 */ 1727 */
1691struct ieee80211_ops { 1728struct ieee80211_ops {
1692 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1729 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1694,6 +1731,9 @@ struct ieee80211_ops {
1694 void (*stop)(struct ieee80211_hw *hw); 1731 void (*stop)(struct ieee80211_hw *hw);
1695 int (*add_interface)(struct ieee80211_hw *hw, 1732 int (*add_interface)(struct ieee80211_hw *hw,
1696 struct ieee80211_vif *vif); 1733 struct ieee80211_vif *vif);
1734 int (*change_interface)(struct ieee80211_hw *hw,
1735 struct ieee80211_vif *vif,
1736 enum nl80211_iftype new_type, bool p2p);
1697 void (*remove_interface)(struct ieee80211_hw *hw, 1737 void (*remove_interface)(struct ieee80211_hw *hw,
1698 struct ieee80211_vif *vif); 1738 struct ieee80211_vif *vif);
1699 int (*config)(struct ieee80211_hw *hw, u32 changed); 1739 int (*config)(struct ieee80211_hw *hw, u32 changed);
@@ -1752,6 +1792,7 @@ struct ieee80211_ops {
1752 void (*flush)(struct ieee80211_hw *hw, bool drop); 1792 void (*flush)(struct ieee80211_hw *hw, bool drop);
1753 void (*channel_switch)(struct ieee80211_hw *hw, 1793 void (*channel_switch)(struct ieee80211_hw *hw,
1754 struct ieee80211_channel_switch *ch_switch); 1794 struct ieee80211_channel_switch *ch_switch);
1795 int (*napi_poll)(struct ieee80211_hw *hw, int budget);
1755}; 1796};
1756 1797
1757/** 1798/**
@@ -1897,6 +1938,22 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
1897 */ 1938 */
1898void ieee80211_restart_hw(struct ieee80211_hw *hw); 1939void ieee80211_restart_hw(struct ieee80211_hw *hw);
1899 1940
1941/** ieee80211_napi_schedule - schedule NAPI poll
1942 *
1943 * Use this function to schedule NAPI polling on a device.
1944 *
1945 * @hw: the hardware to start polling
1946 */
1947void ieee80211_napi_schedule(struct ieee80211_hw *hw);
1948
1949/** ieee80211_napi_complete - complete NAPI polling
1950 *
1951 * Use this function to finish NAPI polling on a device.
1952 *
1953 * @hw: the hardware to stop polling
1954 */
1955void ieee80211_napi_complete(struct ieee80211_hw *hw);
1956
1900/** 1957/**
1901 * ieee80211_rx - receive frame 1958 * ieee80211_rx - receive frame
1902 * 1959 *
@@ -2252,7 +2309,8 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
2252 * 2309 *
2253 * When hardware scan offload is used (i.e. the hw_scan() callback is 2310 * When hardware scan offload is used (i.e. the hw_scan() callback is
2254 * assigned) this function needs to be called by the driver to notify 2311 * assigned) this function needs to be called by the driver to notify
2255 * mac80211 that the scan finished. 2312 * mac80211 that the scan finished. This function can be called from
2313 * any context, including hardirq context.
2256 * 2314 *
2257 * @hw: the hardware that finished the scan 2315 * @hw: the hardware that finished the scan
2258 * @aborted: set to true if scan was aborted 2316 * @aborted: set to true if scan was aborted
@@ -2267,6 +2325,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted);
2267 * This function allows the iterator function to sleep, when the iterator 2325 * This function allows the iterator function to sleep, when the iterator
2268 * function is atomic @ieee80211_iterate_active_interfaces_atomic can 2326 * function is atomic @ieee80211_iterate_active_interfaces_atomic can
2269 * be used. 2327 * be used.
2328 * Does not iterate over a new interface during add_interface()
2270 * 2329 *
2271 * @hw: the hardware struct of which the interfaces should be iterated over 2330 * @hw: the hardware struct of which the interfaces should be iterated over
2272 * @iterator: the iterator function to call 2331 * @iterator: the iterator function to call
@@ -2284,6 +2343,7 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
2284 * hardware that are currently active and calls the callback for them. 2343 * hardware that are currently active and calls the callback for them.
2285 * This function requires the iterator callback function to be atomic, 2344 * This function requires the iterator callback function to be atomic,
2286 * if that is not desired, use @ieee80211_iterate_active_interfaces instead. 2345 * if that is not desired, use @ieee80211_iterate_active_interfaces instead.
2346 * Does not iterate over a new interface during add_interface()
2287 * 2347 *
2288 * @hw: the hardware struct of which the interfaces should be iterated over 2348 * @hw: the hardware struct of which the interfaces should be iterated over
2289 * @iterator: the iterator function to call, cannot sleep 2349 * @iterator: the iterator function to call, cannot sleep
@@ -2385,25 +2445,28 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
2385 const u8 *addr); 2445 const u8 *addr);
2386 2446
2387/** 2447/**
2388 * ieee80211_find_sta_by_hw - find a station on hardware 2448 * ieee80211_find_sta_by_ifaddr - find a station on hardware
2389 * 2449 *
2390 * @hw: pointer as obtained from ieee80211_alloc_hw() 2450 * @hw: pointer as obtained from ieee80211_alloc_hw()
2391 * @addr: station's address 2451 * @addr: remote station's address
2452 * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'.
2392 * 2453 *
2393 * This function must be called under RCU lock and the 2454 * This function must be called under RCU lock and the
2394 * resulting pointer is only valid under RCU lock as well. 2455 * resulting pointer is only valid under RCU lock as well.
2395 * 2456 *
2396 * NOTE: This function should not be used! When mac80211 is converted 2457 * NOTE: You may pass NULL for localaddr, but then you will just get
2397 * internally to properly keep track of stations on multiple 2458 * the first STA that matches the remote address 'addr'.
2398 * virtual interfaces, it will not always know which station to 2459 * We can have multiple STA associated with multiple
2399 * return here since a single address might be used by multiple 2460 * logical stations (e.g. consider a station connecting to another
2400 * logical stations (e.g. consider a station connecting to another 2461 * BSSID on the same AP hardware without disconnecting first).
2401 * BSSID on the same AP hardware without disconnecting first). 2462 * In this case, the result of this method with localaddr NULL
2463 * is not reliable.
2402 * 2464 *
2403 * DO NOT USE THIS FUNCTION. 2465 * DO NOT USE THIS FUNCTION with localaddr NULL if at all possible.
2404 */ 2466 */
2405struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, 2467struct ieee80211_sta *ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw,
2406 const u8 *addr); 2468 const u8 *addr,
2469 const u8 *localaddr);
2407 2470
2408/** 2471/**
2409 * ieee80211_sta_block_awake - block station from waking up 2472 * ieee80211_sta_block_awake - block station from waking up
@@ -2442,7 +2505,7 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
2442 * 2505 *
2443 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 2506 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2444 * 2507 *
2445 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING and 2508 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER and
2446 * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the 2509 * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the
2447 * hardware is not receiving beacons with this function. 2510 * hardware is not receiving beacons with this function.
2448 */ 2511 */
@@ -2453,7 +2516,7 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
2453 * 2516 *
2454 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 2517 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2455 * 2518 *
2456 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING, and 2519 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER, and
2457 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver 2520 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver
2458 * needs to inform if the connection to the AP has been lost. 2521 * needs to inform if the connection to the AP has been lost.
2459 * 2522 *
@@ -2518,6 +2581,34 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
2518 */ 2581 */
2519void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); 2582void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success);
2520 2583
2584/**
2585 * ieee80211_request_smps - request SM PS transition
2586 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2587 * @smps_mode: new SM PS mode
2588 *
2589 * This allows the driver to request an SM PS transition in managed
2590 * mode. This is useful when the driver has more information than
2591 * the stack about possible interference, for example by bluetooth.
2592 */
2593void ieee80211_request_smps(struct ieee80211_vif *vif,
2594 enum ieee80211_smps_mode smps_mode);
2595
2596/**
2597 * ieee80211_key_removed - disable hw acceleration for key
2598 * @key_conf: The key hw acceleration should be disabled for
2599 *
2600 * This allows drivers to indicate that the given key has been
2601 * removed from hardware acceleration, due to a new key that
2602 * was added. Don't use this if the key can continue to be used
2603 * for TX, if the key restriction is on RX only it is permitted
2604 * to keep the key for TX only and not call this function.
2605 *
2606 * Due to locking constraints, it may only be called during
2607 * @set_key. This function must be allowed to sleep, and the
2608 * key it tries to disable may still be used until it returns.
2609 */
2610void ieee80211_key_removed(struct ieee80211_key_conf *key_conf);
2611
2521/* Rate control API */ 2612/* Rate control API */
2522 2613
2523/** 2614/**
@@ -2681,4 +2772,26 @@ conf_is_ht(struct ieee80211_conf *conf)
2681 return conf->channel_type != NL80211_CHAN_NO_HT; 2772 return conf->channel_type != NL80211_CHAN_NO_HT;
2682} 2773}
2683 2774
2775static inline enum nl80211_iftype
2776ieee80211_iftype_p2p(enum nl80211_iftype type, bool p2p)
2777{
2778 if (p2p) {
2779 switch (type) {
2780 case NL80211_IFTYPE_STATION:
2781 return NL80211_IFTYPE_P2P_CLIENT;
2782 case NL80211_IFTYPE_AP:
2783 return NL80211_IFTYPE_P2P_GO;
2784 default:
2785 break;
2786 }
2787 }
2788 return type;
2789}
2790
2791static inline enum nl80211_iftype
2792ieee80211_vif_type_p2p(struct ieee80211_vif *vif)
2793{
2794 return ieee80211_iftype_p2p(vif->type, vif->p2p);
2795}
2796
2684#endif /* MAC80211_H */ 2797#endif /* MAC80211_H */
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 242879b6c4d..55590ab16b3 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -91,26 +91,28 @@ struct neigh_statistics {
91#define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field) 91#define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field)
92 92
93struct neighbour { 93struct neighbour {
94 struct neighbour *next; 94 struct neighbour __rcu *next;
95 struct neigh_table *tbl; 95 struct neigh_table *tbl;
96 struct neigh_parms *parms; 96 struct neigh_parms *parms;
97 struct net_device *dev;
98 unsigned long used;
99 unsigned long confirmed; 97 unsigned long confirmed;
100 unsigned long updated; 98 unsigned long updated;
101 __u8 flags; 99 __u8 flags;
102 __u8 nud_state; 100 __u8 nud_state;
103 __u8 type; 101 __u8 type;
104 __u8 dead; 102 __u8 dead;
103 atomic_t refcnt;
104 struct sk_buff_head arp_queue;
105 struct timer_list timer;
106 unsigned long used;
105 atomic_t probes; 107 atomic_t probes;
106 rwlock_t lock; 108 rwlock_t lock;
109 seqlock_t ha_lock;
107 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; 110 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))];
108 struct hh_cache *hh; 111 struct hh_cache *hh;
109 atomic_t refcnt;
110 int (*output)(struct sk_buff *skb); 112 int (*output)(struct sk_buff *skb);
111 struct sk_buff_head arp_queue;
112 struct timer_list timer;
113 const struct neigh_ops *ops; 113 const struct neigh_ops *ops;
114 struct rcu_head rcu;
115 struct net_device *dev;
114 u8 primary_key[0]; 116 u8 primary_key[0];
115}; 117};
116 118
@@ -138,13 +140,22 @@ struct pneigh_entry {
138 * neighbour table manipulation 140 * neighbour table manipulation
139 */ 141 */
140 142
143struct neigh_hash_table {
144 struct neighbour __rcu **hash_buckets;
145 unsigned int hash_mask;
146 __u32 hash_rnd;
147 struct rcu_head rcu;
148};
149
141 150
142struct neigh_table { 151struct neigh_table {
143 struct neigh_table *next; 152 struct neigh_table *next;
144 int family; 153 int family;
145 int entry_size; 154 int entry_size;
146 int key_len; 155 int key_len;
147 __u32 (*hash)(const void *pkey, const struct net_device *); 156 __u32 (*hash)(const void *pkey,
157 const struct net_device *dev,
158 __u32 hash_rnd);
148 int (*constructor)(struct neighbour *); 159 int (*constructor)(struct neighbour *);
149 int (*pconstructor)(struct pneigh_entry *); 160 int (*pconstructor)(struct pneigh_entry *);
150 void (*pdestructor)(struct pneigh_entry *); 161 void (*pdestructor)(struct pneigh_entry *);
@@ -163,11 +174,9 @@ struct neigh_table {
163 atomic_t entries; 174 atomic_t entries;
164 rwlock_t lock; 175 rwlock_t lock;
165 unsigned long last_rand; 176 unsigned long last_rand;
166 struct kmem_cache *kmem_cachep; 177 struct kmem_cache *kmem_cachep;
167 struct neigh_statistics __percpu *stats; 178 struct neigh_statistics __percpu *stats;
168 struct neighbour **hash_buckets; 179 struct neigh_hash_table __rcu *nht;
169 unsigned int hash_mask;
170 __u32 hash_rnd;
171 struct pneigh_entry **phash_buckets; 180 struct pneigh_entry **phash_buckets;
172}; 181};
173 182
@@ -237,6 +246,7 @@ extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_en
237struct neigh_seq_state { 246struct neigh_seq_state {
238 struct seq_net_private p; 247 struct seq_net_private p;
239 struct neigh_table *tbl; 248 struct neigh_table *tbl;
249 struct neigh_hash_table *nht;
240 void *(*neigh_sub_iter)(struct neigh_seq_state *state, 250 void *(*neigh_sub_iter)(struct neigh_seq_state *state,
241 struct neighbour *n, loff_t *pos); 251 struct neighbour *n, loff_t *pos);
242 unsigned int bucket; 252 unsigned int bucket;
@@ -293,7 +303,10 @@ static inline void neigh_confirm(struct neighbour *neigh)
293 303
294static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) 304static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
295{ 305{
296 neigh->used = jiffies; 306 unsigned long now = ACCESS_ONCE(jiffies);
307
308 if (neigh->used != now)
309 neigh->used = now;
297 if (!(neigh->nud_state&(NUD_CONNECTED|NUD_DELAY|NUD_PROBE))) 310 if (!(neigh->nud_state&(NUD_CONNECTED|NUD_DELAY|NUD_PROBE)))
298 return __neigh_event_send(neigh, skb); 311 return __neigh_event_send(neigh, skb);
299 return 0; 312 return 0;
@@ -364,4 +377,14 @@ struct neighbour_cb {
364 377
365#define NEIGH_CB(skb) ((struct neighbour_cb *)(skb)->cb) 378#define NEIGH_CB(skb) ((struct neighbour_cb *)(skb)->cb)
366 379
380static inline void neigh_ha_snapshot(char *dst, const struct neighbour *n,
381 const struct net_device *dev)
382{
383 unsigned int seq;
384
385 do {
386 seq = read_seqbegin(&n->ha_lock);
387 memcpy(dst, n->ha, dev->addr_len);
388 } while (read_seqretry(&n->ha_lock, seq));
389}
367#endif 390#endif
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index bd10a790899..1bf812b21fb 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -41,6 +41,8 @@ struct net {
41 * destroy on demand 41 * destroy on demand
42 */ 42 */
43#endif 43#endif
44 spinlock_t rules_mod_lock;
45
44 struct list_head list; /* list of network namespaces */ 46 struct list_head list; /* list of network namespaces */
45 struct list_head cleanup_list; /* namespaces on death row */ 47 struct list_head cleanup_list; /* namespaces on death row */
46 struct list_head exit_list; /* Use only net_mutex */ 48 struct list_head exit_list; /* Use only net_mutex */
@@ -52,7 +54,8 @@ struct net {
52 struct ctl_table_set sysctls; 54 struct ctl_table_set sysctls;
53#endif 55#endif
54 56
55 struct net_device *loopback_dev; /* The loopback */ 57 struct sock *rtnl; /* rtnetlink socket */
58 struct sock *genl_sock;
56 59
57 struct list_head dev_base_head; 60 struct list_head dev_base_head;
58 struct hlist_head *dev_name_head; 61 struct hlist_head *dev_name_head;
@@ -60,11 +63,9 @@ struct net {
60 63
61 /* core fib_rules */ 64 /* core fib_rules */
62 struct list_head rules_ops; 65 struct list_head rules_ops;
63 spinlock_t rules_mod_lock;
64 66
65 struct sock *rtnl; /* rtnetlink socket */
66 struct sock *genl_sock;
67 67
68 struct net_device *loopback_dev; /* The loopback */
68 struct netns_core core; 69 struct netns_core core;
69 struct netns_mib mib; 70 struct netns_mib mib;
70 struct netns_packet packet; 71 struct netns_packet packet;
@@ -84,13 +85,15 @@ struct net {
84 struct sock *nfnl; 85 struct sock *nfnl;
85 struct sock *nfnl_stash; 86 struct sock *nfnl_stash;
86#endif 87#endif
87#ifdef CONFIG_XFRM
88 struct netns_xfrm xfrm;
89#endif
90#ifdef CONFIG_WEXT_CORE 88#ifdef CONFIG_WEXT_CORE
91 struct sk_buff_head wext_nlevents; 89 struct sk_buff_head wext_nlevents;
92#endif 90#endif
93 struct net_generic *gen; 91 struct net_generic __rcu *gen;
92
93 /* Note : following structs are cache line aligned */
94#ifdef CONFIG_XFRM
95 struct netns_xfrm xfrm;
96#endif
94}; 97};
95 98
96 99
diff --git a/include/net/netfilter/ipv6/nf_defrag_ipv6.h b/include/net/netfilter/ipv6/nf_defrag_ipv6.h
new file mode 100644
index 00000000000..94dd54d76b4
--- /dev/null
+++ b/include/net/netfilter/ipv6/nf_defrag_ipv6.h
@@ -0,0 +1,6 @@
1#ifndef _NF_DEFRAG_IPV6_H
2#define _NF_DEFRAG_IPV6_H
3
4extern void nf_defrag_ipv6_enable(void);
5
6#endif /* _NF_DEFRAG_IPV6_H */
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h
index 11e815084fc..0f8a8c58753 100644
--- a/include/net/netfilter/nf_conntrack_expect.h
+++ b/include/net/netfilter/nf_conntrack_expect.h
@@ -67,9 +67,6 @@ struct nf_conntrack_expect_policy {
67 67
68#define NF_CT_EXPECT_CLASS_DEFAULT 0 68#define NF_CT_EXPECT_CLASS_DEFAULT 0
69 69
70#define NF_CT_EXPECT_PERMANENT 0x1
71#define NF_CT_EXPECT_INACTIVE 0x2
72
73int nf_conntrack_expect_init(struct net *net); 70int nf_conntrack_expect_init(struct net *net);
74void nf_conntrack_expect_fini(struct net *net); 71void nf_conntrack_expect_fini(struct net *net);
75 72
@@ -85,9 +82,16 @@ struct nf_conntrack_expect *
85nf_ct_find_expectation(struct net *net, u16 zone, 82nf_ct_find_expectation(struct net *net, u16 zone,
86 const struct nf_conntrack_tuple *tuple); 83 const struct nf_conntrack_tuple *tuple);
87 84
88void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); 85void nf_ct_unlink_expect_report(struct nf_conntrack_expect *exp,
86 u32 pid, int report);
87static inline void nf_ct_unlink_expect(struct nf_conntrack_expect *exp)
88{
89 nf_ct_unlink_expect_report(exp, 0, 0);
90}
91
89void nf_ct_remove_expectations(struct nf_conn *ct); 92void nf_ct_remove_expectations(struct nf_conn *ct);
90void nf_ct_unexpect_related(struct nf_conntrack_expect *exp); 93void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);
94void nf_ct_remove_userspace_expectations(void);
91 95
92/* Allocate space for an expectation: this is mandatory before calling 96/* Allocate space for an expectation: this is mandatory before calling
93 nf_ct_expect_related. You will have to call put afterwards. */ 97 nf_ct_expect_related. You will have to call put afterwards. */
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h
index df17bac46bf..93cc90d28e6 100644
--- a/include/net/netfilter/nf_nat_protocol.h
+++ b/include/net/netfilter/nf_nat_protocol.h
@@ -45,9 +45,6 @@ struct nf_nat_protocol {
45extern int nf_nat_protocol_register(const struct nf_nat_protocol *proto); 45extern int nf_nat_protocol_register(const struct nf_nat_protocol *proto);
46extern void nf_nat_protocol_unregister(const struct nf_nat_protocol *proto); 46extern void nf_nat_protocol_unregister(const struct nf_nat_protocol *proto);
47 47
48extern const struct nf_nat_protocol *nf_nat_proto_find_get(u_int8_t protocol);
49extern void nf_nat_proto_put(const struct nf_nat_protocol *proto);
50
51/* Built-in protocols. */ 48/* Built-in protocols. */
52extern const struct nf_nat_protocol nf_nat_protocol_tcp; 49extern const struct nf_nat_protocol nf_nat_protocol_tcp;
53extern const struct nf_nat_protocol nf_nat_protocol_udp; 50extern const struct nf_nat_protocol nf_nat_protocol_udp;
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h
index 208b46f4d6d..cd85b3bc832 100644
--- a/include/net/netfilter/nf_tproxy_core.h
+++ b/include/net/netfilter/nf_tproxy_core.h
@@ -5,15 +5,201 @@
5#include <linux/in.h> 5#include <linux/in.h>
6#include <linux/skbuff.h> 6#include <linux/skbuff.h>
7#include <net/sock.h> 7#include <net/sock.h>
8#include <net/inet_sock.h> 8#include <net/inet_hashtables.h>
9#include <net/inet6_hashtables.h>
9#include <net/tcp.h> 10#include <net/tcp.h>
10 11
12#define NFT_LOOKUP_ANY 0
13#define NFT_LOOKUP_LISTENER 1
14#define NFT_LOOKUP_ESTABLISHED 2
15
11/* look up and get a reference to a matching socket */ 16/* look up and get a reference to a matching socket */
12extern struct sock * 17
18
19/* This function is used by the 'TPROXY' target and the 'socket'
20 * match. The following lookups are supported:
21 *
22 * Explicit TProxy target rule
23 * ===========================
24 *
25 * This is used when the user wants to intercept a connection matching
26 * an explicit iptables rule. In this case the sockets are assumed
27 * matching in preference order:
28 *
29 * - match: if there's a fully established connection matching the
30 * _packet_ tuple, it is returned, assuming the redirection
31 * already took place and we process a packet belonging to an
32 * established connection
33 *
34 * - match: if there's a listening socket matching the redirection
35 * (e.g. on-port & on-ip of the connection), it is returned,
36 * regardless if it was bound to 0.0.0.0 or an explicit
37 * address. The reasoning is that if there's an explicit rule, it
38 * does not really matter if the listener is bound to an interface
39 * or to 0. The user already stated that he wants redirection
40 * (since he added the rule).
41 *
42 * "socket" match based redirection (no specific rule)
43 * ===================================================
44 *
45 * There are connections with dynamic endpoints (e.g. FTP data
46 * connection) that the user is unable to add explicit rules
47 * for. These are taken care of by a generic "socket" rule. It is
48 * assumed that the proxy application is trusted to open such
49 * connections without explicit iptables rule (except of course the
50 * generic 'socket' rule). In this case the following sockets are
51 * matched in preference order:
52 *
53 * - match: if there's a fully established connection matching the
54 * _packet_ tuple
55 *
56 * - match: if there's a non-zero bound listener (possibly with a
57 * non-local address) We don't accept zero-bound listeners, since
58 * then local services could intercept traffic going through the
59 * box.
60 *
61 * Please note that there's an overlap between what a TPROXY target
62 * and a socket match will match. Normally if you have both rules the
63 * "socket" match will be the first one, effectively all packets
64 * belonging to established connections going through that one.
65 */
66static inline struct sock *
13nf_tproxy_get_sock_v4(struct net *net, const u8 protocol, 67nf_tproxy_get_sock_v4(struct net *net, const u8 protocol,
14 const __be32 saddr, const __be32 daddr, 68 const __be32 saddr, const __be32 daddr,
15 const __be16 sport, const __be16 dport, 69 const __be16 sport, const __be16 dport,
16 const struct net_device *in, bool listening); 70 const struct net_device *in, int lookup_type)
71{
72 struct sock *sk;
73
74 /* look up socket */
75 switch (protocol) {
76 case IPPROTO_TCP:
77 switch (lookup_type) {
78 case NFT_LOOKUP_ANY:
79 sk = __inet_lookup(net, &tcp_hashinfo,
80 saddr, sport, daddr, dport,
81 in->ifindex);
82 break;
83 case NFT_LOOKUP_LISTENER:
84 sk = inet_lookup_listener(net, &tcp_hashinfo,
85 daddr, dport,
86 in->ifindex);
87
88 /* NOTE: we return listeners even if bound to
89 * 0.0.0.0, those are filtered out in
90 * xt_socket, since xt_TPROXY needs 0 bound
91 * listeners too */
92
93 break;
94 case NFT_LOOKUP_ESTABLISHED:
95 sk = inet_lookup_established(net, &tcp_hashinfo,
96 saddr, sport, daddr, dport,
97 in->ifindex);
98 break;
99 default:
100 WARN_ON(1);
101 sk = NULL;
102 break;
103 }
104 break;
105 case IPPROTO_UDP:
106 sk = udp4_lib_lookup(net, saddr, sport, daddr, dport,
107 in->ifindex);
108 if (sk && lookup_type != NFT_LOOKUP_ANY) {
109 int connected = (sk->sk_state == TCP_ESTABLISHED);
110 int wildcard = (inet_sk(sk)->inet_rcv_saddr == 0);
111
112 /* NOTE: we return listeners even if bound to
113 * 0.0.0.0, those are filtered out in
114 * xt_socket, since xt_TPROXY needs 0 bound
115 * listeners too */
116 if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) ||
117 (lookup_type == NFT_LOOKUP_LISTENER && connected)) {
118 sock_put(sk);
119 sk = NULL;
120 }
121 }
122 break;
123 default:
124 WARN_ON(1);
125 sk = NULL;
126 }
127
128 pr_debug("tproxy socket lookup: proto %u %08x:%u -> %08x:%u, lookup type: %d, sock %p\n",
129 protocol, ntohl(saddr), ntohs(sport), ntohl(daddr), ntohs(dport), lookup_type, sk);
130
131 return sk;
132}
133
134#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
135static inline struct sock *
136nf_tproxy_get_sock_v6(struct net *net, const u8 protocol,
137 const struct in6_addr *saddr, const struct in6_addr *daddr,
138 const __be16 sport, const __be16 dport,
139 const struct net_device *in, int lookup_type)
140{
141 struct sock *sk;
142
143 /* look up socket */
144 switch (protocol) {
145 case IPPROTO_TCP:
146 switch (lookup_type) {
147 case NFT_LOOKUP_ANY:
148 sk = inet6_lookup(net, &tcp_hashinfo,
149 saddr, sport, daddr, dport,
150 in->ifindex);
151 break;
152 case NFT_LOOKUP_LISTENER:
153 sk = inet6_lookup_listener(net, &tcp_hashinfo,
154 daddr, ntohs(dport),
155 in->ifindex);
156
157 /* NOTE: we return listeners even if bound to
158 * 0.0.0.0, those are filtered out in
159 * xt_socket, since xt_TPROXY needs 0 bound
160 * listeners too */
161
162 break;
163 case NFT_LOOKUP_ESTABLISHED:
164 sk = __inet6_lookup_established(net, &tcp_hashinfo,
165 saddr, sport, daddr, ntohs(dport),
166 in->ifindex);
167 break;
168 default:
169 WARN_ON(1);
170 sk = NULL;
171 break;
172 }
173 break;
174 case IPPROTO_UDP:
175 sk = udp6_lib_lookup(net, saddr, sport, daddr, dport,
176 in->ifindex);
177 if (sk && lookup_type != NFT_LOOKUP_ANY) {
178 int connected = (sk->sk_state == TCP_ESTABLISHED);
179 int wildcard = ipv6_addr_any(&inet6_sk(sk)->rcv_saddr);
180
181 /* NOTE: we return listeners even if bound to
182 * 0.0.0.0, those are filtered out in
183 * xt_socket, since xt_TPROXY needs 0 bound
184 * listeners too */
185 if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) ||
186 (lookup_type == NFT_LOOKUP_LISTENER && connected)) {
187 sock_put(sk);
188 sk = NULL;
189 }
190 }
191 break;
192 default:
193 WARN_ON(1);
194 sk = NULL;
195 }
196
197 pr_debug("tproxy socket lookup: proto %u %pI6:%u -> %pI6:%u, lookup type: %d, sock %p\n",
198 protocol, saddr, ntohs(sport), daddr, ntohs(dport), lookup_type, sk);
199
200 return sk;
201}
202#endif
17 203
18static inline void 204static inline void
19nf_tproxy_put_sock(struct sock *sk) 205nf_tproxy_put_sock(struct sock *sk)
diff --git a/include/net/netfilter/xt_log.h b/include/net/netfilter/xt_log.h
new file mode 100644
index 00000000000..0dfb34a5b53
--- /dev/null
+++ b/include/net/netfilter/xt_log.h
@@ -0,0 +1,54 @@
1#define S_SIZE (1024 - (sizeof(unsigned int) + 1))
2
3struct sbuff {
4 unsigned int count;
5 char buf[S_SIZE + 1];
6};
7static struct sbuff emergency, *emergency_ptr = &emergency;
8
9static int sb_add(struct sbuff *m, const char *f, ...)
10{
11 va_list args;
12 int len;
13
14 if (likely(m->count < S_SIZE)) {
15 va_start(args, f);
16 len = vsnprintf(m->buf + m->count, S_SIZE - m->count, f, args);
17 va_end(args);
18 if (likely(m->count + len < S_SIZE)) {
19 m->count += len;
20 return 0;
21 }
22 }
23 m->count = S_SIZE;
24 printk_once(KERN_ERR KBUILD_MODNAME " please increase S_SIZE\n");
25 return -1;
26}
27
28static struct sbuff *sb_open(void)
29{
30 struct sbuff *m = kmalloc(sizeof(*m), GFP_ATOMIC);
31
32 if (unlikely(!m)) {
33 local_bh_disable();
34 do {
35 m = xchg(&emergency_ptr, NULL);
36 } while (!m);
37 }
38 m->count = 0;
39 return m;
40}
41
42static void sb_close(struct sbuff *m)
43{
44 m->buf[m->count] = 0;
45 printk("%s\n", m->buf);
46
47 if (likely(m != &emergency))
48 kfree(m);
49 else {
50 xchg(&emergency_ptr, m);
51 local_bh_enable();
52 }
53}
54
diff --git a/include/net/netlink.h b/include/net/netlink.h
index f3b201d335b..9801c55de5d 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -384,7 +384,7 @@ static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
384 * 384 *
385 * Returns the first attribute which matches the specified type. 385 * Returns the first attribute which matches the specified type.
386 */ 386 */
387static inline struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh, 387static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh,
388 int hdrlen, int attrtype) 388 int hdrlen, int attrtype)
389{ 389{
390 return nla_find(nlmsg_attrdata(nlh, hdrlen), 390 return nla_find(nlmsg_attrdata(nlh, hdrlen),
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h
index 74f119a2829..748f91f87cd 100644
--- a/include/net/netns/xfrm.h
+++ b/include/net/netns/xfrm.h
@@ -43,10 +43,6 @@ struct netns_xfrm {
43 unsigned int policy_count[XFRM_POLICY_MAX * 2]; 43 unsigned int policy_count[XFRM_POLICY_MAX * 2];
44 struct work_struct policy_hash_work; 44 struct work_struct policy_hash_work;
45 45
46 struct dst_ops xfrm4_dst_ops;
47#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
48 struct dst_ops xfrm6_dst_ops;
49#endif
50 46
51 struct sock *nlsk; 47 struct sock *nlsk;
52 struct sock *nlsk_stash; 48 struct sock *nlsk_stash;
@@ -58,6 +54,11 @@ struct netns_xfrm {
58#ifdef CONFIG_SYSCTL 54#ifdef CONFIG_SYSCTL
59 struct ctl_table_header *sysctl_hdr; 55 struct ctl_table_header *sysctl_hdr;
60#endif 56#endif
57
58 struct dst_ops xfrm4_dst_ops;
59#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
60 struct dst_ops xfrm6_dst_ops;
61#endif
61}; 62};
62 63
63#endif 64#endif
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h
index 35672b1cf44..b60b28c99e8 100644
--- a/include/net/phonet/pep.h
+++ b/include/net/phonet/pep.h
@@ -45,6 +45,10 @@ struct pep_sock {
45 u8 tx_fc; /* TX flow control */ 45 u8 tx_fc; /* TX flow control */
46 u8 init_enable; /* auto-enable at creation */ 46 u8 init_enable; /* auto-enable at creation */
47 u8 aligned; 47 u8 aligned;
48#ifdef CONFIG_PHONET_PIPECTRLR
49 u8 pipe_state;
50 struct sockaddr_pn remote_pep;
51#endif
48}; 52};
49 53
50static inline struct pep_sock *pep_sk(struct sock *sk) 54static inline struct pep_sock *pep_sk(struct sock *sk)
@@ -77,6 +81,11 @@ static inline struct pnpipehdr *pnp_hdr(struct sk_buff *skb)
77#define MAX_PNPIPE_HEADER (MAX_PHONET_HEADER + 4) 81#define MAX_PNPIPE_HEADER (MAX_PHONET_HEADER + 4)
78 82
79enum { 83enum {
84 PNS_PIPE_CREATE_REQ = 0x00,
85 PNS_PIPE_CREATE_RESP,
86 PNS_PIPE_REMOVE_REQ,
87 PNS_PIPE_REMOVE_RESP,
88
80 PNS_PIPE_DATA = 0x20, 89 PNS_PIPE_DATA = 0x20,
81 PNS_PIPE_ALIGNED_DATA, 90 PNS_PIPE_ALIGNED_DATA,
82 91
@@ -160,4 +169,21 @@ enum {
160 PEP_IND_READY, 169 PEP_IND_READY,
161}; 170};
162 171
172#ifdef CONFIG_PHONET_PIPECTRLR
173#define PNS_PEP_CONNECT_UTID 0x02
174#define PNS_PIPE_CREATED_IND_UTID 0x04
175#define PNS_PIPE_ENABLE_UTID 0x0A
176#define PNS_PIPE_ENABLED_IND_UTID 0x0C
177#define PNS_PIPE_DISABLE_UTID 0x0F
178#define PNS_PIPE_DISABLED_IND_UTID 0x11
179#define PNS_PEP_DISCONNECT_UTID 0x06
180
181/* Used for tracking state of a pipe */
182enum {
183 PIPE_IDLE,
184 PIPE_DISABLED,
185 PIPE_ENABLED,
186};
187#endif /* CONFIG_PHONET_PIPECTRLR */
188
163#endif 189#endif
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h
index 7b114079a51..d5df797f954 100644
--- a/include/net/phonet/phonet.h
+++ b/include/net/phonet/phonet.h
@@ -54,6 +54,11 @@ void pn_sock_hash(struct sock *sk);
54void pn_sock_unhash(struct sock *sk); 54void pn_sock_unhash(struct sock *sk);
55int pn_sock_get_port(struct sock *sk, unsigned short sport); 55int pn_sock_get_port(struct sock *sk, unsigned short sport);
56 56
57struct sock *pn_find_sock_by_res(struct net *net, u8 res);
58int pn_sock_bind_res(struct sock *sock, u8 res);
59int pn_sock_unbind_res(struct sock *sk, u8 res);
60void pn_sock_unbind_all_res(struct sock *sk);
61
57int pn_skb_send(struct sock *sk, struct sk_buff *skb, 62int pn_skb_send(struct sock *sk, struct sk_buff *skb,
58 const struct sockaddr_pn *target); 63 const struct sockaddr_pn *target);
59 64
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h
index 2d16783d5e2..13649eb5741 100644
--- a/include/net/phonet/pn_dev.h
+++ b/include/net/phonet/pn_dev.h
@@ -57,5 +57,6 @@ struct net_device *phonet_route_output(struct net *net, u8 daddr);
57#define PN_NO_ADDR 0xff 57#define PN_NO_ADDR 0xff
58 58
59extern const struct file_operations pn_sock_seq_fops; 59extern const struct file_operations pn_sock_seq_fops;
60extern const struct file_operations pn_res_seq_fops;
60 61
61#endif 62#endif
diff --git a/include/net/protocol.h b/include/net/protocol.h
index f1effdd3c26..dc07495bce4 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -89,10 +89,10 @@ struct inet_protosw {
89#define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */ 89#define INET_PROTOSW_PERMANENT 0x02 /* Permanent protocols are unremovable. */
90#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ 90#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */
91 91
92extern const struct net_protocol *inet_protos[MAX_INET_PROTOS]; 92extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS];
93 93
94#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 94#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
95extern const struct inet6_protocol *inet6_protos[MAX_INET_PROTOS]; 95extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
96#endif 96#endif
97 97
98extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); 98extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num);
diff --git a/include/net/raw.h b/include/net/raw.h
index 43c57502659..42ce6fe7a2d 100644
--- a/include/net/raw.h
+++ b/include/net/raw.h
@@ -45,7 +45,10 @@ struct raw_iter_state {
45 struct raw_hashinfo *h; 45 struct raw_hashinfo *h;
46}; 46};
47 47
48#define raw_seq_private(seq) ((struct raw_iter_state *)(seq)->private) 48static inline struct raw_iter_state *raw_seq_private(struct seq_file *seq)
49{
50 return seq->private;
51}
49void *raw_seq_start(struct seq_file *seq, loff_t *pos); 52void *raw_seq_start(struct seq_file *seq, loff_t *pos);
50void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos); 53void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos);
51void raw_seq_stop(struct seq_file *seq, void *v); 54void raw_seq_stop(struct seq_file *seq, void *v);
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index af60fd05084..e013c68bfb0 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -79,7 +79,6 @@ struct rtnl_link_ops {
79 79
80extern int __rtnl_link_register(struct rtnl_link_ops *ops); 80extern int __rtnl_link_register(struct rtnl_link_ops *ops);
81extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); 81extern void __rtnl_link_unregister(struct rtnl_link_ops *ops);
82extern void rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops);
83 82
84extern int rtnl_link_register(struct rtnl_link_ops *ops); 83extern int rtnl_link_register(struct rtnl_link_ops *ops);
85extern void rtnl_link_unregister(struct rtnl_link_ops *ops); 84extern void rtnl_link_unregister(struct rtnl_link_ops *ops);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 3c8728aaab4..ea1f8a83160 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -328,8 +328,7 @@ extern void qdisc_destroy(struct Qdisc *qdisc);
328extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 328extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
329extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, 329extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
330 struct Qdisc_ops *ops); 330 struct Qdisc_ops *ops);
331extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, 331extern struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
332 struct netdev_queue *dev_queue,
333 struct Qdisc_ops *ops, u32 parentid); 332 struct Qdisc_ops *ops, u32 parentid);
334extern void qdisc_calculate_pkt_len(struct sk_buff *skb, 333extern void qdisc_calculate_pkt_len(struct sk_buff *skb,
335 struct qdisc_size_table *stab); 334 struct qdisc_size_table *stab);
@@ -601,7 +600,7 @@ static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
601 slot = 0; 600 slot = 0;
602 slot >>= rtab->rate.cell_log; 601 slot >>= rtab->rate.cell_log;
603 if (slot > 255) 602 if (slot > 255)
604 return (rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]); 603 return rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF];
605 return rtab->data[slot]; 604 return rtab->data[slot];
606} 605}
607 606
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 65946bc43d0..505845ddb0b 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -275,24 +275,35 @@ struct sctp_mib {
275/* Print debugging messages. */ 275/* Print debugging messages. */
276#if SCTP_DEBUG 276#if SCTP_DEBUG
277extern int sctp_debug_flag; 277extern int sctp_debug_flag;
278#define SCTP_DEBUG_PRINTK(whatever...) \ 278#define SCTP_DEBUG_PRINTK(fmt, args...) \
279 ((void) (sctp_debug_flag && printk(KERN_DEBUG whatever))) 279do { \
280#define SCTP_DEBUG_PRINTK_IPADDR(lead, trail, leadparm, saddr, otherparms...) \ 280 if (sctp_debug_flag) \
281 if (sctp_debug_flag) { \ 281 printk(KERN_DEBUG pr_fmt(fmt), ##args); \
282 if (saddr->sa.sa_family == AF_INET6) { \ 282} while (0)
283 printk(KERN_DEBUG \ 283#define SCTP_DEBUG_PRINTK_CONT(fmt, args...) \
284 lead "%pI6" trail, \ 284do { \
285 leadparm, \ 285 if (sctp_debug_flag) \
286 &saddr->v6.sin6_addr, \ 286 pr_cont(fmt, ##args); \
287 otherparms); \ 287} while (0)
288 } else { \ 288#define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \
289 printk(KERN_DEBUG \ 289 args_lead, saddr, args_trail...) \
290 lead "%pI4" trail, \ 290do { \
291 leadparm, \ 291 if (sctp_debug_flag) { \
292 &saddr->v4.sin_addr.s_addr, \ 292 if (saddr->sa.sa_family == AF_INET6) { \
293 otherparms); \ 293 printk(KERN_DEBUG \
294 } \ 294 pr_fmt(fmt_lead "%pI6" fmt_trail), \
295 } 295 args_lead, \
296 &saddr->v6.sin6_addr, \
297 args_trail); \
298 } else { \
299 printk(KERN_DEBUG \
300 pr_fmt(fmt_lead "%pI4" fmt_trail), \
301 args_lead, \
302 &saddr->v4.sin_addr.s_addr, \
303 args_trail); \
304 } \
305 } \
306} while (0)
296#define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } 307#define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; }
297#define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } 308#define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; }
298 309
@@ -306,6 +317,7 @@ extern int sctp_debug_flag;
306#else /* SCTP_DEBUG */ 317#else /* SCTP_DEBUG */
307 318
308#define SCTP_DEBUG_PRINTK(whatever...) 319#define SCTP_DEBUG_PRINTK(whatever...)
320#define SCTP_DEBUG_PRINTK_CONT(fmt, args...)
309#define SCTP_DEBUG_PRINTK_IPADDR(whatever...) 321#define SCTP_DEBUG_PRINTK_IPADDR(whatever...)
310#define SCTP_ENABLE_DEBUG 322#define SCTP_ENABLE_DEBUG
311#define SCTP_DISABLE_DEBUG 323#define SCTP_DISABLE_DEBUG
@@ -393,7 +405,7 @@ static inline void sctp_v6_del_protocol(void) { return; }
393/* Map an association to an assoc_id. */ 405/* Map an association to an assoc_id. */
394static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) 406static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc)
395{ 407{
396 return (asoc?asoc->assoc_id:0); 408 return asoc ? asoc->assoc_id : 0;
397} 409}
398 410
399/* Look up the association by its id. */ 411/* Look up the association by its id. */
@@ -461,7 +473,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
461/* Tests if the list has one and only one entry. */ 473/* Tests if the list has one and only one entry. */
462static inline int sctp_list_single_entry(struct list_head *head) 474static inline int sctp_list_single_entry(struct list_head *head)
463{ 475{
464 return ((head->next != head) && (head->next == head->prev)); 476 return (head->next != head) && (head->next == head->prev);
465} 477}
466 478
467/* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ 479/* Generate a random jitter in the range of -50% ~ +50% of input RTO. */
@@ -619,13 +631,13 @@ static inline int sctp_sanity_check(void)
619/* This is the hash function for the SCTP port hash table. */ 631/* This is the hash function for the SCTP port hash table. */
620static inline int sctp_phashfn(__u16 lport) 632static inline int sctp_phashfn(__u16 lport)
621{ 633{
622 return (lport & (sctp_port_hashsize - 1)); 634 return lport & (sctp_port_hashsize - 1);
623} 635}
624 636
625/* This is the hash function for the endpoint hash table. */ 637/* This is the hash function for the endpoint hash table. */
626static inline int sctp_ep_hashfn(__u16 lport) 638static inline int sctp_ep_hashfn(__u16 lport)
627{ 639{
628 return (lport & (sctp_ep_hashsize - 1)); 640 return lport & (sctp_ep_hashsize - 1);
629} 641}
630 642
631/* This is the hash function for the association hash table. */ 643/* This is the hash function for the association hash table. */
@@ -633,7 +645,7 @@ static inline int sctp_assoc_hashfn(__u16 lport, __u16 rport)
633{ 645{
634 int h = (lport << 16) + rport; 646 int h = (lport << 16) + rport;
635 h ^= h>>8; 647 h ^= h>>8;
636 return (h & (sctp_assoc_hashsize - 1)); 648 return h & (sctp_assoc_hashsize - 1);
637} 649}
638 650
639/* This is the hash function for the association hash table. This is 651/* This is the hash function for the association hash table. This is
@@ -644,7 +656,7 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag)
644{ 656{
645 int h = (lport << 16) + rport; 657 int h = (lport << 16) + rport;
646 h ^= vtag; 658 h ^= vtag;
647 return (h & (sctp_assoc_hashsize-1)); 659 return h & (sctp_assoc_hashsize - 1);
648} 660}
649 661
650#define sctp_for_each_hentry(epb, node, head) \ 662#define sctp_for_each_hentry(epb, node, head) \
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 4088c89a905..9352d12f02d 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -345,12 +345,12 @@ enum {
345 345
346static inline int TSN_lt(__u32 s, __u32 t) 346static inline int TSN_lt(__u32 s, __u32 t)
347{ 347{
348 return (((s) - (t)) & TSN_SIGN_BIT); 348 return ((s) - (t)) & TSN_SIGN_BIT;
349} 349}
350 350
351static inline int TSN_lte(__u32 s, __u32 t) 351static inline int TSN_lte(__u32 s, __u32 t)
352{ 352{
353 return (((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT)); 353 return ((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT);
354} 354}
355 355
356/* Compare two SSNs */ 356/* Compare two SSNs */
@@ -369,12 +369,12 @@ enum {
369 369
370static inline int SSN_lt(__u16 s, __u16 t) 370static inline int SSN_lt(__u16 s, __u16 t)
371{ 371{
372 return (((s) - (t)) & SSN_SIGN_BIT); 372 return ((s) - (t)) & SSN_SIGN_BIT;
373} 373}
374 374
375static inline int SSN_lte(__u16 s, __u16 t) 375static inline int SSN_lte(__u16 s, __u16 t)
376{ 376{
377 return (((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT)); 377 return ((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT);
378} 378}
379 379
380/* 380/*
@@ -388,7 +388,7 @@ enum {
388 388
389static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) 389static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t)
390{ 390{
391 return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT)); 391 return ((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT);
392} 392}
393 393
394/* Check VTAG of the packet matches the sender's own tag. */ 394/* Check VTAG of the packet matches the sender's own tag. */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index f9e7473613b..69fef4fb79c 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -847,7 +847,7 @@ void sctp_packet_free(struct sctp_packet *);
847 847
848static inline int sctp_packet_empty(struct sctp_packet *packet) 848static inline int sctp_packet_empty(struct sctp_packet *packet)
849{ 849{
850 return (packet->size == packet->overhead); 850 return packet->size == packet->overhead;
851} 851}
852 852
853/* This represents a remote transport address. 853/* This represents a remote transport address.
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 4aabc5a96cf..e7728bc14cc 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -157,7 +157,7 @@ __u16 sctp_tsnmap_pending(struct sctp_tsnmap *map);
157/* Is there a gap in the TSN map? */ 157/* Is there a gap in the TSN map? */
158static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map) 158static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map)
159{ 159{
160 return (map->cumulative_tsn_ack_point != map->max_tsn_seen); 160 return map->cumulative_tsn_ack_point != map->max_tsn_seen;
161} 161}
162 162
163/* Mark a duplicate TSN. Note: limit the storage of duplicate TSN 163/* Mark a duplicate TSN. Note: limit the storage of duplicate TSN
diff --git a/include/net/sock.h b/include/net/sock.h
index adab9dc5818..c7a736228ca 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -301,7 +301,7 @@ struct sock {
301 const struct cred *sk_peer_cred; 301 const struct cred *sk_peer_cred;
302 long sk_rcvtimeo; 302 long sk_rcvtimeo;
303 long sk_sndtimeo; 303 long sk_sndtimeo;
304 struct sk_filter *sk_filter; 304 struct sk_filter __rcu *sk_filter;
305 void *sk_protinfo; 305 void *sk_protinfo;
306 struct timer_list sk_timer; 306 struct timer_list sk_timer;
307 ktime_t sk_stamp; 307 ktime_t sk_stamp;
@@ -1558,7 +1558,11 @@ static inline void sk_wake_async(struct sock *sk, int how, int band)
1558} 1558}
1559 1559
1560#define SOCK_MIN_SNDBUF 2048 1560#define SOCK_MIN_SNDBUF 2048
1561#define SOCK_MIN_RCVBUF 256 1561/*
1562 * Since sk_rmem_alloc sums skb->truesize, even a small frame might need
1563 * sizeof(sk_buff) + MTU + padding, unless net driver perform copybreak
1564 */
1565#define SOCK_MIN_RCVBUF (2048 + sizeof(struct sk_buff))
1562 1566
1563static inline void sk_stream_moderate_sndbuf(struct sock *sk) 1567static inline void sk_stream_moderate_sndbuf(struct sock *sk)
1564{ 1568{
@@ -1670,17 +1674,13 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
1670 1674
1671/** 1675/**
1672 * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped 1676 * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped
1673 * @msg: outgoing packet
1674 * @sk: socket sending this packet 1677 * @sk: socket sending this packet
1675 * @shtx: filled with instructions for time stamping 1678 * @tx_flags: filled with instructions for time stamping
1676 * 1679 *
1677 * Currently only depends on SOCK_TIMESTAMPING* flags. Returns error code if 1680 * Currently only depends on SOCK_TIMESTAMPING* flags. Returns error code if
1678 * parameters are invalid. 1681 * parameters are invalid.
1679 */ 1682 */
1680extern int sock_tx_timestamp(struct msghdr *msg, 1683extern int sock_tx_timestamp(struct sock *sk, __u8 *tx_flags);
1681 struct sock *sk,
1682 union skb_shared_tx *shtx);
1683
1684 1684
1685/** 1685/**
1686 * sk_eat_skb - Release a skb if it is no longer needed 1686 * sk_eat_skb - Release a skb if it is no longer needed
diff --git a/include/net/tc_act/tc_csum.h b/include/net/tc_act/tc_csum.h
new file mode 100644
index 00000000000..9e8710be7a0
--- /dev/null
+++ b/include/net/tc_act/tc_csum.h
@@ -0,0 +1,15 @@
1#ifndef __NET_TC_CSUM_H
2#define __NET_TC_CSUM_H
3
4#include <linux/types.h>
5#include <net/act_api.h>
6
7struct tcf_csum {
8 struct tcf_common common;
9
10 u32 update_flags;
11};
12#define to_tcf_csum(pc) \
13 container_of(pc,struct tcf_csum,common)
14
15#endif /* __NET_TC_CSUM_H */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 3e4b33e3660..4fee0424af7 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -346,8 +346,6 @@ static inline void tcp_dec_quickack_mode(struct sock *sk,
346 } 346 }
347} 347}
348 348
349extern void tcp_enter_quickack_mode(struct sock *sk);
350
351#define TCP_ECN_OK 1 349#define TCP_ECN_OK 1
352#define TCP_ECN_QUEUE_CWR 2 350#define TCP_ECN_QUEUE_CWR 2
353#define TCP_ECN_DEMAND_CWR 4 351#define TCP_ECN_DEMAND_CWR 4
@@ -803,6 +801,15 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk)
803/* Use define here intentionally to get WARN_ON location shown at the caller */ 801/* Use define here intentionally to get WARN_ON location shown at the caller */
804#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) 802#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out)
805 803
804/*
805 * Convert RFC 3390 larger initial window into an equivalent number of packets.
806 * This is based on the numbers specified in RFC 5681, 3.1.
807 */
808static inline u32 rfc3390_bytes_to_packets(const u32 smss)
809{
810 return smss <= 1095 ? 4 : (smss > 2190 ? 2 : 3);
811}
812
806extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); 813extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
807extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); 814extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst);
808 815
diff --git a/include/net/tipc/tipc.h b/include/net/tipc/tipc.h
index 15af6dca0b4..1e0645e1eed 100644
--- a/include/net/tipc/tipc.h
+++ b/include/net/tipc/tipc.h
@@ -50,8 +50,6 @@
50 * TIPC operating mode routines 50 * TIPC operating mode routines
51 */ 51 */
52 52
53u32 tipc_get_addr(void);
54
55#define TIPC_NOT_RUNNING 0 53#define TIPC_NOT_RUNNING 0
56#define TIPC_NODE_MODE 1 54#define TIPC_NODE_MODE 1
57#define TIPC_NET_MODE 2 55#define TIPC_NET_MODE 2
@@ -62,8 +60,6 @@ int tipc_attach(unsigned int *userref, tipc_mode_event, void *usr_handle);
62 60
63void tipc_detach(unsigned int userref); 61void tipc_detach(unsigned int userref);
64 62
65int tipc_get_mode(void);
66
67/* 63/*
68 * TIPC port manipulation routines 64 * TIPC port manipulation routines
69 */ 65 */
@@ -153,12 +149,6 @@ int tipc_disconnect(u32 portref);
153 149
154int tipc_shutdown(u32 ref); 150int tipc_shutdown(u32 ref);
155 151
156int tipc_isconnected(u32 portref, int *isconnected);
157
158int tipc_peer(u32 portref, struct tipc_portid *peer);
159
160int tipc_ref_valid(u32 portref);
161
162/* 152/*
163 * TIPC messaging routines 153 * TIPC messaging routines
164 */ 154 */
@@ -170,38 +160,12 @@ int tipc_send(u32 portref,
170 unsigned int num_sect, 160 unsigned int num_sect,
171 struct iovec const *msg_sect); 161 struct iovec const *msg_sect);
172 162
173int tipc_send_buf(u32 portref,
174 struct sk_buff *buf,
175 unsigned int dsz);
176
177int tipc_send2name(u32 portref, 163int tipc_send2name(u32 portref,
178 struct tipc_name const *name, 164 struct tipc_name const *name,
179 u32 domain, 165 u32 domain,
180 unsigned int num_sect, 166 unsigned int num_sect,
181 struct iovec const *msg_sect); 167 struct iovec const *msg_sect);
182 168
183int tipc_send_buf2name(u32 portref,
184 struct tipc_name const *name,
185 u32 domain,
186 struct sk_buff *buf,
187 unsigned int dsz);
188
189int tipc_forward2name(u32 portref,
190 struct tipc_name const *name,
191 u32 domain,
192 unsigned int section_count,
193 struct iovec const *msg_sect,
194 struct tipc_portid const *origin,
195 unsigned int importance);
196
197int tipc_forward_buf2name(u32 portref,
198 struct tipc_name const *name,
199 u32 domain,
200 struct sk_buff *buf,
201 unsigned int dsz,
202 struct tipc_portid const *orig,
203 unsigned int importance);
204
205int tipc_send2port(u32 portref, 169int tipc_send2port(u32 portref,
206 struct tipc_portid const *dest, 170 struct tipc_portid const *dest,
207 unsigned int num_sect, 171 unsigned int num_sect,
@@ -212,46 +176,11 @@ int tipc_send_buf2port(u32 portref,
212 struct sk_buff *buf, 176 struct sk_buff *buf,
213 unsigned int dsz); 177 unsigned int dsz);
214 178
215int tipc_forward2port(u32 portref,
216 struct tipc_portid const *dest,
217 unsigned int num_sect,
218 struct iovec const *msg_sect,
219 struct tipc_portid const *origin,
220 unsigned int importance);
221
222int tipc_forward_buf2port(u32 portref,
223 struct tipc_portid const *dest,
224 struct sk_buff *buf,
225 unsigned int dsz,
226 struct tipc_portid const *orig,
227 unsigned int importance);
228
229int tipc_multicast(u32 portref, 179int tipc_multicast(u32 portref,
230 struct tipc_name_seq const *seq, 180 struct tipc_name_seq const *seq,
231 u32 domain, /* currently unused */ 181 u32 domain, /* currently unused */
232 unsigned int section_count, 182 unsigned int section_count,
233 struct iovec const *msg); 183 struct iovec const *msg);
234
235#if 0
236int tipc_multicast_buf(u32 portref,
237 struct tipc_name_seq const *seq,
238 u32 domain,
239 void *buf,
240 unsigned int size);
241#endif
242
243/*
244 * TIPC subscription routines
245 */
246
247int tipc_ispublished(struct tipc_name const *name);
248
249/*
250 * Get number of available nodes within specified domain (excluding own node)
251 */
252
253unsigned int tipc_available_nodes(const u32 domain);
254
255#endif 184#endif
256 185
257#endif 186#endif
diff --git a/include/net/tipc/tipc_msg.h b/include/net/tipc/tipc_msg.h
index 2e159a812f8..ffe50b4e7b9 100644
--- a/include/net/tipc/tipc_msg.h
+++ b/include/net/tipc/tipc_msg.h
@@ -107,7 +107,7 @@ static inline u32 msg_hdr_sz(struct tipc_msg *m)
107 107
108static inline int msg_short(struct tipc_msg *m) 108static inline int msg_short(struct tipc_msg *m)
109{ 109{
110 return (msg_hdr_sz(m) == 24); 110 return msg_hdr_sz(m) == 24;
111} 111}
112 112
113static inline u32 msg_size(struct tipc_msg *m) 113static inline u32 msg_size(struct tipc_msg *m)
@@ -117,7 +117,7 @@ static inline u32 msg_size(struct tipc_msg *m)
117 117
118static inline u32 msg_data_sz(struct tipc_msg *m) 118static inline u32 msg_data_sz(struct tipc_msg *m)
119{ 119{
120 return (msg_size(m) - msg_hdr_sz(m)); 120 return msg_size(m) - msg_hdr_sz(m);
121} 121}
122 122
123static inline unchar *msg_data(struct tipc_msg *m) 123static inline unchar *msg_data(struct tipc_msg *m)
@@ -132,17 +132,17 @@ static inline u32 msg_type(struct tipc_msg *m)
132 132
133static inline u32 msg_named(struct tipc_msg *m) 133static inline u32 msg_named(struct tipc_msg *m)
134{ 134{
135 return (msg_type(m) == TIPC_NAMED_MSG); 135 return msg_type(m) == TIPC_NAMED_MSG;
136} 136}
137 137
138static inline u32 msg_mcast(struct tipc_msg *m) 138static inline u32 msg_mcast(struct tipc_msg *m)
139{ 139{
140 return (msg_type(m) == TIPC_MCAST_MSG); 140 return msg_type(m) == TIPC_MCAST_MSG;
141} 141}
142 142
143static inline u32 msg_connected(struct tipc_msg *m) 143static inline u32 msg_connected(struct tipc_msg *m)
144{ 144{
145 return (msg_type(m) == TIPC_CONN_MSG); 145 return msg_type(m) == TIPC_CONN_MSG;
146} 146}
147 147
148static inline u32 msg_errcode(struct tipc_msg *m) 148static inline u32 msg_errcode(struct tipc_msg *m)
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index c54917cbfa4..1893aaf4942 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -88,8 +88,6 @@ void tipc_acknowledge(u32 port_ref,u32 ack);
88 88
89struct tipc_port *tipc_get_port(const u32 ref); 89struct tipc_port *tipc_get_port(const u32 ref);
90 90
91void *tipc_get_handle(const u32 ref);
92
93/* 91/*
94 * The following routines require that the port be locked on entry 92 * The following routines require that the port be locked on entry
95 */ 93 */
diff --git a/include/net/udp.h b/include/net/udp.h
index a184d3496b1..200b82848c9 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -183,6 +183,9 @@ extern int udp_lib_setsockopt(struct sock *sk, int level, int optname,
183extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, 183extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
184 __be32 daddr, __be16 dport, 184 __be32 daddr, __be16 dport,
185 int dif); 185 int dif);
186extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport,
187 const struct in6_addr *daddr, __be16 dport,
188 int dif);
186 189
187/* 190/*
188 * SNMP statistics for UDP and UDP-Lite 191 * SNMP statistics for UDP and UDP-Lite
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 4f53532d4c2..bcfb6b24b01 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1264,7 +1264,7 @@ struct xfrm_tunnel {
1264 int (*handler)(struct sk_buff *skb); 1264 int (*handler)(struct sk_buff *skb);
1265 int (*err_handler)(struct sk_buff *skb, u32 info); 1265 int (*err_handler)(struct sk_buff *skb, u32 info);
1266 1266
1267 struct xfrm_tunnel *next; 1267 struct xfrm_tunnel __rcu *next;
1268 int priority; 1268 int priority;
1269}; 1269};
1270 1270
@@ -1272,7 +1272,7 @@ struct xfrm6_tunnel {
1272 int (*handler)(struct sk_buff *skb); 1272 int (*handler)(struct sk_buff *skb);
1273 int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, 1273 int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
1274 u8 type, u8 code, int offset, __be32 info); 1274 u8 type, u8 code, int offset, __be32 info);
1275 struct xfrm6_tunnel *next; 1275 struct xfrm6_tunnel __rcu *next;
1276 int priority; 1276 int priority;
1277}; 1277};
1278 1278
@@ -1419,7 +1419,6 @@ extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
1419extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family); 1419extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family);
1420extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family); 1420extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family);
1421extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr); 1421extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr);
1422extern void xfrm6_tunnel_free_spi(struct net *net, xfrm_address_t *saddr);
1423extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, xfrm_address_t *saddr); 1422extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, xfrm_address_t *saddr);
1424extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); 1423extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb);
1425extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); 1424extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb);
@@ -1466,8 +1465,6 @@ struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark,
1466 xfrm_address_t *saddr, int create, 1465 xfrm_address_t *saddr, int create,
1467 unsigned short family); 1466 unsigned short family);
1468extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); 1467extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
1469extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst,
1470 struct flowi *fl, int family, int strict);
1471 1468
1472#ifdef CONFIG_XFRM_MIGRATE 1469#ifdef CONFIG_XFRM_MIGRATE
1473extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type, 1470extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index fa0d52b8e62..b5fc9f39122 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -39,7 +39,9 @@
39#include <linux/if_arp.h> 39#include <linux/if_arp.h>
40#include <linux/netdevice.h> 40#include <linux/netdevice.h>
41#include <linux/socket.h> 41#include <linux/socket.h>
42#include <linux/if_vlan.h>
42#include <rdma/ib_verbs.h> 43#include <rdma/ib_verbs.h>
44#include <rdma/ib_pack.h>
43 45
44struct rdma_addr_client { 46struct rdma_addr_client {
45 atomic_t refcount; 47 atomic_t refcount;
@@ -63,6 +65,7 @@ struct rdma_dev_addr {
63 unsigned char broadcast[MAX_ADDR_LEN]; 65 unsigned char broadcast[MAX_ADDR_LEN];
64 unsigned short dev_type; 66 unsigned short dev_type;
65 int bound_dev_if; 67 int bound_dev_if;
68 enum rdma_transport_type transport;
66}; 69};
67 70
68/** 71/**
@@ -127,9 +130,51 @@ static inline int rdma_addr_gid_offset(struct rdma_dev_addr *dev_addr)
127 return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0; 130 return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0;
128} 131}
129 132
133static inline void iboe_mac_vlan_to_ll(union ib_gid *gid, u8 *mac, u16 vid)
134{
135 memset(gid->raw, 0, 16);
136 *((__be32 *) gid->raw) = cpu_to_be32(0xfe800000);
137 if (vid < 0x1000) {
138 gid->raw[12] = vid & 0xff;
139 gid->raw[11] = vid >> 8;
140 } else {
141 gid->raw[12] = 0xfe;
142 gid->raw[11] = 0xff;
143 }
144 memcpy(gid->raw + 13, mac + 3, 3);
145 memcpy(gid->raw + 8, mac, 3);
146 gid->raw[8] ^= 2;
147}
148
149static inline u16 rdma_vlan_dev_vlan_id(const struct net_device *dev)
150{
151 return dev->priv_flags & IFF_802_1Q_VLAN ?
152 vlan_dev_vlan_id(dev) : 0xffff;
153}
154
155static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr,
156 union ib_gid *gid)
157{
158 struct net_device *dev;
159 u16 vid = 0xffff;
160
161 dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if);
162 if (dev) {
163 vid = rdma_vlan_dev_vlan_id(dev);
164 dev_put(dev);
165 }
166
167 iboe_mac_vlan_to_ll(gid, dev_addr->src_dev_addr, vid);
168}
169
130static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) 170static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid)
131{ 171{
132 memcpy(gid, dev_addr->src_dev_addr + rdma_addr_gid_offset(dev_addr), sizeof *gid); 172 if (dev_addr->transport == RDMA_TRANSPORT_IB &&
173 dev_addr->dev_type != ARPHRD_INFINIBAND)
174 iboe_addr_get_sgid(dev_addr, gid);
175 else
176 memcpy(gid, dev_addr->src_dev_addr +
177 rdma_addr_gid_offset(dev_addr), sizeof *gid);
133} 178}
134 179
135static inline void rdma_addr_set_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) 180static inline void rdma_addr_set_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid)
@@ -147,4 +192,91 @@ static inline void rdma_addr_set_dgid(struct rdma_dev_addr *dev_addr, union ib_g
147 memcpy(dev_addr->dst_dev_addr + rdma_addr_gid_offset(dev_addr), gid, sizeof *gid); 192 memcpy(dev_addr->dst_dev_addr + rdma_addr_gid_offset(dev_addr), gid, sizeof *gid);
148} 193}
149 194
195static inline enum ib_mtu iboe_get_mtu(int mtu)
196{
197 /*
198 * reduce IB headers from effective IBoE MTU. 28 stands for
199 * atomic header which is the biggest possible header after BTH
200 */
201 mtu = mtu - IB_GRH_BYTES - IB_BTH_BYTES - 28;
202
203 if (mtu >= ib_mtu_enum_to_int(IB_MTU_4096))
204 return IB_MTU_4096;
205 else if (mtu >= ib_mtu_enum_to_int(IB_MTU_2048))
206 return IB_MTU_2048;
207 else if (mtu >= ib_mtu_enum_to_int(IB_MTU_1024))
208 return IB_MTU_1024;
209 else if (mtu >= ib_mtu_enum_to_int(IB_MTU_512))
210 return IB_MTU_512;
211 else if (mtu >= ib_mtu_enum_to_int(IB_MTU_256))
212 return IB_MTU_256;
213 else
214 return 0;
215}
216
217static inline int iboe_get_rate(struct net_device *dev)
218{
219 struct ethtool_cmd cmd;
220
221 if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings ||
222 dev->ethtool_ops->get_settings(dev, &cmd))
223 return IB_RATE_PORT_CURRENT;
224
225 if (cmd.speed >= 40000)
226 return IB_RATE_40_GBPS;
227 else if (cmd.speed >= 30000)
228 return IB_RATE_30_GBPS;
229 else if (cmd.speed >= 20000)
230 return IB_RATE_20_GBPS;
231 else if (cmd.speed >= 10000)
232 return IB_RATE_10_GBPS;
233 else
234 return IB_RATE_PORT_CURRENT;
235}
236
237static inline int rdma_link_local_addr(struct in6_addr *addr)
238{
239 if (addr->s6_addr32[0] == htonl(0xfe800000) &&
240 addr->s6_addr32[1] == 0)
241 return 1;
242
243 return 0;
244}
245
246static inline void rdma_get_ll_mac(struct in6_addr *addr, u8 *mac)
247{
248 memcpy(mac, &addr->s6_addr[8], 3);
249 memcpy(mac + 3, &addr->s6_addr[13], 3);
250 mac[0] ^= 2;
251}
252
253static inline int rdma_is_multicast_addr(struct in6_addr *addr)
254{
255 return addr->s6_addr[0] == 0xff;
256}
257
258static inline void rdma_get_mcast_mac(struct in6_addr *addr, u8 *mac)
259{
260 int i;
261
262 mac[0] = 0x33;
263 mac[1] = 0x33;
264 for (i = 2; i < 6; ++i)
265 mac[i] = addr->s6_addr[i + 10];
266}
267
268static inline u16 rdma_get_vlan_id(union ib_gid *dgid)
269{
270 u16 vid;
271
272 vid = dgid->raw[11] << 8 | dgid->raw[12];
273 return vid < 0x1000 ? vid : 0xffff;
274}
275
276static inline struct net_device *rdma_vlan_dev_real_dev(const struct net_device *dev)
277{
278 return dev->priv_flags & IFF_802_1Q_VLAN ?
279 vlan_dev_real_dev(dev) : 0;
280}
281
150#endif /* IB_ADDR_H */ 282#endif /* IB_ADDR_H */
diff --git a/include/rdma/ib_pack.h b/include/rdma/ib_pack.h
index cbb50f4da3d..b37fe3b10a9 100644
--- a/include/rdma/ib_pack.h
+++ b/include/rdma/ib_pack.h
@@ -37,6 +37,8 @@
37 37
38enum { 38enum {
39 IB_LRH_BYTES = 8, 39 IB_LRH_BYTES = 8,
40 IB_ETH_BYTES = 14,
41 IB_VLAN_BYTES = 4,
40 IB_GRH_BYTES = 40, 42 IB_GRH_BYTES = 40,
41 IB_BTH_BYTES = 12, 43 IB_BTH_BYTES = 12,
42 IB_DETH_BYTES = 8 44 IB_DETH_BYTES = 8
@@ -210,14 +212,32 @@ struct ib_unpacked_deth {
210 __be32 source_qpn; 212 __be32 source_qpn;
211}; 213};
212 214
215struct ib_unpacked_eth {
216 u8 dmac_h[4];
217 u8 dmac_l[2];
218 u8 smac_h[2];
219 u8 smac_l[4];
220 __be16 type;
221};
222
223struct ib_unpacked_vlan {
224 __be16 tag;
225 __be16 type;
226};
227
213struct ib_ud_header { 228struct ib_ud_header {
229 int lrh_present;
214 struct ib_unpacked_lrh lrh; 230 struct ib_unpacked_lrh lrh;
215 int grh_present; 231 int eth_present;
216 struct ib_unpacked_grh grh; 232 struct ib_unpacked_eth eth;
217 struct ib_unpacked_bth bth; 233 int vlan_present;
234 struct ib_unpacked_vlan vlan;
235 int grh_present;
236 struct ib_unpacked_grh grh;
237 struct ib_unpacked_bth bth;
218 struct ib_unpacked_deth deth; 238 struct ib_unpacked_deth deth;
219 int immediate_present; 239 int immediate_present;
220 __be32 immediate_data; 240 __be32 immediate_data;
221}; 241};
222 242
223void ib_pack(const struct ib_field *desc, 243void ib_pack(const struct ib_field *desc,
@@ -230,9 +250,12 @@ void ib_unpack(const struct ib_field *desc,
230 void *buf, 250 void *buf,
231 void *structure); 251 void *structure);
232 252
233void ib_ud_header_init(int payload_bytes, 253void ib_ud_header_init(int payload_bytes,
234 int grh_present, 254 int lrh_present,
235 int immediate_present, 255 int eth_present,
256 int vlan_present,
257 int grh_present,
258 int immediate_present,
236 struct ib_ud_header *header); 259 struct ib_ud_header *header);
237 260
238int ib_ud_header_pack(struct ib_ud_header *header, 261int ib_ud_header_pack(struct ib_ud_header *header,
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h
index a17f7710614..fe5b05177a2 100644
--- a/include/rdma/ib_user_verbs.h
+++ b/include/rdma/ib_user_verbs.h
@@ -205,7 +205,8 @@ struct ib_uverbs_query_port_resp {
205 __u8 active_width; 205 __u8 active_width;
206 __u8 active_speed; 206 __u8 active_speed;
207 __u8 phys_state; 207 __u8 phys_state;
208 __u8 reserved[3]; 208 __u8 link_layer;
209 __u8 reserved[2];
209}; 210};
210 211
211struct ib_uverbs_alloc_pd { 212struct ib_uverbs_alloc_pd {
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 857b3b9cf12..e04c4888d1f 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -75,6 +75,12 @@ enum rdma_transport_type {
75enum rdma_transport_type 75enum rdma_transport_type
76rdma_node_get_transport(enum rdma_node_type node_type) __attribute_const__; 76rdma_node_get_transport(enum rdma_node_type node_type) __attribute_const__;
77 77
78enum rdma_link_layer {
79 IB_LINK_LAYER_UNSPECIFIED,
80 IB_LINK_LAYER_INFINIBAND,
81 IB_LINK_LAYER_ETHERNET,
82};
83
78enum ib_device_cap_flags { 84enum ib_device_cap_flags {
79 IB_DEVICE_RESIZE_MAX_WR = 1, 85 IB_DEVICE_RESIZE_MAX_WR = 1,
80 IB_DEVICE_BAD_PKEY_CNTR = (1<<1), 86 IB_DEVICE_BAD_PKEY_CNTR = (1<<1),
@@ -1010,6 +1016,8 @@ struct ib_device {
1010 int (*query_port)(struct ib_device *device, 1016 int (*query_port)(struct ib_device *device,
1011 u8 port_num, 1017 u8 port_num,
1012 struct ib_port_attr *port_attr); 1018 struct ib_port_attr *port_attr);
1019 enum rdma_link_layer (*get_link_layer)(struct ib_device *device,
1020 u8 port_num);
1013 int (*query_gid)(struct ib_device *device, 1021 int (*query_gid)(struct ib_device *device,
1014 u8 port_num, int index, 1022 u8 port_num, int index,
1015 union ib_gid *gid); 1023 union ib_gid *gid);
@@ -1222,6 +1230,9 @@ int ib_query_device(struct ib_device *device,
1222int ib_query_port(struct ib_device *device, 1230int ib_query_port(struct ib_device *device,
1223 u8 port_num, struct ib_port_attr *port_attr); 1231 u8 port_num, struct ib_port_attr *port_attr);
1224 1232
1233enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device,
1234 u8 port_num);
1235
1225int ib_query_gid(struct ib_device *device, 1236int ib_query_gid(struct ib_device *device,
1226 u8 port_num, int index, union ib_gid *gid); 1237 u8 port_num, int index, union ib_gid *gid);
1227 1238
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 14be49b44e8..f986ab7ffe6 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -721,7 +721,7 @@ struct libfc_function_template {
721 * struct fc_disc - Discovery context 721 * struct fc_disc - Discovery context
722 * @retry_count: Number of retries 722 * @retry_count: Number of retries
723 * @pending: 1 if discovery is pending, 0 if not 723 * @pending: 1 if discovery is pending, 0 if not
724 * @requesting: 1 if discovery has been requested, 0 if not 724 * @requested: 1 if discovery has been requested, 0 if not
725 * @seq_count: Number of sequences used for discovery 725 * @seq_count: Number of sequences used for discovery
726 * @buf_len: Length of the discovery buffer 726 * @buf_len: Length of the discovery buffer
727 * @disc_id: Discovery ID 727 * @disc_id: Discovery ID
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h
index a8f37012663..53a9e886612 100644
--- a/include/scsi/osd_initiator.h
+++ b/include/scsi/osd_initiator.h
@@ -137,7 +137,7 @@ struct osd_request {
137 void *buff; 137 void *buff;
138 unsigned alloc_size; /* 0 here means: don't call kfree */ 138 unsigned alloc_size; /* 0 here means: don't call kfree */
139 unsigned total_bytes; 139 unsigned total_bytes;
140 } set_attr, enc_get_attr, get_attr; 140 } cdb_cont, set_attr, enc_get_attr, get_attr;
141 141
142 struct _osd_io_info { 142 struct _osd_io_info {
143 struct bio *bio; 143 struct bio *bio;
@@ -448,6 +448,20 @@ void osd_req_read(struct osd_request *or,
448int osd_req_read_kern(struct osd_request *or, 448int osd_req_read_kern(struct osd_request *or,
449 const struct osd_obj_id *obj, u64 offset, void *buff, u64 len); 449 const struct osd_obj_id *obj, u64 offset, void *buff, u64 len);
450 450
451/* Scatter/Gather write/read commands */
452int osd_req_write_sg(struct osd_request *or,
453 const struct osd_obj_id *obj, struct bio *bio,
454 const struct osd_sg_entry *sglist, unsigned numentries);
455int osd_req_read_sg(struct osd_request *or,
456 const struct osd_obj_id *obj, struct bio *bio,
457 const struct osd_sg_entry *sglist, unsigned numentries);
458int osd_req_write_sg_kern(struct osd_request *or,
459 const struct osd_obj_id *obj, void **buff,
460 const struct osd_sg_entry *sglist, unsigned numentries);
461int osd_req_read_sg_kern(struct osd_request *or,
462 const struct osd_obj_id *obj, void **buff,
463 const struct osd_sg_entry *sglist, unsigned numentries);
464
451/* 465/*
452 * Root/Partition/Collection/Object Attributes commands 466 * Root/Partition/Collection/Object Attributes commands
453 */ 467 */
diff --git a/include/scsi/osd_protocol.h b/include/scsi/osd_protocol.h
index 68566128354..a6026da25f3 100644
--- a/include/scsi/osd_protocol.h
+++ b/include/scsi/osd_protocol.h
@@ -631,4 +631,46 @@ static inline void osd_sec_set_caps(struct osd_capability_head *cap,
631 put_unaligned_le16(bit_mask, &cap->permissions_bit_mask); 631 put_unaligned_le16(bit_mask, &cap->permissions_bit_mask);
632} 632}
633 633
634/* osd2r05a sec 5.3: CDB continuation segment formats */
635enum osd_continuation_segment_format {
636 CDB_CONTINUATION_FORMAT_V2 = 0x01,
637};
638
639struct osd_continuation_segment_header {
640 u8 format;
641 u8 reserved1;
642 __be16 service_action;
643 __be32 reserved2;
644 u8 integrity_check[OSDv2_CRYPTO_KEYID_SIZE];
645} __packed;
646
647/* osd2r05a sec 5.4.1: CDB continuation descriptors */
648enum osd_continuation_descriptor_type {
649 NO_MORE_DESCRIPTORS = 0x0000,
650 SCATTER_GATHER_LIST = 0x0001,
651 QUERY_LIST = 0x0002,
652 USER_OBJECT = 0x0003,
653 COPY_USER_OBJECT_SOURCE = 0x0101,
654 EXTENSION_CAPABILITIES = 0xFFEE
655};
656
657struct osd_continuation_descriptor_header {
658 __be16 type;
659 u8 reserved;
660 u8 pad_length;
661 __be32 length;
662} __packed;
663
664
665/* osd2r05a sec 5.4.2: Scatter/gather list */
666struct osd_sg_list_entry {
667 __be64 offset;
668 __be64 len;
669};
670
671struct osd_sg_continuation_descriptor {
672 struct osd_continuation_descriptor_header hdr;
673 struct osd_sg_list_entry entries[];
674};
675
634#endif /* ndef __OSD_PROTOCOL_H__ */ 676#endif /* ndef __OSD_PROTOCOL_H__ */
diff --git a/include/scsi/osd_types.h b/include/scsi/osd_types.h
index 3f5e88cc75c..bd0be7ed4bc 100644
--- a/include/scsi/osd_types.h
+++ b/include/scsi/osd_types.h
@@ -37,4 +37,9 @@ struct osd_attr {
37 void *val_ptr; /* in network order */ 37 void *val_ptr; /* in network order */
38}; 38};
39 39
40struct osd_sg_entry {
41 u64 offset;
42 u64 len;
43};
44
40#endif /* ndef __OSD_TYPES_H__ */ 45#endif /* ndef __OSD_TYPES_H__ */
diff --git a/include/scsi/srp.h b/include/scsi/srp.h
index ad178fa78f6..1ae84db4c9f 100644
--- a/include/scsi/srp.h
+++ b/include/scsi/srp.h
@@ -239,4 +239,42 @@ struct srp_rsp {
239 u8 data[0]; 239 u8 data[0];
240} __attribute__((packed)); 240} __attribute__((packed));
241 241
242struct srp_cred_req {
243 u8 opcode;
244 u8 sol_not;
245 u8 reserved[2];
246 __be32 req_lim_delta;
247 u64 tag;
248};
249
250struct srp_cred_rsp {
251 u8 opcode;
252 u8 reserved[7];
253 u64 tag;
254};
255
256/*
257 * The SRP spec defines the fixed portion of the AER_REQ structure to be
258 * 36 bytes, so it needs to be packed to avoid having it padded to 40 bytes
259 * on 64-bit architectures.
260 */
261struct srp_aer_req {
262 u8 opcode;
263 u8 sol_not;
264 u8 reserved[2];
265 __be32 req_lim_delta;
266 u64 tag;
267 u32 reserved2;
268 __be64 lun;
269 __be32 sense_data_len;
270 u32 reserved3;
271 u8 sense_data[0];
272} __attribute__((packed));
273
274struct srp_aer_rsp {
275 u8 opcode;
276 u8 reserved[7];
277 u64 tag;
278};
279
242#endif /* SCSI_SRP_H */ 280#endif /* SCSI_SRP_H */
diff --git a/include/sound/core.h b/include/sound/core.h
index df26ebbfa9c..1fa2407c966 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -177,7 +177,7 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state);
177#define snd_power_lock(card) do { (void)(card); } while (0) 177#define snd_power_lock(card) do { (void)(card); } while (0)
178#define snd_power_unlock(card) do { (void)(card); } while (0) 178#define snd_power_unlock(card) do { (void)(card); } while (0)
179static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; } 179static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; }
180#define snd_power_get_state(card) SNDRV_CTL_POWER_D0 180#define snd_power_get_state(card) ({ (void)(card); SNDRV_CTL_POWER_D0; })
181#define snd_power_change_state(card, state) do { (void)(card); } while (0) 181#define snd_power_change_state(card, state) do { (void)(card); } while (0)
182 182
183#endif /* CONFIG_PM */ 183#endif /* CONFIG_PM */
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 7dc97d12253..4f865df42f0 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -438,6 +438,8 @@
438#define CCCA_CURRADDR_MASK 0x00ffffff /* Current address of the selected channel */ 438#define CCCA_CURRADDR_MASK 0x00ffffff /* Current address of the selected channel */
439#define CCCA_CURRADDR 0x18000008 439#define CCCA_CURRADDR 0x18000008
440 440
441/* undefine CCR to avoid conflict with the definition for SH */
442#undef CCR
441#define CCR 0x09 /* Cache control register */ 443#define CCR 0x09 /* Cache control register */
442#define CCR_CACHEINVALIDSIZE 0x07190009 444#define CCR_CACHEINVALIDSIZE 0x07190009
443#define CCR_CACHEINVALIDSIZE_MASK 0xfe000000 /* Number of invalid samples cache for this channel */ 445#define CCR_CACHEINVALIDSIZE_MASK 0xfe000000 /* Number of invalid samples cache for this channel */
diff --git a/include/sound/jack.h b/include/sound/jack.h
index d90b9fa3270..c140fc7cbd3 100644
--- a/include/sound/jack.h
+++ b/include/sound/jack.h
@@ -47,6 +47,9 @@ enum snd_jack_types {
47 SND_JACK_BTN_0 = 0x4000, 47 SND_JACK_BTN_0 = 0x4000,
48 SND_JACK_BTN_1 = 0x2000, 48 SND_JACK_BTN_1 = 0x2000,
49 SND_JACK_BTN_2 = 0x1000, 49 SND_JACK_BTN_2 = 0x1000,
50 SND_JACK_BTN_3 = 0x0800,
51 SND_JACK_BTN_4 = 0x0400,
52 SND_JACK_BTN_5 = 0x0200,
50}; 53};
51 54
52struct snd_jack { 55struct snd_jack {
@@ -55,7 +58,7 @@ struct snd_jack {
55 int type; 58 int type;
56 const char *id; 59 const char *id;
57 char name[100]; 60 char name[100];
58 unsigned int key[3]; /* Keep in sync with definitions above */ 61 unsigned int key[6]; /* Keep in sync with definitions above */
59 void *private_data; 62 void *private_data;
60 void (*private_free)(struct snd_jack *); 63 void (*private_free)(struct snd_jack *);
61}; 64};
diff --git a/include/sound/max98088.h b/include/sound/max98088.h
new file mode 100644
index 00000000000..c3ba8239182
--- /dev/null
+++ b/include/sound/max98088.h
@@ -0,0 +1,50 @@
1/*
2 * Platform data for MAX98088
3 *
4 * Copyright 2010 Maxim Integrated Products
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#ifndef __SOUND_MAX98088_PDATA_H__
14#define __SOUND_MAX98088_PDATA_H__
15
16/* Equalizer filter response configuration */
17struct max98088_eq_cfg {
18 const char *name;
19 unsigned int rate;
20 u16 band1[5];
21 u16 band2[5];
22 u16 band3[5];
23 u16 band4[5];
24 u16 band5[5];
25};
26
27/* codec platform data */
28struct max98088_pdata {
29
30 /* Equalizers for DAI1 and DAI2 */
31 struct max98088_eq_cfg *eq_cfg;
32 unsigned int eq_cfgcnt;
33
34 /* Receiver output can be configured as power amplifier or LINE out */
35 /* Set receiver_mode to:
36 * 0 = amplifier output, or
37 * 1 = LINE level output
38 */
39 unsigned int receiver_mode:1;
40
41 /* Analog/digital microphone configuration:
42 * 0 = analog microphone input (normal setting)
43 * 1 = digital microphone input
44 */
45 unsigned int digmic_left_mode:1;
46 unsigned int digmic_right_mode:1;
47
48};
49
50#endif
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 85f1c6bf856..dfd9b76b185 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -278,6 +278,7 @@ struct snd_pcm_runtime {
278 snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ 278 snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */
279 snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ 279 snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */
280 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ 280 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */
281 unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */
281 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ 282 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */
282 283
283 /* -- HW params -- */ 284 /* -- HW params -- */
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index 9d51d6f3589..fa60cbda90a 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -114,7 +114,4 @@ struct sh_fsi_platform_info {
114 int (*set_rate)(int is_porta, int rate); /* for master mode */ 114 int (*set_rate)(int is_porta, int rate); /* for master mode */
115}; 115};
116 116
117extern struct snd_soc_dai fsi_soc_dai[2];
118extern struct snd_soc_platform fsi_soc_platform;
119
120#endif /* __SOUND_FSI_H */ 117#endif /* __SOUND_FSI_H */
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 377693a1438..e7b68024800 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -91,15 +91,17 @@ struct snd_pcm_substream;
91 SNDRV_PCM_FMTBIT_S32_LE |\ 91 SNDRV_PCM_FMTBIT_S32_LE |\
92 SNDRV_PCM_FMTBIT_S32_BE) 92 SNDRV_PCM_FMTBIT_S32_BE)
93 93
94struct snd_soc_dai_ops; 94struct snd_soc_dai_driver;
95struct snd_soc_dai; 95struct snd_soc_dai;
96struct snd_ac97_bus_ops; 96struct snd_ac97_bus_ops;
97 97
98/* Digital Audio Interface registration */ 98/* Digital Audio Interface registration */
99int snd_soc_register_dai(struct snd_soc_dai *dai); 99int snd_soc_register_dai(struct device *dev,
100void snd_soc_unregister_dai(struct snd_soc_dai *dai); 100 struct snd_soc_dai_driver *dai_drv);
101int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count); 101void snd_soc_unregister_dai(struct device *dev);
102void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count); 102int snd_soc_register_dais(struct device *dev,
103 struct snd_soc_dai_driver *dai_drv, size_t count);
104void snd_soc_unregister_dais(struct device *dev, size_t count);
103 105
104/* Digital Audio Interface clocking API.*/ 106/* Digital Audio Interface clocking API.*/
105int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, 107int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,
@@ -126,16 +128,6 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
126/* Digital Audio Interface mute */ 128/* Digital Audio Interface mute */
127int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); 129int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute);
128 130
129/*
130 * Digital Audio Interface.
131 *
132 * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97
133 * operations and capabilities. Codec and platform drivers will register this
134 * structure for every DAI they have.
135 *
136 * This structure covers the clocking, formating and ALSA operations for each
137 * interface.
138 */
139struct snd_soc_dai_ops { 131struct snd_soc_dai_ops {
140 /* 132 /*
141 * DAI clocking configuration, all optional. 133 * DAI clocking configuration, all optional.
@@ -191,24 +183,24 @@ struct snd_soc_dai_ops {
191}; 183};
192 184
193/* 185/*
194 * Digital Audio Interface runtime data. 186 * Digital Audio Interface Driver.
195 * 187 *
196 * Holds runtime data for a DAI. 188 * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97
189 * operations and capabilities. Codec and platform drivers will register this
190 * structure for every DAI they have.
191 *
192 * This structure covers the clocking, formating and ALSA operations for each
193 * interface.
197 */ 194 */
198struct snd_soc_dai { 195struct snd_soc_dai_driver {
199 /* DAI description */ 196 /* DAI description */
200 char *name; 197 const char *name;
201 unsigned int id; 198 unsigned int id;
202 int ac97_control; 199 int ac97_control;
203 200
204 struct device *dev; 201 /* DAI driver callbacks */
205 void *ac97_pdata; /* platform_data for the ac97 codec */ 202 int (*probe)(struct snd_soc_dai *dai);
206 203 int (*remove)(struct snd_soc_dai *dai);
207 /* DAI callbacks */
208 int (*probe)(struct platform_device *pdev,
209 struct snd_soc_dai *dai);
210 void (*remove)(struct platform_device *pdev,
211 struct snd_soc_dai *dai);
212 int (*suspend)(struct snd_soc_dai *dai); 204 int (*suspend)(struct snd_soc_dai *dai);
213 int (*resume)(struct snd_soc_dai *dai); 205 int (*resume)(struct snd_soc_dai *dai);
214 206
@@ -219,26 +211,51 @@ struct snd_soc_dai {
219 struct snd_soc_pcm_stream capture; 211 struct snd_soc_pcm_stream capture;
220 struct snd_soc_pcm_stream playback; 212 struct snd_soc_pcm_stream playback;
221 unsigned int symmetric_rates:1; 213 unsigned int symmetric_rates:1;
214};
215
216/*
217 * Digital Audio Interface runtime data.
218 *
219 * Holds runtime data for a DAI.
220 */
221struct snd_soc_dai {
222 const char *name;
223 int id;
224 struct device *dev;
225 void *ac97_pdata; /* platform_data for the ac97 codec */
226
227 /* driver ops */
228 struct snd_soc_dai_driver *driver;
222 229
223 /* DAI runtime info */ 230 /* DAI runtime info */
224 struct snd_soc_codec *codec; 231 unsigned int capture_active:1; /* stream is in use */
232 unsigned int playback_active:1; /* stream is in use */
233 unsigned int symmetric_rates:1;
234 struct snd_pcm_runtime *runtime;
225 unsigned int active; 235 unsigned int active;
226 unsigned char pop_wait:1; 236 unsigned char pop_wait:1;
237 unsigned char probed:1;
227 238
228 /* DAI private data */ 239 /* DAI DMA data */
229 void *private_data; 240 void *playback_dma_data;
241 void *capture_dma_data;
230 242
231 /* parent platform */ 243 /* parent platform/codec */
232 struct snd_soc_platform *platform; 244 union {
245 struct snd_soc_platform *platform;
246 struct snd_soc_codec *codec;
247 };
248 struct snd_soc_card *card;
233 249
234 struct list_head list; 250 struct list_head list;
251 struct list_head card_list;
235}; 252};
236 253
237static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, 254static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
238 const struct snd_pcm_substream *ss) 255 const struct snd_pcm_substream *ss)
239{ 256{
240 return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 257 return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
241 dai->playback.dma_data : dai->capture.dma_data; 258 dai->playback_dma_data : dai->capture_dma_data;
242} 259}
243 260
244static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, 261static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
@@ -246,9 +263,20 @@ static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
246 void *data) 263 void *data)
247{ 264{
248 if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) 265 if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
249 dai->playback.dma_data = data; 266 dai->playback_dma_data = data;
250 else 267 else
251 dai->capture.dma_data = data; 268 dai->capture_dma_data = data;
269}
270
271static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai,
272 void *data)
273{
274 dev_set_drvdata(dai->dev, data);
275}
276
277static inline void *snd_soc_dai_get_drvdata(struct snd_soc_dai *dai)
278{
279 return dev_get_drvdata(dai->dev);
252} 280}
253 281
254#endif 282#endif
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index c5d9987bc89..8fd3b41b763 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -172,9 +172,19 @@
172#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ 172#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \
173{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 173{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
174 .reg = wreg, .shift = wshift, .invert = winvert } 174 .reg = wreg, .shift = wshift, .invert = winvert }
175#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \
176 wevent, wflags) \
177{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
178 .reg = wreg, .shift = wshift, .invert = winvert, \
179 .event = wevent, .event_flags = wflags }
175#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ 180#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \
176{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 181{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
177 .reg = wreg, .shift = wshift, .invert = winvert } 182 .reg = wreg, .shift = wshift, .invert = winvert }
183#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \
184 wevent, wflags) \
185{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
186 .reg = wreg, .shift = wshift, .invert = winvert, \
187 .event = wevent, .event_flags = wflags }
178#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 188#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
179{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 189{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \
180 .shift = wshift, .invert = winvert} 190 .shift = wshift, .invert = winvert}
@@ -322,14 +332,14 @@ int snd_soc_dapm_new_controls(struct snd_soc_codec *codec,
322 332
323/* dapm path setup */ 333/* dapm path setup */
324int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); 334int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec);
325void snd_soc_dapm_free(struct snd_soc_device *socdev); 335void snd_soc_dapm_free(struct snd_soc_codec *codec);
326int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, 336int snd_soc_dapm_add_routes(struct snd_soc_codec *codec,
327 const struct snd_soc_dapm_route *route, int num); 337 const struct snd_soc_dapm_route *route, int num);
328 338
329/* dapm events */ 339/* dapm events */
330int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, 340int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
331 int event); 341 const char *stream, int event);
332void snd_soc_dapm_shutdown(struct snd_soc_device *socdev); 342void snd_soc_dapm_shutdown(struct snd_soc_card *card);
333 343
334/* dapm sys fs - used by the core */ 344/* dapm sys fs - used by the core */
335int snd_soc_dapm_sys_add(struct device *dev); 345int snd_soc_dapm_sys_add(struct device *dev);
diff --git a/include/sound/soc-of-simple.h b/include/sound/soc-of-simple.h
deleted file mode 100644
index a064e1934a5..00000000000
--- a/include/sound/soc-of-simple.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * OF helpers for ALSA SoC
3 *
4 * Copyright (C) 2008, Secret Lab Technologies Ltd.
5 */
6
7#ifndef _INCLUDE_SOC_OF_H_
8#define _INCLUDE_SOC_OF_H_
9
10#if defined(CONFIG_SND_SOC_OF_SIMPLE) || defined(CONFIG_SND_SOC_OF_SIMPLE_MODULE)
11
12#include <linux/of.h>
13#include <sound/soc.h>
14
15int of_snd_soc_register_codec(struct snd_soc_codec_device *codec_dev,
16 void *codec_data, struct snd_soc_dai *dai,
17 struct device_node *node);
18
19int of_snd_soc_register_platform(struct snd_soc_platform *platform,
20 struct device_node *node,
21 struct snd_soc_dai *cpu_dai);
22
23#endif
24
25#endif /* _INCLUDE_SOC_OF_H_ */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 65e9d03ed4f..5c3bce83f28 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -214,10 +214,10 @@
214 * @OFF: Power Off. No restrictions on transition times. 214 * @OFF: Power Off. No restrictions on transition times.
215 */ 215 */
216enum snd_soc_bias_level { 216enum snd_soc_bias_level {
217 SND_SOC_BIAS_ON,
218 SND_SOC_BIAS_PREPARE,
219 SND_SOC_BIAS_STANDBY,
220 SND_SOC_BIAS_OFF, 217 SND_SOC_BIAS_OFF,
218 SND_SOC_BIAS_STANDBY,
219 SND_SOC_BIAS_PREPARE,
220 SND_SOC_BIAS_ON,
221}; 221};
222 222
223struct snd_jack; 223struct snd_jack;
@@ -228,13 +228,17 @@ struct snd_soc_ops;
228struct snd_soc_dai_mode; 228struct snd_soc_dai_mode;
229struct snd_soc_pcm_runtime; 229struct snd_soc_pcm_runtime;
230struct snd_soc_dai; 230struct snd_soc_dai;
231struct snd_soc_dai_driver;
231struct snd_soc_platform; 232struct snd_soc_platform;
232struct snd_soc_dai_link; 233struct snd_soc_dai_link;
234struct snd_soc_platform_driver;
233struct snd_soc_codec; 235struct snd_soc_codec;
236struct snd_soc_codec_driver;
234struct soc_enum; 237struct soc_enum;
235struct snd_soc_ac97_ops; 238struct snd_soc_ac97_ops;
236struct snd_soc_jack; 239struct snd_soc_jack;
237struct snd_soc_jack_pin; 240struct snd_soc_jack_pin;
241
238#ifdef CONFIG_GPIOLIB 242#ifdef CONFIG_GPIOLIB
239struct snd_soc_jack_gpio; 243struct snd_soc_jack_gpio;
240#endif 244#endif
@@ -249,19 +253,18 @@ enum snd_soc_control_type {
249 SND_SOC_SPI, 253 SND_SOC_SPI,
250}; 254};
251 255
252int snd_soc_register_platform(struct snd_soc_platform *platform); 256int snd_soc_register_platform(struct device *dev,
253void snd_soc_unregister_platform(struct snd_soc_platform *platform); 257 struct snd_soc_platform_driver *platform_drv);
254int snd_soc_register_codec(struct snd_soc_codec *codec); 258void snd_soc_unregister_platform(struct device *dev);
255void snd_soc_unregister_codec(struct snd_soc_codec *codec); 259int snd_soc_register_codec(struct device *dev,
260 struct snd_soc_codec_driver *codec_drv,
261 struct snd_soc_dai_driver *dai_drv, int num_dai);
262void snd_soc_unregister_codec(struct device *dev);
256int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); 263int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg);
257int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, 264int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
258 int addr_bits, int data_bits, 265 int addr_bits, int data_bits,
259 enum snd_soc_control_type control); 266 enum snd_soc_control_type control);
260 267
261/* pcm <-> DAI connect */
262void snd_soc_free_pcms(struct snd_soc_device *socdev);
263int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid);
264
265/* Utility functions to get clock rates from various things */ 268/* Utility functions to get clock rates from various things */
266int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 269int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
267int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); 270int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
@@ -273,7 +276,7 @@ int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
273 const struct snd_pcm_hardware *hw); 276 const struct snd_pcm_hardware *hw);
274 277
275/* Jack reporting */ 278/* Jack reporting */
276int snd_soc_jack_new(struct snd_soc_card *card, const char *id, int type, 279int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type,
277 struct snd_soc_jack *jack); 280 struct snd_soc_jack *jack);
278void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); 281void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);
279int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, 282int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
@@ -382,7 +385,7 @@ struct snd_soc_jack_gpio {
382 int invert; 385 int invert;
383 int debounce_time; 386 int debounce_time;
384 struct snd_soc_jack *jack; 387 struct snd_soc_jack *jack;
385 struct work_struct work; 388 struct delayed_work work;
386 389
387 int (*jack_status_check)(void); 390 int (*jack_status_check)(void);
388}; 391};
@@ -390,7 +393,7 @@ struct snd_soc_jack_gpio {
390 393
391struct snd_soc_jack { 394struct snd_soc_jack {
392 struct snd_jack *jack; 395 struct snd_jack *jack;
393 struct snd_soc_card *card; 396 struct snd_soc_codec *codec;
394 struct list_head pins; 397 struct list_head pins;
395 int status; 398 int status;
396 struct blocking_notifier_head notifier; 399 struct blocking_notifier_head notifier;
@@ -398,15 +401,13 @@ struct snd_soc_jack {
398 401
399/* SoC PCM stream information */ 402/* SoC PCM stream information */
400struct snd_soc_pcm_stream { 403struct snd_soc_pcm_stream {
401 char *stream_name; 404 const char *stream_name;
402 u64 formats; /* SNDRV_PCM_FMTBIT_* */ 405 u64 formats; /* SNDRV_PCM_FMTBIT_* */
403 unsigned int rates; /* SNDRV_PCM_RATE_* */ 406 unsigned int rates; /* SNDRV_PCM_RATE_* */
404 unsigned int rate_min; /* min rate */ 407 unsigned int rate_min; /* min rate */
405 unsigned int rate_max; /* max rate */ 408 unsigned int rate_max; /* max rate */
406 unsigned int channels_min; /* min channels */ 409 unsigned int channels_min; /* min channels */
407 unsigned int channels_max; /* max channels */ 410 unsigned int channels_max; /* max channels */
408 unsigned int active; /* stream is in use */
409 void *dma_data; /* used by platform code */
410}; 411};
411 412
412/* SoC audio ops */ 413/* SoC audio ops */
@@ -419,44 +420,36 @@ struct snd_soc_ops {
419 int (*trigger)(struct snd_pcm_substream *, int); 420 int (*trigger)(struct snd_pcm_substream *, int);
420}; 421};
421 422
422/* SoC Audio Codec */ 423/* SoC Audio Codec device */
423struct snd_soc_codec { 424struct snd_soc_codec {
424 char *name; 425 const char *name;
425 struct module *owner; 426 int id;
426 struct mutex mutex;
427 struct device *dev; 427 struct device *dev;
428 struct snd_soc_device *socdev; 428 struct snd_soc_codec_driver *driver;
429 429
430 struct mutex mutex;
431 struct snd_soc_card *card;
430 struct list_head list; 432 struct list_head list;
431 433 struct list_head card_list;
432 /* callbacks */ 434 int num_dai;
433 int (*set_bias_level)(struct snd_soc_codec *,
434 enum snd_soc_bias_level level);
435 435
436 /* runtime */ 436 /* runtime */
437 struct snd_card *card;
438 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 437 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
439 unsigned int active; 438 unsigned int active;
440 unsigned int pcm_devs; 439 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
441 void *drvdata; 440 unsigned int cache_only:1; /* Suppress writes to hardware */
441 unsigned int cache_sync:1; /* Cache needs to be synced to hardware */
442 unsigned int suspended:1; /* Codec is in suspend PM state */
443 unsigned int probed:1; /* Codec has been probed */
444 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
445 unsigned int ac97_created:1; /* Codec has been created by SoC */
446 unsigned int sysfs_registered:1; /* codec has been sysfs registered */
442 447
443 /* codec IO */ 448 /* codec IO */
444 void *control_data; /* codec control (i2c/3wire) data */ 449 void *control_data; /* codec control (i2c/3wire) data */
445 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
446 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
447 int (*display_register)(struct snd_soc_codec *, char *,
448 size_t, unsigned int);
449 int (*volatile_register)(unsigned int);
450 int (*readable_register)(unsigned int);
451 hw_write_t hw_write; 450 hw_write_t hw_write;
452 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); 451 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
453 void *reg_cache; 452 void *reg_cache;
454 short reg_cache_size;
455 short reg_cache_step;
456
457 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
458 unsigned int cache_only:1; /* Suppress writes to hardware */
459 unsigned int cache_sync:1; /* Cache needs to be synced to hardware */
460 453
461 /* dapm */ 454 /* dapm */
462 u32 pop_time; 455 u32 pop_time;
@@ -466,10 +459,6 @@ struct snd_soc_codec {
466 enum snd_soc_bias_level suspend_bias_level; 459 enum snd_soc_bias_level suspend_bias_level;
467 struct delayed_work delayed_work; 460 struct delayed_work delayed_work;
468 461
469 /* codec DAI's */
470 struct snd_soc_dai *dai;
471 unsigned int num_dai;
472
473#ifdef CONFIG_DEBUG_FS 462#ifdef CONFIG_DEBUG_FS
474 struct dentry *debugfs_codec_root; 463 struct dentry *debugfs_codec_root;
475 struct dentry *debugfs_reg; 464 struct dentry *debugfs_reg;
@@ -478,23 +467,40 @@ struct snd_soc_codec {
478#endif 467#endif
479}; 468};
480 469
481/* codec device */ 470/* codec driver */
482struct snd_soc_codec_device { 471struct snd_soc_codec_driver {
483 int (*probe)(struct platform_device *pdev); 472
484 int (*remove)(struct platform_device *pdev); 473 /* driver ops */
485 int (*suspend)(struct platform_device *pdev, pm_message_t state); 474 int (*probe)(struct snd_soc_codec *);
486 int (*resume)(struct platform_device *pdev); 475 int (*remove)(struct snd_soc_codec *);
476 int (*suspend)(struct snd_soc_codec *,
477 pm_message_t state);
478 int (*resume)(struct snd_soc_codec *);
479
480 /* codec IO */
481 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
482 int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
483 int (*display_register)(struct snd_soc_codec *, char *,
484 size_t, unsigned int);
485 int (*volatile_register)(unsigned int);
486 int (*readable_register)(unsigned int);
487 short reg_cache_size;
488 short reg_cache_step;
489 short reg_word_size;
490 const void *reg_cache_default;
491
492 /* codec bias level */
493 int (*set_bias_level)(struct snd_soc_codec *,
494 enum snd_soc_bias_level level);
487}; 495};
488 496
489/* SoC platform interface */ 497/* SoC platform interface */
490struct snd_soc_platform { 498struct snd_soc_platform_driver {
491 char *name;
492 struct list_head list;
493 499
494 int (*probe)(struct platform_device *pdev); 500 int (*probe)(struct snd_soc_platform *);
495 int (*remove)(struct platform_device *pdev); 501 int (*remove)(struct snd_soc_platform *);
496 int (*suspend)(struct snd_soc_dai_link *dai_link); 502 int (*suspend)(struct snd_soc_dai *dai);
497 int (*resume)(struct snd_soc_dai_link *dai_link); 503 int (*resume)(struct snd_soc_dai *dai);
498 504
499 /* pcm creation and destruction */ 505 /* pcm creation and destruction */
500 int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, 506 int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
@@ -509,23 +515,31 @@ struct snd_soc_platform {
509 struct snd_soc_dai *); 515 struct snd_soc_dai *);
510 516
511 /* platform stream ops */ 517 /* platform stream ops */
512 struct snd_pcm_ops *pcm_ops; 518 struct snd_pcm_ops *ops;
513}; 519};
514 520
515/* SoC machine DAI configuration, glues a codec and cpu DAI together */ 521struct snd_soc_platform {
516struct snd_soc_dai_link { 522 const char *name;
517 char *name; /* Codec name */ 523 int id;
518 char *stream_name; /* Stream name */ 524 struct device *dev;
525 struct snd_soc_platform_driver *driver;
519 526
520 /* DAI */ 527 unsigned int suspended:1; /* platform is suspended */
521 struct snd_soc_dai *codec_dai; 528 unsigned int probed:1;
522 struct snd_soc_dai *cpu_dai;
523 529
524 /* machine stream operations */ 530 struct snd_soc_card *card;
525 struct snd_soc_ops *ops; 531 struct list_head list;
532 struct list_head card_list;
533};
526 534
527 /* codec/machine specific init - e.g. add machine controls */ 535struct snd_soc_dai_link {
528 int (*init)(struct snd_soc_codec *codec); 536 /* config - must be set by machine driver */
537 const char *name; /* Codec name */
538 const char *stream_name; /* Stream name */
539 const char *codec_name; /* for multi-codec */
540 const char *platform_name; /* for multi-platform */
541 const char *cpu_dai_name;
542 const char *codec_dai_name;
529 543
530 /* Keep DAI active over suspend */ 544 /* Keep DAI active over suspend */
531 unsigned int ignore_suspend:1; 545 unsigned int ignore_suspend:1;
@@ -533,21 +547,24 @@ struct snd_soc_dai_link {
533 /* Symmetry requirements */ 547 /* Symmetry requirements */
534 unsigned int symmetric_rates:1; 548 unsigned int symmetric_rates:1;
535 549
536 /* Symmetry data - only valid if symmetry is being enforced */ 550 /* codec/machine specific init - e.g. add machine controls */
537 unsigned int rate; 551 int (*init)(struct snd_soc_pcm_runtime *rtd);
538 552
539 /* DAI pcm */ 553 /* machine stream operations */
540 struct snd_pcm *pcm; 554 struct snd_soc_ops *ops;
541}; 555};
542 556
543/* SoC card */ 557/* SoC card */
544struct snd_soc_card { 558struct snd_soc_card {
545 char *name; 559 const char *name;
546 struct device *dev; 560 struct device *dev;
561 struct snd_card *snd_card;
562 struct module *owner;
547 563
548 struct list_head list; 564 struct list_head list;
565 struct mutex mutex;
549 566
550 int instantiated; 567 bool instantiated;
551 568
552 int (*probe)(struct platform_device *pdev); 569 int (*probe)(struct platform_device *pdev);
553 int (*remove)(struct platform_device *pdev); 570 int (*remove)(struct platform_device *pdev);
@@ -568,28 +585,38 @@ struct snd_soc_card {
568 /* CPU <--> Codec DAI links */ 585 /* CPU <--> Codec DAI links */
569 struct snd_soc_dai_link *dai_link; 586 struct snd_soc_dai_link *dai_link;
570 int num_links; 587 int num_links;
588 struct snd_soc_pcm_runtime *rtd;
589 int num_rtd;
571 590
572 struct snd_soc_device *socdev;
573
574 struct snd_soc_codec *codec;
575
576 struct snd_soc_platform *platform;
577 struct delayed_work delayed_work;
578 struct work_struct deferred_resume_work; 591 struct work_struct deferred_resume_work;
592
593 /* lists of probed devices belonging to this card */
594 struct list_head codec_dev_list;
595 struct list_head platform_dev_list;
596 struct list_head dai_dev_list;
579}; 597};
580 598
581/* SoC Device - the audio subsystem */ 599/* SoC machine DAI configuration, glues a codec and cpu DAI together */
582struct snd_soc_device { 600struct snd_soc_pcm_runtime {
583 struct device *dev; 601 struct device dev;
584 struct snd_soc_card *card; 602 struct snd_soc_card *card;
585 struct snd_soc_codec_device *codec_dev; 603 struct snd_soc_dai_link *dai_link;
586 void *codec_data; 604
587}; 605 unsigned int complete:1;
606 unsigned int dev_registered:1;
607
608 /* Symmetry data - only valid if symmetry is being enforced */
609 unsigned int rate;
610 long pmdown_time;
588 611
589/* runtime channel data */ 612 /* runtime devices */
590struct snd_soc_pcm_runtime { 613 struct snd_pcm *pcm;
591 struct snd_soc_dai_link *dai; 614 struct snd_soc_codec *codec;
592 struct snd_soc_device *socdev; 615 struct snd_soc_platform *platform;
616 struct snd_soc_dai *codec_dai;
617 struct snd_soc_dai *cpu_dai;
618
619 struct delayed_work delayed_work;
593}; 620};
594 621
595/* mixer control */ 622/* mixer control */
@@ -615,24 +642,48 @@ struct soc_enum {
615static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, 642static inline unsigned int snd_soc_read(struct snd_soc_codec *codec,
616 unsigned int reg) 643 unsigned int reg)
617{ 644{
618 return codec->read(codec, reg); 645 return codec->driver->read(codec, reg);
619} 646}
620 647
621static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, 648static inline unsigned int snd_soc_write(struct snd_soc_codec *codec,
622 unsigned int reg, unsigned int val) 649 unsigned int reg, unsigned int val)
623{ 650{
624 return codec->write(codec, reg, val); 651 return codec->driver->write(codec, reg, val);
625} 652}
626 653
654/* device driver data */
655
627static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec, 656static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
628 void *data) 657 void *data)
629{ 658{
630 codec->drvdata = data; 659 dev_set_drvdata(codec->dev, data);
631} 660}
632 661
633static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec) 662static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec)
634{ 663{
635 return codec->drvdata; 664 return dev_get_drvdata(codec->dev);
665}
666
667static inline void snd_soc_platform_set_drvdata(struct snd_soc_platform *platform,
668 void *data)
669{
670 dev_set_drvdata(platform->dev, data);
671}
672
673static inline void *snd_soc_platform_get_drvdata(struct snd_soc_platform *platform)
674{
675 return dev_get_drvdata(platform->dev);
676}
677
678static inline void snd_soc_pcm_set_drvdata(struct snd_soc_pcm_runtime *rtd,
679 void *data)
680{
681 dev_set_drvdata(&rtd->dev, data);
682}
683
684static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
685{
686 return dev_get_drvdata(&rtd->dev);
636} 687}
637 688
638#include <sound/soc-dai.h> 689#include <sound/soc-dai.h>
diff --git a/include/sound/tlv.h b/include/sound/tlv.h
index 9fd5b19ccf5..7067e2dfb0b 100644
--- a/include/sound/tlv.h
+++ b/include/sound/tlv.h
@@ -38,9 +38,11 @@
38#define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ 38#define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */
39#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ 39#define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */
40 40
41#define TLV_DB_SCALE_MASK 0xffff
42#define TLV_DB_SCALE_MUTE 0x10000
41#define TLV_DB_SCALE_ITEM(min, step, mute) \ 43#define TLV_DB_SCALE_ITEM(min, step, mute) \
42 SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ 44 SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \
43 (min), ((step) & 0xffff) | ((mute) ? 0x10000 : 0) 45 (min), ((step) & TLV_DB_SCALE_MASK) | ((mute) ? TLV_DB_SCALE_MUTE : 0)
44#define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ 46#define DECLARE_TLV_DB_SCALE(name, min, step, mute) \
45 unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } 47 unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) }
46 48
diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h
index b1a5f34e5cf..99e0308bf2c 100644
--- a/include/sound/tlv320aic3x.h
+++ b/include/sound/tlv320aic3x.h
@@ -10,8 +10,49 @@
10#ifndef __TLV320AIC3x_H__ 10#ifndef __TLV320AIC3x_H__
11#define __TLV320AIC3x_H__ 11#define __TLV320AIC3x_H__
12 12
13/* GPIO API */
14enum {
15 AIC3X_GPIO1_FUNC_DISABLED = 0,
16 AIC3X_GPIO1_FUNC_AUDIO_WORDCLK_ADC = 1,
17 AIC3X_GPIO1_FUNC_CLOCK_MUX = 2,
18 AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV2 = 3,
19 AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV4 = 4,
20 AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV8 = 5,
21 AIC3X_GPIO1_FUNC_SHORT_CIRCUIT_IRQ = 6,
22 AIC3X_GPIO1_FUNC_AGC_NOISE_IRQ = 7,
23 AIC3X_GPIO1_FUNC_INPUT = 8,
24 AIC3X_GPIO1_FUNC_OUTPUT = 9,
25 AIC3X_GPIO1_FUNC_DIGITAL_MIC_MODCLK = 10,
26 AIC3X_GPIO1_FUNC_AUDIO_WORDCLK = 11,
27 AIC3X_GPIO1_FUNC_BUTTON_IRQ = 12,
28 AIC3X_GPIO1_FUNC_HEADSET_DETECT_IRQ = 13,
29 AIC3X_GPIO1_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 14,
30 AIC3X_GPIO1_FUNC_ALL_IRQ = 16
31};
32
33enum {
34 AIC3X_GPIO2_FUNC_DISABLED = 0,
35 AIC3X_GPIO2_FUNC_HEADSET_DETECT_IRQ = 2,
36 AIC3X_GPIO2_FUNC_INPUT = 3,
37 AIC3X_GPIO2_FUNC_OUTPUT = 4,
38 AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT = 5,
39 AIC3X_GPIO2_FUNC_AUDIO_BITCLK = 8,
40 AIC3X_GPIO2_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 9,
41 AIC3X_GPIO2_FUNC_ALL_IRQ = 10,
42 AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_OR_AGC_IRQ = 11,
43 AIC3X_GPIO2_FUNC_HEADSET_OR_BUTTON_PRESS_OR_SHORT_CIRCUIT_IRQ = 12,
44 AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_IRQ = 13,
45 AIC3X_GPIO2_FUNC_AGC_NOISE_IRQ = 14,
46 AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15
47};
48
49struct aic3x_setup_data {
50 unsigned int gpio_func[2];
51};
52
13struct aic3x_pdata { 53struct aic3x_pdata {
14 int gpio_reset; /* < 0 if not used */ 54 int gpio_reset; /* < 0 if not used */
55 struct aic3x_setup_data *setup;
15}; 56};
16 57
17#endif \ No newline at end of file 58#endif
diff --git a/include/sound/wm8962.h b/include/sound/wm8962.h
new file mode 100644
index 00000000000..2b5306c503f
--- /dev/null
+++ b/include/sound/wm8962.h
@@ -0,0 +1,32 @@
1/*
2 * wm8962.h -- WM8962 Soc Audio driver platform data
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _WM8962_PDATA_H
10#define _WM8962_PDATA_H
11
12#define WM8962_MAX_GPIO 6
13
14/* Use to set GPIO default values to zero */
15#define WM8962_GPIO_SET 0x10000
16
17struct wm8962_pdata {
18 int gpio_base;
19 u32 gpio_init[WM8962_MAX_GPIO];
20
21 /* Setup for microphone detection, raw value to be written to
22 * R48(0x30) - only microphone related bits will be updated.
23 * Detection may be enabled here for use with signals brought
24 * out on the GPIOs. */
25 u32 mic_cfg;
26
27 bool irq_active_low;
28
29 bool spk_mono; /* Speaker outputs tied together as mono */
30};
31
32#endif
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 01e9e0076a9..289010d3270 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -21,7 +21,8 @@ TRACE_EVENT(ext4_free_inode,
21 TP_ARGS(inode), 21 TP_ARGS(inode),
22 22
23 TP_STRUCT__entry( 23 TP_STRUCT__entry(
24 __field( dev_t, dev ) 24 __field( int, dev_major )
25 __field( int, dev_minor )
25 __field( ino_t, ino ) 26 __field( ino_t, ino )
26 __field( umode_t, mode ) 27 __field( umode_t, mode )
27 __field( uid_t, uid ) 28 __field( uid_t, uid )
@@ -30,7 +31,8 @@ TRACE_EVENT(ext4_free_inode,
30 ), 31 ),
31 32
32 TP_fast_assign( 33 TP_fast_assign(
33 __entry->dev = inode->i_sb->s_dev; 34 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
35 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
34 __entry->ino = inode->i_ino; 36 __entry->ino = inode->i_ino;
35 __entry->mode = inode->i_mode; 37 __entry->mode = inode->i_mode;
36 __entry->uid = inode->i_uid; 38 __entry->uid = inode->i_uid;
@@ -38,9 +40,10 @@ TRACE_EVENT(ext4_free_inode,
38 __entry->blocks = inode->i_blocks; 40 __entry->blocks = inode->i_blocks;
39 ), 41 ),
40 42
41 TP_printk("dev %s ino %lu mode 0%o uid %u gid %u blocks %llu", 43 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
42 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 44 __entry->dev_major, __entry->dev_minor,
43 __entry->mode, __entry->uid, __entry->gid, 45 (unsigned long) __entry->ino, __entry->mode,
46 __entry->uid, __entry->gid,
44 (unsigned long long) __entry->blocks) 47 (unsigned long long) __entry->blocks)
45); 48);
46 49
@@ -50,20 +53,22 @@ TRACE_EVENT(ext4_request_inode,
50 TP_ARGS(dir, mode), 53 TP_ARGS(dir, mode),
51 54
52 TP_STRUCT__entry( 55 TP_STRUCT__entry(
53 __field( dev_t, dev ) 56 __field( int, dev_major )
57 __field( int, dev_minor )
54 __field( ino_t, dir ) 58 __field( ino_t, dir )
55 __field( umode_t, mode ) 59 __field( umode_t, mode )
56 ), 60 ),
57 61
58 TP_fast_assign( 62 TP_fast_assign(
59 __entry->dev = dir->i_sb->s_dev; 63 __entry->dev_major = MAJOR(dir->i_sb->s_dev);
64 __entry->dev_minor = MINOR(dir->i_sb->s_dev);
60 __entry->dir = dir->i_ino; 65 __entry->dir = dir->i_ino;
61 __entry->mode = mode; 66 __entry->mode = mode;
62 ), 67 ),
63 68
64 TP_printk("dev %s dir %lu mode 0%o", 69 TP_printk("dev %d,%d dir %lu mode 0%o",
65 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->dir, 70 __entry->dev_major, __entry->dev_minor,
66 __entry->mode) 71 (unsigned long) __entry->dir, __entry->mode)
67); 72);
68 73
69TRACE_EVENT(ext4_allocate_inode, 74TRACE_EVENT(ext4_allocate_inode,
@@ -72,21 +77,24 @@ TRACE_EVENT(ext4_allocate_inode,
72 TP_ARGS(inode, dir, mode), 77 TP_ARGS(inode, dir, mode),
73 78
74 TP_STRUCT__entry( 79 TP_STRUCT__entry(
75 __field( dev_t, dev ) 80 __field( int, dev_major )
81 __field( int, dev_minor )
76 __field( ino_t, ino ) 82 __field( ino_t, ino )
77 __field( ino_t, dir ) 83 __field( ino_t, dir )
78 __field( umode_t, mode ) 84 __field( umode_t, mode )
79 ), 85 ),
80 86
81 TP_fast_assign( 87 TP_fast_assign(
82 __entry->dev = inode->i_sb->s_dev; 88 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
89 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
83 __entry->ino = inode->i_ino; 90 __entry->ino = inode->i_ino;
84 __entry->dir = dir->i_ino; 91 __entry->dir = dir->i_ino;
85 __entry->mode = mode; 92 __entry->mode = mode;
86 ), 93 ),
87 94
88 TP_printk("dev %s ino %lu dir %lu mode 0%o", 95 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
89 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 96 __entry->dev_major, __entry->dev_minor,
97 (unsigned long) __entry->ino,
90 (unsigned long) __entry->dir, __entry->mode) 98 (unsigned long) __entry->dir, __entry->mode)
91); 99);
92 100
@@ -98,7 +106,8 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
98 TP_ARGS(inode, pos, len, flags), 106 TP_ARGS(inode, pos, len, flags),
99 107
100 TP_STRUCT__entry( 108 TP_STRUCT__entry(
101 __field( dev_t, dev ) 109 __field( int, dev_major )
110 __field( int, dev_minor )
102 __field( ino_t, ino ) 111 __field( ino_t, ino )
103 __field( loff_t, pos ) 112 __field( loff_t, pos )
104 __field( unsigned int, len ) 113 __field( unsigned int, len )
@@ -106,15 +115,17 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
106 ), 115 ),
107 116
108 TP_fast_assign( 117 TP_fast_assign(
109 __entry->dev = inode->i_sb->s_dev; 118 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
119 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
110 __entry->ino = inode->i_ino; 120 __entry->ino = inode->i_ino;
111 __entry->pos = pos; 121 __entry->pos = pos;
112 __entry->len = len; 122 __entry->len = len;
113 __entry->flags = flags; 123 __entry->flags = flags;
114 ), 124 ),
115 125
116 TP_printk("dev %s ino %lu pos %llu len %u flags %u", 126 TP_printk("dev %d,%d ino %lu pos %llu len %u flags %u",
117 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 127 __entry->dev_major, __entry->dev_minor,
128 (unsigned long) __entry->ino,
118 __entry->pos, __entry->len, __entry->flags) 129 __entry->pos, __entry->len, __entry->flags)
119); 130);
120 131
@@ -141,7 +152,8 @@ DECLARE_EVENT_CLASS(ext4__write_end,
141 TP_ARGS(inode, pos, len, copied), 152 TP_ARGS(inode, pos, len, copied),
142 153
143 TP_STRUCT__entry( 154 TP_STRUCT__entry(
144 __field( dev_t, dev ) 155 __field( int, dev_major )
156 __field( int, dev_minor )
145 __field( ino_t, ino ) 157 __field( ino_t, ino )
146 __field( loff_t, pos ) 158 __field( loff_t, pos )
147 __field( unsigned int, len ) 159 __field( unsigned int, len )
@@ -149,16 +161,18 @@ DECLARE_EVENT_CLASS(ext4__write_end,
149 ), 161 ),
150 162
151 TP_fast_assign( 163 TP_fast_assign(
152 __entry->dev = inode->i_sb->s_dev; 164 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
165 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
153 __entry->ino = inode->i_ino; 166 __entry->ino = inode->i_ino;
154 __entry->pos = pos; 167 __entry->pos = pos;
155 __entry->len = len; 168 __entry->len = len;
156 __entry->copied = copied; 169 __entry->copied = copied;
157 ), 170 ),
158 171
159 TP_printk("dev %s ino %lu pos %llu len %u copied %u", 172 TP_printk("dev %d,%d ino %lu pos %llu len %u copied %u",
160 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 173 __entry->dev_major, __entry->dev_minor,
161 __entry->pos, __entry->len, __entry->copied) 174 (unsigned long) __entry->ino, __entry->pos,
175 __entry->len, __entry->copied)
162); 176);
163 177
164DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end, 178DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end,
@@ -199,21 +213,23 @@ TRACE_EVENT(ext4_writepage,
199 TP_ARGS(inode, page), 213 TP_ARGS(inode, page),
200 214
201 TP_STRUCT__entry( 215 TP_STRUCT__entry(
202 __field( dev_t, dev ) 216 __field( int, dev_major )
217 __field( int, dev_minor )
203 __field( ino_t, ino ) 218 __field( ino_t, ino )
204 __field( pgoff_t, index ) 219 __field( pgoff_t, index )
205 220
206 ), 221 ),
207 222
208 TP_fast_assign( 223 TP_fast_assign(
209 __entry->dev = inode->i_sb->s_dev; 224 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
225 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
210 __entry->ino = inode->i_ino; 226 __entry->ino = inode->i_ino;
211 __entry->index = page->index; 227 __entry->index = page->index;
212 ), 228 ),
213 229
214 TP_printk("dev %s ino %lu page_index %lu", 230 TP_printk("dev %d,%d ino %lu page_index %lu",
215 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 231 __entry->dev_major, __entry->dev_minor,
216 __entry->index) 232 (unsigned long) __entry->ino, __entry->index)
217); 233);
218 234
219TRACE_EVENT(ext4_da_writepages, 235TRACE_EVENT(ext4_da_writepages,
@@ -222,13 +238,13 @@ TRACE_EVENT(ext4_da_writepages,
222 TP_ARGS(inode, wbc), 238 TP_ARGS(inode, wbc),
223 239
224 TP_STRUCT__entry( 240 TP_STRUCT__entry(
225 __field( dev_t, dev ) 241 __field( int, dev_major )
242 __field( int, dev_minor )
226 __field( ino_t, ino ) 243 __field( ino_t, ino )
227 __field( long, nr_to_write ) 244 __field( long, nr_to_write )
228 __field( long, pages_skipped ) 245 __field( long, pages_skipped )
229 __field( loff_t, range_start ) 246 __field( loff_t, range_start )
230 __field( loff_t, range_end ) 247 __field( loff_t, range_end )
231 __field( char, nonblocking )
232 __field( char, for_kupdate ) 248 __field( char, for_kupdate )
233 __field( char, for_reclaim ) 249 __field( char, for_reclaim )
234 __field( char, range_cyclic ) 250 __field( char, range_cyclic )
@@ -236,24 +252,27 @@ TRACE_EVENT(ext4_da_writepages,
236 ), 252 ),
237 253
238 TP_fast_assign( 254 TP_fast_assign(
239 __entry->dev = inode->i_sb->s_dev; 255 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
256 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
240 __entry->ino = inode->i_ino; 257 __entry->ino = inode->i_ino;
241 __entry->nr_to_write = wbc->nr_to_write; 258 __entry->nr_to_write = wbc->nr_to_write;
242 __entry->pages_skipped = wbc->pages_skipped; 259 __entry->pages_skipped = wbc->pages_skipped;
243 __entry->range_start = wbc->range_start; 260 __entry->range_start = wbc->range_start;
244 __entry->range_end = wbc->range_end; 261 __entry->range_end = wbc->range_end;
245 __entry->nonblocking = wbc->nonblocking;
246 __entry->for_kupdate = wbc->for_kupdate; 262 __entry->for_kupdate = wbc->for_kupdate;
247 __entry->for_reclaim = wbc->for_reclaim; 263 __entry->for_reclaim = wbc->for_reclaim;
248 __entry->range_cyclic = wbc->range_cyclic; 264 __entry->range_cyclic = wbc->range_cyclic;
249 __entry->writeback_index = inode->i_mapping->writeback_index; 265 __entry->writeback_index = inode->i_mapping->writeback_index;
250 ), 266 ),
251 267
252 TP_printk("dev %s ino %lu nr_to_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d writeback_index %lu", 268 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
253 jbd2_dev_to_name(__entry->dev), 269 "range_start %llu range_end %llu "
270 "for_kupdate %d for_reclaim %d "
271 "range_cyclic %d writeback_index %lu",
272 __entry->dev_major, __entry->dev_minor,
254 (unsigned long) __entry->ino, __entry->nr_to_write, 273 (unsigned long) __entry->ino, __entry->nr_to_write,
255 __entry->pages_skipped, __entry->range_start, 274 __entry->pages_skipped, __entry->range_start,
256 __entry->range_end, __entry->nonblocking, 275 __entry->range_end,
257 __entry->for_kupdate, __entry->for_reclaim, 276 __entry->for_kupdate, __entry->for_reclaim,
258 __entry->range_cyclic, 277 __entry->range_cyclic,
259 (unsigned long) __entry->writeback_index) 278 (unsigned long) __entry->writeback_index)
@@ -265,7 +284,8 @@ TRACE_EVENT(ext4_da_write_pages,
265 TP_ARGS(inode, mpd), 284 TP_ARGS(inode, mpd),
266 285
267 TP_STRUCT__entry( 286 TP_STRUCT__entry(
268 __field( dev_t, dev ) 287 __field( int, dev_major )
288 __field( int, dev_minor )
269 __field( ino_t, ino ) 289 __field( ino_t, ino )
270 __field( __u64, b_blocknr ) 290 __field( __u64, b_blocknr )
271 __field( __u32, b_size ) 291 __field( __u32, b_size )
@@ -276,7 +296,8 @@ TRACE_EVENT(ext4_da_write_pages,
276 ), 296 ),
277 297
278 TP_fast_assign( 298 TP_fast_assign(
279 __entry->dev = inode->i_sb->s_dev; 299 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
300 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
280 __entry->ino = inode->i_ino; 301 __entry->ino = inode->i_ino;
281 __entry->b_blocknr = mpd->b_blocknr; 302 __entry->b_blocknr = mpd->b_blocknr;
282 __entry->b_size = mpd->b_size; 303 __entry->b_size = mpd->b_size;
@@ -286,8 +307,9 @@ TRACE_EVENT(ext4_da_write_pages,
286 __entry->pages_written = mpd->pages_written; 307 __entry->pages_written = mpd->pages_written;
287 ), 308 ),
288 309
289 TP_printk("dev %s ino %lu b_blocknr %llu b_size %u b_state 0x%04x first_page %lu io_done %d pages_written %d", 310 TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x first_page %lu io_done %d pages_written %d",
290 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 311 __entry->dev_major, __entry->dev_minor,
312 (unsigned long) __entry->ino,
291 __entry->b_blocknr, __entry->b_size, 313 __entry->b_blocknr, __entry->b_size,
292 __entry->b_state, __entry->first_page, 314 __entry->b_state, __entry->first_page,
293 __entry->io_done, __entry->pages_written) 315 __entry->io_done, __entry->pages_written)
@@ -300,7 +322,8 @@ TRACE_EVENT(ext4_da_writepages_result,
300 TP_ARGS(inode, wbc, ret, pages_written), 322 TP_ARGS(inode, wbc, ret, pages_written),
301 323
302 TP_STRUCT__entry( 324 TP_STRUCT__entry(
303 __field( dev_t, dev ) 325 __field( int, dev_major )
326 __field( int, dev_minor )
304 __field( ino_t, ino ) 327 __field( ino_t, ino )
305 __field( int, ret ) 328 __field( int, ret )
306 __field( int, pages_written ) 329 __field( int, pages_written )
@@ -310,7 +333,8 @@ TRACE_EVENT(ext4_da_writepages_result,
310 ), 333 ),
311 334
312 TP_fast_assign( 335 TP_fast_assign(
313 __entry->dev = inode->i_sb->s_dev; 336 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
337 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
314 __entry->ino = inode->i_ino; 338 __entry->ino = inode->i_ino;
315 __entry->ret = ret; 339 __entry->ret = ret;
316 __entry->pages_written = pages_written; 340 __entry->pages_written = pages_written;
@@ -319,8 +343,8 @@ TRACE_EVENT(ext4_da_writepages_result,
319 __entry->writeback_index = inode->i_mapping->writeback_index; 343 __entry->writeback_index = inode->i_mapping->writeback_index;
320 ), 344 ),
321 345
322 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu", 346 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu",
323 jbd2_dev_to_name(__entry->dev), 347 __entry->dev_major, __entry->dev_minor,
324 (unsigned long) __entry->ino, __entry->ret, 348 (unsigned long) __entry->ino, __entry->ret,
325 __entry->pages_written, __entry->pages_skipped, 349 __entry->pages_written, __entry->pages_skipped,
326 __entry->more_io, 350 __entry->more_io,
@@ -334,20 +358,23 @@ TRACE_EVENT(ext4_discard_blocks,
334 TP_ARGS(sb, blk, count), 358 TP_ARGS(sb, blk, count),
335 359
336 TP_STRUCT__entry( 360 TP_STRUCT__entry(
337 __field( dev_t, dev ) 361 __field( int, dev_major )
362 __field( int, dev_minor )
338 __field( __u64, blk ) 363 __field( __u64, blk )
339 __field( __u64, count ) 364 __field( __u64, count )
340 365
341 ), 366 ),
342 367
343 TP_fast_assign( 368 TP_fast_assign(
344 __entry->dev = sb->s_dev; 369 __entry->dev_major = MAJOR(sb->s_dev);
370 __entry->dev_minor = MINOR(sb->s_dev);
345 __entry->blk = blk; 371 __entry->blk = blk;
346 __entry->count = count; 372 __entry->count = count;
347 ), 373 ),
348 374
349 TP_printk("dev %s blk %llu count %llu", 375 TP_printk("dev %d,%d blk %llu count %llu",
350 jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count) 376 __entry->dev_major, __entry->dev_minor,
377 __entry->blk, __entry->count)
351); 378);
352 379
353DECLARE_EVENT_CLASS(ext4__mb_new_pa, 380DECLARE_EVENT_CLASS(ext4__mb_new_pa,
@@ -357,7 +384,8 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
357 TP_ARGS(ac, pa), 384 TP_ARGS(ac, pa),
358 385
359 TP_STRUCT__entry( 386 TP_STRUCT__entry(
360 __field( dev_t, dev ) 387 __field( int, dev_major )
388 __field( int, dev_minor )
361 __field( ino_t, ino ) 389 __field( ino_t, ino )
362 __field( __u64, pa_pstart ) 390 __field( __u64, pa_pstart )
363 __field( __u32, pa_len ) 391 __field( __u32, pa_len )
@@ -366,16 +394,18 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
366 ), 394 ),
367 395
368 TP_fast_assign( 396 TP_fast_assign(
369 __entry->dev = ac->ac_sb->s_dev; 397 __entry->dev_major = MAJOR(ac->ac_sb->s_dev);
398 __entry->dev_minor = MINOR(ac->ac_sb->s_dev);
370 __entry->ino = ac->ac_inode->i_ino; 399 __entry->ino = ac->ac_inode->i_ino;
371 __entry->pa_pstart = pa->pa_pstart; 400 __entry->pa_pstart = pa->pa_pstart;
372 __entry->pa_len = pa->pa_len; 401 __entry->pa_len = pa->pa_len;
373 __entry->pa_lstart = pa->pa_lstart; 402 __entry->pa_lstart = pa->pa_lstart;
374 ), 403 ),
375 404
376 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", 405 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
377 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 406 __entry->dev_major, __entry->dev_minor,
378 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) 407 (unsigned long) __entry->ino, __entry->pa_pstart,
408 __entry->pa_len, __entry->pa_lstart)
379); 409);
380 410
381DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa, 411DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
@@ -396,14 +426,15 @@ DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
396 426
397TRACE_EVENT(ext4_mb_release_inode_pa, 427TRACE_EVENT(ext4_mb_release_inode_pa,
398 TP_PROTO(struct super_block *sb, 428 TP_PROTO(struct super_block *sb,
399 struct ext4_allocation_context *ac, 429 struct inode *inode,
400 struct ext4_prealloc_space *pa, 430 struct ext4_prealloc_space *pa,
401 unsigned long long block, unsigned int count), 431 unsigned long long block, unsigned int count),
402 432
403 TP_ARGS(sb, ac, pa, block, count), 433 TP_ARGS(sb, inode, pa, block, count),
404 434
405 TP_STRUCT__entry( 435 TP_STRUCT__entry(
406 __field( dev_t, dev ) 436 __field( int, dev_major )
437 __field( int, dev_minor )
407 __field( ino_t, ino ) 438 __field( ino_t, ino )
408 __field( __u64, block ) 439 __field( __u64, block )
409 __field( __u32, count ) 440 __field( __u32, count )
@@ -411,43 +442,42 @@ TRACE_EVENT(ext4_mb_release_inode_pa,
411 ), 442 ),
412 443
413 TP_fast_assign( 444 TP_fast_assign(
414 __entry->dev = sb->s_dev; 445 __entry->dev_major = MAJOR(sb->s_dev);
415 __entry->ino = (ac && ac->ac_inode) ? 446 __entry->dev_minor = MINOR(sb->s_dev);
416 ac->ac_inode->i_ino : 0; 447 __entry->ino = inode->i_ino;
417 __entry->block = block; 448 __entry->block = block;
418 __entry->count = count; 449 __entry->count = count;
419 ), 450 ),
420 451
421 TP_printk("dev %s ino %lu block %llu count %u", 452 TP_printk("dev %d,%d ino %lu block %llu count %u",
422 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 453 __entry->dev_major, __entry->dev_minor,
423 __entry->block, __entry->count) 454 (unsigned long) __entry->ino, __entry->block, __entry->count)
424); 455);
425 456
426TRACE_EVENT(ext4_mb_release_group_pa, 457TRACE_EVENT(ext4_mb_release_group_pa,
427 TP_PROTO(struct super_block *sb, 458 TP_PROTO(struct super_block *sb,
428 struct ext4_allocation_context *ac,
429 struct ext4_prealloc_space *pa), 459 struct ext4_prealloc_space *pa),
430 460
431 TP_ARGS(sb, ac, pa), 461 TP_ARGS(sb, pa),
432 462
433 TP_STRUCT__entry( 463 TP_STRUCT__entry(
434 __field( dev_t, dev ) 464 __field( int, dev_major )
435 __field( ino_t, ino ) 465 __field( int, dev_minor )
436 __field( __u64, pa_pstart ) 466 __field( __u64, pa_pstart )
437 __field( __u32, pa_len ) 467 __field( __u32, pa_len )
438 468
439 ), 469 ),
440 470
441 TP_fast_assign( 471 TP_fast_assign(
442 __entry->dev = sb->s_dev; 472 __entry->dev_major = MAJOR(sb->s_dev);
443 __entry->ino = (ac && ac->ac_inode) ? 473 __entry->dev_minor = MINOR(sb->s_dev);
444 ac->ac_inode->i_ino : 0;
445 __entry->pa_pstart = pa->pa_pstart; 474 __entry->pa_pstart = pa->pa_pstart;
446 __entry->pa_len = pa->pa_len; 475 __entry->pa_len = pa->pa_len;
447 ), 476 ),
448 477
449 TP_printk("dev %s pstart %llu len %u", 478 TP_printk("dev %d,%d pstart %llu len %u",
450 jbd2_dev_to_name(__entry->dev), __entry->pa_pstart, __entry->pa_len) 479 __entry->dev_major, __entry->dev_minor,
480 __entry->pa_pstart, __entry->pa_len)
451); 481);
452 482
453TRACE_EVENT(ext4_discard_preallocations, 483TRACE_EVENT(ext4_discard_preallocations,
@@ -456,18 +486,21 @@ TRACE_EVENT(ext4_discard_preallocations,
456 TP_ARGS(inode), 486 TP_ARGS(inode),
457 487
458 TP_STRUCT__entry( 488 TP_STRUCT__entry(
459 __field( dev_t, dev ) 489 __field( int, dev_major )
490 __field( int, dev_minor )
460 __field( ino_t, ino ) 491 __field( ino_t, ino )
461 492
462 ), 493 ),
463 494
464 TP_fast_assign( 495 TP_fast_assign(
465 __entry->dev = inode->i_sb->s_dev; 496 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
497 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
466 __entry->ino = inode->i_ino; 498 __entry->ino = inode->i_ino;
467 ), 499 ),
468 500
469 TP_printk("dev %s ino %lu", 501 TP_printk("dev %d,%d ino %lu",
470 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) 502 __entry->dev_major, __entry->dev_minor,
503 (unsigned long) __entry->ino)
471); 504);
472 505
473TRACE_EVENT(ext4_mb_discard_preallocations, 506TRACE_EVENT(ext4_mb_discard_preallocations,
@@ -476,18 +509,20 @@ TRACE_EVENT(ext4_mb_discard_preallocations,
476 TP_ARGS(sb, needed), 509 TP_ARGS(sb, needed),
477 510
478 TP_STRUCT__entry( 511 TP_STRUCT__entry(
479 __field( dev_t, dev ) 512 __field( int, dev_major )
513 __field( int, dev_minor )
480 __field( int, needed ) 514 __field( int, needed )
481 515
482 ), 516 ),
483 517
484 TP_fast_assign( 518 TP_fast_assign(
485 __entry->dev = sb->s_dev; 519 __entry->dev_major = MAJOR(sb->s_dev);
520 __entry->dev_minor = MINOR(sb->s_dev);
486 __entry->needed = needed; 521 __entry->needed = needed;
487 ), 522 ),
488 523
489 TP_printk("dev %s needed %d", 524 TP_printk("dev %d,%d needed %d",
490 jbd2_dev_to_name(__entry->dev), __entry->needed) 525 __entry->dev_major, __entry->dev_minor, __entry->needed)
491); 526);
492 527
493TRACE_EVENT(ext4_request_blocks, 528TRACE_EVENT(ext4_request_blocks,
@@ -496,7 +531,8 @@ TRACE_EVENT(ext4_request_blocks,
496 TP_ARGS(ar), 531 TP_ARGS(ar),
497 532
498 TP_STRUCT__entry( 533 TP_STRUCT__entry(
499 __field( dev_t, dev ) 534 __field( int, dev_major )
535 __field( int, dev_minor )
500 __field( ino_t, ino ) 536 __field( ino_t, ino )
501 __field( unsigned int, flags ) 537 __field( unsigned int, flags )
502 __field( unsigned int, len ) 538 __field( unsigned int, len )
@@ -509,7 +545,8 @@ TRACE_EVENT(ext4_request_blocks,
509 ), 545 ),
510 546
511 TP_fast_assign( 547 TP_fast_assign(
512 __entry->dev = ar->inode->i_sb->s_dev; 548 __entry->dev_major = MAJOR(ar->inode->i_sb->s_dev);
549 __entry->dev_minor = MINOR(ar->inode->i_sb->s_dev);
513 __entry->ino = ar->inode->i_ino; 550 __entry->ino = ar->inode->i_ino;
514 __entry->flags = ar->flags; 551 __entry->flags = ar->flags;
515 __entry->len = ar->len; 552 __entry->len = ar->len;
@@ -521,8 +558,9 @@ TRACE_EVENT(ext4_request_blocks,
521 __entry->pright = ar->pright; 558 __entry->pright = ar->pright;
522 ), 559 ),
523 560
524 TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", 561 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
525 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 562 __entry->dev_major, __entry->dev_minor,
563 (unsigned long) __entry->ino,
526 __entry->flags, __entry->len, 564 __entry->flags, __entry->len,
527 (unsigned long long) __entry->logical, 565 (unsigned long long) __entry->logical,
528 (unsigned long long) __entry->goal, 566 (unsigned long long) __entry->goal,
@@ -538,7 +576,8 @@ TRACE_EVENT(ext4_allocate_blocks,
538 TP_ARGS(ar, block), 576 TP_ARGS(ar, block),
539 577
540 TP_STRUCT__entry( 578 TP_STRUCT__entry(
541 __field( dev_t, dev ) 579 __field( int, dev_major )
580 __field( int, dev_minor )
542 __field( ino_t, ino ) 581 __field( ino_t, ino )
543 __field( __u64, block ) 582 __field( __u64, block )
544 __field( unsigned int, flags ) 583 __field( unsigned int, flags )
@@ -552,7 +591,8 @@ TRACE_EVENT(ext4_allocate_blocks,
552 ), 591 ),
553 592
554 TP_fast_assign( 593 TP_fast_assign(
555 __entry->dev = ar->inode->i_sb->s_dev; 594 __entry->dev_major = MAJOR(ar->inode->i_sb->s_dev);
595 __entry->dev_minor = MINOR(ar->inode->i_sb->s_dev);
556 __entry->ino = ar->inode->i_ino; 596 __entry->ino = ar->inode->i_ino;
557 __entry->block = block; 597 __entry->block = block;
558 __entry->flags = ar->flags; 598 __entry->flags = ar->flags;
@@ -565,9 +605,10 @@ TRACE_EVENT(ext4_allocate_blocks,
565 __entry->pright = ar->pright; 605 __entry->pright = ar->pright;
566 ), 606 ),
567 607
568 TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", 608 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
569 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 609 __entry->dev_major, __entry->dev_minor,
570 __entry->flags, __entry->len, __entry->block, 610 (unsigned long) __entry->ino, __entry->flags,
611 __entry->len, __entry->block,
571 (unsigned long long) __entry->logical, 612 (unsigned long long) __entry->logical,
572 (unsigned long long) __entry->goal, 613 (unsigned long long) __entry->goal,
573 (unsigned long long) __entry->lleft, 614 (unsigned long long) __entry->lleft,
@@ -583,7 +624,8 @@ TRACE_EVENT(ext4_free_blocks,
583 TP_ARGS(inode, block, count, flags), 624 TP_ARGS(inode, block, count, flags),
584 625
585 TP_STRUCT__entry( 626 TP_STRUCT__entry(
586 __field( dev_t, dev ) 627 __field( int, dev_major )
628 __field( int, dev_minor )
587 __field( ino_t, ino ) 629 __field( ino_t, ino )
588 __field( umode_t, mode ) 630 __field( umode_t, mode )
589 __field( __u64, block ) 631 __field( __u64, block )
@@ -592,7 +634,8 @@ TRACE_EVENT(ext4_free_blocks,
592 ), 634 ),
593 635
594 TP_fast_assign( 636 TP_fast_assign(
595 __entry->dev = inode->i_sb->s_dev; 637 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
638 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
596 __entry->ino = inode->i_ino; 639 __entry->ino = inode->i_ino;
597 __entry->mode = inode->i_mode; 640 __entry->mode = inode->i_mode;
598 __entry->block = block; 641 __entry->block = block;
@@ -600,8 +643,9 @@ TRACE_EVENT(ext4_free_blocks,
600 __entry->flags = flags; 643 __entry->flags = flags;
601 ), 644 ),
602 645
603 TP_printk("dev %s ino %lu mode 0%o block %llu count %lu flags %d", 646 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d",
604 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 647 __entry->dev_major, __entry->dev_minor,
648 (unsigned long) __entry->ino,
605 __entry->mode, __entry->block, __entry->count, 649 __entry->mode, __entry->block, __entry->count,
606 __entry->flags) 650 __entry->flags)
607); 651);
@@ -612,7 +656,8 @@ TRACE_EVENT(ext4_sync_file,
612 TP_ARGS(file, datasync), 656 TP_ARGS(file, datasync),
613 657
614 TP_STRUCT__entry( 658 TP_STRUCT__entry(
615 __field( dev_t, dev ) 659 __field( int, dev_major )
660 __field( int, dev_minor )
616 __field( ino_t, ino ) 661 __field( ino_t, ino )
617 __field( ino_t, parent ) 662 __field( ino_t, parent )
618 __field( int, datasync ) 663 __field( int, datasync )
@@ -621,14 +666,16 @@ TRACE_EVENT(ext4_sync_file,
621 TP_fast_assign( 666 TP_fast_assign(
622 struct dentry *dentry = file->f_path.dentry; 667 struct dentry *dentry = file->f_path.dentry;
623 668
624 __entry->dev = dentry->d_inode->i_sb->s_dev; 669 __entry->dev_major = MAJOR(dentry->d_inode->i_sb->s_dev);
670 __entry->dev_minor = MINOR(dentry->d_inode->i_sb->s_dev);
625 __entry->ino = dentry->d_inode->i_ino; 671 __entry->ino = dentry->d_inode->i_ino;
626 __entry->datasync = datasync; 672 __entry->datasync = datasync;
627 __entry->parent = dentry->d_parent->d_inode->i_ino; 673 __entry->parent = dentry->d_parent->d_inode->i_ino;
628 ), 674 ),
629 675
630 TP_printk("dev %s ino %ld parent %ld datasync %d ", 676 TP_printk("dev %d,%d ino %ld parent %ld datasync %d ",
631 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 677 __entry->dev_major, __entry->dev_minor,
678 (unsigned long) __entry->ino,
632 (unsigned long) __entry->parent, __entry->datasync) 679 (unsigned long) __entry->parent, __entry->datasync)
633); 680);
634 681
@@ -638,18 +685,20 @@ TRACE_EVENT(ext4_sync_fs,
638 TP_ARGS(sb, wait), 685 TP_ARGS(sb, wait),
639 686
640 TP_STRUCT__entry( 687 TP_STRUCT__entry(
641 __field( dev_t, dev ) 688 __field( int, dev_major )
689 __field( int, dev_minor )
642 __field( int, wait ) 690 __field( int, wait )
643 691
644 ), 692 ),
645 693
646 TP_fast_assign( 694 TP_fast_assign(
647 __entry->dev = sb->s_dev; 695 __entry->dev_major = MAJOR(sb->s_dev);
696 __entry->dev_minor = MINOR(sb->s_dev);
648 __entry->wait = wait; 697 __entry->wait = wait;
649 ), 698 ),
650 699
651 TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry->dev), 700 TP_printk("dev %d,%d wait %d", __entry->dev_major,
652 __entry->wait) 701 __entry->dev_minor, __entry->wait)
653); 702);
654 703
655TRACE_EVENT(ext4_alloc_da_blocks, 704TRACE_EVENT(ext4_alloc_da_blocks,
@@ -658,21 +707,24 @@ TRACE_EVENT(ext4_alloc_da_blocks,
658 TP_ARGS(inode), 707 TP_ARGS(inode),
659 708
660 TP_STRUCT__entry( 709 TP_STRUCT__entry(
661 __field( dev_t, dev ) 710 __field( int, dev_major )
711 __field( int, dev_minor )
662 __field( ino_t, ino ) 712 __field( ino_t, ino )
663 __field( unsigned int, data_blocks ) 713 __field( unsigned int, data_blocks )
664 __field( unsigned int, meta_blocks ) 714 __field( unsigned int, meta_blocks )
665 ), 715 ),
666 716
667 TP_fast_assign( 717 TP_fast_assign(
668 __entry->dev = inode->i_sb->s_dev; 718 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
719 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
669 __entry->ino = inode->i_ino; 720 __entry->ino = inode->i_ino;
670 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks; 721 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
671 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 722 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
672 ), 723 ),
673 724
674 TP_printk("dev %s ino %lu data_blocks %u meta_blocks %u", 725 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
675 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 726 __entry->dev_major, __entry->dev_minor,
727 (unsigned long) __entry->ino,
676 __entry->data_blocks, __entry->meta_blocks) 728 __entry->data_blocks, __entry->meta_blocks)
677); 729);
678 730
@@ -682,7 +734,8 @@ TRACE_EVENT(ext4_mballoc_alloc,
682 TP_ARGS(ac), 734 TP_ARGS(ac),
683 735
684 TP_STRUCT__entry( 736 TP_STRUCT__entry(
685 __field( dev_t, dev ) 737 __field( int, dev_major )
738 __field( int, dev_minor )
686 __field( ino_t, ino ) 739 __field( ino_t, ino )
687 __field( __u16, found ) 740 __field( __u16, found )
688 __field( __u16, groups ) 741 __field( __u16, groups )
@@ -705,7 +758,8 @@ TRACE_EVENT(ext4_mballoc_alloc,
705 ), 758 ),
706 759
707 TP_fast_assign( 760 TP_fast_assign(
708 __entry->dev = ac->ac_inode->i_sb->s_dev; 761 __entry->dev_major = MAJOR(ac->ac_inode->i_sb->s_dev);
762 __entry->dev_minor = MINOR(ac->ac_inode->i_sb->s_dev);
709 __entry->ino = ac->ac_inode->i_ino; 763 __entry->ino = ac->ac_inode->i_ino;
710 __entry->found = ac->ac_found; 764 __entry->found = ac->ac_found;
711 __entry->flags = ac->ac_flags; 765 __entry->flags = ac->ac_flags;
@@ -727,10 +781,11 @@ TRACE_EVENT(ext4_mballoc_alloc,
727 __entry->result_len = ac->ac_f_ex.fe_len; 781 __entry->result_len = ac->ac_f_ex.fe_len;
728 ), 782 ),
729 783
730 TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u " 784 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
731 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x " 785 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
732 "tail %u broken %u", 786 "tail %u broken %u",
733 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 787 __entry->dev_major, __entry->dev_minor,
788 (unsigned long) __entry->ino,
734 __entry->orig_group, __entry->orig_start, 789 __entry->orig_group, __entry->orig_start,
735 __entry->orig_len, __entry->orig_logical, 790 __entry->orig_len, __entry->orig_logical,
736 __entry->goal_group, __entry->goal_start, 791 __entry->goal_group, __entry->goal_start,
@@ -748,7 +803,8 @@ TRACE_EVENT(ext4_mballoc_prealloc,
748 TP_ARGS(ac), 803 TP_ARGS(ac),
749 804
750 TP_STRUCT__entry( 805 TP_STRUCT__entry(
751 __field( dev_t, dev ) 806 __field( int, dev_major )
807 __field( int, dev_minor )
752 __field( ino_t, ino ) 808 __field( ino_t, ino )
753 __field( __u32, orig_logical ) 809 __field( __u32, orig_logical )
754 __field( int, orig_start ) 810 __field( int, orig_start )
@@ -761,7 +817,8 @@ TRACE_EVENT(ext4_mballoc_prealloc,
761 ), 817 ),
762 818
763 TP_fast_assign( 819 TP_fast_assign(
764 __entry->dev = ac->ac_inode->i_sb->s_dev; 820 __entry->dev_major = MAJOR(ac->ac_inode->i_sb->s_dev);
821 __entry->dev_minor = MINOR(ac->ac_inode->i_sb->s_dev);
765 __entry->ino = ac->ac_inode->i_ino; 822 __entry->ino = ac->ac_inode->i_ino;
766 __entry->orig_logical = ac->ac_o_ex.fe_logical; 823 __entry->orig_logical = ac->ac_o_ex.fe_logical;
767 __entry->orig_start = ac->ac_o_ex.fe_start; 824 __entry->orig_start = ac->ac_o_ex.fe_start;
@@ -773,8 +830,9 @@ TRACE_EVENT(ext4_mballoc_prealloc,
773 __entry->result_len = ac->ac_b_ex.fe_len; 830 __entry->result_len = ac->ac_b_ex.fe_len;
774 ), 831 ),
775 832
776 TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u", 833 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
777 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 834 __entry->dev_major, __entry->dev_minor,
835 (unsigned long) __entry->ino,
778 __entry->orig_group, __entry->orig_start, 836 __entry->orig_group, __entry->orig_start,
779 __entry->orig_len, __entry->orig_logical, 837 __entry->orig_len, __entry->orig_logical,
780 __entry->result_group, __entry->result_start, 838 __entry->result_group, __entry->result_start,
@@ -782,46 +840,59 @@ TRACE_EVENT(ext4_mballoc_prealloc,
782); 840);
783 841
784DECLARE_EVENT_CLASS(ext4__mballoc, 842DECLARE_EVENT_CLASS(ext4__mballoc,
785 TP_PROTO(struct ext4_allocation_context *ac), 843 TP_PROTO(struct super_block *sb,
844 struct inode *inode,
845 ext4_group_t group,
846 ext4_grpblk_t start,
847 ext4_grpblk_t len),
786 848
787 TP_ARGS(ac), 849 TP_ARGS(sb, inode, group, start, len),
788 850
789 TP_STRUCT__entry( 851 TP_STRUCT__entry(
790 __field( dev_t, dev ) 852 __field( int, dev_major )
853 __field( int, dev_minor )
791 __field( ino_t, ino ) 854 __field( ino_t, ino )
792 __field( __u32, result_logical )
793 __field( int, result_start ) 855 __field( int, result_start )
794 __field( __u32, result_group ) 856 __field( __u32, result_group )
795 __field( int, result_len ) 857 __field( int, result_len )
796 ), 858 ),
797 859
798 TP_fast_assign( 860 TP_fast_assign(
799 __entry->dev = ac->ac_inode->i_sb->s_dev; 861 __entry->dev_major = MAJOR(sb->s_dev);
800 __entry->ino = ac->ac_inode->i_ino; 862 __entry->dev_minor = MINOR(sb->s_dev);
801 __entry->result_logical = ac->ac_b_ex.fe_logical; 863 __entry->ino = inode ? inode->i_ino : 0;
802 __entry->result_start = ac->ac_b_ex.fe_start; 864 __entry->result_start = start;
803 __entry->result_group = ac->ac_b_ex.fe_group; 865 __entry->result_group = group;
804 __entry->result_len = ac->ac_b_ex.fe_len; 866 __entry->result_len = len;
805 ), 867 ),
806 868
807 TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", 869 TP_printk("dev %d,%d inode %lu extent %u/%d/%u ",
808 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 870 __entry->dev_major, __entry->dev_minor,
871 (unsigned long) __entry->ino,
809 __entry->result_group, __entry->result_start, 872 __entry->result_group, __entry->result_start,
810 __entry->result_len, __entry->result_logical) 873 __entry->result_len)
811); 874);
812 875
813DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard, 876DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
814 877
815 TP_PROTO(struct ext4_allocation_context *ac), 878 TP_PROTO(struct super_block *sb,
879 struct inode *inode,
880 ext4_group_t group,
881 ext4_grpblk_t start,
882 ext4_grpblk_t len),
816 883
817 TP_ARGS(ac) 884 TP_ARGS(sb, inode, group, start, len)
818); 885);
819 886
820DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free, 887DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
821 888
822 TP_PROTO(struct ext4_allocation_context *ac), 889 TP_PROTO(struct super_block *sb,
890 struct inode *inode,
891 ext4_group_t group,
892 ext4_grpblk_t start,
893 ext4_grpblk_t len),
823 894
824 TP_ARGS(ac) 895 TP_ARGS(sb, inode, group, start, len)
825); 896);
826 897
827TRACE_EVENT(ext4_forget, 898TRACE_EVENT(ext4_forget,
@@ -830,7 +901,8 @@ TRACE_EVENT(ext4_forget,
830 TP_ARGS(inode, is_metadata, block), 901 TP_ARGS(inode, is_metadata, block),
831 902
832 TP_STRUCT__entry( 903 TP_STRUCT__entry(
833 __field( dev_t, dev ) 904 __field( int, dev_major )
905 __field( int, dev_minor )
834 __field( ino_t, ino ) 906 __field( ino_t, ino )
835 __field( umode_t, mode ) 907 __field( umode_t, mode )
836 __field( int, is_metadata ) 908 __field( int, is_metadata )
@@ -838,16 +910,18 @@ TRACE_EVENT(ext4_forget,
838 ), 910 ),
839 911
840 TP_fast_assign( 912 TP_fast_assign(
841 __entry->dev = inode->i_sb->s_dev; 913 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
914 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
842 __entry->ino = inode->i_ino; 915 __entry->ino = inode->i_ino;
843 __entry->mode = inode->i_mode; 916 __entry->mode = inode->i_mode;
844 __entry->is_metadata = is_metadata; 917 __entry->is_metadata = is_metadata;
845 __entry->block = block; 918 __entry->block = block;
846 ), 919 ),
847 920
848 TP_printk("dev %s ino %lu mode 0%o is_metadata %d block %llu", 921 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
849 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 922 __entry->dev_major, __entry->dev_minor,
850 __entry->mode, __entry->is_metadata, __entry->block) 923 (unsigned long) __entry->ino, __entry->mode,
924 __entry->is_metadata, __entry->block)
851); 925);
852 926
853TRACE_EVENT(ext4_da_update_reserve_space, 927TRACE_EVENT(ext4_da_update_reserve_space,
@@ -856,7 +930,8 @@ TRACE_EVENT(ext4_da_update_reserve_space,
856 TP_ARGS(inode, used_blocks), 930 TP_ARGS(inode, used_blocks),
857 931
858 TP_STRUCT__entry( 932 TP_STRUCT__entry(
859 __field( dev_t, dev ) 933 __field( int, dev_major )
934 __field( int, dev_minor )
860 __field( ino_t, ino ) 935 __field( ino_t, ino )
861 __field( umode_t, mode ) 936 __field( umode_t, mode )
862 __field( __u64, i_blocks ) 937 __field( __u64, i_blocks )
@@ -867,7 +942,8 @@ TRACE_EVENT(ext4_da_update_reserve_space,
867 ), 942 ),
868 943
869 TP_fast_assign( 944 TP_fast_assign(
870 __entry->dev = inode->i_sb->s_dev; 945 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
946 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
871 __entry->ino = inode->i_ino; 947 __entry->ino = inode->i_ino;
872 __entry->mode = inode->i_mode; 948 __entry->mode = inode->i_mode;
873 __entry->i_blocks = inode->i_blocks; 949 __entry->i_blocks = inode->i_blocks;
@@ -877,9 +953,10 @@ TRACE_EVENT(ext4_da_update_reserve_space,
877 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 953 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
878 ), 954 ),
879 955
880 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu used_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d", 956 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d",
881 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 957 __entry->dev_major, __entry->dev_minor,
882 __entry->mode, (unsigned long long) __entry->i_blocks, 958 (unsigned long) __entry->ino, __entry->mode,
959 (unsigned long long) __entry->i_blocks,
883 __entry->used_blocks, __entry->reserved_data_blocks, 960 __entry->used_blocks, __entry->reserved_data_blocks,
884 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 961 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
885); 962);
@@ -890,7 +967,8 @@ TRACE_EVENT(ext4_da_reserve_space,
890 TP_ARGS(inode, md_needed), 967 TP_ARGS(inode, md_needed),
891 968
892 TP_STRUCT__entry( 969 TP_STRUCT__entry(
893 __field( dev_t, dev ) 970 __field( int, dev_major )
971 __field( int, dev_minor )
894 __field( ino_t, ino ) 972 __field( ino_t, ino )
895 __field( umode_t, mode ) 973 __field( umode_t, mode )
896 __field( __u64, i_blocks ) 974 __field( __u64, i_blocks )
@@ -900,7 +978,8 @@ TRACE_EVENT(ext4_da_reserve_space,
900 ), 978 ),
901 979
902 TP_fast_assign( 980 TP_fast_assign(
903 __entry->dev = inode->i_sb->s_dev; 981 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
982 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
904 __entry->ino = inode->i_ino; 983 __entry->ino = inode->i_ino;
905 __entry->mode = inode->i_mode; 984 __entry->mode = inode->i_mode;
906 __entry->i_blocks = inode->i_blocks; 985 __entry->i_blocks = inode->i_blocks;
@@ -909,8 +988,9 @@ TRACE_EVENT(ext4_da_reserve_space,
909 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 988 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
910 ), 989 ),
911 990
912 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu md_needed %d reserved_data_blocks %d reserved_meta_blocks %d", 991 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d reserved_data_blocks %d reserved_meta_blocks %d",
913 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 992 __entry->dev_major, __entry->dev_minor,
993 (unsigned long) __entry->ino,
914 __entry->mode, (unsigned long long) __entry->i_blocks, 994 __entry->mode, (unsigned long long) __entry->i_blocks,
915 __entry->md_needed, __entry->reserved_data_blocks, 995 __entry->md_needed, __entry->reserved_data_blocks,
916 __entry->reserved_meta_blocks) 996 __entry->reserved_meta_blocks)
@@ -922,7 +1002,8 @@ TRACE_EVENT(ext4_da_release_space,
922 TP_ARGS(inode, freed_blocks), 1002 TP_ARGS(inode, freed_blocks),
923 1003
924 TP_STRUCT__entry( 1004 TP_STRUCT__entry(
925 __field( dev_t, dev ) 1005 __field( int, dev_major )
1006 __field( int, dev_minor )
926 __field( ino_t, ino ) 1007 __field( ino_t, ino )
927 __field( umode_t, mode ) 1008 __field( umode_t, mode )
928 __field( __u64, i_blocks ) 1009 __field( __u64, i_blocks )
@@ -933,7 +1014,8 @@ TRACE_EVENT(ext4_da_release_space,
933 ), 1014 ),
934 1015
935 TP_fast_assign( 1016 TP_fast_assign(
936 __entry->dev = inode->i_sb->s_dev; 1017 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
1018 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
937 __entry->ino = inode->i_ino; 1019 __entry->ino = inode->i_ino;
938 __entry->mode = inode->i_mode; 1020 __entry->mode = inode->i_mode;
939 __entry->i_blocks = inode->i_blocks; 1021 __entry->i_blocks = inode->i_blocks;
@@ -943,8 +1025,9 @@ TRACE_EVENT(ext4_da_release_space,
943 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1025 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
944 ), 1026 ),
945 1027
946 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu freed_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d", 1028 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d",
947 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 1029 __entry->dev_major, __entry->dev_minor,
1030 (unsigned long) __entry->ino,
948 __entry->mode, (unsigned long long) __entry->i_blocks, 1031 __entry->mode, (unsigned long long) __entry->i_blocks,
949 __entry->freed_blocks, __entry->reserved_data_blocks, 1032 __entry->freed_blocks, __entry->reserved_data_blocks,
950 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1033 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
@@ -956,18 +1039,20 @@ DECLARE_EVENT_CLASS(ext4__bitmap_load,
956 TP_ARGS(sb, group), 1039 TP_ARGS(sb, group),
957 1040
958 TP_STRUCT__entry( 1041 TP_STRUCT__entry(
959 __field( dev_t, dev ) 1042 __field( int, dev_major )
1043 __field( int, dev_minor )
960 __field( __u32, group ) 1044 __field( __u32, group )
961 1045
962 ), 1046 ),
963 1047
964 TP_fast_assign( 1048 TP_fast_assign(
965 __entry->dev = sb->s_dev; 1049 __entry->dev_major = MAJOR(sb->s_dev);
1050 __entry->dev_minor = MINOR(sb->s_dev);
966 __entry->group = group; 1051 __entry->group = group;
967 ), 1052 ),
968 1053
969 TP_printk("dev %s group %u", 1054 TP_printk("dev %d,%d group %u",
970 jbd2_dev_to_name(__entry->dev), __entry->group) 1055 __entry->dev_major, __entry->dev_minor, __entry->group)
971); 1056);
972 1057
973DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load, 1058DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index 6fa7cbab7d9..1c09820df58 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -86,76 +86,62 @@ TRACE_EVENT(irq_handler_exit,
86 86
87DECLARE_EVENT_CLASS(softirq, 87DECLARE_EVENT_CLASS(softirq,
88 88
89 TP_PROTO(struct softirq_action *h, struct softirq_action *vec), 89 TP_PROTO(unsigned int vec_nr),
90 90
91 TP_ARGS(h, vec), 91 TP_ARGS(vec_nr),
92 92
93 TP_STRUCT__entry( 93 TP_STRUCT__entry(
94 __field( int, vec ) 94 __field( unsigned int, vec )
95 ), 95 ),
96 96
97 TP_fast_assign( 97 TP_fast_assign(
98 if (vec) 98 __entry->vec = vec_nr;
99 __entry->vec = (int)(h - vec);
100 else
101 __entry->vec = (int)(long)h;
102 ), 99 ),
103 100
104 TP_printk("vec=%d [action=%s]", __entry->vec, 101 TP_printk("vec=%u [action=%s]", __entry->vec,
105 show_softirq_name(__entry->vec)) 102 show_softirq_name(__entry->vec))
106); 103);
107 104
108/** 105/**
109 * softirq_entry - called immediately before the softirq handler 106 * softirq_entry - called immediately before the softirq handler
110 * @h: pointer to struct softirq_action 107 * @vec_nr: softirq vector number
111 * @vec: pointer to first struct softirq_action in softirq_vec array
112 * 108 *
113 * The @h parameter, contains a pointer to the struct softirq_action 109 * When used in combination with the softirq_exit tracepoint
114 * which has a pointer to the action handler that is called. By subtracting 110 * we can determine the softirq handler runtine.
115 * the @vec pointer from the @h pointer, we can determine the softirq
116 * number. Also, when used in combination with the softirq_exit tracepoint
117 * we can determine the softirq latency.
118 */ 111 */
119DEFINE_EVENT(softirq, softirq_entry, 112DEFINE_EVENT(softirq, softirq_entry,
120 113
121 TP_PROTO(struct softirq_action *h, struct softirq_action *vec), 114 TP_PROTO(unsigned int vec_nr),
122 115
123 TP_ARGS(h, vec) 116 TP_ARGS(vec_nr)
124); 117);
125 118
126/** 119/**
127 * softirq_exit - called immediately after the softirq handler returns 120 * softirq_exit - called immediately after the softirq handler returns
128 * @h: pointer to struct softirq_action 121 * @vec_nr: softirq vector number
129 * @vec: pointer to first struct softirq_action in softirq_vec array
130 * 122 *
131 * The @h parameter contains a pointer to the struct softirq_action 123 * When used in combination with the softirq_entry tracepoint
132 * that has handled the softirq. By subtracting the @vec pointer from 124 * we can determine the softirq handler runtine.
133 * the @h pointer, we can determine the softirq number. Also, when used in
134 * combination with the softirq_entry tracepoint we can determine the softirq
135 * latency.
136 */ 125 */
137DEFINE_EVENT(softirq, softirq_exit, 126DEFINE_EVENT(softirq, softirq_exit,
138 127
139 TP_PROTO(struct softirq_action *h, struct softirq_action *vec), 128 TP_PROTO(unsigned int vec_nr),
140 129
141 TP_ARGS(h, vec) 130 TP_ARGS(vec_nr)
142); 131);
143 132
144/** 133/**
145 * softirq_raise - called immediately when a softirq is raised 134 * softirq_raise - called immediately when a softirq is raised
146 * @h: pointer to struct softirq_action 135 * @vec_nr: softirq vector number
147 * @vec: pointer to first struct softirq_action in softirq_vec array
148 * 136 *
149 * The @h parameter contains a pointer to the softirq vector number which is 137 * When used in combination with the softirq_entry tracepoint
150 * raised. @vec is NULL and it means @h includes vector number not 138 * we can determine the softirq raise to run latency.
151 * softirq_action. When used in combination with the softirq_entry tracepoint
152 * we can determine the softirq raise latency.
153 */ 139 */
154DEFINE_EVENT(softirq, softirq_raise, 140DEFINE_EVENT(softirq, softirq_raise,
155 141
156 TP_PROTO(struct softirq_action *h, struct softirq_action *vec), 142 TP_PROTO(unsigned int vec_nr),
157 143
158 TP_ARGS(h, vec) 144 TP_ARGS(vec_nr)
159); 145);
160 146
161#endif /* _TRACE_IRQ_H */ 147#endif /* _TRACE_IRQ_H */
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h
index bf16545cc97..7447ea9305b 100644
--- a/include/trace/events/jbd2.h
+++ b/include/trace/events/jbd2.h
@@ -17,17 +17,19 @@ TRACE_EVENT(jbd2_checkpoint,
17 TP_ARGS(journal, result), 17 TP_ARGS(journal, result),
18 18
19 TP_STRUCT__entry( 19 TP_STRUCT__entry(
20 __field( dev_t, dev ) 20 __field( int, dev_major )
21 __field( int, dev_minor )
21 __field( int, result ) 22 __field( int, result )
22 ), 23 ),
23 24
24 TP_fast_assign( 25 TP_fast_assign(
25 __entry->dev = journal->j_fs_dev->bd_dev; 26 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
27 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
26 __entry->result = result; 28 __entry->result = result;
27 ), 29 ),
28 30
29 TP_printk("dev %s result %d", 31 TP_printk("dev %d,%d result %d",
30 jbd2_dev_to_name(__entry->dev), __entry->result) 32 __entry->dev_major, __entry->dev_minor, __entry->result)
31); 33);
32 34
33DECLARE_EVENT_CLASS(jbd2_commit, 35DECLARE_EVENT_CLASS(jbd2_commit,
@@ -37,20 +39,22 @@ DECLARE_EVENT_CLASS(jbd2_commit,
37 TP_ARGS(journal, commit_transaction), 39 TP_ARGS(journal, commit_transaction),
38 40
39 TP_STRUCT__entry( 41 TP_STRUCT__entry(
40 __field( dev_t, dev ) 42 __field( int, dev_major )
43 __field( int, dev_minor )
41 __field( char, sync_commit ) 44 __field( char, sync_commit )
42 __field( int, transaction ) 45 __field( int, transaction )
43 ), 46 ),
44 47
45 TP_fast_assign( 48 TP_fast_assign(
46 __entry->dev = journal->j_fs_dev->bd_dev; 49 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
50 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
47 __entry->sync_commit = commit_transaction->t_synchronous_commit; 51 __entry->sync_commit = commit_transaction->t_synchronous_commit;
48 __entry->transaction = commit_transaction->t_tid; 52 __entry->transaction = commit_transaction->t_tid;
49 ), 53 ),
50 54
51 TP_printk("dev %s transaction %d sync %d", 55 TP_printk("dev %d,%d transaction %d sync %d",
52 jbd2_dev_to_name(__entry->dev), __entry->transaction, 56 __entry->dev_major, __entry->dev_minor,
53 __entry->sync_commit) 57 __entry->transaction, __entry->sync_commit)
54); 58);
55 59
56DEFINE_EVENT(jbd2_commit, jbd2_start_commit, 60DEFINE_EVENT(jbd2_commit, jbd2_start_commit,
@@ -87,22 +91,24 @@ TRACE_EVENT(jbd2_end_commit,
87 TP_ARGS(journal, commit_transaction), 91 TP_ARGS(journal, commit_transaction),
88 92
89 TP_STRUCT__entry( 93 TP_STRUCT__entry(
90 __field( dev_t, dev ) 94 __field( int, dev_major )
95 __field( int, dev_minor )
91 __field( char, sync_commit ) 96 __field( char, sync_commit )
92 __field( int, transaction ) 97 __field( int, transaction )
93 __field( int, head ) 98 __field( int, head )
94 ), 99 ),
95 100
96 TP_fast_assign( 101 TP_fast_assign(
97 __entry->dev = journal->j_fs_dev->bd_dev; 102 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
103 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
98 __entry->sync_commit = commit_transaction->t_synchronous_commit; 104 __entry->sync_commit = commit_transaction->t_synchronous_commit;
99 __entry->transaction = commit_transaction->t_tid; 105 __entry->transaction = commit_transaction->t_tid;
100 __entry->head = journal->j_tail_sequence; 106 __entry->head = journal->j_tail_sequence;
101 ), 107 ),
102 108
103 TP_printk("dev %s transaction %d sync %d head %d", 109 TP_printk("dev %d,%d transaction %d sync %d head %d",
104 jbd2_dev_to_name(__entry->dev), __entry->transaction, 110 __entry->dev_major, __entry->dev_minor,
105 __entry->sync_commit, __entry->head) 111 __entry->transaction, __entry->sync_commit, __entry->head)
106); 112);
107 113
108TRACE_EVENT(jbd2_submit_inode_data, 114TRACE_EVENT(jbd2_submit_inode_data,
@@ -111,17 +117,20 @@ TRACE_EVENT(jbd2_submit_inode_data,
111 TP_ARGS(inode), 117 TP_ARGS(inode),
112 118
113 TP_STRUCT__entry( 119 TP_STRUCT__entry(
114 __field( dev_t, dev ) 120 __field( int, dev_major )
121 __field( int, dev_minor )
115 __field( ino_t, ino ) 122 __field( ino_t, ino )
116 ), 123 ),
117 124
118 TP_fast_assign( 125 TP_fast_assign(
119 __entry->dev = inode->i_sb->s_dev; 126 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
127 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
120 __entry->ino = inode->i_ino; 128 __entry->ino = inode->i_ino;
121 ), 129 ),
122 130
123 TP_printk("dev %s ino %lu", 131 TP_printk("dev %d,%d ino %lu",
124 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) 132 __entry->dev_major, __entry->dev_minor,
133 (unsigned long) __entry->ino)
125); 134);
126 135
127TRACE_EVENT(jbd2_run_stats, 136TRACE_EVENT(jbd2_run_stats,
@@ -131,7 +140,8 @@ TRACE_EVENT(jbd2_run_stats,
131 TP_ARGS(dev, tid, stats), 140 TP_ARGS(dev, tid, stats),
132 141
133 TP_STRUCT__entry( 142 TP_STRUCT__entry(
134 __field( dev_t, dev ) 143 __field( int, dev_major )
144 __field( int, dev_minor )
135 __field( unsigned long, tid ) 145 __field( unsigned long, tid )
136 __field( unsigned long, wait ) 146 __field( unsigned long, wait )
137 __field( unsigned long, running ) 147 __field( unsigned long, running )
@@ -144,7 +154,8 @@ TRACE_EVENT(jbd2_run_stats,
144 ), 154 ),
145 155
146 TP_fast_assign( 156 TP_fast_assign(
147 __entry->dev = dev; 157 __entry->dev_major = MAJOR(dev);
158 __entry->dev_minor = MINOR(dev);
148 __entry->tid = tid; 159 __entry->tid = tid;
149 __entry->wait = stats->rs_wait; 160 __entry->wait = stats->rs_wait;
150 __entry->running = stats->rs_running; 161 __entry->running = stats->rs_running;
@@ -156,9 +167,9 @@ TRACE_EVENT(jbd2_run_stats,
156 __entry->blocks_logged = stats->rs_blocks_logged; 167 __entry->blocks_logged = stats->rs_blocks_logged;
157 ), 168 ),
158 169
159 TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u " 170 TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u "
160 "logging %u handle_count %u blocks %u blocks_logged %u", 171 "logging %u handle_count %u blocks %u blocks_logged %u",
161 jbd2_dev_to_name(__entry->dev), __entry->tid, 172 __entry->dev_major, __entry->dev_minor, __entry->tid,
162 jiffies_to_msecs(__entry->wait), 173 jiffies_to_msecs(__entry->wait),
163 jiffies_to_msecs(__entry->running), 174 jiffies_to_msecs(__entry->running),
164 jiffies_to_msecs(__entry->locked), 175 jiffies_to_msecs(__entry->locked),
@@ -175,7 +186,8 @@ TRACE_EVENT(jbd2_checkpoint_stats,
175 TP_ARGS(dev, tid, stats), 186 TP_ARGS(dev, tid, stats),
176 187
177 TP_STRUCT__entry( 188 TP_STRUCT__entry(
178 __field( dev_t, dev ) 189 __field( int, dev_major )
190 __field( int, dev_minor )
179 __field( unsigned long, tid ) 191 __field( unsigned long, tid )
180 __field( unsigned long, chp_time ) 192 __field( unsigned long, chp_time )
181 __field( __u32, forced_to_close ) 193 __field( __u32, forced_to_close )
@@ -184,7 +196,8 @@ TRACE_EVENT(jbd2_checkpoint_stats,
184 ), 196 ),
185 197
186 TP_fast_assign( 198 TP_fast_assign(
187 __entry->dev = dev; 199 __entry->dev_major = MAJOR(dev);
200 __entry->dev_minor = MINOR(dev);
188 __entry->tid = tid; 201 __entry->tid = tid;
189 __entry->chp_time = stats->cs_chp_time; 202 __entry->chp_time = stats->cs_chp_time;
190 __entry->forced_to_close= stats->cs_forced_to_close; 203 __entry->forced_to_close= stats->cs_forced_to_close;
@@ -192,9 +205,9 @@ TRACE_EVENT(jbd2_checkpoint_stats,
192 __entry->dropped = stats->cs_dropped; 205 __entry->dropped = stats->cs_dropped;
193 ), 206 ),
194 207
195 TP_printk("dev %s tid %lu chp_time %u forced_to_close %u " 208 TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u "
196 "written %u dropped %u", 209 "written %u dropped %u",
197 jbd2_dev_to_name(__entry->dev), __entry->tid, 210 __entry->dev_major, __entry->dev_minor, __entry->tid,
198 jiffies_to_msecs(__entry->chp_time), 211 jiffies_to_msecs(__entry->chp_time),
199 __entry->forced_to_close, __entry->written, __entry->dropped) 212 __entry->forced_to_close, __entry->written, __entry->dropped)
200); 213);
@@ -207,7 +220,8 @@ TRACE_EVENT(jbd2_cleanup_journal_tail,
207 TP_ARGS(journal, first_tid, block_nr, freed), 220 TP_ARGS(journal, first_tid, block_nr, freed),
208 221
209 TP_STRUCT__entry( 222 TP_STRUCT__entry(
210 __field( dev_t, dev ) 223 __field( int, dev_major )
224 __field( int, dev_minor )
211 __field( tid_t, tail_sequence ) 225 __field( tid_t, tail_sequence )
212 __field( tid_t, first_tid ) 226 __field( tid_t, first_tid )
213 __field(unsigned long, block_nr ) 227 __field(unsigned long, block_nr )
@@ -215,16 +229,18 @@ TRACE_EVENT(jbd2_cleanup_journal_tail,
215 ), 229 ),
216 230
217 TP_fast_assign( 231 TP_fast_assign(
218 __entry->dev = journal->j_fs_dev->bd_dev; 232 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev);
233 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
219 __entry->tail_sequence = journal->j_tail_sequence; 234 __entry->tail_sequence = journal->j_tail_sequence;
220 __entry->first_tid = first_tid; 235 __entry->first_tid = first_tid;
221 __entry->block_nr = block_nr; 236 __entry->block_nr = block_nr;
222 __entry->freed = freed; 237 __entry->freed = freed;
223 ), 238 ),
224 239
225 TP_printk("dev %s from %u to %u offset %lu freed %lu", 240 TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
226 jbd2_dev_to_name(__entry->dev), __entry->tail_sequence, 241 __entry->dev_major, __entry->dev_minor,
227 __entry->first_tid, __entry->block_nr, __entry->freed) 242 __entry->tail_sequence, __entry->first_tid,
243 __entry->block_nr, __entry->freed)
228); 244);
229 245
230#endif /* _TRACE_JBD2_H */ 246#endif /* _TRACE_JBD2_H */
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index 370aa5a8732..c255fcc587b 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -10,6 +10,7 @@
10 10
11#define RECLAIM_WB_ANON 0x0001u 11#define RECLAIM_WB_ANON 0x0001u
12#define RECLAIM_WB_FILE 0x0002u 12#define RECLAIM_WB_FILE 0x0002u
13#define RECLAIM_WB_MIXED 0x0010u
13#define RECLAIM_WB_SYNC 0x0004u 14#define RECLAIM_WB_SYNC 0x0004u
14#define RECLAIM_WB_ASYNC 0x0008u 15#define RECLAIM_WB_ASYNC 0x0008u
15 16
@@ -17,13 +18,20 @@
17 (flags) ? __print_flags(flags, "|", \ 18 (flags) ? __print_flags(flags, "|", \
18 {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \ 19 {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \
19 {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \ 20 {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \
21 {RECLAIM_WB_MIXED, "RECLAIM_WB_MIXED"}, \
20 {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \ 22 {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \
21 {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \ 23 {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \
22 ) : "RECLAIM_WB_NONE" 24 ) : "RECLAIM_WB_NONE"
23 25
24#define trace_reclaim_flags(page, sync) ( \ 26#define trace_reclaim_flags(page, sync) ( \
25 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ 27 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
26 (sync == PAGEOUT_IO_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ 28 (sync == LUMPY_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \
29 )
30
31#define trace_shrink_flags(file, sync) ( \
32 (sync == LUMPY_MODE_SYNC ? RECLAIM_WB_MIXED : \
33 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON)) | \
34 (sync == LUMPY_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \
27 ) 35 )
28 36
29TRACE_EVENT(mm_vmscan_kswapd_sleep, 37TRACE_EVENT(mm_vmscan_kswapd_sleep,
@@ -269,6 +277,40 @@ TRACE_EVENT(mm_vmscan_writepage,
269 show_reclaim_flags(__entry->reclaim_flags)) 277 show_reclaim_flags(__entry->reclaim_flags))
270); 278);
271 279
280TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
281
282 TP_PROTO(int nid, int zid,
283 unsigned long nr_scanned, unsigned long nr_reclaimed,
284 int priority, int reclaim_flags),
285
286 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
287
288 TP_STRUCT__entry(
289 __field(int, nid)
290 __field(int, zid)
291 __field(unsigned long, nr_scanned)
292 __field(unsigned long, nr_reclaimed)
293 __field(int, priority)
294 __field(int, reclaim_flags)
295 ),
296
297 TP_fast_assign(
298 __entry->nid = nid;
299 __entry->zid = zid;
300 __entry->nr_scanned = nr_scanned;
301 __entry->nr_reclaimed = nr_reclaimed;
302 __entry->priority = priority;
303 __entry->reclaim_flags = reclaim_flags;
304 ),
305
306 TP_printk("nid=%d zid=%d nr_scanned=%ld nr_reclaimed=%ld priority=%d flags=%s",
307 __entry->nid, __entry->zid,
308 __entry->nr_scanned, __entry->nr_reclaimed,
309 __entry->priority,
310 show_reclaim_flags(__entry->reclaim_flags))
311);
312
313
272#endif /* _TRACE_VMSCAN_H */ 314#endif /* _TRACE_VMSCAN_H */
273 315
274/* This part must be outside protection */ 316/* This part must be outside protection */
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index f345f66ae9d..89a2b2db437 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -96,8 +96,6 @@ DECLARE_EVENT_CLASS(wbc_class,
96 __field(long, nr_to_write) 96 __field(long, nr_to_write)
97 __field(long, pages_skipped) 97 __field(long, pages_skipped)
98 __field(int, sync_mode) 98 __field(int, sync_mode)
99 __field(int, nonblocking)
100 __field(int, encountered_congestion)
101 __field(int, for_kupdate) 99 __field(int, for_kupdate)
102 __field(int, for_background) 100 __field(int, for_background)
103 __field(int, for_reclaim) 101 __field(int, for_reclaim)
@@ -153,6 +151,41 @@ DEFINE_WBC_EVENT(wbc_balance_dirty_written);
153DEFINE_WBC_EVENT(wbc_balance_dirty_wait); 151DEFINE_WBC_EVENT(wbc_balance_dirty_wait);
154DEFINE_WBC_EVENT(wbc_writepage); 152DEFINE_WBC_EVENT(wbc_writepage);
155 153
154DECLARE_EVENT_CLASS(writeback_congest_waited_template,
155
156 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
157
158 TP_ARGS(usec_timeout, usec_delayed),
159
160 TP_STRUCT__entry(
161 __field( unsigned int, usec_timeout )
162 __field( unsigned int, usec_delayed )
163 ),
164
165 TP_fast_assign(
166 __entry->usec_timeout = usec_timeout;
167 __entry->usec_delayed = usec_delayed;
168 ),
169
170 TP_printk("usec_timeout=%u usec_delayed=%u",
171 __entry->usec_timeout,
172 __entry->usec_delayed)
173);
174
175DEFINE_EVENT(writeback_congest_waited_template, writeback_congestion_wait,
176
177 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
178
179 TP_ARGS(usec_timeout, usec_delayed)
180);
181
182DEFINE_EVENT(writeback_congest_waited_template, writeback_wait_iff_congested,
183
184 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
185
186 TP_ARGS(usec_timeout, usec_delayed)
187);
188
156#endif /* _TRACE_WRITEBACK_H */ 189#endif /* _TRACE_WRITEBACK_H */
157 190
158/* This part must be outside protection */ 191/* This part must be outside protection */
diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h
index 577cf18cce8..1e1aa54ab2e 100644
--- a/include/video/sh_mobile_hdmi.h
+++ b/include/video/sh_mobile_hdmi.h
@@ -14,9 +14,25 @@
14struct sh_mobile_lcdc_chan_cfg; 14struct sh_mobile_lcdc_chan_cfg;
15struct device; 15struct device;
16 16
17/*
18 * flags format
19 *
20 * 0x0000000A
21 *
22 * A: Audio source select
23 */
24
25/* Audio source select */
26#define HDMI_SND_SRC_MASK (0xF << 0)
27#define HDMI_SND_SRC_I2S (0 << 0) /* default */
28#define HDMI_SND_SRC_SPDIF (1 << 0)
29#define HDMI_SND_SRC_DSD (2 << 0)
30#define HDMI_SND_SRC_HBR (3 << 0)
31
17struct sh_mobile_hdmi_info { 32struct sh_mobile_hdmi_info {
18 struct sh_mobile_lcdc_chan_cfg *lcd_chan; 33 struct sh_mobile_lcdc_chan_cfg *lcd_chan;
19 struct device *lcd_dev; 34 struct device *lcd_dev;
35 unsigned int flags;
20}; 36};
21 37
22#endif 38#endif
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
index 55d700e8566..daabae5817c 100644
--- a/include/video/sh_mobile_lcdc.h
+++ b/include/video/sh_mobile_lcdc.h
@@ -49,7 +49,9 @@ struct sh_mobile_lcdc_sys_bus_ops {
49 unsigned long (*read_data)(void *handle); 49 unsigned long (*read_data)(void *handle);
50}; 50};
51 51
52struct module;
52struct sh_mobile_lcdc_board_cfg { 53struct sh_mobile_lcdc_board_cfg {
54 struct module *owner;
53 void *board_data; 55 void *board_data;
54 int (*setup_sys)(void *board_data, void *sys_ops_handle, 56 int (*setup_sys)(void *board_data, void *sys_ops_handle,
55 struct sh_mobile_lcdc_sys_bus_ops *sys_ops); 57 struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
@@ -70,7 +72,8 @@ struct sh_mobile_lcdc_chan_cfg {
70 int interface_type; /* selects RGBn or SYSn I/F, see above */ 72 int interface_type; /* selects RGBn or SYSn I/F, see above */
71 int clock_divider; 73 int clock_divider;
72 unsigned long flags; /* LCDC_FLAGS_... */ 74 unsigned long flags; /* LCDC_FLAGS_... */
73 struct fb_videomode lcd_cfg; 75 const struct fb_videomode *lcd_cfg;
76 int num_cfg;
74 struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg; 77 struct sh_mobile_lcdc_lcd_size_cfg lcd_size_cfg;
75 struct sh_mobile_lcdc_board_cfg board_cfg; 78 struct sh_mobile_lcdc_board_cfg board_cfg;
76 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ 79 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
diff --git a/include/video/vga.h b/include/video/vga.h
index b49a5120ca2..2b8691f7d25 100644
--- a/include/video/vga.h
+++ b/include/video/vga.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright history from vga16fb.c: 6 * Copyright history from vga16fb.c:
7 * Copyright 1999 Ben Pfaff and Petr Vandrovec 7 * Copyright 1999 Ben Pfaff and Petr Vandrovec
8 * Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm 8 * Based on VGA info at http://www.osdever.net/FreeVGA/home.htm
9 * Based on VESA framebuffer (c) 1998 Gerd Knorr 9 * Based on VESA framebuffer (c) 1998 Gerd Knorr
10 * 10 *
11 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
diff --git a/include/xen/Kbuild b/include/xen/Kbuild
index 4e65c16a445..84ad8f02fee 100644
--- a/include/xen/Kbuild
+++ b/include/xen/Kbuild
@@ -1 +1,2 @@
1header-y += evtchn.h 1header-y += evtchn.h
2header-y += privcmd.h
diff --git a/include/xen/events.h b/include/xen/events.h
index a15d93262e3..646dd17d3aa 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -12,6 +12,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
12 irq_handler_t handler, 12 irq_handler_t handler,
13 unsigned long irqflags, const char *devname, 13 unsigned long irqflags, const char *devname,
14 void *dev_id); 14 void *dev_id);
15int bind_virq_to_irq(unsigned int virq, unsigned int cpu);
15int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, 16int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
16 irq_handler_t handler, 17 irq_handler_t handler,
17 unsigned long irqflags, const char *devname, 18 unsigned long irqflags, const char *devname,
@@ -53,6 +54,10 @@ bool xen_test_irq_pending(int irq);
53 irq will be disabled so it won't deliver an interrupt. */ 54 irq will be disabled so it won't deliver an interrupt. */
54void xen_poll_irq(int irq); 55void xen_poll_irq(int irq);
55 56
57/* Poll waiting for an irq to become pending with a timeout. In the usual case,
58 * the irq will be disabled so it won't deliver an interrupt. */
59void xen_poll_irq_timeout(int irq, u64 timeout);
60
56/* Determine the IRQ which is bound to an event channel */ 61/* Determine the IRQ which is bound to an event channel */
57unsigned irq_from_evtchn(unsigned int evtchn); 62unsigned irq_from_evtchn(unsigned int evtchn);
58 63
@@ -63,4 +68,25 @@ int xen_set_callback_via(uint64_t via);
63void xen_evtchn_do_upcall(struct pt_regs *regs); 68void xen_evtchn_do_upcall(struct pt_regs *regs);
64void xen_hvm_evtchn_do_upcall(void); 69void xen_hvm_evtchn_do_upcall(void);
65 70
71/* Allocate an irq for a physical interrupt, given a gsi. "Legacy"
72 * GSIs are identity mapped; others are dynamically allocated as
73 * usual. */
74int xen_allocate_pirq(unsigned gsi, int shareable, char *name);
75int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name);
76
77#ifdef CONFIG_PCI_MSI
78/* Allocate an irq and a pirq to be used with MSIs. */
79void xen_allocate_pirq_msi(char *name, int *irq, int *pirq);
80int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type);
81#endif
82
83/* De-allocates the above mentioned physical interrupt. */
84int xen_destroy_irq(int irq);
85
86/* Return vector allocated to pirq */
87int xen_vector_from_irq(unsigned pirq);
88
89/* Return gsi allocated to pirq */
90int xen_gsi_from_irq(unsigned pirq);
91
66#endif /* _XEN_EVENTS_H */ 92#endif /* _XEN_EVENTS_H */
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h
index 70d2563ab16..b6ca39a069d 100644
--- a/include/xen/interface/features.h
+++ b/include/xen/interface/features.h
@@ -47,6 +47,9 @@
47/* x86: pvclock algorithm is safe to use on HVM */ 47/* x86: pvclock algorithm is safe to use on HVM */
48#define XENFEAT_hvm_safe_pvclock 9 48#define XENFEAT_hvm_safe_pvclock 9
49 49
50/* x86: pirq can be used by HVM guests */
51#define XENFEAT_hvm_pirqs 10
52
50#define XENFEAT_NR_SUBMAPS 1 53#define XENFEAT_NR_SUBMAPS 1
51 54
52#endif /* __XEN_PUBLIC_FEATURES_H__ */ 55#endif /* __XEN_PUBLIC_FEATURES_H__ */
diff --git a/include/xen/interface/io/pciif.h b/include/xen/interface/io/pciif.h
new file mode 100644
index 00000000000..d9922ae36eb
--- /dev/null
+++ b/include/xen/interface/io/pciif.h
@@ -0,0 +1,112 @@
1/*
2 * PCI Backend/Frontend Common Data Structures & Macros
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 *
22 * Author: Ryan Wilson <hap9@epoch.ncsc.mil>
23 */
24#ifndef __XEN_PCI_COMMON_H__
25#define __XEN_PCI_COMMON_H__
26
27/* Be sure to bump this number if you change this file */
28#define XEN_PCI_MAGIC "7"
29
30/* xen_pci_sharedinfo flags */
31#define _XEN_PCIF_active (0)
32#define XEN_PCIF_active (1<<_XEN_PCIF_active)
33#define _XEN_PCIB_AERHANDLER (1)
34#define XEN_PCIB_AERHANDLER (1<<_XEN_PCIB_AERHANDLER)
35#define _XEN_PCIB_active (2)
36#define XEN_PCIB_active (1<<_XEN_PCIB_active)
37
38/* xen_pci_op commands */
39#define XEN_PCI_OP_conf_read (0)
40#define XEN_PCI_OP_conf_write (1)
41#define XEN_PCI_OP_enable_msi (2)
42#define XEN_PCI_OP_disable_msi (3)
43#define XEN_PCI_OP_enable_msix (4)
44#define XEN_PCI_OP_disable_msix (5)
45#define XEN_PCI_OP_aer_detected (6)
46#define XEN_PCI_OP_aer_resume (7)
47#define XEN_PCI_OP_aer_mmio (8)
48#define XEN_PCI_OP_aer_slotreset (9)
49
50/* xen_pci_op error numbers */
51#define XEN_PCI_ERR_success (0)
52#define XEN_PCI_ERR_dev_not_found (-1)
53#define XEN_PCI_ERR_invalid_offset (-2)
54#define XEN_PCI_ERR_access_denied (-3)
55#define XEN_PCI_ERR_not_implemented (-4)
56/* XEN_PCI_ERR_op_failed - backend failed to complete the operation */
57#define XEN_PCI_ERR_op_failed (-5)
58
59/*
60 * it should be PAGE_SIZE-sizeof(struct xen_pci_op))/sizeof(struct msix_entry))
61 * Should not exceed 128
62 */
63#define SH_INFO_MAX_VEC 128
64
65struct xen_msix_entry {
66 uint16_t vector;
67 uint16_t entry;
68};
69struct xen_pci_op {
70 /* IN: what action to perform: XEN_PCI_OP_* */
71 uint32_t cmd;
72
73 /* OUT: will contain an error number (if any) from errno.h */
74 int32_t err;
75
76 /* IN: which device to touch */
77 uint32_t domain; /* PCI Domain/Segment */
78 uint32_t bus;
79 uint32_t devfn;
80
81 /* IN: which configuration registers to touch */
82 int32_t offset;
83 int32_t size;
84
85 /* IN/OUT: Contains the result after a READ or the value to WRITE */
86 uint32_t value;
87 /* IN: Contains extra infor for this operation */
88 uint32_t info;
89 /*IN: param for msi-x */
90 struct xen_msix_entry msix_entries[SH_INFO_MAX_VEC];
91};
92
93/*used for pcie aer handling*/
94struct xen_pcie_aer_op {
95 /* IN: what action to perform: XEN_PCI_OP_* */
96 uint32_t cmd;
97 /*IN/OUT: return aer_op result or carry error_detected state as input*/
98 int32_t err;
99
100 /* IN: which device to touch */
101 uint32_t domain; /* PCI Domain/Segment*/
102 uint32_t bus;
103 uint32_t devfn;
104};
105struct xen_pci_sharedinfo {
106 /* flags - XEN_PCIF_* */
107 uint32_t flags;
108 struct xen_pci_op op;
109 struct xen_pcie_aer_op aer_op;
110};
111
112#endif /* __XEN_PCI_COMMON_H__ */
diff --git a/include/xen/interface/io/xenbus.h b/include/xen/interface/io/xenbus.h
index 46508c7fa39..9fda532973a 100644
--- a/include/xen/interface/io/xenbus.h
+++ b/include/xen/interface/io/xenbus.h
@@ -27,8 +27,14 @@ enum xenbus_state
27 XenbusStateClosing = 5, /* The device is being closed 27 XenbusStateClosing = 5, /* The device is being closed
28 due to an error or an unplug 28 due to an error or an unplug
29 event. */ 29 event. */
30 XenbusStateClosed = 6 30 XenbusStateClosed = 6,
31 31
32 /*
33 * Reconfiguring: The device is being reconfigured.
34 */
35 XenbusStateReconfiguring = 7,
36
37 XenbusStateReconfigured = 8
32}; 38};
33 39
34#endif /* _XEN_PUBLIC_IO_XENBUS_H */ 40#endif /* _XEN_PUBLIC_IO_XENBUS_H */
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h
index d3938d3e71f..d7a6c13bde6 100644
--- a/include/xen/interface/memory.h
+++ b/include/xen/interface/memory.h
@@ -186,6 +186,35 @@ struct xen_translate_gpfn_list {
186}; 186};
187DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list); 187DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list);
188 188
189/*
190 * Returns the pseudo-physical memory map as it was when the domain
191 * was started (specified by XENMEM_set_memory_map).
192 * arg == addr of struct xen_memory_map.
193 */
194#define XENMEM_memory_map 9
195struct xen_memory_map {
196 /*
197 * On call the number of entries which can be stored in buffer. On
198 * return the number of entries which have been stored in
199 * buffer.
200 */
201 unsigned int nr_entries;
202
203 /*
204 * Entries in the buffer are in the same format as returned by the
205 * BIOS INT 0x15 EAX=0xE820 call.
206 */
207 GUEST_HANDLE(void) buffer;
208};
209DEFINE_GUEST_HANDLE_STRUCT(xen_memory_map);
210
211/*
212 * Returns the real physical memory map. Passes the same structure as
213 * XENMEM_memory_map.
214 * arg == addr of struct xen_memory_map.
215 */
216#define XENMEM_machine_memory_map 10
217
189 218
190/* 219/*
191 * Prevent the balloon driver from changing the memory reservation 220 * Prevent the balloon driver from changing the memory reservation
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
index cd6939147cb..2b2c66c3df0 100644
--- a/include/xen/interface/physdev.h
+++ b/include/xen/interface/physdev.h
@@ -106,6 +106,57 @@ struct physdev_irq {
106 uint32_t vector; 106 uint32_t vector;
107}; 107};
108 108
109#define MAP_PIRQ_TYPE_MSI 0x0
110#define MAP_PIRQ_TYPE_GSI 0x1
111#define MAP_PIRQ_TYPE_UNKNOWN 0x2
112
113#define PHYSDEVOP_map_pirq 13
114struct physdev_map_pirq {
115 domid_t domid;
116 /* IN */
117 int type;
118 /* IN */
119 int index;
120 /* IN or OUT */
121 int pirq;
122 /* IN */
123 int bus;
124 /* IN */
125 int devfn;
126 /* IN */
127 int entry_nr;
128 /* IN */
129 uint64_t table_base;
130};
131
132#define PHYSDEVOP_unmap_pirq 14
133struct physdev_unmap_pirq {
134 domid_t domid;
135 /* IN */
136 int pirq;
137};
138
139#define PHYSDEVOP_manage_pci_add 15
140#define PHYSDEVOP_manage_pci_remove 16
141struct physdev_manage_pci {
142 /* IN */
143 uint8_t bus;
144 uint8_t devfn;
145};
146
147#define PHYSDEVOP_manage_pci_add_ext 20
148struct physdev_manage_pci_ext {
149 /* IN */
150 uint8_t bus;
151 uint8_t devfn;
152 unsigned is_extfn;
153 unsigned is_virtfn;
154 struct {
155 uint8_t bus;
156 uint8_t devfn;
157 } physfn;
158};
159
109/* 160/*
110 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op() 161 * Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
111 * hypercall since 0x00030202. 162 * hypercall since 0x00030202.
@@ -121,6 +172,22 @@ struct physdev_op {
121 } u; 172 } u;
122}; 173};
123 174
175#define PHYSDEVOP_setup_gsi 21
176struct physdev_setup_gsi {
177 int gsi;
178 /* IN */
179 uint8_t triggering;
180 /* IN */
181 uint8_t polarity;
182 /* IN */
183};
184
185#define PHYSDEVOP_get_nr_pirqs 22
186struct physdev_nr_pirqs {
187 /* OUT */
188 uint32_t nr_pirqs;
189};
190
124/* 191/*
125 * Notify that some PIRQ-bound event channels have been unmasked. 192 * Notify that some PIRQ-bound event channels have been unmasked.
126 * ** This command is obsolete since interface version 0x00030202 and is ** 193 * ** This command is obsolete since interface version 0x00030202 and is **
diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h
new file mode 100644
index 00000000000..b42cdfd92fe
--- /dev/null
+++ b/include/xen/privcmd.h
@@ -0,0 +1,80 @@
1/******************************************************************************
2 * privcmd.h
3 *
4 * Interface to /proc/xen/privcmd.
5 *
6 * Copyright (c) 2003-2005, K A Fraser
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation; or, when distributed
11 * separately from the Linux kernel or incorporated into other
12 * software packages, subject to the following license:
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a copy
15 * of this source file (the "Software"), to deal in the Software without
16 * restriction, including without limitation the rights to use, copy, modify,
17 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
18 * and to permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30 * IN THE SOFTWARE.
31 */
32
33#ifndef __LINUX_PUBLIC_PRIVCMD_H__
34#define __LINUX_PUBLIC_PRIVCMD_H__
35
36#include <linux/types.h>
37
38typedef unsigned long xen_pfn_t;
39
40#ifndef __user
41#define __user
42#endif
43
44struct privcmd_hypercall {
45 __u64 op;
46 __u64 arg[5];
47};
48
49struct privcmd_mmap_entry {
50 __u64 va;
51 __u64 mfn;
52 __u64 npages;
53};
54
55struct privcmd_mmap {
56 int num;
57 domid_t dom; /* target domain */
58 struct privcmd_mmap_entry __user *entry;
59};
60
61struct privcmd_mmapbatch {
62 int num; /* number of pages to populate */
63 domid_t dom; /* target domain */
64 __u64 addr; /* virtual address */
65 xen_pfn_t __user *arr; /* array of mfns - top nibble set on err */
66};
67
68/*
69 * @cmd: IOCTL_PRIVCMD_HYPERCALL
70 * @arg: &privcmd_hypercall_t
71 * Return: Value returned from execution of the specified hypercall.
72 */
73#define IOCTL_PRIVCMD_HYPERCALL \
74 _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall))
75#define IOCTL_PRIVCMD_MMAP \
76 _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap))
77#define IOCTL_PRIVCMD_MMAPBATCH \
78 _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))
79
80#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 351f4051f6d..98b92154a26 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -23,4 +23,9 @@ int xen_create_contiguous_region(unsigned long vstart, unsigned int order,
23 23
24void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order); 24void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order);
25 25
26int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
27 unsigned long addr,
28 unsigned long mfn, int nr,
29 pgprot_t prot, unsigned domid);
30
26#endif /* INCLUDE_XEN_OPS_H */ 31#endif /* INCLUDE_XEN_OPS_H */