aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/alarmtimer.h31
-rw-r--r--include/linux/audit.h69
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h2
-rw-r--r--include/linux/binfmts.h6
-rw-r--r--include/linux/bio.h70
-rw-r--r--include/linux/blk_types.h36
-rw-r--r--include/linux/blkdev.h82
-rw-r--r--include/linux/caif/Kbuild2
-rw-r--r--include/linux/can/Kbuild5
-rw-r--r--include/linux/clocksource.h16
-rw-r--r--include/linux/compat.h8
-rw-r--r--include/linux/compiler-gcc4.h2
-rw-r--r--include/linux/console.h10
-rw-r--r--include/linux/dvb/version.h2
-rw-r--r--include/linux/dw_dmac.h7
-rw-r--r--include/linux/edma.h29
-rw-r--r--include/linux/fs.h32
-rw-r--r--include/linux/fsnotify.h8
-rw-r--r--include/linux/i2c-algo-pca.h1
-rw-r--r--include/linux/i2c-omap.h1
-rw-r--r--include/linux/i2c/i2c-rcar.h10
-rw-r--r--include/linux/if_link.h6
-rw-r--r--include/linux/if_vlan.h8
-rw-r--r--include/linux/input.h10
-rw-r--r--include/linux/isdn/Kbuild1
-rw-r--r--include/linux/jiffies.h20
-rw-r--r--include/linux/leds-lp5523.h1
-rw-r--r--include/linux/leds.h4
-rw-r--r--include/linux/lglock.h19
-rw-r--r--include/linux/memcontrol.h4
-rw-r--r--include/linux/mmc/Kbuild1
-rw-r--r--include/linux/mmc/card.h18
-rw-r--r--include/linux/mmc/core.h4
-rw-r--r--include/linux/mmc/dw_mmc.h15
-rw-r--r--include/linux/mmc/host.h5
-rw-r--r--include/linux/mmc/mmc.h19
-rw-r--r--include/linux/mmc/sdhci.h3
-rw-r--r--include/linux/mtd/bbm.h7
-rw-r--r--include/linux/mtd/lpc32xx_mlc.h20
-rw-r--r--include/linux/mtd/lpc32xx_slc.h20
-rw-r--r--include/linux/mtd/mtd.h9
-rw-r--r--include/linux/mtd/nand.h72
-rw-r--r--include/linux/mtd/sh_flctl.h23
-rw-r--r--include/linux/netdevice.h19
-rw-r--r--include/linux/netfilter/Kbuild77
-rw-r--r--include/linux/netfilter/ipset/Kbuild4
-rw-r--r--include/linux/netfilter/ipset/ip_set.h225
-rw-r--r--include/linux/netfilter/ipset/ip_set_bitmap.h11
-rw-r--r--include/linux/netfilter/ipset/ip_set_hash.h19
-rw-r--r--include/linux/netfilter/ipset/ip_set_list.h19
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h115
-rw-r--r--include/linux/netfilter/nf_conntrack_ftp.h16
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h49
-rw-r--r--include/linux/netfilter/nfnetlink.h55
-rw-r--r--include/linux/netfilter/nfnetlink_acct.h25
-rw-r--r--include/linux/netfilter/x_tables.h186
-rw-r--r--include/linux/netfilter/xt_hashlimit.h71
-rw-r--r--include/linux/netfilter/xt_physdev.h21
-rw-r--r--include/linux/netfilter_arp/Kbuild2
-rw-r--r--include/linux/netfilter_arp/arp_tables.h200
-rw-r--r--include/linux/netfilter_bridge/Kbuild18
-rw-r--r--include/linux/netfilter_bridge/ebt_802_3.h61
-rw-r--r--include/linux/netfilter_bridge/ebtables.h255
-rw-r--r--include/linux/netfilter_ipv4/Kbuild10
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h218
-rw-r--r--include/linux/netfilter_ipv6/Kbuild12
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h256
-rw-r--r--include/linux/netlink.h20
-rw-r--r--include/linux/nfs_fs.h11
-rw-r--r--include/linux/nfs_fs_sb.h3
-rw-r--r--include/linux/nfs_xdr.h5
-rw-r--r--include/linux/nfsd/Kbuild5
-rw-r--r--include/linux/nfsd/debug.h31
-rw-r--r--include/linux/nfsd/export.h52
-rw-r--r--include/linux/nfsd/nfsfh.h111
-rw-r--r--include/linux/nfsd/stats.h8
-rw-r--r--include/linux/of_mdio.h20
-rw-r--r--include/linux/pageblock-flags.h6
-rw-r--r--include/linux/percpu-rwsem.h89
-rw-r--r--include/linux/perf_event.h2
-rw-r--r--include/linux/platform_data/i2c-nomadik.h2
-rw-r--r--include/linux/platform_data/leds-lm3556.h50
-rw-r--r--include/linux/platform_data/leds-lm355x.h66
-rw-r--r--include/linux/platform_data/leds-lm3642.h38
-rw-r--r--include/linux/platform_data/leds-pca9633.h35
-rw-r--r--include/linux/platform_data/mipi-csis.h30
-rw-r--r--include/linux/platform_data/mmp_dma.h19
-rw-r--r--include/linux/platform_data/pxa_sdhci.h1
-rw-r--r--include/linux/ptrace.h4
-rw-r--r--include/linux/pwm.h108
-rw-r--r--include/linux/rio.h3
-rw-r--r--include/linux/scatterlist.h1
-rw-r--r--include/linux/sched.h3
-rw-r--r--include/linux/security.h12
-rw-r--r--include/linux/skbuff.h24
-rw-r--r--include/linux/sunrpc/Kbuild1
-rw-r--r--include/linux/sunrpc/clnt.h2
-rw-r--r--include/linux/sunrpc/debug.h39
-rw-r--r--include/linux/sunrpc/svc_xprt.h5
-rw-r--r--include/linux/sunrpc/svcsock.h3
-rw-r--r--include/linux/sunrpc/xprt.h3
-rw-r--r--include/linux/syscalls.h8
-rw-r--r--include/linux/tc_act/Kbuild7
-rw-r--r--include/linux/tc_ematch/Kbuild4
-rw-r--r--include/linux/timekeeper_internal.h108
-rw-r--r--include/linux/usb/usbnet.h2
-rw-r--r--include/linux/v4l2-controls.h42
-rw-r--r--include/linux/v4l2-mediabus.h5
-rw-r--r--include/linux/videodev2.h5
-rw-r--r--include/linux/virtio_scsi.h2
-rw-r--r--include/linux/wimax/Kbuild1
-rw-r--r--include/media/davinci/vpbe.h14
-rw-r--r--include/media/davinci/vpbe_types.h8
-rw-r--r--include/media/davinci/vpbe_venc.h2
-rw-r--r--include/media/davinci/vpif_types.h26
-rw-r--r--include/media/s5p_fimc.h2
-rw-r--r--include/media/v4l2-ctrls.h23
-rw-r--r--include/media/v4l2-subdev.h48
-rw-r--r--include/mtd/Kbuild5
-rw-r--r--include/net/flow.h1
-rw-r--r--include/net/route.h3
-rw-r--r--include/rdma/rdma_netlink.h1
-rw-r--r--include/scsi/fc/fc_fcp.h6
-rw-r--r--include/scsi/libfcoe.h2
-rw-r--r--include/scsi/scsi_cmnd.h12
-rw-r--r--include/target/target_core_backend.h3
-rw-r--r--include/target/target_core_fabric.h5
-rw-r--r--include/trace/events/btrfs.h14
-rw-r--r--include/uapi/linux/caif/Kbuild2
-rw-r--r--include/uapi/linux/caif/caif_socket.h (renamed from include/linux/caif/caif_socket.h)0
-rw-r--r--include/uapi/linux/caif/if_caif.h (renamed from include/linux/caif/if_caif.h)0
-rw-r--r--include/uapi/linux/can/Kbuild5
-rw-r--r--include/uapi/linux/can/bcm.h (renamed from include/linux/can/bcm.h)0
-rw-r--r--include/uapi/linux/can/error.h (renamed from include/linux/can/error.h)0
-rw-r--r--include/uapi/linux/can/gw.h (renamed from include/linux/can/gw.h)0
-rw-r--r--include/uapi/linux/can/netlink.h (renamed from include/linux/can/netlink.h)0
-rw-r--r--include/uapi/linux/can/raw.h (renamed from include/linux/can/raw.h)0
-rw-r--r--include/uapi/linux/isdn/Kbuild1
-rw-r--r--include/uapi/linux/isdn/capicmd.h (renamed from include/linux/isdn/capicmd.h)0
-rw-r--r--include/uapi/linux/mmc/Kbuild1
-rw-r--r--include/uapi/linux/mmc/ioctl.h (renamed from include/linux/mmc/ioctl.h)0
-rw-r--r--include/uapi/linux/netfilter/Kbuild76
-rw-r--r--include/uapi/linux/netfilter/ipset/Kbuild4
-rw-r--r--include/uapi/linux/netfilter/ipset/ip_set.h231
-rw-r--r--include/uapi/linux/netfilter/ipset/ip_set_bitmap.h13
-rw-r--r--include/uapi/linux/netfilter/ipset/ip_set_hash.h21
-rw-r--r--include/uapi/linux/netfilter/ipset/ip_set_list.h21
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_common.h117
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_ftp.h18
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_sctp.h (renamed from include/linux/netfilter/nf_conntrack_sctp.h)0
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_tcp.h51
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_tuple_common.h (renamed from include/linux/netfilter/nf_conntrack_tuple_common.h)0
-rw-r--r--include/uapi/linux/netfilter/nf_nat.h (renamed from include/linux/netfilter/nf_nat.h)0
-rw-r--r--include/uapi/linux/netfilter/nfnetlink.h56
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_acct.h27
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_compat.h (renamed from include/linux/netfilter/nfnetlink_compat.h)0
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_conntrack.h (renamed from include/linux/netfilter/nfnetlink_conntrack.h)0
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_cthelper.h (renamed from include/linux/netfilter/nfnetlink_cthelper.h)0
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_cttimeout.h (renamed from include/linux/netfilter/nfnetlink_cttimeout.h)0
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_log.h (renamed from include/linux/netfilter/nfnetlink_log.h)0
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_queue.h (renamed from include/linux/netfilter/nfnetlink_queue.h)0
-rw-r--r--include/uapi/linux/netfilter/x_tables.h187
-rw-r--r--include/uapi/linux/netfilter/xt_AUDIT.h (renamed from include/linux/netfilter/xt_AUDIT.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_CHECKSUM.h (renamed from include/linux/netfilter/xt_CHECKSUM.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_CLASSIFY.h (renamed from include/linux/netfilter/xt_CLASSIFY.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_CONNMARK.h (renamed from include/linux/netfilter/xt_CONNMARK.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_CONNSECMARK.h (renamed from include/linux/netfilter/xt_CONNSECMARK.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_CT.h (renamed from include/linux/netfilter/xt_CT.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_DSCP.h (renamed from include/linux/netfilter/xt_DSCP.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_IDLETIMER.h (renamed from include/linux/netfilter/xt_IDLETIMER.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_LED.h (renamed from include/linux/netfilter/xt_LED.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_LOG.h (renamed from include/linux/netfilter/xt_LOG.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_MARK.h (renamed from include/linux/netfilter/xt_MARK.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_NFLOG.h (renamed from include/linux/netfilter/xt_NFLOG.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_NFQUEUE.h (renamed from include/linux/netfilter/xt_NFQUEUE.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_RATEEST.h (renamed from include/linux/netfilter/xt_RATEEST.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_SECMARK.h (renamed from include/linux/netfilter/xt_SECMARK.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_TCPMSS.h (renamed from include/linux/netfilter/xt_TCPMSS.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_TCPOPTSTRIP.h (renamed from include/linux/netfilter/xt_TCPOPTSTRIP.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_TEE.h (renamed from include/linux/netfilter/xt_TEE.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_TPROXY.h (renamed from include/linux/netfilter/xt_TPROXY.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_addrtype.h (renamed from include/linux/netfilter/xt_addrtype.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_cluster.h (renamed from include/linux/netfilter/xt_cluster.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_comment.h (renamed from include/linux/netfilter/xt_comment.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_connbytes.h (renamed from include/linux/netfilter/xt_connbytes.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_connlimit.h (renamed from include/linux/netfilter/xt_connlimit.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_connmark.h (renamed from include/linux/netfilter/xt_connmark.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_conntrack.h (renamed from include/linux/netfilter/xt_conntrack.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_cpu.h (renamed from include/linux/netfilter/xt_cpu.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_dccp.h (renamed from include/linux/netfilter/xt_dccp.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_devgroup.h (renamed from include/linux/netfilter/xt_devgroup.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_dscp.h (renamed from include/linux/netfilter/xt_dscp.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_ecn.h (renamed from include/linux/netfilter/xt_ecn.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_esp.h (renamed from include/linux/netfilter/xt_esp.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_hashlimit.h73
-rw-r--r--include/uapi/linux/netfilter/xt_helper.h (renamed from include/linux/netfilter/xt_helper.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_iprange.h (renamed from include/linux/netfilter/xt_iprange.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_ipvs.h (renamed from include/linux/netfilter/xt_ipvs.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_length.h (renamed from include/linux/netfilter/xt_length.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_limit.h (renamed from include/linux/netfilter/xt_limit.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_mac.h (renamed from include/linux/netfilter/xt_mac.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_mark.h (renamed from include/linux/netfilter/xt_mark.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_multiport.h (renamed from include/linux/netfilter/xt_multiport.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_nfacct.h (renamed from include/linux/netfilter/xt_nfacct.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_osf.h (renamed from include/linux/netfilter/xt_osf.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_owner.h (renamed from include/linux/netfilter/xt_owner.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_physdev.h23
-rw-r--r--include/uapi/linux/netfilter/xt_pkttype.h (renamed from include/linux/netfilter/xt_pkttype.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_policy.h (renamed from include/linux/netfilter/xt_policy.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_quota.h (renamed from include/linux/netfilter/xt_quota.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_rateest.h (renamed from include/linux/netfilter/xt_rateest.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_realm.h (renamed from include/linux/netfilter/xt_realm.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_recent.h (renamed from include/linux/netfilter/xt_recent.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_sctp.h (renamed from include/linux/netfilter/xt_sctp.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_set.h (renamed from include/linux/netfilter/xt_set.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_socket.h (renamed from include/linux/netfilter/xt_socket.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_state.h (renamed from include/linux/netfilter/xt_state.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_statistic.h (renamed from include/linux/netfilter/xt_statistic.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_string.h (renamed from include/linux/netfilter/xt_string.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_tcpmss.h (renamed from include/linux/netfilter/xt_tcpmss.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_tcpudp.h (renamed from include/linux/netfilter/xt_tcpudp.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_time.h (renamed from include/linux/netfilter/xt_time.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_u32.h (renamed from include/linux/netfilter/xt_u32.h)0
-rw-r--r--include/uapi/linux/netfilter_arp/Kbuild2
-rw-r--r--include/uapi/linux/netfilter_arp/arp_tables.h206
-rw-r--r--include/uapi/linux/netfilter_arp/arpt_mangle.h (renamed from include/linux/netfilter_arp/arpt_mangle.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/Kbuild18
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_802_3.h62
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_among.h (renamed from include/linux/netfilter_bridge/ebt_among.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_arp.h (renamed from include/linux/netfilter_bridge/ebt_arp.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_arpreply.h (renamed from include/linux/netfilter_bridge/ebt_arpreply.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_ip.h (renamed from include/linux/netfilter_bridge/ebt_ip.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_ip6.h (renamed from include/linux/netfilter_bridge/ebt_ip6.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_limit.h (renamed from include/linux/netfilter_bridge/ebt_limit.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_log.h (renamed from include/linux/netfilter_bridge/ebt_log.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_mark_m.h (renamed from include/linux/netfilter_bridge/ebt_mark_m.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_mark_t.h (renamed from include/linux/netfilter_bridge/ebt_mark_t.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_nat.h (renamed from include/linux/netfilter_bridge/ebt_nat.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_nflog.h (renamed from include/linux/netfilter_bridge/ebt_nflog.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_pkttype.h (renamed from include/linux/netfilter_bridge/ebt_pkttype.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_redirect.h (renamed from include/linux/netfilter_bridge/ebt_redirect.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_stp.h (renamed from include/linux/netfilter_bridge/ebt_stp.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_ulog.h (renamed from include/linux/netfilter_bridge/ebt_ulog.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_vlan.h (renamed from include/linux/netfilter_bridge/ebt_vlan.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebtables.h268
-rw-r--r--include/uapi/linux/netfilter_ipv4/Kbuild10
-rw-r--r--include/uapi/linux/netfilter_ipv4/ip_tables.h229
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h (renamed from include/linux/netfilter_ipv4/ipt_CLUSTERIP.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_ECN.h (renamed from include/linux/netfilter_ipv4/ipt_ECN.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_LOG.h (renamed from include/linux/netfilter_ipv4/ipt_LOG.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_REJECT.h (renamed from include/linux/netfilter_ipv4/ipt_REJECT.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_TTL.h (renamed from include/linux/netfilter_ipv4/ipt_TTL.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_ULOG.h (renamed from include/linux/netfilter_ipv4/ipt_ULOG.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_ah.h (renamed from include/linux/netfilter_ipv4/ipt_ah.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_ecn.h (renamed from include/linux/netfilter_ipv4/ipt_ecn.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_ttl.h (renamed from include/linux/netfilter_ipv4/ipt_ttl.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/Kbuild12
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6_tables.h267
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_HL.h (renamed from include/linux/netfilter_ipv6/ip6t_HL.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_LOG.h (renamed from include/linux/netfilter_ipv6/ip6t_LOG.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_NPT.h (renamed from include/linux/netfilter_ipv6/ip6t_NPT.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h (renamed from include/linux/netfilter_ipv6/ip6t_REJECT.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_ah.h (renamed from include/linux/netfilter_ipv6/ip6t_ah.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_frag.h (renamed from include/linux/netfilter_ipv6/ip6t_frag.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_hl.h (renamed from include/linux/netfilter_ipv6/ip6t_hl.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_ipv6header.h (renamed from include/linux/netfilter_ipv6/ip6t_ipv6header.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_mh.h (renamed from include/linux/netfilter_ipv6/ip6t_mh.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_opts.h (renamed from include/linux/netfilter_ipv6/ip6t_opts.h)0
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_rt.h (renamed from include/linux/netfilter_ipv6/ip6t_rt.h)0
-rw-r--r--include/uapi/linux/nfsd/Kbuild5
-rw-r--r--include/uapi/linux/nfsd/cld.h (renamed from include/linux/nfsd/cld.h)0
-rw-r--r--include/uapi/linux/nfsd/debug.h40
-rw-r--r--include/uapi/linux/nfsd/export.h58
-rw-r--r--include/uapi/linux/nfsd/nfsfh.h122
-rw-r--r--include/uapi/linux/nfsd/stats.h17
-rw-r--r--include/uapi/linux/sunrpc/Kbuild1
-rw-r--r--include/uapi/linux/sunrpc/debug.h48
-rw-r--r--include/uapi/linux/tc_act/Kbuild7
-rw-r--r--include/uapi/linux/tc_act/tc_csum.h (renamed from include/linux/tc_act/tc_csum.h)0
-rw-r--r--include/uapi/linux/tc_act/tc_gact.h (renamed from include/linux/tc_act/tc_gact.h)0
-rw-r--r--include/uapi/linux/tc_act/tc_ipt.h (renamed from include/linux/tc_act/tc_ipt.h)0
-rw-r--r--include/uapi/linux/tc_act/tc_mirred.h (renamed from include/linux/tc_act/tc_mirred.h)0
-rw-r--r--include/uapi/linux/tc_act/tc_nat.h (renamed from include/linux/tc_act/tc_nat.h)0
-rw-r--r--include/uapi/linux/tc_act/tc_pedit.h (renamed from include/linux/tc_act/tc_pedit.h)0
-rw-r--r--include/uapi/linux/tc_act/tc_skbedit.h (renamed from include/linux/tc_act/tc_skbedit.h)0
-rw-r--r--include/uapi/linux/tc_ematch/Kbuild4
-rw-r--r--include/uapi/linux/tc_ematch/tc_em_cmp.h (renamed from include/linux/tc_ematch/tc_em_cmp.h)0
-rw-r--r--include/uapi/linux/tc_ematch/tc_em_meta.h (renamed from include/linux/tc_ematch/tc_em_meta.h)0
-rw-r--r--include/uapi/linux/tc_ematch/tc_em_nbyte.h (renamed from include/linux/tc_ematch/tc_em_nbyte.h)0
-rw-r--r--include/uapi/linux/tc_ematch/tc_em_text.h (renamed from include/linux/tc_ematch/tc_em_text.h)0
-rw-r--r--include/uapi/linux/wimax/Kbuild1
-rw-r--r--include/uapi/linux/wimax/i2400m.h (renamed from include/linux/wimax/i2400m.h)0
-rw-r--r--include/uapi/mtd/Kbuild5
-rw-r--r--include/uapi/mtd/inftl-user.h (renamed from include/mtd/inftl-user.h)0
-rw-r--r--include/uapi/mtd/mtd-abi.h (renamed from include/mtd/mtd-abi.h)0
-rw-r--r--include/uapi/mtd/mtd-user.h (renamed from include/mtd/mtd-user.h)0
-rw-r--r--include/uapi/mtd/nftl-user.h (renamed from include/mtd/nftl-user.h)0
-rw-r--r--include/uapi/mtd/ubi-user.h (renamed from include/mtd/ubi-user.h)0
-rw-r--r--include/uapi/xen/Kbuild2
-rw-r--r--include/uapi/xen/evtchn.h (renamed from include/xen/evtchn.h)0
-rw-r--r--include/uapi/xen/privcmd.h (renamed from include/xen/privcmd.h)0
-rw-r--r--include/video/omapdss.h112
-rw-r--r--include/video/samsung_fimd.h533
-rw-r--r--include/xen/Kbuild2
-rw-r--r--include/xen/interface/hvm/hvm_op.h19
305 files changed, 4222 insertions, 2588 deletions
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h
index 96c5c249b086..9069694e70eb 100644
--- a/include/linux/alarmtimer.h
+++ b/include/linux/alarmtimer.h
@@ -21,7 +21,6 @@ enum alarmtimer_restart {
21 21
22#define ALARMTIMER_STATE_INACTIVE 0x00 22#define ALARMTIMER_STATE_INACTIVE 0x00
23#define ALARMTIMER_STATE_ENQUEUED 0x01 23#define ALARMTIMER_STATE_ENQUEUED 0x01
24#define ALARMTIMER_STATE_CALLBACK 0x02
25 24
26/** 25/**
27 * struct alarm - Alarm timer structure 26 * struct alarm - Alarm timer structure
@@ -35,6 +34,7 @@ enum alarmtimer_restart {
35 */ 34 */
36struct alarm { 35struct alarm {
37 struct timerqueue_node node; 36 struct timerqueue_node node;
37 struct hrtimer timer;
38 enum alarmtimer_restart (*function)(struct alarm *, ktime_t now); 38 enum alarmtimer_restart (*function)(struct alarm *, ktime_t now);
39 enum alarmtimer_type type; 39 enum alarmtimer_type type;
40 int state; 40 int state;
@@ -43,39 +43,12 @@ struct alarm {
43 43
44void alarm_init(struct alarm *alarm, enum alarmtimer_type type, 44void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
45 enum alarmtimer_restart (*function)(struct alarm *, ktime_t)); 45 enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
46void alarm_start(struct alarm *alarm, ktime_t start); 46int alarm_start(struct alarm *alarm, ktime_t start);
47int alarm_try_to_cancel(struct alarm *alarm); 47int alarm_try_to_cancel(struct alarm *alarm);
48int alarm_cancel(struct alarm *alarm); 48int alarm_cancel(struct alarm *alarm);
49 49
50u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval); 50u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval);
51 51
52/*
53 * A alarmtimer is active, when it is enqueued into timerqueue or the
54 * callback function is running.
55 */
56static inline int alarmtimer_active(const struct alarm *timer)
57{
58 return timer->state != ALARMTIMER_STATE_INACTIVE;
59}
60
61/*
62 * Helper function to check, whether the timer is on one of the queues
63 */
64static inline int alarmtimer_is_queued(struct alarm *timer)
65{
66 return timer->state & ALARMTIMER_STATE_ENQUEUED;
67}
68
69/*
70 * Helper function to check, whether the timer is running the callback
71 * function
72 */
73static inline int alarmtimer_callback_running(struct alarm *timer)
74{
75 return timer->state & ALARMTIMER_STATE_CALLBACK;
76}
77
78
79/* Provide way to access the rtc device being used by alarmtimers */ 52/* Provide way to access the rtc device being used by alarmtimers */
80struct rtc_device *alarmtimer_get_rtcdev(void); 53struct rtc_device *alarmtimer_get_rtcdev(void);
81 54
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 2c83e5f7edb1..e5884f950b4b 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -452,6 +452,16 @@ struct audit_field {
452extern int __init audit_register_class(int class, unsigned *list); 452extern int __init audit_register_class(int class, unsigned *list);
453extern int audit_classify_syscall(int abi, unsigned syscall); 453extern int audit_classify_syscall(int abi, unsigned syscall);
454extern int audit_classify_arch(int arch); 454extern int audit_classify_arch(int arch);
455
456/* audit_names->type values */
457#define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */
458#define AUDIT_TYPE_NORMAL 1 /* a "normal" audit record */
459#define AUDIT_TYPE_PARENT 2 /* a parent audit record */
460#define AUDIT_TYPE_CHILD_DELETE 3 /* a child being deleted */
461#define AUDIT_TYPE_CHILD_CREATE 4 /* a child being created */
462
463struct filename;
464
455#ifdef CONFIG_AUDITSYSCALL 465#ifdef CONFIG_AUDITSYSCALL
456/* These are defined in auditsc.c */ 466/* These are defined in auditsc.c */
457 /* Public API */ 467 /* Public API */
@@ -461,11 +471,14 @@ extern void __audit_syscall_entry(int arch,
461 int major, unsigned long a0, unsigned long a1, 471 int major, unsigned long a0, unsigned long a1,
462 unsigned long a2, unsigned long a3); 472 unsigned long a2, unsigned long a3);
463extern void __audit_syscall_exit(int ret_success, long ret_value); 473extern void __audit_syscall_exit(int ret_success, long ret_value);
464extern void __audit_getname(const char *name); 474extern struct filename *__audit_reusename(const __user char *uptr);
465extern void audit_putname(const char *name); 475extern void __audit_getname(struct filename *name);
466extern void __audit_inode(const char *name, const struct dentry *dentry); 476extern void audit_putname(struct filename *name);
467extern void __audit_inode_child(const struct dentry *dentry, 477extern void __audit_inode(struct filename *name, const struct dentry *dentry,
468 const struct inode *parent); 478 unsigned int parent);
479extern void __audit_inode_child(const struct inode *parent,
480 const struct dentry *dentry,
481 const unsigned char type);
469extern void __audit_seccomp(unsigned long syscall, long signr, int code); 482extern void __audit_seccomp(unsigned long syscall, long signr, int code);
470extern void __audit_ptrace(struct task_struct *t); 483extern void __audit_ptrace(struct task_struct *t);
471 484
@@ -495,19 +508,27 @@ static inline void audit_syscall_exit(void *pt_regs)
495 __audit_syscall_exit(success, return_code); 508 __audit_syscall_exit(success, return_code);
496 } 509 }
497} 510}
498static inline void audit_getname(const char *name) 511static inline struct filename *audit_reusename(const __user char *name)
512{
513 if (unlikely(!audit_dummy_context()))
514 return __audit_reusename(name);
515 return NULL;
516}
517static inline void audit_getname(struct filename *name)
499{ 518{
500 if (unlikely(!audit_dummy_context())) 519 if (unlikely(!audit_dummy_context()))
501 __audit_getname(name); 520 __audit_getname(name);
502} 521}
503static inline void audit_inode(const char *name, const struct dentry *dentry) { 522static inline void audit_inode(struct filename *name, const struct dentry *dentry,
523 unsigned int parent) {
504 if (unlikely(!audit_dummy_context())) 524 if (unlikely(!audit_dummy_context()))
505 __audit_inode(name, dentry); 525 __audit_inode(name, dentry, parent);
506} 526}
507static inline void audit_inode_child(const struct dentry *dentry, 527static inline void audit_inode_child(const struct inode *parent,
508 const struct inode *parent) { 528 const struct dentry *dentry,
529 const unsigned char type) {
509 if (unlikely(!audit_dummy_context())) 530 if (unlikely(!audit_dummy_context()))
510 __audit_inode_child(dentry, parent); 531 __audit_inode_child(parent, dentry, type);
511} 532}
512void audit_core_dumps(long signr); 533void audit_core_dumps(long signr);
513 534
@@ -651,19 +672,29 @@ static inline int audit_dummy_context(void)
651{ 672{
652 return 1; 673 return 1;
653} 674}
654static inline void audit_getname(const char *name) 675static inline struct filename *audit_reusename(const __user char *name)
676{
677 return NULL;
678}
679static inline void audit_getname(struct filename *name)
655{ } 680{ }
656static inline void audit_putname(const char *name) 681static inline void audit_putname(struct filename *name)
657{ } 682{ }
658static inline void __audit_inode(const char *name, const struct dentry *dentry) 683static inline void __audit_inode(struct filename *name,
684 const struct dentry *dentry,
685 unsigned int parent)
659{ } 686{ }
660static inline void __audit_inode_child(const struct dentry *dentry, 687static inline void __audit_inode_child(const struct inode *parent,
661 const struct inode *parent) 688 const struct dentry *dentry,
689 const unsigned char type)
662{ } 690{ }
663static inline void audit_inode(const char *name, const struct dentry *dentry) 691static inline void audit_inode(struct filename *name,
692 const struct dentry *dentry,
693 unsigned int parent)
664{ } 694{ }
665static inline void audit_inode_child(const struct dentry *dentry, 695static inline void audit_inode_child(const struct inode *parent,
666 const struct inode *parent) 696 const struct dentry *dentry,
697 const unsigned char type)
667{ } 698{ }
668static inline void audit_core_dumps(long signr) 699static inline void audit_core_dumps(long signr)
669{ } 700{ }
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 6ba45d2b99db..1cf1749440ac 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -522,6 +522,8 @@ struct bcma_sflash {
522 u32 blocksize; 522 u32 blocksize;
523 u16 numblocks; 523 u16 numblocks;
524 u32 size; 524 u32 size;
525
526 struct mtd_info *mtd;
525}; 527};
526#endif 528#endif
527 529
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 37935c2d2e8f..26531f32bbb2 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -19,6 +19,8 @@ struct pt_regs;
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/unistd.h>
23#include <asm/exec.h>
22 24
23#define CORENAME_MAX_SIZE 128 25#define CORENAME_MAX_SIZE 128
24 26
@@ -135,5 +137,9 @@ extern void install_exec_creds(struct linux_binprm *bprm);
135extern void set_binfmt(struct linux_binfmt *new); 137extern void set_binfmt(struct linux_binfmt *new);
136extern void free_bprm(struct linux_binprm *); 138extern void free_bprm(struct linux_binprm *);
137 139
140#ifdef __ARCH_WANT_KERNEL_EXECVE
141extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn;
142#endif
143
138#endif /* __KERNEL__ */ 144#endif /* __KERNEL__ */
139#endif /* _LINUX_BINFMTS_H */ 145#endif /* _LINUX_BINFMTS_H */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 26435890dc87..820e7aaad4fd 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -212,20 +212,41 @@ extern void bio_pair_release(struct bio_pair *dbio);
212extern struct bio_set *bioset_create(unsigned int, unsigned int); 212extern struct bio_set *bioset_create(unsigned int, unsigned int);
213extern void bioset_free(struct bio_set *); 213extern void bioset_free(struct bio_set *);
214 214
215extern struct bio *bio_alloc(gfp_t, unsigned int);
216extern struct bio *bio_kmalloc(gfp_t, unsigned int);
217extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); 215extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *);
218extern void bio_put(struct bio *); 216extern void bio_put(struct bio *);
219extern void bio_free(struct bio *, struct bio_set *); 217
218extern void __bio_clone(struct bio *, struct bio *);
219extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs);
220
221extern struct bio_set *fs_bio_set;
222
223static inline struct bio *bio_alloc(gfp_t gfp_mask, unsigned int nr_iovecs)
224{
225 return bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set);
226}
227
228static inline struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask)
229{
230 return bio_clone_bioset(bio, gfp_mask, fs_bio_set);
231}
232
233static inline struct bio *bio_kmalloc(gfp_t gfp_mask, unsigned int nr_iovecs)
234{
235 return bio_alloc_bioset(gfp_mask, nr_iovecs, NULL);
236}
237
238static inline struct bio *bio_clone_kmalloc(struct bio *bio, gfp_t gfp_mask)
239{
240 return bio_clone_bioset(bio, gfp_mask, NULL);
241
242}
220 243
221extern void bio_endio(struct bio *, int); 244extern void bio_endio(struct bio *, int);
222struct request_queue; 245struct request_queue;
223extern int bio_phys_segments(struct request_queue *, struct bio *); 246extern int bio_phys_segments(struct request_queue *, struct bio *);
224 247
225extern void __bio_clone(struct bio *, struct bio *);
226extern struct bio *bio_clone(struct bio *, gfp_t);
227
228extern void bio_init(struct bio *); 248extern void bio_init(struct bio *);
249extern void bio_reset(struct bio *);
229 250
230extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); 251extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
231extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, 252extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *,
@@ -304,8 +325,6 @@ struct biovec_slab {
304 struct kmem_cache *slab; 325 struct kmem_cache *slab;
305}; 326};
306 327
307extern struct bio_set *fs_bio_set;
308
309/* 328/*
310 * a small number of entries is fine, not going to be performance critical. 329 * a small number of entries is fine, not going to be performance critical.
311 * basically we just need to survive 330 * basically we just need to survive
@@ -367,9 +386,31 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
367/* 386/*
368 * Check whether this bio carries any data or not. A NULL bio is allowed. 387 * Check whether this bio carries any data or not. A NULL bio is allowed.
369 */ 388 */
370static inline int bio_has_data(struct bio *bio) 389static inline bool bio_has_data(struct bio *bio)
371{ 390{
372 return bio && bio->bi_io_vec != NULL; 391 if (bio && bio->bi_vcnt)
392 return true;
393
394 return false;
395}
396
397static inline bool bio_is_rw(struct bio *bio)
398{
399 if (!bio_has_data(bio))
400 return false;
401
402 if (bio->bi_rw & REQ_WRITE_SAME)
403 return false;
404
405 return true;
406}
407
408static inline bool bio_mergeable(struct bio *bio)
409{
410 if (bio->bi_rw & REQ_NOMERGE_FLAGS)
411 return false;
412
413 return true;
373} 414}
374 415
375/* 416/*
@@ -505,9 +546,8 @@ static inline struct bio *bio_list_get(struct bio_list *bl)
505 546
506#define bio_integrity(bio) (bio->bi_integrity != NULL) 547#define bio_integrity(bio) (bio->bi_integrity != NULL)
507 548
508extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *);
509extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); 549extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int);
510extern void bio_integrity_free(struct bio *, struct bio_set *); 550extern void bio_integrity_free(struct bio *);
511extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int); 551extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int);
512extern int bio_integrity_enabled(struct bio *bio); 552extern int bio_integrity_enabled(struct bio *bio);
513extern int bio_integrity_set_tag(struct bio *, void *, unsigned int); 553extern int bio_integrity_set_tag(struct bio *, void *, unsigned int);
@@ -517,7 +557,7 @@ extern void bio_integrity_endio(struct bio *, int);
517extern void bio_integrity_advance(struct bio *, unsigned int); 557extern void bio_integrity_advance(struct bio *, unsigned int);
518extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); 558extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
519extern void bio_integrity_split(struct bio *, struct bio_pair *, int); 559extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
520extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, struct bio_set *); 560extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t);
521extern int bioset_integrity_create(struct bio_set *, int); 561extern int bioset_integrity_create(struct bio_set *, int);
522extern void bioset_integrity_free(struct bio_set *); 562extern void bioset_integrity_free(struct bio_set *);
523extern void bio_integrity_init(void); 563extern void bio_integrity_init(void);
@@ -549,13 +589,13 @@ static inline int bio_integrity_prep(struct bio *bio)
549 return 0; 589 return 0;
550} 590}
551 591
552static inline void bio_integrity_free(struct bio *bio, struct bio_set *bs) 592static inline void bio_integrity_free(struct bio *bio)
553{ 593{
554 return; 594 return;
555} 595}
556 596
557static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src, 597static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
558 gfp_t gfp_mask, struct bio_set *bs) 598 gfp_t gfp_mask)
559{ 599{
560 return 0; 600 return 0;
561} 601}
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 7b7ac9ccec7a..cdf11191e645 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -59,12 +59,6 @@ struct bio {
59 unsigned int bi_seg_front_size; 59 unsigned int bi_seg_front_size;
60 unsigned int bi_seg_back_size; 60 unsigned int bi_seg_back_size;
61 61
62 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
63
64 atomic_t bi_cnt; /* pin count */
65
66 struct bio_vec *bi_io_vec; /* the actual vec list */
67
68 bio_end_io_t *bi_end_io; 62 bio_end_io_t *bi_end_io;
69 63
70 void *bi_private; 64 void *bi_private;
@@ -80,7 +74,17 @@ struct bio {
80 struct bio_integrity_payload *bi_integrity; /* data integrity */ 74 struct bio_integrity_payload *bi_integrity; /* data integrity */
81#endif 75#endif
82 76
83 bio_destructor_t *bi_destructor; /* destructor */ 77 /*
78 * Everything starting with bi_max_vecs will be preserved by bio_reset()
79 */
80
81 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
82
83 atomic_t bi_cnt; /* pin count */
84
85 struct bio_vec *bi_io_vec; /* the actual vec list */
86
87 struct bio_set *bi_pool;
84 88
85 /* 89 /*
86 * We can inline a number of vecs at the end of the bio, to avoid 90 * We can inline a number of vecs at the end of the bio, to avoid
@@ -90,6 +94,8 @@ struct bio {
90 struct bio_vec bi_inline_vecs[0]; 94 struct bio_vec bi_inline_vecs[0];
91}; 95};
92 96
97#define BIO_RESET_BYTES offsetof(struct bio, bi_max_vecs)
98
93/* 99/*
94 * bio flags 100 * bio flags
95 */ 101 */
@@ -105,6 +111,13 @@ struct bio {
105#define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */ 111#define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */
106#define BIO_QUIET 10 /* Make BIO Quiet */ 112#define BIO_QUIET 10 /* Make BIO Quiet */
107#define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */ 113#define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */
114
115/*
116 * Flags starting here get preserved by bio_reset() - this includes
117 * BIO_POOL_IDX()
118 */
119#define BIO_RESET_BITS 12
120
108#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) 121#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
109 122
110/* 123/*
@@ -134,6 +147,7 @@ enum rq_flag_bits {
134 __REQ_PRIO, /* boost priority in cfq */ 147 __REQ_PRIO, /* boost priority in cfq */
135 __REQ_DISCARD, /* request to discard sectors */ 148 __REQ_DISCARD, /* request to discard sectors */
136 __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ 149 __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
150 __REQ_WRITE_SAME, /* write same block many times */
137 151
138 __REQ_NOIDLE, /* don't anticipate more IO after this one */ 152 __REQ_NOIDLE, /* don't anticipate more IO after this one */
139 __REQ_FUA, /* forced unit access */ 153 __REQ_FUA, /* forced unit access */
@@ -172,15 +186,21 @@ enum rq_flag_bits {
172#define REQ_META (1 << __REQ_META) 186#define REQ_META (1 << __REQ_META)
173#define REQ_PRIO (1 << __REQ_PRIO) 187#define REQ_PRIO (1 << __REQ_PRIO)
174#define REQ_DISCARD (1 << __REQ_DISCARD) 188#define REQ_DISCARD (1 << __REQ_DISCARD)
189#define REQ_WRITE_SAME (1 << __REQ_WRITE_SAME)
175#define REQ_NOIDLE (1 << __REQ_NOIDLE) 190#define REQ_NOIDLE (1 << __REQ_NOIDLE)
176 191
177#define REQ_FAILFAST_MASK \ 192#define REQ_FAILFAST_MASK \
178 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) 193 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
179#define REQ_COMMON_MASK \ 194#define REQ_COMMON_MASK \
180 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | \ 195 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | \
181 REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | REQ_SECURE) 196 REQ_DISCARD | REQ_WRITE_SAME | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | \
197 REQ_SECURE)
182#define REQ_CLONE_MASK REQ_COMMON_MASK 198#define REQ_CLONE_MASK REQ_COMMON_MASK
183 199
200/* This mask is used for both bio and request merge checking */
201#define REQ_NOMERGE_FLAGS \
202 (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA)
203
184#define REQ_RAHEAD (1 << __REQ_RAHEAD) 204#define REQ_RAHEAD (1 << __REQ_RAHEAD)
185#define REQ_THROTTLED (1 << __REQ_THROTTLED) 205#define REQ_THROTTLED (1 << __REQ_THROTTLED)
186 206
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4a2ab7c85393..1756001210d2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -270,6 +270,7 @@ struct queue_limits {
270 unsigned int io_min; 270 unsigned int io_min;
271 unsigned int io_opt; 271 unsigned int io_opt;
272 unsigned int max_discard_sectors; 272 unsigned int max_discard_sectors;
273 unsigned int max_write_same_sectors;
273 unsigned int discard_granularity; 274 unsigned int discard_granularity;
274 unsigned int discard_alignment; 275 unsigned int discard_alignment;
275 276
@@ -540,8 +541,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
540 541
541#define blk_account_rq(rq) \ 542#define blk_account_rq(rq) \
542 (((rq)->cmd_flags & REQ_STARTED) && \ 543 (((rq)->cmd_flags & REQ_STARTED) && \
543 ((rq)->cmd_type == REQ_TYPE_FS || \ 544 ((rq)->cmd_type == REQ_TYPE_FS))
544 ((rq)->cmd_flags & REQ_DISCARD)))
545 545
546#define blk_pm_request(rq) \ 546#define blk_pm_request(rq) \
547 ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND || \ 547 ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND || \
@@ -595,17 +595,39 @@ static inline void blk_clear_rl_full(struct request_list *rl, bool sync)
595 rl->flags &= ~flag; 595 rl->flags &= ~flag;
596} 596}
597 597
598static inline bool rq_mergeable(struct request *rq)
599{
600 if (rq->cmd_type != REQ_TYPE_FS)
601 return false;
598 602
599/* 603 if (rq->cmd_flags & REQ_NOMERGE_FLAGS)
600 * mergeable request must not have _NOMERGE or _BARRIER bit set, nor may 604 return false;
601 * it already be started by driver. 605
602 */ 606 return true;
603#define RQ_NOMERGE_FLAGS \ 607}
604 (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD) 608
605#define rq_mergeable(rq) \ 609static inline bool blk_check_merge_flags(unsigned int flags1,
606 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ 610 unsigned int flags2)
607 (((rq)->cmd_flags & REQ_DISCARD) || \ 611{
608 (rq)->cmd_type == REQ_TYPE_FS)) 612 if ((flags1 & REQ_DISCARD) != (flags2 & REQ_DISCARD))
613 return false;
614
615 if ((flags1 & REQ_SECURE) != (flags2 & REQ_SECURE))
616 return false;
617
618 if ((flags1 & REQ_WRITE_SAME) != (flags2 & REQ_WRITE_SAME))
619 return false;
620
621 return true;
622}
623
624static inline bool blk_write_same_mergeable(struct bio *a, struct bio *b)
625{
626 if (bio_data(a) == bio_data(b))
627 return true;
628
629 return false;
630}
609 631
610/* 632/*
611 * q->prep_rq_fn return values 633 * q->prep_rq_fn return values
@@ -802,6 +824,28 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
802 return blk_rq_cur_bytes(rq) >> 9; 824 return blk_rq_cur_bytes(rq) >> 9;
803} 825}
804 826
827static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q,
828 unsigned int cmd_flags)
829{
830 if (unlikely(cmd_flags & REQ_DISCARD))
831 return q->limits.max_discard_sectors;
832
833 if (unlikely(cmd_flags & REQ_WRITE_SAME))
834 return q->limits.max_write_same_sectors;
835
836 return q->limits.max_sectors;
837}
838
839static inline unsigned int blk_rq_get_max_sectors(struct request *rq)
840{
841 struct request_queue *q = rq->q;
842
843 if (unlikely(rq->cmd_type == REQ_TYPE_BLOCK_PC))
844 return q->limits.max_hw_sectors;
845
846 return blk_queue_get_max_sectors(q, rq->cmd_flags);
847}
848
805/* 849/*
806 * Request issue related functions. 850 * Request issue related functions.
807 */ 851 */
@@ -857,6 +901,8 @@ extern void blk_queue_max_segments(struct request_queue *, unsigned short);
857extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); 901extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
858extern void blk_queue_max_discard_sectors(struct request_queue *q, 902extern void blk_queue_max_discard_sectors(struct request_queue *q,
859 unsigned int max_discard_sectors); 903 unsigned int max_discard_sectors);
904extern void blk_queue_max_write_same_sectors(struct request_queue *q,
905 unsigned int max_write_same_sectors);
860extern void blk_queue_logical_block_size(struct request_queue *, unsigned short); 906extern void blk_queue_logical_block_size(struct request_queue *, unsigned short);
861extern void blk_queue_physical_block_size(struct request_queue *, unsigned int); 907extern void blk_queue_physical_block_size(struct request_queue *, unsigned int);
862extern void blk_queue_alignment_offset(struct request_queue *q, 908extern void blk_queue_alignment_offset(struct request_queue *q,
@@ -987,6 +1033,8 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
987extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *); 1033extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *);
988extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector, 1034extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
989 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags); 1035 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
1036extern int blkdev_issue_write_same(struct block_device *bdev, sector_t sector,
1037 sector_t nr_sects, gfp_t gfp_mask, struct page *page);
990extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, 1038extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
991 sector_t nr_sects, gfp_t gfp_mask); 1039 sector_t nr_sects, gfp_t gfp_mask);
992static inline int sb_issue_discard(struct super_block *sb, sector_t block, 1040static inline int sb_issue_discard(struct super_block *sb, sector_t block,
@@ -1164,6 +1212,16 @@ static inline unsigned int bdev_discard_zeroes_data(struct block_device *bdev)
1164 return queue_discard_zeroes_data(bdev_get_queue(bdev)); 1212 return queue_discard_zeroes_data(bdev_get_queue(bdev));
1165} 1213}
1166 1214
1215static inline unsigned int bdev_write_same(struct block_device *bdev)
1216{
1217 struct request_queue *q = bdev_get_queue(bdev);
1218
1219 if (q)
1220 return q->limits.max_write_same_sectors;
1221
1222 return 0;
1223}
1224
1167static inline int queue_dma_alignment(struct request_queue *q) 1225static inline int queue_dma_alignment(struct request_queue *q)
1168{ 1226{
1169 return q ? q->dma_alignment : 511; 1227 return q ? q->dma_alignment : 511;
diff --git a/include/linux/caif/Kbuild b/include/linux/caif/Kbuild
index a9cf250689dc..e69de29bb2d1 100644
--- a/include/linux/caif/Kbuild
+++ b/include/linux/caif/Kbuild
@@ -1,2 +0,0 @@
1header-y += caif_socket.h
2header-y += if_caif.h
diff --git a/include/linux/can/Kbuild b/include/linux/can/Kbuild
index c62b7f1728f9..e69de29bb2d1 100644
--- a/include/linux/can/Kbuild
+++ b/include/linux/can/Kbuild
@@ -1,5 +0,0 @@
1header-y += raw.h
2header-y += bcm.h
3header-y += gw.h
4header-y += error.h
5header-y += netlink.h
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index fbe89e17124e..4dceaf8ae152 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -319,22 +319,6 @@ static inline void __clocksource_updatefreq_khz(struct clocksource *cs, u32 khz)
319 __clocksource_updatefreq_scale(cs, 1000, khz); 319 __clocksource_updatefreq_scale(cs, 1000, khz);
320} 320}
321 321
322#ifdef CONFIG_GENERIC_TIME_VSYSCALL
323extern void
324update_vsyscall(struct timespec *ts, struct timespec *wtm,
325 struct clocksource *c, u32 mult);
326extern void update_vsyscall_tz(void);
327#else
328static inline void
329update_vsyscall(struct timespec *ts, struct timespec *wtm,
330 struct clocksource *c, u32 mult)
331{
332}
333
334static inline void update_vsyscall_tz(void)
335{
336}
337#endif
338 322
339extern void timekeeping_notify(struct clocksource *clock); 323extern void timekeeping_notify(struct clocksource *clock);
340 324
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 3f53d002c7c5..d0ced1011f2f 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -284,8 +284,12 @@ asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
284 const struct compat_iovec __user *vec, 284 const struct compat_iovec __user *vec,
285 unsigned long vlen, u32 pos_low, u32 pos_high); 285 unsigned long vlen, u32 pos_low, u32 pos_high);
286 286
287int compat_do_execve(char *filename, compat_uptr_t __user *argv, 287int compat_do_execve(const char *filename, const compat_uptr_t __user *argv,
288 compat_uptr_t __user *envp, struct pt_regs *regs); 288 const compat_uptr_t __user *envp, struct pt_regs *regs);
289#ifdef __ARCH_WANT_SYS_EXECVE
290asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
291 const compat_uptr_t __user *envp);
292#endif
289 293
290asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, 294asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
291 compat_ulong_t __user *outp, compat_ulong_t __user *exp, 295 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 934bc34d5f99..412bc6c2b023 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -59,7 +59,7 @@
59#if __GNUC_MINOR__ > 0 59#if __GNUC_MINOR__ > 0
60#define __compiletime_object_size(obj) __builtin_object_size(obj, 0) 60#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
61#endif 61#endif
62#if __GNUC_MINOR__ >= 4 && !defined(__CHECKER__) 62#if __GNUC_MINOR__ >= 3 && !defined(__CHECKER__)
63#define __compiletime_warning(message) __attribute__((warning(message))) 63#define __compiletime_warning(message) __attribute__((warning(message)))
64#define __compiletime_error(message) __attribute__((error(message))) 64#define __compiletime_error(message) __attribute__((error(message)))
65#endif 65#endif
diff --git a/include/linux/console.h b/include/linux/console.h
index 7201ce4280ca..dedb082fe50f 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -83,8 +83,14 @@ void give_up_console(const struct consw *sw);
83int con_debug_enter(struct vc_data *vc); 83int con_debug_enter(struct vc_data *vc);
84int con_debug_leave(void); 84int con_debug_leave(void);
85#else 85#else
86#define con_debug_enter(vc) (0) 86static inline int con_debug_enter(struct vc_data *vc)
87#define con_debug_leave() (0) 87{
88 return 0;
89}
90static inline int con_debug_leave(void)
91{
92 return 0;
93}
88#endif 94#endif
89 95
90/* scroll */ 96/* scroll */
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h
index 20e5eac2ffd3..827cce7e33e3 100644
--- a/include/linux/dvb/version.h
+++ b/include/linux/dvb/version.h
@@ -24,6 +24,6 @@
24#define _DVBVERSION_H_ 24#define _DVBVERSION_H_
25 25
26#define DVB_API_VERSION 5 26#define DVB_API_VERSION 5
27#define DVB_API_VERSION_MINOR 8 27#define DVB_API_VERSION_MINOR 9
28 28
29#endif /*_DVBVERSION_H_*/ 29#endif /*_DVBVERSION_H_*/
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
index 2412e02d7c0f..e1c8c9e919ac 100644
--- a/include/linux/dw_dmac.h
+++ b/include/linux/dw_dmac.h
@@ -19,6 +19,10 @@
19 * @nr_channels: Number of channels supported by hardware (max 8) 19 * @nr_channels: Number of channels supported by hardware (max 8)
20 * @is_private: The device channels should be marked as private and not for 20 * @is_private: The device channels should be marked as private and not for
21 * by the general purpose DMA channel allocator. 21 * by the general purpose DMA channel allocator.
22 * @block_size: Maximum block size supported by the controller
23 * @nr_masters: Number of AHB masters supported by the controller
24 * @data_width: Maximum data width supported by hardware per AHB master
25 * (0 - 8bits, 1 - 16bits, ..., 5 - 256bits)
22 */ 26 */
23struct dw_dma_platform_data { 27struct dw_dma_platform_data {
24 unsigned int nr_channels; 28 unsigned int nr_channels;
@@ -29,6 +33,9 @@ struct dw_dma_platform_data {
29#define CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */ 33#define CHAN_PRIORITY_ASCENDING 0 /* chan0 highest */
30#define CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */ 34#define CHAN_PRIORITY_DESCENDING 1 /* chan7 highest */
31 unsigned char chan_priority; 35 unsigned char chan_priority;
36 unsigned short block_size;
37 unsigned char nr_masters;
38 unsigned char data_width[4];
32}; 39};
33 40
34/* bursts size */ 41/* bursts size */
diff --git a/include/linux/edma.h b/include/linux/edma.h
new file mode 100644
index 000000000000..a1307e7827e8
--- /dev/null
+++ b/include/linux/edma.h
@@ -0,0 +1,29 @@
1/*
2 * TI EDMA DMA engine driver
3 *
4 * Copyright 2012 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#ifndef __LINUX_EDMA_H
16#define __LINUX_EDMA_H
17
18struct dma_chan;
19
20#if defined(CONFIG_TI_EDMA) || defined(CONFIG_TI_EDMA_MODULE)
21bool edma_filter_fn(struct dma_chan *, void *);
22#else
23static inline bool edma_filter_fn(struct dma_chan *chan, void *param)
24{
25 return false;
26}
27#endif
28
29#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c617ed024df8..65fbf571023f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -335,6 +335,7 @@ struct inodes_stat_t {
335#define BLKDISCARDZEROES _IO(0x12,124) 335#define BLKDISCARDZEROES _IO(0x12,124)
336#define BLKSECDISCARD _IO(0x12,125) 336#define BLKSECDISCARD _IO(0x12,125)
337#define BLKROTATIONAL _IO(0x12,126) 337#define BLKROTATIONAL _IO(0x12,126)
338#define BLKZEROOUT _IO(0x12,127)
338 339
339#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ 340#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
340#define FIBMAP _IO(0x00,1) /* bmap access */ 341#define FIBMAP _IO(0x00,1) /* bmap access */
@@ -415,6 +416,7 @@ struct inodes_stat_t {
415#include <linux/migrate_mode.h> 416#include <linux/migrate_mode.h>
416#include <linux/uidgid.h> 417#include <linux/uidgid.h>
417#include <linux/lockdep.h> 418#include <linux/lockdep.h>
419#include <linux/percpu-rwsem.h>
418 420
419#include <asm/byteorder.h> 421#include <asm/byteorder.h>
420 422
@@ -724,6 +726,8 @@ struct block_device {
724 int bd_fsfreeze_count; 726 int bd_fsfreeze_count;
725 /* Mutex for freeze */ 727 /* Mutex for freeze */
726 struct mutex bd_fsfreeze_mutex; 728 struct mutex bd_fsfreeze_mutex;
729 /* A semaphore that prevents I/O while block size is being changed */
730 struct percpu_rw_semaphore bd_block_size_semaphore;
727}; 731};
728 732
729/* 733/*
@@ -1132,7 +1136,7 @@ static inline int file_check_writeable(struct file *filp)
1132#if BITS_PER_LONG==32 1136#if BITS_PER_LONG==32
1133#define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) 1137#define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1)
1134#elif BITS_PER_LONG==64 1138#elif BITS_PER_LONG==64
1135#define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffff) 1139#define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffffLL)
1136#endif 1140#endif
1137 1141
1138#define FL_POSIX 1 1142#define FL_POSIX 1
@@ -1507,7 +1511,6 @@ struct super_block {
1507 unsigned long s_magic; 1511 unsigned long s_magic;
1508 struct dentry *s_root; 1512 struct dentry *s_root;
1509 struct rw_semaphore s_umount; 1513 struct rw_semaphore s_umount;
1510 struct mutex s_lock;
1511 int s_count; 1514 int s_count;
1512 atomic_t s_active; 1515 atomic_t s_active;
1513#ifdef CONFIG_SECURITY 1516#ifdef CONFIG_SECURITY
@@ -2076,7 +2079,7 @@ extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);
2076extern void kern_unmount(struct vfsmount *mnt); 2079extern void kern_unmount(struct vfsmount *mnt);
2077extern int may_umount_tree(struct vfsmount *); 2080extern int may_umount_tree(struct vfsmount *);
2078extern int may_umount(struct vfsmount *); 2081extern int may_umount(struct vfsmount *);
2079extern long do_mount(char *, char *, char *, unsigned long, void *); 2082extern long do_mount(const char *, const char *, const char *, unsigned long, void *);
2080extern struct vfsmount *collect_mounts(struct path *); 2083extern struct vfsmount *collect_mounts(struct path *);
2081extern void drop_collected_mounts(struct vfsmount *); 2084extern void drop_collected_mounts(struct vfsmount *);
2082extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, 2085extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
@@ -2193,6 +2196,13 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
2193#endif /* CONFIG_FILE_LOCKING */ 2196#endif /* CONFIG_FILE_LOCKING */
2194 2197
2195/* fs/open.c */ 2198/* fs/open.c */
2199struct audit_names;
2200struct filename {
2201 const char *name; /* pointer to actual string */
2202 const __user char *uptr; /* original userland pointer */
2203 struct audit_names *aname;
2204 bool separate; /* should "name" be freed? */
2205};
2196 2206
2197extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, 2207extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
2198 struct file *filp); 2208 struct file *filp);
@@ -2200,12 +2210,15 @@ extern int do_fallocate(struct file *file, int mode, loff_t offset,
2200 loff_t len); 2210 loff_t len);
2201extern long do_sys_open(int dfd, const char __user *filename, int flags, 2211extern long do_sys_open(int dfd, const char __user *filename, int flags,
2202 umode_t mode); 2212 umode_t mode);
2213extern struct file *file_open_name(struct filename *, int, umode_t);
2203extern struct file *filp_open(const char *, int, umode_t); 2214extern struct file *filp_open(const char *, int, umode_t);
2204extern struct file *file_open_root(struct dentry *, struct vfsmount *, 2215extern struct file *file_open_root(struct dentry *, struct vfsmount *,
2205 const char *, int); 2216 const char *, int);
2206extern struct file * dentry_open(const struct path *, int, const struct cred *); 2217extern struct file * dentry_open(const struct path *, int, const struct cred *);
2207extern int filp_close(struct file *, fl_owner_t id); 2218extern int filp_close(struct file *, fl_owner_t id);
2208extern char * getname(const char __user *); 2219
2220extern struct filename *getname(const char __user *);
2221
2209enum { 2222enum {
2210 FILE_CREATED = 1, 2223 FILE_CREATED = 1,
2211 FILE_OPENED = 2 2224 FILE_OPENED = 2
@@ -2225,13 +2238,14 @@ extern void __init vfs_caches_init(unsigned long);
2225 2238
2226extern struct kmem_cache *names_cachep; 2239extern struct kmem_cache *names_cachep;
2227 2240
2228#define __getname_gfp(gfp) kmem_cache_alloc(names_cachep, (gfp)) 2241extern void final_putname(struct filename *name);
2229#define __getname() __getname_gfp(GFP_KERNEL) 2242
2243#define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL)
2230#define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) 2244#define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
2231#ifndef CONFIG_AUDITSYSCALL 2245#ifndef CONFIG_AUDITSYSCALL
2232#define putname(name) __putname(name) 2246#define putname(name) final_putname(name)
2233#else 2247#else
2234extern void putname(const char *name); 2248extern void putname(struct filename *name);
2235#endif 2249#endif
2236 2250
2237#ifdef CONFIG_BLOCK 2251#ifdef CONFIG_BLOCK
@@ -2570,6 +2584,8 @@ extern int generic_segment_checks(const struct iovec *iov,
2570 unsigned long *nr_segs, size_t *count, int access_flags); 2584 unsigned long *nr_segs, size_t *count, int access_flags);
2571 2585
2572/* fs/block_dev.c */ 2586/* fs/block_dev.c */
2587extern ssize_t blkdev_aio_read(struct kiocb *iocb, const struct iovec *iov,
2588 unsigned long nr_segs, loff_t pos);
2573extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2589extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2574 unsigned long nr_segs, loff_t pos); 2590 unsigned long nr_segs, loff_t pos);
2575extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, 2591extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index a6dfe6944564..0fbfb4646d1b 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -109,7 +109,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
109 109
110 if (source) 110 if (source)
111 fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0); 111 fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0);
112 audit_inode_child(moved, new_dir); 112 audit_inode_child(new_dir, moved, AUDIT_TYPE_CHILD_CREATE);
113} 113}
114 114
115/* 115/*
@@ -155,7 +155,7 @@ static inline void fsnotify_inoderemove(struct inode *inode)
155 */ 155 */
156static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) 156static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
157{ 157{
158 audit_inode_child(dentry, inode); 158 audit_inode_child(inode, dentry, AUDIT_TYPE_CHILD_CREATE);
159 159
160 fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); 160 fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0);
161} 161}
@@ -168,7 +168,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
168static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry) 168static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry)
169{ 169{
170 fsnotify_link_count(inode); 170 fsnotify_link_count(inode);
171 audit_inode_child(new_dentry, dir); 171 audit_inode_child(dir, new_dentry, AUDIT_TYPE_CHILD_CREATE);
172 172
173 fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0); 173 fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0);
174} 174}
@@ -181,7 +181,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
181 __u32 mask = (FS_CREATE | FS_ISDIR); 181 __u32 mask = (FS_CREATE | FS_ISDIR);
182 struct inode *d_inode = dentry->d_inode; 182 struct inode *d_inode = dentry->d_inode;
183 183
184 audit_inode_child(dentry, inode); 184 audit_inode_child(inode, dentry, AUDIT_TYPE_CHILD_CREATE);
185 185
186 fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); 186 fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0);
187} 187}
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h
index 1364d62e2fbe..a3c3ecd59f08 100644
--- a/include/linux/i2c-algo-pca.h
+++ b/include/linux/i2c-algo-pca.h
@@ -62,6 +62,7 @@ struct i2c_algo_pca_data {
62 * 330000, 288000, 217000, 146000, 88000, 59000, 44000, 36000 62 * 330000, 288000, 217000, 146000, 88000, 59000, 44000, 36000
63 * For PCA9665, use the frequency you want here. */ 63 * For PCA9665, use the frequency you want here. */
64 unsigned int i2c_clock; 64 unsigned int i2c_clock;
65 unsigned int chip;
65}; 66};
66 67
67int i2c_pca_add_bus(struct i2c_adapter *); 68int i2c_pca_add_bus(struct i2c_adapter *);
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index 92a0dc75bc74..df804ba73e0b 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -34,7 +34,6 @@ struct omap_i2c_bus_platform_data {
34 u32 clkrate; 34 u32 clkrate;
35 u32 rev; 35 u32 rev;
36 u32 flags; 36 u32 flags;
37 void (*set_mpu_wkup_lat)(struct device *dev, long set);
38}; 37};
39 38
40#endif 39#endif
diff --git a/include/linux/i2c/i2c-rcar.h b/include/linux/i2c/i2c-rcar.h
new file mode 100644
index 000000000000..496f5c2b23c9
--- /dev/null
+++ b/include/linux/i2c/i2c-rcar.h
@@ -0,0 +1,10 @@
1#ifndef __I2C_R_CAR_H__
2#define __I2C_R_CAR_H__
3
4#include <linux/platform_device.h>
5
6struct i2c_rcar_platform_data {
7 u32 bus_speed;
8};
9
10#endif /* __I2C_R_CAR_H__ */
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index e4dad4ddf085..3265f332998a 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -284,10 +284,16 @@ enum {
284 IFLA_VXLAN_LEARNING, 284 IFLA_VXLAN_LEARNING,
285 IFLA_VXLAN_AGEING, 285 IFLA_VXLAN_AGEING,
286 IFLA_VXLAN_LIMIT, 286 IFLA_VXLAN_LIMIT,
287 IFLA_VXLAN_PORT_RANGE,
287 __IFLA_VXLAN_MAX 288 __IFLA_VXLAN_MAX
288}; 289};
289#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) 290#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
290 291
292struct ifla_vxlan_port_range {
293 __be16 low;
294 __be16 high;
295};
296
291/* SR-IOV virtual function management section */ 297/* SR-IOV virtual function management section */
292 298
293enum { 299enum {
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index e6ff12dd717b..c0ff748d0aa5 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -80,6 +80,8 @@ static inline int is_vlan_dev(struct net_device *dev)
80} 80}
81 81
82#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) 82#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
83#define vlan_tx_nonzero_tag_present(__skb) \
84 (vlan_tx_tag_present(__skb) && ((__skb)->vlan_tci & VLAN_VID_MASK))
83#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 85#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
84 86
85#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 87#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
@@ -89,7 +91,7 @@ extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
89extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 91extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
90extern u16 vlan_dev_vlan_id(const struct net_device *dev); 92extern u16 vlan_dev_vlan_id(const struct net_device *dev);
91 93
92extern bool vlan_do_receive(struct sk_buff **skb, bool last_handler); 94extern bool vlan_do_receive(struct sk_buff **skb);
93extern struct sk_buff *vlan_untag(struct sk_buff *skb); 95extern struct sk_buff *vlan_untag(struct sk_buff *skb);
94 96
95extern int vlan_vid_add(struct net_device *dev, unsigned short vid); 97extern int vlan_vid_add(struct net_device *dev, unsigned short vid);
@@ -120,10 +122,8 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
120 return 0; 122 return 0;
121} 123}
122 124
123static inline bool vlan_do_receive(struct sk_buff **skb, bool last_handler) 125static inline bool vlan_do_receive(struct sk_buff **skb)
124{ 126{
125 if (((*skb)->vlan_tci & VLAN_VID_MASK) && last_handler)
126 (*skb)->pkt_type = PACKET_OTHERHOST;
127 return false; 127 return false;
128} 128}
129 129
diff --git a/include/linux/input.h b/include/linux/input.h
index ba4874302939..15464ba6bf53 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1396,8 +1396,8 @@ struct input_handle;
1396 * @start: starts handler for given handle. This function is called by 1396 * @start: starts handler for given handle. This function is called by
1397 * input core right after connect() method and also when a process 1397 * input core right after connect() method and also when a process
1398 * that "grabbed" a device releases it 1398 * that "grabbed" a device releases it
1399 * @fops: file operations this driver implements 1399 * @legacy_minors: set to %true by drivers using legacy minor ranges
1400 * @minor: beginning of range of 32 minors for devices this driver 1400 * @minor: beginning of range of 32 legacy minors for devices this driver
1401 * can provide 1401 * can provide
1402 * @name: name of the handler, to be shown in /proc/bus/input/handlers 1402 * @name: name of the handler, to be shown in /proc/bus/input/handlers
1403 * @id_table: pointer to a table of input_device_ids this driver can 1403 * @id_table: pointer to a table of input_device_ids this driver can
@@ -1431,7 +1431,7 @@ struct input_handler {
1431 void (*disconnect)(struct input_handle *handle); 1431 void (*disconnect)(struct input_handle *handle);
1432 void (*start)(struct input_handle *handle); 1432 void (*start)(struct input_handle *handle);
1433 1433
1434 const struct file_operations *fops; 1434 bool legacy_minors;
1435 int minor; 1435 int minor;
1436 const char *name; 1436 const char *name;
1437 1437
@@ -1499,6 +1499,10 @@ void input_reset_device(struct input_dev *);
1499int __must_check input_register_handler(struct input_handler *); 1499int __must_check input_register_handler(struct input_handler *);
1500void input_unregister_handler(struct input_handler *); 1500void input_unregister_handler(struct input_handler *);
1501 1501
1502int __must_check input_get_new_minor(int legacy_base, unsigned int legacy_num,
1503 bool allow_dynamic);
1504void input_free_minor(unsigned int minor);
1505
1502int input_handler_for_each_handle(struct input_handler *, void *data, 1506int input_handler_for_each_handle(struct input_handler *, void *data,
1503 int (*fn)(struct input_handle *, void *)); 1507 int (*fn)(struct input_handle *, void *));
1504 1508
diff --git a/include/linux/isdn/Kbuild b/include/linux/isdn/Kbuild
index 991cdb29ab2e..e69de29bb2d1 100644
--- a/include/linux/isdn/Kbuild
+++ b/include/linux/isdn/Kbuild
@@ -1 +0,0 @@
1header-y += capicmd.h
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 05e3c2c7a8cf..6b87413da9d6 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -51,31 +51,17 @@
51#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \ 51#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \
52 + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN)) 52 + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
53 53
54#ifdef CLOCK_TICK_RATE
55/* LATCH is used in the interval timer and ftape setup. */ 54/* LATCH is used in the interval timer and ftape setup. */
56# define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ 55#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */
57 56
58/* 57extern int register_refined_jiffies(long clock_tick_rate);
59 * HZ is the requested value. However the CLOCK_TICK_RATE may not allow
60 * for exactly HZ. So SHIFTED_HZ is high res HZ ("<< 8" is for accuracy)
61 */
62# define SHIFTED_HZ (SH_DIV(CLOCK_TICK_RATE, LATCH, 8))
63#else
64# define SHIFTED_HZ (HZ << 8)
65#endif
66 58
67/* TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ */ 59/* TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ */
68#define TICK_NSEC (SH_DIV(1000000UL * 1000, SHIFTED_HZ, 8)) 60#define TICK_NSEC ((NSEC_PER_SEC+HZ/2)/HZ)
69 61
70/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ 62/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */
71#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) 63#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)
72 64
73/*
74 * TICK_USEC_TO_NSEC is the time between ticks in nsec assuming SHIFTED_HZ and
75 * a value TUSEC for TICK_USEC (can be set bij adjtimex)
76 */
77#define TICK_USEC_TO_NSEC(TUSEC) (SH_DIV(TUSEC * USER_HZ * 1000, SHIFTED_HZ, 8))
78
79/* some arch's have a small-data section that can be accessed register-relative 65/* some arch's have a small-data section that can be accessed register-relative
80 * but that can only take up to, say, 4-byte variables. jiffies being part of 66 * but that can only take up to, say, 4-byte variables. jiffies being part of
81 * an 8-byte variable may not be correctly accessed unless we force the issue 67 * an 8-byte variable may not be correctly accessed unless we force the issue
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h
index 2694289babd0..727877fb406d 100644
--- a/include/linux/leds-lp5523.h
+++ b/include/linux/leds-lp5523.h
@@ -26,6 +26,7 @@
26/* See Documentation/leds/leds-lp5523.txt */ 26/* See Documentation/leds/leds-lp5523.txt */
27 27
28struct lp5523_led_config { 28struct lp5523_led_config {
29 const char *name;
29 u8 chan_nr; 30 u8 chan_nr;
30 u8 led_current; /* mA x10, 0 if led is not connected */ 31 u8 led_current; /* mA x10, 0 if led is not connected */
31 u8 max_current; 32 u8 max_current;
diff --git a/include/linux/leds.h b/include/linux/leds.h
index c6f8dad2ceb0..6e53bb31c220 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -16,6 +16,7 @@
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/rwsem.h> 17#include <linux/rwsem.h>
18#include <linux/timer.h> 18#include <linux/timer.h>
19#include <linux/workqueue.h>
19 20
20struct device; 21struct device;
21/* 22/*
@@ -69,6 +70,9 @@ struct led_classdev {
69 struct timer_list blink_timer; 70 struct timer_list blink_timer;
70 int blink_brightness; 71 int blink_brightness;
71 72
73 struct work_struct set_brightness_work;
74 int delayed_set_value;
75
72#ifdef CONFIG_LEDS_TRIGGERS 76#ifdef CONFIG_LEDS_TRIGGERS
73 /* Protects the trigger data below */ 77 /* Protects the trigger data below */
74 struct rw_semaphore trigger_lock; 78 struct rw_semaphore trigger_lock;
diff --git a/include/linux/lglock.h b/include/linux/lglock.h
index f01e5f6d1f07..0d24e932db0b 100644
--- a/include/linux/lglock.h
+++ b/include/linux/lglock.h
@@ -32,20 +32,13 @@
32#define br_write_lock(name) lg_global_lock(name) 32#define br_write_lock(name) lg_global_lock(name)
33#define br_write_unlock(name) lg_global_unlock(name) 33#define br_write_unlock(name) lg_global_unlock(name)
34 34
35#define DEFINE_BRLOCK(name) DEFINE_LGLOCK(name) 35#define DEFINE_BRLOCK(name) DEFINE_LGLOCK(name)
36#define DEFINE_STATIC_BRLOCK(name) DEFINE_STATIC_LGLOCK(name)
36 37
37#ifdef CONFIG_DEBUG_LOCK_ALLOC 38#ifdef CONFIG_DEBUG_LOCK_ALLOC
38#define LOCKDEP_INIT_MAP lockdep_init_map 39#define LOCKDEP_INIT_MAP lockdep_init_map
39
40#define DEFINE_LGLOCK_LOCKDEP(name) \
41 struct lock_class_key name##_lock_key; \
42 struct lockdep_map name##_lock_dep_map; \
43 EXPORT_SYMBOL(name##_lock_dep_map)
44
45#else 40#else
46#define LOCKDEP_INIT_MAP(a, b, c, d) 41#define LOCKDEP_INIT_MAP(a, b, c, d)
47
48#define DEFINE_LGLOCK_LOCKDEP(name)
49#endif 42#endif
50 43
51struct lglock { 44struct lglock {
@@ -57,11 +50,15 @@ struct lglock {
57}; 50};
58 51
59#define DEFINE_LGLOCK(name) \ 52#define DEFINE_LGLOCK(name) \
60 DEFINE_LGLOCK_LOCKDEP(name); \ 53 static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
61 DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
62 = __ARCH_SPIN_LOCK_UNLOCKED; \ 54 = __ARCH_SPIN_LOCK_UNLOCKED; \
63 struct lglock name = { .lock = &name ## _lock } 55 struct lglock name = { .lock = &name ## _lock }
64 56
57#define DEFINE_STATIC_LGLOCK(name) \
58 static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
59 = __ARCH_SPIN_LOCK_UNLOCKED; \
60 static struct lglock name = { .lock = &name ## _lock }
61
65void lg_lock_init(struct lglock *lg, char *name); 62void lg_lock_init(struct lglock *lg, char *name);
66void lg_local_lock(struct lglock *lg); 63void lg_local_lock(struct lglock *lg);
67void lg_local_unlock(struct lglock *lg); 64void lg_local_unlock(struct lglock *lg);
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index fd0e6d53836e..11ddc7ffeba8 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -396,7 +396,7 @@ enum {
396}; 396};
397 397
398struct sock; 398struct sock;
399#ifdef CONFIG_MEMCG_KMEM 399#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM)
400void sock_update_memcg(struct sock *sk); 400void sock_update_memcg(struct sock *sk);
401void sock_release_memcg(struct sock *sk); 401void sock_release_memcg(struct sock *sk);
402#else 402#else
@@ -406,6 +406,6 @@ static inline void sock_update_memcg(struct sock *sk)
406static inline void sock_release_memcg(struct sock *sk) 406static inline void sock_release_memcg(struct sock *sk)
407{ 407{
408} 408}
409#endif /* CONFIG_MEMCG_KMEM */ 409#endif /* CONFIG_INET && CONFIG_MEMCG_KMEM */
410#endif /* _LINUX_MEMCONTROL_H */ 410#endif /* _LINUX_MEMCONTROL_H */
411 411
diff --git a/include/linux/mmc/Kbuild b/include/linux/mmc/Kbuild
index 1fb26448faa9..e69de29bb2d1 100644
--- a/include/linux/mmc/Kbuild
+++ b/include/linux/mmc/Kbuild
@@ -1 +0,0 @@
1header-y += ioctl.h
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 4b27f9f503e4..943550dfe9ea 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -57,6 +57,7 @@ struct mmc_ext_csd {
57 unsigned int sa_timeout; /* Units: 100ns */ 57 unsigned int sa_timeout; /* Units: 100ns */
58 unsigned int generic_cmd6_time; /* Units: 10ms */ 58 unsigned int generic_cmd6_time; /* Units: 10ms */
59 unsigned int power_off_longtime; /* Units: ms */ 59 unsigned int power_off_longtime; /* Units: ms */
60 u8 power_off_notification; /* state */
60 unsigned int hs_max_dtr; 61 unsigned int hs_max_dtr;
61#define MMC_HIGH_26_MAX_DTR 26000000 62#define MMC_HIGH_26_MAX_DTR 26000000
62#define MMC_HIGH_52_MAX_DTR 52000000 63#define MMC_HIGH_52_MAX_DTR 52000000
@@ -76,10 +77,13 @@ struct mmc_ext_csd {
76 bool hpi_en; /* HPI enablebit */ 77 bool hpi_en; /* HPI enablebit */
77 bool hpi; /* HPI support bit */ 78 bool hpi; /* HPI support bit */
78 unsigned int hpi_cmd; /* cmd used as HPI */ 79 unsigned int hpi_cmd; /* cmd used as HPI */
80 bool bkops; /* background support bit */
81 bool bkops_en; /* background enable bit */
79 unsigned int data_sector_size; /* 512 bytes or 4KB */ 82 unsigned int data_sector_size; /* 512 bytes or 4KB */
80 unsigned int data_tag_unit_size; /* DATA TAG UNIT size */ 83 unsigned int data_tag_unit_size; /* DATA TAG UNIT size */
81 unsigned int boot_ro_lock; /* ro lock support */ 84 unsigned int boot_ro_lock; /* ro lock support */
82 bool boot_ro_lockable; 85 bool boot_ro_lockable;
86 u8 raw_exception_status; /* 53 */
83 u8 raw_partition_support; /* 160 */ 87 u8 raw_partition_support; /* 160 */
84 u8 raw_erased_mem_count; /* 181 */ 88 u8 raw_erased_mem_count; /* 181 */
85 u8 raw_ext_csd_structure; /* 194 */ 89 u8 raw_ext_csd_structure; /* 194 */
@@ -93,6 +97,7 @@ struct mmc_ext_csd {
93 u8 raw_sec_erase_mult; /* 230 */ 97 u8 raw_sec_erase_mult; /* 230 */
94 u8 raw_sec_feature_support;/* 231 */ 98 u8 raw_sec_feature_support;/* 231 */
95 u8 raw_trim_mult; /* 232 */ 99 u8 raw_trim_mult; /* 232 */
100 u8 raw_bkops_status; /* 246 */
96 u8 raw_sectors[4]; /* 212 - 4 bytes */ 101 u8 raw_sectors[4]; /* 212 - 4 bytes */
97 102
98 unsigned int feature_support; 103 unsigned int feature_support;
@@ -225,7 +230,7 @@ struct mmc_card {
225#define MMC_CARD_SDXC (1<<6) /* card is SDXC */ 230#define MMC_CARD_SDXC (1<<6) /* card is SDXC */
226#define MMC_CARD_REMOVED (1<<7) /* card has been removed */ 231#define MMC_CARD_REMOVED (1<<7) /* card has been removed */
227#define MMC_STATE_HIGHSPEED_200 (1<<8) /* card is in HS200 mode */ 232#define MMC_STATE_HIGHSPEED_200 (1<<8) /* card is in HS200 mode */
228#define MMC_STATE_SLEEP (1<<9) /* card is in sleep state */ 233#define MMC_STATE_DOING_BKOPS (1<<10) /* card is doing BKOPS */
229 unsigned int quirks; /* card quirks */ 234 unsigned int quirks; /* card quirks */
230#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ 235#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */
231#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ 236#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */
@@ -241,11 +246,6 @@ struct mmc_card {
241#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */ 246#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */
242#define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */ 247#define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */
243 /* byte mode */ 248 /* byte mode */
244 unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */
245#define MMC_NO_POWER_NOTIFICATION 0
246#define MMC_POWERED_ON 1
247#define MMC_POWEROFF_SHORT 2
248#define MMC_POWEROFF_LONG 3
249 249
250 unsigned int erase_size; /* erase size in sectors */ 250 unsigned int erase_size; /* erase size in sectors */
251 unsigned int erase_shift; /* if erase unit is power 2 */ 251 unsigned int erase_shift; /* if erase unit is power 2 */
@@ -392,7 +392,7 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
392#define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) 392#define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED)
393#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC) 393#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC)
394#define mmc_card_removed(c) ((c) && ((c)->state & MMC_CARD_REMOVED)) 394#define mmc_card_removed(c) ((c) && ((c)->state & MMC_CARD_REMOVED))
395#define mmc_card_is_sleep(c) ((c)->state & MMC_STATE_SLEEP) 395#define mmc_card_doing_bkops(c) ((c)->state & MMC_STATE_DOING_BKOPS)
396 396
397#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) 397#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
398#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) 398#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
@@ -404,9 +404,9 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
404#define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) 404#define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED)
405#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) 405#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)
406#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED) 406#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED)
407#define mmc_card_set_sleep(c) ((c)->state |= MMC_STATE_SLEEP) 407#define mmc_card_set_doing_bkops(c) ((c)->state |= MMC_STATE_DOING_BKOPS)
408#define mmc_card_clr_doing_bkops(c) ((c)->state &= ~MMC_STATE_DOING_BKOPS)
408 409
409#define mmc_card_clr_sleep(c) ((c)->state &= ~MMC_STATE_SLEEP)
410/* 410/*
411 * Quirk add/remove for MMC products. 411 * Quirk add/remove for MMC products.
412 */ 412 */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 1b431c728b9a..9b9cdafc7737 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -134,6 +134,8 @@ struct mmc_host;
134struct mmc_card; 134struct mmc_card;
135struct mmc_async_req; 135struct mmc_async_req;
136 136
137extern int mmc_stop_bkops(struct mmc_card *);
138extern int mmc_read_bkops_status(struct mmc_card *);
137extern struct mmc_async_req *mmc_start_req(struct mmc_host *, 139extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
138 struct mmc_async_req *, int *); 140 struct mmc_async_req *, int *);
139extern int mmc_interrupt_hpi(struct mmc_card *); 141extern int mmc_interrupt_hpi(struct mmc_card *);
@@ -142,6 +144,8 @@ extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
142extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); 144extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
143extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, 145extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
144 struct mmc_command *, int); 146 struct mmc_command *, int);
147extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);
148extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool);
145extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); 149extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
146 150
147#define MMC_ERASE_ARG 0x00000000 151#define MMC_ERASE_ARG 0x00000000
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index 7a7ebd367cfd..7c6a1139d8fa 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -78,6 +78,10 @@ struct mmc_data;
78 * @data_offset: Set the offset of DATA register according to VERID. 78 * @data_offset: Set the offset of DATA register according to VERID.
79 * @dev: Device associated with the MMC controller. 79 * @dev: Device associated with the MMC controller.
80 * @pdata: Platform data associated with the MMC controller. 80 * @pdata: Platform data associated with the MMC controller.
81 * @drv_data: Driver specific data for identified variant of the controller
82 * @priv: Implementation defined private data.
83 * @biu_clk: Pointer to bus interface unit clock instance.
84 * @ciu_clk: Pointer to card interface unit clock instance.
81 * @slot: Slots sharing this MMC controller. 85 * @slot: Slots sharing this MMC controller.
82 * @fifo_depth: depth of FIFO. 86 * @fifo_depth: depth of FIFO.
83 * @data_shift: log2 of FIFO item size. 87 * @data_shift: log2 of FIFO item size.
@@ -156,8 +160,12 @@ struct dw_mci {
156 u32 fifoth_val; 160 u32 fifoth_val;
157 u16 verid; 161 u16 verid;
158 u16 data_offset; 162 u16 data_offset;
159 struct device dev; 163 struct device *dev;
160 struct dw_mci_board *pdata; 164 struct dw_mci_board *pdata;
165 struct dw_mci_drv_data *drv_data;
166 void *priv;
167 struct clk *biu_clk;
168 struct clk *ciu_clk;
161 struct dw_mci_slot *slot[MAX_MCI_SLOTS]; 169 struct dw_mci_slot *slot[MAX_MCI_SLOTS];
162 170
163 /* FIFO push and pull */ 171 /* FIFO push and pull */
@@ -201,7 +209,8 @@ struct dw_mci_dma_ops {
201#define DW_MCI_QUIRK_HIGHSPEED BIT(2) 209#define DW_MCI_QUIRK_HIGHSPEED BIT(2)
202/* Unreliable card detection */ 210/* Unreliable card detection */
203#define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) 211#define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3)
204 212/* Write Protect detection not available */
213#define DW_MCI_QUIRK_NO_WRITE_PROTECT BIT(4)
205 214
206struct dma_pdata; 215struct dma_pdata;
207 216
@@ -218,7 +227,7 @@ struct dw_mci_board {
218 u32 num_slots; 227 u32 num_slots;
219 228
220 u32 quirks; /* Workaround / Quirk flags */ 229 u32 quirks; /* Workaround / Quirk flags */
221 unsigned int bus_hz; /* Bus speed */ 230 unsigned int bus_hz; /* Clock speed at the cclk_in pad */
222 231
223 unsigned int caps; /* Capabilities */ 232 unsigned int caps; /* Capabilities */
224 unsigned int caps2; /* More capabilities */ 233 unsigned int caps2; /* More capabilities */
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f578a71d82a6..7abb0e1f7bda 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -259,10 +259,6 @@ struct mmc_host {
259#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ 259#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
260 260
261 mmc_pm_flag_t pm_caps; /* supported pm features */ 261 mmc_pm_flag_t pm_caps; /* supported pm features */
262 unsigned int power_notify_type;
263#define MMC_HOST_PW_NOTIFY_NONE 0
264#define MMC_HOST_PW_NOTIFY_SHORT 1
265#define MMC_HOST_PW_NOTIFY_LONG 2
266 262
267#ifdef CONFIG_MMC_CLKGATE 263#ifdef CONFIG_MMC_CLKGATE
268 int clk_requests; /* internal reference counter */ 264 int clk_requests; /* internal reference counter */
@@ -300,6 +296,7 @@ struct mmc_host {
300#endif 296#endif
301 297
302 int rescan_disable; /* disable card detection */ 298 int rescan_disable; /* disable card detection */
299 int rescan_entered; /* used with nonremovable devices */
303 300
304 struct mmc_card *card; /* device attached to this host */ 301 struct mmc_card *card; /* device attached to this host */
305 302
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index d425cab144d9..01e4b394029b 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -139,6 +139,7 @@ static inline bool mmc_op_multi(u32 opcode)
139#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ 139#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */
140#define R1_READY_FOR_DATA (1 << 8) /* sx, a */ 140#define R1_READY_FOR_DATA (1 << 8) /* sx, a */
141#define R1_SWITCH_ERROR (1 << 7) /* sx, c */ 141#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
142#define R1_EXCEPTION_EVENT (1 << 6) /* sx, a */
142#define R1_APP_CMD (1 << 5) /* sr, c */ 143#define R1_APP_CMD (1 << 5) /* sr, c */
143 144
144#define R1_STATE_IDLE 0 145#define R1_STATE_IDLE 0
@@ -274,12 +275,15 @@ struct _mmc_csd {
274#define EXT_CSD_FLUSH_CACHE 32 /* W */ 275#define EXT_CSD_FLUSH_CACHE 32 /* W */
275#define EXT_CSD_CACHE_CTRL 33 /* R/W */ 276#define EXT_CSD_CACHE_CTRL 33 /* R/W */
276#define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ 277#define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */
278#define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO */
277#define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ 279#define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */
278#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ 280#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */
279#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ 281#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
280#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ 282#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */
281#define EXT_CSD_HPI_MGMT 161 /* R/W */ 283#define EXT_CSD_HPI_MGMT 161 /* R/W */
282#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ 284#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */
285#define EXT_CSD_BKOPS_EN 163 /* R/W */
286#define EXT_CSD_BKOPS_START 164 /* W */
283#define EXT_CSD_SANITIZE_START 165 /* W */ 287#define EXT_CSD_SANITIZE_START 165 /* W */
284#define EXT_CSD_WR_REL_PARAM 166 /* RO */ 288#define EXT_CSD_WR_REL_PARAM 166 /* RO */
285#define EXT_CSD_BOOT_WP 173 /* R/W */ 289#define EXT_CSD_BOOT_WP 173 /* R/W */
@@ -313,11 +317,13 @@ struct _mmc_csd {
313#define EXT_CSD_PWR_CL_200_360 237 /* RO */ 317#define EXT_CSD_PWR_CL_200_360 237 /* RO */
314#define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */ 318#define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */
315#define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */ 319#define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */
320#define EXT_CSD_BKOPS_STATUS 246 /* RO */
316#define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ 321#define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */
317#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ 322#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */
318#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ 323#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */
319#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */ 324#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */
320#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */ 325#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */
326#define EXT_CSD_BKOPS_SUPPORT 502 /* RO */
321#define EXT_CSD_HPI_FEATURES 503 /* RO */ 327#define EXT_CSD_HPI_FEATURES 503 /* RO */
322 328
323/* 329/*
@@ -378,6 +384,19 @@ struct _mmc_csd {
378#define EXT_CSD_PWR_CL_8BIT_SHIFT 4 384#define EXT_CSD_PWR_CL_8BIT_SHIFT 4
379#define EXT_CSD_PWR_CL_4BIT_SHIFT 0 385#define EXT_CSD_PWR_CL_4BIT_SHIFT 0
380/* 386/*
387 * EXCEPTION_EVENT_STATUS field
388 */
389#define EXT_CSD_URGENT_BKOPS BIT(0)
390#define EXT_CSD_DYNCAP_NEEDED BIT(1)
391#define EXT_CSD_SYSPOOL_EXHAUSTED BIT(2)
392#define EXT_CSD_PACKED_FAILURE BIT(3)
393
394/*
395 * BKOPS status level
396 */
397#define EXT_CSD_BKOPS_LEVEL_2 0x2
398
399/*
381 * MMC_SWITCH access modes 400 * MMC_SWITCH access modes
382 */ 401 */
383 402
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index ac83b105bedd..fa8529a859b8 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -97,7 +97,8 @@ struct sdhci_host {
97 97
98 const struct sdhci_ops *ops; /* Low level hw interface */ 98 const struct sdhci_ops *ops; /* Low level hw interface */
99 99
100 struct regulator *vmmc; /* Power regulator */ 100 struct regulator *vmmc; /* Power regulator (vmmc) */
101 struct regulator *vqmmc; /* Signaling regulator (vccq) */
101 102
102 /* Internal data */ 103 /* Internal data */
103 struct mmc_host *mmc; /* MMC structure */ 104 struct mmc_host *mmc; /* MMC structure */
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 650ef352f045..211ff67e8b0d 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -78,8 +78,6 @@ struct nand_bbt_descr {
78#define NAND_BBT_LASTBLOCK 0x00000010 78#define NAND_BBT_LASTBLOCK 0x00000010
79/* The bbt is at the given page, else we must scan for the bbt */ 79/* The bbt is at the given page, else we must scan for the bbt */
80#define NAND_BBT_ABSPAGE 0x00000020 80#define NAND_BBT_ABSPAGE 0x00000020
81/* The bbt is at the given page, else we must scan for the bbt */
82#define NAND_BBT_SEARCH 0x00000040
83/* bbt is stored per chip on multichip devices */ 81/* bbt is stored per chip on multichip devices */
84#define NAND_BBT_PERCHIP 0x00000080 82#define NAND_BBT_PERCHIP 0x00000080
85/* bbt has a version counter at offset veroffs */ 83/* bbt has a version counter at offset veroffs */
@@ -110,7 +108,10 @@ struct nand_bbt_descr {
110 * OOB area. This option is passed to the default bad block table function. 108 * OOB area. This option is passed to the default bad block table function.
111 */ 109 */
112#define NAND_BBT_USE_FLASH 0x00020000 110#define NAND_BBT_USE_FLASH 0x00020000
113/* Do not store flash based bad block table in OOB area; store it in-band */ 111/*
112 * Do not store flash based bad block table marker in the OOB area; store it
113 * in-band.
114 */
114#define NAND_BBT_NO_OOB 0x00040000 115#define NAND_BBT_NO_OOB 0x00040000
115/* 116/*
116 * Do not write new bad block markers to OOB; useful, e.g., when ECC covers 117 * Do not write new bad block markers to OOB; useful, e.g., when ECC covers
diff --git a/include/linux/mtd/lpc32xx_mlc.h b/include/linux/mtd/lpc32xx_mlc.h
new file mode 100644
index 000000000000..d91b1e35631e
--- /dev/null
+++ b/include/linux/mtd/lpc32xx_mlc.h
@@ -0,0 +1,20 @@
1/*
2 * Platform data for LPC32xx SoC MLC NAND controller
3 *
4 * Copyright © 2012 Roland Stigge
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __LINUX_MTD_LPC32XX_MLC_H
12#define __LINUX_MTD_LPC32XX_MLC_H
13
14#include <linux/dmaengine.h>
15
16struct lpc32xx_mlc_platform_data {
17 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
18};
19
20#endif /* __LINUX_MTD_LPC32XX_MLC_H */
diff --git a/include/linux/mtd/lpc32xx_slc.h b/include/linux/mtd/lpc32xx_slc.h
new file mode 100644
index 000000000000..1169548a1535
--- /dev/null
+++ b/include/linux/mtd/lpc32xx_slc.h
@@ -0,0 +1,20 @@
1/*
2 * Platform data for LPC32xx SoC SLC NAND controller
3 *
4 * Copyright © 2012 Roland Stigge
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __LINUX_MTD_LPC32XX_SLC_H
12#define __LINUX_MTD_LPC32XX_SLC_H
13
14#include <linux/dmaengine.h>
15
16struct lpc32xx_slc_platform_data {
17 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
18};
19
20#endif /* __LINUX_MTD_LPC32XX_SLC_H */
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 63dadc0dfb62..81d61e704599 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -265,14 +265,7 @@ int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
265int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, 265int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
266 const u_char *buf); 266 const u_char *buf);
267 267
268static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from, 268int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
269 struct mtd_oob_ops *ops)
270{
271 ops->retlen = ops->oobretlen = 0;
272 if (!mtd->_read_oob)
273 return -EOPNOTSUPP;
274 return mtd->_read_oob(mtd, from, ops);
275}
276 269
277static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, 270static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to,
278 struct mtd_oob_ops *ops) 271 struct mtd_oob_ops *ops)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 57977c640529..24e915957e4f 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -56,7 +56,7 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
56 * 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
57 * adjust this accordingly. 57 * adjust this accordingly.
58 */ 58 */
59#define NAND_MAX_OOBSIZE 576 59#define NAND_MAX_OOBSIZE 640
60#define NAND_MAX_PAGESIZE 8192 60#define NAND_MAX_PAGESIZE 8192
61 61
62/* 62/*
@@ -92,6 +92,8 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
92#define NAND_CMD_READID 0x90 92#define NAND_CMD_READID 0x90
93#define NAND_CMD_ERASE2 0xd0 93#define NAND_CMD_ERASE2 0xd0
94#define NAND_CMD_PARAM 0xec 94#define NAND_CMD_PARAM 0xec
95#define NAND_CMD_GET_FEATURES 0xee
96#define NAND_CMD_SET_FEATURES 0xef
95#define NAND_CMD_RESET 0xff 97#define NAND_CMD_RESET 0xff
96 98
97#define NAND_CMD_LOCK 0x2a 99#define NAND_CMD_LOCK 0x2a
@@ -185,12 +187,6 @@ typedef enum {
185 * This happens with the Renesas AG-AND chips, possibly others. 187 * This happens with the Renesas AG-AND chips, possibly others.
186 */ 188 */
187#define BBT_AUTO_REFRESH 0x00000080 189#define BBT_AUTO_REFRESH 0x00000080
188/*
189 * Chip does not require ready check on read. True
190 * for all large page devices, as they do not support
191 * autoincrement.
192 */
193#define NAND_NO_READRDY 0x00000100
194/* Chip does not allow subpage writes */ 190/* Chip does not allow subpage writes */
195#define NAND_NO_SUBPAGE_WRITE 0x00000200 191#define NAND_NO_SUBPAGE_WRITE 0x00000200
196 192
@@ -200,6 +196,9 @@ typedef enum {
200/* Device behaves just like nand, but is readonly */ 196/* Device behaves just like nand, but is readonly */
201#define NAND_ROM 0x00000800 197#define NAND_ROM 0x00000800
202 198
199/* Device supports subpage reads */
200#define NAND_SUBPAGE_READ 0x00001000
201
203/* Options valid for Samsung large page devices */ 202/* Options valid for Samsung large page devices */
204#define NAND_SAMSUNG_LP_OPTIONS \ 203#define NAND_SAMSUNG_LP_OPTIONS \
205 (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) 204 (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK)
@@ -208,12 +207,7 @@ typedef enum {
208#define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING)) 207#define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING))
209#define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) 208#define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG))
210#define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK)) 209#define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK))
211/* Large page NAND with SOFT_ECC should support subpage reads */ 210#define NAND_HAS_SUBPAGE_READ(chip) ((chip->options & NAND_SUBPAGE_READ))
212#define NAND_SUBPAGE_READ(chip) ((chip->ecc.mode == NAND_ECC_SOFT) \
213 && (chip->page_shift > 9))
214
215/* Mask to zero out the chip options, which come from the id table */
216#define NAND_CHIPOPTIONS_MSK 0x0000ffff
217 211
218/* Non chip related options */ 212/* Non chip related options */
219/* This option skips the bbt scan during initialization. */ 213/* This option skips the bbt scan during initialization. */
@@ -237,6 +231,21 @@ typedef enum {
237/* Keep gcc happy */ 231/* Keep gcc happy */
238struct nand_chip; 232struct nand_chip;
239 233
234/* ONFI timing mode, used in both asynchronous and synchronous mode */
235#define ONFI_TIMING_MODE_0 (1 << 0)
236#define ONFI_TIMING_MODE_1 (1 << 1)
237#define ONFI_TIMING_MODE_2 (1 << 2)
238#define ONFI_TIMING_MODE_3 (1 << 3)
239#define ONFI_TIMING_MODE_4 (1 << 4)
240#define ONFI_TIMING_MODE_5 (1 << 5)
241#define ONFI_TIMING_MODE_UNKNOWN (1 << 6)
242
243/* ONFI feature address */
244#define ONFI_FEATURE_ADDR_TIMING_MODE 0x1
245
246/* ONFI subfeature parameters length */
247#define ONFI_SUBFEATURE_PARAM_LEN 4
248
240struct nand_onfi_params { 249struct nand_onfi_params {
241 /* rev info and features block */ 250 /* rev info and features block */
242 /* 'O' 'N' 'F' 'I' */ 251 /* 'O' 'N' 'F' 'I' */
@@ -334,8 +343,10 @@ struct nand_hw_control {
334 * @read_page_raw: function to read a raw page without ECC 343 * @read_page_raw: function to read a raw page without ECC
335 * @write_page_raw: function to write a raw page without ECC 344 * @write_page_raw: function to write a raw page without ECC
336 * @read_page: function to read a page according to the ECC generator 345 * @read_page: function to read a page according to the ECC generator
337 * requirements. 346 * requirements; returns maximum number of bitflips corrected in
338 * @read_subpage: function to read parts of the page covered by ECC. 347 * any single ECC step, 0 if bitflips uncorrectable, -EIO hw error
348 * @read_subpage: function to read parts of the page covered by ECC;
349 * returns same as read_page()
339 * @write_page: function to write a page according to the ECC generator 350 * @write_page: function to write a page according to the ECC generator
340 * requirements. 351 * requirements.
341 * @write_oob_raw: function to write chip OOB data without ECC 352 * @write_oob_raw: function to write chip OOB data without ECC
@@ -361,13 +372,13 @@ struct nand_ecc_ctrl {
361 uint8_t *calc_ecc); 372 uint8_t *calc_ecc);
362 int (*read_page_raw)(struct mtd_info *mtd, struct nand_chip *chip, 373 int (*read_page_raw)(struct mtd_info *mtd, struct nand_chip *chip,
363 uint8_t *buf, int oob_required, int page); 374 uint8_t *buf, int oob_required, int page);
364 void (*write_page_raw)(struct mtd_info *mtd, struct nand_chip *chip, 375 int (*write_page_raw)(struct mtd_info *mtd, struct nand_chip *chip,
365 const uint8_t *buf, int oob_required); 376 const uint8_t *buf, int oob_required);
366 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip, 377 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip,
367 uint8_t *buf, int oob_required, int page); 378 uint8_t *buf, int oob_required, int page);
368 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip, 379 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
369 uint32_t offs, uint32_t len, uint8_t *buf); 380 uint32_t offs, uint32_t len, uint8_t *buf);
370 void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, 381 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
371 const uint8_t *buf, int oob_required); 382 const uint8_t *buf, int oob_required);
372 int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, 383 int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
373 int page); 384 int page);
@@ -403,8 +414,6 @@ struct nand_buffers {
403 * @read_word: [REPLACEABLE] read one word from the chip 414 * @read_word: [REPLACEABLE] read one word from the chip
404 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 415 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
405 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 416 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
406 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip
407 * data.
408 * @select_chip: [REPLACEABLE] select chip nr 417 * @select_chip: [REPLACEABLE] select chip nr
409 * @block_bad: [REPLACEABLE] check, if the block is bad 418 * @block_bad: [REPLACEABLE] check, if the block is bad
410 * @block_markbad: [REPLACEABLE] mark the block bad 419 * @block_markbad: [REPLACEABLE] mark the block bad
@@ -462,6 +471,8 @@ struct nand_buffers {
462 * non 0 if ONFI supported. 471 * non 0 if ONFI supported.
463 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is 472 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is
464 * supported, 0 otherwise. 473 * supported, 0 otherwise.
474 * @onfi_set_features [REPLACEABLE] set the features for ONFI nand
475 * @onfi_get_features [REPLACEABLE] get the features for ONFI nand
465 * @ecclayout: [REPLACEABLE] the default ECC placement scheme 476 * @ecclayout: [REPLACEABLE] the default ECC placement scheme
466 * @bbt: [INTERN] bad block table pointer 477 * @bbt: [INTERN] bad block table pointer
467 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash 478 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash
@@ -487,7 +498,6 @@ struct nand_chip {
487 u16 (*read_word)(struct mtd_info *mtd); 498 u16 (*read_word)(struct mtd_info *mtd);
488 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); 499 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
489 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); 500 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
490 int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
491 void (*select_chip)(struct mtd_info *mtd, int chip); 501 void (*select_chip)(struct mtd_info *mtd, int chip);
492 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); 502 int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
493 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); 503 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
@@ -505,6 +515,10 @@ struct nand_chip {
505 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, 515 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
506 const uint8_t *buf, int oob_required, int page, 516 const uint8_t *buf, int oob_required, int page,
507 int cached, int raw); 517 int cached, int raw);
518 int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip,
519 int feature_addr, uint8_t *subfeature_para);
520 int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip,
521 int feature_addr, uint8_t *subfeature_para);
508 522
509 int chip_delay; 523 int chip_delay;
510 unsigned int options; 524 unsigned int options;
@@ -559,6 +573,7 @@ struct nand_chip {
559#define NAND_MFR_MICRON 0x2c 573#define NAND_MFR_MICRON 0x2c
560#define NAND_MFR_AMD 0x01 574#define NAND_MFR_AMD 0x01
561#define NAND_MFR_MACRONIX 0xc2 575#define NAND_MFR_MACRONIX 0xc2
576#define NAND_MFR_EON 0x92
562 577
563/** 578/**
564 * struct nand_flash_dev - NAND Flash Device ID Structure 579 * struct nand_flash_dev - NAND Flash Device ID Structure
@@ -641,6 +656,7 @@ struct platform_device;
641 * ALE/CLE/nCE. Also used to write command and address 656 * ALE/CLE/nCE. Also used to write command and address
642 * @write_buf: platform specific function for write buffer 657 * @write_buf: platform specific function for write buffer
643 * @read_buf: platform specific function for read buffer 658 * @read_buf: platform specific function for read buffer
659 * @read_byte: platform specific function to read one byte from chip
644 * @priv: private data to transport driver specific settings 660 * @priv: private data to transport driver specific settings
645 * 661 *
646 * All fields are optional and depend on the hardware driver requirements 662 * All fields are optional and depend on the hardware driver requirements
@@ -677,4 +693,20 @@ struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
677 return chip->priv; 693 return chip->priv;
678} 694}
679 695
696/* return the supported asynchronous timing mode. */
697static inline int onfi_get_async_timing_mode(struct nand_chip *chip)
698{
699 if (!chip->onfi_version)
700 return ONFI_TIMING_MODE_UNKNOWN;
701 return le16_to_cpu(chip->onfi_params.async_timing_mode);
702}
703
704/* return the supported synchronous timing mode. */
705static inline int onfi_get_sync_timing_mode(struct nand_chip *chip)
706{
707 if (!chip->onfi_version)
708 return ONFI_TIMING_MODE_UNKNOWN;
709 return le16_to_cpu(chip->onfi_params.src_sync_timing_mode);
710}
711
680#endif /* __LINUX_MTD_NAND_H */ 712#endif /* __LINUX_MTD_NAND_H */
diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h
index a38e1fa8af01..01e4b15b280e 100644
--- a/include/linux/mtd/sh_flctl.h
+++ b/include/linux/mtd/sh_flctl.h
@@ -49,7 +49,6 @@
49#define FLERRADR(f) (f->reg + 0x98) 49#define FLERRADR(f) (f->reg + 0x98)
50 50
51/* FLCMNCR control bits */ 51/* FLCMNCR control bits */
52#define ECCPOS2 (0x1 << 25)
53#define _4ECCCNTEN (0x1 << 24) 52#define _4ECCCNTEN (0x1 << 24)
54#define _4ECCEN (0x1 << 23) 53#define _4ECCEN (0x1 << 23)
55#define _4ECCCORRECT (0x1 << 22) 54#define _4ECCCORRECT (0x1 << 22)
@@ -59,9 +58,6 @@
59#define QTSEL_E (0x1 << 17) 58#define QTSEL_E (0x1 << 17)
60#define ENDIAN (0x1 << 16) /* 1 = little endian */ 59#define ENDIAN (0x1 << 16) /* 1 = little endian */
61#define FCKSEL_E (0x1 << 15) 60#define FCKSEL_E (0x1 << 15)
62#define ECCPOS_00 (0x00 << 12)
63#define ECCPOS_01 (0x01 << 12)
64#define ECCPOS_02 (0x02 << 12)
65#define ACM_SACCES_MODE (0x01 << 10) 61#define ACM_SACCES_MODE (0x01 << 10)
66#define NANWF_E (0x1 << 9) 62#define NANWF_E (0x1 << 9)
67#define SE_D (0x1 << 8) /* Spare area disable */ 63#define SE_D (0x1 << 8) /* Spare area disable */
@@ -107,6 +103,14 @@
107#define DOCMD2_E (0x1 << 17) /* 2nd cmd stage execute */ 103#define DOCMD2_E (0x1 << 17) /* 2nd cmd stage execute */
108#define DOCMD1_E (0x1 << 16) /* 1st cmd stage execute */ 104#define DOCMD1_E (0x1 << 16) /* 1st cmd stage execute */
109 105
106/* FLINTDMACR control bits */
107#define ESTERINTE (0x1 << 24) /* ECC error interrupt enable */
108#define AC1CLR (0x1 << 19) /* ECC FIFO clear */
109#define AC0CLR (0x1 << 18) /* Data FIFO clear */
110#define ECERB (0x1 << 9) /* ECC error */
111#define STERB (0x1 << 8) /* Status error */
112#define STERINTE (0x1 << 4) /* Status error enable */
113
110/* FLTRCR control bits */ 114/* FLTRCR control bits */
111#define TRSTRT (0x1 << 0) /* translation start */ 115#define TRSTRT (0x1 << 0) /* translation start */
112#define TREND (0x1 << 1) /* translation end */ 116#define TREND (0x1 << 1) /* translation end */
@@ -125,9 +129,15 @@
125#define _4ECCEND (0x1 << 1) /* 4 symbols end */ 129#define _4ECCEND (0x1 << 1) /* 4 symbols end */
126#define _4ECCEXST (0x1 << 0) /* 4 symbols exist */ 130#define _4ECCEXST (0x1 << 0) /* 4 symbols exist */
127 131
128#define INIT_FL4ECCRESULT_VAL 0x03FF03FF
129#define LOOP_TIMEOUT_MAX 0x00010000 132#define LOOP_TIMEOUT_MAX 0x00010000
130 133
134enum flctl_ecc_res_t {
135 FL_SUCCESS,
136 FL_REPAIRABLE,
137 FL_ERROR,
138 FL_TIMEOUT
139};
140
131struct sh_flctl { 141struct sh_flctl {
132 struct mtd_info mtd; 142 struct mtd_info mtd;
133 struct nand_chip chip; 143 struct nand_chip chip;
@@ -145,8 +155,7 @@ struct sh_flctl {
145 uint32_t erase_ADRCNT; /* bits of FLCMDCR in ERASE1 cmd */ 155 uint32_t erase_ADRCNT; /* bits of FLCMDCR in ERASE1 cmd */
146 uint32_t rw_ADRCNT; /* bits of FLCMDCR in READ WRITE cmd */ 156 uint32_t rw_ADRCNT; /* bits of FLCMDCR in READ WRITE cmd */
147 uint32_t flcmncr_base; /* base value of FLCMNCR */ 157 uint32_t flcmncr_base; /* base value of FLCMNCR */
148 158 uint32_t flintdmacr_base; /* irq enable bits */
149 int hwecc_cant_correct[4];
150 159
151 unsigned page_size:1; /* NAND page size (0 = 512, 1 = 2048) */ 160 unsigned page_size:1; /* NAND page size (0 = 512, 1 = 2048) */
152 unsigned hwecc:1; /* Hardware ECC (0 = disabled, 1 = enabled) */ 161 unsigned hwecc:1; /* Hardware ECC (0 = disabled, 1 = enabled) */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 01646aa53b0e..561c8bc8976d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1497,19 +1497,25 @@ struct napi_gro_cb {
1497 /* This indicates where we are processing relative to skb->data. */ 1497 /* This indicates where we are processing relative to skb->data. */
1498 int data_offset; 1498 int data_offset;
1499 1499
1500 /* This is non-zero if the packet may be of the same flow. */
1501 int same_flow;
1502
1503 /* This is non-zero if the packet cannot be merged with the new skb. */ 1500 /* This is non-zero if the packet cannot be merged with the new skb. */
1504 int flush; 1501 int flush;
1505 1502
1506 /* Number of segments aggregated. */ 1503 /* Number of segments aggregated. */
1507 int count; 1504 u16 count;
1505
1506 /* This is non-zero if the packet may be of the same flow. */
1507 u8 same_flow;
1508 1508
1509 /* Free the skb? */ 1509 /* Free the skb? */
1510 int free; 1510 u8 free;
1511#define NAPI_GRO_FREE 1 1511#define NAPI_GRO_FREE 1
1512#define NAPI_GRO_FREE_STOLEN_HEAD 2 1512#define NAPI_GRO_FREE_STOLEN_HEAD 2
1513
1514 /* jiffies when first packet was created/queued */
1515 unsigned long age;
1516
1517 /* Used in ipv6_gro_receive() */
1518 int proto;
1513}; 1519};
1514 1520
1515#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) 1521#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
@@ -1663,7 +1669,6 @@ extern int netpoll_trap(void);
1663#endif 1669#endif
1664extern int skb_gro_receive(struct sk_buff **head, 1670extern int skb_gro_receive(struct sk_buff **head,
1665 struct sk_buff *skb); 1671 struct sk_buff *skb);
1666extern void skb_gro_reset_offset(struct sk_buff *skb);
1667 1672
1668static inline unsigned int skb_gro_offset(const struct sk_buff *skb) 1673static inline unsigned int skb_gro_offset(const struct sk_buff *skb)
1669{ 1674{
@@ -2157,7 +2162,7 @@ extern gro_result_t dev_gro_receive(struct napi_struct *napi,
2157extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); 2162extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
2158extern gro_result_t napi_gro_receive(struct napi_struct *napi, 2163extern gro_result_t napi_gro_receive(struct napi_struct *napi,
2159 struct sk_buff *skb); 2164 struct sk_buff *skb);
2160extern void napi_gro_flush(struct napi_struct *napi); 2165extern void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2161extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 2166extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
2162extern gro_result_t napi_frags_finish(struct napi_struct *napi, 2167extern gro_result_t napi_frags_finish(struct napi_struct *napi,
2163 struct sk_buff *skb, 2168 struct sk_buff *skb,
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 874ae8f2706b..b3322023e9a5 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -1,78 +1 @@
1header-y += ipset/ header-y += ipset/
2
3header-y += nf_conntrack_common.h
4header-y += nf_conntrack_ftp.h
5header-y += nf_conntrack_sctp.h
6header-y += nf_conntrack_tcp.h
7header-y += nf_conntrack_tuple_common.h
8header-y += nf_nat.h
9header-y += nfnetlink.h
10header-y += nfnetlink_acct.h
11header-y += nfnetlink_compat.h
12header-y += nfnetlink_conntrack.h
13header-y += nfnetlink_cthelper.h
14header-y += nfnetlink_cttimeout.h
15header-y += nfnetlink_log.h
16header-y += nfnetlink_queue.h
17header-y += x_tables.h
18header-y += xt_AUDIT.h
19header-y += xt_CHECKSUM.h
20header-y += xt_CLASSIFY.h
21header-y += xt_CONNMARK.h
22header-y += xt_CONNSECMARK.h
23header-y += xt_CT.h
24header-y += xt_DSCP.h
25header-y += xt_IDLETIMER.h
26header-y += xt_LED.h
27header-y += xt_LOG.h
28header-y += xt_MARK.h
29header-y += xt_nfacct.h
30header-y += xt_NFLOG.h
31header-y += xt_NFQUEUE.h
32header-y += xt_RATEEST.h
33header-y += xt_SECMARK.h
34header-y += xt_TCPMSS.h
35header-y += xt_TCPOPTSTRIP.h
36header-y += xt_TEE.h
37header-y += xt_TPROXY.h
38header-y += xt_addrtype.h
39header-y += xt_cluster.h
40header-y += xt_comment.h
41header-y += xt_connbytes.h
42header-y += xt_connlimit.h
43header-y += xt_connmark.h
44header-y += xt_conntrack.h
45header-y += xt_cpu.h
46header-y += xt_dccp.h
47header-y += xt_devgroup.h
48header-y += xt_dscp.h
49header-y += xt_ecn.h
50header-y += xt_esp.h
51header-y += xt_hashlimit.h
52header-y += xt_helper.h
53header-y += xt_iprange.h
54header-y += xt_ipvs.h
55header-y += xt_length.h
56header-y += xt_limit.h
57header-y += xt_mac.h
58header-y += xt_mark.h
59header-y += xt_multiport.h
60header-y += xt_osf.h
61header-y += xt_owner.h
62header-y += xt_physdev.h
63header-y += xt_pkttype.h
64header-y += xt_policy.h
65header-y += xt_quota.h
66header-y += xt_rateest.h
67header-y += xt_realm.h
68header-y += xt_recent.h
69header-y += xt_set.h
70header-y += xt_sctp.h
71header-y += xt_socket.h
72header-y += xt_state.h
73header-y += xt_statistic.h
74header-y += xt_string.h
75header-y += xt_tcpmss.h
76header-y += xt_tcpudp.h
77header-y += xt_time.h
78header-y += xt_u32.h
diff --git a/include/linux/netfilter/ipset/Kbuild b/include/linux/netfilter/ipset/Kbuild
index 601fe71d34d5..e69de29bb2d1 100644
--- a/include/linux/netfilter/ipset/Kbuild
+++ b/include/linux/netfilter/ipset/Kbuild
@@ -1,4 +0,0 @@
1header-y += ip_set.h
2header-y += ip_set_bitmap.h
3header-y += ip_set_hash.h
4header-y += ip_set_list.h
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 528697b3c152..7958e84a65af 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -1,6 +1,3 @@
1#ifndef _IP_SET_H
2#define _IP_SET_H
3
4/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu> 1/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
5 * Patrick Schaaf <bof@bof.de> 2 * Patrick Schaaf <bof@bof.de>
6 * Martin Josefsson <gandalf@wlug.westbo.se> 3 * Martin Josefsson <gandalf@wlug.westbo.se>
@@ -10,199 +7,9 @@
10 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
12 */ 9 */
10#ifndef _IP_SET_H
11#define _IP_SET_H
13 12
14#include <linux/types.h>
15
16/* The protocol version */
17#define IPSET_PROTOCOL 6
18
19/* The max length of strings including NUL: set and type identifiers */
20#define IPSET_MAXNAMELEN 32
21
22/* Message types and commands */
23enum ipset_cmd {
24 IPSET_CMD_NONE,
25 IPSET_CMD_PROTOCOL, /* 1: Return protocol version */
26 IPSET_CMD_CREATE, /* 2: Create a new (empty) set */
27 IPSET_CMD_DESTROY, /* 3: Destroy a (empty) set */
28 IPSET_CMD_FLUSH, /* 4: Remove all elements from a set */
29 IPSET_CMD_RENAME, /* 5: Rename a set */
30 IPSET_CMD_SWAP, /* 6: Swap two sets */
31 IPSET_CMD_LIST, /* 7: List sets */
32 IPSET_CMD_SAVE, /* 8: Save sets */
33 IPSET_CMD_ADD, /* 9: Add an element to a set */
34 IPSET_CMD_DEL, /* 10: Delete an element from a set */
35 IPSET_CMD_TEST, /* 11: Test an element in a set */
36 IPSET_CMD_HEADER, /* 12: Get set header data only */
37 IPSET_CMD_TYPE, /* 13: Get set type */
38 IPSET_MSG_MAX, /* Netlink message commands */
39
40 /* Commands in userspace: */
41 IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 14: Enter restore mode */
42 IPSET_CMD_HELP, /* 15: Get help */
43 IPSET_CMD_VERSION, /* 16: Get program version */
44 IPSET_CMD_QUIT, /* 17: Quit from interactive mode */
45
46 IPSET_CMD_MAX,
47
48 IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 18: Commit buffered commands */
49};
50
51/* Attributes at command level */
52enum {
53 IPSET_ATTR_UNSPEC,
54 IPSET_ATTR_PROTOCOL, /* 1: Protocol version */
55 IPSET_ATTR_SETNAME, /* 2: Name of the set */
56 IPSET_ATTR_TYPENAME, /* 3: Typename */
57 IPSET_ATTR_SETNAME2 = IPSET_ATTR_TYPENAME, /* Setname at rename/swap */
58 IPSET_ATTR_REVISION, /* 4: Settype revision */
59 IPSET_ATTR_FAMILY, /* 5: Settype family */
60 IPSET_ATTR_FLAGS, /* 6: Flags at command level */
61 IPSET_ATTR_DATA, /* 7: Nested attributes */
62 IPSET_ATTR_ADT, /* 8: Multiple data containers */
63 IPSET_ATTR_LINENO, /* 9: Restore lineno */
64 IPSET_ATTR_PROTOCOL_MIN, /* 10: Minimal supported version number */
65 IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN, /* type rev min */
66 __IPSET_ATTR_CMD_MAX,
67};
68#define IPSET_ATTR_CMD_MAX (__IPSET_ATTR_CMD_MAX - 1)
69
70/* CADT specific attributes */
71enum {
72 IPSET_ATTR_IP = IPSET_ATTR_UNSPEC + 1,
73 IPSET_ATTR_IP_FROM = IPSET_ATTR_IP,
74 IPSET_ATTR_IP_TO, /* 2 */
75 IPSET_ATTR_CIDR, /* 3 */
76 IPSET_ATTR_PORT, /* 4 */
77 IPSET_ATTR_PORT_FROM = IPSET_ATTR_PORT,
78 IPSET_ATTR_PORT_TO, /* 5 */
79 IPSET_ATTR_TIMEOUT, /* 6 */
80 IPSET_ATTR_PROTO, /* 7 */
81 IPSET_ATTR_CADT_FLAGS, /* 8 */
82 IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */
83 /* Reserve empty slots */
84 IPSET_ATTR_CADT_MAX = 16,
85 /* Create-only specific attributes */
86 IPSET_ATTR_GC,
87 IPSET_ATTR_HASHSIZE,
88 IPSET_ATTR_MAXELEM,
89 IPSET_ATTR_NETMASK,
90 IPSET_ATTR_PROBES,
91 IPSET_ATTR_RESIZE,
92 IPSET_ATTR_SIZE,
93 /* Kernel-only */
94 IPSET_ATTR_ELEMENTS,
95 IPSET_ATTR_REFERENCES,
96 IPSET_ATTR_MEMSIZE,
97
98 __IPSET_ATTR_CREATE_MAX,
99};
100#define IPSET_ATTR_CREATE_MAX (__IPSET_ATTR_CREATE_MAX - 1)
101
102/* ADT specific attributes */
103enum {
104 IPSET_ATTR_ETHER = IPSET_ATTR_CADT_MAX + 1,
105 IPSET_ATTR_NAME,
106 IPSET_ATTR_NAMEREF,
107 IPSET_ATTR_IP2,
108 IPSET_ATTR_CIDR2,
109 IPSET_ATTR_IP2_TO,
110 IPSET_ATTR_IFACE,
111 __IPSET_ATTR_ADT_MAX,
112};
113#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
114
115/* IP specific attributes */
116enum {
117 IPSET_ATTR_IPADDR_IPV4 = IPSET_ATTR_UNSPEC + 1,
118 IPSET_ATTR_IPADDR_IPV6,
119 __IPSET_ATTR_IPADDR_MAX,
120};
121#define IPSET_ATTR_IPADDR_MAX (__IPSET_ATTR_IPADDR_MAX - 1)
122
123/* Error codes */
124enum ipset_errno {
125 IPSET_ERR_PRIVATE = 4096,
126 IPSET_ERR_PROTOCOL,
127 IPSET_ERR_FIND_TYPE,
128 IPSET_ERR_MAX_SETS,
129 IPSET_ERR_BUSY,
130 IPSET_ERR_EXIST_SETNAME2,
131 IPSET_ERR_TYPE_MISMATCH,
132 IPSET_ERR_EXIST,
133 IPSET_ERR_INVALID_CIDR,
134 IPSET_ERR_INVALID_NETMASK,
135 IPSET_ERR_INVALID_FAMILY,
136 IPSET_ERR_TIMEOUT,
137 IPSET_ERR_REFERENCED,
138 IPSET_ERR_IPADDR_IPV4,
139 IPSET_ERR_IPADDR_IPV6,
140
141 /* Type specific error codes */
142 IPSET_ERR_TYPE_SPECIFIC = 4352,
143};
144
145/* Flags at command level */
146enum ipset_cmd_flags {
147 IPSET_FLAG_BIT_EXIST = 0,
148 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
149 IPSET_FLAG_BIT_LIST_SETNAME = 1,
150 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
151 IPSET_FLAG_BIT_LIST_HEADER = 2,
152 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
153 IPSET_FLAG_CMD_MAX = 15, /* Lower half */
154};
155
156/* Flags at CADT attribute level */
157enum ipset_cadt_flags {
158 IPSET_FLAG_BIT_BEFORE = 0,
159 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
160 IPSET_FLAG_BIT_PHYSDEV = 1,
161 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
162 IPSET_FLAG_BIT_NOMATCH = 2,
163 IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
164 IPSET_FLAG_CADT_MAX = 15, /* Upper half */
165};
166
167/* Commands with settype-specific attributes */
168enum ipset_adt {
169 IPSET_ADD,
170 IPSET_DEL,
171 IPSET_TEST,
172 IPSET_ADT_MAX,
173 IPSET_CREATE = IPSET_ADT_MAX,
174 IPSET_CADT_MAX,
175};
176
177/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t
178 * and IPSET_INVALID_ID if you want to increase the max number of sets.
179 */
180typedef __u16 ip_set_id_t;
181
182#define IPSET_INVALID_ID 65535
183
184enum ip_set_dim {
185 IPSET_DIM_ZERO = 0,
186 IPSET_DIM_ONE,
187 IPSET_DIM_TWO,
188 IPSET_DIM_THREE,
189 /* Max dimension in elements.
190 * If changed, new revision of iptables match/target is required.
191 */
192 IPSET_DIM_MAX = 6,
193 IPSET_BIT_RETURN_NOMATCH = 7,
194};
195
196/* Option flags for kernel operations */
197enum ip_set_kopt {
198 IPSET_INV_MATCH = (1 << IPSET_DIM_ZERO),
199 IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
200 IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
201 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
202 IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH),
203};
204
205#ifdef __KERNEL__
206#include <linux/ip.h> 13#include <linux/ip.h>
207#include <linux/ipv6.h> 14#include <linux/ipv6.h>
208#include <linux/netlink.h> 15#include <linux/netlink.h>
@@ -211,6 +18,7 @@ enum ip_set_kopt {
211#include <linux/stringify.h> 18#include <linux/stringify.h>
212#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
213#include <net/netlink.h> 20#include <net/netlink.h>
21#include <uapi/linux/netfilter/ipset/ip_set.h>
214 22
215#define _IP_SET_MODULE_DESC(a, b, c) \ 23#define _IP_SET_MODULE_DESC(a, b, c) \
216 MODULE_DESCRIPTION(a " type of IP sets, revisions " b "-" c) 24 MODULE_DESCRIPTION(a " type of IP sets, revisions " b "-" c)
@@ -476,31 +284,4 @@ bitmap_bytes(u32 a, u32 b)
476 return 4 * ((((b - a + 8) / 8) + 3) / 4); 284 return 4 * ((((b - a + 8) / 8) + 3) / 4);
477} 285}
478 286
479#endif /* __KERNEL__ */
480
481/* Interface to iptables/ip6tables */
482
483#define SO_IP_SET 83
484
485union ip_set_name_index {
486 char name[IPSET_MAXNAMELEN];
487 ip_set_id_t index;
488};
489
490#define IP_SET_OP_GET_BYNAME 0x00000006 /* Get set index by name */
491struct ip_set_req_get_set {
492 unsigned int op;
493 unsigned int version;
494 union ip_set_name_index set;
495};
496
497#define IP_SET_OP_GET_BYINDEX 0x00000007 /* Get set name by index */
498/* Uses ip_set_req_get_set */
499
500#define IP_SET_OP_VERSION 0x00000100 /* Ask kernel version */
501struct ip_set_req_version {
502 unsigned int op;
503 unsigned int version;
504};
505
506#endif /*_IP_SET_H */ 287#endif /*_IP_SET_H */
diff --git a/include/linux/netfilter/ipset/ip_set_bitmap.h b/include/linux/netfilter/ipset/ip_set_bitmap.h
index 61a9e8746c83..1a30646d5be8 100644
--- a/include/linux/netfilter/ipset/ip_set_bitmap.h
+++ b/include/linux/netfilter/ipset/ip_set_bitmap.h
@@ -1,15 +1,8 @@
1#ifndef __IP_SET_BITMAP_H 1#ifndef __IP_SET_BITMAP_H
2#define __IP_SET_BITMAP_H 2#define __IP_SET_BITMAP_H
3 3
4/* Bitmap type specific error codes */ 4#include <uapi/linux/netfilter/ipset/ip_set_bitmap.h>
5enum {
6 /* The element is out of the range of the set */
7 IPSET_ERR_BITMAP_RANGE = IPSET_ERR_TYPE_SPECIFIC,
8 /* The range exceeds the size limit of the set type */
9 IPSET_ERR_BITMAP_RANGE_SIZE,
10};
11 5
12#ifdef __KERNEL__
13#define IPSET_BITMAP_MAX_RANGE 0x0000FFFF 6#define IPSET_BITMAP_MAX_RANGE 0x0000FFFF
14 7
15/* Common functions */ 8/* Common functions */
@@ -26,6 +19,4 @@ range_to_mask(u32 from, u32 to, u8 *bits)
26 return mask; 19 return mask;
27} 20}
28 21
29#endif /* __KERNEL__ */
30
31#endif /* __IP_SET_BITMAP_H */ 22#endif /* __IP_SET_BITMAP_H */
diff --git a/include/linux/netfilter/ipset/ip_set_hash.h b/include/linux/netfilter/ipset/ip_set_hash.h
index e2a9fae767f6..f98ddfb094cb 100644
--- a/include/linux/netfilter/ipset/ip_set_hash.h
+++ b/include/linux/netfilter/ipset/ip_set_hash.h
@@ -1,23 +1,8 @@
1#ifndef __IP_SET_HASH_H 1#ifndef __IP_SET_HASH_H
2#define __IP_SET_HASH_H 2#define __IP_SET_HASH_H
3 3
4/* Hash type specific error codes */ 4#include <uapi/linux/netfilter/ipset/ip_set_hash.h>
5enum {
6 /* Hash is full */
7 IPSET_ERR_HASH_FULL = IPSET_ERR_TYPE_SPECIFIC,
8 /* Null-valued element */
9 IPSET_ERR_HASH_ELEM,
10 /* Invalid protocol */
11 IPSET_ERR_INVALID_PROTO,
12 /* Protocol missing but must be specified */
13 IPSET_ERR_MISSING_PROTO,
14 /* Range not supported */
15 IPSET_ERR_HASH_RANGE_UNSUPPORTED,
16 /* Invalid range */
17 IPSET_ERR_HASH_RANGE,
18};
19 5
20#ifdef __KERNEL__
21 6
22#define IPSET_DEFAULT_HASHSIZE 1024 7#define IPSET_DEFAULT_HASHSIZE 1024
23#define IPSET_MIMINAL_HASHSIZE 64 8#define IPSET_MIMINAL_HASHSIZE 64
@@ -25,6 +10,4 @@ enum {
25#define IPSET_DEFAULT_PROBES 4 10#define IPSET_DEFAULT_PROBES 4
26#define IPSET_DEFAULT_RESIZE 100 11#define IPSET_DEFAULT_RESIZE 100
27 12
28#endif /* __KERNEL__ */
29
30#endif /* __IP_SET_HASH_H */ 13#endif /* __IP_SET_HASH_H */
diff --git a/include/linux/netfilter/ipset/ip_set_list.h b/include/linux/netfilter/ipset/ip_set_list.h
index 40a63f302613..68c2aea897f5 100644
--- a/include/linux/netfilter/ipset/ip_set_list.h
+++ b/include/linux/netfilter/ipset/ip_set_list.h
@@ -1,27 +1,10 @@
1#ifndef __IP_SET_LIST_H 1#ifndef __IP_SET_LIST_H
2#define __IP_SET_LIST_H 2#define __IP_SET_LIST_H
3 3
4/* List type specific error codes */ 4#include <uapi/linux/netfilter/ipset/ip_set_list.h>
5enum {
6 /* Set name to be added/deleted/tested does not exist. */
7 IPSET_ERR_NAME = IPSET_ERR_TYPE_SPECIFIC,
8 /* list:set type is not permitted to add */
9 IPSET_ERR_LOOP,
10 /* Missing reference set */
11 IPSET_ERR_BEFORE,
12 /* Reference set does not exist */
13 IPSET_ERR_NAMEREF,
14 /* Set is full */
15 IPSET_ERR_LIST_FULL,
16 /* Reference set is not added to the set */
17 IPSET_ERR_REF_EXIST,
18};
19 5
20#ifdef __KERNEL__
21 6
22#define IP_SET_LIST_DEFAULT_SIZE 8 7#define IP_SET_LIST_DEFAULT_SIZE 8
23#define IP_SET_LIST_MIN_SIZE 4 8#define IP_SET_LIST_MIN_SIZE 4
24 9
25#endif /* __KERNEL__ */
26
27#endif /* __IP_SET_LIST_H */ 10#endif /* __IP_SET_LIST_H */
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index d146872a0b91..127d0b90604f 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -1,119 +1,8 @@
1#ifndef _NF_CONNTRACK_COMMON_H 1#ifndef _NF_CONNTRACK_COMMON_H
2#define _NF_CONNTRACK_COMMON_H 2#define _NF_CONNTRACK_COMMON_H
3/* Connection state tracking for netfilter. This is separated from,
4 but required by, the NAT layer; it can also be used by an iptables
5 extension. */
6enum ip_conntrack_info {
7 /* Part of an established connection (either direction). */
8 IP_CT_ESTABLISHED,
9 3
10 /* Like NEW, but related to an existing connection, or ICMP error 4#include <uapi/linux/netfilter/nf_conntrack_common.h>
11 (in either direction). */
12 IP_CT_RELATED,
13 5
14 /* Started a new connection to track (only
15 IP_CT_DIR_ORIGINAL); may be a retransmission. */
16 IP_CT_NEW,
17
18 /* >= this indicates reply direction */
19 IP_CT_IS_REPLY,
20
21 IP_CT_ESTABLISHED_REPLY = IP_CT_ESTABLISHED + IP_CT_IS_REPLY,
22 IP_CT_RELATED_REPLY = IP_CT_RELATED + IP_CT_IS_REPLY,
23 IP_CT_NEW_REPLY = IP_CT_NEW + IP_CT_IS_REPLY,
24 /* Number of distinct IP_CT types (no NEW in reply dirn). */
25 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
26};
27
28/* Bitset representing status of connection. */
29enum ip_conntrack_status {
30 /* It's an expected connection: bit 0 set. This bit never changed */
31 IPS_EXPECTED_BIT = 0,
32 IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
33
34 /* We've seen packets both ways: bit 1 set. Can be set, not unset. */
35 IPS_SEEN_REPLY_BIT = 1,
36 IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
37
38 /* Conntrack should never be early-expired. */
39 IPS_ASSURED_BIT = 2,
40 IPS_ASSURED = (1 << IPS_ASSURED_BIT),
41
42 /* Connection is confirmed: originating packet has left box */
43 IPS_CONFIRMED_BIT = 3,
44 IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
45
46 /* Connection needs src nat in orig dir. This bit never changed. */
47 IPS_SRC_NAT_BIT = 4,
48 IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
49
50 /* Connection needs dst nat in orig dir. This bit never changed. */
51 IPS_DST_NAT_BIT = 5,
52 IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
53
54 /* Both together. */
55 IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
56
57 /* Connection needs TCP sequence adjusted. */
58 IPS_SEQ_ADJUST_BIT = 6,
59 IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
60
61 /* NAT initialization bits. */
62 IPS_SRC_NAT_DONE_BIT = 7,
63 IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
64
65 IPS_DST_NAT_DONE_BIT = 8,
66 IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
67
68 /* Both together */
69 IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
70
71 /* Connection is dying (removed from lists), can not be unset. */
72 IPS_DYING_BIT = 9,
73 IPS_DYING = (1 << IPS_DYING_BIT),
74
75 /* Connection has fixed timeout. */
76 IPS_FIXED_TIMEOUT_BIT = 10,
77 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
78
79 /* Conntrack is a template */
80 IPS_TEMPLATE_BIT = 11,
81 IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT),
82
83 /* Conntrack is a fake untracked entry */
84 IPS_UNTRACKED_BIT = 12,
85 IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),
86
87 /* Conntrack got a helper explicitly attached via CT target. */
88 IPS_HELPER_BIT = 13,
89 IPS_HELPER = (1 << IPS_HELPER_BIT),
90};
91
92/* Connection tracking event types */
93enum ip_conntrack_events {
94 IPCT_NEW, /* new conntrack */
95 IPCT_RELATED, /* related conntrack */
96 IPCT_DESTROY, /* destroyed conntrack */
97 IPCT_REPLY, /* connection has seen two-way traffic */
98 IPCT_ASSURED, /* connection status has changed to assured */
99 IPCT_PROTOINFO, /* protocol information has changed */
100 IPCT_HELPER, /* new helper has been set */
101 IPCT_MARK, /* new mark has been set */
102 IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */
103 IPCT_SECMARK, /* new security mark has been set */
104};
105
106enum ip_conntrack_expect_events {
107 IPEXP_NEW, /* new expectation */
108 IPEXP_DESTROY, /* destroyed expectation */
109};
110
111/* expectation flags */
112#define NF_CT_EXPECT_PERMANENT 0x1
113#define NF_CT_EXPECT_INACTIVE 0x2
114#define NF_CT_EXPECT_USERSPACE 0x4
115
116#ifdef __KERNEL__
117struct ip_conntrack_stat { 6struct ip_conntrack_stat {
118 unsigned int searched; 7 unsigned int searched;
119 unsigned int found; 8 unsigned int found;
@@ -136,6 +25,4 @@ struct ip_conntrack_stat {
136/* call to create an explicit dependency on nf_conntrack. */ 25/* call to create an explicit dependency on nf_conntrack. */
137extern void need_conntrack(void); 26extern void need_conntrack(void);
138 27
139#endif /* __KERNEL__ */
140
141#endif /* _NF_CONNTRACK_COMMON_H */ 28#endif /* _NF_CONNTRACK_COMMON_H */
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
index 8faf3f792d13..5f818b01e035 100644
--- a/include/linux/netfilter/nf_conntrack_ftp.h
+++ b/include/linux/netfilter/nf_conntrack_ftp.h
@@ -1,20 +1,8 @@
1#ifndef _NF_CONNTRACK_FTP_H 1#ifndef _NF_CONNTRACK_FTP_H
2#define _NF_CONNTRACK_FTP_H 2#define _NF_CONNTRACK_FTP_H
3/* FTP tracking. */
4 3
5/* This enum is exposed to userspace */ 4#include <uapi/linux/netfilter/nf_conntrack_ftp.h>
6enum nf_ct_ftp_type {
7 /* PORT command from client */
8 NF_CT_FTP_PORT,
9 /* PASV response from server */
10 NF_CT_FTP_PASV,
11 /* EPRT command from client */
12 NF_CT_FTP_EPRT,
13 /* EPSV response from server */
14 NF_CT_FTP_EPSV,
15};
16 5
17#ifdef __KERNEL__
18 6
19#define FTP_PORT 21 7#define FTP_PORT 21
20 8
@@ -42,6 +30,4 @@ extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb,
42 unsigned int matchoff, 30 unsigned int matchoff,
43 unsigned int matchlen, 31 unsigned int matchlen,
44 struct nf_conntrack_expect *exp); 32 struct nf_conntrack_expect *exp);
45#endif /* __KERNEL__ */
46
47#endif /* _NF_CONNTRACK_FTP_H */ 33#endif /* _NF_CONNTRACK_FTP_H */
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index e59868ae12d4..22db9614b584 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -1,53 +1,8 @@
1#ifndef _NF_CONNTRACK_TCP_H 1#ifndef _NF_CONNTRACK_TCP_H
2#define _NF_CONNTRACK_TCP_H 2#define _NF_CONNTRACK_TCP_H
3/* TCP tracking. */
4 3
5#include <linux/types.h> 4#include <uapi/linux/netfilter/nf_conntrack_tcp.h>
6 5
7/* This is exposed to userspace (ctnetlink) */
8enum tcp_conntrack {
9 TCP_CONNTRACK_NONE,
10 TCP_CONNTRACK_SYN_SENT,
11 TCP_CONNTRACK_SYN_RECV,
12 TCP_CONNTRACK_ESTABLISHED,
13 TCP_CONNTRACK_FIN_WAIT,
14 TCP_CONNTRACK_CLOSE_WAIT,
15 TCP_CONNTRACK_LAST_ACK,
16 TCP_CONNTRACK_TIME_WAIT,
17 TCP_CONNTRACK_CLOSE,
18 TCP_CONNTRACK_LISTEN, /* obsolete */
19#define TCP_CONNTRACK_SYN_SENT2 TCP_CONNTRACK_LISTEN
20 TCP_CONNTRACK_MAX,
21 TCP_CONNTRACK_IGNORE,
22 TCP_CONNTRACK_RETRANS,
23 TCP_CONNTRACK_UNACK,
24 TCP_CONNTRACK_TIMEOUT_MAX
25};
26
27/* Window scaling is advertised by the sender */
28#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
29
30/* SACK is permitted by the sender */
31#define IP_CT_TCP_FLAG_SACK_PERM 0x02
32
33/* This sender sent FIN first */
34#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
35
36/* Be liberal in window checking */
37#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
38
39/* Has unacknowledged data */
40#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10
41
42/* The field td_maxack has been set */
43#define IP_CT_TCP_FLAG_MAXACK_SET 0x20
44
45struct nf_ct_tcp_flags {
46 __u8 flags;
47 __u8 mask;
48};
49
50#ifdef __KERNEL__
51 6
52struct ip_ct_tcp_state { 7struct ip_ct_tcp_state {
53 u_int32_t td_end; /* max of seq + len */ 8 u_int32_t td_end; /* max of seq + len */
@@ -74,6 +29,4 @@ struct ip_ct_tcp {
74 u_int8_t last_flags; /* Last flags set */ 29 u_int8_t last_flags; /* Last flags set */
75}; 30};
76 31
77#endif /* __KERNEL__ */
78
79#endif /* _NF_CONNTRACK_TCP_H */ 32#endif /* _NF_CONNTRACK_TCP_H */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 18341cdb2443..4966ddec039b 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -1,63 +1,11 @@
1#ifndef _NFNETLINK_H 1#ifndef _NFNETLINK_H
2#define _NFNETLINK_H 2#define _NFNETLINK_H
3#include <linux/types.h>
4#include <linux/netfilter/nfnetlink_compat.h>
5 3
6enum nfnetlink_groups {
7 NFNLGRP_NONE,
8#define NFNLGRP_NONE NFNLGRP_NONE
9 NFNLGRP_CONNTRACK_NEW,
10#define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW
11 NFNLGRP_CONNTRACK_UPDATE,
12#define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE
13 NFNLGRP_CONNTRACK_DESTROY,
14#define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY
15 NFNLGRP_CONNTRACK_EXP_NEW,
16#define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW
17 NFNLGRP_CONNTRACK_EXP_UPDATE,
18#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
19 NFNLGRP_CONNTRACK_EXP_DESTROY,
20#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
21 __NFNLGRP_MAX,
22};
23#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
24
25/* General form of address family dependent message.
26 */
27struct nfgenmsg {
28 __u8 nfgen_family; /* AF_xxx */
29 __u8 version; /* nfnetlink version */
30 __be16 res_id; /* resource id */
31};
32
33#define NFNETLINK_V0 0
34
35/* netfilter netlink message types are split in two pieces:
36 * 8 bit subsystem, 8bit operation.
37 */
38
39#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
40#define NFNL_MSG_TYPE(x) (x & 0x00ff)
41
42/* No enum here, otherwise __stringify() trick of MODULE_ALIAS_NFNL_SUBSYS()
43 * won't work anymore */
44#define NFNL_SUBSYS_NONE 0
45#define NFNL_SUBSYS_CTNETLINK 1
46#define NFNL_SUBSYS_CTNETLINK_EXP 2
47#define NFNL_SUBSYS_QUEUE 3
48#define NFNL_SUBSYS_ULOG 4
49#define NFNL_SUBSYS_OSF 5
50#define NFNL_SUBSYS_IPSET 6
51#define NFNL_SUBSYS_ACCT 7
52#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
53#define NFNL_SUBSYS_CTHELPER 9
54#define NFNL_SUBSYS_COUNT 10
55
56#ifdef __KERNEL__
57 4
58#include <linux/netlink.h> 5#include <linux/netlink.h>
59#include <linux/capability.h> 6#include <linux/capability.h>
60#include <net/netlink.h> 7#include <net/netlink.h>
8#include <uapi/linux/netfilter/nfnetlink.h>
61 9
62struct nfnl_callback { 10struct nfnl_callback {
63 int (*call)(struct sock *nl, struct sk_buff *skb, 11 int (*call)(struct sock *nl, struct sk_buff *skb,
@@ -92,5 +40,4 @@ extern void nfnl_unlock(void);
92#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ 40#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
93 MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) 41 MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
94 42
95#endif /* __KERNEL__ */
96#endif /* _NFNETLINK_H */ 43#endif /* _NFNETLINK_H */
diff --git a/include/linux/netfilter/nfnetlink_acct.h b/include/linux/netfilter/nfnetlink_acct.h
index 7c4279b4ae7a..bb4bbc9b7a18 100644
--- a/include/linux/netfilter/nfnetlink_acct.h
+++ b/include/linux/netfilter/nfnetlink_acct.h
@@ -1,29 +1,8 @@
1#ifndef _NFNL_ACCT_H_ 1#ifndef _NFNL_ACCT_H_
2#define _NFNL_ACCT_H_ 2#define _NFNL_ACCT_H_
3 3
4#ifndef NFACCT_NAME_MAX 4#include <uapi/linux/netfilter/nfnetlink_acct.h>
5#define NFACCT_NAME_MAX 32
6#endif
7 5
8enum nfnl_acct_msg_types {
9 NFNL_MSG_ACCT_NEW,
10 NFNL_MSG_ACCT_GET,
11 NFNL_MSG_ACCT_GET_CTRZERO,
12 NFNL_MSG_ACCT_DEL,
13 NFNL_MSG_ACCT_MAX
14};
15
16enum nfnl_acct_type {
17 NFACCT_UNSPEC,
18 NFACCT_NAME,
19 NFACCT_PKTS,
20 NFACCT_BYTES,
21 NFACCT_USE,
22 __NFACCT_MAX
23};
24#define NFACCT_MAX (__NFACCT_MAX - 1)
25
26#ifdef __KERNEL__
27 6
28struct nf_acct; 7struct nf_acct;
29 8
@@ -31,6 +10,4 @@ extern struct nf_acct *nfnl_acct_find_get(const char *filter_name);
31extern void nfnl_acct_put(struct nf_acct *acct); 10extern void nfnl_acct_put(struct nf_acct *acct);
32extern void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct); 11extern void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct);
33 12
34#endif /* __KERNEL__ */
35
36#endif /* _NFNL_ACCT_H */ 13#endif /* _NFNL_ACCT_H */
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 8d674a786744..dd49566315c6 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -1,191 +1,9 @@
1#ifndef _X_TABLES_H 1#ifndef _X_TABLES_H
2#define _X_TABLES_H 2#define _X_TABLES_H
3#include <linux/kernel.h>
4#include <linux/types.h>
5 3
6#define XT_FUNCTION_MAXNAMELEN 30
7#define XT_EXTENSION_MAXNAMELEN 29
8#define XT_TABLE_MAXNAMELEN 32
9
10struct xt_entry_match {
11 union {
12 struct {
13 __u16 match_size;
14
15 /* Used by userspace */
16 char name[XT_EXTENSION_MAXNAMELEN];
17 __u8 revision;
18 } user;
19 struct {
20 __u16 match_size;
21
22 /* Used inside the kernel */
23 struct xt_match *match;
24 } kernel;
25
26 /* Total length */
27 __u16 match_size;
28 } u;
29
30 unsigned char data[0];
31};
32
33struct xt_entry_target {
34 union {
35 struct {
36 __u16 target_size;
37
38 /* Used by userspace */
39 char name[XT_EXTENSION_MAXNAMELEN];
40 __u8 revision;
41 } user;
42 struct {
43 __u16 target_size;
44
45 /* Used inside the kernel */
46 struct xt_target *target;
47 } kernel;
48
49 /* Total length */
50 __u16 target_size;
51 } u;
52
53 unsigned char data[0];
54};
55
56#define XT_TARGET_INIT(__name, __size) \
57{ \
58 .target.u.user = { \
59 .target_size = XT_ALIGN(__size), \
60 .name = __name, \
61 }, \
62}
63
64struct xt_standard_target {
65 struct xt_entry_target target;
66 int verdict;
67};
68
69struct xt_error_target {
70 struct xt_entry_target target;
71 char errorname[XT_FUNCTION_MAXNAMELEN];
72};
73
74/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
75 * kernel supports, if >= revision. */
76struct xt_get_revision {
77 char name[XT_EXTENSION_MAXNAMELEN];
78 __u8 revision;
79};
80
81/* CONTINUE verdict for targets */
82#define XT_CONTINUE 0xFFFFFFFF
83
84/* For standard target */
85#define XT_RETURN (-NF_REPEAT - 1)
86
87/* this is a dummy structure to find out the alignment requirement for a struct
88 * containing all the fundamental data types that are used in ipt_entry,
89 * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my
90 * personal pleasure to remove it -HW
91 */
92struct _xt_align {
93 __u8 u8;
94 __u16 u16;
95 __u32 u32;
96 __u64 u64;
97};
98
99#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
100
101/* Standard return verdict, or do jump. */
102#define XT_STANDARD_TARGET ""
103/* Error verdict. */
104#define XT_ERROR_TARGET "ERROR"
105
106#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
107#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
108
109struct xt_counters {
110 __u64 pcnt, bcnt; /* Packet and byte counters */
111};
112
113/* The argument to IPT_SO_ADD_COUNTERS. */
114struct xt_counters_info {
115 /* Which table. */
116 char name[XT_TABLE_MAXNAMELEN];
117
118 unsigned int num_counters;
119
120 /* The counters (actually `number' of these). */
121 struct xt_counters counters[0];
122};
123
124#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
125
126#ifndef __KERNEL__
127/* fn returns 0 to continue iteration */
128#define XT_MATCH_ITERATE(type, e, fn, args...) \
129({ \
130 unsigned int __i; \
131 int __ret = 0; \
132 struct xt_entry_match *__m; \
133 \
134 for (__i = sizeof(type); \
135 __i < (e)->target_offset; \
136 __i += __m->u.match_size) { \
137 __m = (void *)e + __i; \
138 \
139 __ret = fn(__m , ## args); \
140 if (__ret != 0) \
141 break; \
142 } \
143 __ret; \
144})
145
146/* fn returns 0 to continue iteration */
147#define XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...) \
148({ \
149 unsigned int __i, __n; \
150 int __ret = 0; \
151 type *__entry; \
152 \
153 for (__i = 0, __n = 0; __i < (size); \
154 __i += __entry->next_offset, __n++) { \
155 __entry = (void *)(entries) + __i; \
156 if (__n < n) \
157 continue; \
158 \
159 __ret = fn(__entry , ## args); \
160 if (__ret != 0) \
161 break; \
162 } \
163 __ret; \
164})
165
166/* fn returns 0 to continue iteration */
167#define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \
168 XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
169
170#endif /* !__KERNEL__ */
171
172/* pos is normally a struct ipt_entry/ip6t_entry/etc. */
173#define xt_entry_foreach(pos, ehead, esize) \
174 for ((pos) = (typeof(pos))(ehead); \
175 (pos) < (typeof(pos))((char *)(ehead) + (esize)); \
176 (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset))
177
178/* can only be xt_entry_match, so no use of typeof here */
179#define xt_ematch_foreach(pos, entry) \
180 for ((pos) = (struct xt_entry_match *)entry->elems; \
181 (pos) < (struct xt_entry_match *)((char *)(entry) + \
182 (entry)->target_offset); \
183 (pos) = (struct xt_entry_match *)((char *)(pos) + \
184 (pos)->u.match_size))
185
186#ifdef __KERNEL__
187 4
188#include <linux/netdevice.h> 5#include <linux/netdevice.h>
6#include <uapi/linux/netfilter/x_tables.h>
189 7
190/** 8/**
191 * struct xt_action_param - parameters for matches/targets 9 * struct xt_action_param - parameters for matches/targets
@@ -617,6 +435,4 @@ extern int xt_compat_target_to_user(const struct xt_entry_target *t,
617 void __user **dstptr, unsigned int *size); 435 void __user **dstptr, unsigned int *size);
618 436
619#endif /* CONFIG_COMPAT */ 437#endif /* CONFIG_COMPAT */
620#endif /* __KERNEL__ */
621
622#endif /* _X_TABLES_H */ 438#endif /* _X_TABLES_H */
diff --git a/include/linux/netfilter/xt_hashlimit.h b/include/linux/netfilter/xt_hashlimit.h
index c42e52f39f8f..074790c0cf74 100644
--- a/include/linux/netfilter/xt_hashlimit.h
+++ b/include/linux/netfilter/xt_hashlimit.h
@@ -1,78 +1,9 @@
1#ifndef _XT_HASHLIMIT_H 1#ifndef _XT_HASHLIMIT_H
2#define _XT_HASHLIMIT_H 2#define _XT_HASHLIMIT_H
3 3
4#include <linux/types.h> 4#include <uapi/linux/netfilter/xt_hashlimit.h>
5 5
6/* timings are in milliseconds. */
7#define XT_HASHLIMIT_SCALE 10000
8/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
9 * seconds, or one packet every 59 hours.
10 */
11
12/* packet length accounting is done in 16-byte steps */
13#define XT_HASHLIMIT_BYTE_SHIFT 4
14
15/* details of this structure hidden by the implementation */
16struct xt_hashlimit_htable;
17
18enum {
19 XT_HASHLIMIT_HASH_DIP = 1 << 0,
20 XT_HASHLIMIT_HASH_DPT = 1 << 1,
21 XT_HASHLIMIT_HASH_SIP = 1 << 2,
22 XT_HASHLIMIT_HASH_SPT = 1 << 3,
23 XT_HASHLIMIT_INVERT = 1 << 4,
24 XT_HASHLIMIT_BYTES = 1 << 5,
25};
26#ifdef __KERNEL__
27#define XT_HASHLIMIT_ALL (XT_HASHLIMIT_HASH_DIP | XT_HASHLIMIT_HASH_DPT | \ 6#define XT_HASHLIMIT_ALL (XT_HASHLIMIT_HASH_DIP | XT_HASHLIMIT_HASH_DPT | \
28 XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | \ 7 XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | \
29 XT_HASHLIMIT_INVERT | XT_HASHLIMIT_BYTES) 8 XT_HASHLIMIT_INVERT | XT_HASHLIMIT_BYTES)
30#endif
31
32struct hashlimit_cfg {
33 __u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */
34 __u32 avg; /* Average secs between packets * scale */
35 __u32 burst; /* Period multiplier for upper limit. */
36
37 /* user specified */
38 __u32 size; /* how many buckets */
39 __u32 max; /* max number of entries */
40 __u32 gc_interval; /* gc interval */
41 __u32 expire; /* when do entries expire? */
42};
43
44struct xt_hashlimit_info {
45 char name [IFNAMSIZ]; /* name */
46 struct hashlimit_cfg cfg;
47
48 /* Used internally by the kernel */
49 struct xt_hashlimit_htable *hinfo;
50 union {
51 void *ptr;
52 struct xt_hashlimit_info *master;
53 } u;
54};
55
56struct hashlimit_cfg1 {
57 __u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */
58 __u32 avg; /* Average secs between packets * scale */
59 __u32 burst; /* Period multiplier for upper limit. */
60
61 /* user specified */
62 __u32 size; /* how many buckets */
63 __u32 max; /* max number of entries */
64 __u32 gc_interval; /* gc interval */
65 __u32 expire; /* when do entries expire? */
66
67 __u8 srcmask, dstmask;
68};
69
70struct xt_hashlimit_mtinfo1 {
71 char name[IFNAMSIZ];
72 struct hashlimit_cfg1 cfg;
73
74 /* Used internally by the kernel */
75 struct xt_hashlimit_htable *hinfo __attribute__((aligned(8)));
76};
77
78#endif /*_XT_HASHLIMIT_H*/ 9#endif /*_XT_HASHLIMIT_H*/
diff --git a/include/linux/netfilter/xt_physdev.h b/include/linux/netfilter/xt_physdev.h
index 8555e399886d..5b5e41716d69 100644
--- a/include/linux/netfilter/xt_physdev.h
+++ b/include/linux/netfilter/xt_physdev.h
@@ -1,26 +1,7 @@
1#ifndef _XT_PHYSDEV_H 1#ifndef _XT_PHYSDEV_H
2#define _XT_PHYSDEV_H 2#define _XT_PHYSDEV_H
3 3
4#include <linux/types.h>
5
6#ifdef __KERNEL__
7#include <linux/if.h> 4#include <linux/if.h>
8#endif 5#include <uapi/linux/netfilter/xt_physdev.h>
9
10#define XT_PHYSDEV_OP_IN 0x01
11#define XT_PHYSDEV_OP_OUT 0x02
12#define XT_PHYSDEV_OP_BRIDGED 0x04
13#define XT_PHYSDEV_OP_ISIN 0x08
14#define XT_PHYSDEV_OP_ISOUT 0x10
15#define XT_PHYSDEV_OP_MASK (0x20 - 1)
16
17struct xt_physdev_info {
18 char physindev[IFNAMSIZ];
19 char in_mask[IFNAMSIZ];
20 char physoutdev[IFNAMSIZ];
21 char out_mask[IFNAMSIZ];
22 __u8 invert;
23 __u8 bitmask;
24};
25 6
26#endif /*_XT_PHYSDEV_H*/ 7#endif /*_XT_PHYSDEV_H*/
diff --git a/include/linux/netfilter_arp/Kbuild b/include/linux/netfilter_arp/Kbuild
index b27439c71037..e69de29bb2d1 100644
--- a/include/linux/netfilter_arp/Kbuild
+++ b/include/linux/netfilter_arp/Kbuild
@@ -1,2 +0,0 @@
1header-y += arp_tables.h
2header-y += arpt_mangle.h
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index e08565d45178..cfb7191e6efa 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -5,211 +5,14 @@
5 * network byte order. 5 * network byte order.
6 * flags are stored in host byte order (of course). 6 * flags are stored in host byte order (of course).
7 */ 7 */
8
9#ifndef _ARPTABLES_H 8#ifndef _ARPTABLES_H
10#define _ARPTABLES_H 9#define _ARPTABLES_H
11 10
12#ifdef __KERNEL__
13#include <linux/if.h> 11#include <linux/if.h>
14#include <linux/in.h> 12#include <linux/in.h>
15#include <linux/if_arp.h> 13#include <linux/if_arp.h>
16#include <linux/skbuff.h> 14#include <linux/skbuff.h>
17#endif 15#include <uapi/linux/netfilter_arp/arp_tables.h>
18#include <linux/types.h>
19#include <linux/compiler.h>
20#include <linux/netfilter_arp.h>
21
22#include <linux/netfilter/x_tables.h>
23
24#ifndef __KERNEL__
25#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_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
39
40#define ARPT_DEV_ADDR_LEN_MAX 16
41
42struct arpt_devaddr_info {
43 char addr[ARPT_DEV_ADDR_LEN_MAX];
44 char mask[ARPT_DEV_ADDR_LEN_MAX];
45};
46
47/* Yes, Virginia, you have to zero the padding. */
48struct arpt_arp {
49 /* Source and target IP addr */
50 struct in_addr src, tgt;
51 /* Mask for src and target IP addr */
52 struct in_addr smsk, tmsk;
53
54 /* Device hw address length, src+target device addresses */
55 __u8 arhln, arhln_mask;
56 struct arpt_devaddr_info src_devaddr;
57 struct arpt_devaddr_info tgt_devaddr;
58
59 /* ARP operation code. */
60 __be16 arpop, arpop_mask;
61
62 /* ARP hardware address and protocol address format. */
63 __be16 arhrd, arhrd_mask;
64 __be16 arpro, arpro_mask;
65
66 /* The protocol address length is only accepted if it is 4
67 * so there is no use in offering a way to do filtering on it.
68 */
69
70 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
71 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
72
73 /* Flags word */
74 __u8 flags;
75 /* Inverse flags */
76 __u16 invflags;
77};
78
79/* Values for "flag" field in struct arpt_ip (general arp structure).
80 * No flags defined yet.
81 */
82#define ARPT_F_MASK 0x00 /* All possible flag bits mask. */
83
84/* Values for "inv" field in struct arpt_arp. */
85#define ARPT_INV_VIA_IN 0x0001 /* Invert the sense of IN IFACE. */
86#define ARPT_INV_VIA_OUT 0x0002 /* Invert the sense of OUT IFACE */
87#define ARPT_INV_SRCIP 0x0004 /* Invert the sense of SRC IP. */
88#define ARPT_INV_TGTIP 0x0008 /* Invert the sense of TGT IP. */
89#define ARPT_INV_SRCDEVADDR 0x0010 /* Invert the sense of SRC DEV ADDR. */
90#define ARPT_INV_TGTDEVADDR 0x0020 /* Invert the sense of TGT DEV ADDR. */
91#define ARPT_INV_ARPOP 0x0040 /* Invert the sense of ARP OP. */
92#define ARPT_INV_ARPHRD 0x0080 /* Invert the sense of ARP HRD. */
93#define ARPT_INV_ARPPRO 0x0100 /* Invert the sense of ARP PRO. */
94#define ARPT_INV_ARPHLN 0x0200 /* Invert the sense of ARP HLN. */
95#define ARPT_INV_MASK 0x03FF /* All possible flag bits mask. */
96
97/* This structure defines each of the firewall rules. Consists of 3
98 parts which are 1) general ARP header stuff 2) match specific
99 stuff 3) the target to perform if the rule matches */
100struct arpt_entry
101{
102 struct arpt_arp arp;
103
104 /* Size of arpt_entry + matches */
105 __u16 target_offset;
106 /* Size of arpt_entry + matches + target */
107 __u16 next_offset;
108
109 /* Back pointer */
110 unsigned int comefrom;
111
112 /* Packet and byte counters. */
113 struct xt_counters counters;
114
115 /* The matches (if any), then the target. */
116 unsigned char elems[0];
117};
118
119/*
120 * New IP firewall options for [gs]etsockopt at the RAW IP level.
121 * Unlike BSD Linux inherits IP options so you don't have to use a raw
122 * socket for this. Instead we check rights in the calls.
123 *
124 * ATTENTION: check linux/in.h before adding new number here.
125 */
126#define ARPT_BASE_CTL 96
127
128#define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
129#define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
130#define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
131
132#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
133#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
134/* #define ARPT_SO_GET_REVISION_MATCH (APRT_BASE_CTL + 2) */
135#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
136#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
137
138/* The argument to ARPT_SO_GET_INFO */
139struct arpt_getinfo {
140 /* Which table: caller fills this in. */
141 char name[XT_TABLE_MAXNAMELEN];
142
143 /* Kernel fills these in. */
144 /* Which hook entry points are valid: bitmask */
145 unsigned int valid_hooks;
146
147 /* Hook entry points: one per netfilter hook. */
148 unsigned int hook_entry[NF_ARP_NUMHOOKS];
149
150 /* Underflow points. */
151 unsigned int underflow[NF_ARP_NUMHOOKS];
152
153 /* Number of entries */
154 unsigned int num_entries;
155
156 /* Size of entries. */
157 unsigned int size;
158};
159
160/* The argument to ARPT_SO_SET_REPLACE. */
161struct arpt_replace {
162 /* Which table. */
163 char name[XT_TABLE_MAXNAMELEN];
164
165 /* Which hook entry points are valid: bitmask. You can't
166 change this. */
167 unsigned int valid_hooks;
168
169 /* Number of entries */
170 unsigned int num_entries;
171
172 /* Total size of new entries */
173 unsigned int size;
174
175 /* Hook entry points. */
176 unsigned int hook_entry[NF_ARP_NUMHOOKS];
177
178 /* Underflow points. */
179 unsigned int underflow[NF_ARP_NUMHOOKS];
180
181 /* Information about old entries: */
182 /* Number of counters (must be equal to current number of entries). */
183 unsigned int num_counters;
184 /* The old entries' counters. */
185 struct xt_counters __user *counters;
186
187 /* The entries (hang off end: not really an array). */
188 struct arpt_entry entries[0];
189};
190
191/* The argument to ARPT_SO_GET_ENTRIES. */
192struct arpt_get_entries {
193 /* Which table: user fills this in. */
194 char name[XT_TABLE_MAXNAMELEN];
195
196 /* User fills this in: total entry size. */
197 unsigned int size;
198
199 /* The entries. */
200 struct arpt_entry entrytable[0];
201};
202
203/* Helper functions */
204static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)
205{
206 return (void *)e + e->target_offset;
207}
208
209/*
210 * Main firewall chains definitions and global var's definitions.
211 */
212#ifdef __KERNEL__
213 16
214/* Standard entry. */ 17/* Standard entry. */
215struct arpt_standard { 18struct arpt_standard {
@@ -274,5 +77,4 @@ compat_arpt_get_target(struct compat_arpt_entry *e)
274} 77}
275 78
276#endif /* CONFIG_COMPAT */ 79#endif /* CONFIG_COMPAT */
277#endif /*__KERNEL__*/
278#endif /* _ARPTABLES_H */ 80#endif /* _ARPTABLES_H */
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild
index e48f1a3f5a4a..e69de29bb2d1 100644
--- a/include/linux/netfilter_bridge/Kbuild
+++ b/include/linux/netfilter_bridge/Kbuild
@@ -1,18 +0,0 @@
1header-y += ebt_802_3.h
2header-y += ebt_among.h
3header-y += ebt_arp.h
4header-y += ebt_arpreply.h
5header-y += ebt_ip.h
6header-y += ebt_ip6.h
7header-y += ebt_limit.h
8header-y += ebt_log.h
9header-y += ebt_mark_m.h
10header-y += ebt_mark_t.h
11header-y += ebt_nat.h
12header-y += ebt_nflog.h
13header-y += ebt_pkttype.h
14header-y += ebt_redirect.h
15header-y += ebt_stp.h
16header-y += ebt_ulog.h
17header-y += ebt_vlan.h
18header-y += ebtables.h
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h
index be5be1577a56..e17e8bfb4e8b 100644
--- a/include/linux/netfilter_bridge/ebt_802_3.h
+++ b/include/linux/netfilter_bridge/ebt_802_3.h
@@ -1,70 +1,11 @@
1#ifndef __LINUX_BRIDGE_EBT_802_3_H 1#ifndef __LINUX_BRIDGE_EBT_802_3_H
2#define __LINUX_BRIDGE_EBT_802_3_H 2#define __LINUX_BRIDGE_EBT_802_3_H
3 3
4#include <linux/types.h>
5
6#define EBT_802_3_SAP 0x01
7#define EBT_802_3_TYPE 0x02
8
9#define EBT_802_3_MATCH "802_3"
10
11/*
12 * If frame has DSAP/SSAP value 0xaa you must check the SNAP type
13 * to discover what kind of packet we're carrying.
14 */
15#define CHECK_TYPE 0xaa
16
17/*
18 * Control field may be one or two bytes. If the first byte has
19 * the value 0x03 then the entire length is one byte, otherwise it is two.
20 * One byte controls are used in Unnumbered Information frames.
21 * Two byte controls are used in Numbered Information frames.
22 */
23#define IS_UI 0x03
24
25#define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
26
27/* ui has one byte ctrl, ni has two */
28struct hdr_ui {
29 __u8 dsap;
30 __u8 ssap;
31 __u8 ctrl;
32 __u8 orig[3];
33 __be16 type;
34};
35
36struct hdr_ni {
37 __u8 dsap;
38 __u8 ssap;
39 __be16 ctrl;
40 __u8 orig[3];
41 __be16 type;
42};
43
44struct ebt_802_3_hdr {
45 __u8 daddr[6];
46 __u8 saddr[6];
47 __be16 len;
48 union {
49 struct hdr_ui ui;
50 struct hdr_ni ni;
51 } llc;
52};
53
54#ifdef __KERNEL__
55#include <linux/skbuff.h> 4#include <linux/skbuff.h>
5#include <uapi/linux/netfilter_bridge/ebt_802_3.h>
56 6
57static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) 7static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
58{ 8{
59 return (struct ebt_802_3_hdr *)skb_mac_header(skb); 9 return (struct ebt_802_3_hdr *)skb_mac_header(skb);
60} 10}
61#endif 11#endif
62
63struct ebt_802_3_info {
64 __u8 sap;
65 __be16 type;
66 __u8 bitmask;
67 __u8 invflags;
68};
69
70#endif
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index 4dd5bd6994a8..34e7a2b7f867 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -9,191 +9,11 @@
9 * This code is stongly inspired on the iptables code which is 9 * This code is stongly inspired on the iptables code which is
10 * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling 10 * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
11 */ 11 */
12
13#ifndef __LINUX_BRIDGE_EFF_H 12#ifndef __LINUX_BRIDGE_EFF_H
14#define __LINUX_BRIDGE_EFF_H 13#define __LINUX_BRIDGE_EFF_H
15#include <linux/if.h>
16#include <linux/netfilter_bridge.h>
17#include <linux/if_ether.h>
18
19#define EBT_TABLE_MAXNAMELEN 32
20#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
21#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN
22
23/* verdicts >0 are "branches" */
24#define EBT_ACCEPT -1
25#define EBT_DROP -2
26#define EBT_CONTINUE -3
27#define EBT_RETURN -4
28#define NUM_STANDARD_TARGETS 4
29/* ebtables target modules store the verdict inside an int. We can
30 * reclaim a part of this int for backwards compatible extensions.
31 * The 4 lsb are more than enough to store the verdict. */
32#define EBT_VERDICT_BITS 0x0000000F
33
34struct xt_match;
35struct xt_target;
36
37struct ebt_counter {
38 uint64_t pcnt;
39 uint64_t bcnt;
40};
41 14
42struct ebt_replace { 15#include <uapi/linux/netfilter_bridge/ebtables.h>
43 char name[EBT_TABLE_MAXNAMELEN];
44 unsigned int valid_hooks;
45 /* nr of rules in the table */
46 unsigned int nentries;
47 /* total size of the entries */
48 unsigned int entries_size;
49 /* start of the chains */
50 struct ebt_entries __user *hook_entry[NF_BR_NUMHOOKS];
51 /* nr of counters userspace expects back */
52 unsigned int num_counters;
53 /* where the kernel will put the old counters */
54 struct ebt_counter __user *counters;
55 char __user *entries;
56};
57 16
58struct ebt_replace_kernel {
59 char name[EBT_TABLE_MAXNAMELEN];
60 unsigned int valid_hooks;
61 /* nr of rules in the table */
62 unsigned int nentries;
63 /* total size of the entries */
64 unsigned int entries_size;
65 /* start of the chains */
66 struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
67 /* nr of counters userspace expects back */
68 unsigned int num_counters;
69 /* where the kernel will put the old counters */
70 struct ebt_counter *counters;
71 char *entries;
72};
73
74struct ebt_entries {
75 /* this field is always set to zero
76 * See EBT_ENTRY_OR_ENTRIES.
77 * Must be same size as ebt_entry.bitmask */
78 unsigned int distinguisher;
79 /* the chain name */
80 char name[EBT_CHAIN_MAXNAMELEN];
81 /* counter offset for this chain */
82 unsigned int counter_offset;
83 /* one standard (accept, drop, return) per hook */
84 int policy;
85 /* nr. of entries */
86 unsigned int nentries;
87 /* entry list */
88 char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
89};
90
91/* used for the bitmask of struct ebt_entry */
92
93/* This is a hack to make a difference between an ebt_entry struct and an
94 * ebt_entries struct when traversing the entries from start to end.
95 * Using this simplifies the code a lot, while still being able to use
96 * ebt_entries.
97 * Contrary, iptables doesn't use something like ebt_entries and therefore uses
98 * different techniques for naming the policy and such. So, iptables doesn't
99 * need a hack like this.
100 */
101#define EBT_ENTRY_OR_ENTRIES 0x01
102/* these are the normal masks */
103#define EBT_NOPROTO 0x02
104#define EBT_802_3 0x04
105#define EBT_SOURCEMAC 0x08
106#define EBT_DESTMAC 0x10
107#define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC \
108 | EBT_ENTRY_OR_ENTRIES)
109
110#define EBT_IPROTO 0x01
111#define EBT_IIN 0x02
112#define EBT_IOUT 0x04
113#define EBT_ISOURCE 0x8
114#define EBT_IDEST 0x10
115#define EBT_ILOGICALIN 0x20
116#define EBT_ILOGICALOUT 0x40
117#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
118 | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
119
120struct ebt_entry_match {
121 union {
122 char name[EBT_FUNCTION_MAXNAMELEN];
123 struct xt_match *match;
124 } u;
125 /* size of data */
126 unsigned int match_size;
127 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
128};
129
130struct ebt_entry_watcher {
131 union {
132 char name[EBT_FUNCTION_MAXNAMELEN];
133 struct xt_target *watcher;
134 } u;
135 /* size of data */
136 unsigned int watcher_size;
137 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
138};
139
140struct ebt_entry_target {
141 union {
142 char name[EBT_FUNCTION_MAXNAMELEN];
143 struct xt_target *target;
144 } u;
145 /* size of data */
146 unsigned int target_size;
147 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
148};
149
150#define EBT_STANDARD_TARGET "standard"
151struct ebt_standard_target {
152 struct ebt_entry_target target;
153 int verdict;
154};
155
156/* one entry */
157struct ebt_entry {
158 /* this needs to be the first field */
159 unsigned int bitmask;
160 unsigned int invflags;
161 __be16 ethproto;
162 /* the physical in-dev */
163 char in[IFNAMSIZ];
164 /* the logical in-dev */
165 char logical_in[IFNAMSIZ];
166 /* the physical out-dev */
167 char out[IFNAMSIZ];
168 /* the logical out-dev */
169 char logical_out[IFNAMSIZ];
170 unsigned char sourcemac[ETH_ALEN];
171 unsigned char sourcemsk[ETH_ALEN];
172 unsigned char destmac[ETH_ALEN];
173 unsigned char destmsk[ETH_ALEN];
174 /* sizeof ebt_entry + matches */
175 unsigned int watchers_offset;
176 /* sizeof ebt_entry + matches + watchers */
177 unsigned int target_offset;
178 /* sizeof ebt_entry + matches + watchers + target */
179 unsigned int next_offset;
180 unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
181};
182
183/* {g,s}etsockopt numbers */
184#define EBT_BASE_CTL 128
185
186#define EBT_SO_SET_ENTRIES (EBT_BASE_CTL)
187#define EBT_SO_SET_COUNTERS (EBT_SO_SET_ENTRIES+1)
188#define EBT_SO_SET_MAX (EBT_SO_SET_COUNTERS+1)
189
190#define EBT_SO_GET_INFO (EBT_BASE_CTL)
191#define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO+1)
192#define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES+1)
193#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1)
194#define EBT_SO_GET_MAX (EBT_SO_GET_INIT_ENTRIES+1)
195
196#ifdef __KERNEL__
197 17
198/* return values for match() functions */ 18/* return values for match() functions */
199#define EBT_MATCH 0 19#define EBT_MATCH 0
@@ -304,77 +124,4 @@ extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
304/* True if the target is not a standard target */ 124/* True if the target is not a standard target */
305#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0) 125#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0)
306 126
307#endif /* __KERNEL__ */
308
309/* blatently stolen from ip_tables.h
310 * fn returns 0 to continue iteration */
311#define EBT_MATCH_ITERATE(e, fn, args...) \
312({ \
313 unsigned int __i; \
314 int __ret = 0; \
315 struct ebt_entry_match *__match; \
316 \
317 for (__i = sizeof(struct ebt_entry); \
318 __i < (e)->watchers_offset; \
319 __i += __match->match_size + \
320 sizeof(struct ebt_entry_match)) { \
321 __match = (void *)(e) + __i; \
322 \
323 __ret = fn(__match , ## args); \
324 if (__ret != 0) \
325 break; \
326 } \
327 if (__ret == 0) { \
328 if (__i != (e)->watchers_offset) \
329 __ret = -EINVAL; \
330 } \
331 __ret; \
332})
333
334#define EBT_WATCHER_ITERATE(e, fn, args...) \
335({ \
336 unsigned int __i; \
337 int __ret = 0; \
338 struct ebt_entry_watcher *__watcher; \
339 \
340 for (__i = e->watchers_offset; \
341 __i < (e)->target_offset; \
342 __i += __watcher->watcher_size + \
343 sizeof(struct ebt_entry_watcher)) { \
344 __watcher = (void *)(e) + __i; \
345 \
346 __ret = fn(__watcher , ## args); \
347 if (__ret != 0) \
348 break; \
349 } \
350 if (__ret == 0) { \
351 if (__i != (e)->target_offset) \
352 __ret = -EINVAL; \
353 } \
354 __ret; \
355})
356
357#define EBT_ENTRY_ITERATE(entries, size, fn, args...) \
358({ \
359 unsigned int __i; \
360 int __ret = 0; \
361 struct ebt_entry *__entry; \
362 \
363 for (__i = 0; __i < (size);) { \
364 __entry = (void *)(entries) + __i; \
365 __ret = fn(__entry , ## args); \
366 if (__ret != 0) \
367 break; \
368 if (__entry->bitmask != 0) \
369 __i += __entry->next_offset; \
370 else \
371 __i += sizeof(struct ebt_entries); \
372 } \
373 if (__ret == 0) { \
374 if (__i != (size)) \
375 __ret = -EINVAL; \
376 } \
377 __ret; \
378})
379
380#endif 127#endif
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index 8ba0c5b72ea9..e69de29bb2d1 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -1,10 +0,0 @@
1header-y += ip_tables.h
2header-y += ipt_CLUSTERIP.h
3header-y += ipt_ECN.h
4header-y += ipt_LOG.h
5header-y += ipt_REJECT.h
6header-y += ipt_TTL.h
7header-y += ipt_ULOG.h
8header-y += ipt_ah.h
9header-y += ipt_ecn.h
10header-y += ipt_ttl.h
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index db79231914ce..901e84db847d 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -11,230 +11,17 @@
11 * flags are stored in host byte order (of course). 11 * flags are stored in host byte order (of course).
12 * Port numbers are stored in HOST byte order. 12 * Port numbers are stored in HOST byte order.
13 */ 13 */
14
15#ifndef _IPTABLES_H 14#ifndef _IPTABLES_H
16#define _IPTABLES_H 15#define _IPTABLES_H
17 16
18#ifdef __KERNEL__
19#include <linux/if.h> 17#include <linux/if.h>
20#include <linux/in.h> 18#include <linux/in.h>
21#include <linux/ip.h> 19#include <linux/ip.h>
22#include <linux/skbuff.h> 20#include <linux/skbuff.h>
23#endif
24#include <linux/types.h>
25#include <linux/compiler.h>
26#include <linux/netfilter_ipv4.h>
27
28#include <linux/netfilter/x_tables.h>
29
30#ifndef __KERNEL__
31#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
32#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
33#define ipt_match xt_match
34#define ipt_target xt_target
35#define ipt_table xt_table
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
73
74/* Yes, Virginia, you have to zero the padding. */
75struct ipt_ip {
76 /* Source and destination IP addr */
77 struct in_addr src, dst;
78 /* Mask for src and dest IP addr */
79 struct in_addr smsk, dmsk;
80 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
81 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
82
83 /* Protocol, 0 = ANY */
84 __u16 proto;
85
86 /* Flags word */
87 __u8 flags;
88 /* Inverse flags */
89 __u8 invflags;
90};
91
92/* Values for "flag" field in struct ipt_ip (general ip structure). */
93#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */
94#define IPT_F_GOTO 0x02 /* Set if jump is a goto */
95#define IPT_F_MASK 0x03 /* All possible flag bits mask. */
96
97/* Values for "inv" field in struct ipt_ip. */
98#define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
99#define IPT_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
100#define IPT_INV_TOS 0x04 /* Invert the sense of TOS. */
101#define IPT_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
102#define IPT_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
103#define IPT_INV_FRAG 0x20 /* Invert the sense of FRAG. */
104#define IPT_INV_PROTO XT_INV_PROTO
105#define IPT_INV_MASK 0x7F /* All possible flag bits mask. */
106
107/* This structure defines each of the firewall rules. Consists of 3
108 parts which are 1) general IP header stuff 2) match specific
109 stuff 3) the target to perform if the rule matches */
110struct ipt_entry {
111 struct ipt_ip ip;
112
113 /* Mark with fields that we care about. */
114 unsigned int nfcache;
115
116 /* Size of ipt_entry + matches */
117 __u16 target_offset;
118 /* Size of ipt_entry + matches + target */
119 __u16 next_offset;
120
121 /* Back pointer */
122 unsigned int comefrom;
123
124 /* Packet and byte counters. */
125 struct xt_counters counters;
126
127 /* The matches (if any), then the target. */
128 unsigned char elems[0];
129};
130
131/*
132 * New IP firewall options for [gs]etsockopt at the RAW IP level.
133 * Unlike BSD Linux inherits IP options so you don't have to use a raw
134 * socket for this. Instead we check rights in the calls.
135 *
136 * ATTENTION: check linux/in.h before adding new number here.
137 */
138#define IPT_BASE_CTL 64
139
140#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
141#define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1)
142#define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS
143
144#define IPT_SO_GET_INFO (IPT_BASE_CTL)
145#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
146#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
147#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
148#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
149
150/* ICMP matching stuff */
151struct ipt_icmp {
152 __u8 type; /* type to match */
153 __u8 code[2]; /* range of code */
154 __u8 invflags; /* Inverse flags */
155};
156
157/* Values for "inv" field for struct ipt_icmp. */
158#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */
159
160/* The argument to IPT_SO_GET_INFO */
161struct ipt_getinfo {
162 /* Which table: caller fills this in. */
163 char name[XT_TABLE_MAXNAMELEN];
164
165 /* Kernel fills these in. */
166 /* Which hook entry points are valid: bitmask */
167 unsigned int valid_hooks;
168
169 /* Hook entry points: one per netfilter hook. */
170 unsigned int hook_entry[NF_INET_NUMHOOKS];
171
172 /* Underflow points. */
173 unsigned int underflow[NF_INET_NUMHOOKS];
174
175 /* Number of entries */
176 unsigned int num_entries;
177
178 /* Size of entries. */
179 unsigned int size;
180};
181
182/* The argument to IPT_SO_SET_REPLACE. */
183struct ipt_replace {
184 /* Which table. */
185 char name[XT_TABLE_MAXNAMELEN];
186
187 /* Which hook entry points are valid: bitmask. You can't
188 change this. */
189 unsigned int valid_hooks;
190
191 /* Number of entries */
192 unsigned int num_entries;
193
194 /* Total size of new entries */
195 unsigned int size;
196
197 /* Hook entry points. */
198 unsigned int hook_entry[NF_INET_NUMHOOKS];
199
200 /* Underflow points. */
201 unsigned int underflow[NF_INET_NUMHOOKS];
202
203 /* Information about old entries: */
204 /* Number of counters (must be equal to current number of entries). */
205 unsigned int num_counters;
206 /* The old entries' counters. */
207 struct xt_counters __user *counters;
208
209 /* The entries (hang off end: not really an array). */
210 struct ipt_entry entries[0];
211};
212
213/* The argument to IPT_SO_GET_ENTRIES. */
214struct ipt_get_entries {
215 /* Which table: user fills this in. */
216 char name[XT_TABLE_MAXNAMELEN];
217
218 /* User fills this in: total entry size. */
219 unsigned int size;
220
221 /* The entries. */
222 struct ipt_entry entrytable[0];
223};
224
225/* Helper functions */
226static __inline__ struct xt_entry_target *
227ipt_get_target(struct ipt_entry *e)
228{
229 return (void *)e + e->target_offset;
230}
231
232/*
233 * Main firewall chains definitions and global var's definitions.
234 */
235#ifdef __KERNEL__
236 21
237#include <linux/init.h> 22#include <linux/init.h>
23#include <uapi/linux/netfilter_ipv4/ip_tables.h>
24
238extern void ipt_init(void) __init; 25extern void ipt_init(void) __init;
239 26
240extern struct xt_table *ipt_register_table(struct net *net, 27extern struct xt_table *ipt_register_table(struct net *net,
@@ -303,5 +90,4 @@ compat_ipt_get_target(struct compat_ipt_entry *e)
303} 90}
304 91
305#endif /* CONFIG_COMPAT */ 92#endif /* CONFIG_COMPAT */
306#endif /*__KERNEL__*/
307#endif /* _IPTABLES_H */ 93#endif /* _IPTABLES_H */
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild
index b88c0058bf73..e69de29bb2d1 100644
--- a/include/linux/netfilter_ipv6/Kbuild
+++ b/include/linux/netfilter_ipv6/Kbuild
@@ -1,12 +0,0 @@
1header-y += ip6_tables.h
2header-y += ip6t_HL.h
3header-y += ip6t_LOG.h
4header-y += ip6t_NPT.h
5header-y += ip6t_REJECT.h
6header-y += ip6t_ah.h
7header-y += ip6t_frag.h
8header-y += ip6t_hl.h
9header-y += ip6t_ipv6header.h
10header-y += ip6t_mh.h
11header-y += ip6t_opts.h
12header-y += ip6t_rt.h
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 08c2cbbaa32b..5f84c6229dc6 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -11,268 +11,17 @@
11 * flags are stored in host byte order (of course). 11 * flags are stored in host byte order (of course).
12 * Port numbers are stored in HOST byte order. 12 * Port numbers are stored in HOST byte order.
13 */ 13 */
14
15#ifndef _IP6_TABLES_H 14#ifndef _IP6_TABLES_H
16#define _IP6_TABLES_H 15#define _IP6_TABLES_H
17 16
18#ifdef __KERNEL__
19#include <linux/if.h> 17#include <linux/if.h>
20#include <linux/in6.h> 18#include <linux/in6.h>
21#include <linux/ipv6.h> 19#include <linux/ipv6.h>
22#include <linux/skbuff.h> 20#include <linux/skbuff.h>
23#endif
24#include <linux/types.h>
25#include <linux/compiler.h>
26#include <linux/netfilter_ipv6.h>
27
28#include <linux/netfilter/x_tables.h>
29
30#ifndef __KERNEL__
31#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
32#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
33#define ip6t_match xt_match
34#define ip6t_target xt_target
35#define ip6t_table xt_table
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
66
67/* Yes, Virginia, you have to zero the padding. */
68struct ip6t_ip6 {
69 /* Source and destination IP6 addr */
70 struct in6_addr src, dst;
71 /* Mask for src and dest IP6 addr */
72 struct in6_addr smsk, dmsk;
73 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
74 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
75
76 /* Upper protocol number
77 * - The allowed value is 0 (any) or protocol number of last parsable
78 * header, which is 50 (ESP), 59 (No Next Header), 135 (MH), or
79 * the non IPv6 extension headers.
80 * - The protocol numbers of IPv6 extension headers except of ESP and
81 * MH do not match any packets.
82 * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
83 */
84 __u16 proto;
85 /* TOS to match iff flags & IP6T_F_TOS */
86 __u8 tos;
87
88 /* Flags word */
89 __u8 flags;
90 /* Inverse flags */
91 __u8 invflags;
92};
93
94/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
95#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper
96 protocols */
97#define IP6T_F_TOS 0x02 /* Match the TOS. */
98#define IP6T_F_GOTO 0x04 /* Set if jump is a goto */
99#define IP6T_F_MASK 0x07 /* All possible flag bits mask. */
100
101/* Values for "inv" field in struct ip6t_ip6. */
102#define IP6T_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
103#define IP6T_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
104#define IP6T_INV_TOS 0x04 /* Invert the sense of TOS. */
105#define IP6T_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
106#define IP6T_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
107#define IP6T_INV_FRAG 0x20 /* Invert the sense of FRAG. */
108#define IP6T_INV_PROTO XT_INV_PROTO
109#define IP6T_INV_MASK 0x7F /* All possible flag bits mask. */
110
111/* This structure defines each of the firewall rules. Consists of 3
112 parts which are 1) general IP header stuff 2) match specific
113 stuff 3) the target to perform if the rule matches */
114struct ip6t_entry {
115 struct ip6t_ip6 ipv6;
116
117 /* Mark with fields that we care about. */
118 unsigned int nfcache;
119
120 /* Size of ipt_entry + matches */
121 __u16 target_offset;
122 /* Size of ipt_entry + matches + target */
123 __u16 next_offset;
124
125 /* Back pointer */
126 unsigned int comefrom;
127
128 /* Packet and byte counters. */
129 struct xt_counters counters;
130
131 /* The matches (if any), then the target. */
132 unsigned char elems[0];
133};
134
135/* Standard entry */
136struct ip6t_standard {
137 struct ip6t_entry entry;
138 struct xt_standard_target target;
139};
140
141struct ip6t_error {
142 struct ip6t_entry entry;
143 struct xt_error_target target;
144};
145
146#define IP6T_ENTRY_INIT(__size) \
147{ \
148 .target_offset = sizeof(struct ip6t_entry), \
149 .next_offset = (__size), \
150}
151
152#define IP6T_STANDARD_INIT(__verdict) \
153{ \
154 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \
155 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
156 sizeof(struct xt_standard_target)), \
157 .target.verdict = -(__verdict) - 1, \
158}
159
160#define IP6T_ERROR_INIT \
161{ \
162 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \
163 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
164 sizeof(struct xt_error_target)), \
165 .target.errorname = "ERROR", \
166}
167
168/*
169 * New IP firewall options for [gs]etsockopt at the RAW IP level.
170 * Unlike BSD Linux inherits IP options so you don't have to use
171 * a raw socket for this. Instead we check rights in the calls.
172 *
173 * ATTENTION: check linux/in6.h before adding new number here.
174 */
175#define IP6T_BASE_CTL 64
176
177#define IP6T_SO_SET_REPLACE (IP6T_BASE_CTL)
178#define IP6T_SO_SET_ADD_COUNTERS (IP6T_BASE_CTL + 1)
179#define IP6T_SO_SET_MAX IP6T_SO_SET_ADD_COUNTERS
180
181#define IP6T_SO_GET_INFO (IP6T_BASE_CTL)
182#define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1)
183#define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 4)
184#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
185#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
186
187/* ICMP matching stuff */
188struct ip6t_icmp {
189 __u8 type; /* type to match */
190 __u8 code[2]; /* range of code */
191 __u8 invflags; /* Inverse flags */
192};
193
194/* Values for "inv" field for struct ipt_icmp. */
195#define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */
196
197/* The argument to IP6T_SO_GET_INFO */
198struct ip6t_getinfo {
199 /* Which table: caller fills this in. */
200 char name[XT_TABLE_MAXNAMELEN];
201
202 /* Kernel fills these in. */
203 /* Which hook entry points are valid: bitmask */
204 unsigned int valid_hooks;
205
206 /* Hook entry points: one per netfilter hook. */
207 unsigned int hook_entry[NF_INET_NUMHOOKS];
208
209 /* Underflow points. */
210 unsigned int underflow[NF_INET_NUMHOOKS];
211
212 /* Number of entries */
213 unsigned int num_entries;
214
215 /* Size of entries. */
216 unsigned int size;
217};
218
219/* The argument to IP6T_SO_SET_REPLACE. */
220struct ip6t_replace {
221 /* Which table. */
222 char name[XT_TABLE_MAXNAMELEN];
223
224 /* Which hook entry points are valid: bitmask. You can't
225 change this. */
226 unsigned int valid_hooks;
227
228 /* Number of entries */
229 unsigned int num_entries;
230
231 /* Total size of new entries */
232 unsigned int size;
233
234 /* Hook entry points. */
235 unsigned int hook_entry[NF_INET_NUMHOOKS];
236
237 /* Underflow points. */
238 unsigned int underflow[NF_INET_NUMHOOKS];
239
240 /* Information about old entries: */
241 /* Number of counters (must be equal to current number of entries). */
242 unsigned int num_counters;
243 /* The old entries' counters. */
244 struct xt_counters __user *counters;
245
246 /* The entries (hang off end: not really an array). */
247 struct ip6t_entry entries[0];
248};
249
250/* The argument to IP6T_SO_GET_ENTRIES. */
251struct ip6t_get_entries {
252 /* Which table: user fills this in. */
253 char name[XT_TABLE_MAXNAMELEN];
254
255 /* User fills this in: total entry size. */
256 unsigned int size;
257
258 /* The entries. */
259 struct ip6t_entry entrytable[0];
260};
261
262/* Helper functions */
263static __inline__ struct xt_entry_target *
264ip6t_get_target(struct ip6t_entry *e)
265{
266 return (void *)e + e->target_offset;
267}
268
269/*
270 * Main firewall chains definitions and global var's definitions.
271 */
272
273#ifdef __KERNEL__
274 21
275#include <linux/init.h> 22#include <linux/init.h>
23#include <uapi/linux/netfilter_ipv6/ip6_tables.h>
24
276extern void ip6t_init(void) __init; 25extern void ip6t_init(void) __init;
277 26
278extern void *ip6t_alloc_initial_table(const struct xt_table *); 27extern void *ip6t_alloc_initial_table(const struct xt_table *);
@@ -327,5 +76,4 @@ compat_ip6t_get_target(struct compat_ip6t_entry *e)
327} 76}
328 77
329#endif /* CONFIG_COMPAT */ 78#endif /* CONFIG_COMPAT */
330#endif /*__KERNEL__*/
331#endif /* _IP6_TABLES_H */ 79#endif /* _IP6_TABLES_H */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index f80c56ac4d82..6d3af05c107c 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -245,6 +245,8 @@ struct netlink_callback {
245 struct netlink_callback *cb); 245 struct netlink_callback *cb);
246 int (*done)(struct netlink_callback *cb); 246 int (*done)(struct netlink_callback *cb);
247 void *data; 247 void *data;
248 /* the module that dump function belong to */
249 struct module *module;
248 u16 family; 250 u16 family;
249 u16 min_dump_alloc; 251 u16 min_dump_alloc;
250 unsigned int prev_seq, seq; 252 unsigned int prev_seq, seq;
@@ -262,14 +264,24 @@ __nlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, int type, int len, int fla
262 264
263struct netlink_dump_control { 265struct netlink_dump_control {
264 int (*dump)(struct sk_buff *skb, struct netlink_callback *); 266 int (*dump)(struct sk_buff *skb, struct netlink_callback *);
265 int (*done)(struct netlink_callback*); 267 int (*done)(struct netlink_callback *);
266 void *data; 268 void *data;
269 struct module *module;
267 u16 min_dump_alloc; 270 u16 min_dump_alloc;
268}; 271};
269 272
270extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, 273extern int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
271 const struct nlmsghdr *nlh, 274 const struct nlmsghdr *nlh,
272 struct netlink_dump_control *control); 275 struct netlink_dump_control *control);
276static inline int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
277 const struct nlmsghdr *nlh,
278 struct netlink_dump_control *control)
279{
280 if (!control->module)
281 control->module = THIS_MODULE;
282
283 return __netlink_dump_start(ssk, skb, nlh, control);
284}
273 285
274#endif /* __KERNEL__ */ 286#endif /* __KERNEL__ */
275 287
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 4b03f56e280e..334a2f5f6bf1 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -81,12 +81,16 @@ struct nfs_access_entry {
81 int mask; 81 int mask;
82}; 82};
83 83
84struct nfs_lockowner {
85 fl_owner_t l_owner;
86 pid_t l_pid;
87};
88
84struct nfs_lock_context { 89struct nfs_lock_context {
85 atomic_t count; 90 atomic_t count;
86 struct list_head list; 91 struct list_head list;
87 struct nfs_open_context *open_context; 92 struct nfs_open_context *open_context;
88 fl_owner_t lockowner; 93 struct nfs_lockowner lockowner;
89 pid_t pid;
90}; 94};
91 95
92struct nfs4_state; 96struct nfs4_state;
@@ -99,6 +103,7 @@ struct nfs_open_context {
99 103
100 unsigned long flags; 104 unsigned long flags;
101#define NFS_CONTEXT_ERROR_WRITE (0) 105#define NFS_CONTEXT_ERROR_WRITE (0)
106#define NFS_CONTEXT_RESEND_WRITES (1)
102 int error; 107 int error;
103 108
104 struct list_head list; 109 struct list_head list;
@@ -355,6 +360,8 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
355extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); 360extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
356extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); 361extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr);
357extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 362extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
363extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *);
364extern void nfs_access_set_mask(struct nfs_access_entry *, u32);
358extern int nfs_permission(struct inode *, int); 365extern int nfs_permission(struct inode *, int);
359extern int nfs_open(struct inode *, struct file *); 366extern int nfs_open(struct inode *, struct file *);
360extern int nfs_release(struct inode *, struct file *); 367extern int nfs_release(struct inode *, struct file *);
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 310c63c8ab2c..a9e76ee1adca 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -39,6 +39,7 @@ struct nfs_client {
39 unsigned long cl_flags; /* behavior switches */ 39 unsigned long cl_flags; /* behavior switches */
40#define NFS_CS_NORESVPORT 0 /* - use ephemeral src port */ 40#define NFS_CS_NORESVPORT 0 /* - use ephemeral src port */
41#define NFS_CS_DISCRTRY 1 /* - disconnect on RPC retry */ 41#define NFS_CS_DISCRTRY 1 /* - disconnect on RPC retry */
42#define NFS_CS_MIGRATION 2 /* - transparent state migr */
42 struct sockaddr_storage cl_addr; /* server identifier */ 43 struct sockaddr_storage cl_addr; /* server identifier */
43 size_t cl_addrlen; 44 size_t cl_addrlen;
44 char * cl_hostname; /* hostname of server */ 45 char * cl_hostname; /* hostname of server */
@@ -81,6 +82,7 @@ struct nfs_client {
81 /* The flags used for obtaining the clientid during EXCHANGE_ID */ 82 /* The flags used for obtaining the clientid during EXCHANGE_ID */
82 u32 cl_exchange_flags; 83 u32 cl_exchange_flags;
83 struct nfs4_session *cl_session; /* shared session */ 84 struct nfs4_session *cl_session; /* shared session */
85 bool cl_preserve_clid;
84 struct nfs41_server_owner *cl_serverowner; 86 struct nfs41_server_owner *cl_serverowner;
85 struct nfs41_server_scope *cl_serverscope; 87 struct nfs41_server_scope *cl_serverscope;
86 struct nfs41_impl_id *cl_implid; 88 struct nfs41_impl_id *cl_implid;
@@ -125,6 +127,7 @@ struct nfs_server {
125 unsigned int namelen; 127 unsigned int namelen;
126 unsigned int options; /* extra options enabled by mount */ 128 unsigned int options; /* extra options enabled by mount */
127#define NFS_OPTION_FSCACHE 0x00000001 /* - local caching enabled */ 129#define NFS_OPTION_FSCACHE 0x00000001 /* - local caching enabled */
130#define NFS_OPTION_MIGRATION 0x00000002 /* - NFSv4 migration enabled */
128 131
129 struct nfs_fsid fsid; 132 struct nfs_fsid fsid;
130 __u64 maxfilesize; /* maximum file size */ 133 __u64 maxfilesize; /* maximum file size */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index be9cf3c7e79e..a73ea89789d1 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -251,7 +251,6 @@ struct nfs4_layoutget_res {
251struct nfs4_layoutget { 251struct nfs4_layoutget {
252 struct nfs4_layoutget_args args; 252 struct nfs4_layoutget_args args;
253 struct nfs4_layoutget_res res; 253 struct nfs4_layoutget_res res;
254 struct pnfs_layout_segment **lsegpp;
255 gfp_t gfp_flags; 254 gfp_t gfp_flags;
256}; 255};
257 256
@@ -335,6 +334,7 @@ struct nfs_openargs {
335 struct nfs_seqid * seqid; 334 struct nfs_seqid * seqid;
336 int open_flags; 335 int open_flags;
337 fmode_t fmode; 336 fmode_t fmode;
337 u32 access;
338 __u64 clientid; 338 __u64 clientid;
339 struct stateowner_id id; 339 struct stateowner_id id;
340 union { 340 union {
@@ -369,6 +369,9 @@ struct nfs_openres {
369 struct nfs4_string *owner; 369 struct nfs4_string *owner;
370 struct nfs4_string *group_owner; 370 struct nfs4_string *group_owner;
371 struct nfs4_sequence_res seq_res; 371 struct nfs4_sequence_res seq_res;
372 __u32 access_request;
373 __u32 access_supported;
374 __u32 access_result;
372}; 375};
373 376
374/* 377/*
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild
index 5b7d84ac954a..e69de29bb2d1 100644
--- a/include/linux/nfsd/Kbuild
+++ b/include/linux/nfsd/Kbuild
@@ -1,5 +0,0 @@
1header-y += cld.h
2header-y += debug.h
3header-y += export.h
4header-y += nfsfh.h
5header-y += stats.h
diff --git a/include/linux/nfsd/debug.h b/include/linux/nfsd/debug.h
index ee4aa91788e7..19ef8375b577 100644
--- a/include/linux/nfsd/debug.h
+++ b/include/linux/nfsd/debug.h
@@ -5,44 +5,15 @@
5 * 5 *
6 * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de> 6 * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
7 */ 7 */
8
9#ifndef LINUX_NFSD_DEBUG_H 8#ifndef LINUX_NFSD_DEBUG_H
10#define LINUX_NFSD_DEBUG_H 9#define LINUX_NFSD_DEBUG_H
11 10
12#include <linux/sunrpc/debug.h> 11#include <uapi/linux/nfsd/debug.h>
13 12
14/*
15 * Enable debugging for nfsd.
16 * Requires RPC_DEBUG.
17 */
18#ifdef RPC_DEBUG
19# define NFSD_DEBUG 1
20#endif
21
22/*
23 * knfsd debug flags
24 */
25#define NFSDDBG_SOCK 0x0001
26#define NFSDDBG_FH 0x0002
27#define NFSDDBG_EXPORT 0x0004
28#define NFSDDBG_SVC 0x0008
29#define NFSDDBG_PROC 0x0010
30#define NFSDDBG_FILEOP 0x0020
31#define NFSDDBG_AUTH 0x0040
32#define NFSDDBG_REPCACHE 0x0080
33#define NFSDDBG_XDR 0x0100
34#define NFSDDBG_LOCKD 0x0200
35#define NFSDDBG_ALL 0x7FFF
36#define NFSDDBG_NOCHANGE 0xFFFF
37
38
39#ifdef __KERNEL__
40# undef ifdebug 13# undef ifdebug
41# ifdef NFSD_DEBUG 14# ifdef NFSD_DEBUG
42# define ifdebug(flag) if (nfsd_debug & NFSDDBG_##flag) 15# define ifdebug(flag) if (nfsd_debug & NFSDDBG_##flag)
43# else 16# else
44# define ifdebug(flag) if (0) 17# define ifdebug(flag) if (0)
45# endif 18# endif
46#endif /* __KERNEL__ */
47
48#endif /* LINUX_NFSD_DEBUG_H */ 19#endif /* LINUX_NFSD_DEBUG_H */
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index e33f747b173c..24c139288db4 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -6,58 +6,11 @@
6 * 6 *
7 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> 7 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
8 */ 8 */
9
10#ifndef NFSD_EXPORT_H 9#ifndef NFSD_EXPORT_H
11#define NFSD_EXPORT_H 10#define NFSD_EXPORT_H
12 11
13# include <linux/types.h>
14#ifdef __KERNEL__
15# include <linux/nfsd/nfsfh.h> 12# include <linux/nfsd/nfsfh.h>
16#endif 13#include <uapi/linux/nfsd/export.h>
17
18/*
19 * Important limits for the exports stuff.
20 */
21#define NFSCLNT_IDMAX 1024
22#define NFSCLNT_ADDRMAX 16
23#define NFSCLNT_KEYMAX 32
24
25/*
26 * Export flags.
27 */
28#define NFSEXP_READONLY 0x0001
29#define NFSEXP_INSECURE_PORT 0x0002
30#define NFSEXP_ROOTSQUASH 0x0004
31#define NFSEXP_ALLSQUASH 0x0008
32#define NFSEXP_ASYNC 0x0010
33#define NFSEXP_GATHERED_WRITES 0x0020
34/* 40 80 100 currently unused */
35#define NFSEXP_NOHIDE 0x0200
36#define NFSEXP_NOSUBTREECHECK 0x0400
37#define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */
38#define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect; no longer supported */
39#define NFSEXP_FSID 0x2000
40#define NFSEXP_CROSSMOUNT 0x4000
41#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */
42/*
43 * The NFSEXP_V4ROOT flag causes the kernel to give access only to NFSv4
44 * clients, and only to the single directory that is the root of the
45 * export; further lookup and readdir operations are treated as if every
46 * subdirectory was a mountpoint, and ignored if they are not themselves
47 * exported. This is used by nfsd and mountd to construct the NFSv4
48 * pseudofilesystem, which provides access only to paths leading to each
49 * exported filesystem.
50 */
51#define NFSEXP_V4ROOT 0x10000
52/* All flags that we claim to support. (Note we don't support NOACL.) */
53#define NFSEXP_ALLFLAGS 0x17E3F
54
55/* The flags that may vary depending on security flavor: */
56#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
57 | NFSEXP_ALLSQUASH \
58 | NFSEXP_INSECURE_PORT)
59
60#ifdef __KERNEL__
61 14
62/* 15/*
63 * FS Locations 16 * FS Locations
@@ -154,7 +107,4 @@ static inline void exp_get(struct svc_export *exp)
154} 107}
155struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *); 108struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *);
156 109
157#endif /* __KERNEL__ */
158
159#endif /* NFSD_EXPORT_H */ 110#endif /* NFSD_EXPORT_H */
160
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index fa63048fecff..a93593f1fa4e 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -10,117 +10,11 @@
10 * 10 *
11 * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de> 11 * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
12 */ 12 */
13
14#ifndef _LINUX_NFSD_FH_H 13#ifndef _LINUX_NFSD_FH_H
15#define _LINUX_NFSD_FH_H 14#define _LINUX_NFSD_FH_H
16 15
17#include <linux/types.h>
18#include <linux/nfs.h>
19#include <linux/nfs2.h>
20#include <linux/nfs3.h>
21#include <linux/nfs4.h>
22#ifdef __KERNEL__
23# include <linux/sunrpc/svc.h> 16# include <linux/sunrpc/svc.h>
24#endif 17#include <uapi/linux/nfsd/nfsfh.h>
25
26/*
27 * This is the old "dentry style" Linux NFSv2 file handle.
28 *
29 * The xino and xdev fields are currently used to transport the
30 * ino/dev of the exported inode.
31 */
32struct nfs_fhbase_old {
33 __u32 fb_dcookie; /* dentry cookie - always 0xfeebbaca */
34 __u32 fb_ino; /* our inode number */
35 __u32 fb_dirino; /* dir inode number, 0 for directories */
36 __u32 fb_dev; /* our device */
37 __u32 fb_xdev;
38 __u32 fb_xino;
39 __u32 fb_generation;
40};
41
42/*
43 * This is the new flexible, extensible style NFSv2/v3 file handle.
44 * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000
45 *
46 * The file handle starts with a sequence of four-byte words.
47 * The first word contains a version number (1) and three descriptor bytes
48 * that tell how the remaining 3 variable length fields should be handled.
49 * These three bytes are auth_type, fsid_type and fileid_type.
50 *
51 * All four-byte values are in host-byte-order.
52 *
53 * The auth_type field specifies how the filehandle can be authenticated
54 * This might allow a file to be confirmed to be in a writable part of a
55 * filetree without checking the path from it up to the root.
56 * Current values:
57 * 0 - No authentication. fb_auth is 0 bytes long
58 * Possible future values:
59 * 1 - 4 bytes taken from MD5 hash of the remainer of the file handle
60 * prefixed by a secret and with the important export flags.
61 *
62 * The fsid_type identifies how the filesystem (or export point) is
63 * encoded.
64 * Current values:
65 * 0 - 4 byte device id (ms-2-bytes major, ls-2-bytes minor), 4byte inode number
66 * NOTE: we cannot use the kdev_t device id value, because kdev_t.h
67 * says we mustn't. We must break it up and reassemble.
68 * 1 - 4 byte user specified identifier
69 * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED
70 * 3 - 4 byte device id, encoded for user-space, 4 byte inode number
71 * 4 - 4 byte inode number and 4 byte uuid
72 * 5 - 8 byte uuid
73 * 6 - 16 byte uuid
74 * 7 - 8 byte inode number and 16 byte uuid
75 *
76 * The fileid_type identified how the file within the filesystem is encoded.
77 * This is (will be) passed to, and set by, the underlying filesystem if it supports
78 * filehandle operations. The filesystem must not use the value '0' or '0xff' and may
79 * only use the values 1 and 2 as defined below:
80 * Current values:
81 * 0 - The root, or export point, of the filesystem. fb_fileid is 0 bytes.
82 * 1 - 32bit inode number, 32 bit generation number.
83 * 2 - 32bit inode number, 32 bit generation number, 32 bit parent directory inode number.
84 *
85 */
86struct nfs_fhbase_new {
87 __u8 fb_version; /* == 1, even => nfs_fhbase_old */
88 __u8 fb_auth_type;
89 __u8 fb_fsid_type;
90 __u8 fb_fileid_type;
91 __u32 fb_auth[1];
92/* __u32 fb_fsid[0]; floating */
93/* __u32 fb_fileid[0]; floating */
94};
95
96struct knfsd_fh {
97 unsigned int fh_size; /* significant for NFSv3.
98 * Points to the current size while building
99 * a new file handle
100 */
101 union {
102 struct nfs_fhbase_old fh_old;
103 __u32 fh_pad[NFS4_FHSIZE/4];
104 struct nfs_fhbase_new fh_new;
105 } fh_base;
106};
107
108#define ofh_dcookie fh_base.fh_old.fb_dcookie
109#define ofh_ino fh_base.fh_old.fb_ino
110#define ofh_dirino fh_base.fh_old.fb_dirino
111#define ofh_dev fh_base.fh_old.fb_dev
112#define ofh_xdev fh_base.fh_old.fb_xdev
113#define ofh_xino fh_base.fh_old.fb_xino
114#define ofh_generation fh_base.fh_old.fb_generation
115
116#define fh_version fh_base.fh_new.fb_version
117#define fh_fsid_type fh_base.fh_new.fb_fsid_type
118#define fh_auth_type fh_base.fh_new.fb_auth_type
119#define fh_fileid_type fh_base.fh_new.fb_fileid_type
120#define fh_auth fh_base.fh_new.fb_auth
121#define fh_fsid fh_base.fh_new.fb_auth
122
123#ifdef __KERNEL__
124 18
125static inline __u32 ino_t_to_u32(ino_t ino) 19static inline __u32 ino_t_to_u32(ino_t ino)
126{ 20{
@@ -166,7 +60,4 @@ typedef struct svc_fh {
166 60
167} svc_fh; 61} svc_fh;
168 62
169#endif /* __KERNEL__ */
170
171
172#endif /* _LINUX_NFSD_FH_H */ 63#endif /* _LINUX_NFSD_FH_H */
diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h
index 2693ef647df6..e75b2544ff12 100644
--- a/include/linux/nfsd/stats.h
+++ b/include/linux/nfsd/stats.h
@@ -5,16 +5,11 @@
5 * 5 *
6 * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de> 6 * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
7 */ 7 */
8
9#ifndef LINUX_NFSD_STATS_H 8#ifndef LINUX_NFSD_STATS_H
10#define LINUX_NFSD_STATS_H 9#define LINUX_NFSD_STATS_H
11 10
12#include <linux/nfs4.h> 11#include <uapi/linux/nfsd/stats.h>
13
14/* thread usage wraps very million seconds (approx one fortnight) */
15#define NFSD_USAGE_WRAP (HZ*1000000)
16 12
17#ifdef __KERNEL__
18 13
19struct nfsd_stats { 14struct nfsd_stats {
20 unsigned int rchits; /* repcache hits */ 15 unsigned int rchits; /* repcache hits */
@@ -47,5 +42,4 @@ extern struct svc_stat nfsd_svcstats;
47void nfsd_stat_init(void); 42void nfsd_stat_init(void);
48void nfsd_stat_shutdown(void); 43void nfsd_stat_shutdown(void);
49 44
50#endif /* __KERNEL__ */
51#endif /* LINUX_NFSD_STATS_H */ 45#endif /* LINUX_NFSD_STATS_H */
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 6ef49b803efb..8163107b94b4 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -26,32 +26,32 @@ extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
26extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); 26extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
27 27
28#else /* CONFIG_OF */ 28#else /* CONFIG_OF */
29int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) 29static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
30{ 30{
31 return -ENOSYS; 31 return -ENOSYS;
32} 32}
33 33
34struct phy_device *of_phy_find_device(struct device_node *phy_np) 34static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
35{ 35{
36 return NULL; 36 return NULL;
37} 37}
38 38
39struct phy_device *of_phy_connect(struct net_device *dev, 39static inline struct phy_device *of_phy_connect(struct net_device *dev,
40 struct device_node *phy_np, 40 struct device_node *phy_np,
41 void (*hndlr)(struct net_device *), 41 void (*hndlr)(struct net_device *),
42 u32 flags, phy_interface_t iface) 42 u32 flags, phy_interface_t iface)
43{ 43{
44 return NULL; 44 return NULL;
45} 45}
46 46
47struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 47static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
48 void (*hndlr)(struct net_device *), 48 void (*hndlr)(struct net_device *),
49 phy_interface_t iface) 49 phy_interface_t iface)
50{ 50{
51 return NULL; 51 return NULL;
52} 52}
53 53
54struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) 54static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
55{ 55{
56 return NULL; 56 return NULL;
57} 57}
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index eed27f4f4c3e..be655e4a2a75 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -71,13 +71,13 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
71#ifdef CONFIG_COMPACTION 71#ifdef CONFIG_COMPACTION
72#define get_pageblock_skip(page) \ 72#define get_pageblock_skip(page) \
73 get_pageblock_flags_group(page, PB_migrate_skip, \ 73 get_pageblock_flags_group(page, PB_migrate_skip, \
74 PB_migrate_skip + 1) 74 PB_migrate_skip)
75#define clear_pageblock_skip(page) \ 75#define clear_pageblock_skip(page) \
76 set_pageblock_flags_group(page, 0, PB_migrate_skip, \ 76 set_pageblock_flags_group(page, 0, PB_migrate_skip, \
77 PB_migrate_skip + 1) 77 PB_migrate_skip)
78#define set_pageblock_skip(page) \ 78#define set_pageblock_skip(page) \
79 set_pageblock_flags_group(page, 1, PB_migrate_skip, \ 79 set_pageblock_flags_group(page, 1, PB_migrate_skip, \
80 PB_migrate_skip + 1) 80 PB_migrate_skip)
81#endif /* CONFIG_COMPACTION */ 81#endif /* CONFIG_COMPACTION */
82 82
83#define get_pageblock_flags(page) \ 83#define get_pageblock_flags(page) \
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h
new file mode 100644
index 000000000000..cf80f7e5277f
--- /dev/null
+++ b/include/linux/percpu-rwsem.h
@@ -0,0 +1,89 @@
1#ifndef _LINUX_PERCPU_RWSEM_H
2#define _LINUX_PERCPU_RWSEM_H
3
4#include <linux/mutex.h>
5#include <linux/percpu.h>
6#include <linux/rcupdate.h>
7#include <linux/delay.h>
8
9struct percpu_rw_semaphore {
10 unsigned __percpu *counters;
11 bool locked;
12 struct mutex mtx;
13};
14
15static inline void percpu_down_read(struct percpu_rw_semaphore *p)
16{
17 rcu_read_lock();
18 if (unlikely(p->locked)) {
19 rcu_read_unlock();
20 mutex_lock(&p->mtx);
21 this_cpu_inc(*p->counters);
22 mutex_unlock(&p->mtx);
23 return;
24 }
25 this_cpu_inc(*p->counters);
26 rcu_read_unlock();
27}
28
29static inline void percpu_up_read(struct percpu_rw_semaphore *p)
30{
31 /*
32 * On X86, write operation in this_cpu_dec serves as a memory unlock
33 * barrier (i.e. memory accesses may be moved before the write, but
34 * no memory accesses are moved past the write).
35 * On other architectures this may not be the case, so we need smp_mb()
36 * there.
37 */
38#if defined(CONFIG_X86) && (!defined(CONFIG_X86_PPRO_FENCE) && !defined(CONFIG_X86_OOSTORE))
39 barrier();
40#else
41 smp_mb();
42#endif
43 this_cpu_dec(*p->counters);
44}
45
46static inline unsigned __percpu_count(unsigned __percpu *counters)
47{
48 unsigned total = 0;
49 int cpu;
50
51 for_each_possible_cpu(cpu)
52 total += ACCESS_ONCE(*per_cpu_ptr(counters, cpu));
53
54 return total;
55}
56
57static inline void percpu_down_write(struct percpu_rw_semaphore *p)
58{
59 mutex_lock(&p->mtx);
60 p->locked = true;
61 synchronize_rcu();
62 while (__percpu_count(p->counters))
63 msleep(1);
64 smp_rmb(); /* paired with smp_mb() in percpu_sem_up_read() */
65}
66
67static inline void percpu_up_write(struct percpu_rw_semaphore *p)
68{
69 p->locked = false;
70 mutex_unlock(&p->mtx);
71}
72
73static inline int percpu_init_rwsem(struct percpu_rw_semaphore *p)
74{
75 p->counters = alloc_percpu(unsigned);
76 if (unlikely(!p->counters))
77 return -ENOMEM;
78 p->locked = false;
79 mutex_init(&p->mtx);
80 return 0;
81}
82
83static inline void percpu_free_rwsem(struct percpu_rw_semaphore *p)
84{
85 free_percpu(p->counters);
86 p->counters = NULL; /* catch use after free bugs */
87}
88
89#endif
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 599afc4bb67e..b4166cdfa7a2 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1110,7 +1110,7 @@ struct perf_cpu_context {
1110 int exclusive; 1110 int exclusive;
1111 struct list_head rotation_list; 1111 struct list_head rotation_list;
1112 int jiffies_interval; 1112 int jiffies_interval;
1113 struct pmu *active_pmu; 1113 struct pmu *unique_pmu;
1114 struct perf_cgroup *cgrp; 1114 struct perf_cgroup *cgrp;
1115}; 1115};
1116 1116
diff --git a/include/linux/platform_data/i2c-nomadik.h b/include/linux/platform_data/i2c-nomadik.h
index c2303c3e4803..3a8be9cdc95c 100644
--- a/include/linux/platform_data/i2c-nomadik.h
+++ b/include/linux/platform_data/i2c-nomadik.h
@@ -28,7 +28,7 @@ enum i2c_freq_mode {
28 * @sm: speed mode 28 * @sm: speed mode
29 */ 29 */
30struct nmk_i2c_controller { 30struct nmk_i2c_controller {
31 unsigned long clk_freq; 31 u32 clk_freq;
32 unsigned short slsu; 32 unsigned short slsu;
33 unsigned char tft; 33 unsigned char tft;
34 unsigned char rft; 34 unsigned char rft;
diff --git a/include/linux/platform_data/leds-lm3556.h b/include/linux/platform_data/leds-lm3556.h
deleted file mode 100644
index 4b4e7d6b0527..000000000000
--- a/include/linux/platform_data/leds-lm3556.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * Simple driver for Texas Instruments LM3556 LED Flash driver chip (Rev0x03)
3 * Copyright (C) 2012 Texas Instruments
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 */
10
11#ifndef __LINUX_LM3556_H
12#define __LINUX_LM3556_H
13
14#define LM3556_NAME "leds-lm3556"
15
16enum lm3556_pin_polarity {
17 PIN_LOW_ACTIVE = 0,
18 PIN_HIGH_ACTIVE,
19};
20
21enum lm3556_pin_enable {
22 PIN_DISABLED = 0,
23 PIN_ENABLED,
24};
25
26enum lm3556_strobe_usuage {
27 STROBE_EDGE_DETECT = 0,
28 STROBE_LEVEL_DETECT,
29};
30
31enum lm3556_indic_mode {
32 INDIC_MODE_INTERNAL = 0,
33 INDIC_MODE_EXTERNAL,
34};
35
36struct lm3556_platform_data {
37 enum lm3556_pin_enable torch_pin_en;
38 enum lm3556_pin_polarity torch_pin_polarity;
39
40 enum lm3556_strobe_usuage strobe_usuage;
41 enum lm3556_pin_enable strobe_pin_en;
42 enum lm3556_pin_polarity strobe_pin_polarity;
43
44 enum lm3556_pin_enable tx_pin_en;
45 enum lm3556_pin_polarity tx_pin_polarity;
46
47 enum lm3556_indic_mode indicator_mode;
48};
49
50#endif /* __LINUX_LM3556_H */
diff --git a/include/linux/platform_data/leds-lm355x.h b/include/linux/platform_data/leds-lm355x.h
new file mode 100644
index 000000000000..b88724bb0b46
--- /dev/null
+++ b/include/linux/platform_data/leds-lm355x.h
@@ -0,0 +1,66 @@
1/*
2 * Copyright (C) 2012 Texas Instruments
3 *
4 * License Terms: GNU General Public License v2
5 *
6 * Simple driver for Texas Instruments LM355x LED driver chip
7 *
8 * Author: G.Shark Jeong <gshark.jeong@gmail.com>
9 * Daniel Jeong <daniel.jeong@ti.com>
10 */
11
12#define LM355x_NAME "leds-lm355x"
13#define LM3554_NAME "leds-lm3554"
14#define LM3556_NAME "leds-lm3556"
15
16/* lm3554 : strobe def. on */
17enum lm355x_strobe {
18 LM355x_PIN_STROBE_DISABLE = 0x00,
19 LM355x_PIN_STROBE_ENABLE = 0x01,
20};
21
22enum lm355x_torch {
23 LM355x_PIN_TORCH_DISABLE = 0,
24 LM3554_PIN_TORCH_ENABLE = 0x80,
25 LM3556_PIN_TORCH_ENABLE = 0x10,
26};
27
28enum lm355x_tx2 {
29 LM355x_PIN_TX_DISABLE = 0,
30 LM3554_PIN_TX_ENABLE = 0x20,
31 LM3556_PIN_TX_ENABLE = 0x40,
32};
33
34enum lm355x_ntc {
35 LM355x_PIN_NTC_DISABLE = 0,
36 LM3554_PIN_NTC_ENABLE = 0x08,
37 LM3556_PIN_NTC_ENABLE = 0x80,
38};
39
40enum lm355x_pmode {
41 LM355x_PMODE_DISABLE = 0,
42 LM355x_PMODE_ENABLE = 0x04,
43};
44
45/*
46 * struct lm3554_platform_data
47 * @pin_strobe: strobe input
48 * @pin_torch : input pin
49 * lm3554-tx1/torch/gpio1
50 * lm3556-torch
51 * @pin_tx2 : input pin
52 * lm3554-envm/tx2/gpio2
53 * lm3556-tx pin
54 * @ntc_pin : output pin
55 * lm3554-ledi/ntc
56 * lm3556-temp pin
57 * @pass_mode : pass mode
58 */
59struct lm355x_platform_data {
60 enum lm355x_strobe pin_strobe;
61 enum lm355x_torch pin_tx1;
62 enum lm355x_tx2 pin_tx2;
63 enum lm355x_ntc ntc_pin;
64
65 enum lm355x_pmode pass_mode;
66};
diff --git a/include/linux/platform_data/leds-lm3642.h b/include/linux/platform_data/leds-lm3642.h
new file mode 100644
index 000000000000..72d6ee6ade57
--- /dev/null
+++ b/include/linux/platform_data/leds-lm3642.h
@@ -0,0 +1,38 @@
1/*
2* Copyright (C) 2012 Texas Instruments
3*
4* License Terms: GNU General Public License v2
5*
6* Simple driver for Texas Instruments LM3642 LED driver chip
7*
8* Author: G.Shark Jeong <gshark.jeong@gmail.com>
9* Daniel Jeong <daniel.jeong@ti.com>
10*/
11
12#ifndef __LINUX_LM3642_H
13#define __LINUX_LM3642_H
14
15#define LM3642_NAME "leds-lm3642"
16
17enum lm3642_torch_pin_enable {
18 LM3642_TORCH_PIN_DISABLE = 0x00,
19 LM3642_TORCH_PIN_ENABLE = 0x10,
20};
21
22enum lm3642_strobe_pin_enable {
23 LM3642_STROBE_PIN_DISABLE = 0x00,
24 LM3642_STROBE_PIN_ENABLE = 0x20,
25};
26
27enum lm3642_tx_pin_enable {
28 LM3642_TX_PIN_DISABLE = 0x00,
29 LM3642_TX_PIN_ENABLE = 0x40,
30};
31
32struct lm3642_platform_data {
33 enum lm3642_torch_pin_enable torch_pin;
34 enum lm3642_strobe_pin_enable strobe_pin;
35 enum lm3642_tx_pin_enable tx_pin;
36};
37
38#endif /* __LINUX_LM3642_H */
diff --git a/include/linux/platform_data/leds-pca9633.h b/include/linux/platform_data/leds-pca9633.h
new file mode 100644
index 000000000000..c5bf29b6fa7f
--- /dev/null
+++ b/include/linux/platform_data/leds-pca9633.h
@@ -0,0 +1,35 @@
1/*
2 * PCA9633 LED chip driver.
3 *
4 * Copyright 2012 bct electronic GmbH
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 */
20
21#ifndef __LINUX_PCA9633_H
22#define __LINUX_PCA9633_H
23#include <linux/leds.h>
24
25enum pca9633_outdrv {
26 PCA9633_OPEN_DRAIN,
27 PCA9633_TOTEM_POLE, /* aka push-pull */
28};
29
30struct pca9633_platform_data {
31 struct led_platform_data leds;
32 enum pca9633_outdrv outdrv;
33};
34
35#endif /* __LINUX_PCA9633_H*/
diff --git a/include/linux/platform_data/mipi-csis.h b/include/linux/platform_data/mipi-csis.h
index c45b1e8d4c2e..bf34e17cee7f 100644
--- a/include/linux/platform_data/mipi-csis.h
+++ b/include/linux/platform_data/mipi-csis.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd. 2 * Copyright (C) 2010 - 2012 Samsung Electronics Co., Ltd.
3 * 3 *
4 * S5P series MIPI CSI slave device support 4 * Samsung S5P/Exynos SoC series MIPI CSIS device support
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 version 2 as 7 * it under the terms of the GNU General Public License version 2 as
@@ -11,33 +11,27 @@
11#ifndef __PLAT_SAMSUNG_MIPI_CSIS_H_ 11#ifndef __PLAT_SAMSUNG_MIPI_CSIS_H_
12#define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__ 12#define __PLAT_SAMSUNG_MIPI_CSIS_H_ __FILE__
13 13
14struct platform_device;
15
16/** 14/**
17 * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver 15 * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver
18 * @clk_rate: bus clock frequency 16 * @clk_rate: bus clock frequency
19 * @lanes: number of data lanes used 17 * @wclk_source: CSI wrapper clock selection: 0 - bus clock, 1 - ext. SCLK_CAM
20 * @alignment: data alignment in bits 18 * @lanes: number of data lanes used
21 * @hs_settle: HS-RX settle time 19 * @hs_settle: HS-RX settle time
22 * @fixed_phy_vdd: false to enable external D-PHY regulator management in the
23 * driver or true in case this regulator has no enable function
24 * @phy_enable: pointer to a callback controlling D-PHY enable/reset
25 */ 20 */
26struct s5p_platform_mipi_csis { 21struct s5p_platform_mipi_csis {
27 unsigned long clk_rate; 22 unsigned long clk_rate;
23 u8 wclk_source;
28 u8 lanes; 24 u8 lanes;
29 u8 alignment;
30 u8 hs_settle; 25 u8 hs_settle;
31 bool fixed_phy_vdd;
32 int (*phy_enable)(struct platform_device *pdev, bool on);
33}; 26};
34 27
35/** 28/**
36 * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control 29 * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control
37 * @pdev: MIPI-CSIS platform device 30 * @id: MIPI-CSIS harware instance index (0...1)
38 * @on: true to enable D-PHY and deassert its reset 31 * @on: true to enable D-PHY and deassert its reset
39 * false to disable D-PHY 32 * false to disable D-PHY
33 * @return: 0 on success, or negative error code on failure
40 */ 34 */
41int s5p_csis_phy_enable(struct platform_device *pdev, bool on); 35int s5p_csis_phy_enable(int id, bool on);
42 36
43#endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */ 37#endif /* __PLAT_SAMSUNG_MIPI_CSIS_H_ */
diff --git a/include/linux/platform_data/mmp_dma.h b/include/linux/platform_data/mmp_dma.h
new file mode 100644
index 000000000000..2a330ec9e2af
--- /dev/null
+++ b/include/linux/platform_data/mmp_dma.h
@@ -0,0 +1,19 @@
1/*
2 * MMP Platform DMA Management
3 *
4 * Copyright (c) 2011 Marvell Semiconductors Inc.
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
12#ifndef MMP_DMA_H
13#define MMP_DMA_H
14
15struct mmp_dma_platdata {
16 int dma_channels;
17};
18
19#endif /* MMP_DMA_H */
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h
index 51ad0995abac..59acd987ed34 100644
--- a/include/linux/platform_data/pxa_sdhci.h
+++ b/include/linux/platform_data/pxa_sdhci.h
@@ -49,6 +49,7 @@ struct sdhci_pxa_platdata {
49 bool ext_cd_gpio_invert; 49 bool ext_cd_gpio_invert;
50 unsigned int max_speed; 50 unsigned int max_speed;
51 unsigned int host_caps; 51 unsigned int host_caps;
52 unsigned int host_caps2;
52 unsigned int quirks; 53 unsigned int quirks;
53 unsigned int pm_caps; 54 unsigned int pm_caps;
54}; 55};
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 3db698aee34c..1d24ffad59c5 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -401,6 +401,10 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
401#define arch_ptrace_stop(code, info) do { } while (0) 401#define arch_ptrace_stop(code, info) do { } while (0)
402#endif 402#endif
403 403
404#ifndef current_pt_regs
405#define current_pt_regs() task_pt_regs(current)
406#endif
407
404extern int task_current_syscall(struct task_struct *target, long *callno, 408extern int task_current_syscall(struct task_struct *target, long *callno,
405 unsigned long args[6], unsigned int maxargs, 409 unsigned long args[6], unsigned int maxargs,
406 unsigned long *sp, unsigned long *pc); 410 unsigned long *sp, unsigned long *pc);
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index 21d076c5089e..112b31436848 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -1,11 +1,13 @@
1#ifndef __LINUX_PWM_H 1#ifndef __LINUX_PWM_H
2#define __LINUX_PWM_H 2#define __LINUX_PWM_H
3 3
4#include <linux/err.h>
4#include <linux/of.h> 5#include <linux/of.h>
5 6
6struct pwm_device; 7struct pwm_device;
7struct seq_file; 8struct seq_file;
8 9
10#if IS_ENABLED(CONFIG_PWM) || IS_ENABLED(CONFIG_HAVE_PWM)
9/* 11/*
10 * pwm_request - request a PWM device 12 * pwm_request - request a PWM device
11 */ 13 */
@@ -30,10 +32,47 @@ int pwm_enable(struct pwm_device *pwm);
30 * pwm_disable - stop a PWM output toggling 32 * pwm_disable - stop a PWM output toggling
31 */ 33 */
32void pwm_disable(struct pwm_device *pwm); 34void pwm_disable(struct pwm_device *pwm);
35#else
36static inline struct pwm_device *pwm_request(int pwm_id, const char *label)
37{
38 return ERR_PTR(-ENODEV);
39}
40
41static inline void pwm_free(struct pwm_device *pwm)
42{
43}
44
45static inline int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
46{
47 return -EINVAL;
48}
49
50static inline int pwm_enable(struct pwm_device *pwm)
51{
52 return -EINVAL;
53}
54
55static inline void pwm_disable(struct pwm_device *pwm)
56{
57}
58#endif
33 59
34#ifdef CONFIG_PWM
35struct pwm_chip; 60struct pwm_chip;
36 61
62/**
63 * enum pwm_polarity - polarity of a PWM signal
64 * @PWM_POLARITY_NORMAL: a high signal for the duration of the duty-
65 * cycle, followed by a low signal for the remainder of the pulse
66 * period
67 * @PWM_POLARITY_INVERSED: a low signal for the duration of the duty-
68 * cycle, followed by a high signal for the remainder of the pulse
69 * period
70 */
71enum pwm_polarity {
72 PWM_POLARITY_NORMAL,
73 PWM_POLARITY_INVERSED,
74};
75
37enum { 76enum {
38 PWMF_REQUESTED = 1 << 0, 77 PWMF_REQUESTED = 1 << 0,
39 PWMF_ENABLED = 1 << 1, 78 PWMF_ENABLED = 1 << 1,
@@ -61,11 +100,17 @@ static inline unsigned int pwm_get_period(struct pwm_device *pwm)
61 return pwm ? pwm->period : 0; 100 return pwm ? pwm->period : 0;
62} 101}
63 102
103/*
104 * pwm_set_polarity - configure the polarity of a PWM signal
105 */
106int pwm_set_polarity(struct pwm_device *pwm, enum pwm_polarity polarity);
107
64/** 108/**
65 * struct pwm_ops - PWM controller operations 109 * struct pwm_ops - PWM controller operations
66 * @request: optional hook for requesting a PWM 110 * @request: optional hook for requesting a PWM
67 * @free: optional hook for freeing a PWM 111 * @free: optional hook for freeing a PWM
68 * @config: configure duty cycles and period length for this PWM 112 * @config: configure duty cycles and period length for this PWM
113 * @set_polarity: configure the polarity of this PWM
69 * @enable: enable PWM output toggling 114 * @enable: enable PWM output toggling
70 * @disable: disable PWM output toggling 115 * @disable: disable PWM output toggling
71 * @dbg_show: optional routine to show contents in debugfs 116 * @dbg_show: optional routine to show contents in debugfs
@@ -79,6 +124,9 @@ struct pwm_ops {
79 int (*config)(struct pwm_chip *chip, 124 int (*config)(struct pwm_chip *chip,
80 struct pwm_device *pwm, 125 struct pwm_device *pwm,
81 int duty_ns, int period_ns); 126 int duty_ns, int period_ns);
127 int (*set_polarity)(struct pwm_chip *chip,
128 struct pwm_device *pwm,
129 enum pwm_polarity polarity);
82 int (*enable)(struct pwm_chip *chip, 130 int (*enable)(struct pwm_chip *chip,
83 struct pwm_device *pwm); 131 struct pwm_device *pwm);
84 void (*disable)(struct pwm_chip *chip, 132 void (*disable)(struct pwm_chip *chip,
@@ -113,6 +161,7 @@ struct pwm_chip {
113 unsigned int of_pwm_n_cells; 161 unsigned int of_pwm_n_cells;
114}; 162};
115 163
164#if IS_ENABLED(CONFIG_PWM)
116int pwm_set_chip_data(struct pwm_device *pwm, void *data); 165int pwm_set_chip_data(struct pwm_device *pwm, void *data);
117void *pwm_get_chip_data(struct pwm_device *pwm); 166void *pwm_get_chip_data(struct pwm_device *pwm);
118 167
@@ -125,6 +174,57 @@ struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
125struct pwm_device *pwm_get(struct device *dev, const char *consumer); 174struct pwm_device *pwm_get(struct device *dev, const char *consumer);
126void pwm_put(struct pwm_device *pwm); 175void pwm_put(struct pwm_device *pwm);
127 176
177struct pwm_device *devm_pwm_get(struct device *dev, const char *consumer);
178void devm_pwm_put(struct device *dev, struct pwm_device *pwm);
179#else
180static inline int pwm_set_chip_data(struct pwm_device *pwm, void *data)
181{
182 return -EINVAL;
183}
184
185static inline void *pwm_get_chip_data(struct pwm_device *pwm)
186{
187 return NULL;
188}
189
190static inline int pwmchip_add(struct pwm_chip *chip)
191{
192 return -EINVAL;
193}
194
195static inline int pwmchip_remove(struct pwm_chip *chip)
196{
197 return -EINVAL;
198}
199
200static inline struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
201 unsigned int index,
202 const char *label)
203{
204 return ERR_PTR(-ENODEV);
205}
206
207static inline struct pwm_device *pwm_get(struct device *dev,
208 const char *consumer)
209{
210 return ERR_PTR(-ENODEV);
211}
212
213static inline void pwm_put(struct pwm_device *pwm)
214{
215}
216
217static inline struct pwm_device *devm_pwm_get(struct device *dev,
218 const char *consumer)
219{
220 return ERR_PTR(-ENODEV);
221}
222
223static inline void devm_pwm_put(struct device *dev, struct pwm_device *pwm)
224{
225}
226#endif
227
128struct pwm_lookup { 228struct pwm_lookup {
129 struct list_head list; 229 struct list_head list;
130 const char *provider; 230 const char *provider;
@@ -141,8 +241,12 @@ struct pwm_lookup {
141 .con_id = _con_id, \ 241 .con_id = _con_id, \
142 } 242 }
143 243
244#if IS_ENABLED(CONFIG_PWM)
144void pwm_add_table(struct pwm_lookup *table, size_t num); 245void pwm_add_table(struct pwm_lookup *table, size_t num);
145 246#else
247static inline void pwm_add_table(struct pwm_lookup *table, size_t num)
248{
249}
146#endif 250#endif
147 251
148#endif /* __LINUX_PWM_H */ 252#endif /* __LINUX_PWM_H */
diff --git a/include/linux/rio.h b/include/linux/rio.h
index d2dff22cf681..4187da511006 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -63,7 +63,7 @@
63 * 63 *
64 * 0 RapidIO inbound doorbells 64 * 0 RapidIO inbound doorbells
65 * 1 RapidIO inbound mailboxes 65 * 1 RapidIO inbound mailboxes
66 * 1 RapidIO outbound mailboxes 66 * 2 RapidIO outbound mailboxes
67 */ 67 */
68#define RIO_DOORBELL_RESOURCE 0 68#define RIO_DOORBELL_RESOURCE 0
69#define RIO_INB_MBOX_RESOURCE 1 69#define RIO_INB_MBOX_RESOURCE 1
@@ -266,7 +266,6 @@ struct rio_mport {
266 266
267struct rio_id_table { 267struct rio_id_table {
268 u16 start; /* logical minimal id */ 268 u16 start; /* logical minimal id */
269 u16 next; /* hint for find */
270 u32 max; /* max number of IDs in table */ 269 u32 max; /* max number of IDs in table */
271 spinlock_t lock; 270 spinlock_t lock;
272 unsigned long *table; 271 unsigned long *table;
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 7b600da9a635..4bd6c06eb28e 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -201,6 +201,7 @@ static inline void *sg_virt(struct scatterlist *sg)
201 return page_address(sg_page(sg)) + sg->offset; 201 return page_address(sg_page(sg)) + sg->offset;
202} 202}
203 203
204int sg_nents(struct scatterlist *sg);
204struct scatterlist *sg_next(struct scatterlist *); 205struct scatterlist *sg_next(struct scatterlist *);
205struct scatterlist *sg_last(struct scatterlist *s, unsigned int); 206struct scatterlist *sg_last(struct scatterlist *s, unsigned int);
206void sg_init_table(struct scatterlist *, unsigned int); 207void sg_init_table(struct scatterlist *, unsigned int);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c2070e92a9d6..a83ca5816ecb 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2332,6 +2332,9 @@ extern int do_execve(const char *,
2332 const char __user * const __user *, struct pt_regs *); 2332 const char __user * const __user *, struct pt_regs *);
2333extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); 2333extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
2334struct task_struct *fork_idle(int); 2334struct task_struct *fork_idle(int);
2335#ifdef CONFIG_GENERIC_KERNEL_THREAD
2336extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
2337#endif
2335 2338
2336extern void set_task_comm(struct task_struct *tsk, char *from); 2339extern void set_task_comm(struct task_struct *tsk, char *from);
2337extern char *get_task_comm(char *to, struct task_struct *tsk); 2340extern char *get_task_comm(char *to, struct task_struct *tsk);
diff --git a/include/linux/security.h b/include/linux/security.h
index 5b50c4e1a7c2..05e88bdcf7d9 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1411,8 +1411,8 @@ struct security_operations {
1411 int (*sb_kern_mount) (struct super_block *sb, int flags, void *data); 1411 int (*sb_kern_mount) (struct super_block *sb, int flags, void *data);
1412 int (*sb_show_options) (struct seq_file *m, struct super_block *sb); 1412 int (*sb_show_options) (struct seq_file *m, struct super_block *sb);
1413 int (*sb_statfs) (struct dentry *dentry); 1413 int (*sb_statfs) (struct dentry *dentry);
1414 int (*sb_mount) (char *dev_name, struct path *path, 1414 int (*sb_mount) (const char *dev_name, struct path *path,
1415 char *type, unsigned long flags, void *data); 1415 const char *type, unsigned long flags, void *data);
1416 int (*sb_umount) (struct vfsmount *mnt, int flags); 1416 int (*sb_umount) (struct vfsmount *mnt, int flags);
1417 int (*sb_pivotroot) (struct path *old_path, 1417 int (*sb_pivotroot) (struct path *old_path,
1418 struct path *new_path); 1418 struct path *new_path);
@@ -1694,8 +1694,8 @@ int security_sb_remount(struct super_block *sb, void *data);
1694int security_sb_kern_mount(struct super_block *sb, int flags, void *data); 1694int security_sb_kern_mount(struct super_block *sb, int flags, void *data);
1695int security_sb_show_options(struct seq_file *m, struct super_block *sb); 1695int security_sb_show_options(struct seq_file *m, struct super_block *sb);
1696int security_sb_statfs(struct dentry *dentry); 1696int security_sb_statfs(struct dentry *dentry);
1697int security_sb_mount(char *dev_name, struct path *path, 1697int security_sb_mount(const char *dev_name, struct path *path,
1698 char *type, unsigned long flags, void *data); 1698 const char *type, unsigned long flags, void *data);
1699int security_sb_umount(struct vfsmount *mnt, int flags); 1699int security_sb_umount(struct vfsmount *mnt, int flags);
1700int security_sb_pivotroot(struct path *old_path, struct path *new_path); 1700int security_sb_pivotroot(struct path *old_path, struct path *new_path);
1701int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); 1701int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts);
@@ -1964,8 +1964,8 @@ static inline int security_sb_statfs(struct dentry *dentry)
1964 return 0; 1964 return 0;
1965} 1965}
1966 1966
1967static inline int security_sb_mount(char *dev_name, struct path *path, 1967static inline int security_sb_mount(const char *dev_name, struct path *path,
1968 char *type, unsigned long flags, 1968 const char *type, unsigned long flags,
1969 void *data) 1969 void *data)
1970{ 1970{
1971 return 0; 1971 return 0;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index b33a3a1f205e..6a2c34e6d962 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -589,9 +589,6 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
589 return __alloc_skb(size, priority, SKB_ALLOC_FCLONE, NUMA_NO_NODE); 589 return __alloc_skb(size, priority, SKB_ALLOC_FCLONE, NUMA_NO_NODE);
590} 590}
591 591
592extern void skb_recycle(struct sk_buff *skb);
593extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);
594
595extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); 592extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
596extern int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); 593extern int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask);
597extern struct sk_buff *skb_clone(struct sk_buff *skb, 594extern struct sk_buff *skb_clone(struct sk_buff *skb,
@@ -2645,27 +2642,6 @@ static inline void skb_checksum_none_assert(const struct sk_buff *skb)
2645 2642
2646bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2643bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2647 2644
2648static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size)
2649{
2650 if (irqs_disabled())
2651 return false;
2652
2653 if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY)
2654 return false;
2655
2656 if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE)
2657 return false;
2658
2659 skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD);
2660 if (skb_end_offset(skb) < skb_size)
2661 return false;
2662
2663 if (skb_shared(skb) || skb_cloned(skb))
2664 return false;
2665
2666 return true;
2667}
2668
2669/** 2645/**
2670 * skb_head_is_locked - Determine if the skb->head is locked down 2646 * skb_head_is_locked - Determine if the skb->head is locked down
2671 * @skb: skb to check 2647 * @skb: skb to check
diff --git a/include/linux/sunrpc/Kbuild b/include/linux/sunrpc/Kbuild
index 98df21164a86..e69de29bb2d1 100644
--- a/include/linux/sunrpc/Kbuild
+++ b/include/linux/sunrpc/Kbuild
@@ -1 +0,0 @@
1header-y += debug.h
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 523547ecfee2..34206b84d8da 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -130,6 +130,8 @@ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
130 const struct rpc_program *, u32); 130 const struct rpc_program *, u32);
131void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt); 131void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt);
132struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); 132struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
133struct rpc_clnt *rpc_clone_client_set_auth(struct rpc_clnt *,
134 rpc_authflavor_t);
133void rpc_shutdown_client(struct rpc_clnt *); 135void rpc_shutdown_client(struct rpc_clnt *);
134void rpc_release_client(struct rpc_clnt *); 136void rpc_release_client(struct rpc_clnt *);
135void rpc_task_release_client(struct rpc_task *); 137void rpc_task_release_client(struct rpc_task *);
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index a76cc20d98ce..9385bd74c860 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -5,28 +5,11 @@
5 * 5 *
6 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> 6 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
7 */ 7 */
8
9#ifndef _LINUX_SUNRPC_DEBUG_H_ 8#ifndef _LINUX_SUNRPC_DEBUG_H_
10#define _LINUX_SUNRPC_DEBUG_H_ 9#define _LINUX_SUNRPC_DEBUG_H_
11 10
12/* 11#include <uapi/linux/sunrpc/debug.h>
13 * RPC debug facilities
14 */
15#define RPCDBG_XPRT 0x0001
16#define RPCDBG_CALL 0x0002
17#define RPCDBG_DEBUG 0x0004
18#define RPCDBG_NFS 0x0008
19#define RPCDBG_AUTH 0x0010
20#define RPCDBG_BIND 0x0020
21#define RPCDBG_SCHED 0x0040
22#define RPCDBG_TRANS 0x0080
23#define RPCDBG_SVCXPRT 0x0100
24#define RPCDBG_SVCDSP 0x0200
25#define RPCDBG_MISC 0x0400
26#define RPCDBG_CACHE 0x0800
27#define RPCDBG_ALL 0x7fff
28 12
29#ifdef __KERNEL__
30 13
31/* 14/*
32 * Enable RPC debugging/profiling. 15 * Enable RPC debugging/profiling.
@@ -87,24 +70,4 @@ void rpc_register_sysctl(void);
87void rpc_unregister_sysctl(void); 70void rpc_unregister_sysctl(void);
88#endif 71#endif
89 72
90#endif /* __KERNEL__ */
91
92/*
93 * Declarations for the sysctl debug interface, which allows to read or
94 * change the debug flags for rpc, nfs, nfsd, and lockd. Since the sunrpc
95 * module currently registers its sysctl table dynamically, the sysctl path
96 * for module FOO is <CTL_SUNRPC, CTL_FOODEBUG>.
97 */
98
99enum {
100 CTL_RPCDEBUG = 1,
101 CTL_NFSDEBUG,
102 CTL_NFSDDEBUG,
103 CTL_NLMDEBUG,
104 CTL_SLOTTABLE_UDP,
105 CTL_SLOTTABLE_TCP,
106 CTL_MIN_RESVPORT,
107 CTL_MAX_RESVPORT,
108};
109
110#endif /* _LINUX_SUNRPC_DEBUG_H_ */ 73#endif /* _LINUX_SUNRPC_DEBUG_H_ */
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index b3f64b12f141..b05963f09ebf 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -114,7 +114,6 @@ void svc_xprt_init(struct net *, struct svc_xprt_class *, struct svc_xprt *,
114int svc_create_xprt(struct svc_serv *, const char *, struct net *, 114int svc_create_xprt(struct svc_serv *, const char *, struct net *,
115 const int, const unsigned short, int); 115 const int, const unsigned short, int);
116void svc_xprt_enqueue(struct svc_xprt *xprt); 116void svc_xprt_enqueue(struct svc_xprt *xprt);
117void svc_xprt_received(struct svc_xprt *);
118void svc_xprt_put(struct svc_xprt *xprt); 117void svc_xprt_put(struct svc_xprt *xprt);
119void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt); 118void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt);
120void svc_close_xprt(struct svc_xprt *xprt); 119void svc_close_xprt(struct svc_xprt *xprt);
@@ -124,6 +123,7 @@ struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
124 struct net *net, const sa_family_t af, 123 struct net *net, const sa_family_t af,
125 const unsigned short port); 124 const unsigned short port);
126int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen); 125int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen);
126void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *xprt);
127 127
128static inline void svc_xprt_get(struct svc_xprt *xprt) 128static inline void svc_xprt_get(struct svc_xprt *xprt)
129{ 129{
@@ -166,8 +166,7 @@ static inline size_t svc_addr_len(const struct sockaddr *sa)
166 case AF_INET6: 166 case AF_INET6:
167 return sizeof(struct sockaddr_in6); 167 return sizeof(struct sockaddr_in6);
168 } 168 }
169 169 BUG();
170 return 0;
171} 170}
172 171
173static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt) 172static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt)
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index cb4ac69e1f33..92ad02f0dcc0 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -39,9 +39,6 @@ int svc_recv(struct svc_rqst *, long);
39int svc_send(struct svc_rqst *); 39int svc_send(struct svc_rqst *);
40void svc_drop(struct svc_rqst *); 40void svc_drop(struct svc_rqst *);
41void svc_sock_update_bufs(struct svc_serv *serv); 41void svc_sock_update_bufs(struct svc_serv *serv);
42int svc_sock_names(struct svc_serv *serv, char *buf,
43 const size_t buflen,
44 const char *toclose);
45int svc_addsock(struct svc_serv *serv, const int fd, 42int svc_addsock(struct svc_serv *serv, const int fd,
46 char *name_return, const size_t len); 43 char *name_return, const size_t len);
47void svc_init_xprt_sock(void); 44void svc_init_xprt_sock(void);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index bf8c49ff7530..951cb9b7d02b 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -173,8 +173,7 @@ struct rpc_xprt {
173 unsigned int min_reqs; /* min number of slots */ 173 unsigned int min_reqs; /* min number of slots */
174 atomic_t num_reqs; /* total slots */ 174 atomic_t num_reqs; /* total slots */
175 unsigned long state; /* transport state */ 175 unsigned long state; /* transport state */
176 unsigned char shutdown : 1, /* being shut down */ 176 unsigned char resvport : 1; /* use a reserved port */
177 resvport : 1; /* use a reserved port */
178 unsigned int swapper; /* we're swapping over this 177 unsigned int swapper; /* we're swapping over this
179 transport */ 178 transport */
180 unsigned int bind_index; /* bind function index */ 179 unsigned int bind_index; /* bind function index */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 19439c75c5b2..727f0cd73921 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -827,7 +827,15 @@ asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags,
827 const char __user *pathname); 827 const char __user *pathname);
828asmlinkage long sys_syncfs(int fd); 828asmlinkage long sys_syncfs(int fd);
829 829
830#ifndef CONFIG_GENERIC_KERNEL_EXECVE
830int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]); 831int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]);
832#else
833#define kernel_execve(filename, argv, envp) \
834 do_execve(filename, \
835 (const char __user *const __user *)argv, \
836 (const char __user *const __user *)envp, \
837 current_pt_regs())
838#endif
831 839
832 840
833asmlinkage long sys_perf_event_open( 841asmlinkage long sys_perf_event_open(
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild
index 67b501c302b2..e69de29bb2d1 100644
--- a/include/linux/tc_act/Kbuild
+++ b/include/linux/tc_act/Kbuild
@@ -1,7 +0,0 @@
1header-y += tc_gact.h
2header-y += tc_ipt.h
3header-y += tc_mirred.h
4header-y += tc_pedit.h
5header-y += tc_nat.h
6header-y += tc_skbedit.h
7header-y += tc_csum.h
diff --git a/include/linux/tc_ematch/Kbuild b/include/linux/tc_ematch/Kbuild
index 4a58a1c32a00..e69de29bb2d1 100644
--- a/include/linux/tc_ematch/Kbuild
+++ b/include/linux/tc_ematch/Kbuild
@@ -1,4 +0,0 @@
1header-y += tc_em_cmp.h
2header-y += tc_em_meta.h
3header-y += tc_em_nbyte.h
4header-y += tc_em_text.h
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h
new file mode 100644
index 000000000000..e1d558e237ec
--- /dev/null
+++ b/include/linux/timekeeper_internal.h
@@ -0,0 +1,108 @@
1/*
2 * You SHOULD NOT be including this unless you're vsyscall
3 * handling code or timekeeping internal code!
4 */
5
6#ifndef _LINUX_TIMEKEEPER_INTERNAL_H
7#define _LINUX_TIMEKEEPER_INTERNAL_H
8
9#include <linux/clocksource.h>
10#include <linux/jiffies.h>
11#include <linux/time.h>
12
13/* Structure holding internal timekeeping values. */
14struct timekeeper {
15 /* Current clocksource used for timekeeping. */
16 struct clocksource *clock;
17 /* NTP adjusted clock multiplier */
18 u32 mult;
19 /* The shift value of the current clocksource. */
20 u32 shift;
21 /* Number of clock cycles in one NTP interval. */
22 cycle_t cycle_interval;
23 /* Number of clock shifted nano seconds in one NTP interval. */
24 u64 xtime_interval;
25 /* shifted nano seconds left over when rounding cycle_interval */
26 s64 xtime_remainder;
27 /* Raw nano seconds accumulated per NTP interval. */
28 u32 raw_interval;
29
30 /* Current CLOCK_REALTIME time in seconds */
31 u64 xtime_sec;
32 /* Clock shifted nano seconds */
33 u64 xtime_nsec;
34
35 /* Difference between accumulated time and NTP time in ntp
36 * shifted nano seconds. */
37 s64 ntp_error;
38 /* Shift conversion between clock shifted nano seconds and
39 * ntp shifted nano seconds. */
40 u32 ntp_error_shift;
41
42 /*
43 * wall_to_monotonic is what we need to add to xtime (or xtime corrected
44 * for sub jiffie times) to get to monotonic time. Monotonic is pegged
45 * at zero at system boot time, so wall_to_monotonic will be negative,
46 * however, we will ALWAYS keep the tv_nsec part positive so we can use
47 * the usual normalization.
48 *
49 * wall_to_monotonic is moved after resume from suspend for the
50 * monotonic time not to jump. We need to add total_sleep_time to
51 * wall_to_monotonic to get the real boot based time offset.
52 *
53 * - wall_to_monotonic is no longer the boot time, getboottime must be
54 * used instead.
55 */
56 struct timespec wall_to_monotonic;
57 /* Offset clock monotonic -> clock realtime */
58 ktime_t offs_real;
59 /* time spent in suspend */
60 struct timespec total_sleep_time;
61 /* Offset clock monotonic -> clock boottime */
62 ktime_t offs_boot;
63 /* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */
64 struct timespec raw_time;
65 /* Seqlock for all timekeeper values */
66 seqlock_t lock;
67};
68
69static inline struct timespec tk_xtime(struct timekeeper *tk)
70{
71 struct timespec ts;
72
73 ts.tv_sec = tk->xtime_sec;
74 ts.tv_nsec = (long)(tk->xtime_nsec >> tk->shift);
75 return ts;
76}
77
78
79#ifdef CONFIG_GENERIC_TIME_VSYSCALL
80
81extern void update_vsyscall(struct timekeeper *tk);
82extern void update_vsyscall_tz(void);
83
84#elif defined(CONFIG_GENERIC_TIME_VSYSCALL_OLD)
85
86extern void update_vsyscall_old(struct timespec *ts, struct timespec *wtm,
87 struct clocksource *c, u32 mult);
88extern void update_vsyscall_tz(void);
89
90static inline void update_vsyscall(struct timekeeper *tk)
91{
92 struct timespec xt;
93
94 xt = tk_xtime(tk);
95 update_vsyscall_old(&xt, &tk->wall_to_monotonic, tk->clock, tk->mult);
96}
97
98#else
99
100static inline void update_vsyscall(struct timekeeper *tk)
101{
102}
103static inline void update_vsyscall_tz(void)
104{
105}
106#endif
107
108#endif /* _LINUX_TIMEKEEPER_INTERNAL_H */
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index f87cf622317f..ddbbb7de894b 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -68,6 +68,7 @@ struct usbnet {
68# define EVENT_RX_PAUSED 5 68# define EVENT_RX_PAUSED 5
69# define EVENT_DEV_ASLEEP 6 69# define EVENT_DEV_ASLEEP 6
70# define EVENT_DEV_OPEN 7 70# define EVENT_DEV_OPEN 7
71# define EVENT_DEVICE_REPORT_IDLE 8
71}; 72};
72 73
73static inline struct usb_driver *driver_of(struct usb_interface *intf) 74static inline struct usb_driver *driver_of(struct usb_interface *intf)
@@ -160,6 +161,7 @@ extern int usbnet_probe(struct usb_interface *, const struct usb_device_id *);
160extern int usbnet_suspend(struct usb_interface *, pm_message_t); 161extern int usbnet_suspend(struct usb_interface *, pm_message_t);
161extern int usbnet_resume(struct usb_interface *); 162extern int usbnet_resume(struct usb_interface *);
162extern void usbnet_disconnect(struct usb_interface *); 163extern void usbnet_disconnect(struct usb_interface *);
164extern void usbnet_device_suggests_idle(struct usbnet *dev);
163 165
164 166
165/* Drivers that reuse some of the standard USB CDC infrastructure 167/* Drivers that reuse some of the standard USB CDC infrastructure
diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h
index 421d24c7f686..f56c945cecd4 100644
--- a/include/linux/v4l2-controls.h
+++ b/include/linux/v4l2-controls.h
@@ -349,6 +349,7 @@ enum v4l2_mpeg_video_multi_slice_mode {
349#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222) 349#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
350#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223) 350#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
351#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224) 351#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
352#define V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225)
352 353
353#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300) 354#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
354#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301) 355#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
@@ -439,6 +440,46 @@ enum v4l2_mpeg_video_h264_vui_sar_idc {
439 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16, 440 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
440 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17, 441 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
441}; 442};
443#define V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_MPEG_BASE+368)
444#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_MPEG_BASE+369)
445#define V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_MPEG_BASE+370)
446enum v4l2_mpeg_video_h264_sei_fp_arrangement_type {
447 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHECKERBOARD = 0,
448 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_COLUMN = 1,
449 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_ROW = 2,
450 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_SIDE_BY_SIDE = 3,
451 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TOP_BOTTOM = 4,
452 V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_TEMPORAL = 5,
453};
454#define V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_MPEG_BASE+371)
455#define V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_MPEG_BASE+372)
456enum v4l2_mpeg_video_h264_fmo_map_type {
457 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES = 0,
458 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_SCATTERED_SLICES = 1,
459 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_FOREGROUND_WITH_LEFT_OVER = 2,
460 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_BOX_OUT = 3,
461 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_RASTER_SCAN = 4,
462 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_WIPE_SCAN = 5,
463 V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_EXPLICIT = 6,
464};
465#define V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_MPEG_BASE+373)
466#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_MPEG_BASE+374)
467enum v4l2_mpeg_video_h264_fmo_change_dir {
468 V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_RIGHT = 0,
469 V4L2_MPEG_VIDEO_H264_FMO_CHANGE_DIR_LEFT = 1,
470};
471#define V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_MPEG_BASE+375)
472#define V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_MPEG_BASE+376)
473#define V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_MPEG_BASE+377)
474#define V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_MPEG_BASE+378)
475#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_MPEG_BASE+379)
476#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_MPEG_BASE+380)
477enum v4l2_mpeg_video_h264_hierarchical_coding_type {
478 V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_B = 0,
479 V4L2_MPEG_VIDEO_H264_HIERARCHICAL_CODING_P = 1,
480};
481#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381)
482#define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382)
442#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400) 483#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
443#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401) 484#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
444#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402) 485#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
@@ -757,5 +798,6 @@ enum v4l2_jpeg_chroma_subsampling {
757 798
758#define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1) 799#define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
759#define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2) 800#define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
801#define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
760 802
761#endif 803#endif
diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h
index 5ea7f753a348..7d64e0e1a18b 100644
--- a/include/linux/v4l2-mediabus.h
+++ b/include/linux/v4l2-mediabus.h
@@ -92,6 +92,11 @@ enum v4l2_mbus_pixelcode {
92 92
93 /* JPEG compressed formats - next is 0x4002 */ 93 /* JPEG compressed formats - next is 0x4002 */
94 V4L2_MBUS_FMT_JPEG_1X8 = 0x4001, 94 V4L2_MBUS_FMT_JPEG_1X8 = 0x4001,
95
96 /* Vendor specific formats - next is 0x5002 */
97
98 /* S5C73M3 sensor specific interleaved UYVY and JPEG */
99 V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 = 0x5001,
95}; 100};
96 101
97/** 102/**
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 61395ef85a00..873adbe82988 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -366,7 +366,9 @@ struct v4l2_pix_format {
366 366
367/* two non contiguous planes - one Y, one Cr + Cb interleaved */ 367/* two non contiguous planes - one Y, one Cr + Cb interleaved */
368#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ 368#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
369#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
369#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */ 370#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
371#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
370 372
371/* three non contiguous planes - Y, Cb, Cr */ 373/* three non contiguous planes - Y, Cb, Cr */
372#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */ 374#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
@@ -403,6 +405,7 @@ struct v4l2_pix_format {
403#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */ 405#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
404#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */ 406#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
405#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */ 407#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
408#define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
406#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */ 409#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
407#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */ 410#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
408#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */ 411#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
@@ -410,6 +413,7 @@ struct v4l2_pix_format {
410#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */ 413#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
411#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */ 414#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
412#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */ 415#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
416#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
413 417
414/* Vendor-specific formats */ 418/* Vendor-specific formats */
415#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ 419#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
@@ -437,6 +441,7 @@ struct v4l2_pix_format {
437#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ 441#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
438#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ 442#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
439#define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */ 443#define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
444#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
440 445
441/* 446/*
442 * F O R M A T E N U M E R A T I O N 447 * F O R M A T E N U M E R A T I O N
diff --git a/include/linux/virtio_scsi.h b/include/linux/virtio_scsi.h
index dc8d305b0e05..d6b4440387b7 100644
--- a/include/linux/virtio_scsi.h
+++ b/include/linux/virtio_scsi.h
@@ -72,6 +72,7 @@ struct virtio_scsi_config {
72/* Feature Bits */ 72/* Feature Bits */
73#define VIRTIO_SCSI_F_INOUT 0 73#define VIRTIO_SCSI_F_INOUT 0
74#define VIRTIO_SCSI_F_HOTPLUG 1 74#define VIRTIO_SCSI_F_HOTPLUG 1
75#define VIRTIO_SCSI_F_CHANGE 2
75 76
76/* Response codes */ 77/* Response codes */
77#define VIRTIO_SCSI_S_OK 0 78#define VIRTIO_SCSI_S_OK 0
@@ -108,6 +109,7 @@ struct virtio_scsi_config {
108#define VIRTIO_SCSI_T_NO_EVENT 0 109#define VIRTIO_SCSI_T_NO_EVENT 0
109#define VIRTIO_SCSI_T_TRANSPORT_RESET 1 110#define VIRTIO_SCSI_T_TRANSPORT_RESET 1
110#define VIRTIO_SCSI_T_ASYNC_NOTIFY 2 111#define VIRTIO_SCSI_T_ASYNC_NOTIFY 2
112#define VIRTIO_SCSI_T_PARAM_CHANGE 3
111 113
112/* Reasons of transport reset event */ 114/* Reasons of transport reset event */
113#define VIRTIO_SCSI_EVT_RESET_HARD 0 115#define VIRTIO_SCSI_EVT_RESET_HARD 0
diff --git a/include/linux/wimax/Kbuild b/include/linux/wimax/Kbuild
index 3cb4f269bb09..e69de29bb2d1 100644
--- a/include/linux/wimax/Kbuild
+++ b/include/linux/wimax/Kbuild
@@ -1 +0,0 @@
1header-y += i2400m.h
diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h
index 8bc1b3c0e679..a7ca4884c46c 100644
--- a/include/media/davinci/vpbe.h
+++ b/include/media/davinci/vpbe.h
@@ -35,7 +35,7 @@ struct osd_config_info {
35struct vpbe_output { 35struct vpbe_output {
36 struct v4l2_output output; 36 struct v4l2_output output;
37 /* 37 /*
38 * If output capabilities include dv_preset, list supported presets 38 * If output capabilities include dv_timings, list supported timings
39 * below 39 * below
40 */ 40 */
41 char *subdev_name; 41 char *subdev_name;
@@ -120,16 +120,16 @@ struct vpbe_device_ops {
120 unsigned int (*get_output)(struct vpbe_device *vpbe_dev); 120 unsigned int (*get_output)(struct vpbe_device *vpbe_dev);
121 121
122 /* Set DV preset at current output */ 122 /* Set DV preset at current output */
123 int (*s_dv_preset)(struct vpbe_device *vpbe_dev, 123 int (*s_dv_timings)(struct vpbe_device *vpbe_dev,
124 struct v4l2_dv_preset *dv_preset); 124 struct v4l2_dv_timings *dv_timings);
125 125
126 /* Get DV presets supported at the output */ 126 /* Get DV presets supported at the output */
127 int (*g_dv_preset)(struct vpbe_device *vpbe_dev, 127 int (*g_dv_timings)(struct vpbe_device *vpbe_dev,
128 struct v4l2_dv_preset *dv_preset); 128 struct v4l2_dv_timings *dv_timings);
129 129
130 /* Enumerate the DV Presets supported at the output */ 130 /* Enumerate the DV Presets supported at the output */
131 int (*enum_dv_presets)(struct vpbe_device *vpbe_dev, 131 int (*enum_dv_timings)(struct vpbe_device *vpbe_dev,
132 struct v4l2_dv_enum_preset *preset_info); 132 struct v4l2_enum_dv_timings *timings_info);
133 133
134 /* Set std at the output */ 134 /* Set std at the output */
135 int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id); 135 int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
diff --git a/include/media/davinci/vpbe_types.h b/include/media/davinci/vpbe_types.h
index 727f55170e41..9b85396514be 100644
--- a/include/media/davinci/vpbe_types.h
+++ b/include/media/davinci/vpbe_types.h
@@ -32,11 +32,6 @@ enum vpbe_enc_timings_type {
32 VPBE_ENC_TIMINGS_INVALID = 0x8, 32 VPBE_ENC_TIMINGS_INVALID = 0x8,
33}; 33};
34 34
35union vpbe_timings {
36 v4l2_std_id std_id;
37 unsigned int dv_preset;
38};
39
40/* 35/*
41 * struct vpbe_enc_mode_info 36 * struct vpbe_enc_mode_info
42 * @name: ptr to name string of the standard, "NTSC", "PAL" etc 37 * @name: ptr to name string of the standard, "NTSC", "PAL" etc
@@ -73,7 +68,8 @@ union vpbe_timings {
73struct vpbe_enc_mode_info { 68struct vpbe_enc_mode_info {
74 unsigned char *name; 69 unsigned char *name;
75 enum vpbe_enc_timings_type timings_type; 70 enum vpbe_enc_timings_type timings_type;
76 union vpbe_timings timings; 71 v4l2_std_id std_id;
72 struct v4l2_dv_timings dv_timings;
77 unsigned int interlaced; 73 unsigned int interlaced;
78 unsigned int xres; 74 unsigned int xres;
79 unsigned int yres; 75 unsigned int yres;
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h
index 6b57334f4029..cc78c2eb16da 100644
--- a/include/media/davinci/vpbe_venc.h
+++ b/include/media/davinci/vpbe_venc.h
@@ -32,7 +32,7 @@ struct venc_platform_data {
32 int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type, 32 int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type,
33 int field); 33 int field);
34 int (*setup_clock)(enum vpbe_enc_timings_type type, 34 int (*setup_clock)(enum vpbe_enc_timings_type type,
35 unsigned int mode); 35 unsigned int pixclock);
36 int (*setup_if_config)(enum v4l2_mbus_pixelcode pixcode); 36 int (*setup_if_config)(enum v4l2_mbus_pixelcode pixcode);
37 /* Number of LCD outputs supported */ 37 /* Number of LCD outputs supported */
38 int num_lcd_outputs; 38 int num_lcd_outputs;
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h
index d8f6ab1943e4..3882e0675ccf 100644
--- a/include/media/davinci/vpif_types.h
+++ b/include/media/davinci/vpif_types.h
@@ -20,6 +20,7 @@
20#include <linux/i2c.h> 20#include <linux/i2c.h>
21 21
22#define VPIF_CAPTURE_MAX_CHANNELS 2 22#define VPIF_CAPTURE_MAX_CHANNELS 2
23#define VPIF_DISPLAY_MAX_CHANNELS 2
23 24
24enum vpif_if_type { 25enum vpif_if_type {
25 VPIF_IF_BT656, 26 VPIF_IF_BT656,
@@ -37,29 +38,38 @@ struct vpif_interface {
37struct vpif_subdev_info { 38struct vpif_subdev_info {
38 const char *name; 39 const char *name;
39 struct i2c_board_info board_info; 40 struct i2c_board_info board_info;
40 u32 input; 41};
41 u32 output; 42
42 unsigned can_route:1; 43struct vpif_output {
43 struct vpif_interface vpif_if; 44 struct v4l2_output output;
45 const char *subdev_name;
46 u32 input_route;
47 u32 output_route;
48};
49
50struct vpif_display_chan_config {
51 const struct vpif_output *outputs;
52 int output_count;
53 bool clip_en;
44}; 54};
45 55
46struct vpif_display_config { 56struct vpif_display_config {
47 int (*set_clock)(int, int); 57 int (*set_clock)(int, int);
48 struct vpif_subdev_info *subdevinfo; 58 struct vpif_subdev_info *subdevinfo;
49 int subdev_count; 59 int subdev_count;
50 const char **output; 60 struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS];
51 int output_count;
52 const char *card_name; 61 const char *card_name;
53 bool ch2_clip_en;
54 bool ch3_clip_en;
55}; 62};
56 63
57struct vpif_input { 64struct vpif_input {
58 struct v4l2_input input; 65 struct v4l2_input input;
59 const char *subdev_name; 66 const char *subdev_name;
67 u32 input_route;
68 u32 output_route;
60}; 69};
61 70
62struct vpif_capture_chan_config { 71struct vpif_capture_chan_config {
72 struct vpif_interface vpif_if;
63 const struct vpif_input *inputs; 73 const struct vpif_input *inputs;
64 int input_count; 74 int input_count;
65}; 75};
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h
index 09421a611d73..eaea62a382f8 100644
--- a/include/media/s5p_fimc.h
+++ b/include/media/s5p_fimc.h
@@ -30,7 +30,6 @@ struct i2c_board_info;
30 * @board_info: pointer to I2C subdevice's board info 30 * @board_info: pointer to I2C subdevice's board info
31 * @clk_frequency: frequency of the clock the host interface provides to sensor 31 * @clk_frequency: frequency of the clock the host interface provides to sensor
32 * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc. 32 * @bus_type: determines bus type, MIPI, ITU-R BT.601 etc.
33 * @csi_data_align: MIPI-CSI interface data alignment in bits
34 * @i2c_bus_num: i2c control bus id the sensor is attached to 33 * @i2c_bus_num: i2c control bus id the sensor is attached to
35 * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) 34 * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
36 * @clk_id: index of the SoC peripheral clock for sensors 35 * @clk_id: index of the SoC peripheral clock for sensors
@@ -40,7 +39,6 @@ struct s5p_fimc_isp_info {
40 struct i2c_board_info *board_info; 39 struct i2c_board_info *board_info;
41 unsigned long clk_frequency; 40 unsigned long clk_frequency;
42 enum cam_bus_type bus_type; 41 enum cam_bus_type bus_type;
43 u16 csi_data_align;
44 u16 i2c_bus_num; 42 u16 i2c_bus_num;
45 u16 mux_id; 43 u16 mux_id;
46 u16 flags; 44 u16 flags;
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 801adb466bd2..96509119f28f 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -351,6 +351,29 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
351 const struct v4l2_ctrl_ops *ops, 351 const struct v4l2_ctrl_ops *ops,
352 u32 id, s32 max, s32 mask, s32 def); 352 u32 id, s32 max, s32 mask, s32 def);
353 353
354/** v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control
355 * with driver specific menu.
356 * @hdl: The control handler.
357 * @ops: The control ops.
358 * @id: The control ID.
359 * @max: The control's maximum value.
360 * @mask: The control's skip mask for menu controls. This makes it
361 * easy to skip menu items that are not valid. If bit X is set,
362 * then menu item X is skipped. Of course, this only works for
363 * menus with <= 32 menu items. There are no menus that come
364 * close to that number, so this is OK. Should we ever need more,
365 * then this will have to be extended to a u64 or a bit array.
366 * @def: The control's default value.
367 * @qmenu: The new menu.
368 *
369 * Same as v4l2_ctrl_new_std_menu(), but @qmenu will be the driver specific
370 * menu of this control.
371 *
372 */
373struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl,
374 const struct v4l2_ctrl_ops *ops, u32 id, s32 max,
375 s32 mask, s32 def, const char * const *qmenu);
376
354/** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control. 377/** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control.
355 * @hdl: The control handler. 378 * @hdl: The control handler.
356 * @ops: The control ops. 379 * @ops: The control ops.
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 2ecd7377153b..b137a5e1151a 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -21,6 +21,7 @@
21#ifndef _V4L2_SUBDEV_H 21#ifndef _V4L2_SUBDEV_H
22#define _V4L2_SUBDEV_H 22#define _V4L2_SUBDEV_H
23 23
24#include <linux/types.h>
24#include <linux/v4l2-subdev.h> 25#include <linux/v4l2-subdev.h>
25#include <media/media-entity.h> 26#include <media/media-entity.h>
26#include <media/v4l2-common.h> 27#include <media/v4l2-common.h>
@@ -45,6 +46,7 @@ struct v4l2_fh;
45struct v4l2_subdev; 46struct v4l2_subdev;
46struct v4l2_subdev_fh; 47struct v4l2_subdev_fh;
47struct tuner_setup; 48struct tuner_setup;
49struct v4l2_mbus_frame_desc;
48 50
49/* decode_vbi_line */ 51/* decode_vbi_line */
50struct v4l2_decode_vbi_line { 52struct v4l2_decode_vbi_line {
@@ -226,6 +228,36 @@ struct v4l2_subdev_audio_ops {
226 int (*s_stream)(struct v4l2_subdev *sd, int enable); 228 int (*s_stream)(struct v4l2_subdev *sd, int enable);
227}; 229};
228 230
231/* Indicates the @length field specifies maximum data length. */
232#define V4L2_MBUS_FRAME_DESC_FL_LEN_MAX (1U << 0)
233/* Indicates user defined data format, i.e. non standard frame format. */
234#define V4L2_MBUS_FRAME_DESC_FL_BLOB (1U << 1)
235
236/**
237 * struct v4l2_mbus_frame_desc_entry - media bus frame description structure
238 * @flags: V4L2_MBUS_FRAME_DESC_FL_* flags
239 * @pixelcode: media bus pixel code, valid if FRAME_DESC_FL_BLOB is not set
240 * @length: number of octets per frame, valid for compressed or unspecified
241 * formats
242 */
243struct v4l2_mbus_frame_desc_entry {
244 u16 flags;
245 u32 pixelcode;
246 u32 length;
247};
248
249#define V4L2_FRAME_DESC_ENTRY_MAX 4
250
251/**
252 * struct v4l2_mbus_frame_desc - media bus data frame description
253 * @entry: frame descriptors array
254 * @num_entries: number of entries in @entry array
255 */
256struct v4l2_mbus_frame_desc {
257 struct v4l2_mbus_frame_desc_entry entry[V4L2_FRAME_DESC_ENTRY_MAX];
258 unsigned short num_entries;
259};
260
229/* 261/*
230 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by 262 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by
231 video input devices. 263 video input devices.
@@ -274,6 +306,10 @@ struct v4l2_subdev_audio_ops {
274 s_mbus_config: set a certain mediabus configuration. This operation is added 306 s_mbus_config: set a certain mediabus configuration. This operation is added
275 for compatibility with soc-camera drivers and should not be used by new 307 for compatibility with soc-camera drivers and should not be used by new
276 software. 308 software.
309
310 s_rx_buffer: set a host allocated memory buffer for the subdev. The subdev
311 can adjust @size to a lower value and must not write more data to the
312 buffer starting at @data than the original value of @size.
277 */ 313 */
278struct v4l2_subdev_video_ops { 314struct v4l2_subdev_video_ops {
279 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 315 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
@@ -327,6 +363,8 @@ struct v4l2_subdev_video_ops {
327 struct v4l2_mbus_config *cfg); 363 struct v4l2_mbus_config *cfg);
328 int (*s_mbus_config)(struct v4l2_subdev *sd, 364 int (*s_mbus_config)(struct v4l2_subdev *sd,
329 const struct v4l2_mbus_config *cfg); 365 const struct v4l2_mbus_config *cfg);
366 int (*s_rx_buffer)(struct v4l2_subdev *sd, void *buf,
367 unsigned int *size);
330}; 368};
331 369
332/* 370/*
@@ -455,6 +493,12 @@ struct v4l2_subdev_ir_ops {
455 struct v4l2_subdev_ir_parameters *params); 493 struct v4l2_subdev_ir_parameters *params);
456}; 494};
457 495
496/**
497 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations
498 * @get_frame_desc: get the current low level media bus frame parameters.
499 * @get_frame_desc: set the low level media bus frame parameters, @fd array
500 * may be adjusted by the subdev driver to device capabilities.
501 */
458struct v4l2_subdev_pad_ops { 502struct v4l2_subdev_pad_ops {
459 int (*enum_mbus_code)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, 503 int (*enum_mbus_code)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
460 struct v4l2_subdev_mbus_code_enum *code); 504 struct v4l2_subdev_mbus_code_enum *code);
@@ -483,6 +527,10 @@ struct v4l2_subdev_pad_ops {
483 struct v4l2_subdev_format *source_fmt, 527 struct v4l2_subdev_format *source_fmt,
484 struct v4l2_subdev_format *sink_fmt); 528 struct v4l2_subdev_format *sink_fmt);
485#endif /* CONFIG_MEDIA_CONTROLLER */ 529#endif /* CONFIG_MEDIA_CONTROLLER */
530 int (*get_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
531 struct v4l2_mbus_frame_desc *fd);
532 int (*set_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
533 struct v4l2_mbus_frame_desc *fd);
486}; 534};
487 535
488struct v4l2_subdev_ops { 536struct v4l2_subdev_ops {
diff --git a/include/mtd/Kbuild b/include/mtd/Kbuild
index 192f8fb7d546..e69de29bb2d1 100644
--- a/include/mtd/Kbuild
+++ b/include/mtd/Kbuild
@@ -1,5 +0,0 @@
1header-y += inftl-user.h
2header-y += mtd-abi.h
3header-y += mtd-user.h
4header-y += nftl-user.h
5header-y += ubi-user.h
diff --git a/include/net/flow.h b/include/net/flow.h
index e1dd5082ec7e..628e11b98c58 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -21,6 +21,7 @@ struct flowi_common {
21 __u8 flowic_flags; 21 __u8 flowic_flags;
22#define FLOWI_FLAG_ANYSRC 0x01 22#define FLOWI_FLAG_ANYSRC 0x01
23#define FLOWI_FLAG_CAN_SLEEP 0x02 23#define FLOWI_FLAG_CAN_SLEEP 0x02
24#define FLOWI_FLAG_KNOWN_NH 0x04
24 __u32 flowic_secid; 25 __u32 flowic_secid;
25}; 26};
26 27
diff --git a/include/net/route.h b/include/net/route.h
index da22243d2760..bc40b633a5c4 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -48,7 +48,8 @@ struct rtable {
48 int rt_genid; 48 int rt_genid;
49 unsigned int rt_flags; 49 unsigned int rt_flags;
50 __u16 rt_type; 50 __u16 rt_type;
51 __u16 rt_is_input; 51 __u8 rt_is_input;
52 __u8 rt_uses_gateway;
52 53
53 int rt_iif; 54 int rt_iif;
54 55
diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h
index 3c5363ab867b..bd3d8b24b420 100644
--- a/include/rdma/rdma_netlink.h
+++ b/include/rdma/rdma_netlink.h
@@ -39,6 +39,7 @@ struct rdma_cm_id_stats {
39 39
40struct ibnl_client_cbs { 40struct ibnl_client_cbs {
41 int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb); 41 int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb);
42 struct module *module;
42}; 43};
43 44
44int ibnl_init(void); 45int ibnl_init(void);
diff --git a/include/scsi/fc/fc_fcp.h b/include/scsi/fc/fc_fcp.h
index 0d7d67e96d43..9c8702942b61 100644
--- a/include/scsi/fc/fc_fcp.h
+++ b/include/scsi/fc/fc_fcp.h
@@ -127,6 +127,9 @@ struct fcp_txrdy {
127 * 127 *
128 * All response frames will always contain the fcp_resp template. Some 128 * All response frames will always contain the fcp_resp template. Some
129 * will also include the fcp_resp_len template. 129 * will also include the fcp_resp_len template.
130 *
131 * From Table 23, the FCP_RSP_INFO can either be 4 bytes or 8 bytes, both
132 * are valid length.
130 */ 133 */
131struct fcp_resp { 134struct fcp_resp {
132 __u8 _fr_resvd[8]; /* reserved */ 135 __u8 _fr_resvd[8]; /* reserved */
@@ -156,6 +159,9 @@ struct fcp_resp_rsp_info {
156 __u8 _fr_resvd2[4]; /* reserved */ 159 __u8 _fr_resvd2[4]; /* reserved */
157}; 160};
158 161
162#define FCP_RESP_RSP_INFO_LEN4 4 /* without reserved field */
163#define FCP_RESP_RSP_INFO_LEN8 8 /* with reserved field */
164
159struct fcp_resp_with_ext { 165struct fcp_resp_with_ext {
160 struct fcp_resp resp; 166 struct fcp_resp resp;
161 struct fcp_resp_ext ext; 167 struct fcp_resp_ext ext;
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 22b07cc99808..8742d853a3b8 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -327,7 +327,6 @@ struct fcoe_percpu_s {
327 * @lport: The associated local port 327 * @lport: The associated local port
328 * @fcoe_pending_queue: The pending Rx queue of skbs 328 * @fcoe_pending_queue: The pending Rx queue of skbs
329 * @fcoe_pending_queue_active: Indicates if the pending queue is active 329 * @fcoe_pending_queue_active: Indicates if the pending queue is active
330 * @priority: Packet priority (DCB)
331 * @max_queue_depth: Max queue depth of pending queue 330 * @max_queue_depth: Max queue depth of pending queue
332 * @min_queue_depth: Min queue depth of pending queue 331 * @min_queue_depth: Min queue depth of pending queue
333 * @timer: The queue timer 332 * @timer: The queue timer
@@ -343,7 +342,6 @@ struct fcoe_port {
343 struct fc_lport *lport; 342 struct fc_lport *lport;
344 struct sk_buff_head fcoe_pending_queue; 343 struct sk_buff_head fcoe_pending_queue;
345 u8 fcoe_pending_queue_active; 344 u8 fcoe_pending_queue_active;
346 u8 priority;
347 u32 max_queue_depth; 345 u32 max_queue_depth;
348 u32 min_queue_depth; 346 u32 min_queue_depth;
349 struct timer_list timer; 347 struct timer_list timer;
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index ac06cc595890..de5f5d8f1f8a 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -132,18 +132,10 @@ struct scsi_cmnd {
132 unsigned char tag; /* SCSI-II queued command tag */ 132 unsigned char tag; /* SCSI-II queued command tag */
133}; 133};
134 134
135/* make sure not to use it with REQ_TYPE_BLOCK_PC commands */
135static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) 136static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
136{ 137{
137 struct scsi_driver **sdp; 138 return *(struct scsi_driver **)cmd->request->rq_disk->private_data;
138
139 if (!cmd->request->rq_disk)
140 return NULL;
141
142 sdp = (struct scsi_driver **)cmd->request->rq_disk->private_data;
143 if (!sdp)
144 return NULL;
145
146 return *sdp;
147} 139}
148 140
149extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); 141extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 941c84bf1065..2acd54018b64 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -13,9 +13,6 @@ struct se_subsystem_api {
13 13
14 u8 transport_type; 14 u8 transport_type;
15 15
16 unsigned int fua_write_emulated : 1;
17 unsigned int write_cache_emulated : 1;
18
19 int (*attach_hba)(struct se_hba *, u32); 16 int (*attach_hba)(struct se_hba *, u32);
20 void (*detach_hba)(struct se_hba *); 17 void (*detach_hba)(struct se_hba *);
21 int (*pmode_enable_hba)(struct se_hba *, unsigned long); 18 int (*pmode_enable_hba)(struct se_hba *, unsigned long);
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 69fb3cfd02d7..81ddb4ae6c3f 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -62,8 +62,6 @@ struct target_core_fabric_ops {
62 int (*queue_data_in)(struct se_cmd *); 62 int (*queue_data_in)(struct se_cmd *);
63 int (*queue_status)(struct se_cmd *); 63 int (*queue_status)(struct se_cmd *);
64 int (*queue_tm_rsp)(struct se_cmd *); 64 int (*queue_tm_rsp)(struct se_cmd *);
65 u16 (*set_fabric_sense_len)(struct se_cmd *, u32);
66 u16 (*get_fabric_sense_len)(void);
67 /* 65 /*
68 * fabric module calls for target_core_fabric_configfs.c 66 * fabric module calls for target_core_fabric_configfs.c
69 */ 67 */
@@ -102,6 +100,9 @@ void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *,
102 struct se_session *, u32, int, int, unsigned char *); 100 struct se_session *, u32, int, int, unsigned char *);
103int transport_lookup_cmd_lun(struct se_cmd *, u32); 101int transport_lookup_cmd_lun(struct se_cmd *, u32);
104int target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *); 102int target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *);
103int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *,
104 unsigned char *, unsigned char *, u32, u32, int, int, int,
105 struct scatterlist *, u32, struct scatterlist *, u32);
105int target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *, 106int target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *,
106 unsigned char *, u32, u32, int, int, int); 107 unsigned char *, u32, u32, int, int, int);
107int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, 108int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 91b91e805673..54fab041b22a 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -445,6 +445,7 @@ TRACE_EVENT(btrfs_delayed_tree_ref,
445 __field( u64, ref_root ) 445 __field( u64, ref_root )
446 __field( int, level ) 446 __field( int, level )
447 __field( int, type ) 447 __field( int, type )
448 __field( u64, seq )
448 ), 449 ),
449 450
450 TP_fast_assign( 451 TP_fast_assign(
@@ -455,17 +456,19 @@ TRACE_EVENT(btrfs_delayed_tree_ref,
455 __entry->ref_root = full_ref->root; 456 __entry->ref_root = full_ref->root;
456 __entry->level = full_ref->level; 457 __entry->level = full_ref->level;
457 __entry->type = ref->type; 458 __entry->type = ref->type;
459 __entry->seq = ref->seq;
458 ), 460 ),
459 461
460 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, " 462 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, "
461 "parent = %llu(%s), ref_root = %llu(%s), level = %d, " 463 "parent = %llu(%s), ref_root = %llu(%s), level = %d, "
462 "type = %s", 464 "type = %s, seq = %llu",
463 (unsigned long long)__entry->bytenr, 465 (unsigned long long)__entry->bytenr,
464 (unsigned long long)__entry->num_bytes, 466 (unsigned long long)__entry->num_bytes,
465 show_ref_action(__entry->action), 467 show_ref_action(__entry->action),
466 show_root_type(__entry->parent), 468 show_root_type(__entry->parent),
467 show_root_type(__entry->ref_root), 469 show_root_type(__entry->ref_root),
468 __entry->level, show_ref_type(__entry->type)) 470 __entry->level, show_ref_type(__entry->type),
471 (unsigned long long)__entry->seq)
469); 472);
470 473
471TRACE_EVENT(btrfs_delayed_data_ref, 474TRACE_EVENT(btrfs_delayed_data_ref,
@@ -485,6 +488,7 @@ TRACE_EVENT(btrfs_delayed_data_ref,
485 __field( u64, owner ) 488 __field( u64, owner )
486 __field( u64, offset ) 489 __field( u64, offset )
487 __field( int, type ) 490 __field( int, type )
491 __field( u64, seq )
488 ), 492 ),
489 493
490 TP_fast_assign( 494 TP_fast_assign(
@@ -496,11 +500,12 @@ TRACE_EVENT(btrfs_delayed_data_ref,
496 __entry->owner = full_ref->objectid; 500 __entry->owner = full_ref->objectid;
497 __entry->offset = full_ref->offset; 501 __entry->offset = full_ref->offset;
498 __entry->type = ref->type; 502 __entry->type = ref->type;
503 __entry->seq = ref->seq;
499 ), 504 ),
500 505
501 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, " 506 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, "
502 "parent = %llu(%s), ref_root = %llu(%s), owner = %llu, " 507 "parent = %llu(%s), ref_root = %llu(%s), owner = %llu, "
503 "offset = %llu, type = %s", 508 "offset = %llu, type = %s, seq = %llu",
504 (unsigned long long)__entry->bytenr, 509 (unsigned long long)__entry->bytenr,
505 (unsigned long long)__entry->num_bytes, 510 (unsigned long long)__entry->num_bytes,
506 show_ref_action(__entry->action), 511 show_ref_action(__entry->action),
@@ -508,7 +513,8 @@ TRACE_EVENT(btrfs_delayed_data_ref,
508 show_root_type(__entry->ref_root), 513 show_root_type(__entry->ref_root),
509 (unsigned long long)__entry->owner, 514 (unsigned long long)__entry->owner,
510 (unsigned long long)__entry->offset, 515 (unsigned long long)__entry->offset,
511 show_ref_type(__entry->type)) 516 show_ref_type(__entry->type),
517 (unsigned long long)__entry->seq)
512); 518);
513 519
514TRACE_EVENT(btrfs_delayed_ref_head, 520TRACE_EVENT(btrfs_delayed_ref_head,
diff --git a/include/uapi/linux/caif/Kbuild b/include/uapi/linux/caif/Kbuild
index aafaa5aa54d4..43396612d3a3 100644
--- a/include/uapi/linux/caif/Kbuild
+++ b/include/uapi/linux/caif/Kbuild
@@ -1 +1,3 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += caif_socket.h
3header-y += if_caif.h
diff --git a/include/linux/caif/caif_socket.h b/include/uapi/linux/caif/caif_socket.h
index 3f3bac6af7bc..3f3bac6af7bc 100644
--- a/include/linux/caif/caif_socket.h
+++ b/include/uapi/linux/caif/caif_socket.h
diff --git a/include/linux/caif/if_caif.h b/include/uapi/linux/caif/if_caif.h
index 5e7eed4edf51..5e7eed4edf51 100644
--- a/include/linux/caif/if_caif.h
+++ b/include/uapi/linux/caif/if_caif.h
diff --git a/include/uapi/linux/can/Kbuild b/include/uapi/linux/can/Kbuild
index aafaa5aa54d4..21c91bf25a29 100644
--- a/include/uapi/linux/can/Kbuild
+++ b/include/uapi/linux/can/Kbuild
@@ -1 +1,6 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += bcm.h
3header-y += error.h
4header-y += gw.h
5header-y += netlink.h
6header-y += raw.h
diff --git a/include/linux/can/bcm.h b/include/uapi/linux/can/bcm.h
index 3ebe387fea4d..3ebe387fea4d 100644
--- a/include/linux/can/bcm.h
+++ b/include/uapi/linux/can/bcm.h
diff --git a/include/linux/can/error.h b/include/uapi/linux/can/error.h
index 7b7148bded71..7b7148bded71 100644
--- a/include/linux/can/error.h
+++ b/include/uapi/linux/can/error.h
diff --git a/include/linux/can/gw.h b/include/uapi/linux/can/gw.h
index 8e1db18c3cb6..8e1db18c3cb6 100644
--- a/include/linux/can/gw.h
+++ b/include/uapi/linux/can/gw.h
diff --git a/include/linux/can/netlink.h b/include/uapi/linux/can/netlink.h
index 14966ddb7df1..14966ddb7df1 100644
--- a/include/linux/can/netlink.h
+++ b/include/uapi/linux/can/netlink.h
diff --git a/include/linux/can/raw.h b/include/uapi/linux/can/raw.h
index a814062b0719..a814062b0719 100644
--- a/include/linux/can/raw.h
+++ b/include/uapi/linux/can/raw.h
diff --git a/include/uapi/linux/isdn/Kbuild b/include/uapi/linux/isdn/Kbuild
index aafaa5aa54d4..89e52850bf29 100644
--- a/include/uapi/linux/isdn/Kbuild
+++ b/include/uapi/linux/isdn/Kbuild
@@ -1 +1,2 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += capicmd.h
diff --git a/include/linux/isdn/capicmd.h b/include/uapi/linux/isdn/capicmd.h
index b58635f722da..b58635f722da 100644
--- a/include/linux/isdn/capicmd.h
+++ b/include/uapi/linux/isdn/capicmd.h
diff --git a/include/uapi/linux/mmc/Kbuild b/include/uapi/linux/mmc/Kbuild
index aafaa5aa54d4..8c1d2cb75e33 100644
--- a/include/uapi/linux/mmc/Kbuild
+++ b/include/uapi/linux/mmc/Kbuild
@@ -1 +1,2 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += ioctl.h
diff --git a/include/linux/mmc/ioctl.h b/include/uapi/linux/mmc/ioctl.h
index 1f5e68923929..1f5e68923929 100644
--- a/include/linux/mmc/ioctl.h
+++ b/include/uapi/linux/mmc/ioctl.h
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index 4afbace8e869..08f555fef13f 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -1,2 +1,78 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += ipset/ 2header-y += ipset/
3header-y += nf_conntrack_common.h
4header-y += nf_conntrack_ftp.h
5header-y += nf_conntrack_sctp.h
6header-y += nf_conntrack_tcp.h
7header-y += nf_conntrack_tuple_common.h
8header-y += nf_nat.h
9header-y += nfnetlink.h
10header-y += nfnetlink_acct.h
11header-y += nfnetlink_compat.h
12header-y += nfnetlink_conntrack.h
13header-y += nfnetlink_cthelper.h
14header-y += nfnetlink_cttimeout.h
15header-y += nfnetlink_log.h
16header-y += nfnetlink_queue.h
17header-y += x_tables.h
18header-y += xt_AUDIT.h
19header-y += xt_CHECKSUM.h
20header-y += xt_CLASSIFY.h
21header-y += xt_CONNMARK.h
22header-y += xt_CONNSECMARK.h
23header-y += xt_CT.h
24header-y += xt_DSCP.h
25header-y += xt_IDLETIMER.h
26header-y += xt_LED.h
27header-y += xt_LOG.h
28header-y += xt_MARK.h
29header-y += xt_NFLOG.h
30header-y += xt_NFQUEUE.h
31header-y += xt_RATEEST.h
32header-y += xt_SECMARK.h
33header-y += xt_TCPMSS.h
34header-y += xt_TCPOPTSTRIP.h
35header-y += xt_TEE.h
36header-y += xt_TPROXY.h
37header-y += xt_addrtype.h
38header-y += xt_cluster.h
39header-y += xt_comment.h
40header-y += xt_connbytes.h
41header-y += xt_connlimit.h
42header-y += xt_connmark.h
43header-y += xt_conntrack.h
44header-y += xt_cpu.h
45header-y += xt_dccp.h
46header-y += xt_devgroup.h
47header-y += xt_dscp.h
48header-y += xt_ecn.h
49header-y += xt_esp.h
50header-y += xt_hashlimit.h
51header-y += xt_helper.h
52header-y += xt_iprange.h
53header-y += xt_ipvs.h
54header-y += xt_length.h
55header-y += xt_limit.h
56header-y += xt_mac.h
57header-y += xt_mark.h
58header-y += xt_multiport.h
59header-y += xt_nfacct.h
60header-y += xt_osf.h
61header-y += xt_owner.h
62header-y += xt_physdev.h
63header-y += xt_pkttype.h
64header-y += xt_policy.h
65header-y += xt_quota.h
66header-y += xt_rateest.h
67header-y += xt_realm.h
68header-y += xt_recent.h
69header-y += xt_sctp.h
70header-y += xt_set.h
71header-y += xt_socket.h
72header-y += xt_state.h
73header-y += xt_statistic.h
74header-y += xt_string.h
75header-y += xt_tcpmss.h
76header-y += xt_tcpudp.h
77header-y += xt_time.h
78header-y += xt_u32.h
diff --git a/include/uapi/linux/netfilter/ipset/Kbuild b/include/uapi/linux/netfilter/ipset/Kbuild
index aafaa5aa54d4..d2680423d9ab 100644
--- a/include/uapi/linux/netfilter/ipset/Kbuild
+++ b/include/uapi/linux/netfilter/ipset/Kbuild
@@ -1 +1,5 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += ip_set.h
3header-y += ip_set_bitmap.h
4header-y += ip_set_hash.h
5header-y += ip_set_list.h
diff --git a/include/uapi/linux/netfilter/ipset/ip_set.h b/include/uapi/linux/netfilter/ipset/ip_set.h
new file mode 100644
index 000000000000..fbee42807a11
--- /dev/null
+++ b/include/uapi/linux/netfilter/ipset/ip_set.h
@@ -0,0 +1,231 @@
1/* Copyright (C) 2000-2002 Joakim Axelsson <gozem@linux.nu>
2 * Patrick Schaaf <bof@bof.de>
3 * Martin Josefsson <gandalf@wlug.westbo.se>
4 * Copyright (C) 2003-2011 Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
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#ifndef _UAPI_IP_SET_H
11#define _UAPI_IP_SET_H
12
13
14#include <linux/types.h>
15
16/* The protocol version */
17#define IPSET_PROTOCOL 6
18
19/* The max length of strings including NUL: set and type identifiers */
20#define IPSET_MAXNAMELEN 32
21
22/* Message types and commands */
23enum ipset_cmd {
24 IPSET_CMD_NONE,
25 IPSET_CMD_PROTOCOL, /* 1: Return protocol version */
26 IPSET_CMD_CREATE, /* 2: Create a new (empty) set */
27 IPSET_CMD_DESTROY, /* 3: Destroy a (empty) set */
28 IPSET_CMD_FLUSH, /* 4: Remove all elements from a set */
29 IPSET_CMD_RENAME, /* 5: Rename a set */
30 IPSET_CMD_SWAP, /* 6: Swap two sets */
31 IPSET_CMD_LIST, /* 7: List sets */
32 IPSET_CMD_SAVE, /* 8: Save sets */
33 IPSET_CMD_ADD, /* 9: Add an element to a set */
34 IPSET_CMD_DEL, /* 10: Delete an element from a set */
35 IPSET_CMD_TEST, /* 11: Test an element in a set */
36 IPSET_CMD_HEADER, /* 12: Get set header data only */
37 IPSET_CMD_TYPE, /* 13: Get set type */
38 IPSET_MSG_MAX, /* Netlink message commands */
39
40 /* Commands in userspace: */
41 IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 14: Enter restore mode */
42 IPSET_CMD_HELP, /* 15: Get help */
43 IPSET_CMD_VERSION, /* 16: Get program version */
44 IPSET_CMD_QUIT, /* 17: Quit from interactive mode */
45
46 IPSET_CMD_MAX,
47
48 IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 18: Commit buffered commands */
49};
50
51/* Attributes at command level */
52enum {
53 IPSET_ATTR_UNSPEC,
54 IPSET_ATTR_PROTOCOL, /* 1: Protocol version */
55 IPSET_ATTR_SETNAME, /* 2: Name of the set */
56 IPSET_ATTR_TYPENAME, /* 3: Typename */
57 IPSET_ATTR_SETNAME2 = IPSET_ATTR_TYPENAME, /* Setname at rename/swap */
58 IPSET_ATTR_REVISION, /* 4: Settype revision */
59 IPSET_ATTR_FAMILY, /* 5: Settype family */
60 IPSET_ATTR_FLAGS, /* 6: Flags at command level */
61 IPSET_ATTR_DATA, /* 7: Nested attributes */
62 IPSET_ATTR_ADT, /* 8: Multiple data containers */
63 IPSET_ATTR_LINENO, /* 9: Restore lineno */
64 IPSET_ATTR_PROTOCOL_MIN, /* 10: Minimal supported version number */
65 IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN, /* type rev min */
66 __IPSET_ATTR_CMD_MAX,
67};
68#define IPSET_ATTR_CMD_MAX (__IPSET_ATTR_CMD_MAX - 1)
69
70/* CADT specific attributes */
71enum {
72 IPSET_ATTR_IP = IPSET_ATTR_UNSPEC + 1,
73 IPSET_ATTR_IP_FROM = IPSET_ATTR_IP,
74 IPSET_ATTR_IP_TO, /* 2 */
75 IPSET_ATTR_CIDR, /* 3 */
76 IPSET_ATTR_PORT, /* 4 */
77 IPSET_ATTR_PORT_FROM = IPSET_ATTR_PORT,
78 IPSET_ATTR_PORT_TO, /* 5 */
79 IPSET_ATTR_TIMEOUT, /* 6 */
80 IPSET_ATTR_PROTO, /* 7 */
81 IPSET_ATTR_CADT_FLAGS, /* 8 */
82 IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */
83 /* Reserve empty slots */
84 IPSET_ATTR_CADT_MAX = 16,
85 /* Create-only specific attributes */
86 IPSET_ATTR_GC,
87 IPSET_ATTR_HASHSIZE,
88 IPSET_ATTR_MAXELEM,
89 IPSET_ATTR_NETMASK,
90 IPSET_ATTR_PROBES,
91 IPSET_ATTR_RESIZE,
92 IPSET_ATTR_SIZE,
93 /* Kernel-only */
94 IPSET_ATTR_ELEMENTS,
95 IPSET_ATTR_REFERENCES,
96 IPSET_ATTR_MEMSIZE,
97
98 __IPSET_ATTR_CREATE_MAX,
99};
100#define IPSET_ATTR_CREATE_MAX (__IPSET_ATTR_CREATE_MAX - 1)
101
102/* ADT specific attributes */
103enum {
104 IPSET_ATTR_ETHER = IPSET_ATTR_CADT_MAX + 1,
105 IPSET_ATTR_NAME,
106 IPSET_ATTR_NAMEREF,
107 IPSET_ATTR_IP2,
108 IPSET_ATTR_CIDR2,
109 IPSET_ATTR_IP2_TO,
110 IPSET_ATTR_IFACE,
111 __IPSET_ATTR_ADT_MAX,
112};
113#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
114
115/* IP specific attributes */
116enum {
117 IPSET_ATTR_IPADDR_IPV4 = IPSET_ATTR_UNSPEC + 1,
118 IPSET_ATTR_IPADDR_IPV6,
119 __IPSET_ATTR_IPADDR_MAX,
120};
121#define IPSET_ATTR_IPADDR_MAX (__IPSET_ATTR_IPADDR_MAX - 1)
122
123/* Error codes */
124enum ipset_errno {
125 IPSET_ERR_PRIVATE = 4096,
126 IPSET_ERR_PROTOCOL,
127 IPSET_ERR_FIND_TYPE,
128 IPSET_ERR_MAX_SETS,
129 IPSET_ERR_BUSY,
130 IPSET_ERR_EXIST_SETNAME2,
131 IPSET_ERR_TYPE_MISMATCH,
132 IPSET_ERR_EXIST,
133 IPSET_ERR_INVALID_CIDR,
134 IPSET_ERR_INVALID_NETMASK,
135 IPSET_ERR_INVALID_FAMILY,
136 IPSET_ERR_TIMEOUT,
137 IPSET_ERR_REFERENCED,
138 IPSET_ERR_IPADDR_IPV4,
139 IPSET_ERR_IPADDR_IPV6,
140
141 /* Type specific error codes */
142 IPSET_ERR_TYPE_SPECIFIC = 4352,
143};
144
145/* Flags at command level */
146enum ipset_cmd_flags {
147 IPSET_FLAG_BIT_EXIST = 0,
148 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
149 IPSET_FLAG_BIT_LIST_SETNAME = 1,
150 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
151 IPSET_FLAG_BIT_LIST_HEADER = 2,
152 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
153 IPSET_FLAG_CMD_MAX = 15, /* Lower half */
154};
155
156/* Flags at CADT attribute level */
157enum ipset_cadt_flags {
158 IPSET_FLAG_BIT_BEFORE = 0,
159 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
160 IPSET_FLAG_BIT_PHYSDEV = 1,
161 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
162 IPSET_FLAG_BIT_NOMATCH = 2,
163 IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
164 IPSET_FLAG_CADT_MAX = 15, /* Upper half */
165};
166
167/* Commands with settype-specific attributes */
168enum ipset_adt {
169 IPSET_ADD,
170 IPSET_DEL,
171 IPSET_TEST,
172 IPSET_ADT_MAX,
173 IPSET_CREATE = IPSET_ADT_MAX,
174 IPSET_CADT_MAX,
175};
176
177/* Sets are identified by an index in kernel space. Tweak with ip_set_id_t
178 * and IPSET_INVALID_ID if you want to increase the max number of sets.
179 */
180typedef __u16 ip_set_id_t;
181
182#define IPSET_INVALID_ID 65535
183
184enum ip_set_dim {
185 IPSET_DIM_ZERO = 0,
186 IPSET_DIM_ONE,
187 IPSET_DIM_TWO,
188 IPSET_DIM_THREE,
189 /* Max dimension in elements.
190 * If changed, new revision of iptables match/target is required.
191 */
192 IPSET_DIM_MAX = 6,
193 IPSET_BIT_RETURN_NOMATCH = 7,
194};
195
196/* Option flags for kernel operations */
197enum ip_set_kopt {
198 IPSET_INV_MATCH = (1 << IPSET_DIM_ZERO),
199 IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
200 IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
201 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
202 IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH),
203};
204
205
206/* Interface to iptables/ip6tables */
207
208#define SO_IP_SET 83
209
210union ip_set_name_index {
211 char name[IPSET_MAXNAMELEN];
212 ip_set_id_t index;
213};
214
215#define IP_SET_OP_GET_BYNAME 0x00000006 /* Get set index by name */
216struct ip_set_req_get_set {
217 unsigned int op;
218 unsigned int version;
219 union ip_set_name_index set;
220};
221
222#define IP_SET_OP_GET_BYINDEX 0x00000007 /* Get set name by index */
223/* Uses ip_set_req_get_set */
224
225#define IP_SET_OP_VERSION 0x00000100 /* Ask kernel version */
226struct ip_set_req_version {
227 unsigned int op;
228 unsigned int version;
229};
230
231#endif /* _UAPI_IP_SET_H */
diff --git a/include/uapi/linux/netfilter/ipset/ip_set_bitmap.h b/include/uapi/linux/netfilter/ipset/ip_set_bitmap.h
new file mode 100644
index 000000000000..6a2c038d1888
--- /dev/null
+++ b/include/uapi/linux/netfilter/ipset/ip_set_bitmap.h
@@ -0,0 +1,13 @@
1#ifndef _UAPI__IP_SET_BITMAP_H
2#define _UAPI__IP_SET_BITMAP_H
3
4/* Bitmap type specific error codes */
5enum {
6 /* The element is out of the range of the set */
7 IPSET_ERR_BITMAP_RANGE = IPSET_ERR_TYPE_SPECIFIC,
8 /* The range exceeds the size limit of the set type */
9 IPSET_ERR_BITMAP_RANGE_SIZE,
10};
11
12
13#endif /* _UAPI__IP_SET_BITMAP_H */
diff --git a/include/uapi/linux/netfilter/ipset/ip_set_hash.h b/include/uapi/linux/netfilter/ipset/ip_set_hash.h
new file mode 100644
index 000000000000..352eeccdc7f2
--- /dev/null
+++ b/include/uapi/linux/netfilter/ipset/ip_set_hash.h
@@ -0,0 +1,21 @@
1#ifndef _UAPI__IP_SET_HASH_H
2#define _UAPI__IP_SET_HASH_H
3
4/* Hash type specific error codes */
5enum {
6 /* Hash is full */
7 IPSET_ERR_HASH_FULL = IPSET_ERR_TYPE_SPECIFIC,
8 /* Null-valued element */
9 IPSET_ERR_HASH_ELEM,
10 /* Invalid protocol */
11 IPSET_ERR_INVALID_PROTO,
12 /* Protocol missing but must be specified */
13 IPSET_ERR_MISSING_PROTO,
14 /* Range not supported */
15 IPSET_ERR_HASH_RANGE_UNSUPPORTED,
16 /* Invalid range */
17 IPSET_ERR_HASH_RANGE,
18};
19
20
21#endif /* _UAPI__IP_SET_HASH_H */
diff --git a/include/uapi/linux/netfilter/ipset/ip_set_list.h b/include/uapi/linux/netfilter/ipset/ip_set_list.h
new file mode 100644
index 000000000000..a44efaa98213
--- /dev/null
+++ b/include/uapi/linux/netfilter/ipset/ip_set_list.h
@@ -0,0 +1,21 @@
1#ifndef _UAPI__IP_SET_LIST_H
2#define _UAPI__IP_SET_LIST_H
3
4/* List type specific error codes */
5enum {
6 /* Set name to be added/deleted/tested does not exist. */
7 IPSET_ERR_NAME = IPSET_ERR_TYPE_SPECIFIC,
8 /* list:set type is not permitted to add */
9 IPSET_ERR_LOOP,
10 /* Missing reference set */
11 IPSET_ERR_BEFORE,
12 /* Reference set does not exist */
13 IPSET_ERR_NAMEREF,
14 /* Set is full */
15 IPSET_ERR_LIST_FULL,
16 /* Reference set is not added to the set */
17 IPSET_ERR_REF_EXIST,
18};
19
20
21#endif /* _UAPI__IP_SET_LIST_H */
diff --git a/include/uapi/linux/netfilter/nf_conntrack_common.h b/include/uapi/linux/netfilter/nf_conntrack_common.h
new file mode 100644
index 000000000000..1644cdd8be91
--- /dev/null
+++ b/include/uapi/linux/netfilter/nf_conntrack_common.h
@@ -0,0 +1,117 @@
1#ifndef _UAPI_NF_CONNTRACK_COMMON_H
2#define _UAPI_NF_CONNTRACK_COMMON_H
3/* Connection state tracking for netfilter. This is separated from,
4 but required by, the NAT layer; it can also be used by an iptables
5 extension. */
6enum ip_conntrack_info {
7 /* Part of an established connection (either direction). */
8 IP_CT_ESTABLISHED,
9
10 /* Like NEW, but related to an existing connection, or ICMP error
11 (in either direction). */
12 IP_CT_RELATED,
13
14 /* Started a new connection to track (only
15 IP_CT_DIR_ORIGINAL); may be a retransmission. */
16 IP_CT_NEW,
17
18 /* >= this indicates reply direction */
19 IP_CT_IS_REPLY,
20
21 IP_CT_ESTABLISHED_REPLY = IP_CT_ESTABLISHED + IP_CT_IS_REPLY,
22 IP_CT_RELATED_REPLY = IP_CT_RELATED + IP_CT_IS_REPLY,
23 IP_CT_NEW_REPLY = IP_CT_NEW + IP_CT_IS_REPLY,
24 /* Number of distinct IP_CT types (no NEW in reply dirn). */
25 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
26};
27
28/* Bitset representing status of connection. */
29enum ip_conntrack_status {
30 /* It's an expected connection: bit 0 set. This bit never changed */
31 IPS_EXPECTED_BIT = 0,
32 IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
33
34 /* We've seen packets both ways: bit 1 set. Can be set, not unset. */
35 IPS_SEEN_REPLY_BIT = 1,
36 IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
37
38 /* Conntrack should never be early-expired. */
39 IPS_ASSURED_BIT = 2,
40 IPS_ASSURED = (1 << IPS_ASSURED_BIT),
41
42 /* Connection is confirmed: originating packet has left box */
43 IPS_CONFIRMED_BIT = 3,
44 IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
45
46 /* Connection needs src nat in orig dir. This bit never changed. */
47 IPS_SRC_NAT_BIT = 4,
48 IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
49
50 /* Connection needs dst nat in orig dir. This bit never changed. */
51 IPS_DST_NAT_BIT = 5,
52 IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
53
54 /* Both together. */
55 IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
56
57 /* Connection needs TCP sequence adjusted. */
58 IPS_SEQ_ADJUST_BIT = 6,
59 IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
60
61 /* NAT initialization bits. */
62 IPS_SRC_NAT_DONE_BIT = 7,
63 IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
64
65 IPS_DST_NAT_DONE_BIT = 8,
66 IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
67
68 /* Both together */
69 IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
70
71 /* Connection is dying (removed from lists), can not be unset. */
72 IPS_DYING_BIT = 9,
73 IPS_DYING = (1 << IPS_DYING_BIT),
74
75 /* Connection has fixed timeout. */
76 IPS_FIXED_TIMEOUT_BIT = 10,
77 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
78
79 /* Conntrack is a template */
80 IPS_TEMPLATE_BIT = 11,
81 IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT),
82
83 /* Conntrack is a fake untracked entry */
84 IPS_UNTRACKED_BIT = 12,
85 IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),
86
87 /* Conntrack got a helper explicitly attached via CT target. */
88 IPS_HELPER_BIT = 13,
89 IPS_HELPER = (1 << IPS_HELPER_BIT),
90};
91
92/* Connection tracking event types */
93enum ip_conntrack_events {
94 IPCT_NEW, /* new conntrack */
95 IPCT_RELATED, /* related conntrack */
96 IPCT_DESTROY, /* destroyed conntrack */
97 IPCT_REPLY, /* connection has seen two-way traffic */
98 IPCT_ASSURED, /* connection status has changed to assured */
99 IPCT_PROTOINFO, /* protocol information has changed */
100 IPCT_HELPER, /* new helper has been set */
101 IPCT_MARK, /* new mark has been set */
102 IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */
103 IPCT_SECMARK, /* new security mark has been set */
104};
105
106enum ip_conntrack_expect_events {
107 IPEXP_NEW, /* new expectation */
108 IPEXP_DESTROY, /* destroyed expectation */
109};
110
111/* expectation flags */
112#define NF_CT_EXPECT_PERMANENT 0x1
113#define NF_CT_EXPECT_INACTIVE 0x2
114#define NF_CT_EXPECT_USERSPACE 0x4
115
116
117#endif /* _UAPI_NF_CONNTRACK_COMMON_H */
diff --git a/include/uapi/linux/netfilter/nf_conntrack_ftp.h b/include/uapi/linux/netfilter/nf_conntrack_ftp.h
new file mode 100644
index 000000000000..1030315a41b5
--- /dev/null
+++ b/include/uapi/linux/netfilter/nf_conntrack_ftp.h
@@ -0,0 +1,18 @@
1#ifndef _UAPI_NF_CONNTRACK_FTP_H
2#define _UAPI_NF_CONNTRACK_FTP_H
3/* FTP tracking. */
4
5/* This enum is exposed to userspace */
6enum nf_ct_ftp_type {
7 /* PORT command from client */
8 NF_CT_FTP_PORT,
9 /* PASV response from server */
10 NF_CT_FTP_PASV,
11 /* EPRT command from client */
12 NF_CT_FTP_EPRT,
13 /* EPSV response from server */
14 NF_CT_FTP_EPSV,
15};
16
17
18#endif /* _UAPI_NF_CONNTRACK_FTP_H */
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/uapi/linux/netfilter/nf_conntrack_sctp.h
index ceeefe6681b5..ceeefe6681b5 100644
--- a/include/linux/netfilter/nf_conntrack_sctp.h
+++ b/include/uapi/linux/netfilter/nf_conntrack_sctp.h
diff --git a/include/uapi/linux/netfilter/nf_conntrack_tcp.h b/include/uapi/linux/netfilter/nf_conntrack_tcp.h
new file mode 100644
index 000000000000..9993a421201c
--- /dev/null
+++ b/include/uapi/linux/netfilter/nf_conntrack_tcp.h
@@ -0,0 +1,51 @@
1#ifndef _UAPI_NF_CONNTRACK_TCP_H
2#define _UAPI_NF_CONNTRACK_TCP_H
3/* TCP tracking. */
4
5#include <linux/types.h>
6
7/* This is exposed to userspace (ctnetlink) */
8enum tcp_conntrack {
9 TCP_CONNTRACK_NONE,
10 TCP_CONNTRACK_SYN_SENT,
11 TCP_CONNTRACK_SYN_RECV,
12 TCP_CONNTRACK_ESTABLISHED,
13 TCP_CONNTRACK_FIN_WAIT,
14 TCP_CONNTRACK_CLOSE_WAIT,
15 TCP_CONNTRACK_LAST_ACK,
16 TCP_CONNTRACK_TIME_WAIT,
17 TCP_CONNTRACK_CLOSE,
18 TCP_CONNTRACK_LISTEN, /* obsolete */
19#define TCP_CONNTRACK_SYN_SENT2 TCP_CONNTRACK_LISTEN
20 TCP_CONNTRACK_MAX,
21 TCP_CONNTRACK_IGNORE,
22 TCP_CONNTRACK_RETRANS,
23 TCP_CONNTRACK_UNACK,
24 TCP_CONNTRACK_TIMEOUT_MAX
25};
26
27/* Window scaling is advertised by the sender */
28#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
29
30/* SACK is permitted by the sender */
31#define IP_CT_TCP_FLAG_SACK_PERM 0x02
32
33/* This sender sent FIN first */
34#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
35
36/* Be liberal in window checking */
37#define IP_CT_TCP_FLAG_BE_LIBERAL 0x08
38
39/* Has unacknowledged data */
40#define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10
41
42/* The field td_maxack has been set */
43#define IP_CT_TCP_FLAG_MAXACK_SET 0x20
44
45struct nf_ct_tcp_flags {
46 __u8 flags;
47 __u8 mask;
48};
49
50
51#endif /* _UAPI_NF_CONNTRACK_TCP_H */
diff --git a/include/linux/netfilter/nf_conntrack_tuple_common.h b/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h
index 2f6bbc5b8125..2f6bbc5b8125 100644
--- a/include/linux/netfilter/nf_conntrack_tuple_common.h
+++ b/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h
diff --git a/include/linux/netfilter/nf_nat.h b/include/uapi/linux/netfilter/nf_nat.h
index bf0cc373ffb6..bf0cc373ffb6 100644
--- a/include/linux/netfilter/nf_nat.h
+++ b/include/uapi/linux/netfilter/nf_nat.h
diff --git a/include/uapi/linux/netfilter/nfnetlink.h b/include/uapi/linux/netfilter/nfnetlink.h
new file mode 100644
index 000000000000..4a4efafad5f4
--- /dev/null
+++ b/include/uapi/linux/netfilter/nfnetlink.h
@@ -0,0 +1,56 @@
1#ifndef _UAPI_NFNETLINK_H
2#define _UAPI_NFNETLINK_H
3#include <linux/types.h>
4#include <linux/netfilter/nfnetlink_compat.h>
5
6enum nfnetlink_groups {
7 NFNLGRP_NONE,
8#define NFNLGRP_NONE NFNLGRP_NONE
9 NFNLGRP_CONNTRACK_NEW,
10#define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW
11 NFNLGRP_CONNTRACK_UPDATE,
12#define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE
13 NFNLGRP_CONNTRACK_DESTROY,
14#define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY
15 NFNLGRP_CONNTRACK_EXP_NEW,
16#define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW
17 NFNLGRP_CONNTRACK_EXP_UPDATE,
18#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
19 NFNLGRP_CONNTRACK_EXP_DESTROY,
20#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
21 __NFNLGRP_MAX,
22};
23#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
24
25/* General form of address family dependent message.
26 */
27struct nfgenmsg {
28 __u8 nfgen_family; /* AF_xxx */
29 __u8 version; /* nfnetlink version */
30 __be16 res_id; /* resource id */
31};
32
33#define NFNETLINK_V0 0
34
35/* netfilter netlink message types are split in two pieces:
36 * 8 bit subsystem, 8bit operation.
37 */
38
39#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
40#define NFNL_MSG_TYPE(x) (x & 0x00ff)
41
42/* No enum here, otherwise __stringify() trick of MODULE_ALIAS_NFNL_SUBSYS()
43 * won't work anymore */
44#define NFNL_SUBSYS_NONE 0
45#define NFNL_SUBSYS_CTNETLINK 1
46#define NFNL_SUBSYS_CTNETLINK_EXP 2
47#define NFNL_SUBSYS_QUEUE 3
48#define NFNL_SUBSYS_ULOG 4
49#define NFNL_SUBSYS_OSF 5
50#define NFNL_SUBSYS_IPSET 6
51#define NFNL_SUBSYS_ACCT 7
52#define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
53#define NFNL_SUBSYS_CTHELPER 9
54#define NFNL_SUBSYS_COUNT 10
55
56#endif /* _UAPI_NFNETLINK_H */
diff --git a/include/uapi/linux/netfilter/nfnetlink_acct.h b/include/uapi/linux/netfilter/nfnetlink_acct.h
new file mode 100644
index 000000000000..c7b6269e760b
--- /dev/null
+++ b/include/uapi/linux/netfilter/nfnetlink_acct.h
@@ -0,0 +1,27 @@
1#ifndef _UAPI_NFNL_ACCT_H_
2#define _UAPI_NFNL_ACCT_H_
3
4#ifndef NFACCT_NAME_MAX
5#define NFACCT_NAME_MAX 32
6#endif
7
8enum nfnl_acct_msg_types {
9 NFNL_MSG_ACCT_NEW,
10 NFNL_MSG_ACCT_GET,
11 NFNL_MSG_ACCT_GET_CTRZERO,
12 NFNL_MSG_ACCT_DEL,
13 NFNL_MSG_ACCT_MAX
14};
15
16enum nfnl_acct_type {
17 NFACCT_UNSPEC,
18 NFACCT_NAME,
19 NFACCT_PKTS,
20 NFACCT_BYTES,
21 NFACCT_USE,
22 __NFACCT_MAX
23};
24#define NFACCT_MAX (__NFACCT_MAX - 1)
25
26
27#endif /* _UAPI_NFNL_ACCT_H_ */
diff --git a/include/linux/netfilter/nfnetlink_compat.h b/include/uapi/linux/netfilter/nfnetlink_compat.h
index ffb95036bbd4..ffb95036bbd4 100644
--- a/include/linux/netfilter/nfnetlink_compat.h
+++ b/include/uapi/linux/netfilter/nfnetlink_compat.h
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
index 43bfe3e1685b..43bfe3e1685b 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
diff --git a/include/linux/netfilter/nfnetlink_cthelper.h b/include/uapi/linux/netfilter/nfnetlink_cthelper.h
index 33659f6fad3e..33659f6fad3e 100644
--- a/include/linux/netfilter/nfnetlink_cthelper.h
+++ b/include/uapi/linux/netfilter/nfnetlink_cthelper.h
diff --git a/include/linux/netfilter/nfnetlink_cttimeout.h b/include/uapi/linux/netfilter/nfnetlink_cttimeout.h
index a2810a7c5e30..a2810a7c5e30 100644
--- a/include/linux/netfilter/nfnetlink_cttimeout.h
+++ b/include/uapi/linux/netfilter/nfnetlink_cttimeout.h
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/uapi/linux/netfilter/nfnetlink_log.h
index 90c2c9575bac..90c2c9575bac 100644
--- a/include/linux/netfilter/nfnetlink_log.h
+++ b/include/uapi/linux/netfilter/nfnetlink_log.h
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/uapi/linux/netfilter/nfnetlink_queue.h
index 70ec8c2bc11a..70ec8c2bc11a 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/uapi/linux/netfilter/nfnetlink_queue.h
diff --git a/include/uapi/linux/netfilter/x_tables.h b/include/uapi/linux/netfilter/x_tables.h
new file mode 100644
index 000000000000..c36969b91533
--- /dev/null
+++ b/include/uapi/linux/netfilter/x_tables.h
@@ -0,0 +1,187 @@
1#ifndef _UAPI_X_TABLES_H
2#define _UAPI_X_TABLES_H
3#include <linux/kernel.h>
4#include <linux/types.h>
5
6#define XT_FUNCTION_MAXNAMELEN 30
7#define XT_EXTENSION_MAXNAMELEN 29
8#define XT_TABLE_MAXNAMELEN 32
9
10struct xt_entry_match {
11 union {
12 struct {
13 __u16 match_size;
14
15 /* Used by userspace */
16 char name[XT_EXTENSION_MAXNAMELEN];
17 __u8 revision;
18 } user;
19 struct {
20 __u16 match_size;
21
22 /* Used inside the kernel */
23 struct xt_match *match;
24 } kernel;
25
26 /* Total length */
27 __u16 match_size;
28 } u;
29
30 unsigned char data[0];
31};
32
33struct xt_entry_target {
34 union {
35 struct {
36 __u16 target_size;
37
38 /* Used by userspace */
39 char name[XT_EXTENSION_MAXNAMELEN];
40 __u8 revision;
41 } user;
42 struct {
43 __u16 target_size;
44
45 /* Used inside the kernel */
46 struct xt_target *target;
47 } kernel;
48
49 /* Total length */
50 __u16 target_size;
51 } u;
52
53 unsigned char data[0];
54};
55
56#define XT_TARGET_INIT(__name, __size) \
57{ \
58 .target.u.user = { \
59 .target_size = XT_ALIGN(__size), \
60 .name = __name, \
61 }, \
62}
63
64struct xt_standard_target {
65 struct xt_entry_target target;
66 int verdict;
67};
68
69struct xt_error_target {
70 struct xt_entry_target target;
71 char errorname[XT_FUNCTION_MAXNAMELEN];
72};
73
74/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
75 * kernel supports, if >= revision. */
76struct xt_get_revision {
77 char name[XT_EXTENSION_MAXNAMELEN];
78 __u8 revision;
79};
80
81/* CONTINUE verdict for targets */
82#define XT_CONTINUE 0xFFFFFFFF
83
84/* For standard target */
85#define XT_RETURN (-NF_REPEAT - 1)
86
87/* this is a dummy structure to find out the alignment requirement for a struct
88 * containing all the fundamental data types that are used in ipt_entry,
89 * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my
90 * personal pleasure to remove it -HW
91 */
92struct _xt_align {
93 __u8 u8;
94 __u16 u16;
95 __u32 u32;
96 __u64 u64;
97};
98
99#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
100
101/* Standard return verdict, or do jump. */
102#define XT_STANDARD_TARGET ""
103/* Error verdict. */
104#define XT_ERROR_TARGET "ERROR"
105
106#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
107#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
108
109struct xt_counters {
110 __u64 pcnt, bcnt; /* Packet and byte counters */
111};
112
113/* The argument to IPT_SO_ADD_COUNTERS. */
114struct xt_counters_info {
115 /* Which table. */
116 char name[XT_TABLE_MAXNAMELEN];
117
118 unsigned int num_counters;
119
120 /* The counters (actually `number' of these). */
121 struct xt_counters counters[0];
122};
123
124#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
125
126#ifndef __KERNEL__
127/* fn returns 0 to continue iteration */
128#define XT_MATCH_ITERATE(type, e, fn, args...) \
129({ \
130 unsigned int __i; \
131 int __ret = 0; \
132 struct xt_entry_match *__m; \
133 \
134 for (__i = sizeof(type); \
135 __i < (e)->target_offset; \
136 __i += __m->u.match_size) { \
137 __m = (void *)e + __i; \
138 \
139 __ret = fn(__m , ## args); \
140 if (__ret != 0) \
141 break; \
142 } \
143 __ret; \
144})
145
146/* fn returns 0 to continue iteration */
147#define XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...) \
148({ \
149 unsigned int __i, __n; \
150 int __ret = 0; \
151 type *__entry; \
152 \
153 for (__i = 0, __n = 0; __i < (size); \
154 __i += __entry->next_offset, __n++) { \
155 __entry = (void *)(entries) + __i; \
156 if (__n < n) \
157 continue; \
158 \
159 __ret = fn(__entry , ## args); \
160 if (__ret != 0) \
161 break; \
162 } \
163 __ret; \
164})
165
166/* fn returns 0 to continue iteration */
167#define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \
168 XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
169
170#endif /* !__KERNEL__ */
171
172/* pos is normally a struct ipt_entry/ip6t_entry/etc. */
173#define xt_entry_foreach(pos, ehead, esize) \
174 for ((pos) = (typeof(pos))(ehead); \
175 (pos) < (typeof(pos))((char *)(ehead) + (esize)); \
176 (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset))
177
178/* can only be xt_entry_match, so no use of typeof here */
179#define xt_ematch_foreach(pos, entry) \
180 for ((pos) = (struct xt_entry_match *)entry->elems; \
181 (pos) < (struct xt_entry_match *)((char *)(entry) + \
182 (entry)->target_offset); \
183 (pos) = (struct xt_entry_match *)((char *)(pos) + \
184 (pos)->u.match_size))
185
186
187#endif /* _UAPI_X_TABLES_H */
diff --git a/include/linux/netfilter/xt_AUDIT.h b/include/uapi/linux/netfilter/xt_AUDIT.h
index 38751d2ea52b..38751d2ea52b 100644
--- a/include/linux/netfilter/xt_AUDIT.h
+++ b/include/uapi/linux/netfilter/xt_AUDIT.h
diff --git a/include/linux/netfilter/xt_CHECKSUM.h b/include/uapi/linux/netfilter/xt_CHECKSUM.h
index 9a2e4661654e..9a2e4661654e 100644
--- a/include/linux/netfilter/xt_CHECKSUM.h
+++ b/include/uapi/linux/netfilter/xt_CHECKSUM.h
diff --git a/include/linux/netfilter/xt_CLASSIFY.h b/include/uapi/linux/netfilter/xt_CLASSIFY.h
index a813bf14dd63..a813bf14dd63 100644
--- a/include/linux/netfilter/xt_CLASSIFY.h
+++ b/include/uapi/linux/netfilter/xt_CLASSIFY.h
diff --git a/include/linux/netfilter/xt_CONNMARK.h b/include/uapi/linux/netfilter/xt_CONNMARK.h
index 2f2e48ec8023..2f2e48ec8023 100644
--- a/include/linux/netfilter/xt_CONNMARK.h
+++ b/include/uapi/linux/netfilter/xt_CONNMARK.h
diff --git a/include/linux/netfilter/xt_CONNSECMARK.h b/include/uapi/linux/netfilter/xt_CONNSECMARK.h
index b973ff80fa1e..b973ff80fa1e 100644
--- a/include/linux/netfilter/xt_CONNSECMARK.h
+++ b/include/uapi/linux/netfilter/xt_CONNSECMARK.h
diff --git a/include/linux/netfilter/xt_CT.h b/include/uapi/linux/netfilter/xt_CT.h
index a064b8af360c..a064b8af360c 100644
--- a/include/linux/netfilter/xt_CT.h
+++ b/include/uapi/linux/netfilter/xt_CT.h
diff --git a/include/linux/netfilter/xt_DSCP.h b/include/uapi/linux/netfilter/xt_DSCP.h
index 648e0b3bed29..648e0b3bed29 100644
--- a/include/linux/netfilter/xt_DSCP.h
+++ b/include/uapi/linux/netfilter/xt_DSCP.h
diff --git a/include/linux/netfilter/xt_IDLETIMER.h b/include/uapi/linux/netfilter/xt_IDLETIMER.h
index 208ae9387331..208ae9387331 100644
--- a/include/linux/netfilter/xt_IDLETIMER.h
+++ b/include/uapi/linux/netfilter/xt_IDLETIMER.h
diff --git a/include/linux/netfilter/xt_LED.h b/include/uapi/linux/netfilter/xt_LED.h
index f5509e7524d3..f5509e7524d3 100644
--- a/include/linux/netfilter/xt_LED.h
+++ b/include/uapi/linux/netfilter/xt_LED.h
diff --git a/include/linux/netfilter/xt_LOG.h b/include/uapi/linux/netfilter/xt_LOG.h
index cac079095305..cac079095305 100644
--- a/include/linux/netfilter/xt_LOG.h
+++ b/include/uapi/linux/netfilter/xt_LOG.h
diff --git a/include/linux/netfilter/xt_MARK.h b/include/uapi/linux/netfilter/xt_MARK.h
index 41c456deba22..41c456deba22 100644
--- a/include/linux/netfilter/xt_MARK.h
+++ b/include/uapi/linux/netfilter/xt_MARK.h
diff --git a/include/linux/netfilter/xt_NFLOG.h b/include/uapi/linux/netfilter/xt_NFLOG.h
index 87b58311ce6b..87b58311ce6b 100644
--- a/include/linux/netfilter/xt_NFLOG.h
+++ b/include/uapi/linux/netfilter/xt_NFLOG.h
diff --git a/include/linux/netfilter/xt_NFQUEUE.h b/include/uapi/linux/netfilter/xt_NFQUEUE.h
index 9eafdbbb401c..9eafdbbb401c 100644
--- a/include/linux/netfilter/xt_NFQUEUE.h
+++ b/include/uapi/linux/netfilter/xt_NFQUEUE.h
diff --git a/include/linux/netfilter/xt_RATEEST.h b/include/uapi/linux/netfilter/xt_RATEEST.h
index 6605e20ad8cf..6605e20ad8cf 100644
--- a/include/linux/netfilter/xt_RATEEST.h
+++ b/include/uapi/linux/netfilter/xt_RATEEST.h
diff --git a/include/linux/netfilter/xt_SECMARK.h b/include/uapi/linux/netfilter/xt_SECMARK.h
index 989092bd6274..989092bd6274 100644
--- a/include/linux/netfilter/xt_SECMARK.h
+++ b/include/uapi/linux/netfilter/xt_SECMARK.h
diff --git a/include/linux/netfilter/xt_TCPMSS.h b/include/uapi/linux/netfilter/xt_TCPMSS.h
index 9a6960afc134..9a6960afc134 100644
--- a/include/linux/netfilter/xt_TCPMSS.h
+++ b/include/uapi/linux/netfilter/xt_TCPMSS.h
diff --git a/include/linux/netfilter/xt_TCPOPTSTRIP.h b/include/uapi/linux/netfilter/xt_TCPOPTSTRIP.h
index 7157318499c2..7157318499c2 100644
--- a/include/linux/netfilter/xt_TCPOPTSTRIP.h
+++ b/include/uapi/linux/netfilter/xt_TCPOPTSTRIP.h
diff --git a/include/linux/netfilter/xt_TEE.h b/include/uapi/linux/netfilter/xt_TEE.h
index 5c21d5c829af..5c21d5c829af 100644
--- a/include/linux/netfilter/xt_TEE.h
+++ b/include/uapi/linux/netfilter/xt_TEE.h
diff --git a/include/linux/netfilter/xt_TPROXY.h b/include/uapi/linux/netfilter/xt_TPROXY.h
index 902043c2073f..902043c2073f 100644
--- a/include/linux/netfilter/xt_TPROXY.h
+++ b/include/uapi/linux/netfilter/xt_TPROXY.h
diff --git a/include/linux/netfilter/xt_addrtype.h b/include/uapi/linux/netfilter/xt_addrtype.h
index b156baa9d55e..b156baa9d55e 100644
--- a/include/linux/netfilter/xt_addrtype.h
+++ b/include/uapi/linux/netfilter/xt_addrtype.h
diff --git a/include/linux/netfilter/xt_cluster.h b/include/uapi/linux/netfilter/xt_cluster.h
index 9b883c8fbf54..9b883c8fbf54 100644
--- a/include/linux/netfilter/xt_cluster.h
+++ b/include/uapi/linux/netfilter/xt_cluster.h
diff --git a/include/linux/netfilter/xt_comment.h b/include/uapi/linux/netfilter/xt_comment.h
index 0ea5e79f5bd7..0ea5e79f5bd7 100644
--- a/include/linux/netfilter/xt_comment.h
+++ b/include/uapi/linux/netfilter/xt_comment.h
diff --git a/include/linux/netfilter/xt_connbytes.h b/include/uapi/linux/netfilter/xt_connbytes.h
index f1d6c15bd9e3..f1d6c15bd9e3 100644
--- a/include/linux/netfilter/xt_connbytes.h
+++ b/include/uapi/linux/netfilter/xt_connbytes.h
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/uapi/linux/netfilter/xt_connlimit.h
index f1656096121e..f1656096121e 100644
--- a/include/linux/netfilter/xt_connlimit.h
+++ b/include/uapi/linux/netfilter/xt_connlimit.h
diff --git a/include/linux/netfilter/xt_connmark.h b/include/uapi/linux/netfilter/xt_connmark.h
index efc17a8305fb..efc17a8305fb 100644
--- a/include/linux/netfilter/xt_connmark.h
+++ b/include/uapi/linux/netfilter/xt_connmark.h
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/uapi/linux/netfilter/xt_conntrack.h
index e3c041d54020..e3c041d54020 100644
--- a/include/linux/netfilter/xt_conntrack.h
+++ b/include/uapi/linux/netfilter/xt_conntrack.h
diff --git a/include/linux/netfilter/xt_cpu.h b/include/uapi/linux/netfilter/xt_cpu.h
index 93c7f11d8f42..93c7f11d8f42 100644
--- a/include/linux/netfilter/xt_cpu.h
+++ b/include/uapi/linux/netfilter/xt_cpu.h
diff --git a/include/linux/netfilter/xt_dccp.h b/include/uapi/linux/netfilter/xt_dccp.h
index a579e1b6f040..a579e1b6f040 100644
--- a/include/linux/netfilter/xt_dccp.h
+++ b/include/uapi/linux/netfilter/xt_dccp.h
diff --git a/include/linux/netfilter/xt_devgroup.h b/include/uapi/linux/netfilter/xt_devgroup.h
index 1babde0ec900..1babde0ec900 100644
--- a/include/linux/netfilter/xt_devgroup.h
+++ b/include/uapi/linux/netfilter/xt_devgroup.h
diff --git a/include/linux/netfilter/xt_dscp.h b/include/uapi/linux/netfilter/xt_dscp.h
index 15f8932ad5ce..15f8932ad5ce 100644
--- a/include/linux/netfilter/xt_dscp.h
+++ b/include/uapi/linux/netfilter/xt_dscp.h
diff --git a/include/linux/netfilter/xt_ecn.h b/include/uapi/linux/netfilter/xt_ecn.h
index 7158fca364f2..7158fca364f2 100644
--- a/include/linux/netfilter/xt_ecn.h
+++ b/include/uapi/linux/netfilter/xt_ecn.h
diff --git a/include/linux/netfilter/xt_esp.h b/include/uapi/linux/netfilter/xt_esp.h
index ee6882408000..ee6882408000 100644
--- a/include/linux/netfilter/xt_esp.h
+++ b/include/uapi/linux/netfilter/xt_esp.h
diff --git a/include/uapi/linux/netfilter/xt_hashlimit.h b/include/uapi/linux/netfilter/xt_hashlimit.h
new file mode 100644
index 000000000000..cbfc43d1af68
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_hashlimit.h
@@ -0,0 +1,73 @@
1#ifndef _UAPI_XT_HASHLIMIT_H
2#define _UAPI_XT_HASHLIMIT_H
3
4#include <linux/types.h>
5
6/* timings are in milliseconds. */
7#define XT_HASHLIMIT_SCALE 10000
8/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
9 * seconds, or one packet every 59 hours.
10 */
11
12/* packet length accounting is done in 16-byte steps */
13#define XT_HASHLIMIT_BYTE_SHIFT 4
14
15/* details of this structure hidden by the implementation */
16struct xt_hashlimit_htable;
17
18enum {
19 XT_HASHLIMIT_HASH_DIP = 1 << 0,
20 XT_HASHLIMIT_HASH_DPT = 1 << 1,
21 XT_HASHLIMIT_HASH_SIP = 1 << 2,
22 XT_HASHLIMIT_HASH_SPT = 1 << 3,
23 XT_HASHLIMIT_INVERT = 1 << 4,
24 XT_HASHLIMIT_BYTES = 1 << 5,
25};
26
27struct hashlimit_cfg {
28 __u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */
29 __u32 avg; /* Average secs between packets * scale */
30 __u32 burst; /* Period multiplier for upper limit. */
31
32 /* user specified */
33 __u32 size; /* how many buckets */
34 __u32 max; /* max number of entries */
35 __u32 gc_interval; /* gc interval */
36 __u32 expire; /* when do entries expire? */
37};
38
39struct xt_hashlimit_info {
40 char name [IFNAMSIZ]; /* name */
41 struct hashlimit_cfg cfg;
42
43 /* Used internally by the kernel */
44 struct xt_hashlimit_htable *hinfo;
45 union {
46 void *ptr;
47 struct xt_hashlimit_info *master;
48 } u;
49};
50
51struct hashlimit_cfg1 {
52 __u32 mode; /* bitmask of XT_HASHLIMIT_HASH_* */
53 __u32 avg; /* Average secs between packets * scale */
54 __u32 burst; /* Period multiplier for upper limit. */
55
56 /* user specified */
57 __u32 size; /* how many buckets */
58 __u32 max; /* max number of entries */
59 __u32 gc_interval; /* gc interval */
60 __u32 expire; /* when do entries expire? */
61
62 __u8 srcmask, dstmask;
63};
64
65struct xt_hashlimit_mtinfo1 {
66 char name[IFNAMSIZ];
67 struct hashlimit_cfg1 cfg;
68
69 /* Used internally by the kernel */
70 struct xt_hashlimit_htable *hinfo __attribute__((aligned(8)));
71};
72
73#endif /* _UAPI_XT_HASHLIMIT_H */
diff --git a/include/linux/netfilter/xt_helper.h b/include/uapi/linux/netfilter/xt_helper.h
index 6b42763f999d..6b42763f999d 100644
--- a/include/linux/netfilter/xt_helper.h
+++ b/include/uapi/linux/netfilter/xt_helper.h
diff --git a/include/linux/netfilter/xt_iprange.h b/include/uapi/linux/netfilter/xt_iprange.h
index 25fd7cf851f0..25fd7cf851f0 100644
--- a/include/linux/netfilter/xt_iprange.h
+++ b/include/uapi/linux/netfilter/xt_iprange.h
diff --git a/include/linux/netfilter/xt_ipvs.h b/include/uapi/linux/netfilter/xt_ipvs.h
index eff34ac18808..eff34ac18808 100644
--- a/include/linux/netfilter/xt_ipvs.h
+++ b/include/uapi/linux/netfilter/xt_ipvs.h
diff --git a/include/linux/netfilter/xt_length.h b/include/uapi/linux/netfilter/xt_length.h
index b82ed7c4b1e0..b82ed7c4b1e0 100644
--- a/include/linux/netfilter/xt_length.h
+++ b/include/uapi/linux/netfilter/xt_length.h
diff --git a/include/linux/netfilter/xt_limit.h b/include/uapi/linux/netfilter/xt_limit.h
index bb47fc4d2ade..bb47fc4d2ade 100644
--- a/include/linux/netfilter/xt_limit.h
+++ b/include/uapi/linux/netfilter/xt_limit.h
diff --git a/include/linux/netfilter/xt_mac.h b/include/uapi/linux/netfilter/xt_mac.h
index b892cdc67e06..b892cdc67e06 100644
--- a/include/linux/netfilter/xt_mac.h
+++ b/include/uapi/linux/netfilter/xt_mac.h
diff --git a/include/linux/netfilter/xt_mark.h b/include/uapi/linux/netfilter/xt_mark.h
index ecadc40d5cde..ecadc40d5cde 100644
--- a/include/linux/netfilter/xt_mark.h
+++ b/include/uapi/linux/netfilter/xt_mark.h
diff --git a/include/linux/netfilter/xt_multiport.h b/include/uapi/linux/netfilter/xt_multiport.h
index 5b7e72dfffc5..5b7e72dfffc5 100644
--- a/include/linux/netfilter/xt_multiport.h
+++ b/include/uapi/linux/netfilter/xt_multiport.h
diff --git a/include/linux/netfilter/xt_nfacct.h b/include/uapi/linux/netfilter/xt_nfacct.h
index 3e19c8a86576..3e19c8a86576 100644
--- a/include/linux/netfilter/xt_nfacct.h
+++ b/include/uapi/linux/netfilter/xt_nfacct.h
diff --git a/include/linux/netfilter/xt_osf.h b/include/uapi/linux/netfilter/xt_osf.h
index 18afa495f973..18afa495f973 100644
--- a/include/linux/netfilter/xt_osf.h
+++ b/include/uapi/linux/netfilter/xt_osf.h
diff --git a/include/linux/netfilter/xt_owner.h b/include/uapi/linux/netfilter/xt_owner.h
index 2081761714b5..2081761714b5 100644
--- a/include/linux/netfilter/xt_owner.h
+++ b/include/uapi/linux/netfilter/xt_owner.h
diff --git a/include/uapi/linux/netfilter/xt_physdev.h b/include/uapi/linux/netfilter/xt_physdev.h
new file mode 100644
index 000000000000..db7a2982e9c0
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_physdev.h
@@ -0,0 +1,23 @@
1#ifndef _UAPI_XT_PHYSDEV_H
2#define _UAPI_XT_PHYSDEV_H
3
4#include <linux/types.h>
5
6
7#define XT_PHYSDEV_OP_IN 0x01
8#define XT_PHYSDEV_OP_OUT 0x02
9#define XT_PHYSDEV_OP_BRIDGED 0x04
10#define XT_PHYSDEV_OP_ISIN 0x08
11#define XT_PHYSDEV_OP_ISOUT 0x10
12#define XT_PHYSDEV_OP_MASK (0x20 - 1)
13
14struct xt_physdev_info {
15 char physindev[IFNAMSIZ];
16 char in_mask[IFNAMSIZ];
17 char physoutdev[IFNAMSIZ];
18 char out_mask[IFNAMSIZ];
19 __u8 invert;
20 __u8 bitmask;
21};
22
23#endif /* _UAPI_XT_PHYSDEV_H */
diff --git a/include/linux/netfilter/xt_pkttype.h b/include/uapi/linux/netfilter/xt_pkttype.h
index f265cf52faea..f265cf52faea 100644
--- a/include/linux/netfilter/xt_pkttype.h
+++ b/include/uapi/linux/netfilter/xt_pkttype.h
diff --git a/include/linux/netfilter/xt_policy.h b/include/uapi/linux/netfilter/xt_policy.h
index be8ead05c316..be8ead05c316 100644
--- a/include/linux/netfilter/xt_policy.h
+++ b/include/uapi/linux/netfilter/xt_policy.h
diff --git a/include/linux/netfilter/xt_quota.h b/include/uapi/linux/netfilter/xt_quota.h
index 9314723f39ca..9314723f39ca 100644
--- a/include/linux/netfilter/xt_quota.h
+++ b/include/uapi/linux/netfilter/xt_quota.h
diff --git a/include/linux/netfilter/xt_rateest.h b/include/uapi/linux/netfilter/xt_rateest.h
index d40a6196842a..d40a6196842a 100644
--- a/include/linux/netfilter/xt_rateest.h
+++ b/include/uapi/linux/netfilter/xt_rateest.h
diff --git a/include/linux/netfilter/xt_realm.h b/include/uapi/linux/netfilter/xt_realm.h
index d4a82ee56a02..d4a82ee56a02 100644
--- a/include/linux/netfilter/xt_realm.h
+++ b/include/uapi/linux/netfilter/xt_realm.h
diff --git a/include/linux/netfilter/xt_recent.h b/include/uapi/linux/netfilter/xt_recent.h
index 6ef36c113e89..6ef36c113e89 100644
--- a/include/linux/netfilter/xt_recent.h
+++ b/include/uapi/linux/netfilter/xt_recent.h
diff --git a/include/linux/netfilter/xt_sctp.h b/include/uapi/linux/netfilter/xt_sctp.h
index 29287be696a2..29287be696a2 100644
--- a/include/linux/netfilter/xt_sctp.h
+++ b/include/uapi/linux/netfilter/xt_sctp.h
diff --git a/include/linux/netfilter/xt_set.h b/include/uapi/linux/netfilter/xt_set.h
index e3a9978f259f..e3a9978f259f 100644
--- a/include/linux/netfilter/xt_set.h
+++ b/include/uapi/linux/netfilter/xt_set.h
diff --git a/include/linux/netfilter/xt_socket.h b/include/uapi/linux/netfilter/xt_socket.h
index 26d7217bd4f1..26d7217bd4f1 100644
--- a/include/linux/netfilter/xt_socket.h
+++ b/include/uapi/linux/netfilter/xt_socket.h
diff --git a/include/linux/netfilter/xt_state.h b/include/uapi/linux/netfilter/xt_state.h
index 7b32de886613..7b32de886613 100644
--- a/include/linux/netfilter/xt_state.h
+++ b/include/uapi/linux/netfilter/xt_state.h
diff --git a/include/linux/netfilter/xt_statistic.h b/include/uapi/linux/netfilter/xt_statistic.h
index 4e983ef0c968..4e983ef0c968 100644
--- a/include/linux/netfilter/xt_statistic.h
+++ b/include/uapi/linux/netfilter/xt_statistic.h
diff --git a/include/linux/netfilter/xt_string.h b/include/uapi/linux/netfilter/xt_string.h
index 235347c02eab..235347c02eab 100644
--- a/include/linux/netfilter/xt_string.h
+++ b/include/uapi/linux/netfilter/xt_string.h
diff --git a/include/linux/netfilter/xt_tcpmss.h b/include/uapi/linux/netfilter/xt_tcpmss.h
index fbac56b9e667..fbac56b9e667 100644
--- a/include/linux/netfilter/xt_tcpmss.h
+++ b/include/uapi/linux/netfilter/xt_tcpmss.h
diff --git a/include/linux/netfilter/xt_tcpudp.h b/include/uapi/linux/netfilter/xt_tcpudp.h
index 38aa7b399021..38aa7b399021 100644
--- a/include/linux/netfilter/xt_tcpudp.h
+++ b/include/uapi/linux/netfilter/xt_tcpudp.h
diff --git a/include/linux/netfilter/xt_time.h b/include/uapi/linux/netfilter/xt_time.h
index 095886019396..095886019396 100644
--- a/include/linux/netfilter/xt_time.h
+++ b/include/uapi/linux/netfilter/xt_time.h
diff --git a/include/linux/netfilter/xt_u32.h b/include/uapi/linux/netfilter/xt_u32.h
index 04d1bfea03c2..04d1bfea03c2 100644
--- a/include/linux/netfilter/xt_u32.h
+++ b/include/uapi/linux/netfilter/xt_u32.h
diff --git a/include/uapi/linux/netfilter_arp/Kbuild b/include/uapi/linux/netfilter_arp/Kbuild
index aafaa5aa54d4..62d5637cc0ac 100644
--- a/include/uapi/linux/netfilter_arp/Kbuild
+++ b/include/uapi/linux/netfilter_arp/Kbuild
@@ -1 +1,3 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += arp_tables.h
3header-y += arpt_mangle.h
diff --git a/include/uapi/linux/netfilter_arp/arp_tables.h b/include/uapi/linux/netfilter_arp/arp_tables.h
new file mode 100644
index 000000000000..a5a86a4db6b3
--- /dev/null
+++ b/include/uapi/linux/netfilter_arp/arp_tables.h
@@ -0,0 +1,206 @@
1/*
2 * Format of an ARP firewall descriptor
3 *
4 * src, tgt, src_mask, tgt_mask, arpop, arpop_mask are always stored in
5 * network byte order.
6 * flags are stored in host byte order (of course).
7 */
8
9#ifndef _UAPI_ARPTABLES_H
10#define _UAPI_ARPTABLES_H
11
12#include <linux/types.h>
13#include <linux/compiler.h>
14#include <linux/netfilter_arp.h>
15
16#include <linux/netfilter/x_tables.h>
17
18#ifndef __KERNEL__
19#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
20#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
21#define arpt_entry_target xt_entry_target
22#define arpt_standard_target xt_standard_target
23#define arpt_error_target xt_error_target
24#define ARPT_CONTINUE XT_CONTINUE
25#define ARPT_RETURN XT_RETURN
26#define arpt_counters_info xt_counters_info
27#define arpt_counters xt_counters
28#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
29#define ARPT_ERROR_TARGET XT_ERROR_TARGET
30#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
31 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
32#endif
33
34#define ARPT_DEV_ADDR_LEN_MAX 16
35
36struct arpt_devaddr_info {
37 char addr[ARPT_DEV_ADDR_LEN_MAX];
38 char mask[ARPT_DEV_ADDR_LEN_MAX];
39};
40
41/* Yes, Virginia, you have to zero the padding. */
42struct arpt_arp {
43 /* Source and target IP addr */
44 struct in_addr src, tgt;
45 /* Mask for src and target IP addr */
46 struct in_addr smsk, tmsk;
47
48 /* Device hw address length, src+target device addresses */
49 __u8 arhln, arhln_mask;
50 struct arpt_devaddr_info src_devaddr;
51 struct arpt_devaddr_info tgt_devaddr;
52
53 /* ARP operation code. */
54 __be16 arpop, arpop_mask;
55
56 /* ARP hardware address and protocol address format. */
57 __be16 arhrd, arhrd_mask;
58 __be16 arpro, arpro_mask;
59
60 /* The protocol address length is only accepted if it is 4
61 * so there is no use in offering a way to do filtering on it.
62 */
63
64 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
65 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
66
67 /* Flags word */
68 __u8 flags;
69 /* Inverse flags */
70 __u16 invflags;
71};
72
73/* Values for "flag" field in struct arpt_ip (general arp structure).
74 * No flags defined yet.
75 */
76#define ARPT_F_MASK 0x00 /* All possible flag bits mask. */
77
78/* Values for "inv" field in struct arpt_arp. */
79#define ARPT_INV_VIA_IN 0x0001 /* Invert the sense of IN IFACE. */
80#define ARPT_INV_VIA_OUT 0x0002 /* Invert the sense of OUT IFACE */
81#define ARPT_INV_SRCIP 0x0004 /* Invert the sense of SRC IP. */
82#define ARPT_INV_TGTIP 0x0008 /* Invert the sense of TGT IP. */
83#define ARPT_INV_SRCDEVADDR 0x0010 /* Invert the sense of SRC DEV ADDR. */
84#define ARPT_INV_TGTDEVADDR 0x0020 /* Invert the sense of TGT DEV ADDR. */
85#define ARPT_INV_ARPOP 0x0040 /* Invert the sense of ARP OP. */
86#define ARPT_INV_ARPHRD 0x0080 /* Invert the sense of ARP HRD. */
87#define ARPT_INV_ARPPRO 0x0100 /* Invert the sense of ARP PRO. */
88#define ARPT_INV_ARPHLN 0x0200 /* Invert the sense of ARP HLN. */
89#define ARPT_INV_MASK 0x03FF /* All possible flag bits mask. */
90
91/* This structure defines each of the firewall rules. Consists of 3
92 parts which are 1) general ARP header stuff 2) match specific
93 stuff 3) the target to perform if the rule matches */
94struct arpt_entry
95{
96 struct arpt_arp arp;
97
98 /* Size of arpt_entry + matches */
99 __u16 target_offset;
100 /* Size of arpt_entry + matches + target */
101 __u16 next_offset;
102
103 /* Back pointer */
104 unsigned int comefrom;
105
106 /* Packet and byte counters. */
107 struct xt_counters counters;
108
109 /* The matches (if any), then the target. */
110 unsigned char elems[0];
111};
112
113/*
114 * New IP firewall options for [gs]etsockopt at the RAW IP level.
115 * Unlike BSD Linux inherits IP options so you don't have to use a raw
116 * socket for this. Instead we check rights in the calls.
117 *
118 * ATTENTION: check linux/in.h before adding new number here.
119 */
120#define ARPT_BASE_CTL 96
121
122#define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
123#define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
124#define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
125
126#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
127#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
128/* #define ARPT_SO_GET_REVISION_MATCH (APRT_BASE_CTL + 2) */
129#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
130#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
131
132/* The argument to ARPT_SO_GET_INFO */
133struct arpt_getinfo {
134 /* Which table: caller fills this in. */
135 char name[XT_TABLE_MAXNAMELEN];
136
137 /* Kernel fills these in. */
138 /* Which hook entry points are valid: bitmask */
139 unsigned int valid_hooks;
140
141 /* Hook entry points: one per netfilter hook. */
142 unsigned int hook_entry[NF_ARP_NUMHOOKS];
143
144 /* Underflow points. */
145 unsigned int underflow[NF_ARP_NUMHOOKS];
146
147 /* Number of entries */
148 unsigned int num_entries;
149
150 /* Size of entries. */
151 unsigned int size;
152};
153
154/* The argument to ARPT_SO_SET_REPLACE. */
155struct arpt_replace {
156 /* Which table. */
157 char name[XT_TABLE_MAXNAMELEN];
158
159 /* Which hook entry points are valid: bitmask. You can't
160 change this. */
161 unsigned int valid_hooks;
162
163 /* Number of entries */
164 unsigned int num_entries;
165
166 /* Total size of new entries */
167 unsigned int size;
168
169 /* Hook entry points. */
170 unsigned int hook_entry[NF_ARP_NUMHOOKS];
171
172 /* Underflow points. */
173 unsigned int underflow[NF_ARP_NUMHOOKS];
174
175 /* Information about old entries: */
176 /* Number of counters (must be equal to current number of entries). */
177 unsigned int num_counters;
178 /* The old entries' counters. */
179 struct xt_counters __user *counters;
180
181 /* The entries (hang off end: not really an array). */
182 struct arpt_entry entries[0];
183};
184
185/* The argument to ARPT_SO_GET_ENTRIES. */
186struct arpt_get_entries {
187 /* Which table: user fills this in. */
188 char name[XT_TABLE_MAXNAMELEN];
189
190 /* User fills this in: total entry size. */
191 unsigned int size;
192
193 /* The entries. */
194 struct arpt_entry entrytable[0];
195};
196
197/* Helper functions */
198static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e)
199{
200 return (void *)e + e->target_offset;
201}
202
203/*
204 * Main firewall chains definitions and global var's definitions.
205 */
206#endif /* _UAPI_ARPTABLES_H */
diff --git a/include/linux/netfilter_arp/arpt_mangle.h b/include/uapi/linux/netfilter_arp/arpt_mangle.h
index 250f502902bb..250f502902bb 100644
--- a/include/linux/netfilter_arp/arpt_mangle.h
+++ b/include/uapi/linux/netfilter_arp/arpt_mangle.h
diff --git a/include/uapi/linux/netfilter_bridge/Kbuild b/include/uapi/linux/netfilter_bridge/Kbuild
index aafaa5aa54d4..348717c3a22f 100644
--- a/include/uapi/linux/netfilter_bridge/Kbuild
+++ b/include/uapi/linux/netfilter_bridge/Kbuild
@@ -1 +1,19 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += ebt_802_3.h
3header-y += ebt_among.h
4header-y += ebt_arp.h
5header-y += ebt_arpreply.h
6header-y += ebt_ip.h
7header-y += ebt_ip6.h
8header-y += ebt_limit.h
9header-y += ebt_log.h
10header-y += ebt_mark_m.h
11header-y += ebt_mark_t.h
12header-y += ebt_nat.h
13header-y += ebt_nflog.h
14header-y += ebt_pkttype.h
15header-y += ebt_redirect.h
16header-y += ebt_stp.h
17header-y += ebt_ulog.h
18header-y += ebt_vlan.h
19header-y += ebtables.h
diff --git a/include/uapi/linux/netfilter_bridge/ebt_802_3.h b/include/uapi/linux/netfilter_bridge/ebt_802_3.h
new file mode 100644
index 000000000000..5bf84912a082
--- /dev/null
+++ b/include/uapi/linux/netfilter_bridge/ebt_802_3.h
@@ -0,0 +1,62 @@
1#ifndef _UAPI__LINUX_BRIDGE_EBT_802_3_H
2#define _UAPI__LINUX_BRIDGE_EBT_802_3_H
3
4#include <linux/types.h>
5
6#define EBT_802_3_SAP 0x01
7#define EBT_802_3_TYPE 0x02
8
9#define EBT_802_3_MATCH "802_3"
10
11/*
12 * If frame has DSAP/SSAP value 0xaa you must check the SNAP type
13 * to discover what kind of packet we're carrying.
14 */
15#define CHECK_TYPE 0xaa
16
17/*
18 * Control field may be one or two bytes. If the first byte has
19 * the value 0x03 then the entire length is one byte, otherwise it is two.
20 * One byte controls are used in Unnumbered Information frames.
21 * Two byte controls are used in Numbered Information frames.
22 */
23#define IS_UI 0x03
24
25#define EBT_802_3_MASK (EBT_802_3_SAP | EBT_802_3_TYPE | EBT_802_3)
26
27/* ui has one byte ctrl, ni has two */
28struct hdr_ui {
29 __u8 dsap;
30 __u8 ssap;
31 __u8 ctrl;
32 __u8 orig[3];
33 __be16 type;
34};
35
36struct hdr_ni {
37 __u8 dsap;
38 __u8 ssap;
39 __be16 ctrl;
40 __u8 orig[3];
41 __be16 type;
42};
43
44struct ebt_802_3_hdr {
45 __u8 daddr[6];
46 __u8 saddr[6];
47 __be16 len;
48 union {
49 struct hdr_ui ui;
50 struct hdr_ni ni;
51 } llc;
52};
53
54
55struct ebt_802_3_info {
56 __u8 sap;
57 __be16 type;
58 __u8 bitmask;
59 __u8 invflags;
60};
61
62#endif /* _UAPI__LINUX_BRIDGE_EBT_802_3_H */
diff --git a/include/linux/netfilter_bridge/ebt_among.h b/include/uapi/linux/netfilter_bridge/ebt_among.h
index bd4e3ad0b706..bd4e3ad0b706 100644
--- a/include/linux/netfilter_bridge/ebt_among.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_among.h
diff --git a/include/linux/netfilter_bridge/ebt_arp.h b/include/uapi/linux/netfilter_bridge/ebt_arp.h
index 522f3e427f49..522f3e427f49 100644
--- a/include/linux/netfilter_bridge/ebt_arp.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_arp.h
diff --git a/include/linux/netfilter_bridge/ebt_arpreply.h b/include/uapi/linux/netfilter_bridge/ebt_arpreply.h
index 7e77896e1fbf..7e77896e1fbf 100644
--- a/include/linux/netfilter_bridge/ebt_arpreply.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_arpreply.h
diff --git a/include/linux/netfilter_bridge/ebt_ip.h b/include/uapi/linux/netfilter_bridge/ebt_ip.h
index c4bbc41b0ea4..c4bbc41b0ea4 100644
--- a/include/linux/netfilter_bridge/ebt_ip.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_ip.h
diff --git a/include/linux/netfilter_bridge/ebt_ip6.h b/include/uapi/linux/netfilter_bridge/ebt_ip6.h
index 42b889682721..42b889682721 100644
--- a/include/linux/netfilter_bridge/ebt_ip6.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_ip6.h
diff --git a/include/linux/netfilter_bridge/ebt_limit.h b/include/uapi/linux/netfilter_bridge/ebt_limit.h
index 66d80b30ba0e..66d80b30ba0e 100644
--- a/include/linux/netfilter_bridge/ebt_limit.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_limit.h
diff --git a/include/linux/netfilter_bridge/ebt_log.h b/include/uapi/linux/netfilter_bridge/ebt_log.h
index 7e7f1d1fe494..7e7f1d1fe494 100644
--- a/include/linux/netfilter_bridge/ebt_log.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_log.h
diff --git a/include/linux/netfilter_bridge/ebt_mark_m.h b/include/uapi/linux/netfilter_bridge/ebt_mark_m.h
index 410f9e5a71d4..410f9e5a71d4 100644
--- a/include/linux/netfilter_bridge/ebt_mark_m.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_mark_m.h
diff --git a/include/linux/netfilter_bridge/ebt_mark_t.h b/include/uapi/linux/netfilter_bridge/ebt_mark_t.h
index 7d5a268a4311..7d5a268a4311 100644
--- a/include/linux/netfilter_bridge/ebt_mark_t.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_mark_t.h
diff --git a/include/linux/netfilter_bridge/ebt_nat.h b/include/uapi/linux/netfilter_bridge/ebt_nat.h
index 5e74e3b03bd6..5e74e3b03bd6 100644
--- a/include/linux/netfilter_bridge/ebt_nat.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_nat.h
diff --git a/include/linux/netfilter_bridge/ebt_nflog.h b/include/uapi/linux/netfilter_bridge/ebt_nflog.h
index df829fce9125..df829fce9125 100644
--- a/include/linux/netfilter_bridge/ebt_nflog.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_nflog.h
diff --git a/include/linux/netfilter_bridge/ebt_pkttype.h b/include/uapi/linux/netfilter_bridge/ebt_pkttype.h
index c241badcd036..c241badcd036 100644
--- a/include/linux/netfilter_bridge/ebt_pkttype.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_pkttype.h
diff --git a/include/linux/netfilter_bridge/ebt_redirect.h b/include/uapi/linux/netfilter_bridge/ebt_redirect.h
index dd9622ce8488..dd9622ce8488 100644
--- a/include/linux/netfilter_bridge/ebt_redirect.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_redirect.h
diff --git a/include/linux/netfilter_bridge/ebt_stp.h b/include/uapi/linux/netfilter_bridge/ebt_stp.h
index 1025b9f5fb7d..1025b9f5fb7d 100644
--- a/include/linux/netfilter_bridge/ebt_stp.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_stp.h
diff --git a/include/linux/netfilter_bridge/ebt_ulog.h b/include/uapi/linux/netfilter_bridge/ebt_ulog.h
index 89a6becb5269..89a6becb5269 100644
--- a/include/linux/netfilter_bridge/ebt_ulog.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_ulog.h
diff --git a/include/linux/netfilter_bridge/ebt_vlan.h b/include/uapi/linux/netfilter_bridge/ebt_vlan.h
index 967d1d5cf98d..967d1d5cf98d 100644
--- a/include/linux/netfilter_bridge/ebt_vlan.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_vlan.h
diff --git a/include/uapi/linux/netfilter_bridge/ebtables.h b/include/uapi/linux/netfilter_bridge/ebtables.h
new file mode 100644
index 000000000000..ba993360dbe9
--- /dev/null
+++ b/include/uapi/linux/netfilter_bridge/ebtables.h
@@ -0,0 +1,268 @@
1/*
2 * ebtables
3 *
4 * Authors:
5 * Bart De Schuymer <bdschuym@pandora.be>
6 *
7 * ebtables.c,v 2.0, April, 2002
8 *
9 * This code is stongly inspired on the iptables code which is
10 * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
11 */
12
13#ifndef _UAPI__LINUX_BRIDGE_EFF_H
14#define _UAPI__LINUX_BRIDGE_EFF_H
15#include <linux/if.h>
16#include <linux/netfilter_bridge.h>
17#include <linux/if_ether.h>
18
19#define EBT_TABLE_MAXNAMELEN 32
20#define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN
21#define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN
22
23/* verdicts >0 are "branches" */
24#define EBT_ACCEPT -1
25#define EBT_DROP -2
26#define EBT_CONTINUE -3
27#define EBT_RETURN -4
28#define NUM_STANDARD_TARGETS 4
29/* ebtables target modules store the verdict inside an int. We can
30 * reclaim a part of this int for backwards compatible extensions.
31 * The 4 lsb are more than enough to store the verdict. */
32#define EBT_VERDICT_BITS 0x0000000F
33
34struct xt_match;
35struct xt_target;
36
37struct ebt_counter {
38 uint64_t pcnt;
39 uint64_t bcnt;
40};
41
42struct ebt_replace {
43 char name[EBT_TABLE_MAXNAMELEN];
44 unsigned int valid_hooks;
45 /* nr of rules in the table */
46 unsigned int nentries;
47 /* total size of the entries */
48 unsigned int entries_size;
49 /* start of the chains */
50 struct ebt_entries __user *hook_entry[NF_BR_NUMHOOKS];
51 /* nr of counters userspace expects back */
52 unsigned int num_counters;
53 /* where the kernel will put the old counters */
54 struct ebt_counter __user *counters;
55 char __user *entries;
56};
57
58struct ebt_replace_kernel {
59 char name[EBT_TABLE_MAXNAMELEN];
60 unsigned int valid_hooks;
61 /* nr of rules in the table */
62 unsigned int nentries;
63 /* total size of the entries */
64 unsigned int entries_size;
65 /* start of the chains */
66 struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
67 /* nr of counters userspace expects back */
68 unsigned int num_counters;
69 /* where the kernel will put the old counters */
70 struct ebt_counter *counters;
71 char *entries;
72};
73
74struct ebt_entries {
75 /* this field is always set to zero
76 * See EBT_ENTRY_OR_ENTRIES.
77 * Must be same size as ebt_entry.bitmask */
78 unsigned int distinguisher;
79 /* the chain name */
80 char name[EBT_CHAIN_MAXNAMELEN];
81 /* counter offset for this chain */
82 unsigned int counter_offset;
83 /* one standard (accept, drop, return) per hook */
84 int policy;
85 /* nr. of entries */
86 unsigned int nentries;
87 /* entry list */
88 char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
89};
90
91/* used for the bitmask of struct ebt_entry */
92
93/* This is a hack to make a difference between an ebt_entry struct and an
94 * ebt_entries struct when traversing the entries from start to end.
95 * Using this simplifies the code a lot, while still being able to use
96 * ebt_entries.
97 * Contrary, iptables doesn't use something like ebt_entries and therefore uses
98 * different techniques for naming the policy and such. So, iptables doesn't
99 * need a hack like this.
100 */
101#define EBT_ENTRY_OR_ENTRIES 0x01
102/* these are the normal masks */
103#define EBT_NOPROTO 0x02
104#define EBT_802_3 0x04
105#define EBT_SOURCEMAC 0x08
106#define EBT_DESTMAC 0x10
107#define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC \
108 | EBT_ENTRY_OR_ENTRIES)
109
110#define EBT_IPROTO 0x01
111#define EBT_IIN 0x02
112#define EBT_IOUT 0x04
113#define EBT_ISOURCE 0x8
114#define EBT_IDEST 0x10
115#define EBT_ILOGICALIN 0x20
116#define EBT_ILOGICALOUT 0x40
117#define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \
118 | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST)
119
120struct ebt_entry_match {
121 union {
122 char name[EBT_FUNCTION_MAXNAMELEN];
123 struct xt_match *match;
124 } u;
125 /* size of data */
126 unsigned int match_size;
127 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
128};
129
130struct ebt_entry_watcher {
131 union {
132 char name[EBT_FUNCTION_MAXNAMELEN];
133 struct xt_target *watcher;
134 } u;
135 /* size of data */
136 unsigned int watcher_size;
137 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
138};
139
140struct ebt_entry_target {
141 union {
142 char name[EBT_FUNCTION_MAXNAMELEN];
143 struct xt_target *target;
144 } u;
145 /* size of data */
146 unsigned int target_size;
147 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
148};
149
150#define EBT_STANDARD_TARGET "standard"
151struct ebt_standard_target {
152 struct ebt_entry_target target;
153 int verdict;
154};
155
156/* one entry */
157struct ebt_entry {
158 /* this needs to be the first field */
159 unsigned int bitmask;
160 unsigned int invflags;
161 __be16 ethproto;
162 /* the physical in-dev */
163 char in[IFNAMSIZ];
164 /* the logical in-dev */
165 char logical_in[IFNAMSIZ];
166 /* the physical out-dev */
167 char out[IFNAMSIZ];
168 /* the logical out-dev */
169 char logical_out[IFNAMSIZ];
170 unsigned char sourcemac[ETH_ALEN];
171 unsigned char sourcemsk[ETH_ALEN];
172 unsigned char destmac[ETH_ALEN];
173 unsigned char destmsk[ETH_ALEN];
174 /* sizeof ebt_entry + matches */
175 unsigned int watchers_offset;
176 /* sizeof ebt_entry + matches + watchers */
177 unsigned int target_offset;
178 /* sizeof ebt_entry + matches + watchers + target */
179 unsigned int next_offset;
180 unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
181};
182
183/* {g,s}etsockopt numbers */
184#define EBT_BASE_CTL 128
185
186#define EBT_SO_SET_ENTRIES (EBT_BASE_CTL)
187#define EBT_SO_SET_COUNTERS (EBT_SO_SET_ENTRIES+1)
188#define EBT_SO_SET_MAX (EBT_SO_SET_COUNTERS+1)
189
190#define EBT_SO_GET_INFO (EBT_BASE_CTL)
191#define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO+1)
192#define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES+1)
193#define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1)
194#define EBT_SO_GET_MAX (EBT_SO_GET_INIT_ENTRIES+1)
195
196
197/* blatently stolen from ip_tables.h
198 * fn returns 0 to continue iteration */
199#define EBT_MATCH_ITERATE(e, fn, args...) \
200({ \
201 unsigned int __i; \
202 int __ret = 0; \
203 struct ebt_entry_match *__match; \
204 \
205 for (__i = sizeof(struct ebt_entry); \
206 __i < (e)->watchers_offset; \
207 __i += __match->match_size + \
208 sizeof(struct ebt_entry_match)) { \
209 __match = (void *)(e) + __i; \
210 \
211 __ret = fn(__match , ## args); \
212 if (__ret != 0) \
213 break; \
214 } \
215 if (__ret == 0) { \
216 if (__i != (e)->watchers_offset) \
217 __ret = -EINVAL; \
218 } \
219 __ret; \
220})
221
222#define EBT_WATCHER_ITERATE(e, fn, args...) \
223({ \
224 unsigned int __i; \
225 int __ret = 0; \
226 struct ebt_entry_watcher *__watcher; \
227 \
228 for (__i = e->watchers_offset; \
229 __i < (e)->target_offset; \
230 __i += __watcher->watcher_size + \
231 sizeof(struct ebt_entry_watcher)) { \
232 __watcher = (void *)(e) + __i; \
233 \
234 __ret = fn(__watcher , ## args); \
235 if (__ret != 0) \
236 break; \
237 } \
238 if (__ret == 0) { \
239 if (__i != (e)->target_offset) \
240 __ret = -EINVAL; \
241 } \
242 __ret; \
243})
244
245#define EBT_ENTRY_ITERATE(entries, size, fn, args...) \
246({ \
247 unsigned int __i; \
248 int __ret = 0; \
249 struct ebt_entry *__entry; \
250 \
251 for (__i = 0; __i < (size);) { \
252 __entry = (void *)(entries) + __i; \
253 __ret = fn(__entry , ## args); \
254 if (__ret != 0) \
255 break; \
256 if (__entry->bitmask != 0) \
257 __i += __entry->next_offset; \
258 else \
259 __i += sizeof(struct ebt_entries); \
260 } \
261 if (__ret == 0) { \
262 if (__i != (size)) \
263 __ret = -EINVAL; \
264 } \
265 __ret; \
266})
267
268#endif /* _UAPI__LINUX_BRIDGE_EFF_H */
diff --git a/include/uapi/linux/netfilter_ipv4/Kbuild b/include/uapi/linux/netfilter_ipv4/Kbuild
index aafaa5aa54d4..fb008437dde1 100644
--- a/include/uapi/linux/netfilter_ipv4/Kbuild
+++ b/include/uapi/linux/netfilter_ipv4/Kbuild
@@ -1 +1,11 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += ip_tables.h
3header-y += ipt_CLUSTERIP.h
4header-y += ipt_ECN.h
5header-y += ipt_LOG.h
6header-y += ipt_REJECT.h
7header-y += ipt_TTL.h
8header-y += ipt_ULOG.h
9header-y += ipt_ah.h
10header-y += ipt_ecn.h
11header-y += ipt_ttl.h
diff --git a/include/uapi/linux/netfilter_ipv4/ip_tables.h b/include/uapi/linux/netfilter_ipv4/ip_tables.h
new file mode 100644
index 000000000000..f1e6ef256034
--- /dev/null
+++ b/include/uapi/linux/netfilter_ipv4/ip_tables.h
@@ -0,0 +1,229 @@
1/*
2 * 25-Jul-1998 Major changes to allow for ip chain table
3 *
4 * 3-Jan-2000 Named tables to allow packet selection for different uses.
5 */
6
7/*
8 * Format of an IP firewall descriptor
9 *
10 * src, dst, src_mask, dst_mask are always stored in network byte order.
11 * flags are stored in host byte order (of course).
12 * Port numbers are stored in HOST byte order.
13 */
14
15#ifndef _UAPI_IPTABLES_H
16#define _UAPI_IPTABLES_H
17
18#include <linux/types.h>
19#include <linux/compiler.h>
20#include <linux/netfilter_ipv4.h>
21
22#include <linux/netfilter/x_tables.h>
23
24#ifndef __KERNEL__
25#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
26#define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
27#define ipt_match xt_match
28#define ipt_target xt_target
29#define ipt_table xt_table
30#define ipt_get_revision xt_get_revision
31#define ipt_entry_match xt_entry_match
32#define ipt_entry_target xt_entry_target
33#define ipt_standard_target xt_standard_target
34#define ipt_error_target xt_error_target
35#define ipt_counters xt_counters
36#define IPT_CONTINUE XT_CONTINUE
37#define IPT_RETURN XT_RETURN
38
39/* This group is older than old (iptables < v1.4.0-rc1~89) */
40#include <linux/netfilter/xt_tcpudp.h>
41#define ipt_udp xt_udp
42#define ipt_tcp xt_tcp
43#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
44#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
45#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
46#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
47#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
48#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
49#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
50#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
51
52/* The argument to IPT_SO_ADD_COUNTERS. */
53#define ipt_counters_info xt_counters_info
54/* Standard return verdict, or do jump. */
55#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
56/* Error verdict. */
57#define IPT_ERROR_TARGET XT_ERROR_TARGET
58
59/* fn returns 0 to continue iteration */
60#define IPT_MATCH_ITERATE(e, fn, args...) \
61 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
62
63/* fn returns 0 to continue iteration */
64#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
65 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
66#endif
67
68/* Yes, Virginia, you have to zero the padding. */
69struct ipt_ip {
70 /* Source and destination IP addr */
71 struct in_addr src, dst;
72 /* Mask for src and dest IP addr */
73 struct in_addr smsk, dmsk;
74 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
75 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
76
77 /* Protocol, 0 = ANY */
78 __u16 proto;
79
80 /* Flags word */
81 __u8 flags;
82 /* Inverse flags */
83 __u8 invflags;
84};
85
86/* Values for "flag" field in struct ipt_ip (general ip structure). */
87#define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */
88#define IPT_F_GOTO 0x02 /* Set if jump is a goto */
89#define IPT_F_MASK 0x03 /* All possible flag bits mask. */
90
91/* Values for "inv" field in struct ipt_ip. */
92#define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
93#define IPT_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
94#define IPT_INV_TOS 0x04 /* Invert the sense of TOS. */
95#define IPT_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
96#define IPT_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
97#define IPT_INV_FRAG 0x20 /* Invert the sense of FRAG. */
98#define IPT_INV_PROTO XT_INV_PROTO
99#define IPT_INV_MASK 0x7F /* All possible flag bits mask. */
100
101/* This structure defines each of the firewall rules. Consists of 3
102 parts which are 1) general IP header stuff 2) match specific
103 stuff 3) the target to perform if the rule matches */
104struct ipt_entry {
105 struct ipt_ip ip;
106
107 /* Mark with fields that we care about. */
108 unsigned int nfcache;
109
110 /* Size of ipt_entry + matches */
111 __u16 target_offset;
112 /* Size of ipt_entry + matches + target */
113 __u16 next_offset;
114
115 /* Back pointer */
116 unsigned int comefrom;
117
118 /* Packet and byte counters. */
119 struct xt_counters counters;
120
121 /* The matches (if any), then the target. */
122 unsigned char elems[0];
123};
124
125/*
126 * New IP firewall options for [gs]etsockopt at the RAW IP level.
127 * Unlike BSD Linux inherits IP options so you don't have to use a raw
128 * socket for this. Instead we check rights in the calls.
129 *
130 * ATTENTION: check linux/in.h before adding new number here.
131 */
132#define IPT_BASE_CTL 64
133
134#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
135#define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1)
136#define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS
137
138#define IPT_SO_GET_INFO (IPT_BASE_CTL)
139#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
140#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
141#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
142#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
143
144/* ICMP matching stuff */
145struct ipt_icmp {
146 __u8 type; /* type to match */
147 __u8 code[2]; /* range of code */
148 __u8 invflags; /* Inverse flags */
149};
150
151/* Values for "inv" field for struct ipt_icmp. */
152#define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */
153
154/* The argument to IPT_SO_GET_INFO */
155struct ipt_getinfo {
156 /* Which table: caller fills this in. */
157 char name[XT_TABLE_MAXNAMELEN];
158
159 /* Kernel fills these in. */
160 /* Which hook entry points are valid: bitmask */
161 unsigned int valid_hooks;
162
163 /* Hook entry points: one per netfilter hook. */
164 unsigned int hook_entry[NF_INET_NUMHOOKS];
165
166 /* Underflow points. */
167 unsigned int underflow[NF_INET_NUMHOOKS];
168
169 /* Number of entries */
170 unsigned int num_entries;
171
172 /* Size of entries. */
173 unsigned int size;
174};
175
176/* The argument to IPT_SO_SET_REPLACE. */
177struct ipt_replace {
178 /* Which table. */
179 char name[XT_TABLE_MAXNAMELEN];
180
181 /* Which hook entry points are valid: bitmask. You can't
182 change this. */
183 unsigned int valid_hooks;
184
185 /* Number of entries */
186 unsigned int num_entries;
187
188 /* Total size of new entries */
189 unsigned int size;
190
191 /* Hook entry points. */
192 unsigned int hook_entry[NF_INET_NUMHOOKS];
193
194 /* Underflow points. */
195 unsigned int underflow[NF_INET_NUMHOOKS];
196
197 /* Information about old entries: */
198 /* Number of counters (must be equal to current number of entries). */
199 unsigned int num_counters;
200 /* The old entries' counters. */
201 struct xt_counters __user *counters;
202
203 /* The entries (hang off end: not really an array). */
204 struct ipt_entry entries[0];
205};
206
207/* The argument to IPT_SO_GET_ENTRIES. */
208struct ipt_get_entries {
209 /* Which table: user fills this in. */
210 char name[XT_TABLE_MAXNAMELEN];
211
212 /* User fills this in: total entry size. */
213 unsigned int size;
214
215 /* The entries. */
216 struct ipt_entry entrytable[0];
217};
218
219/* Helper functions */
220static __inline__ struct xt_entry_target *
221ipt_get_target(struct ipt_entry *e)
222{
223 return (void *)e + e->target_offset;
224}
225
226/*
227 * Main firewall chains definitions and global var's definitions.
228 */
229#endif /* _UAPI_IPTABLES_H */
diff --git a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
index c6a204c97047..c6a204c97047 100644
--- a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
diff --git a/include/linux/netfilter_ipv4/ipt_ECN.h b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h
index bb88d5315a4d..bb88d5315a4d 100644
--- a/include/linux/netfilter_ipv4/ipt_ECN.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/uapi/linux/netfilter_ipv4/ipt_LOG.h
index 5d8152077d71..5d8152077d71 100644
--- a/include/linux/netfilter_ipv4/ipt_LOG.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_LOG.h
diff --git a/include/linux/netfilter_ipv4/ipt_REJECT.h b/include/uapi/linux/netfilter_ipv4/ipt_REJECT.h
index 4293a1ad1b01..4293a1ad1b01 100644
--- a/include/linux/netfilter_ipv4/ipt_REJECT.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_REJECT.h
diff --git a/include/linux/netfilter_ipv4/ipt_TTL.h b/include/uapi/linux/netfilter_ipv4/ipt_TTL.h
index f6ac169d92f9..f6ac169d92f9 100644
--- a/include/linux/netfilter_ipv4/ipt_TTL.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_TTL.h
diff --git a/include/linux/netfilter_ipv4/ipt_ULOG.h b/include/uapi/linux/netfilter_ipv4/ipt_ULOG.h
index 417aad280bcc..417aad280bcc 100644
--- a/include/linux/netfilter_ipv4/ipt_ULOG.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_ULOG.h
diff --git a/include/linux/netfilter_ipv4/ipt_ah.h b/include/uapi/linux/netfilter_ipv4/ipt_ah.h
index 4e02bb0119e3..4e02bb0119e3 100644
--- a/include/linux/netfilter_ipv4/ipt_ah.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_ah.h
diff --git a/include/linux/netfilter_ipv4/ipt_ecn.h b/include/uapi/linux/netfilter_ipv4/ipt_ecn.h
index 0e0c063dbf60..0e0c063dbf60 100644
--- a/include/linux/netfilter_ipv4/ipt_ecn.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_ecn.h
diff --git a/include/linux/netfilter_ipv4/ipt_ttl.h b/include/uapi/linux/netfilter_ipv4/ipt_ttl.h
index 37bee4442486..37bee4442486 100644
--- a/include/linux/netfilter_ipv4/ipt_ttl.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_ttl.h
diff --git a/include/uapi/linux/netfilter_ipv6/Kbuild b/include/uapi/linux/netfilter_ipv6/Kbuild
index aafaa5aa54d4..75a668ca2353 100644
--- a/include/uapi/linux/netfilter_ipv6/Kbuild
+++ b/include/uapi/linux/netfilter_ipv6/Kbuild
@@ -1 +1,13 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += ip6_tables.h
3header-y += ip6t_HL.h
4header-y += ip6t_LOG.h
5header-y += ip6t_NPT.h
6header-y += ip6t_REJECT.h
7header-y += ip6t_ah.h
8header-y += ip6t_frag.h
9header-y += ip6t_hl.h
10header-y += ip6t_ipv6header.h
11header-y += ip6t_mh.h
12header-y += ip6t_opts.h
13header-y += ip6t_rt.h
diff --git a/include/uapi/linux/netfilter_ipv6/ip6_tables.h b/include/uapi/linux/netfilter_ipv6/ip6_tables.h
new file mode 100644
index 000000000000..bf1ef65cc582
--- /dev/null
+++ b/include/uapi/linux/netfilter_ipv6/ip6_tables.h
@@ -0,0 +1,267 @@
1/*
2 * 25-Jul-1998 Major changes to allow for ip chain table
3 *
4 * 3-Jan-2000 Named tables to allow packet selection for different uses.
5 */
6
7/*
8 * Format of an IP6 firewall descriptor
9 *
10 * src, dst, src_mask, dst_mask are always stored in network byte order.
11 * flags are stored in host byte order (of course).
12 * Port numbers are stored in HOST byte order.
13 */
14
15#ifndef _UAPI_IP6_TABLES_H
16#define _UAPI_IP6_TABLES_H
17
18#include <linux/types.h>
19#include <linux/compiler.h>
20#include <linux/netfilter_ipv6.h>
21
22#include <linux/netfilter/x_tables.h>
23
24#ifndef __KERNEL__
25#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
26#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
27#define ip6t_match xt_match
28#define ip6t_target xt_target
29#define ip6t_table xt_table
30#define ip6t_get_revision xt_get_revision
31#define ip6t_entry_match xt_entry_match
32#define ip6t_entry_target xt_entry_target
33#define ip6t_standard_target xt_standard_target
34#define ip6t_error_target xt_error_target
35#define ip6t_counters xt_counters
36#define IP6T_CONTINUE XT_CONTINUE
37#define IP6T_RETURN XT_RETURN
38
39/* Pre-iptables-1.4.0 */
40#include <linux/netfilter/xt_tcpudp.h>
41#define ip6t_tcp xt_tcp
42#define ip6t_udp xt_udp
43#define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
44#define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
45#define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
46#define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
47#define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
48#define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
49#define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
50#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
51
52#define ip6t_counters_info xt_counters_info
53#define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
54#define IP6T_ERROR_TARGET XT_ERROR_TARGET
55#define IP6T_MATCH_ITERATE(e, fn, args...) \
56 XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args)
57#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
58 XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args)
59#endif
60
61/* Yes, Virginia, you have to zero the padding. */
62struct ip6t_ip6 {
63 /* Source and destination IP6 addr */
64 struct in6_addr src, dst;
65 /* Mask for src and dest IP6 addr */
66 struct in6_addr smsk, dmsk;
67 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
68 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
69
70 /* Upper protocol number
71 * - The allowed value is 0 (any) or protocol number of last parsable
72 * header, which is 50 (ESP), 59 (No Next Header), 135 (MH), or
73 * the non IPv6 extension headers.
74 * - The protocol numbers of IPv6 extension headers except of ESP and
75 * MH do not match any packets.
76 * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
77 */
78 __u16 proto;
79 /* TOS to match iff flags & IP6T_F_TOS */
80 __u8 tos;
81
82 /* Flags word */
83 __u8 flags;
84 /* Inverse flags */
85 __u8 invflags;
86};
87
88/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
89#define IP6T_F_PROTO 0x01 /* Set if rule cares about upper
90 protocols */
91#define IP6T_F_TOS 0x02 /* Match the TOS. */
92#define IP6T_F_GOTO 0x04 /* Set if jump is a goto */
93#define IP6T_F_MASK 0x07 /* All possible flag bits mask. */
94
95/* Values for "inv" field in struct ip6t_ip6. */
96#define IP6T_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
97#define IP6T_INV_VIA_OUT 0x02 /* Invert the sense of OUT IFACE */
98#define IP6T_INV_TOS 0x04 /* Invert the sense of TOS. */
99#define IP6T_INV_SRCIP 0x08 /* Invert the sense of SRC IP. */
100#define IP6T_INV_DSTIP 0x10 /* Invert the sense of DST OP. */
101#define IP6T_INV_FRAG 0x20 /* Invert the sense of FRAG. */
102#define IP6T_INV_PROTO XT_INV_PROTO
103#define IP6T_INV_MASK 0x7F /* All possible flag bits mask. */
104
105/* This structure defines each of the firewall rules. Consists of 3
106 parts which are 1) general IP header stuff 2) match specific
107 stuff 3) the target to perform if the rule matches */
108struct ip6t_entry {
109 struct ip6t_ip6 ipv6;
110
111 /* Mark with fields that we care about. */
112 unsigned int nfcache;
113
114 /* Size of ipt_entry + matches */
115 __u16 target_offset;
116 /* Size of ipt_entry + matches + target */
117 __u16 next_offset;
118
119 /* Back pointer */
120 unsigned int comefrom;
121
122 /* Packet and byte counters. */
123 struct xt_counters counters;
124
125 /* The matches (if any), then the target. */
126 unsigned char elems[0];
127};
128
129/* Standard entry */
130struct ip6t_standard {
131 struct ip6t_entry entry;
132 struct xt_standard_target target;
133};
134
135struct ip6t_error {
136 struct ip6t_entry entry;
137 struct xt_error_target target;
138};
139
140#define IP6T_ENTRY_INIT(__size) \
141{ \
142 .target_offset = sizeof(struct ip6t_entry), \
143 .next_offset = (__size), \
144}
145
146#define IP6T_STANDARD_INIT(__verdict) \
147{ \
148 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \
149 .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \
150 sizeof(struct xt_standard_target)), \
151 .target.verdict = -(__verdict) - 1, \
152}
153
154#define IP6T_ERROR_INIT \
155{ \
156 .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \
157 .target = XT_TARGET_INIT(XT_ERROR_TARGET, \
158 sizeof(struct xt_error_target)), \
159 .target.errorname = "ERROR", \
160}
161
162/*
163 * New IP firewall options for [gs]etsockopt at the RAW IP level.
164 * Unlike BSD Linux inherits IP options so you don't have to use
165 * a raw socket for this. Instead we check rights in the calls.
166 *
167 * ATTENTION: check linux/in6.h before adding new number here.
168 */
169#define IP6T_BASE_CTL 64
170
171#define IP6T_SO_SET_REPLACE (IP6T_BASE_CTL)
172#define IP6T_SO_SET_ADD_COUNTERS (IP6T_BASE_CTL + 1)
173#define IP6T_SO_SET_MAX IP6T_SO_SET_ADD_COUNTERS
174
175#define IP6T_SO_GET_INFO (IP6T_BASE_CTL)
176#define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1)
177#define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 4)
178#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
179#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
180
181/* ICMP matching stuff */
182struct ip6t_icmp {
183 __u8 type; /* type to match */
184 __u8 code[2]; /* range of code */
185 __u8 invflags; /* Inverse flags */
186};
187
188/* Values for "inv" field for struct ipt_icmp. */
189#define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */
190
191/* The argument to IP6T_SO_GET_INFO */
192struct ip6t_getinfo {
193 /* Which table: caller fills this in. */
194 char name[XT_TABLE_MAXNAMELEN];
195
196 /* Kernel fills these in. */
197 /* Which hook entry points are valid: bitmask */
198 unsigned int valid_hooks;
199
200 /* Hook entry points: one per netfilter hook. */
201 unsigned int hook_entry[NF_INET_NUMHOOKS];
202
203 /* Underflow points. */
204 unsigned int underflow[NF_INET_NUMHOOKS];
205
206 /* Number of entries */
207 unsigned int num_entries;
208
209 /* Size of entries. */
210 unsigned int size;
211};
212
213/* The argument to IP6T_SO_SET_REPLACE. */
214struct ip6t_replace {
215 /* Which table. */
216 char name[XT_TABLE_MAXNAMELEN];
217
218 /* Which hook entry points are valid: bitmask. You can't
219 change this. */
220 unsigned int valid_hooks;
221
222 /* Number of entries */
223 unsigned int num_entries;
224
225 /* Total size of new entries */
226 unsigned int size;
227
228 /* Hook entry points. */
229 unsigned int hook_entry[NF_INET_NUMHOOKS];
230
231 /* Underflow points. */
232 unsigned int underflow[NF_INET_NUMHOOKS];
233
234 /* Information about old entries: */
235 /* Number of counters (must be equal to current number of entries). */
236 unsigned int num_counters;
237 /* The old entries' counters. */
238 struct xt_counters __user *counters;
239
240 /* The entries (hang off end: not really an array). */
241 struct ip6t_entry entries[0];
242};
243
244/* The argument to IP6T_SO_GET_ENTRIES. */
245struct ip6t_get_entries {
246 /* Which table: user fills this in. */
247 char name[XT_TABLE_MAXNAMELEN];
248
249 /* User fills this in: total entry size. */
250 unsigned int size;
251
252 /* The entries. */
253 struct ip6t_entry entrytable[0];
254};
255
256/* Helper functions */
257static __inline__ struct xt_entry_target *
258ip6t_get_target(struct ip6t_entry *e)
259{
260 return (void *)e + e->target_offset;
261}
262
263/*
264 * Main firewall chains definitions and global var's definitions.
265 */
266
267#endif /* _UAPI_IP6_TABLES_H */
diff --git a/include/linux/netfilter_ipv6/ip6t_HL.h b/include/uapi/linux/netfilter_ipv6/ip6t_HL.h
index ebd8ead1bb63..ebd8ead1bb63 100644
--- a/include/linux/netfilter_ipv6/ip6t_HL.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_HL.h
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/uapi/linux/netfilter_ipv6/ip6t_LOG.h
index 3dd0bc4e0735..3dd0bc4e0735 100644
--- a/include/linux/netfilter_ipv6/ip6t_LOG.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_LOG.h
diff --git a/include/linux/netfilter_ipv6/ip6t_NPT.h b/include/uapi/linux/netfilter_ipv6/ip6t_NPT.h
index f763355481b5..f763355481b5 100644
--- a/include/linux/netfilter_ipv6/ip6t_NPT.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_NPT.h
diff --git a/include/linux/netfilter_ipv6/ip6t_REJECT.h b/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h
index 205ed62e4605..205ed62e4605 100644
--- a/include/linux/netfilter_ipv6/ip6t_REJECT.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_REJECT.h
diff --git a/include/linux/netfilter_ipv6/ip6t_ah.h b/include/uapi/linux/netfilter_ipv6/ip6t_ah.h
index 5da2b65cb3ad..5da2b65cb3ad 100644
--- a/include/linux/netfilter_ipv6/ip6t_ah.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_ah.h
diff --git a/include/linux/netfilter_ipv6/ip6t_frag.h b/include/uapi/linux/netfilter_ipv6/ip6t_frag.h
index b47f61b9e082..b47f61b9e082 100644
--- a/include/linux/netfilter_ipv6/ip6t_frag.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_frag.h
diff --git a/include/linux/netfilter_ipv6/ip6t_hl.h b/include/uapi/linux/netfilter_ipv6/ip6t_hl.h
index 6e76dbc6c19a..6e76dbc6c19a 100644
--- a/include/linux/netfilter_ipv6/ip6t_hl.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_hl.h
diff --git a/include/linux/netfilter_ipv6/ip6t_ipv6header.h b/include/uapi/linux/netfilter_ipv6/ip6t_ipv6header.h
index efae3a20c214..efae3a20c214 100644
--- a/include/linux/netfilter_ipv6/ip6t_ipv6header.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_ipv6header.h
diff --git a/include/linux/netfilter_ipv6/ip6t_mh.h b/include/uapi/linux/netfilter_ipv6/ip6t_mh.h
index a7729a5025cd..a7729a5025cd 100644
--- a/include/linux/netfilter_ipv6/ip6t_mh.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_mh.h
diff --git a/include/linux/netfilter_ipv6/ip6t_opts.h b/include/uapi/linux/netfilter_ipv6/ip6t_opts.h
index 17d419a811fd..17d419a811fd 100644
--- a/include/linux/netfilter_ipv6/ip6t_opts.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_opts.h
diff --git a/include/linux/netfilter_ipv6/ip6t_rt.h b/include/uapi/linux/netfilter_ipv6/ip6t_rt.h
index 7605a5ff81cd..7605a5ff81cd 100644
--- a/include/linux/netfilter_ipv6/ip6t_rt.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_rt.h
diff --git a/include/uapi/linux/nfsd/Kbuild b/include/uapi/linux/nfsd/Kbuild
index aafaa5aa54d4..c11bc404053c 100644
--- a/include/uapi/linux/nfsd/Kbuild
+++ b/include/uapi/linux/nfsd/Kbuild
@@ -1 +1,6 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += cld.h
3header-y += debug.h
4header-y += export.h
5header-y += nfsfh.h
6header-y += stats.h
diff --git a/include/linux/nfsd/cld.h b/include/uapi/linux/nfsd/cld.h
index f14a9ab06f1f..f14a9ab06f1f 100644
--- a/include/linux/nfsd/cld.h
+++ b/include/uapi/linux/nfsd/cld.h
diff --git a/include/uapi/linux/nfsd/debug.h b/include/uapi/linux/nfsd/debug.h
new file mode 100644
index 000000000000..a6f453c740b8
--- /dev/null
+++ b/include/uapi/linux/nfsd/debug.h
@@ -0,0 +1,40 @@
1/*
2 * linux/include/linux/nfsd/debug.h
3 *
4 * Debugging-related stuff for nfsd
5 *
6 * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef _UAPILINUX_NFSD_DEBUG_H
10#define _UAPILINUX_NFSD_DEBUG_H
11
12#include <linux/sunrpc/debug.h>
13
14/*
15 * Enable debugging for nfsd.
16 * Requires RPC_DEBUG.
17 */
18#ifdef RPC_DEBUG
19# define NFSD_DEBUG 1
20#endif
21
22/*
23 * knfsd debug flags
24 */
25#define NFSDDBG_SOCK 0x0001
26#define NFSDDBG_FH 0x0002
27#define NFSDDBG_EXPORT 0x0004
28#define NFSDDBG_SVC 0x0008
29#define NFSDDBG_PROC 0x0010
30#define NFSDDBG_FILEOP 0x0020
31#define NFSDDBG_AUTH 0x0040
32#define NFSDDBG_REPCACHE 0x0080
33#define NFSDDBG_XDR 0x0100
34#define NFSDDBG_LOCKD 0x0200
35#define NFSDDBG_ALL 0x7FFF
36#define NFSDDBG_NOCHANGE 0xFFFF
37
38
39
40#endif /* _UAPILINUX_NFSD_DEBUG_H */
diff --git a/include/uapi/linux/nfsd/export.h b/include/uapi/linux/nfsd/export.h
new file mode 100644
index 000000000000..cf47c313794e
--- /dev/null
+++ b/include/uapi/linux/nfsd/export.h
@@ -0,0 +1,58 @@
1/*
2 * include/linux/nfsd/export.h
3 *
4 * Public declarations for NFS exports. The definitions for the
5 * syscall interface are in nfsctl.h
6 *
7 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
8 */
9
10#ifndef _UAPINFSD_EXPORT_H
11#define _UAPINFSD_EXPORT_H
12
13# include <linux/types.h>
14
15/*
16 * Important limits for the exports stuff.
17 */
18#define NFSCLNT_IDMAX 1024
19#define NFSCLNT_ADDRMAX 16
20#define NFSCLNT_KEYMAX 32
21
22/*
23 * Export flags.
24 */
25#define NFSEXP_READONLY 0x0001
26#define NFSEXP_INSECURE_PORT 0x0002
27#define NFSEXP_ROOTSQUASH 0x0004
28#define NFSEXP_ALLSQUASH 0x0008
29#define NFSEXP_ASYNC 0x0010
30#define NFSEXP_GATHERED_WRITES 0x0020
31/* 40 80 100 currently unused */
32#define NFSEXP_NOHIDE 0x0200
33#define NFSEXP_NOSUBTREECHECK 0x0400
34#define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */
35#define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect; no longer supported */
36#define NFSEXP_FSID 0x2000
37#define NFSEXP_CROSSMOUNT 0x4000
38#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */
39/*
40 * The NFSEXP_V4ROOT flag causes the kernel to give access only to NFSv4
41 * clients, and only to the single directory that is the root of the
42 * export; further lookup and readdir operations are treated as if every
43 * subdirectory was a mountpoint, and ignored if they are not themselves
44 * exported. This is used by nfsd and mountd to construct the NFSv4
45 * pseudofilesystem, which provides access only to paths leading to each
46 * exported filesystem.
47 */
48#define NFSEXP_V4ROOT 0x10000
49/* All flags that we claim to support. (Note we don't support NOACL.) */
50#define NFSEXP_ALLFLAGS 0x17E3F
51
52/* The flags that may vary depending on security flavor: */
53#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
54 | NFSEXP_ALLSQUASH \
55 | NFSEXP_INSECURE_PORT)
56
57
58#endif /* _UAPINFSD_EXPORT_H */
diff --git a/include/uapi/linux/nfsd/nfsfh.h b/include/uapi/linux/nfsd/nfsfh.h
new file mode 100644
index 000000000000..616e3b396476
--- /dev/null
+++ b/include/uapi/linux/nfsd/nfsfh.h
@@ -0,0 +1,122 @@
1/*
2 * include/linux/nfsd/nfsfh.h
3 *
4 * This file describes the layout of the file handles as passed
5 * over the wire.
6 *
7 * Earlier versions of knfsd used to sign file handles using keyed MD5
8 * or SHA. I've removed this code, because it doesn't give you more
9 * security than blocking external access to port 2049 on your firewall.
10 *
11 * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
12 */
13
14#ifndef _UAPI_LINUX_NFSD_FH_H
15#define _UAPI_LINUX_NFSD_FH_H
16
17#include <linux/types.h>
18#include <linux/nfs.h>
19#include <linux/nfs2.h>
20#include <linux/nfs3.h>
21#include <linux/nfs4.h>
22
23/*
24 * This is the old "dentry style" Linux NFSv2 file handle.
25 *
26 * The xino and xdev fields are currently used to transport the
27 * ino/dev of the exported inode.
28 */
29struct nfs_fhbase_old {
30 __u32 fb_dcookie; /* dentry cookie - always 0xfeebbaca */
31 __u32 fb_ino; /* our inode number */
32 __u32 fb_dirino; /* dir inode number, 0 for directories */
33 __u32 fb_dev; /* our device */
34 __u32 fb_xdev;
35 __u32 fb_xino;
36 __u32 fb_generation;
37};
38
39/*
40 * This is the new flexible, extensible style NFSv2/v3 file handle.
41 * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000
42 *
43 * The file handle starts with a sequence of four-byte words.
44 * The first word contains a version number (1) and three descriptor bytes
45 * that tell how the remaining 3 variable length fields should be handled.
46 * These three bytes are auth_type, fsid_type and fileid_type.
47 *
48 * All four-byte values are in host-byte-order.
49 *
50 * The auth_type field specifies how the filehandle can be authenticated
51 * This might allow a file to be confirmed to be in a writable part of a
52 * filetree without checking the path from it up to the root.
53 * Current values:
54 * 0 - No authentication. fb_auth is 0 bytes long
55 * Possible future values:
56 * 1 - 4 bytes taken from MD5 hash of the remainer of the file handle
57 * prefixed by a secret and with the important export flags.
58 *
59 * The fsid_type identifies how the filesystem (or export point) is
60 * encoded.
61 * Current values:
62 * 0 - 4 byte device id (ms-2-bytes major, ls-2-bytes minor), 4byte inode number
63 * NOTE: we cannot use the kdev_t device id value, because kdev_t.h
64 * says we mustn't. We must break it up and reassemble.
65 * 1 - 4 byte user specified identifier
66 * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED
67 * 3 - 4 byte device id, encoded for user-space, 4 byte inode number
68 * 4 - 4 byte inode number and 4 byte uuid
69 * 5 - 8 byte uuid
70 * 6 - 16 byte uuid
71 * 7 - 8 byte inode number and 16 byte uuid
72 *
73 * The fileid_type identified how the file within the filesystem is encoded.
74 * This is (will be) passed to, and set by, the underlying filesystem if it supports
75 * filehandle operations. The filesystem must not use the value '0' or '0xff' and may
76 * only use the values 1 and 2 as defined below:
77 * Current values:
78 * 0 - The root, or export point, of the filesystem. fb_fileid is 0 bytes.
79 * 1 - 32bit inode number, 32 bit generation number.
80 * 2 - 32bit inode number, 32 bit generation number, 32 bit parent directory inode number.
81 *
82 */
83struct nfs_fhbase_new {
84 __u8 fb_version; /* == 1, even => nfs_fhbase_old */
85 __u8 fb_auth_type;
86 __u8 fb_fsid_type;
87 __u8 fb_fileid_type;
88 __u32 fb_auth[1];
89/* __u32 fb_fsid[0]; floating */
90/* __u32 fb_fileid[0]; floating */
91};
92
93struct knfsd_fh {
94 unsigned int fh_size; /* significant for NFSv3.
95 * Points to the current size while building
96 * a new file handle
97 */
98 union {
99 struct nfs_fhbase_old fh_old;
100 __u32 fh_pad[NFS4_FHSIZE/4];
101 struct nfs_fhbase_new fh_new;
102 } fh_base;
103};
104
105#define ofh_dcookie fh_base.fh_old.fb_dcookie
106#define ofh_ino fh_base.fh_old.fb_ino
107#define ofh_dirino fh_base.fh_old.fb_dirino
108#define ofh_dev fh_base.fh_old.fb_dev
109#define ofh_xdev fh_base.fh_old.fb_xdev
110#define ofh_xino fh_base.fh_old.fb_xino
111#define ofh_generation fh_base.fh_old.fb_generation
112
113#define fh_version fh_base.fh_new.fb_version
114#define fh_fsid_type fh_base.fh_new.fb_fsid_type
115#define fh_auth_type fh_base.fh_new.fb_auth_type
116#define fh_fileid_type fh_base.fh_new.fb_fileid_type
117#define fh_auth fh_base.fh_new.fb_auth
118#define fh_fsid fh_base.fh_new.fb_auth
119
120
121
122#endif /* _UAPI_LINUX_NFSD_FH_H */
diff --git a/include/uapi/linux/nfsd/stats.h b/include/uapi/linux/nfsd/stats.h
new file mode 100644
index 000000000000..9fb7a0644263
--- /dev/null
+++ b/include/uapi/linux/nfsd/stats.h
@@ -0,0 +1,17 @@
1/*
2 * linux/include/linux/nfsd/stats.h
3 *
4 * Statistics for NFS server.
5 *
6 * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef _UAPILINUX_NFSD_STATS_H
10#define _UAPILINUX_NFSD_STATS_H
11
12#include <linux/nfs4.h>
13
14/* thread usage wraps very million seconds (approx one fortnight) */
15#define NFSD_USAGE_WRAP (HZ*1000000)
16
17#endif /* _UAPILINUX_NFSD_STATS_H */
diff --git a/include/uapi/linux/sunrpc/Kbuild b/include/uapi/linux/sunrpc/Kbuild
index aafaa5aa54d4..8e02e47c20fb 100644
--- a/include/uapi/linux/sunrpc/Kbuild
+++ b/include/uapi/linux/sunrpc/Kbuild
@@ -1 +1,2 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += debug.h
diff --git a/include/uapi/linux/sunrpc/debug.h b/include/uapi/linux/sunrpc/debug.h
new file mode 100644
index 000000000000..830e34493a8c
--- /dev/null
+++ b/include/uapi/linux/sunrpc/debug.h
@@ -0,0 +1,48 @@
1/*
2 * linux/include/linux/sunrpc/debug.h
3 *
4 * Debugging support for sunrpc module
5 *
6 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef _UAPI_LINUX_SUNRPC_DEBUG_H_
10#define _UAPI_LINUX_SUNRPC_DEBUG_H_
11
12/*
13 * RPC debug facilities
14 */
15#define RPCDBG_XPRT 0x0001
16#define RPCDBG_CALL 0x0002
17#define RPCDBG_DEBUG 0x0004
18#define RPCDBG_NFS 0x0008
19#define RPCDBG_AUTH 0x0010
20#define RPCDBG_BIND 0x0020
21#define RPCDBG_SCHED 0x0040
22#define RPCDBG_TRANS 0x0080
23#define RPCDBG_SVCXPRT 0x0100
24#define RPCDBG_SVCDSP 0x0200
25#define RPCDBG_MISC 0x0400
26#define RPCDBG_CACHE 0x0800
27#define RPCDBG_ALL 0x7fff
28
29
30/*
31 * Declarations for the sysctl debug interface, which allows to read or
32 * change the debug flags for rpc, nfs, nfsd, and lockd. Since the sunrpc
33 * module currently registers its sysctl table dynamically, the sysctl path
34 * for module FOO is <CTL_SUNRPC, CTL_FOODEBUG>.
35 */
36
37enum {
38 CTL_RPCDEBUG = 1,
39 CTL_NFSDEBUG,
40 CTL_NFSDDEBUG,
41 CTL_NLMDEBUG,
42 CTL_SLOTTABLE_UDP,
43 CTL_SLOTTABLE_TCP,
44 CTL_MIN_RESVPORT,
45 CTL_MAX_RESVPORT,
46};
47
48#endif /* _UAPI_LINUX_SUNRPC_DEBUG_H_ */
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
index aafaa5aa54d4..0623ec4e728f 100644
--- a/include/uapi/linux/tc_act/Kbuild
+++ b/include/uapi/linux/tc_act/Kbuild
@@ -1 +1,8 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += tc_csum.h
3header-y += tc_gact.h
4header-y += tc_ipt.h
5header-y += tc_mirred.h
6header-y += tc_nat.h
7header-y += tc_pedit.h
8header-y += tc_skbedit.h
diff --git a/include/linux/tc_act/tc_csum.h b/include/uapi/linux/tc_act/tc_csum.h
index a047c49a3153..a047c49a3153 100644
--- a/include/linux/tc_act/tc_csum.h
+++ b/include/uapi/linux/tc_act/tc_csum.h
diff --git a/include/linux/tc_act/tc_gact.h b/include/uapi/linux/tc_act/tc_gact.h
index f7bf94eed510..f7bf94eed510 100644
--- a/include/linux/tc_act/tc_gact.h
+++ b/include/uapi/linux/tc_act/tc_gact.h
diff --git a/include/linux/tc_act/tc_ipt.h b/include/uapi/linux/tc_act/tc_ipt.h
index a2335563d21f..a2335563d21f 100644
--- a/include/linux/tc_act/tc_ipt.h
+++ b/include/uapi/linux/tc_act/tc_ipt.h
diff --git a/include/linux/tc_act/tc_mirred.h b/include/uapi/linux/tc_act/tc_mirred.h
index 7561750e8fd6..7561750e8fd6 100644
--- a/include/linux/tc_act/tc_mirred.h
+++ b/include/uapi/linux/tc_act/tc_mirred.h
diff --git a/include/linux/tc_act/tc_nat.h b/include/uapi/linux/tc_act/tc_nat.h
index 6663aeba0b9a..6663aeba0b9a 100644
--- a/include/linux/tc_act/tc_nat.h
+++ b/include/uapi/linux/tc_act/tc_nat.h
diff --git a/include/linux/tc_act/tc_pedit.h b/include/uapi/linux/tc_act/tc_pedit.h
index 716cfabcd5b2..716cfabcd5b2 100644
--- a/include/linux/tc_act/tc_pedit.h
+++ b/include/uapi/linux/tc_act/tc_pedit.h
diff --git a/include/linux/tc_act/tc_skbedit.h b/include/uapi/linux/tc_act/tc_skbedit.h
index 7a2e910a5f08..7a2e910a5f08 100644
--- a/include/linux/tc_act/tc_skbedit.h
+++ b/include/uapi/linux/tc_act/tc_skbedit.h
diff --git a/include/uapi/linux/tc_ematch/Kbuild b/include/uapi/linux/tc_ematch/Kbuild
index aafaa5aa54d4..53fca3925535 100644
--- a/include/uapi/linux/tc_ematch/Kbuild
+++ b/include/uapi/linux/tc_ematch/Kbuild
@@ -1 +1,5 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += tc_em_cmp.h
3header-y += tc_em_meta.h
4header-y += tc_em_nbyte.h
5header-y += tc_em_text.h
diff --git a/include/linux/tc_ematch/tc_em_cmp.h b/include/uapi/linux/tc_ematch/tc_em_cmp.h
index f34bb1bae083..f34bb1bae083 100644
--- a/include/linux/tc_ematch/tc_em_cmp.h
+++ b/include/uapi/linux/tc_ematch/tc_em_cmp.h
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/uapi/linux/tc_ematch/tc_em_meta.h
index b11f8ce2d3c0..b11f8ce2d3c0 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/uapi/linux/tc_ematch/tc_em_meta.h
diff --git a/include/linux/tc_ematch/tc_em_nbyte.h b/include/uapi/linux/tc_ematch/tc_em_nbyte.h
index 7172cfb999c1..7172cfb999c1 100644
--- a/include/linux/tc_ematch/tc_em_nbyte.h
+++ b/include/uapi/linux/tc_ematch/tc_em_nbyte.h
diff --git a/include/linux/tc_ematch/tc_em_text.h b/include/uapi/linux/tc_ematch/tc_em_text.h
index 5aac4045ba88..5aac4045ba88 100644
--- a/include/linux/tc_ematch/tc_em_text.h
+++ b/include/uapi/linux/tc_ematch/tc_em_text.h
diff --git a/include/uapi/linux/wimax/Kbuild b/include/uapi/linux/wimax/Kbuild
index aafaa5aa54d4..1c97be49971f 100644
--- a/include/uapi/linux/wimax/Kbuild
+++ b/include/uapi/linux/wimax/Kbuild
@@ -1 +1,2 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += i2400m.h
diff --git a/include/linux/wimax/i2400m.h b/include/uapi/linux/wimax/i2400m.h
index 62d356153565..62d356153565 100644
--- a/include/linux/wimax/i2400m.h
+++ b/include/uapi/linux/wimax/i2400m.h
diff --git a/include/uapi/mtd/Kbuild b/include/uapi/mtd/Kbuild
index aafaa5aa54d4..5a691e10cd0e 100644
--- a/include/uapi/mtd/Kbuild
+++ b/include/uapi/mtd/Kbuild
@@ -1 +1,6 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += inftl-user.h
3header-y += mtd-abi.h
4header-y += mtd-user.h
5header-y += nftl-user.h
6header-y += ubi-user.h
diff --git a/include/mtd/inftl-user.h b/include/uapi/mtd/inftl-user.h
index 8376bd1a9e01..8376bd1a9e01 100644
--- a/include/mtd/inftl-user.h
+++ b/include/uapi/mtd/inftl-user.h
diff --git a/include/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h
index 36eace03b2ac..36eace03b2ac 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/uapi/mtd/mtd-abi.h
diff --git a/include/mtd/mtd-user.h b/include/uapi/mtd/mtd-user.h
index 83327c808c86..83327c808c86 100644
--- a/include/mtd/mtd-user.h
+++ b/include/uapi/mtd/mtd-user.h
diff --git a/include/mtd/nftl-user.h b/include/uapi/mtd/nftl-user.h
index bdeabd86ad99..bdeabd86ad99 100644
--- a/include/mtd/nftl-user.h
+++ b/include/uapi/mtd/nftl-user.h
diff --git a/include/mtd/ubi-user.h b/include/uapi/mtd/ubi-user.h
index 53cae1e11e57..53cae1e11e57 100644
--- a/include/mtd/ubi-user.h
+++ b/include/uapi/mtd/ubi-user.h
diff --git a/include/uapi/xen/Kbuild b/include/uapi/xen/Kbuild
index aafaa5aa54d4..61257cb14653 100644
--- a/include/uapi/xen/Kbuild
+++ b/include/uapi/xen/Kbuild
@@ -1 +1,3 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += evtchn.h
3header-y += privcmd.h
diff --git a/include/xen/evtchn.h b/include/uapi/xen/evtchn.h
index 14e833ee4e0b..14e833ee4e0b 100644
--- a/include/xen/evtchn.h
+++ b/include/uapi/xen/evtchn.h
diff --git a/include/xen/privcmd.h b/include/uapi/xen/privcmd.h
index a85316811d79..a85316811d79 100644
--- a/include/xen/privcmd.h
+++ b/include/uapi/xen/privcmd.h
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index a6267a2d292b..3729173b7fbc 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -48,10 +48,10 @@
48#define DISPC_IRQ_FRAMEDONEWB (1 << 23) 48#define DISPC_IRQ_FRAMEDONEWB (1 << 23)
49#define DISPC_IRQ_FRAMEDONETV (1 << 24) 49#define DISPC_IRQ_FRAMEDONETV (1 << 24)
50#define DISPC_IRQ_WBBUFFEROVERFLOW (1 << 25) 50#define DISPC_IRQ_WBBUFFEROVERFLOW (1 << 25)
51#define DISPC_IRQ_FRAMEDONE3 (1 << 26) 51#define DISPC_IRQ_SYNC_LOST3 (1 << 27)
52#define DISPC_IRQ_VSYNC3 (1 << 27) 52#define DISPC_IRQ_VSYNC3 (1 << 28)
53#define DISPC_IRQ_ACBIAS_COUNT_STAT3 (1 << 28) 53#define DISPC_IRQ_ACBIAS_COUNT_STAT3 (1 << 29)
54#define DISPC_IRQ_SYNC_LOST3 (1 << 29) 54#define DISPC_IRQ_FRAMEDONE3 (1 << 30)
55 55
56struct omap_dss_device; 56struct omap_dss_device;
57struct omap_overlay_manager; 57struct omap_overlay_manager;
@@ -73,6 +73,7 @@ enum omap_plane {
73 OMAP_DSS_VIDEO1 = 1, 73 OMAP_DSS_VIDEO1 = 1,
74 OMAP_DSS_VIDEO2 = 2, 74 OMAP_DSS_VIDEO2 = 2,
75 OMAP_DSS_VIDEO3 = 3, 75 OMAP_DSS_VIDEO3 = 3,
76 OMAP_DSS_WB = 4,
76}; 77};
77 78
78enum omap_channel { 79enum omap_channel {
@@ -186,6 +187,8 @@ enum omap_overlay_caps {
186 OMAP_DSS_OVL_CAP_GLOBAL_ALPHA = 1 << 1, 187 OMAP_DSS_OVL_CAP_GLOBAL_ALPHA = 1 << 1,
187 OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA = 1 << 2, 188 OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA = 1 << 2,
188 OMAP_DSS_OVL_CAP_ZORDER = 1 << 3, 189 OMAP_DSS_OVL_CAP_ZORDER = 1 << 3,
190 OMAP_DSS_OVL_CAP_POS = 1 << 4,
191 OMAP_DSS_OVL_CAP_REPLICATION = 1 << 5,
189}; 192};
190 193
191enum omap_overlay_manager_caps { 194enum omap_overlay_manager_caps {
@@ -207,6 +210,16 @@ enum omap_hdmi_flags {
207 OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP = 1 << 0, 210 OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP = 1 << 0,
208}; 211};
209 212
213enum omap_dss_output_id {
214 OMAP_DSS_OUTPUT_DPI = 1 << 0,
215 OMAP_DSS_OUTPUT_DBI = 1 << 1,
216 OMAP_DSS_OUTPUT_SDI = 1 << 2,
217 OMAP_DSS_OUTPUT_DSI1 = 1 << 3,
218 OMAP_DSS_OUTPUT_DSI2 = 1 << 4,
219 OMAP_DSS_OUTPUT_VENC = 1 << 5,
220 OMAP_DSS_OUTPUT_HDMI = 1 << 6,
221};
222
210/* RFBI */ 223/* RFBI */
211 224
212struct rfbi_timings { 225struct rfbi_timings {
@@ -243,7 +256,7 @@ void rfbi_bus_unlock(void);
243 256
244/* DSI */ 257/* DSI */
245 258
246struct omap_dss_dsi_videomode_data { 259struct omap_dss_dsi_videomode_timings {
247 /* DSI video mode blanking data */ 260 /* DSI video mode blanking data */
248 /* Unit: byte clock cycles */ 261 /* Unit: byte clock cycles */
249 u16 hsa; 262 u16 hsa;
@@ -424,6 +437,8 @@ struct omap_overlay {
424 struct omap_overlay_info *info); 437 struct omap_overlay_info *info);
425 438
426 int (*wait_for_go)(struct omap_overlay *ovl); 439 int (*wait_for_go)(struct omap_overlay *ovl);
440
441 struct omap_dss_device *(*get_device)(struct omap_overlay *ovl);
427}; 442};
428 443
429struct omap_overlay_manager_info { 444struct omap_overlay_manager_info {
@@ -448,9 +463,10 @@ struct omap_overlay_manager {
448 enum omap_overlay_manager_caps caps; 463 enum omap_overlay_manager_caps caps;
449 struct list_head overlays; 464 struct list_head overlays;
450 enum omap_display_type supported_displays; 465 enum omap_display_type supported_displays;
466 enum omap_dss_output_id supported_outputs;
451 467
452 /* dynamic fields */ 468 /* dynamic fields */
453 struct omap_dss_device *device; 469 struct omap_dss_output *output;
454 470
455 /* 471 /*
456 * The following functions do not block: 472 * The following functions do not block:
@@ -463,9 +479,9 @@ struct omap_overlay_manager {
463 * interrupt context 479 * interrupt context
464 */ 480 */
465 481
466 int (*set_device)(struct omap_overlay_manager *mgr, 482 int (*set_output)(struct omap_overlay_manager *mgr,
467 struct omap_dss_device *dssdev); 483 struct omap_dss_output *output);
468 int (*unset_device)(struct omap_overlay_manager *mgr); 484 int (*unset_output)(struct omap_overlay_manager *mgr);
469 485
470 int (*set_manager_info)(struct omap_overlay_manager *mgr, 486 int (*set_manager_info)(struct omap_overlay_manager *mgr,
471 struct omap_overlay_manager_info *info); 487 struct omap_overlay_manager_info *info);
@@ -475,6 +491,8 @@ struct omap_overlay_manager {
475 int (*apply)(struct omap_overlay_manager *mgr); 491 int (*apply)(struct omap_overlay_manager *mgr);
476 int (*wait_for_go)(struct omap_overlay_manager *mgr); 492 int (*wait_for_go)(struct omap_overlay_manager *mgr);
477 int (*wait_for_vsync)(struct omap_overlay_manager *mgr); 493 int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
494
495 struct omap_dss_device *(*get_device)(struct omap_overlay_manager *mgr);
478}; 496};
479 497
480/* 22 pins means 1 clk lane and 10 data lanes */ 498/* 22 pins means 1 clk lane and 10 data lanes */
@@ -492,6 +510,37 @@ struct omap_dsi_pin_config {
492 int pins[OMAP_DSS_MAX_DSI_PINS]; 510 int pins[OMAP_DSS_MAX_DSI_PINS];
493}; 511};
494 512
513struct omap_dss_writeback_info {
514 u32 paddr;
515 u32 p_uv_addr;
516 u16 buf_width;
517 u16 width;
518 u16 height;
519 enum omap_color_mode color_mode;
520 u8 rotation;
521 enum omap_dss_rotation_type rotation_type;
522 bool mirror;
523 u8 pre_mult_alpha;
524};
525
526struct omap_dss_output {
527 struct list_head list;
528
529 /* display type supported by the output */
530 enum omap_display_type type;
531
532 /* output instance */
533 enum omap_dss_output_id id;
534
535 /* output's platform device pointer */
536 struct platform_device *pdev;
537
538 /* dynamic fields */
539 struct omap_overlay_manager *manager;
540
541 struct omap_dss_device *device;
542};
543
495struct omap_dss_device { 544struct omap_dss_device {
496 struct device dev; 545 struct device dev;
497 546
@@ -564,7 +613,7 @@ struct omap_dss_device {
564 613
565 enum omap_dss_dsi_pixel_format dsi_pix_fmt; 614 enum omap_dss_dsi_pixel_format dsi_pix_fmt;
566 enum omap_dss_dsi_mode dsi_mode; 615 enum omap_dss_dsi_mode dsi_mode;
567 struct omap_dss_dsi_videomode_data dsi_vm_data; 616 struct omap_dss_dsi_videomode_timings dsi_vm_timings;
568 } panel; 617 } panel;
569 618
570 struct { 619 struct {
@@ -590,7 +639,7 @@ struct omap_dss_device {
590 639
591 enum omap_display_caps caps; 640 enum omap_display_caps caps;
592 641
593 struct omap_overlay_manager *manager; 642 struct omap_dss_output *output;
594 643
595 enum omap_dss_display_state state; 644 enum omap_dss_display_state state;
596 645
@@ -605,6 +654,8 @@ struct omap_dss_device {
605 654
606struct omap_dss_hdmi_data 655struct omap_dss_hdmi_data
607{ 656{
657 int ct_cp_hpd_gpio;
658 int ls_oe_gpio;
608 int hpd_gpio; 659 int hpd_gpio;
609}; 660};
610 661
@@ -699,6 +750,11 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
699int omap_dss_get_num_overlays(void); 750int omap_dss_get_num_overlays(void);
700struct omap_overlay *omap_dss_get_overlay(int num); 751struct omap_overlay *omap_dss_get_overlay(int num);
701 752
753struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id);
754int omapdss_output_set_device(struct omap_dss_output *out,
755 struct omap_dss_device *dssdev);
756int omapdss_output_unset_device(struct omap_dss_output *out);
757
702void omapdss_default_get_resolution(struct omap_dss_device *dssdev, 758void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
703 u16 *xres, u16 *yres); 759 u16 *xres, u16 *yres);
704int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev); 760int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
@@ -719,6 +775,15 @@ int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
719void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, 775void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
720 bool enable); 776 bool enable);
721int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable); 777int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);
778void omapdss_dsi_set_timings(struct omap_dss_device *dssdev,
779 struct omap_video_timings *timings);
780void omapdss_dsi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h);
781void omapdss_dsi_set_pixel_format(struct omap_dss_device *dssdev,
782 enum omap_dss_dsi_pixel_format fmt);
783void omapdss_dsi_set_operation_mode(struct omap_dss_device *dssdev,
784 enum omap_dss_dsi_mode mode);
785void omapdss_dsi_set_videomode_timings(struct omap_dss_device *dssdev,
786 struct omap_dss_dsi_videomode_timings *timings);
722 787
723int omap_dsi_update(struct omap_dss_device *dssdev, int channel, 788int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
724 void (*callback)(int, void *), void *data); 789 void (*callback)(int, void *), void *data);
@@ -727,6 +792,8 @@ int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id);
727void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel); 792void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel);
728int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev, 793int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev,
729 const struct omap_dsi_pin_config *pin_cfg); 794 const struct omap_dsi_pin_config *pin_cfg);
795int omapdss_dsi_set_clocks(struct omap_dss_device *dssdev,
796 unsigned long ddr_clk, unsigned long lp_clk);
730 797
731int omapdss_dsi_display_enable(struct omap_dss_device *dssdev); 798int omapdss_dsi_display_enable(struct omap_dss_device *dssdev);
732void omapdss_dsi_display_disable(struct omap_dss_device *dssdev, 799void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
@@ -734,22 +801,29 @@ void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
734 801
735int omapdss_dpi_display_enable(struct omap_dss_device *dssdev); 802int omapdss_dpi_display_enable(struct omap_dss_device *dssdev);
736void omapdss_dpi_display_disable(struct omap_dss_device *dssdev); 803void omapdss_dpi_display_disable(struct omap_dss_device *dssdev);
737void dpi_set_timings(struct omap_dss_device *dssdev, 804void omapdss_dpi_set_timings(struct omap_dss_device *dssdev,
738 struct omap_video_timings *timings); 805 struct omap_video_timings *timings);
739int dpi_check_timings(struct omap_dss_device *dssdev, 806int dpi_check_timings(struct omap_dss_device *dssdev,
740 struct omap_video_timings *timings); 807 struct omap_video_timings *timings);
808void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines);
741 809
742int omapdss_sdi_display_enable(struct omap_dss_device *dssdev); 810int omapdss_sdi_display_enable(struct omap_dss_device *dssdev);
743void omapdss_sdi_display_disable(struct omap_dss_device *dssdev); 811void omapdss_sdi_display_disable(struct omap_dss_device *dssdev);
812void omapdss_sdi_set_timings(struct omap_dss_device *dssdev,
813 struct omap_video_timings *timings);
814void omapdss_sdi_set_datapairs(struct omap_dss_device *dssdev, int datapairs);
744 815
745int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev); 816int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev);
746void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev); 817void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev);
747int omap_rfbi_prepare_update(struct omap_dss_device *dssdev, 818int omap_rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *),
748 u16 *x, u16 *y, u16 *w, u16 *h); 819 void *data);
749int omap_rfbi_update(struct omap_dss_device *dssdev, 820int omap_rfbi_configure(struct omap_dss_device *dssdev);
750 u16 x, u16 y, u16 w, u16 h, 821void omapdss_rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h);
751 void (*callback)(void *), void *data); 822void omapdss_rfbi_set_pixel_size(struct omap_dss_device *dssdev,
752int omap_rfbi_configure(struct omap_dss_device *dssdev, int pixel_size, 823 int pixel_size);
824void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev,
753 int data_lines); 825 int data_lines);
826void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev,
827 struct rfbi_timings *timings);
754 828
755#endif 829#endif
diff --git a/include/video/samsung_fimd.h b/include/video/samsung_fimd.h
new file mode 100644
index 000000000000..7ae6c07f2ef8
--- /dev/null
+++ b/include/video/samsung_fimd.h
@@ -0,0 +1,533 @@
1/* include/video/samsung_fimd.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C Platform - new-style fimd and framebuffer register definitions
9 *
10 * This is the register set for the fimd and new style framebuffer interface
11 * found from the S3C2443 onwards into the S3C2416, S3C2450 and the
12 * S3C64XX series such as the S3C6400 and S3C6410.
13 *
14 * The file does not contain the cpu specific items which are based on
15 * whichever architecture is selected, it only contains the core of the
16 * register set. See <mach/regs-fb.h> to get the specifics.
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License version 2 as
20 * published by the Free Software Foundation.
21*/
22
23/* VIDCON0 */
24
25#define VIDCON0 (0x00)
26#define VIDCON0_INTERLACE (1 << 29)
27#define VIDCON0_VIDOUT_MASK (0x3 << 26)
28#define VIDCON0_VIDOUT_SHIFT (26)
29#define VIDCON0_VIDOUT_RGB (0x0 << 26)
30#define VIDCON0_VIDOUT_TV (0x1 << 26)
31#define VIDCON0_VIDOUT_I80_LDI0 (0x2 << 26)
32#define VIDCON0_VIDOUT_I80_LDI1 (0x3 << 26)
33
34#define VIDCON0_L1_DATA_MASK (0x7 << 23)
35#define VIDCON0_L1_DATA_SHIFT (23)
36#define VIDCON0_L1_DATA_16BPP (0x0 << 23)
37#define VIDCON0_L1_DATA_18BPP16 (0x1 << 23)
38#define VIDCON0_L1_DATA_18BPP9 (0x2 << 23)
39#define VIDCON0_L1_DATA_24BPP (0x3 << 23)
40#define VIDCON0_L1_DATA_18BPP (0x4 << 23)
41#define VIDCON0_L1_DATA_16BPP8 (0x5 << 23)
42
43#define VIDCON0_L0_DATA_MASK (0x7 << 20)
44#define VIDCON0_L0_DATA_SHIFT (20)
45#define VIDCON0_L0_DATA_16BPP (0x0 << 20)
46#define VIDCON0_L0_DATA_18BPP16 (0x1 << 20)
47#define VIDCON0_L0_DATA_18BPP9 (0x2 << 20)
48#define VIDCON0_L0_DATA_24BPP (0x3 << 20)
49#define VIDCON0_L0_DATA_18BPP (0x4 << 20)
50#define VIDCON0_L0_DATA_16BPP8 (0x5 << 20)
51
52#define VIDCON0_PNRMODE_MASK (0x3 << 17)
53#define VIDCON0_PNRMODE_SHIFT (17)
54#define VIDCON0_PNRMODE_RGB (0x0 << 17)
55#define VIDCON0_PNRMODE_BGR (0x1 << 17)
56#define VIDCON0_PNRMODE_SERIAL_RGB (0x2 << 17)
57#define VIDCON0_PNRMODE_SERIAL_BGR (0x3 << 17)
58
59#define VIDCON0_CLKVALUP (1 << 16)
60#define VIDCON0_CLKVAL_F_MASK (0xff << 6)
61#define VIDCON0_CLKVAL_F_SHIFT (6)
62#define VIDCON0_CLKVAL_F_LIMIT (0xff)
63#define VIDCON0_CLKVAL_F(_x) ((_x) << 6)
64#define VIDCON0_VLCKFREE (1 << 5)
65#define VIDCON0_CLKDIR (1 << 4)
66
67#define VIDCON0_CLKSEL_MASK (0x3 << 2)
68#define VIDCON0_CLKSEL_SHIFT (2)
69#define VIDCON0_CLKSEL_HCLK (0x0 << 2)
70#define VIDCON0_CLKSEL_LCD (0x1 << 2)
71#define VIDCON0_CLKSEL_27M (0x3 << 2)
72
73#define VIDCON0_ENVID (1 << 1)
74#define VIDCON0_ENVID_F (1 << 0)
75
76#define VIDCON1 (0x04)
77#define VIDCON1_LINECNT_MASK (0x7ff << 16)
78#define VIDCON1_LINECNT_SHIFT (16)
79#define VIDCON1_LINECNT_GET(_v) (((_v) >> 16) & 0x7ff)
80#define VIDCON1_VSTATUS_MASK (0x3 << 13)
81#define VIDCON1_VSTATUS_SHIFT (13)
82#define VIDCON1_VSTATUS_VSYNC (0x0 << 13)
83#define VIDCON1_VSTATUS_BACKPORCH (0x1 << 13)
84#define VIDCON1_VSTATUS_ACTIVE (0x2 << 13)
85#define VIDCON1_VSTATUS_FRONTPORCH (0x0 << 13)
86#define VIDCON1_VCLK_MASK (0x3 << 9)
87#define VIDCON1_VCLK_HOLD (0x0 << 9)
88#define VIDCON1_VCLK_RUN (0x1 << 9)
89
90#define VIDCON1_INV_VCLK (1 << 7)
91#define VIDCON1_INV_HSYNC (1 << 6)
92#define VIDCON1_INV_VSYNC (1 << 5)
93#define VIDCON1_INV_VDEN (1 << 4)
94
95/* VIDCON2 */
96
97#define VIDCON2 (0x08)
98#define VIDCON2_EN601 (1 << 23)
99#define VIDCON2_TVFMTSEL_SW (1 << 14)
100
101#define VIDCON2_TVFMTSEL1_MASK (0x3 << 12)
102#define VIDCON2_TVFMTSEL1_SHIFT (12)
103#define VIDCON2_TVFMTSEL1_RGB (0x0 << 12)
104#define VIDCON2_TVFMTSEL1_YUV422 (0x1 << 12)
105#define VIDCON2_TVFMTSEL1_YUV444 (0x2 << 12)
106
107#define VIDCON2_ORGYCbCr (1 << 8)
108#define VIDCON2_YUVORDCrCb (1 << 7)
109
110/* PRTCON (S3C6410, S5PC100)
111 * Might not be present in the S3C6410 documentation,
112 * but tests prove it's there almost for sure; shouldn't hurt in any case.
113 */
114#define PRTCON (0x0c)
115#define PRTCON_PROTECT (1 << 11)
116
117/* VIDTCON0 */
118
119#define VIDTCON0_VBPDE_MASK (0xff << 24)
120#define VIDTCON0_VBPDE_SHIFT (24)
121#define VIDTCON0_VBPDE_LIMIT (0xff)
122#define VIDTCON0_VBPDE(_x) ((_x) << 24)
123
124#define VIDTCON0_VBPD_MASK (0xff << 16)
125#define VIDTCON0_VBPD_SHIFT (16)
126#define VIDTCON0_VBPD_LIMIT (0xff)
127#define VIDTCON0_VBPD(_x) ((_x) << 16)
128
129#define VIDTCON0_VFPD_MASK (0xff << 8)
130#define VIDTCON0_VFPD_SHIFT (8)
131#define VIDTCON0_VFPD_LIMIT (0xff)
132#define VIDTCON0_VFPD(_x) ((_x) << 8)
133
134#define VIDTCON0_VSPW_MASK (0xff << 0)
135#define VIDTCON0_VSPW_SHIFT (0)
136#define VIDTCON0_VSPW_LIMIT (0xff)
137#define VIDTCON0_VSPW(_x) ((_x) << 0)
138
139/* VIDTCON1 */
140
141#define VIDTCON1_VFPDE_MASK (0xff << 24)
142#define VIDTCON1_VFPDE_SHIFT (24)
143#define VIDTCON1_VFPDE_LIMIT (0xff)
144#define VIDTCON1_VFPDE(_x) ((_x) << 24)
145
146#define VIDTCON1_HBPD_MASK (0xff << 16)
147#define VIDTCON1_HBPD_SHIFT (16)
148#define VIDTCON1_HBPD_LIMIT (0xff)
149#define VIDTCON1_HBPD(_x) ((_x) << 16)
150
151#define VIDTCON1_HFPD_MASK (0xff << 8)
152#define VIDTCON1_HFPD_SHIFT (8)
153#define VIDTCON1_HFPD_LIMIT (0xff)
154#define VIDTCON1_HFPD(_x) ((_x) << 8)
155
156#define VIDTCON1_HSPW_MASK (0xff << 0)
157#define VIDTCON1_HSPW_SHIFT (0)
158#define VIDTCON1_HSPW_LIMIT (0xff)
159#define VIDTCON1_HSPW(_x) ((_x) << 0)
160
161#define VIDTCON2 (0x18)
162#define VIDTCON2_LINEVAL_E(_x) ((((_x) & 0x800) >> 11) << 23)
163#define VIDTCON2_LINEVAL_MASK (0x7ff << 11)
164#define VIDTCON2_LINEVAL_SHIFT (11)
165#define VIDTCON2_LINEVAL_LIMIT (0x7ff)
166#define VIDTCON2_LINEVAL(_x) (((_x) & 0x7ff) << 11)
167
168#define VIDTCON2_HOZVAL_E(_x) ((((_x) & 0x800) >> 11) << 22)
169#define VIDTCON2_HOZVAL_MASK (0x7ff << 0)
170#define VIDTCON2_HOZVAL_SHIFT (0)
171#define VIDTCON2_HOZVAL_LIMIT (0x7ff)
172#define VIDTCON2_HOZVAL(_x) (((_x) & 0x7ff) << 0)
173
174/* WINCONx */
175
176
177#define WINCONx_BITSWP (1 << 18)
178#define WINCONx_BYTSWP (1 << 17)
179#define WINCONx_HAWSWP (1 << 16)
180#define WINCONx_WSWP (1 << 15)
181#define WINCONx_BURSTLEN_MASK (0x3 << 9)
182#define WINCONx_BURSTLEN_SHIFT (9)
183#define WINCONx_BURSTLEN_16WORD (0x0 << 9)
184#define WINCONx_BURSTLEN_8WORD (0x1 << 9)
185#define WINCONx_BURSTLEN_4WORD (0x2 << 9)
186
187#define WINCONx_ENWIN (1 << 0)
188#define WINCON0_BPPMODE_MASK (0xf << 2)
189#define WINCON0_BPPMODE_SHIFT (2)
190#define WINCON0_BPPMODE_1BPP (0x0 << 2)
191#define WINCON0_BPPMODE_2BPP (0x1 << 2)
192#define WINCON0_BPPMODE_4BPP (0x2 << 2)
193#define WINCON0_BPPMODE_8BPP_PALETTE (0x3 << 2)
194#define WINCON0_BPPMODE_16BPP_565 (0x5 << 2)
195#define WINCON0_BPPMODE_16BPP_1555 (0x7 << 2)
196#define WINCON0_BPPMODE_18BPP_666 (0x8 << 2)
197#define WINCON0_BPPMODE_24BPP_888 (0xb << 2)
198
199#define WINCON1_BLD_PIX (1 << 6)
200
201#define WINCON1_ALPHA_SEL (1 << 1)
202#define WINCON1_BPPMODE_MASK (0xf << 2)
203#define WINCON1_BPPMODE_SHIFT (2)
204#define WINCON1_BPPMODE_1BPP (0x0 << 2)
205#define WINCON1_BPPMODE_2BPP (0x1 << 2)
206#define WINCON1_BPPMODE_4BPP (0x2 << 2)
207#define WINCON1_BPPMODE_8BPP_PALETTE (0x3 << 2)
208#define WINCON1_BPPMODE_8BPP_1232 (0x4 << 2)
209#define WINCON1_BPPMODE_16BPP_565 (0x5 << 2)
210#define WINCON1_BPPMODE_16BPP_A1555 (0x6 << 2)
211#define WINCON1_BPPMODE_16BPP_I1555 (0x7 << 2)
212#define WINCON1_BPPMODE_18BPP_666 (0x8 << 2)
213#define WINCON1_BPPMODE_18BPP_A1665 (0x9 << 2)
214#define WINCON1_BPPMODE_19BPP_A1666 (0xa << 2)
215#define WINCON1_BPPMODE_24BPP_888 (0xb << 2)
216#define WINCON1_BPPMODE_24BPP_A1887 (0xc << 2)
217#define WINCON1_BPPMODE_25BPP_A1888 (0xd << 2)
218#define WINCON1_BPPMODE_28BPP_A4888 (0xd << 2)
219
220/* S5PV210 */
221#define SHADOWCON (0x34)
222#define SHADOWCON_WINx_PROTECT(_win) (1 << (10 + (_win)))
223/* DMA channels (all windows) */
224#define SHADOWCON_CHx_ENABLE(_win) (1 << (_win))
225/* Local input channels (windows 0-2) */
226#define SHADOWCON_CHx_LOCAL_ENABLE(_win) (1 << (5 + (_win)))
227
228#define VIDOSDxA_TOPLEFT_X_E(_x) ((((_x) & 0x800) >> 11) << 23)
229#define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11)
230#define VIDOSDxA_TOPLEFT_X_SHIFT (11)
231#define VIDOSDxA_TOPLEFT_X_LIMIT (0x7ff)
232#define VIDOSDxA_TOPLEFT_X(_x) (((_x) & 0x7ff) << 11)
233
234#define VIDOSDxA_TOPLEFT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22)
235#define VIDOSDxA_TOPLEFT_Y_MASK (0x7ff << 0)
236#define VIDOSDxA_TOPLEFT_Y_SHIFT (0)
237#define VIDOSDxA_TOPLEFT_Y_LIMIT (0x7ff)
238#define VIDOSDxA_TOPLEFT_Y(_x) (((_x) & 0x7ff) << 0)
239
240#define VIDOSDxB_BOTRIGHT_X_E(_x) ((((_x) & 0x800) >> 11) << 23)
241#define VIDOSDxB_BOTRIGHT_X_MASK (0x7ff << 11)
242#define VIDOSDxB_BOTRIGHT_X_SHIFT (11)
243#define VIDOSDxB_BOTRIGHT_X_LIMIT (0x7ff)
244#define VIDOSDxB_BOTRIGHT_X(_x) (((_x) & 0x7ff) << 11)
245
246#define VIDOSDxB_BOTRIGHT_Y_E(_x) ((((_x) & 0x800) >> 11) << 22)
247#define VIDOSDxB_BOTRIGHT_Y_MASK (0x7ff << 0)
248#define VIDOSDxB_BOTRIGHT_Y_SHIFT (0)
249#define VIDOSDxB_BOTRIGHT_Y_LIMIT (0x7ff)
250#define VIDOSDxB_BOTRIGHT_Y(_x) (((_x) & 0x7ff) << 0)
251
252/* For VIDOSD[1..4]C */
253#define VIDISD14C_ALPHA0_R(_x) ((_x) << 20)
254#define VIDISD14C_ALPHA0_G_MASK (0xf << 16)
255#define VIDISD14C_ALPHA0_G_SHIFT (16)
256#define VIDISD14C_ALPHA0_G_LIMIT (0xf)
257#define VIDISD14C_ALPHA0_G(_x) ((_x) << 16)
258#define VIDISD14C_ALPHA0_B_MASK (0xf << 12)
259#define VIDISD14C_ALPHA0_B_SHIFT (12)
260#define VIDISD14C_ALPHA0_B_LIMIT (0xf)
261#define VIDISD14C_ALPHA0_B(_x) ((_x) << 12)
262#define VIDISD14C_ALPHA1_R_MASK (0xf << 8)
263#define VIDISD14C_ALPHA1_R_SHIFT (8)
264#define VIDISD14C_ALPHA1_R_LIMIT (0xf)
265#define VIDISD14C_ALPHA1_R(_x) ((_x) << 8)
266#define VIDISD14C_ALPHA1_G_MASK (0xf << 4)
267#define VIDISD14C_ALPHA1_G_SHIFT (4)
268#define VIDISD14C_ALPHA1_G_LIMIT (0xf)
269#define VIDISD14C_ALPHA1_G(_x) ((_x) << 4)
270#define VIDISD14C_ALPHA1_B_MASK (0xf << 0)
271#define VIDISD14C_ALPHA1_B_SHIFT (0)
272#define VIDISD14C_ALPHA1_B_LIMIT (0xf)
273#define VIDISD14C_ALPHA1_B(_x) ((_x) << 0)
274
275/* Video buffer addresses */
276#define VIDW_BUF_START(_buff) (0xA0 + ((_buff) * 8))
277#define VIDW_BUF_START1(_buff) (0xA4 + ((_buff) * 8))
278#define VIDW_BUF_END(_buff) (0xD0 + ((_buff) * 8))
279#define VIDW_BUF_END1(_buff) (0xD4 + ((_buff) * 8))
280#define VIDW_BUF_SIZE(_buff) (0x100 + ((_buff) * 4))
281
282#define VIDW_BUF_SIZE_OFFSET_E(_x) ((((_x) & 0x2000) >> 13) << 27)
283#define VIDW_BUF_SIZE_OFFSET_MASK (0x1fff << 13)
284#define VIDW_BUF_SIZE_OFFSET_SHIFT (13)
285#define VIDW_BUF_SIZE_OFFSET_LIMIT (0x1fff)
286#define VIDW_BUF_SIZE_OFFSET(_x) (((_x) & 0x1fff) << 13)
287
288#define VIDW_BUF_SIZE_PAGEWIDTH_E(_x) ((((_x) & 0x2000) >> 13) << 26)
289#define VIDW_BUF_SIZE_PAGEWIDTH_MASK (0x1fff << 0)
290#define VIDW_BUF_SIZE_PAGEWIDTH_SHIFT (0)
291#define VIDW_BUF_SIZE_PAGEWIDTH_LIMIT (0x1fff)
292#define VIDW_BUF_SIZE_PAGEWIDTH(_x) (((_x) & 0x1fff) << 0)
293
294/* Interrupt controls and status */
295
296#define VIDINTCON0_FIFOINTERVAL_MASK (0x3f << 20)
297#define VIDINTCON0_FIFOINTERVAL_SHIFT (20)
298#define VIDINTCON0_FIFOINTERVAL_LIMIT (0x3f)
299#define VIDINTCON0_FIFOINTERVAL(_x) ((_x) << 20)
300
301#define VIDINTCON0_INT_SYSMAINCON (1 << 19)
302#define VIDINTCON0_INT_SYSSUBCON (1 << 18)
303#define VIDINTCON0_INT_I80IFDONE (1 << 17)
304
305#define VIDINTCON0_FRAMESEL0_MASK (0x3 << 15)
306#define VIDINTCON0_FRAMESEL0_SHIFT (15)
307#define VIDINTCON0_FRAMESEL0_BACKPORCH (0x0 << 15)
308#define VIDINTCON0_FRAMESEL0_VSYNC (0x1 << 15)
309#define VIDINTCON0_FRAMESEL0_ACTIVE (0x2 << 15)
310#define VIDINTCON0_FRAMESEL0_FRONTPORCH (0x3 << 15)
311
312#define VIDINTCON0_FRAMESEL1 (1 << 13)
313#define VIDINTCON0_FRAMESEL1_MASK (0x3 << 13)
314#define VIDINTCON0_FRAMESEL1_NONE (0x0 << 13)
315#define VIDINTCON0_FRAMESEL1_BACKPORCH (0x1 << 13)
316#define VIDINTCON0_FRAMESEL1_VSYNC (0x2 << 13)
317#define VIDINTCON0_FRAMESEL1_FRONTPORCH (0x3 << 13)
318
319#define VIDINTCON0_INT_FRAME (1 << 12)
320#define VIDINTCON0_FIFIOSEL_MASK (0x7f << 5)
321#define VIDINTCON0_FIFIOSEL_SHIFT (5)
322#define VIDINTCON0_FIFIOSEL_WINDOW0 (0x1 << 5)
323#define VIDINTCON0_FIFIOSEL_WINDOW1 (0x2 << 5)
324
325#define VIDINTCON0_FIFOLEVEL_MASK (0x7 << 2)
326#define VIDINTCON0_FIFOLEVEL_SHIFT (2)
327#define VIDINTCON0_FIFOLEVEL_TO25PC (0x0 << 2)
328#define VIDINTCON0_FIFOLEVEL_TO50PC (0x1 << 2)
329#define VIDINTCON0_FIFOLEVEL_TO75PC (0x2 << 2)
330#define VIDINTCON0_FIFOLEVEL_EMPTY (0x3 << 2)
331#define VIDINTCON0_FIFOLEVEL_FULL (0x4 << 2)
332
333#define VIDINTCON0_INT_FIFO_MASK (0x3 << 0)
334#define VIDINTCON0_INT_FIFO_SHIFT (0)
335#define VIDINTCON0_INT_ENABLE (1 << 0)
336
337#define VIDINTCON1 (0x134)
338#define VIDINTCON1_INT_I180 (1 << 2)
339#define VIDINTCON1_INT_FRAME (1 << 1)
340#define VIDINTCON1_INT_FIFO (1 << 0)
341
342/* Window colour-key control registers */
343#define WKEYCON (0x140) /* 6410,V210 */
344
345#define WKEYCON0 (0x00)
346#define WKEYCON1 (0x04)
347
348#define WxKEYCON0_KEYBL_EN (1 << 26)
349#define WxKEYCON0_KEYEN_F (1 << 25)
350#define WxKEYCON0_DIRCON (1 << 24)
351#define WxKEYCON0_COMPKEY_MASK (0xffffff << 0)
352#define WxKEYCON0_COMPKEY_SHIFT (0)
353#define WxKEYCON0_COMPKEY_LIMIT (0xffffff)
354#define WxKEYCON0_COMPKEY(_x) ((_x) << 0)
355#define WxKEYCON1_COLVAL_MASK (0xffffff << 0)
356#define WxKEYCON1_COLVAL_SHIFT (0)
357#define WxKEYCON1_COLVAL_LIMIT (0xffffff)
358#define WxKEYCON1_COLVAL(_x) ((_x) << 0)
359
360
361/* Window blanking (MAP) */
362
363#define WINxMAP_MAP (1 << 24)
364#define WINxMAP_MAP_COLOUR_MASK (0xffffff << 0)
365#define WINxMAP_MAP_COLOUR_SHIFT (0)
366#define WINxMAP_MAP_COLOUR_LIMIT (0xffffff)
367#define WINxMAP_MAP_COLOUR(_x) ((_x) << 0)
368
369#define WPALCON_PAL_UPDATE (1 << 9)
370#define WPALCON_W1PAL_MASK (0x7 << 3)
371#define WPALCON_W1PAL_SHIFT (3)
372#define WPALCON_W1PAL_25BPP_A888 (0x0 << 3)
373#define WPALCON_W1PAL_24BPP (0x1 << 3)
374#define WPALCON_W1PAL_19BPP_A666 (0x2 << 3)
375#define WPALCON_W1PAL_18BPP_A665 (0x3 << 3)
376#define WPALCON_W1PAL_18BPP (0x4 << 3)
377#define WPALCON_W1PAL_16BPP_A555 (0x5 << 3)
378#define WPALCON_W1PAL_16BPP_565 (0x6 << 3)
379
380#define WPALCON_W0PAL_MASK (0x7 << 0)
381#define WPALCON_W0PAL_SHIFT (0)
382#define WPALCON_W0PAL_25BPP_A888 (0x0 << 0)
383#define WPALCON_W0PAL_24BPP (0x1 << 0)
384#define WPALCON_W0PAL_19BPP_A666 (0x2 << 0)
385#define WPALCON_W0PAL_18BPP_A665 (0x3 << 0)
386#define WPALCON_W0PAL_18BPP (0x4 << 0)
387#define WPALCON_W0PAL_16BPP_A555 (0x5 << 0)
388#define WPALCON_W0PAL_16BPP_565 (0x6 << 0)
389
390/* Blending equation control */
391#define BLENDCON (0x260)
392#define BLENDCON_NEW_MASK (1 << 0)
393#define BLENDCON_NEW_8BIT_ALPHA_VALUE (1 << 0)
394#define BLENDCON_NEW_4BIT_ALPHA_VALUE (0 << 0)
395
396#define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */
397#define VIDCON1_FSTATUS_EVEN (1 << 15)
398
399/* Video timing controls */
400#define VIDTCON0 (0x10)
401#define VIDTCON1 (0x14)
402#define VIDTCON2 (0x18)
403
404/* Window position controls */
405
406#define WINCON(_win) (0x20 + ((_win) * 4))
407
408/* OSD1 and OSD4 do not have register D */
409
410#define VIDOSD_BASE (0x40)
411
412#define VIDINTCON0 (0x130)
413
414/* WINCONx */
415
416#define WINCONx_CSCWIDTH_MASK (0x3 << 26)
417#define WINCONx_CSCWIDTH_SHIFT (26)
418#define WINCONx_CSCWIDTH_WIDE (0x0 << 26)
419#define WINCONx_CSCWIDTH_NARROW (0x3 << 26)
420
421#define WINCONx_ENLOCAL (1 << 22)
422#define WINCONx_BUFSTATUS (1 << 21)
423#define WINCONx_BUFSEL (1 << 20)
424#define WINCONx_BUFAUTOEN (1 << 19)
425#define WINCONx_YCbCr (1 << 13)
426
427#define WINCON1_LOCALSEL_CAMIF (1 << 23)
428
429#define WINCON2_LOCALSEL_CAMIF (1 << 23)
430#define WINCON2_BLD_PIX (1 << 6)
431
432#define WINCON2_ALPHA_SEL (1 << 1)
433#define WINCON2_BPPMODE_MASK (0xf << 2)
434#define WINCON2_BPPMODE_SHIFT (2)
435#define WINCON2_BPPMODE_1BPP (0x0 << 2)
436#define WINCON2_BPPMODE_2BPP (0x1 << 2)
437#define WINCON2_BPPMODE_4BPP (0x2 << 2)
438#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2)
439#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2)
440#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2)
441#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2)
442#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2)
443#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2)
444#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2)
445#define WINCON2_BPPMODE_24BPP_888 (0xb << 2)
446#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2)
447#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2)
448#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2)
449
450#define WINCON3_BLD_PIX (1 << 6)
451
452#define WINCON3_ALPHA_SEL (1 << 1)
453#define WINCON3_BPPMODE_MASK (0xf << 2)
454#define WINCON3_BPPMODE_SHIFT (2)
455#define WINCON3_BPPMODE_1BPP (0x0 << 2)
456#define WINCON3_BPPMODE_2BPP (0x1 << 2)
457#define WINCON3_BPPMODE_4BPP (0x2 << 2)
458#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2)
459#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2)
460#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2)
461#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2)
462#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2)
463#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2)
464#define WINCON3_BPPMODE_24BPP_888 (0xb << 2)
465#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2)
466#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2)
467#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2)
468
469#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5)
470#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5)
471#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5)
472
473#define DITHMODE (0x170)
474#define WINxMAP(_win) (0x180 + ((_win) * 4))
475
476
477#define DITHMODE_R_POS_MASK (0x3 << 5)
478#define DITHMODE_R_POS_SHIFT (5)
479#define DITHMODE_R_POS_8BIT (0x0 << 5)
480#define DITHMODE_R_POS_6BIT (0x1 << 5)
481#define DITHMODE_R_POS_5BIT (0x2 << 5)
482
483#define DITHMODE_G_POS_MASK (0x3 << 3)
484#define DITHMODE_G_POS_SHIFT (3)
485#define DITHMODE_G_POS_8BIT (0x0 << 3)
486#define DITHMODE_G_POS_6BIT (0x1 << 3)
487#define DITHMODE_G_POS_5BIT (0x2 << 3)
488
489#define DITHMODE_B_POS_MASK (0x3 << 1)
490#define DITHMODE_B_POS_SHIFT (1)
491#define DITHMODE_B_POS_8BIT (0x0 << 1)
492#define DITHMODE_B_POS_6BIT (0x1 << 1)
493#define DITHMODE_B_POS_5BIT (0x2 << 1)
494
495#define DITHMODE_DITH_EN (1 << 0)
496
497#define WPALCON (0x1A0)
498
499/* Palette control */
500/* Note for S5PC100: you can still use those macros on WPALCON (aka WPALCON_L),
501 * but make sure that WPALCON_H W2PAL-W4PAL entries are zeroed out */
502#define WPALCON_W4PAL_16BPP_A555 (1 << 8)
503#define WPALCON_W3PAL_16BPP_A555 (1 << 7)
504#define WPALCON_W2PAL_16BPP_A555 (1 << 6)
505
506
507/* Notes on per-window bpp settings
508 *
509 * Value Win0 Win1 Win2 Win3 Win 4
510 * 0000 1(P) 1(P) 1(P) 1(P) 1(P)
511 * 0001 2(P) 2(P) 2(P) 2(P) 2(P)
512 * 0010 4(P) 4(P) 4(P) 4(P) -none-
513 * 0011 8(P) 8(P) -none- -none- -none-
514 * 0100 -none- 8(A232) 8(A232) -none- -none-
515 * 0101 16(565) 16(565) 16(565) 16(565) 16(565)
516 * 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555)
517 * 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555)
518 * 1000 18(666) 18(666) 18(666) 18(666) 18(666)
519 * 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665)
520 * 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666)
521 * 1011 24(888) 24(888) 24(888) 24(888) 24(888)
522 * 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887)
523 * 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888)
524 * 1110 -none- -none- -none- -none- -none-
525 * 1111 -none- -none- -none- -none- -none-
526*/
527
528/* FIMD Version 8 register offset definitions */
529#define FIMD_V8_VIDTCON0 (0x20010)
530#define FIMD_V8_VIDTCON1 (0x20014)
531#define FIMD_V8_VIDTCON2 (0x20018)
532#define FIMD_V8_VIDTCON3 (0x2001C)
533#define FIMD_V8_VIDCON1 (0x20004)
diff --git a/include/xen/Kbuild b/include/xen/Kbuild
index 84ad8f02fee5..e69de29bb2d1 100644
--- a/include/xen/Kbuild
+++ b/include/xen/Kbuild
@@ -1,2 +0,0 @@
1header-y += evtchn.h
2header-y += privcmd.h
diff --git a/include/xen/interface/hvm/hvm_op.h b/include/xen/interface/hvm/hvm_op.h
index a4827f46ee97..956a04682865 100644
--- a/include/xen/interface/hvm/hvm_op.h
+++ b/include/xen/interface/hvm/hvm_op.h
@@ -43,4 +43,23 @@ struct xen_hvm_pagetable_dying {
43typedef struct xen_hvm_pagetable_dying xen_hvm_pagetable_dying_t; 43typedef struct xen_hvm_pagetable_dying xen_hvm_pagetable_dying_t;
44DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_pagetable_dying_t); 44DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_pagetable_dying_t);
45 45
46enum hvmmem_type_t {
47 HVMMEM_ram_rw, /* Normal read/write guest RAM */
48 HVMMEM_ram_ro, /* Read-only; writes are discarded */
49 HVMMEM_mmio_dm, /* Reads and write go to the device model */
50};
51
52#define HVMOP_get_mem_type 15
53/* Return hvmmem_type_t for the specified pfn. */
54struct xen_hvm_get_mem_type {
55 /* Domain to be queried. */
56 domid_t domid;
57 /* OUT variable. */
58 uint16_t mem_type;
59 uint16_t pad[2]; /* align next field on 8-byte boundary */
60 /* IN variable. */
61 uint64_t pfn;
62};
63DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_get_mem_type);
64
46#endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */ 65#endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */